@charset "utf-8";

.night-sky-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 190px;
    background-color: #15273f;
    z-index: 0;
    clip-path: url(#wave-clip);
    pointer-events: none;
}

.stars-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1.5px 1.5px at 25px 35px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 60px 85px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 110px 45px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2.5px 2.5px at 150px 95px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 190px 135px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 40px 10px, #fff, rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 220px 50px, #fff, rgba(0, 0, 0, 0));
    background-size: 250px 250px;
    opacity: 0.25;
    animation: sky-twinkle 5s ease-in-out infinite alternate;
}

@keyframes sky-twinkle {
    0% {
        opacity: 0.15;
    }

    100% {
        opacity: 0.45;
    }
}

.random-star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 16px rgba(255, 255, 255, 0.6);
}

@keyframes random-star-anim {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
    }

    100% {
        transform: scale(0.5);
        opacity: 0;
    }
}

.shooting-star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 6;
    box-shadow: 0 0 10px #fff, 0 0 20px #fff;
}

.shooting-star::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 2px;
    transform: translateY(-50%);
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), transparent);
}

@keyframes shooting-star-anim {
    0% {
        transform: rotate(-35deg) translateX(0) scale(0);
        opacity: 0;
    }

    10% {
        transform: rotate(-35deg) translateX(-35px) scale(1.2);
        opacity: 1;
    }

    20% {
        transform: rotate(-35deg) translateX(-70px) scale(1);
        opacity: 1;
    }

    80% {
        transform: rotate(-35deg) translateX(-280px) scale(1);
        opacity: 1;
    }

    100% {
        transform: rotate(-35deg) translateX(-350px) scale(0);
        opacity: 0;
    }
}

.daily-orbit-count {
    text-align: left;
    padding: 2px 60px 2px 5px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: bold;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.daily-orbit-count .count-num {
    color: #ffd700;
    font-size: 18px;
    margin: 0 3px;
    font-weight: 900;
}

.daily-orbit-count > span:not(.header-date) {
    font-size: clamp(10px, 3.5vw, 13px);
}

.day-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
    margin: -5px 0 -8px 0;
    width: 100%;
    position: relative;
    z-index: 20;
}

.nav-calendar-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 8px;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-calendar-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.nav-calendar-btn:hover {
    transform: scale(1.1);
}

.orbit-quote {
    text-align: left;
    padding: 3px 2px 10px 11px;
    font-size: 11px;
    color: #a39b93;
    line-height: 1.6;
    word-break: keep-all;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: -10px;
    z-index: 10;
    pointer-events: none;
}

.speech-bubble {
    position: relative;
    background: #ffffff;
    border-radius: 15px;
    padding: 15px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1.5px solid #eaddcf;
    z-index: 10;
    flex: 1;
    color: #6f461e;
    margin-top: -3px;
    height: 85px;
    display: flex;
    align-items: flex-start;
    pointer-events: auto;
}

.quote-mask {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
}

.quote-text {
    color: #6f461e !important;
    width: 100%;
}

.quote-text.short-text {
    height: 100%;
    display: flex;
    align-items: center;
}

.quote-text.scrolling {
    animation: quote-scroll var(--scroll-anim-dur, 10s) linear infinite;
}

@keyframes quote-scroll {
    0%, 15% { transform: translateY(0); }
    45%, 55% { transform: translateY(var(--scroll-dist)); }
    85%, 100% { transform: translateY(0); }
}

.speech-bubble::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 12px 6px 0;
    border-style: solid;
    border-color: transparent #eaddcf transparent transparent;
}

.speech-bubble::after {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 12px 6px 0;
    border-style: solid;
    border-color: transparent #ffffff transparent transparent;
}

.loading-text {
    animation: blink 1.5s infinite;
    color: #bfaea0;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.orbit-otomo-icon {
    position: relative;
    width: 115px;
    height: 115px;
    flex-shrink: 0;
    margin-top: 10px;
    margin-left: -25px;
    left: -3px;
    margin-right: -12px;
    animation: floating 3s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
    z-index: 30;
    pointer-events: auto;
    cursor: pointer;
}

.orbit-otomo-icon img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes floating {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.orbit-otomo-icon:hover {
    transform: translateY(-2px) scale(1.05);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

.header-icon-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.header-icon-btn:hover {
    transform: scale(1.1);
}

.header-date {
    font-size: clamp(10px, 3.5vw, 13px);
    margin-left: 2px;
}

.header-star-name {
    color: #ffd700;
    font-weight: 900;
    margin-left: 2px;
}

#diary-feed-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-top: 15px;
    padding-bottom: 40px;
    overscroll-behavior-y: contain;
    position: relative;
}

#diary-feed-container::-webkit-scrollbar {
    display: none;
}

.diary-paper {
    background: var(--paper-color);
    min-height: 380px;
    height: auto;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    flex-shrink: 0;
    border-radius: 15px;
    padding: 25px 30px 20px 30px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
    touch-action: pan-y;
    user-select: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    margin: 0 2px;
    transition: box-shadow 0.3s, transform 0.3s ease, opacity 0.3s ease;
    background-size: 100% auto;
    background-position: top center;
    background-repeat: repeat;
}

.diary-paper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1.5px var(--active-border);
    z-index: 5;
}

.diary-paper.active::after {
    box-shadow: inset 0 0 0 1.5px var(--active-border);
}

.diary-paper.edit-mode::after {
    box-shadow: inset 0 0 0 3px var(--accent-color);
}

.diary-paper[data-post-type="photo"] {
    min-height: 0 !important;
    padding: 0 !important;
    background: none !important;
    overflow: hidden !important;
}

.diary-paper.active {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

.diary-paper.edit-mode {
    box-shadow: 0 12px 40px rgba(212, 163, 115, 0.2);
    z-index: 100;
}

.diary-ai-reply {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1.5px dashed var(--border-color);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: fadeIn 0.5s ease;
}

.ai-reply-avatar {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(21, 39, 63, 0.8));
    animation: floating 3s ease-in-out infinite;
    margin-top: 6px;
}

.ai-reply-bubble {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px 15px 15px 15px;
    padding: 12px 16px;
    font-size: 9pt;
    font-family: inherit;
    color: #5d4037;
    line-height: 1.8;
    letter-spacing: -0.3px;
    position: relative;
    border: 1px solid #f0e6dd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.ai-reply-loading {
    font-size: 13px;
    color: var(--accent-color);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: blink 1.5s infinite;
    padding: 10px 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.diary-header {
    border-bottom: 1.5px solid var(--accent-color);
    padding-bottom: 10px;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.date-label {
    font-size: 12px;
    color: var(--accent-color);
    font-weight: bold;
    letter-spacing: 0.5px;
}

.diary-content-area {
    flex: none;
    position: relative;
    z-index: 0;
    width: calc(100% + 60px);
    margin-left: -30px;
    height: auto;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.diary-paper.edit-mode .diary-content-area {
    overflow: visible;
}

.text-glass-underlay,
.diary-body-underlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 15px 30px 30px 30px;
    font-size: 12px;
    font-family: inherit;
    line-height: 22px;
    color: transparent;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-sizing: border-box;
    z-index: 0;
    pointer-events: none;
}

.text-glass-underlay span,
.diary-body-underlay span {
    border-radius: 4px;
    transition: background 0.4s ease, backdrop-filter 0.4s ease, border 0.4s ease;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.text-glass-underlay.glass-light span,
.diary-body-underlay.glass-light span {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.text-glass-underlay.glass-dark span,
.diary-body-underlay.glass-dark span {
    background: rgba(0, 0, 0, 0.25);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

textarea,
.diary-body-input {
    width: 100%;
    height: auto;
    min-height: 230px;
    border: none;
    resize: none;
    font-size: 12px;
    font-family: inherit;
    line-height: 22px;
    outline: none;
    background: transparent;
    color: var(--text-color);
    padding: 15px 30px 30px 30px;
    box-sizing: border-box;
    overflow-y: hidden;
    position: relative;
    z-index: 1;
    transition: color 0.4s ease;
}

textarea::placeholder,
.diary-body-input::placeholder {
    color: #bfaea0;
}

textarea[readonly],
.diary-body-input[readonly] {
    cursor: default;
}

.diary-paper[data-post-type="5line"] {
    background-image: url('../assets/bgimg/star_001.webp') !important;
    background-size: 100% auto !important;
    background-position: top center !important;
    background-repeat: repeat !important;
}

.diary-content-area.five-line-content {
    width: 100%;
    margin-left: 0;
    min-height: 0;
}

.five-line-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 25px 0 20px 0;
    margin: 0;
    width: 100%;
}

.five-line-group {
    display: block;
    width: 100%;
}

.five-line-textarea-wrap {
    position: relative;
    width: 100%;
    display: block;
}

.five-line-underlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2px 4px;
    font-size: 12px;
    font-family: inherit;
    line-height: 22px;
    color: transparent;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-sizing: border-box;
    z-index: 0;
    pointer-events: none;
}

.five-line-underlay span {
    border-radius: 4px;
    transition: background 0.4s ease;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.five-line-underlay.glass-light span {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.five-line-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 6px;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.7);
    transition: margin 0.2s;
}

.five-line-input {
    width: 100%;
    position: relative;
    z-index: 1;
    min-height: 0;
    height: auto;
    border-radius: 0;
    border: none;
    background: transparent;
    padding: 2px 4px;
    font-size: 12px;
    font-family: inherit;
    line-height: 22px;
    color: var(--text-color);
    box-sizing: border-box;
    resize: none;
    overflow: hidden;
    transition: padding 0.2s;
}

.five-line-input:focus {
    outline: none;
}

.diary-paper.edit-mode .five-line-underlay {
    opacity: 0.3;
}

.diary-paper.edit-mode .five-line-input {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
}

.diary-paper.edit-mode.glass-dark .five-line-input {
    background: rgba(0, 0, 0, 0.4);
}

.glass-dark .five-line-title {
    color: #f4f4f4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.glass-dark .five-line-input {
    background: transparent;
    color: #f4f4f4;
}

.glass-dark .five-line-group {
    background: rgba(0, 0, 0, 0.25);
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.25);
}

.diary-paper[data-post-type="5line"].glass-dark {
    background-image: url('../assets/bgimg/star_001.webp') !important;
}

.diary-paper:not(.edit-mode) .five-line-input {
    background: transparent !important;
    border-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 2px 4px !important;
    overflow: hidden !important;
    color: inherit;
    pointer-events: none;
}

.diary-paper:not(.edit-mode) .five-line-title {
    margin-bottom: 2px;
}
