/* =============================================
   HAPPY BIRTHDAY HABIBA — ELEGANT + ANIMATED
   Mobile-first, romantic, storytelling
   ============================================= */

:root {
    --bg: #0b0b0f;
    --surface: #111115;
    --card: rgba(255, 255, 255, 0.025);
    --border: rgba(255, 255, 255, 0.05);
    --text: #f2ede8;
    --text-soft: rgba(242, 237, 232, 0.55);
    --pink: #e8a0bf;
    --pink-glow: rgba(232, 160, 191, 0.15);
    --rose: #c9627a;
    --gold: #c9a96e;
    --serif: 'Cormorant Garamond', serif;
    --sans: 'Quicksand', sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
}
::selection { background: var(--pink); color: var(--bg); }

/* ============ PRELOADER ============ */
#preloader {
    position: fixed; inset: 0; background: var(--bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 99999; transition: opacity 1s var(--ease), visibility 1s;
}
#preloader.done { opacity: 0; visibility: hidden; }
.pre-heart { font-size: 2.5rem; color: var(--pink); animation: pulse 1s ease-in-out infinite; }
.pre-text {
    margin-top: 14px; font-family: var(--serif); font-size: 0.8rem;
    letter-spacing: 2px; color: var(--text-soft); animation: fadeIO 2s ease infinite;
}
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }
@keyframes fadeIO { 0%,100%{opacity:.4} 50%{opacity:1} }

/* ============ HEARTS BG ============ */
#hearts-bg { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.bg-heart {
    position: absolute; bottom: -30px; color: var(--pink); opacity: 0;
    animation: rise linear forwards;
}
@keyframes rise {
    0% { transform: translateY(0) rotate(0) scale(1); opacity: 0.5; }
    100% { transform: translateY(-110vh) rotate(360deg) scale(0.4); opacity: 0; }
}

/* ============ PROGRESS ============ */
#progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; z-index: 9999; background: rgba(255,255,255,0.02); }
#progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--pink), var(--gold)); transition: width 0.15s ease; }

/* ============ SECRET GAME ============ */
.game-overlay {
    position: fixed; inset: 0; background: rgba(11, 11, 15, 0.95);
    display: flex; align-items: center; justify-content: center;
    z-index: 100000; padding: 20px;
    animation: fadeIn 0.4s var(--ease);
}
.game-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.game-box {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; padding: 40px 28px; text-align: center;
    max-width: 380px; width: 100%;
    animation: scaleIn 0.5s var(--ease);
}
@keyframes scaleIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.game-hearts { font-size: 1.8rem; margin-bottom: 16px; animation: pulse 1.2s infinite; }
.game-question {
    font-family: var(--serif); font-size: 1.6rem; font-weight: 400;
    margin-bottom: 8px; color: var(--text);
}
.game-sub { font-size: 0.8rem; color: var(--text-soft); margin-bottom: 28px; }

.game-buttons {
    display: flex; gap: 14px; justify-content: center; align-items: center;
    flex-wrap: wrap; min-height: 60px; position: relative;
}

.game-btn {
    font-family: var(--sans); font-size: 0.85rem; letter-spacing: 1px;
    padding: 12px 28px; border-radius: 25px; border: none;
    cursor: pointer; transition: all 0.3s ease; font-weight: 500;
}

.yes-btn {
    background: linear-gradient(135deg, var(--pink), var(--rose));
    color: #fff;
}
.yes-btn:hover { transform: scale(1.05); box-shadow: 0 6px 25px rgba(232,160,191,0.3); }

.no-btn {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-soft); position: relative;
    transition: all 0.15s ease;
}

.game-msg {
    margin-top: 20px; font-size: 0.8rem; color: var(--pink);
    font-style: italic; min-height: 20px;
    animation: fadeIn 0.3s ease;
}

/* Result */
.result-box { max-width: 420px; }
.result-hearts { font-size: 2.5rem; margin-bottom: 16px; animation: pulse 1s infinite; }
.result-title {
    font-family: var(--serif); font-size: 2rem; color: var(--pink); margin-bottom: 16px;
}
.result-text {
    font-size: 0.9rem; color: rgba(242,237,232,0.75); line-height: 1.9;
    font-weight: 300; margin-bottom: 28px;
}

/* Secret hint on hours box */
.cd-secret { cursor: pointer; transition: all 0.3s ease; position: relative; }
.cd-secret:hover { border-color: rgba(232,160,191,0.25); }
.cd-secret::after {
    content: '♥'; position: absolute; top: 4px; right: 6px;
    font-size: 0.5rem; color: var(--pink); opacity: 0.3;
    animation: pulse 2s infinite;
}

/* ============ LOCKED STATE (before countdown ends) ============ */
body.locked { overflow: hidden; }
body.locked .chapter:not(.chapter-countdown) { display: none; }
body.locked #progress { display: none; }

/* ============ CHAPTERS ============ */
.chapter {
    min-height: 100vh; min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 60px 20px; position: relative; z-index: 2;
}
.chapter-inner { max-width: 600px; width: 100%; text-align: center; }

/* ============ ANIMATION SYSTEM ============ */
.anim {
    opacity: 0; transform: translateY(40px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.anim.show { opacity: 1; transform: translateY(0); }

/* ============ COUNTDOWN ============ */
.countdown-label {
    font-family: var(--serif); font-size: 0.8rem;
    letter-spacing: 3px; text-transform: uppercase;
    color: var(--pink); margin-bottom: 24px;
}
.countdown-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 10px; margin-bottom: 30px;
}
.cd-box {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; padding: 18px 8px; text-align: center;
    transition: border-color 0.3s ease;
}
.cd-num {
    display: block; font-family: var(--serif);
    font-size: 2rem; font-weight: 300; color: var(--text); line-height: 1.2;
}
.cd-unit {
    display: block; font-size: 0.65rem; letter-spacing: 1px;
    text-transform: uppercase; color: var(--text-soft); margin-top: 4px;
}
.countdown-quote {
    font-family: var(--serif); font-size: 1rem; font-style: italic;
    color: var(--text-soft); line-height: 1.7; max-width: 400px; margin: 0 auto 20px;
}
.scroll-cue {
    font-size: 0.75rem; color: var(--text-soft); letter-spacing: 1px;
    animation: softBounce 2.5s ease-in-out infinite;
}
@keyframes softBounce { 0%,100%{transform:translateY(0);opacity:.4} 50%{transform:translateY(6px);opacity:.9} }

/* ============ HERO ============ */
.float-heart {
    font-size: 2rem; color: var(--pink); margin-bottom: 16px;
    display: inline-block; animation: floatH 3s ease-in-out infinite;
}
@keyframes floatH { 0%,100%{transform:translateY(0) scale(1)} 50%{transform:translateY(-10px) scale(1.05)} }
.date-tag {
    font-family: var(--serif); font-size: 0.75rem; letter-spacing: 3px;
    text-transform: uppercase; color: var(--gold); margin-bottom: 16px;
}
.hero-title {
    font-family: var(--serif); font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 300; line-height: 1.15; margin-bottom: 14px;
}
.hero-sub {
    font-family: var(--serif); font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    font-weight: 300; font-style: italic; color: var(--text-soft); margin-bottom: 24px;
}
.hero-note { font-size: 0.85rem; color: var(--text-soft); font-weight: 300; }
.divider { width: 40px; height: 1px; background: var(--pink); margin: 18px auto; opacity: 0.4; }

/* ============ CHAPTER TITLES ============ */
.ch-label {
    font-family: var(--serif); font-size: 0.75rem; letter-spacing: 3px;
    text-transform: uppercase; color: var(--pink); margin-bottom: 12px;
}
.ch-title {
    font-family: var(--serif); font-size: clamp(1.6rem, 6vw, 2.8rem);
    font-weight: 300; line-height: 1.25; margin-bottom: 35px;
}

/* ============ TIMELINE ============ */
.timeline { position: relative; padding: 10px 0; text-align: left; }
.tl-line {
    position: absolute; left: 11px; top: 0; bottom: 0; width: 1px;
    background: linear-gradient(to bottom, transparent, var(--pink), var(--gold), transparent);
}
.tl-item { position: relative; padding-left: 42px; margin-bottom: 35px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-dot {
    position: absolute; left: 0; top: 3px; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; color: var(--pink); background: var(--bg);
    border: 1px solid var(--pink); border-radius: 50%; transition: all 0.5s ease;
}
.tl-item.show .tl-dot { background: var(--pink-glow); box-shadow: 0 0 10px rgba(232,160,191,0.25); }
.tl-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 22px 18px; transition: all 0.4s var(--ease);
}
.tl-card:hover { border-color: rgba(232,160,191,0.15); transform: translateX(4px); }
.highlight-card { border-color: rgba(232,160,191,0.12) !important; background: rgba(232,160,191,0.03) !important; }
.tl-date {
    display: inline-block; font-family: var(--serif); font-size: 0.7rem;
    letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; opacity: 0.8;
}
.tl-card h3 { font-family: var(--serif); font-size: 1.1rem; font-weight: 400; margin-bottom: 8px; color: var(--text); }
.tl-card p { font-size: 0.85rem; color: var(--text-soft); font-weight: 300; line-height: 1.75; }
.tl-badge {
    display: inline-block; margin-top: 12px; font-family: var(--serif); font-size: 0.7rem;
    letter-spacing: 1px; color: var(--pink); background: var(--pink-glow);
    padding: 5px 12px; border-radius: 20px; font-style: italic;
}

/* ============ REASONS ============ */
.reasons { text-align: left; max-width: 500px; margin: 0 auto; }
.reason {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 0;
    border-bottom: 1px solid var(--border); font-size: 0.88rem;
    color: rgba(242,237,232,0.7); font-weight: 300; transition: all 0.3s ease;
}
.reason:last-child { border-bottom: none; }
.reason:hover { padding-left: 6px; color: var(--text); }
.r-heart { color: var(--pink); flex-shrink: 0; font-size: 0.7rem; margin-top: 4px; transition: transform 0.3s ease; }
.reason:hover .r-heart { transform: scale(1.3); }

/* ============ LETTER ============ */
.letter {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 35px 24px; text-align: left; position: relative;
}
.letter::before {
    content: '"'; position: absolute; top: 10px; left: 18px;
    font-family: var(--serif); font-size: 3.5rem; color: var(--pink); opacity: 0.1; line-height: 1;
}
.letter p { font-size: 0.9rem; line-height: 2; color: rgba(242,237,232,0.7); font-weight: 300; margin-bottom: 14px; }
.letter-opening { font-family: var(--serif) !important; font-style: italic !important; color: var(--pink) !important; font-size: 1rem !important; }
.letter-close { font-family: var(--serif) !important; font-style: italic !important; color: var(--gold) !important; margin-top: 20px !important; }

/* ============ VOICE ============ */
.voice-desc { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 28px; font-weight: 300; }
.voice-box {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 30px 20px; text-align: center;
}
.wave-bars {
    display: flex; align-items: center; justify-content: center;
    gap: 3px; height: 45px; margin-bottom: 22px;
}
.wave-bars span {
    display: block; width: 3px; height: 12px; background: var(--pink);
    border-radius: 3px; animation: wv 1.3s ease-in-out infinite; opacity: 0.35;
}
.wave-bars.playing span { opacity: 1; }
.wave-bars span:nth-child(1){animation-delay:0s}
.wave-bars span:nth-child(2){animation-delay:.07s}
.wave-bars span:nth-child(3){animation-delay:.14s}
.wave-bars span:nth-child(4){animation-delay:.21s}
.wave-bars span:nth-child(5){animation-delay:.28s}
.wave-bars span:nth-child(6){animation-delay:.35s}
.wave-bars span:nth-child(7){animation-delay:.42s}
.wave-bars span:nth-child(8){animation-delay:.49s}
.wave-bars span:nth-child(9){animation-delay:.42s}
.wave-bars span:nth-child(10){animation-delay:.35s}
.wave-bars span:nth-child(11){animation-delay:.28s}
.wave-bars span:nth-child(12){animation-delay:.21s}
.wave-bars span:nth-child(13){animation-delay:.14s}
.wave-bars span:nth-child(14){animation-delay:.07s}
.wave-bars span:nth-child(15){animation-delay:.1s}
.wave-bars span:nth-child(16){animation-delay:.17s}
.wave-bars span:nth-child(17){animation-delay:.24s}
.wave-bars span:nth-child(18){animation-delay:.31s}
.wave-bars span:nth-child(19){animation-delay:.24s}
.wave-bars span:nth-child(20){animation-delay:.17s}
@keyframes wv { 0%,100%{height:12px} 50%{height:35px} }
.play-btn {
    font-family: var(--sans); font-size: 0.8rem; letter-spacing: 1.5px;
    background: transparent; border: 1px solid var(--pink); color: var(--pink);
    padding: 11px 28px; border-radius: 25px; cursor: pointer; transition: all 0.3s ease;
}
.play-btn:hover, .play-btn.active { background: var(--pink); color: var(--bg); }
.voice-hint { margin-top: 14px; font-size: 0.65rem; color: var(--text-soft); opacity: 0.4; }

/* ============ PROMISES ============ */
.promises { text-align: left; max-width: 520px; margin: 0 auto; }
.promise {
    display: flex; gap: 16px; align-items: flex-start; padding: 22px 0;
    border-bottom: 1px solid var(--border); transition: all 0.3s ease;
}
.promise:last-child { border-bottom: none; }
.promise:hover { padding-left: 5px; }
.p-num { font-family: var(--serif); font-size: 1.3rem; color: var(--pink); opacity: 0.35; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.promise p { font-size: 0.88rem; color: rgba(242,237,232,0.7); font-weight: 300; line-height: 1.8; }

/* ============ FINALE ============ */
.chapter-final { min-height: 100vh; min-height: 100dvh; }
.final-heart { font-size: 3rem; color: var(--pink); margin-bottom: 20px; display: inline-block; animation: pulse 1.2s ease-in-out infinite; }
.final-title {
    font-family: var(--serif); font-size: clamp(2.5rem, 10vw, 5rem); font-weight: 300; margin-bottom: 10px;
    background: linear-gradient(135deg, var(--pink), var(--gold));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.final-sub { font-family: var(--serif); font-size: 1rem; font-style: italic; color: var(--text-soft); margin-bottom: 20px; }
.final-msg { font-size: 0.9rem; color: rgba(242,237,232,0.65); font-weight: 300; line-height: 2; max-width: 450px; margin: 0 auto 24px; }
.final-sign { font-family: var(--serif); font-style: italic; font-size: 0.9rem; color: var(--gold); opacity: 0.7; margin-bottom: 35px; }
.celebrate-btn {
    font-family: var(--sans); font-size: 0.85rem; letter-spacing: 1px;
    background: linear-gradient(135deg, var(--pink), var(--rose)); border: none; color: #fff;
    padding: 14px 35px; border-radius: 25px; cursor: pointer; transition: all 0.4s var(--ease);
}
.celebrate-btn:hover { transform: scale(1.06); box-shadow: 0 8px 30px rgba(232,160,191,0.25); }

/* ============ FX CANVAS ============ */
#fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99998; opacity: 0; transition: opacity 0.3s ease; }
#fx-canvas.active { opacity: 1; }

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(232,160,191,0.3); border-radius: 2px; }
