* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Vazirmatn', sans-serif;
}

:root {
    color-scheme: dark;

    --bg-1: #090b0f;
    --bg-2: #111820;
    --bg-3: #1b1712;
    --gold: #c89b5c;
    --gold-soft: #e1c38d;
    --teal: #477c75;
    --teal-soft: #9fbfba;
    /* alias های قدیمی برای سازگاری */
    --pink: var(--gold);
    --pink-soft: var(--gold-soft);
    --purple: var(--teal);
    --purple-soft: var(--teal-soft);
    --white-soft: rgba(255, 255, 255, 0.86);
    --glass: rgba(18, 22, 28, 0.88);
    --glass-strong: rgba(22, 26, 32, 0.94);
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.24);
    --surface: #14181f;
    --surface-2: #1a2028;
}

html {
    scroll-behavior: smooth;
    background: var(--bg-1);
    color-scheme: dark;
}

body {
    min-height: 100vh;
    color: #fff;
    background:
        radial-gradient(circle at 85% 8%, rgba(200, 155, 92, 0.16), transparent 26%),
        radial-gradient(circle at 12% 78%, rgba(71, 124, 117, 0.18), transparent 30%),
        radial-gradient(circle at 50% 45%, rgba(225, 195, 141, 0.05), transparent 40%),
        linear-gradient(145deg, #080a0e 0%, #121820 48%, #1a1612 100%);
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    opacity: 0.045;
    background-image:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 3px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 4px);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(200, 155, 92, 0.08), transparent 28%),
        radial-gradient(circle at 80% 70%, rgba(71, 124, 117, 0.08), transparent 30%);
    animation: ambienceDrift 18s ease-in-out infinite alternate;
}

.background-slideshow {
    position: fixed;
    inset: 0;
    z-index: -5;
    overflow: hidden;
}

.bg-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1.08);
    transition: opacity 1.8s ease, transform 7s ease;
    filter: brightness(0.26) saturate(1.2)
        /* blur(1px); */
}

.bg-slide.active {
    opacity: 1;
    transform: scale(1);
}

.bg-overlay {
    position: fixed;
    inset: 0;
    z-index: -4;
    background:
        linear-gradient(to bottom, rgba(9, 11, 15, 0.42), rgba(9, 11, 15, 0.55)),
        radial-gradient(circle at center, rgba(255, 255, 255, 0.02), transparent 60%);
    pointer-events: none;
}

.blur-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.22;
    pointer-events: none;
    z-index: -4;
    animation: blobFloat 16s ease-in-out infinite;
}

.orb1 {
    width: 280px;
    height: 280px;
    top: 6%;
    right: 4%;
    background: #c89b5c;
}

.orb2 {
    width: 360px;
    height: 360px;
    bottom: 0;
    left: 2%;
    background: #477c75;
    animation-delay: 2s;
}

.orb3 {
    width: 220px;
    height: 220px;
    top: 46%;
    left: 38%;
    background: #e1c38d;
    opacity: 0.12;
    animation-delay: 4s;
}

@keyframes ambienceDrift {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(0, -18px, 0) scale(1.04);
    }
}

@keyframes blobFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(20px, -18px) scale(1.05);
    }

    50% {
        transform: translate(-12px, 16px) scale(0.97);
    }

    75% {
        transform: translate(18px, 8px) scale(1.03);
    }
}

.stars {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(225, 195, 141, 0.72);
    box-shadow: 0 0 8px rgba(225, 195, 141, 0.36);
    animation: twinkle linear infinite;
}

@keyframes twinkle {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(0.85);
    }

    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

.page {
    min-height: 100vh;
    display: none;
    width: 100%;
    padding: clamp(12px, 3vw, 24px);
}

.page.active {
    display: block;
}

.login-wrap {
    width: min(100%, 480px);
    min-height: calc(100svh - clamp(24px, 6vw, 48px));
    margin: 0 auto;
    display: grid;
    place-items: center;
}

.glass-card {
    width: 100%;
    max-width: calc(100vw - 24px);
    padding: clamp(22px, 5vw, 30px);
    border-radius: 22px;
    background:
        linear-gradient(165deg, rgba(36, 42, 52, 0.98), rgba(14, 17, 22, 0.99) 55%, rgba(22, 20, 18, 0.98));
    border: 1px solid transparent;
    background-clip: padding-box;
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(200, 155, 92, 0.18);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: surfaceRise 0.7s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.glass-card::before {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(200, 155, 92, 0.28), transparent 68%);
    top: -70px;
    left: -50px;
    pointer-events: none;
    animation: softPulse 5.5s ease-in-out infinite;
}

.glass-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.08) 48%, transparent 66%);
    transform: translateX(-120%);
    animation: sheenSweep 7s ease-in-out infinite;
}

.glass-card h1 {
    font-size: clamp(1.8rem, 7vw, 2.7rem);
    margin-bottom: 12px;
    font-weight: 900;
    background: linear-gradient(90deg, #fff, #e8d6ad, #9fbfba);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-card p {
    color: var(--white-soft);
    line-height: 2;
    margin-bottom: 20px;
    font-size: 0.98rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group input {
    width: 100%;
    padding: 15px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    outline: none;
    font-size: 1rem;
    transition: .25s;
}

.input-group input:focus {
    border-color: var(--pink-soft);
    box-shadow: 0 0 0 4px rgba(200, 155, 92, 0.14);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.btn {
    border: none;
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    background:
        linear-gradient(135deg, #d4ad6a 0%, #b88747 42%, #3f746e 100%);
    cursor: pointer;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: .25s ease;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
    transform: translateX(-130%);
    transition: transform 0.55s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}

.btn:hover::after {
    transform: translateX(130%);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: none;
}

.btn.ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: none;
}

.error-text {
    color: #f2d7a0;
    margin-top: 12px;
    min-height: 24px;
    font-size: 0.95rem;
}

.main-container {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding-bottom: 70px;
}

.top-nav {
    position: sticky;
    top: 12px;
    z-index: 20;
    margin-bottom: 18px;
}

.nav-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(18, 22, 28, 0.96), rgba(10, 12, 16, 0.98));
    border: 1px solid rgba(200, 155, 92, 0.18);
    box-shadow:
        var(--shadow-soft),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav-chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 12px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.92rem;
    transition: .2s ease;
}

.nav-chip:hover {
    background: rgba(200, 155, 92, 0.14);
    border-color: rgba(200, 155, 92, 0.35);
    color: #f0e2c4;
}

.hero {
    min-height: 92vh;
    display: flex;
    align-items: center;
    padding: 22px 0 16px;
}

.hero-card {
    width: 100%;
    border-radius: 24px;
    padding: clamp(22px, 4vw, 42px);
    background:
        linear-gradient(160deg, rgba(32, 38, 46, 0.98), rgba(12, 15, 20, 0.99) 52%, rgba(24, 20, 16, 0.98));
    border: 1px solid rgba(200, 155, 92, 0.22);
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 60px rgba(200, 155, 92, 0.06);
    position: relative;
    overflow: hidden;
    animation: surfaceRise 0.85s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(225, 195, 141, 0.55), transparent 35%, transparent 65%, rgba(71, 124, 117, 0.45));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.9;
}

.hero-card::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    left: -80px;
    bottom: -140px;
    background: radial-gradient(circle, rgba(71, 124, 117, 0.22), transparent 68%);
    pointer-events: none;
    animation: softPulse 6s ease-in-out infinite;
}

.hero-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(200, 155, 92, 0.18), rgba(71, 124, 117, 0.12));
    border: 1px solid rgba(200, 155, 92, 0.32);
    color: #ead9b8;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: badgeGlow 3.8s ease-in-out infinite;
}

.hero h2 {
    font-size: clamp(2.6rem, 7vw, 5.4rem);
    line-height: 1.05;
    margin-bottom: 12px;
    font-weight: 900;
    background: linear-gradient(100deg, #fff 10%, #e4c786 42%, #9fbfba 78%, #fff 100%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    animation: titleSheen 8s linear infinite;
}

.hero-subtitle {
    max-width: 820px;
    color: var(--white-soft);
    line-height: 2;
    font-size: 1.03rem;
    margin-bottom: 28px;
    margin-inline: auto;
    text-align: center;
}

.countdown-wrap {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
    direction: ltr;
    /* justify-items: center; */
}

.time-box {
    text-align: center;
    border-radius: 18px;
    padding: 18px 10px;
    background:
        linear-gradient(180deg, rgba(40, 46, 56, 0.95), rgba(18, 22, 28, 0.98));
    border: 1px solid rgba(200, 155, 92, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 8px 20px rgba(0, 0, 0, 0.18);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    direction: rtl;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.time-box:hover {
    transform: translateY(-3px);
    border-color: rgba(225, 195, 141, 0.4);
}

.time-box span {
    display: block;
    font-size: clamp(2rem, 5vw, 3.1rem);
    font-weight: 900;
    margin-bottom: 4px;
    background: linear-gradient(180deg, #fff, #e1c38d);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.time-box small {
    color: rgba(234, 210, 164, 0.82);
    font-size: 0.95rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.section {
    margin-top: 34px;
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.section-title h3 {
    font-size: clamp(1.45rem, 4vw, 2.05rem);
    font-weight: 900;
    background: linear-gradient(90deg, #fff 20%, #e1c38d 70%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title p {
    color: var(--white-soft);
    font-size: 0.98rem;
}

/* memory section removed */
.calendar-panel,
.timeline-panel,
.love-letter,
.gallery-panel {
    border-radius: 22px;
    background:
        linear-gradient(165deg, rgba(30, 36, 44, 0.98), rgba(13, 16, 21, 0.99) 60%, rgba(22, 20, 17, 0.98));
    border: 1px solid rgba(200, 155, 92, 0.16);
    box-shadow:
        var(--shadow),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
    position: relative;
}

.calendar-panel::before,
.love-letter::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -40px;
    top: -50px;
    background: radial-gradient(circle, rgba(200, 155, 92, 0.16), transparent 70%);
    pointer-events: none;
}

.calendar-panel,
.timeline-panel,
.gallery-panel,
.love-letter {
    padding: 22px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.day-card {
    min-height: 114px;
    border-radius: 16px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(34, 40, 48, 0.98), rgba(20, 24, 30, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.10);
    position: relative;
    overflow: hidden;
    transition: .25s ease;
    cursor: pointer;
}

.day-card::before {
    content: "";
    position: absolute;
    inset: auto auto -30px -20px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(200, 155, 92, 0.13), transparent 65%);
    pointer-events: none;
}

.day-card:hover {
    transform: translateY(-4px);
}

.day-card.locked {
    opacity: 0.42;
    cursor: not-allowed;
    filter: grayscale(0.15);
}

.day-card.opened {
    box-shadow:
        0 12px 28px rgba(200, 155, 92, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    border-color: rgba(200, 155, 92, 0.38);
    background: linear-gradient(180deg, rgba(48, 42, 32, 0.98), rgba(24, 26, 30, 0.98));
}

.day-card.opened::before {
    background: radial-gradient(circle, rgba(200, 155, 92, 0.28), transparent 65%);
}

.day-num {
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.day-title {
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.7;
    font-size: 0.92rem;
}

.timeline-list {
    display: grid;
    gap: 16px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 16px;
    padding: 14px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    transition: .25s ease;
}

.timeline-item:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}

.timeline-thumb {
    width: 130px;
    height: 130px;
    border-radius: 20px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.timeline-content h4 {
    margin-bottom: 8px;
    color: #ead2a4;
    font-size: 1.15rem;
}

.timeline-date {
    display: inline-block;
    margin-bottom: 10px;
    color: #9fbfba;
    font-size: 0.92rem;
}

.timeline-content p {
    color: var(--white-soft);
    line-height: 1.95;
    font-size: 0.97rem;
}

.gallery-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.gallery-top p {
    color: var(--white-soft);
    line-height: 1.9;
    font-size: 0.96rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.gallery-page-header {
    margin-bottom: 26px;
    text-align: center;
}

.gallery-page-header h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    background: linear-gradient(90deg, #fff, #e4c786, #9fbfba);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.gallery-page-header p {
    color: var(--white-soft);
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.8;
    font-size: 1rem;
}

.gallery-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.gallery-card {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    /* box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25); */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 540px;
    content-visibility: auto;
    contain: layout paint style;
    contain-intrinsic-size: 540px;
}

.gallery-card-image {
    min-height: 260px;
    background-size: cover;
    background-position: center;
    position: relative;
    aspect-ratio: 4 / 3;
}

.gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-page-sentinel {
    height: 2px;
    width: 100%;
}

.gallery-page-sentinel.hidden {
    display: none;
}

body.gallery-active .blur-orb {
    display: none;
}

body.gallery-active .star {
    animation-play-state: paused;
    box-shadow: none;
}

body.gallery-active .nav-inner {
    background: rgba(12, 15, 20, 0.96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .blur-orb,
    .star,
    .story-date-group,
    .special-day-banner.active {
        animation: none;
    }
}

.gallery-count-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.82rem;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.gallery-card-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.gallery-card-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ead2a4;
}

.gallery-card-description {
    color: var(--white-soft);
    line-height: 1.85;
    font-size: 0.98rem;
    display: -webkit-box;
    min-height: calc(1.85em * 4);
    max-height: calc(1.85em * 4);
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
}

.gallery-card-open {
    margin-top: auto;
    width: fit-content;
    align-self: flex-start;
}

.gallery-card:hover {
    transform: translateY(-3px);
    transition: transform 0.2s ease;
}

.gallery-item {
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
    transition: .25s ease;
    background-color: rgba(255, 255, 255, 0.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

.gallery-load-more {
    display: inline-flex;
    margin: 18px auto 0;
    padding: 12px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    transition: .25s ease;
}

.gallery-load-more:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.gallery-item:hover {
    transform: scale(1.03);
}

.related-photos {
    margin-top: 18px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.related-item {
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    min-height: 140px;
}

.related-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.related-item span {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 0.78rem;
    line-height: 1.4;
}

.gallery-item::after {
    content: attr(data-label);
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    padding: 7px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 0.78rem;
    text-align: center;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.love-letter {
    position: relative;
}

.love-letter::before {
    content: "💌";
    position: absolute;
    left: 24px;
    top: 20px;
    font-size: 1.4rem;
    opacity: 0.7;
}

.love-letter h3 {
    margin-bottom: 14px;
    font-size: 1.55rem;
    color: #ead2a4;
}

.letter-paper {
    margin-top: 10px;
    border-radius: 24px;
    padding: 20px;
    background: linear-gradient(180deg, rgba(30, 35, 42, 0.98), rgba(18, 21, 26, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.88);
    line-height: 2.15;
    white-space: pre-line;
}

.special-day-banner {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(200, 155, 92, 0.16), rgba(71, 124, 117, 0.16));
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.20);
}

.special-day-banner.active {
    display: flex;
    animation: glowPulse 1.6s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    from {
        box-shadow: 0 0 0 rgba(200, 155, 92, 0.16);
    }

    to {
        box-shadow: 0 0 35px rgba(71, 124, 117, 0.24);
    }
}

.footer-note {
    margin-top: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.60);
    font-size: 0.95rem;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(9, 11, 15, 0.88);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 100;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-card {
    width: min(94vw, 780px);
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(22, 26, 30, 0.97), rgba(8, 10, 14, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: var(--shadow);
    position: relative;
    margin: auto;
    perspective: 1300px;
}

.modal-cover {
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s ease, box-shadow 0.3s ease;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

.modal-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(9, 11, 15, 0.96), rgba(9, 11, 15, 0.14));
}

.modal-body {
    position: relative;
    z-index: 2;
    margin-top: -52px;
    padding: 22px;
}

.gallery-modal-footer {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gallery-modal-counter {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.95rem;
    font-weight: 700;
}
.gallery-modal-body p::-webkit-scrollbar {
    width: 4px;
}

.gallery-modal-body p::-webkit-scrollbar-thumb {
    background: var(--pink);
    border-radius: 10px;
}
#galleryModal {
    padding: 14px;
    background: rgba(9, 11, 15, 0.92);
}

.gallery-modal-card {
    width: min(97vw, 1280px);
    max-height: 96vh;
    overflow: hidden;
    border-radius: 24px;
    background:
        radial-gradient(circle at 50% 8%, rgba(71, 124, 117, 0.11), transparent 34%),
        #080a0e;
    box-shadow: none;
    transform-style: preserve-3d;
    animation: galleryModalEnter 0.45s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.gallery-viewer {
    height: clamp(380px, calc(96vh - 280px), 650px);
    padding: 10px 24px 0;
    /* height: clamp(420px, calc(96vh - 210px), 720px);
    padding: 18px 24px 0; */
    display: grid;
    grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) minmax(90px, 150px);
    align-items: center;
    gap: 18px;
    direction: ltr;
    perspective: 1400px;
    transform-style: preserve-3d;
}

.gallery-main-frame {
    grid-column: 2;
    position: relative;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border-radius: 18px;
    background: transparent;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    /* background: #08000d;
    border: 1px solid rgba(255, 255, 255, 0.1); */
    transform: translateZ(34px);
    transform-style: preserve-3d;
}

.gallery-modal-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    backface-visibility: hidden;
    will-change: transform, opacity, filter;
    transition:
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.46s ease,
        filter 0.6s ease;
}

.gallery-modal-image-current {
    z-index: 1;
}

.gallery-modal-image-current.from-next,
.gallery-modal-image-current.from-prev {
    opacity: 0;
    transition: none;
}

.gallery-modal-image-current.from-next {
    transform: translate3d(-8%, 0, 0) scale(0.99);
}

.gallery-modal-image-current.from-prev {
    transform: translate3d(8%, 0, 0) scale(0.99);
}

.gallery-modal-image-current.from-next.is-entering,
.gallery-modal-image-current.from-prev.is-entering {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    transition:
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.34s ease;
}

.gallery-viewer.move-next .gallery-modal-image-current.is-leaving {
    opacity: 0;
    filter: brightness(0.78);
    transform: translate3d(10%, 0, 0) scale(0.985);
}

.gallery-viewer.move-prev .gallery-modal-image-current.is-leaving {
    opacity: 0;
    filter: brightness(0.78);
    transform: translate3d(-10%, 0, 0) scale(0.985);
}

.gallery-viewer.move-next .gallery-preview-next {
    opacity: 0.95;
    transform: rotateY(5deg) translateX(45px) translateZ(34px) scale(1.08);
}

.gallery-viewer.move-prev .gallery-preview-prev {
    opacity: 0.95;
    transform: rotateY(-5deg) translateX(-45px) translateZ(34px) scale(1.08);
}

.gallery-preview {
    width: 100%;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    opacity: 0.58;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    will-change: transform;
    transition:
        opacity 0.3s ease,
        transform 0.38s cubic-bezier(0.2, 0.75, 0.25, 1),
        border-color 0.3s ease;
}

.gallery-preview-prev {
    grid-column: 3;
    grid-row: 1;
    transform: rotateY(-22deg) translateX(-10px) translateZ(-28px);
    transform-origin: left center;
}

.gallery-preview-next {
    grid-column: 1;
    grid-row: 1;
    transform: rotateY(22deg) translateX(10px) translateZ(-28px);
    transform-origin: right center;
}

.gallery-preview:hover {
    opacity: 0.96;
    border-color: rgba(255, 255, 255, 0.28);
}

.gallery-preview-prev:hover {
    transform: rotateY(-8deg) translateX(-4px) translateZ(18px) scale(1.03);
}

.gallery-preview-next:hover {
    transform: rotateY(8deg) translateX(4px) translateZ(18px) scale(1.03);
}

.gallery-preview img {
    width: 100%;
    aspect-ratio: 3 / 4;
    display: block;
    object-fit: cover;
    background: #08000d;
}

.gallery-preview span {
    display: block;
    padding: 9px 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

.gallery-preview.is-hidden {
    visibility: hidden;
    pointer-events: none;
}

@keyframes galleryModalEnter {
    from {
        opacity: 0;
        transform: translateY(18px) rotateX(3deg) scale(0.975);
    }

    to {
        opacity: 1;
        transform: translateY(0) rotateX(0) scale(1);
    }
}
.gallery-modal-body {
    width: calc(100% - 40px);
    margin: -30px auto 10px;
    /* بالا آوردن جزئی روی عکس برای حس عمق */
    padding: 24px 28px;
    max-height: 220px;
    /* افزایش ارتفاع برای متن‌های طولانی */
    min-height: 140px;
    direction: rtl;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(28, 33, 40, 0.98), rgba(12, 15, 20, 0.99));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 -15px 45px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.gallery-modal-body h3 {
    margin-bottom: 12px;
    font-size: 1.5rem;
    /* بزرگتر کردن عنوان (تاریخ یا تیتر) */
    color: #ead2a4;
    font-weight: 800;
}

.gallery-modal-body p {
    line-height: 1.9;
    max-height: 120px;
    /* فضای بیشتر برای اسکرول متن */
    font-size: 1.05rem;
    /* بزرگتر کردن متن اصلی */
    color: rgba(255, 255, 255, 0.92);
    font-weight: 400;
    overflow-y: auto;
    padding-left: 8px;
    /* فضا برای اسکرول‌بار */
}
/* .gallery-modal-body {
    width: calc(100% - 36px);
    margin: -68px auto 0;
    padding: 14px 24px 16px;
    max-height: 154px;
    direction: rtl;
    position: relative;
    z-index: 4;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(180deg, rgba(28, 5, 42, 0.9), #100018 60%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    transition: opacity 0.2s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
} */

.gallery-modal-body.is-changing {
    opacity: 0;
    transform: translateY(7px);
}

.gallery-modal-body .modal-day {
    margin-bottom: 5px;
    padding: 5px 10px;
    font-size: 0.78rem;
    color: #fff;
    background: linear-gradient(135deg, rgba(200, 155, 92, 0.28), rgba(71, 124, 117, 0.28));
    border-color: rgba(255, 255, 255, 0.2);
}

/* .gallery-modal-body h3 {
    margin-bottom: 5px;
    font-size: clamp(1rem, 1.8vw, 1.3rem);
} */

/* .gallery-modal-body p {
    line-height: 1.75;
    max-height: 52px;
    padding-left: 10px;
    font-size: 0.9rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 155, 208, 0.48) rgba(255, 255, 255, 0.06);
} */

/* .gallery-modal-body p::-webkit-scrollbar {
    width: 6px;
} */

.gallery-modal-body p::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

/* .gallery-modal-body p::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(var(--pink-soft), var(--purple-soft));
} */

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.gallery-nav.next {
    left: 15px;
}

.gallery-nav.prev {
    right: 15px;
}

.gallery-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
}

.gallery-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.18);
}

.modal-day {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ead2a4;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.modal-body h3 {
    font-size: 1.9rem;
    margin-bottom: 10px;
}

.modal-body p {
    color: rgba(255, 255, 255, 0.86);
    line-height: 2.05;
    white-space: pre-line;
}

.close-btn {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.36);
    color: #fff;
    cursor: pointer;
    z-index: 5;
    font-size: 1.15rem;
}

.parallax-soft {
    transform: translateY(var(--parallax-offset, 0px));
    transition: transform 0.15s linear;
}

@media (max-width: 960px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .countdown-wrap {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .login-wrap {
        max-width: 358px;
        margin-left: 0;
        margin-right: auto;
    }

    #galleryModal {
        padding: 0;
        align-items: stretch;
    }

    .gallery-modal-card {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        margin: 0;
        display: flex;
        flex-direction: column;
        border-radius: 0;
    }

    .gallery-viewer {
        width: 100%;
        height: auto;
        flex: 1 1 auto;
        min-height: 0;
        padding: 52px 10px 10px;
        display: block;
    }

    .gallery-main-frame {
        width: 100%;
        height: 100%;
        min-height: 0;
        border-radius: 12px;
        transform: none;
    }

    .gallery-preview {
        display: none;
    }

    .gallery-viewer.move-next .gallery-modal-image-current.is-leaving {
        transform: translate3d(7%, 0, 0) scale(0.99);
    }

    .gallery-viewer.move-prev .gallery-modal-image-current.is-leaving {
        transform: translate3d(-7%, 0, 0) scale(0.99);
    }

    .gallery-nav {
        width: 40px;
        height: 40px;
    }

    .gallery-nav.next {
        left: 8px;
    }

    .gallery-nav.prev {
        right: 8px;
    }

    .gallery-modal-body {
        width: 100%;
        max-height: min(38dvh, 300px);
        flex: 0 0 auto;
        margin: 0;
        padding: 14px 18px max(20px, env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 0;
        background: linear-gradient(180deg, #1b0629, #100018);
        box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.34);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 155, 208, 0.55) rgba(255, 255, 255, 0.06);
    }

    .gallery-modal-body::-webkit-scrollbar {
        width: 5px;
    }

    .gallery-modal-body::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }

    .gallery-modal-body::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: linear-gradient(var(--pink-soft), var(--purple-soft));
    }

    .gallery-modal-body .modal-day {
        margin-bottom: 8px;
        padding: 6px 11px;
        font-size: 0.8rem;
    }

    /* .gallery-modal-body h3 {
        margin-bottom: 8px;
        font-size: 1.15rem;
    } */

    /* .gallery-modal-body p {
        max-height: none;
        padding-left: 0;
        overflow: visible;
        font-size: 0.9rem;
        line-height: 1.9;
        color: rgba(255, 255, 255, 0.9);
    } */

    .gallery-modal-footer {
        margin-top: 12px;
    }

    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }

    .timeline-thumb {
        width: 100%;
        height: 190px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {

    .gallery-modal-card,
    .gallery-modal-image {
        animation: none;
        transition: none;
    }

    .gallery-preview,
    .gallery-modal-body {
        transition: opacity 0.2s ease, border-color 0.2s ease;
    }
}

.story-page-header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 10px;
}

.story-page-header h2 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    background: linear-gradient(90deg, #fff, #e4c786, #9fbfba);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.story-page-header p {
    color: var(--white-soft);
    font-size: 1rem;
}

.story-timeline {
    position: relative;
    padding-right: 40px;
}

.story-timeline::before {
    content: "";
    position: absolute;
    right: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--pink), var(--purple));
    opacity: 0.5;
}

.story-date-group {
    position: relative;
    margin-bottom: 28px;
    animation: fadeInUp 0.6s ease forwards;
}

.story-date-marker {
    position: absolute;
    right: -33px;
    top: 18px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--pink);
    border: 2px solid var(--purple);
    box-shadow: 0 0 12px rgba(200, 155, 92, 0.34);
    z-index: 2;
}

.story-date-header {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(200, 155, 92, 0.15), rgba(71, 124, 117, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ead2a4;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.story-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.story-photo-item {
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: transform 0.25s ease;
    background-color: rgba(255, 255, 255, 0.04);
    position: relative;
}

.story-photo-item:hover {
    transform: scale(1.03);
}

.story-photo-item img,
.story-photo-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-photo-item .media-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.story-load-more {
    display: flex;
    margin: 24px auto 0;
    padding: 14px 28px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    transition: .25s ease;
    font-weight: 700;
    font-size: 0.95rem;
}

.story-load-more:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.story-load-more.hidden {
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 700px) {
    .story-timeline {
        padding-right: 30px;
    }

    .story-date-marker {
        right: -23px;
        width: 10px;
        height: 10px;
    }

    .story-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
}

.page {
    padding: clamp(12px, 3vw, 24px);
}

.gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
}

.glass-card,
.hero-card,
.calendar-panel,
.timeline-panel,
.gallery-panel,
.love-letter {
    border-radius: 22px;
}
#letterContent {
    white-space: pre-line;
}

/* Surprise card */
.surprise-card {
    display: none;
    margin-top: 22px;
    padding: 18px 16px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(200, 155, 92, 0.10), transparent 42%),
        linear-gradient(180deg, rgba(28, 33, 40, 0.98), rgba(16, 19, 24, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.surprise-card.active {
    display: block;
    animation: playlistEnter 0.45s ease both;
}

.surprise-label {
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ead2a4;
    background: rgba(200, 155, 92, 0.12);
    border: 1px solid rgba(200, 155, 92, 0.28);
}

.surprise-card h4 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: #fff;
}

.surprise-card > p {
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.9;
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.surprise-action {
    margin-top: 8px;
}

.surprise-token {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(71, 124, 117, 0.16);
    border: 1px dashed rgba(159, 191, 186, 0.4);
    color: var(--purple-soft);
    font-weight: 700;
}

.surprise-song {
    margin-top: 8px;
}

.surprise-song-title {
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--pink-soft);
}

.surprise-song audio,
.playlist-audio {
    width: 100%;
    margin-top: 4px;
    border-radius: 12px;
}

.surprise-qr {
    display: block;
    width: min(100%, 220px);
    margin: 12px auto 0;
}

.surprise-qr img {
    width: 100%;
    border-radius: 16px;
    background: #fff;
    padding: 10px;
}

/* Playlist page + custom memory player */
.playlist-page-layout {
    padding-bottom: 220px;
}

.playlist-page-header {
    text-align: center;
    margin: 8px 0 22px;
}

.playlist-page-header h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin-bottom: 8px;
    background: linear-gradient(120deg, #fff, var(--pink-soft));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.playlist-page-header p {
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.9;
    max-width: 36rem;
    margin: 0 auto;
}

.playlist-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 18px;
}

.playlist-tab {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.82);
    border-radius: 999px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.25s ease;
}

.playlist-tab:hover {
    border-color: rgba(200, 155, 92, 0.35);
    background: rgba(200, 155, 92, 0.08);
}

.playlist-tab.is-active {
    color: #1a140c;
    background: linear-gradient(135deg, var(--pink-soft), var(--pink));
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(200, 155, 92, 0.28);
}

.playlist-page-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: playlistEnter 0.45s ease both;
}

.playlist-track {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    align-items: start;
    width: 100%;
    text-align: right;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    color: inherit;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.playlist-track:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(200, 155, 92, 0.28);
}

.playlist-track.is-playing {
    background: rgba(200, 155, 92, 0.12);
    border-color: rgba(200, 155, 92, 0.42);
    transform: translateY(-1px);
}

.playlist-track-num {
    font-size: 0.85rem;
    font-weight: 800;
    color: rgba(225, 195, 141, 0.7);
    padding-top: 2px;
    font-variant-numeric: tabular-nums;
}

.playlist-track.is-playing .playlist-track-num {
    color: var(--pink-soft);
}

.playlist-track-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.playlist-track-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: #fff;
}

.playlist-track-caption {
    font-size: 0.88rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.72);
    white-space: pre-line;
}

.memory-player {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 80;
    width: min(94vw, 720px);
    display: none;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 22px;
    border: 1px solid rgba(200, 155, 92, 0.28);
    background:
        radial-gradient(circle at 12% 30%, rgba(200, 155, 92, 0.14), transparent 42%),
        radial-gradient(circle at 88% 80%, rgba(71, 124, 117, 0.14), transparent 40%),
        linear-gradient(180deg, rgba(22, 26, 32, 0.98), rgba(10, 12, 16, 0.99));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

body.playlist-active .memory-player {
    display: grid;
    animation: memoryPlayerEnter 0.5s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

body.playlist-active .music-toggle {
    display: none !important;
}

.memory-player-visual {
    position: relative;
    width: 78px;
    height: 78px;
    flex-shrink: 0;
}

.memory-orb {
    position: absolute;
    inset: 0;
    margin: auto;
    border-radius: 50%;
}

.memory-orb-outer {
    width: 74px;
    height: 74px;
    border: 1px dashed rgba(200, 155, 92, 0.45);
    animation: memorySpin 14s linear infinite;
}

.memory-orb-mid {
    width: 52px;
    height: 52px;
    border: 1px solid rgba(159, 191, 186, 0.35);
    animation: memorySpin 9s linear infinite reverse;
}

.memory-orb-core {
    width: 28px;
    height: 28px;
    background: radial-gradient(circle at 35% 30%, #f0d7a4, var(--pink) 55%, #7d5a2d);
    box-shadow: 0 0 18px rgba(200, 155, 92, 0.45);
}

.memory-player.is-playing .memory-orb-core {
    animation: memoryPulse 1.4s ease-in-out infinite;
}

.memory-eq {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    pointer-events: none;
}

.memory-eq span {
    width: 3px;
    height: 10px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.55);
    transform-origin: center bottom;
    opacity: 0.35;
}

.memory-player.is-playing .memory-eq span {
    opacity: 0.95;
    animation: memoryEq 0.85s ease-in-out infinite;
    animation-delay: var(--eq-delay, 0s);
}

.memory-player-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.memory-player-title {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.memory-player-caption {
    font-size: 0.82rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.memory-player-caption[hidden] {
    display: none;
}

.memory-player-progress {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    direction: ltr;
}

.memory-time {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(234, 210, 164, 0.85);
    font-variant-numeric: tabular-nums;
    min-width: 2.4rem;
}

.memory-seek {
    cursor: pointer;
    padding: 8px 0;
    touch-action: none;
}

.memory-seek.is-disabled {
    opacity: 0.45;
    cursor: default;
}

.memory-seek.is-seeking .memory-seek-thumb {
    transform: translate(-50%, -50%) scale(1.18);
}

.memory-seek-track {
    position: relative;
    height: 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.12);
    overflow: visible;
}

.memory-seek-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--purple), var(--pink-soft));
}

.memory-seek-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--pink);
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease;
}

.memory-seek:hover .memory-seek-thumb {
    transform: translate(-50%, -50%) scale(1.12);
}

.memory-player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    direction: ltr;
}

.memory-ctrl {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #ead2a4;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    transition: 0.2s ease;
}

.memory-ctrl:hover {
    background: rgba(200, 155, 92, 0.16);
    border-color: rgba(200, 155, 92, 0.4);
}

.memory-ctrl-main {
    width: 52px;
    height: 52px;
    background: linear-gradient(145deg, var(--pink-soft), var(--pink));
    color: #1a140c;
    border: none;
    box-shadow: 0 10px 24px rgba(200, 155, 92, 0.32);
}

.memory-ctrl-main .icon-pause {
    display: none;
}

.memory-ctrl-main.is-playing .icon-play {
    display: none;
}

.memory-ctrl-main.is-playing .icon-pause {
    display: block;
}

#memoryPlayerAudio {
    display: none;
}

@keyframes playlistEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes memoryPlayerEnter {
    from {
        opacity: 0;
        transform: translate(-50%, 18px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes memorySpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes memoryPulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 14px rgba(200, 155, 92, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 24px rgba(200, 155, 92, 0.7);
    }
}

@keyframes memoryEq {
    0%,
    100% {
        transform: scaleY(0.45);
    }
    50% {
        transform: scaleY(1.35);
    }
}

@media (max-width: 700px) {
    .playlist-page-layout {
        padding-bottom: 250px;
    }

    .memory-player {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
        bottom: 10px;
    }

    .memory-player-visual {
        display: none;
    }

    .playlist-track {
        grid-template-columns: 34px 1fr;
        gap: 10px;
        padding: 11px 12px;
    }
}

@media (max-width: 600px) {
    .surprise-card {
        padding: 14px 12px;
    }
}

/* Background music toggle */
.music-toggle {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 90;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(200, 155, 92, 0.35);
    background: rgba(14, 17, 22, 0.96);
    color: #ead2a4;
    cursor: pointer;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: var(--shadow-soft);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

body.music-ready .music-toggle {
    display: inline-flex;
}

.music-toggle:hover {
    background: rgba(22, 26, 30, 0.95);
    border-color: rgba(200, 155, 92, 0.55);
    transform: translateY(-1px);
}

.music-toggle-icon {
    display: inline-flex;
    line-height: 0;
}

.music-toggle .music-toggle-icon-off {
    display: none;
}

.music-toggle.is-muted .music-toggle-icon-on {
    display: none;
}

.music-toggle.is-muted .music-toggle-icon-off {
    display: inline-flex;
}

.music-toggle-label {
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.music-toggle.is-muted {
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.16);
}

@media (max-width: 600px) {
    .music-toggle {
        left: 12px;
        bottom: 12px;
        padding: 10px 12px;
    }

    .music-toggle-label {
        display: none;
    }
}

/* ---------- Telegram / in-app WebView color safety ---------- */
html.tg-webview,
html.tg-webview body {
    background-color: #090b0f !important;
    color-scheme: dark !important;
}

html.tg-webview .bg-slide {
    filter: brightness(0.22) saturate(1.05);
}

html.tg-webview .bg-overlay {
    background: rgba(9, 11, 15, 0.58);
}

html.tg-webview .blur-orb {
    opacity: 0.14;
    filter: blur(56px);
}

html.tg-webview .glass-card,
html.tg-webview .hero-card,
html.tg-webview .calendar-panel,
html.tg-webview .timeline-panel,
html.tg-webview .love-letter,
html.tg-webview .gallery-panel,
html.tg-webview .modal-card,
html.tg-webview .gallery-modal-card,
html.tg-webview .memory-player,
html.tg-webview .music-toggle,
html.tg-webview .nav-inner,
html.tg-webview .day-card,
html.tg-webview .letter-paper,
html.tg-webview .surprise-card,
html.tg-webview .gallery-modal-body,
html.tg-webview .time-box {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html.tg-webview .glass-card,
html.tg-webview .hero-card {
    background: linear-gradient(165deg, #232933, #12161c 55%, #1a1714) !important;
    border-color: rgba(200, 155, 92, 0.24) !important;
}

html.tg-webview .calendar-panel,
html.tg-webview .timeline-panel,
html.tg-webview .love-letter,
html.tg-webview .gallery-panel,
html.tg-webview .modal-card {
    background: linear-gradient(165deg, #1d232b, #12161c) !important;
    border-color: rgba(200, 155, 92, 0.16) !important;
}

html.tg-webview .day-card {
    background: linear-gradient(180deg, #242a33, #171b21) !important;
}

html.tg-webview .day-card.opened {
    background: linear-gradient(180deg, #332d24, #1a1d22) !important;
    border-color: rgba(200, 155, 92, 0.35) !important;
}

html.tg-webview .letter-paper,
html.tg-webview .surprise-card,
html.tg-webview .time-box {
    background: linear-gradient(180deg, #222831, #161a20) !important;
}

html.tg-webview .nav-inner,
html.tg-webview .music-toggle,
html.tg-webview .memory-player {
    background: linear-gradient(180deg, #1a1f27, #10141a) !important;
    border-color: rgba(200, 155, 92, 0.2) !important;
}

html.tg-webview .modal,
html.tg-webview #galleryModal {
    background: rgba(9, 11, 15, 0.94) !important;
}

html.tg-webview .glass-card h1,
html.tg-webview .hero h2,
html.tg-webview .section-title h3,
html.tg-webview .time-box span {
    -webkit-text-fill-color: #f0e2c4;
    background: none;
    color: #f0e2c4;
    animation: none;
}

html.tg-webview .btn {
    background: linear-gradient(135deg, #d4ad6a, #b88747 45%, #3f746e) !important;
    color: #fff !important;
}

html.tg-webview body::before,
html.tg-webview body::after {
    opacity: 0.03;
    animation: none;
}

@keyframes softPulse {
    0%,
    100% {
        opacity: 0.55;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.06);
    }
}

@keyframes sheenSweep {
    0%,
    55% {
        transform: translateX(-130%);
    }
    75%,
    100% {
        transform: translateX(130%);
    }
}

@keyframes titleSheen {
    from {
        background-position: 0% center;
    }
    to {
        background-position: 200% center;
    }
}

@keyframes badgeGlow {
    0%,
    100% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 rgba(200, 155, 92, 0);
    }
    50% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 18px rgba(200, 155, 92, 0.18);
    }
}

@keyframes surfaceRise {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .glass-card,
    .hero-card,
    .badge,
    .hero h2,
    .glass-card::after,
    .glass-card::before,
    .hero-card::after,
    .btn::after,
    body::after,
    .blur-orb {
        animation: none !important;
    }
}

/* اگر مرورگر blur را واقعاً ساپورت نکند */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass-card,
    .hero-card,
    .calendar-panel,
    .timeline-panel,
    .love-letter,
    .gallery-panel,
    .nav-inner,
    .modal,
    .memory-player,
    .music-toggle {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}
