/* ============================================================
   PROPOSAL WEBSITE - STYLE SYSTEM
   A romantic, cinematic experience
   ============================================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
    --bg-dark: #0a0208;
    --bg-deep: #1a0a14;
    --rose: #c9184a;
    --rose-light: #e8a0bf;
    --rose-glow: rgba(201, 24, 74, 0.4);
    --gold: #d4a373;
    --gold-bright: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.35);
    --cream: #fff5e4;
    --blush: #ffddd2;
    --text: #f5f0eb;
    --text-dim: rgba(245, 240, 235, 0.6);
    --glass-bg: rgba(30, 10, 20, 0.65);
    --glass-border: rgba(245, 240, 235, 0.12);

    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Cormorant Garamond', Garamond, serif;
    --font-script: 'Great Vibes', cursive;

    --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-med: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text);
    overflow: hidden;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

input {
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* --- Screen System --- */
.screen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

.screen.exit {
    opacity: 0;
    visibility: hidden;
    z-index: 5;
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
#screen-loading {
    background: var(--bg-dark);
    z-index: 100;
    flex-direction: column;
}

.loading-content {
    text-align: center;
}

.loading-heart {
    font-size: clamp(3rem, 8vw, 5rem);
    color: var(--rose);
    animation: heartbeat 1.2s ease-in-out infinite;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px var(--rose-glow));
}

.loading-text {
    font-family: var(--font-body);
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: var(--text-dim);
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
    font-weight: 300;
}

.progress-bar {
    width: clamp(200px, 60vw, 320px);
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 0.75rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--rose), var(--gold));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
#screen-login {
    background: radial-gradient(ellipse at 50% 80%, var(--bg-deep), var(--bg-dark));
}

/* Floating Hearts Container */
.floating-hearts {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.floating-heart {
    position: absolute;
    bottom: -30px;
    opacity: 0;
    animation: floatUpHeart var(--duration, 8s) var(--delay, 0s) infinite linear;
    pointer-events: none;
    will-change: transform, opacity;
}

@keyframes floatUpHeart {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(0deg) scale(0.5);
    }
    8% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.5;
    }
    92% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-110vh) rotate(var(--rotate, 360deg)) scale(1);
    }
}

/* ============================================================
   NAME GATE SCREEN
   ============================================================ */
#screen-namegate {
    background: radial-gradient(ellipse at 50% 80%, var(--bg-deep), var(--bg-dark));
}

.namegate-card {
    position: relative;
    z-index: 1;
    width: clamp(320px, 88vw, 440px);
    padding: clamp(2rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
    text-align: center;
    animation: fadeSlideUp 0.8s ease-out;
}

.namegate-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    animation: heartbeat 1.2s ease-in-out infinite;
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.login-card {
    position: relative;
    z-index: 1;
    width: clamp(320px, 88vw, 440px);
    padding: clamp(2rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
    text-align: center;
    animation: fadeSlideUp 0.8s ease-out;
}

.lock-icon {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    animation: gentleBounce 2s ease-in-out infinite;
}

.login-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4.5vw, 2rem);
    font-weight: 700;
    color: var(--cream);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.login-subtitle {
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    color: var(--text-dim);
    margin-bottom: 2rem;
    font-weight: 300;
    font-style: italic;
}

.question-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.question-label {
    display: block;
    font-size: clamp(0.85rem, 2.2vw, 0.95rem);
    color: var(--rose-light);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.question-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.question-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.question-input:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px var(--rose-glow);
    outline: none;
}

.btn-unlock {
    width: 100%;
    padding: 1rem;
    margin-top: 0.75rem;
    background: linear-gradient(135deg, var(--rose), #a01040);
    color: white;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 14px;
    letter-spacing: 0.05em;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: 0 4px 20px var(--rose-glow);
}

.btn-unlock:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px var(--rose-glow);
}

.btn-unlock:active {
    transform: translateY(0);
}

.error-msg {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--rose-light);
    min-height: 1.4em;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.error-msg.visible {
    opacity: 1;
}

.login-card.shake {
    animation: shakeCard 0.5s ease-in-out;
}

/* ============================================================
   VALENTINE GREETING SCREEN
   ============================================================ */
#screen-valentine {
    background: radial-gradient(ellipse at 50% 30%, #2a0a18, var(--bg-dark));
    flex-direction: column;
    overflow: hidden;
}

.valentine-hearts {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.valentine-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 600px;
}

/* Envelope animation */
.envelope {
    position: relative;
    width: 100px;
    height: 70px;
    margin: 0 auto 2.5rem;
    animation: envelopeFloat 3s ease-in-out infinite;
}

.envelope-body {
    position: absolute;
    bottom: 0;
    width: 100px;
    height: 60px;
    background: linear-gradient(135deg, var(--rose), #e05080);
    border-radius: 4px 4px 12px 12px;
    box-shadow: 0 4px 20px var(--rose-glow);
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-top: 40px solid #b01548;
    z-index: 1;
    animation: flapOpen 2s ease-in-out infinite alternate;
    transform-origin: top center;
}

.envelope-heart {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    z-index: 2;
    animation: heartPulse 1.5s ease-in-out infinite;
}

.valentine-title {
    font-family: var(--font-script);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    color: var(--cream);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 40px var(--rose-glow);
    animation: fadeSlideUp 1s ease-out 0.3s both;
}

.valentine-name {
    font-family: var(--font-script);
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: var(--gold);
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 1s ease-out 0.6s both;
}

.valentine-message {
    font-size: clamp(1rem, 2.8vw, 1.15rem);
    color: var(--text-dim);
    line-height: 1.8;
    margin-bottom: 2.5rem;
    font-weight: 300;
    animation: fadeSlideUp 1s ease-out 0.9s both;
}

.btn-gift {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--gold), #c08850);
    color: var(--bg-dark);
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2.8vw, 1.15rem);
    font-weight: 700;
    border-radius: 50px;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 24px var(--gold-glow);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    animation: fadeSlideUp 1s ease-out 1.2s both, glowPulse 2s ease-in-out 2.2s infinite;
}

.btn-gift:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 32px var(--gold-glow);
}

.btn-gift-sparkle {
    animation: sparkleRotate 3s linear infinite;
}

/* ============================================================
   STORYBOOK SCREEN
   ============================================================ */
#screen-storybook {
    background: var(--bg-dark);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}

/* Progress bar at top */
.story-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 20;
}

.story-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--rose), var(--gold));
    transition: width var(--transition-med);
}

/* Storybook container */
.storybook-container {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.story-page {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.story-page.active {
    opacity: 1;
}

/* Image - dual-layer: blurred bg + contained foreground */
.story-image-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
}

.story-image-bg {
    position: absolute;
    inset: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    object-fit: cover;
    object-position: center;
    filter: blur(28px) brightness(0.35) saturate(1.4);
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.story-image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: opacity 0.5s ease;
    will-change: transform, opacity;
}

.story-image.ken-burns {
    animation: kenBurnsZoom 14s ease-in-out infinite alternate;
}

@keyframes kenBurnsZoom {
    0% {
        transform: scale(1.0) translate(0, 0);
    }
    100% {
        transform: scale(1.08) translate(-0.5%, -0.5%);
    }
}

/* Caption overlay at bottom - fades as ONE unit via inline style opacity */
.story-caption-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 15;
    padding: clamp(1.5rem, 5vw, 3rem) clamp(1.5rem, 5vw, 2.5rem);
    padding-bottom: clamp(5rem, 12vw, 6.5rem);
    background: linear-gradient(
        to top,
        rgba(10, 2, 8, 0.95) 0%,
        rgba(10, 2, 8, 0.8) 40%,
        rgba(10, 2, 8, 0.4) 70%,
        transparent 100%
    );
    text-align: center;
    pointer-events: none;
    /* Opacity controlled via JS inline style - this transition makes it smooth */
    transition: opacity 0.6s ease;
}

.story-chapter {
    font-family: var(--font-heading);
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.75rem;
    font-weight: 400;
    /* Always visible - parent overlay controls fade */
}

.story-caption {
    font-family: var(--font-body);
    font-size: clamp(1.05rem, 3.2vw, 1.35rem);
    color: var(--cream);
    line-height: 1.7;
    font-weight: 300;
    font-style: italic;
    max-width: 500px;
    margin: 0 auto;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
    /* Always visible - parent overlay controls fade */
}

/* Navigation */
.story-nav {
    position: absolute;
    bottom: clamp(1.2rem, 3vw, 2rem);
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 20;
}

.story-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.story-nav-btn:hover {
    transform: scale(1.1);
    background: rgba(201, 24, 74, 0.3);
}

.story-nav-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}

.story-counter {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    min-width: 50px;
    text-align: center;
}

/* ============================================================
   TWIST SCREEN
   ============================================================ */
#screen-twist {
    background: var(--bg-dark);
    flex-direction: column;
}

.twist-content {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
}

.twist-line {
    font-family: var(--font-body);
    font-size: clamp(1.2rem, 3.5vw, 1.6rem);
    color: var(--cream);
    line-height: 2;
    font-weight: 300;
    min-height: 3em;
}

.twist-line .cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--rose);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 0.8s step-end infinite;
}

/* ============================================================
   PROPOSAL SCREEN
   ============================================================ */
#screen-proposal {
    background: var(--bg-dark);
    overflow: hidden;
    align-items: stretch;
    justify-content: flex-start;
}

.proposal-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--bg-dark);
}

.proposal-bg-blur {
    position: absolute;
    inset: -30px;
    width: calc(100% + 60px);
    height: calc(100% + 60px);
    object-fit: cover;
    filter: blur(30px) brightness(0.3) saturate(1.3);
    z-index: 0;
    pointer-events: none;
}

.proposal-bg-image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.proposal-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10, 2, 8, 0.85) 0%,
        rgba(10, 2, 8, 0.5) 40%,
        rgba(10, 2, 8, 0.2) 70%,
        rgba(10, 2, 8, 0.35) 100%
    );
    z-index: 1;
}

.proposal-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    padding-bottom: clamp(3rem, 10vw, 5rem);
}

.proposal-question {
    font-family: var(--font-script);
    font-size: clamp(2.5rem, 9vw, 5rem);
    color: var(--cream);
    text-shadow:
        0 0 40px var(--gold-glow),
        0 0 80px rgba(212, 163, 115, 0.2);
    margin-bottom: 2.5rem;
    animation: fadeSlideUp 1.2s ease-out 0.5s both;
}

.proposal-buttons {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 4vw, 2rem);
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 1s ease-out 1.2s both;
}

.btn-yes {
    padding: clamp(0.9rem, 2.5vw, 1.2rem) clamp(2rem, 6vw, 3.5rem);
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    color: var(--bg-dark);
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 3.5vw, 1.6rem);
    font-weight: 700;
    border-radius: 60px;
    letter-spacing: 0.04em;
    box-shadow:
        0 0 30px var(--gold-glow),
        0 0 60px rgba(255, 215, 0, 0.15);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    animation: glowPulse 2s ease-in-out infinite;
}

.btn-yes:hover {
    transform: scale(1.08);
    box-shadow:
        0 0 40px var(--gold-glow),
        0 0 80px rgba(255, 215, 0, 0.25);
}

.btn-no {
    padding: 0.7rem 1.5rem;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 0.95rem;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background var(--transition-fast);
    position: relative;
}

.btn-no.runaway {
    position: fixed !important;
    z-index: 99999 !important;
    transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                background var(--transition-fast);
}

.btn-no.runaway.bounce {
    animation: noBounce 0.5s ease;
}

@keyframes noBounce {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(0.8) rotate(-5deg); }
    50% { transform: scale(1.2) rotate(3deg); }
    75% { transform: scale(0.95) rotate(-1deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.no-message {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    color: var(--rose-light);
    font-style: italic;
    min-height: 1.5em;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.no-message.visible {
    opacity: 1;
}

/* Rose petals (proposal screen decoration) */
.rose-petals {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.rose-petal {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--rose);
    border-radius: 50% 0 50% 50%;
    opacity: 0;
    animation: fallPetal var(--duration, 6s) var(--delay, 0s) infinite linear;
    will-change: transform, opacity;
}

@keyframes fallPetal {
    0% {
        opacity: 0;
        transform: translateY(-20px) rotate(0deg) scale(0.5);
    }
    10% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(105vh) rotate(var(--rotate, 720deg)) translateX(var(--drift, 50px)) scale(1);
    }
}

/* ============================================================
   CELEBRATION SCREEN
   ============================================================ */
#screen-celebration {
    background: radial-gradient(ellipse at 50% 50%, #1a0a14, var(--bg-dark));
    flex-direction: column;
    overflow: hidden;
}

#confetti-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.celebration-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
}

.celebration-ring {
    font-size: clamp(4rem, 12vw, 7rem);
    margin-bottom: 1rem;
    animation: ringBounce 1s ease-out, ringFloat 3s ease-in-out 1s infinite;
    filter: drop-shadow(0 0 30px var(--gold-glow));
}

.celebration-title {
    font-family: var(--font-script);
    font-size: clamp(3rem, 10vw, 5.5rem);
    color: var(--gold-bright);
    text-shadow: 0 0 40px var(--gold-glow);
    margin-bottom: 0.5rem;
    animation: fadeSlideUp 1s ease-out 0.3s both;
}

.celebration-subtitle {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    color: var(--cream);
    letter-spacing: 0.15em;
    font-weight: 400;
    margin-bottom: 1.5rem;
    animation: fadeSlideUp 1s ease-out 0.6s both;
}

.celebration-hearts {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 2rem;
    animation: fadeSlideUp 1s ease-out 0.9s both;
}

.celebration-hearts span {
    color: var(--rose);
    animation: heartbeat 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px var(--rose-glow));
}

.celebration-hearts span:nth-child(2) {
    animation-delay: 0.2s;
}

.celebration-hearts span:nth-child(3) {
    animation-delay: 0.4s;
}

.celebration-message {
    font-family: var(--font-body);
    font-size: clamp(1rem, 3vw, 1.25rem);
    color: var(--text-dim);
    font-style: italic;
    font-weight: 300;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.7;
    animation: fadeSlideUp 1s ease-out 1.2s both;
}

/* ============================================================
   MUSIC TOGGLE
   ============================================================ */
.music-toggle {
    position: fixed;
    top: clamp(1rem, 3vw, 1.5rem);
    right: clamp(1rem, 3vw, 1.5rem);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform var(--transition-fast), opacity var(--transition-med);
}

.music-toggle:hover {
    transform: scale(1.1);
}

.music-toggle.hidden {
    opacity: 0;
    pointer-events: none;
}

.music-toggle.playing #music-icon {
    animation: musicPulse 1s ease-in-out infinite;
}

.music-toggle.muted {
    opacity: 0.5;
}

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.1); }
    60% { transform: scale(1); }
}

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

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes shakeCard {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px) rotate(-0.5deg); }
    30% { transform: translateX(8px) rotate(0.5deg); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
    90% { transform: translateX(3px); }
}

@keyframes envelopeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes flapOpen {
    0% { transform: perspective(200px) rotateX(0deg); }
    100% { transform: perspective(200px) rotateX(-30deg); }
}

@keyframes heartPulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px var(--gold-glow);
    }
    50% {
        box-shadow: 0 0 40px var(--gold-glow), 0 0 60px rgba(255, 215, 0, 0.15);
    }
}

@keyframes sparkleRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes blink {
    50% { opacity: 0; }
}

@keyframes ringBounce {
    0% { transform: scale(0) rotate(-30deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(10deg); opacity: 1; }
    70% { transform: scale(0.9) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes ringFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes musicPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Small phones */
@media (max-width: 380px) {
    .login-card {
        padding: 1.5rem 1.25rem;
        width: 95vw;
        border-radius: 18px;
    }

    .question-input {
        padding: 0.75rem 0.85rem;
    }

    .story-caption {
        font-size: 0.95rem;
    }
}

/* Tablets and larger */
@media (min-width: 768px) {
    .story-caption-overlay {
        padding-bottom: 5rem;
    }

    .login-card {
        padding: 3rem 2.5rem;
    }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
    .login-card {
        padding: 1rem 2rem;
    }

    .lock-icon {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .login-title {
        font-size: 1.3rem;
        margin-bottom: 0.25rem;
    }

    .login-subtitle {
        margin-bottom: 0.75rem;
    }

    .question-group {
        margin-bottom: 0.5rem;
    }

    .valentine-title {
        font-size: 2.5rem;
    }

    .story-caption-overlay {
        padding: 1rem 1.5rem 4rem;
    }

    .proposal-question {
        font-size: 2.5rem;
    }
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
