* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --pink: #ffb6c1;
    --pink-deep: #ff69b4;
    --lavender: #e6e6fa;
    --mint: #b2dfdb;
    --peach: #ffdab9;
    --cream: #fff8f0;
    --gold: #ffd700;
    --text: #5a4a6a;
    --text-light: #8b7a9e;
}

html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--cream);
    color: var(--text);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255, 182, 193, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(230, 230, 250, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(178, 223, 219, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Floating particles */
#floating-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.floating-item {
    position: absolute;
    animation: floatUp linear forwards;
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes floatUp {
    0% { opacity: 0; transform: translateY(100vh) rotate(0deg) scale(0.5); }
    10% { opacity: 0.8; }
    90% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-10vh) rotate(360deg) scale(1); }
}

/* App / screens */
#app {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    z-index: 2;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(40px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) calc(24px + env(safe-area-inset-left));
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen.tall {
    justify-content: flex-start;
    padding-top: calc(20px + env(safe-area-inset-top));
    gap: 0;
}

.screen.tall .next-btn {
    margin-top: auto;
    flex-shrink: 0;
    margin-bottom: env(safe-area-inset-bottom);
}

.screen.tall .section-title {
    margin-bottom: 8px;
    flex-shrink: 0;
}

.screen.tall .section-sub {
    margin-bottom: 12px;
    flex-shrink: 0;
}

.screen.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.screen.prev {
    opacity: 0;
    transform: translateY(-40px) scale(0.98);
}

/* Progress dots */
.progress-dots {
    position: fixed;
    right: calc(14px + env(safe-area-inset-right));
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
    pointer-events: none;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 105, 180, 0.25);
    transition: all 0.4s ease;
}

.dot.active {
    background: var(--pink-deep);
    transform: scale(1.5);
    box-shadow: 0 0 12px rgba(255, 105, 180, 0.6);
}

.dot.done {
    background: rgba(255, 105, 180, 0.55);
}

/* Hero */
.hero-content { text-align: center; }

.sparkle-text {
    font-family: 'Pacifico', cursive;
    font-size: clamp(2rem, 6vw, 4.5rem);
    background: linear-gradient(135deg, var(--pink-deep), #c084fc, var(--pink-deep));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    margin-bottom: 20px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.name-reveal {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 20px;
}

.letter {
    font-family: 'Pacifico', cursive;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--pink-deep);
    display: inline-block;
    animation: letterBounce 0.6s ease calc(var(--i) * 0.1s) both;
    text-shadow: 2px 2px 4px rgba(255, 105, 180, 0.3);
}

@keyframes letterBounce {
    0% { opacity: 0; transform: translateY(-60px) scale(0.5) rotate(-10deg); }
    60% { transform: translateY(10px) scale(1.1) rotate(3deg); }
    100% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}

.subtitle {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.heart-beat {
    display: inline-block;
    animation: heartbeat 1s ease infinite;
    color: var(--pink-deep);
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
}

/* Story screens */
.story-content {
    text-align: center;
    max-width: 560px;
    width: 100%;
}

.story-emoji {
    margin-bottom: 28px;
    animation: iconFloat 3s ease infinite;
}

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

.story-text {
    font-size: clamp(1.1rem, 2.6vw, 1.5rem);
    line-height: 1.8;
    color: var(--text);
    min-height: 6em;
    margin-bottom: 36px;
    font-weight: 600;
}

.story-text::after {
    content: '|';
    color: var(--pink-deep);
    animation: blink 0.9s step-end infinite;
    opacity: 0;
}

.story-text.typing::after { opacity: 1; }

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

/* Section title */
.section-title {
    font-family: 'Pacifico', cursive;
    font-size: clamp(1.4rem, 4vw, 2.3rem);
    color: var(--pink-deep);
    margin-bottom: 30px;
    text-align: center;
}

.section-sub {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 24px;
    text-align: center;
}

/* Magic Button */
.magic-btn {
    position: relative;
    padding: 16px 40px;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--pink-deep), #c084fc);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease;
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.4);
    -webkit-tap-highlight-color: transparent;
}

.magic-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 105, 180, 0.5);
}

.magic-btn:active { transform: scale(0.96); }

.magic-btn.small { padding: 12px 30px; font-size: 1rem; }

.magic-btn::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
    animation: btnShine 3s ease infinite;
}

@keyframes btnShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.next-btn {
    margin-top: 30px;
    animation: nextBtnPulse 2s ease infinite;
}

.next-btn.hidden {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    pointer-events: none;
}

.next-btn.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

@keyframes nextBtnPulse {
    0%, 100% { box-shadow: 0 8px 25px rgba(255, 105, 180, 0.4); }
    50% { box-shadow: 0 8px 35px rgba(255, 105, 180, 0.7); }
}

/* Cake */
.cake-wrapper { text-align: center; }
.cake { position: relative; margin: 0 auto; }

.candle-group {
    display: flex;
    justify-content: center;
    gap: 18px;
    position: relative;
    z-index: 2;
    margin-bottom: -5px;
}

.candle {
    width: 10px; height: 40px;
    background: linear-gradient(180deg, #fff5f5, var(--pink));
    border-radius: 3px 3px 0 0;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.candle:hover { transform: scale(1.1); }
.candle.blown { cursor: default; }

.flame {
    position: absolute;
    top: -18px; left: 50%;
    transform: translateX(-50%);
    width: 12px; height: 18px;
    background: radial-gradient(ellipse at bottom, #ffdd57 30%, #ff9500 60%, transparent 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flicker 0.3s ease infinite alternate;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.candle.blown .flame { opacity: 0; transform: translateX(-50%) scale(0); }

.wick {
    position: absolute;
    bottom: -4px; left: 50%;
    transform: translateX(-50%);
    width: 2px; height: 6px;
    background: #333; border-radius: 1px;
}

@keyframes flicker {
    0% { transform: translateX(-50%) scale(1) rotate(-2deg); }
    100% { transform: translateX(-50%) scale(1.05) rotate(2deg); }
}

.smoke {
    position: absolute;
    top: -20px; left: 50%;
    width: 8px; height: 8px;
    background: rgba(150,150,150,0.4);
    border-radius: 50%;
    animation: smokeRise 1s ease-out forwards;
    transform: translateX(-50%);
}

@keyframes smokeRise {
    0% { opacity: 0.6; transform: translateX(-50%) translateY(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(2); }
}

.cake-top {
    width: 180px; height: 30px;
    background: linear-gradient(135deg, #fff5f5, var(--pink));
    border-radius: 10px 10px 0 0;
    position: relative;
    margin: 0 auto;
}

.cake-top::before {
    content: '';
    position: absolute;
    top: 0; left: 10px; right: 10px;
    height: 8px;
    background: repeating-linear-gradient(90deg, var(--pink-deep) 0px, var(--pink-deep) 8px, white 8px, white 16px);
    border-radius: 4px;
}

.cake-layer { margin: 0 auto; }
.layer-1 { width: 200px; height: 40px; background: linear-gradient(135deg, var(--lavender), #d8bfd8); border-radius: 5px; }
.layer-2 { width: 230px; height: 40px; background: linear-gradient(135deg, var(--mint), #a8d8c8); }
.layer-3 { width: 260px; height: 40px; background: linear-gradient(135deg, var(--peach), #ffcba4); border-radius: 0 0 15px 15px; }
.cake-plate { width: 280px; height: 12px; background: linear-gradient(135deg, #e8e8e8, white); margin: 0 auto; border-radius: 0 0 10px 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

.blow-hint {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 20px;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Wishes */
.wishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: 900px;
    width: 100%;
}

.wish-card {
    background: white;
    border-radius: 20px;
    padding: 26px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    animation: cardAppear 0.6s ease calc(var(--delay) * 0.15s) both;
}

.wish-card:hover {
    transform: translateY(-10px) rotate(-1deg);
    box-shadow: 0 20px 40px rgba(255, 105, 180, 0.15);
}

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

.wish-icon {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconFloat 3s ease infinite;
}

.wish-card h3 { font-size: 1.25rem; margin-bottom: 8px; color: var(--pink-deep); }
.wish-card p { color: var(--text-light); font-size: 0.92rem; line-height: 1.5; }

/* Reasons */
.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    max-width: 880px;
    width: 100%;
    perspective: 1000px;
}

.reason-card {
    height: 180px;
    cursor: pointer;
    animation: cardAppear 0.6s ease calc(var(--delay) * 0.12s) both;
    -webkit-tap-highlight-color: transparent;
}

.reason-inner {
    position: relative;
    width: 100%; height: 100%;
    transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
}

.reason-card.flipped .reason-inner { transform: rotateY(180deg); }

.reason-front, .reason-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px;
    text-align: center;
}

.reason-front {
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.reason-back {
    background: linear-gradient(135deg, #ffe4f0, #f0e4ff);
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.2);
    transform: rotateY(180deg);
}

.reason-icon { margin-bottom: 10px; animation: iconFloat 3s ease infinite; }
.reason-front h3 { font-size: 1.15rem; color: var(--pink-deep); margin: 0; }
.reason-back p { color: var(--text); font-size: 0.92rem; line-height: 1.6; }

/* Letter / Envelope */
.envelope-wrapper { text-align: center; }

.envelope {
    width: 280px; height: 180px;
    margin: 0 auto 20px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.envelope:hover { transform: scale(1.05); }

.envelope-back {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--pink), var(--lavender));
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.envelope-front {
    position: absolute;
    bottom: 0;
    width: 100%; height: 65%;
    background: linear-gradient(135deg, #ffd1e8, var(--pink));
    border-radius: 0 0 10px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.envelope-heart {
    animation: heartbeat 1.5s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.envelope-flap {
    position: absolute;
    top: 0;
    width: 100%; height: 50%;
    background: linear-gradient(135deg, var(--lavender), var(--pink));
    clip-path: polygon(0 0, 50% 100%, 100% 0);
    z-index: 4;
    transition: transform 0.6s ease, opacity 0.6s ease;
    transform-origin: top;
}

.envelope.opened .envelope-flap {
    transform: rotateX(180deg);
    opacity: 0;
}

.envelope-letter {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: white;
    border-radius: 5px;
    z-index: 2;
    transition: transform 0.7s cubic-bezier(0.34,1.56,0.64,1) 0.3s,
                width 0.7s ease 0.3s, height 0.7s ease 0.3s,
                top 0.7s ease 0.3s, left 0.7s ease 0.3s,
                border-radius 0.7s ease 0.3s, box-shadow 0.7s ease 0.3s;
    overflow: hidden;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.envelope.opened .envelope-letter {
    position: absolute;
    width: 90vw; max-width: 420px;
    height: 65vh; max-height: 400px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(255, 105, 180, 0.3);
    z-index: 30;
}

.letter-content {
    text-align: left;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text);
    opacity: 0;
    transition: opacity 0.5s ease 0.7s;
    height: 100%;
    overflow-y: auto;
    padding-right: 6px;
}

.envelope.opened .letter-content { opacity: 1; }

.dear { font-family: 'Pacifico', cursive; font-size: 1.25rem; color: var(--pink-deep); margin-bottom: 12px; }
.letter-content p { margin-bottom: 10px; }
.signature { margin-top: 14px; font-weight: 700; color: var(--pink-deep); font-size: 0.95rem; }

.envelope-hint {
    color: var(--text-light);
    font-size: 0.9rem;
    animation: pulse 2s ease infinite;
}

/* Когда письмо открыто — экран в режиме оверлея */
.screen.letter-open {
    overflow: visible !important;
}

.screen.letter-open .envelope-wrapper {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(255, 240, 245, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 20px;
}

.screen.letter-open .envelope {
    position: static;
    width: 100%;
    height: 100%;
}

.letter-close {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top));
    right: calc(16px + env(safe-area-inset-right));
    width: 40px; height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--pink-deep);
    color: white;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.letter-close:active { transform: scale(0.9); }
.polaroid-wall {
    position: relative;
    width: 90%;
    max-width: 700px;
    height: 460px;
    margin: 0 auto;
}

.polaroid {
    position: absolute;
    left: var(--x); top: var(--y);
    width: 160px;
    background: white;
    padding: 10px 10px 34px;
    border-radius: 3px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
    transform: rotate(var(--rot));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    cursor: pointer;
    animation: polaroidAppear 0.8s ease both;
    -webkit-tap-highlight-color: transparent;
}

.polaroid:hover {
    transform: rotate(0deg) scale(1.15);
    z-index: 10;
    box-shadow: 0 15px 40px rgba(255, 105, 180, 0.25);
}

@keyframes polaroidAppear {
    from { opacity: 0; transform: rotate(var(--rot)) scale(0.5) translateY(50px); }
    to { opacity: 1; transform: rotate(var(--rot)) scale(1) translateY(0); }
}

.polaroid-img {
    width: 100%; height: 130px;
    background: linear-gradient(135deg, var(--pink), var(--lavender));
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.polaroid-caption {
    text-align: center;
    margin-top: 10px;
    font-family: 'Pacifico', cursive;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Drawing canvas */
.canvas-wrapper {
    position: relative;
    width: 90vw;
    max-width: 500px;
    aspect-ratio: 1;
    margin: 0 auto;
}

#heart-canvas {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: rgba(30, 10, 40, 0.85);
    box-shadow: 0 0 40px rgba(192, 132, 252, 0.2), inset 0 0 30px rgba(0,0,0,0.3);
    cursor: crosshair;
    touch-action: none;
}

.canvas-hint {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
    pointer-events: none;
    animation: pulse 2s ease infinite;
}

.canvas-msg {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Pacifico', cursive;
    font-size: 1.6rem;
    color: #ff69b4;
    text-shadow: 0 0 20px rgba(255,105,180,0.8), 0 0 40px rgba(255,105,180,0.4);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.canvas-msg.show { opacity: 1; }

/* Snake game */
.snake-wrapper {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.snake-score {
    font-family: 'Pacifico', cursive;
    font-size: 1.2rem;
    color: var(--pink-deep);
    margin-bottom: 10px;
}

#snake-canvas {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    background: #1a0a20;
    box-shadow: 0 0 30px rgba(192, 132, 252, 0.15);
    touch-action: none;
}

.snake-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 14px;
}

.snake-controls-row {
    display: flex;
    gap: 4px;
}

.snake-btn {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--pink), var(--lavender));
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.snake-btn:active { transform: scale(0.9); }

@media (max-width: 400px) {
    .snake-btn { width: 48px; height: 48px; font-size: 1.1rem; }
}

/* Timer */
#love-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}

.timer-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    border-radius: 16px;
    padding: 18px 16px 12px;
    min-width: 72px;
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.12);
}

.timer-value {
    font-family: 'Pacifico', cursive;
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    background: linear-gradient(135deg, var(--pink-deep), #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.timer-label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
    text-transform: lowercase;
}

.timer-sep {
    font-family: 'Pacifico', cursive;
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    color: var(--pink);
    animation: sepBlink 1s step-end infinite;
    padding-bottom: 20px;
}

@keyframes sepBlink {
    50% { opacity: 0.3; }
}

.timer-sub {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

@media (max-width: 500px) {
    .timer-unit {
        min-width: 60px;
        padding: 14px 10px 10px;
    }
    .timer-value { font-size: 1.6rem; }
    .timer-label { font-size: 0.7rem; }
    .timer-sep { font-size: 1.2rem; }
    #love-timer { gap: 4px; }
}

/* Finale */
.finale-content { text-align: center; }

.big-heart {
    animation: heartbeat 1s ease infinite;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    transition: transform 0.3s ease;
}

.big-heart:hover { transform: scale(1.15); }
.big-heart.clicked { animation: heartExplode 0.6s ease forwards; }

@keyframes heartExplode {
    0% { transform: scale(1); }
    30% { transform: scale(1.5); }
    100% { transform: scale(0); opacity: 0; }
}

.finale-content h2 {
    font-family: 'Pacifico', cursive;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--pink-deep);
    margin: 20px 0;
}

.finale-text {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 24px;
}

.finale-name {
    font-family: 'Pacifico', cursive;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--pink-deep), #c084fc);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    margin-bottom: 30px;
}

/* Confetti */
#confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translateY(100vh) rotate(720deg) scale(0.5); }
}

/* Responsive — телефоны */
@media (max-width: 600px) {
    .polaroid-wall { height: 420px; }
    .polaroid { width: 120px; padding: 8px 8px 28px; }
    .polaroid-img { height: 95px; }

    .wishes-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        max-height: calc(100dvh - 200px);
        overflow-y: auto;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
    }

    .wish-card {
        padding: 14px 10px;
        border-radius: 14px;
    }

    .wish-icon { margin-bottom: 8px; }
    .wish-icon svg { width: 36px !important; height: 36px !important; }
    .wish-card h3 { font-size: 1rem; margin-bottom: 5px; }
    .wish-card p { font-size: 0.8rem; line-height: 1.4; }

    .reasons-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        max-height: calc(100dvh - 200px);
        overflow-y: auto;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
    }

    .reason-card { height: 140px; }
    .reason-icon svg { width: 36px !important; height: 36px !important; }
    .reason-front h3 { font-size: 0.95rem; }
    .reason-back p { font-size: 0.82rem; }

    .envelope { width: 240px; height: 160px; }
    .letter-content { font-size: 0.82rem; padding: 18px; }
    .dear { font-size: 1.1rem; }
    .cake-top { width: 150px; }
    .layer-1 { width: 170px; }
    .layer-2 { width: 200px; }
    .layer-3 { width: 230px; }
    .cake-plate { width: 250px; }
    .candle-group { gap: 14px; }
    .candle { height: 34px; width: 9px; }
    .story-text { font-size: 1.05rem; min-height: 7em; }
    .magic-btn { padding: 14px 30px; font-size: 0.98rem; }
}

/* Very small phones */
@media (max-width: 390px) {
    .sparkle-text { font-size: 1.9rem; }
    .section-title { font-size: 1.35rem; margin-bottom: 10px; }
    .finale-text { font-size: 0.95rem; }
    .finale-name { font-size: 1.6rem; }
    .story-emoji svg { width: 64px; height: 64px; }
    .wishes-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .wish-card { padding: 10px 8px; border-radius: 12px; }
    .wish-card h3 { font-size: 0.9rem; }
    .wish-card p { font-size: 0.75rem; }
    .reason-card { height: 120px; }
    .reason-front h3 { font-size: 0.85rem; }
}

@media (max-width: 390px) {
    .sparkle-text { font-size: 1.9rem; }
    .section-title { font-size: 1.35rem; margin-bottom: 22px; }
    .finale-text { font-size: 0.95rem; }
    .finale-name { font-size: 1.6rem; }
    .story-emoji svg { width: 64px; height: 64px; }
}

/* Touch: убираем hover */
@media (hover: none) {
    .magic-btn:hover, .wish-card:hover, .polaroid:hover,
    .envelope:hover, .big-heart:hover, .candle:hover {
        transform: none;
        box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    }
    .candle:hover { transform: none; }
    .envelope:hover { transform: none; }
    .big-heart:hover { transform: none; }
}

/* no-select на интерактивных */
@media (hover: none) {
    .candle, .reason-card, .wish-card, .polaroid, .envelope,
    .big-heart, .magic-btn, .story-text {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .floating-item, .confetti-piece { display: none; }
    .letter, .heart-beat, .big-heart, .envelope-heart,
    .wish-icon, .reason-icon, .story-emoji { animation: none; }
}
