
/* =================================
   1. ОСНОВНЫЕ НАСТРОЙКИ
================================= */

:root {
    --background: #f8f5f0;
    --text: #463632;
    --muted: #94817b;
    --accent: #a66b73;
    --accent-light: #ead6d0;
    --white: #fffdfa;

    --shadow-soft: 0 12px 35px rgba(91, 62, 53, 0.07);
    --shadow-hover: 0 18px 40px rgba(91, 62, 53, 0.12);
    --border-soft: rgba(166, 107, 115, 0.2);
}

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

body {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(ellipse at 15% 10%, #f1e5df 0%, transparent 38%),
        radial-gradient(ellipse at 90% 90%, #eee3dd 0%, transparent 35%),
        var(--background);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'DM Sans', -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif;
    overflow-x: hidden;
}

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

button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* =================================
   2. ПРОГРЕСС И ОСНОВНАЯ СТРАНИЦА
================================= */

.progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(166, 107, 115, 0.15);
    z-index: 100;
}

#progressBar {
    width: 16.66%;
    height: 100%;
    background: linear-gradient(90deg, #d3aaa2, #a66b73);
    box-shadow: 0 0 10px rgba(166, 107, 115, 0.3);
    transition: width 0.5s ease;
}

main {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 75px 20px 110px;
}

.screen {
    display: none;
    width: 100%;
    max-width: 800px;
    text-align: center;
}

.screen.active {
    display: block;
    position: relative;
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    background: rgba(255, 253, 250, 0.64);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: screenAppear 0.7s ease both;
}

@keyframes screenAppear {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

/* =================================
   3. ТИПОГРАФИКА
================================= */

h1,
h2 {
    font-family: 'Playfair Display', Georgia, 'Songti SC', 'SimSun', serif;
    font-weight: 400;
    color: var(--text);
    letter-spacing: -0.7px;
}

h1 {
    font-size: clamp(48px, 9vw, 82px);
    line-height: 1.1;
    margin-bottom: 25px;
}

h2 {
    font-size: clamp(32px, 6vw, 48px);
    line-height: 1.25;
    margin-bottom: 20px;
}

.top-label {
    font-size: 9px;
    letter-spacing: 5px;
    color: var(--accent);
    margin-bottom: 27px;
    font-weight: 600;
}

.subtitle {
    max-width: 430px;
    margin: 0 auto 35px;
    color: var(--muted);
    font-size: 13px;
    line-height: 2;
}

.bottom-label {
    margin-top: 70px;
    font-size: 9px;
    letter-spacing: 4px;
    color: #ad9991;
}

/* =================================
   4. КНОПКИ И НАВИГАЦИЯ
================================= */

.main-button {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--accent);
    background: linear-gradient(135deg, #b78380, #a66b73);
    color: white;
    padding: 15px 35px;
    border-radius: 50px;
    font-size: 12px;
    letter-spacing: 1px;
    box-shadow: 0 8px 22px rgba(166, 107, 115, 0.2);
    transition: all 0.35s ease;
}

.main-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 13px 30px rgba(166, 107, 115, 0.3);
}

.main-button:active {
    transform: translateY(-1px) scale(0.98);
}

.navigation {
    position: fixed;
    bottom: 25px;
    left: 0;
    width: 100%;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 1.5px;
    z-index: 50;
}

.back-button {
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--accent);
    font-size: 12px;
    transition: transform 0.25s ease, color 0.25s ease;
}

.back-button:hover {
    color: #875c59;
    transform: translateX(-3px);
}

.hidden {
    display: none !important;
}

/* =================================
   5. ПЕРВЫЙ ЭКРАН — АНИМАЦИЯ ТЕКСТА
================================= */

#screen1 .top-label {
    animation: introFade 1s ease both;
}

#screen1 h1 {
    animation: introTitle 1.2s ease both;
    animation-delay: 0.15s;
}

#screen1 .subtitle {
    animation: introFade 1s ease both;
    animation-delay: 0.4s;
}

#screen1 .main-button {
    animation: introButton 1s ease both;
    animation-delay: 0.65s;
}

#screen1 .bottom-label {
    animation: introFade 1.2s ease both;
    animation-delay: 0.9s;
}

@keyframes introFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes introTitle {
    from {
        opacity: 0;
        transform: translateY(30px);
        letter-spacing: 2px;
    }

    to {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: normal;
    }
}

@keyframes introButton {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }

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

/* =================================
   6. СЕРДЕЧКИ — ПЕРВЫЙ ЭКРАН
================================= */

#screen1 {
    isolation: isolate;
    overflow: hidden;
}

#screen1 .floating-hearts {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

#screen1 > p,
#screen1 > h1,
#screen1 > button {
    position: relative;
    z-index: 1;
}

#screen1 .floating-hearts span {
    position: absolute;
    bottom: -30px;
    color: #a66b73;
    opacity: 0;
    font-size: 17px;
    animation: introFloatingHeart 10s linear infinite;
}

#screen1 .floating-hearts span:nth-child(1) {
    left: 12%;
    animation-delay: 0s;
}

#screen1 .floating-hearts span:nth-child(2) {
    left: 32%;
    animation-delay: 2s;
    font-size: 12px;
}

#screen1 .floating-hearts span:nth-child(3) {
    left: 58%;
    animation-delay: 4s;
}

#screen1 .floating-hearts span:nth-child(4) {
    left: 78%;
    animation-delay: 1s;
    font-size: 14px;
}

#screen1 .floating-hearts span:nth-child(5) {
    left: 90%;
    animation-delay: 5s;
}

@keyframes introFloatingHeart {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    15% {
        opacity: 0.35;
    }

    80% {
        opacity: 0.25;
    }

    100% {
        transform: translateY(-75vh) rotate(25deg);
        opacity: 0;
    }
}

/* =================================
   7. КАРТОЧКА С ПЕРЕВОДОМ
================================= */

.translation-card {
    max-width: 460px;
    margin: 35px auto;
    padding: 30px;
    background: rgba(255, 253, 250, 0.85);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.translation-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.original-text {
    font-family: 'Playfair Display', Georgia, 'Songti SC', 'SimSun', serif;
    color: #57423e;
    font-size: 21px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.translate-button {
    border: none;
    background: transparent;
    color: var(--accent);
    font-size: 13px;
    padding: 10px;
    border-bottom: 1px solid var(--accent-light);
    transition: color 0.3s ease;
}

.translate-button:hover {
    color: #875c59;
}

.translation {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee1da;
    text-align: left;
    font-size: 13px;
    line-height: 1.8;
    animation: simpleAppear 0.4s ease;
}

.translation p:nth-child(odd) {
    color: var(--accent);
    font-weight: 600;
    margin-top: 12px;
}

@keyframes simpleAppear {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* =================================
   8. КАРТОЧКИ С ПРИЧИНАМИ
================================= */

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

.reason {
    position: relative;
    min-height: 85px;
    padding: 15px;
    border: 1px solid var(--border-soft);
    border-radius: 17px;
    background: rgba(255, 253, 250, 0.85);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.65s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 18px rgba(91, 62, 53, 0.035);
}

.reason:hover:not(.flipped) {
    background: #f7eae5;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(91, 62, 53, 0.08);
    border-color: var(--accent);
}

.reason.flipped {
    transform: rotateY(180deg);
    background: linear-gradient(145deg, #f0dcd5, #ead1ca);
    box-shadow: inset 0 0 20px rgba(183, 131, 128, 0.08);
}

.reason span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    line-height: 1.6;
}

.reason-front {
    transform: rotateY(0deg);
}

.reason-back {
    transform: rotateY(180deg);
    color: var(--text);
    font-size: 12px;
}

.reason.flipped:hover {
    transform: rotateY(180deg) translateY(-2px);
}

/* =================================
   9. ЛИЧНОЕ ПИСЬМО
================================= */

.personal-letter {
    max-width: 500px;
    margin: 30px auto;
    padding: clamp(25px, 5vw, 48px);
    text-align: left;
    font-family: 'Playfair Display', Georgia, 'Songti SC', 'SimSun', serif;
    font-size: 17px;
    line-height: 2.1;
    background: rgba(255, 253, 250, 0.96);
    border: 1px solid #eee0d9;
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
}

.personal-letter p {
    margin-bottom: 18px;
    color: #574641;
}

.signature {
    padding-top: 12px;
    color: var(--accent);
    font-size: 22px;
    font-style: italic;
}

#letterContent {
    opacity: 1;
    transition: opacity 0.7s ease;
}

#letterContent.hidden {
    display: none !important;
}

#letterContent.show-letter {
    animation: letterAppear 1.2s ease-out both;
}

@keyframes letterAppear {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
        filter: blur(4px);
    }

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

/* =================================
   10. КОНВЕРТ
================================= */

.envelope-container {
    display: flex;
    justify-content: center;
    margin: 45px auto;
    perspective: 1000px;
}

.envelope-button {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.envelope {
    position: relative;
    width: 240px;
    height: 155px;
    background: #e8d0c8;
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(91, 62, 53, 0.15);
    transition: transform 0.4s ease;
}

.envelope-body {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background: linear-gradient(145deg, #f5e6df, #e8d0c8);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    border-radius: 5px;
}

.envelope-body span {
    color: var(--accent);
    font-size: 38px;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #dfc0b7, #d3aaa2);
    clip-path: polygon(0 0, 100% 0, 50% 58%);
    transform-origin: top;
    transition: transform 0.7s ease;
    z-index: 3;
}

.envelope-button:hover .envelope {
    transform: translateY(-5px);
}

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

.envelope-hint {
    margin-top: 25px;
    color: #594540;
    font-family: 'Playfair Display', Georgia, 'Songti SC', 'SimSun', serif;
    font-size: 22px;
}

.envelope-action {
    margin-top: 8px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* =================================
   11. ФОТОГАЛЕРЕЯ
================================= */

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin: 45px auto 30px;
    align-items: center;
}

.photo-card {
    padding: 10px 10px 18px;
    border: 1px solid rgba(234, 214, 208, 0.5);
    border-radius: 5px;
    background: #fffdfa;
    box-shadow: 0 12px 30px rgba(75, 50, 43, 0.12);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    opacity: 0;
    animation: photoAppear 0.9s ease forwards;
}

.photo-one {
    transform: rotate(-5deg);
    animation-delay: 0.2s;
}

.photo-two {
    transform: rotate(3deg) translateY(-12px);
    animation-delay: 0.55s;
}

.photo-three {
    transform: rotate(-3deg);
    animation-delay: 0.9s;
}

.photo-card:hover {
    transform: rotate(0deg) translateY(-10px);
    box-shadow: 0 20px 40px rgba(75, 50, 43, 0.18);
    z-index: 2;
}

.photo-placeholder {
    aspect-ratio: 3 / 4;
    background: linear-gradient(145deg, #f3e5df, #e9d4cc);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    overflow: hidden;
}

.photo-placeholder span {
    font-family: 'Playfair Display', Georgia, 'Songti SC', 'SimSun', serif;
    font-size: 42px;
    margin-bottom: 10px;
}

.photo-placeholder p {
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--muted);
}

.photo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.photo-caption {
    font-family: 'Playfair Display', Georgia, 'Songti SC', 'SimSun', serif;
    font-size: 13px;
    color: #634d47;
    margin-top: 15px;
    letter-spacing: 0.2px;
}

.gallery-note {
    color: var(--muted);
    font-size: 12px;
    font-style: italic;
    margin: 25px auto 30px;
    opacity: 0;
    animation: photoAppear 1s ease forwards;
    animation-delay: 1.2s;
}

@keyframes photoAppear {
    from {
        opacity: 0;
        filter: blur(5px);
    }

    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* =================================
   12. ПРОСМОТР ФОТО
================================= */

.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: rgba(40, 30, 28, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.photo-lightbox.open {
    opacity: 1;
    visibility: visible;
}

.photo-lightbox img {
    display: block;
    max-width: min(90vw, 650px);
    max-height: 82vh;
    object-fit: contain;
    border: 10px solid #fffdfb;
    border-bottom-width: 35px;
    border-radius: 3px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.85) rotate(-2deg);
    transition: transform 0.4s ease;
}

.photo-lightbox.open img {
    transform: scale(1) rotate(0deg);
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 30px;
    border: none;
    background: transparent;
    color: white;
    font-size: 35px;
    cursor: pointer;
}

.lightbox-caption {
    position: absolute;
    bottom: 35px;
    left: 20px;
    right: 20px;
    text-align: center;
    color: #fffdfb;
    font-family: 'Playfair Display', Georgia, 'Songti SC', 'SimSun', serif;
    font-size: 19px;
    letter-spacing: 0.5px;
    animation: photoAppear 0.7s ease both;
}

/* =================================
   13. TIMELINE
================================= */

.timeline {
    position: relative;
    max-width: 520px;
    margin: 45px auto;
    text-align: left;
    display: flow-root;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 85px;
    top: 15px;
    bottom: 15px;
    width: 1px;
    background: var(--accent-light);
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 60px 32px 1fr;
    gap: 10px;
    align-items: start;
    margin-bottom: 30px;
    opacity: 0;
    animation: timelineReveal 0.8s ease forwards;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.6s;
}

.timeline-item:nth-child(3) {
    animation-delay: 1s;
}

.timeline-item:nth-child(4) { animation-delay: 1.4s; }
.timeline-item:nth-child(5) { animation-delay: 1.8s; }

.timeline-date {
    padding-top: 25px;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--muted);
    font-weight: 600;
}

.timeline-heart {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fbf5f1;
    border: 1px solid #e7cfc8;
    color: var(--accent);
    font-size: 18px;
    box-shadow: 0 3px 12px rgba(183, 131, 128, 0.1);
}

.timeline-card {
    position: relative;
    padding: 20px;
    background: rgba(255, 253, 250, 0.92);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(91, 62, 53, 0.055);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.timeline-number {
    color: var(--accent);
    font-size: 10px;
    letter-spacing: 2px;
}

.timeline-card h3 {
    font-family: 'Playfair Display', Georgia, 'Songti SC', 'SimSun', serif;
    font-size: 20px;
    font-weight: 400;
    margin: 8px 0;
    color: #59423d;
}

.timeline-card p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.9;
}

.timeline-ending {
    font-family: 'Playfair Display', Georgia, 'Songti SC', 'SimSun', serif;
    font-size: 19px;
    color: var(--accent);
    font-style: italic;
    margin: 35px auto;
    animation: timelineReveal 1s ease both;
    animation-delay: 2.3s;
}

@keyframes timelineReveal {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

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

/* =================================
   14. ФИНАЛЬНЫЙ ЭКРАН
================================= */

#screen6 {
    position: relative;
    isolation: isolate;
}

#screen6 > *:not(.floating-hearts) {
    position: relative;
    z-index: 2;
}

.final-heart {
    color: var(--accent);
    font-size: 70px;
    margin-bottom: 25px;
    animation: heartbeat 1.8s infinite;
}

#screen6 .final-heart {
    color: #bd8885;
    filter: drop-shadow(0 5px 15px rgba(183, 131, 128, 0.2));
    animation: heartbeat 1.8s infinite, glow 3s ease-in-out infinite alternate;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 5px rgba(183, 131, 128, 0.2));
    }

    to {
        filter: drop-shadow(0 0 18px rgba(183, 131, 128, 0.5));
    }
}

#screen6 h2 {
    animation: finalAppear 1.2s ease both;
}

#screen6 .subtitle {
    animation: finalAppear 1.5s ease both;
}

#screen6 .final-phrase {
    animation: finalAppear 1.8s ease both;
}

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

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

.final-phrase {
    margin: 40px auto;
    padding: 25px;
    border-top: 1px solid rgba(183, 131, 128, 0.3);
    border-bottom: 1px solid rgba(183, 131, 128, 0.3);
    color: #947d76;
    font-size: 14px;
    line-height: 2.5;
    letter-spacing: 0.3px;
}

/* =================================
   15. СЕРДЕЧКИ — ФИНАЛЬНЫЙ ЭКРАН
================================= */

#screen6 .floating-hearts {
    position: absolute;
    inset: -30px -20px;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

#screen6 .floating-hearts span {
    position: absolute;
    bottom: -40px;
    color: var(--accent);
    opacity: 0;
    font-size: 24px;
    animation: finalFloatingHeart 9s linear infinite;
}

#screen6 .floating-hearts span:nth-child(1) {
    left: 5%;
    animation-delay: 0s;
    font-size: 20px;
}

#screen6 .floating-hearts span:nth-child(2) {
    left: 20%;
    animation-delay: 2s;
    font-size: 28px;
}

#screen6 .floating-hearts span:nth-child(3) {
    left: 35%;
    animation-delay: 4s;
    font-size: 17px;
}

#screen6 .floating-hearts span:nth-child(4) {
    left: 50%;
    animation-delay: 1s;
    font-size: 25px;
}

#screen6 .floating-hearts span:nth-child(5) {
    left: 65%;
    animation-delay: 3s;
    font-size: 19px;
}

#screen6 .floating-hearts span:nth-child(6) {
    left: 80%;
    animation-delay: 5s;
    font-size: 30px;
}

#screen6 .floating-hearts span:nth-child(7) {
    left: 90%;
    animation-delay: 6s;
    font-size: 22px;
}

#screen6 .floating-hearts span:nth-child(8) {
    left: 42%;
    animation-delay: 7s;
    font-size: 16px;
}

@keyframes finalFloatingHeart {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }

    15% {
        opacity: 0.45;
    }

    85% {
        opacity: 0.35;
    }

    100% {
        transform: translateY(-750px) rotate(35deg);
        opacity: 0;
    }
}

/* =================================
   16. СЕКРЕТНОЕ ПОЗДРАВЛЕНИЕ
================================= */

.secret-surprise {
    margin: 35px auto;
    max-width: 450px;
}

#surpriseButton {
    background: transparent;
    color: var(--accent);
}

#surpriseButton:hover {
    background: var(--accent);
    color: white;
}

.secret-message {
    margin: 28px auto 10px;
    padding: 28px 22px 30px;
    background: rgba(255, 253, 250, 0.72);
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.secret-message.show {
    animation: secretReveal 1s ease both;
}

.secret-decoration {
    font-size: 30px;
    color: var(--accent);
    margin-bottom: 12px;
    animation: softHeart 2.8s ease-in-out infinite;
}

.love-phrase {
    width: 100%;
    min-height: 2.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-family: 'Playfair Display', Georgia, 'Songti SC', 'SimSun', serif;
    font-size: clamp(23px, 4vw, 34px);
    line-height: 1.45;
    color: #59423d;
    text-align: center;
    overflow-wrap: anywhere;
    transition: opacity 0.17s ease, transform 0.17s ease, filter 0.17s ease;
}

.love-phrase.phrase-out {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    filter: blur(5px);
}

.love-phrase.phrase-in {
    animation: phraseBloom 0.32s cubic-bezier(.2,.75,.25,1) both;
}

.love-caption {
    display: block;
    margin-top: 18px;
    color: var(--accent);
    font-size: 12px;
    letter-spacing: 0.5px;
    text-align: center;
}

@keyframes phraseBloom {
    from { opacity: 0; transform: translateY(13px) scale(0.94); filter: blur(5px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes softHeart {
    0%, 100% { transform: scale(1); opacity: 0.75; }
    50% { transform: scale(1.12); opacity: 1; }
}

@media (max-width: 600px) {
    .secret-message { padding: 24px 16px; min-height: 175px; }
    .love-phrase { font-size: clamp(21px, 6vw, 29px); }
}

@media (prefers-reduced-motion: reduce) {
    .love-phrase, .secret-decoration { animation: none !important; transition: none !important; }
}

@keyframes secretReveal {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

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

/* =================================
   17. АДАПТАЦИЯ ПОД ПЛАНШЕТЫ
================================= */

@media (min-width: 600px) and (max-width: 1024px) {
    main {
        padding: 80px 40px 110px;
    }

    .screen {
        max-width: 780px;
    }

    .reasons {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .reason {
        min-height: 95px;
        font-size: 13px;
    }

    .personal-letter {
        max-width: 620px;
        padding: 40px;
        font-size: 18px;
    }

    .translation-card {
        max-width: 550px;
    }
}

/* =================================
   18. АДАПТАЦИЯ ПОД ТЕЛЕФОНЫ
================================= */

@media (max-width: 500px) {
    main {
        padding: 55px 13px 100px;
    }

    .screen.active {
        padding: 28px 18px;
        border-radius: 23px;
    }

    .top-label {
        font-size: 8px;
        letter-spacing: 3px;
    }

    .bottom-label {
        margin-top: 50px;
    }

    .main-button {
        padding: 14px 29px;
    }

    .reasons {
        gap: 8px;
    }

    .reason {
        min-height: 90px;
        font-size: 11px;
        padding: 12px 7px;
    }

    .reason-back {
        font-size: 11px;
    }

    .translation-card,
    .personal-letter {
        padding: 22px;
    }

    .personal-letter {
        font-size: 15px;
    }

    .photo-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        margin-top: 35px;
    }

    .photo-card {
        padding: 8px 8px 14px;
    }

    .photo-caption {
        font-size: 11px;
    }

    .photo-placeholder p {
        font-size: 9px;
    }

    .lightbox-caption {
        font-size: 16px;
        bottom: 25px;
    }

    .timeline {
        margin: 35px auto;
    }

    .timeline-item {
        grid-template-columns: 48px 28px 1fr;
        gap: 7px;
    }

    .timeline::before {
        left: 68px;
    }

    .timeline-heart {
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .timeline-date {
        font-size: 9px;
    }

    .timeline-card {
        padding: 15px;
    }

    .timeline-card h3 {
        font-size: 17px;
    }

    .timeline-card p {
        font-size: 11px;
    }
}

/* =================================
   19. ОЧЕНЬ МАЛЕНЬКИЕ ТЕЛЕФОНЫ
================================= */

@media (max-width: 380px) {
    main {
        padding: 50px 14px 90px;
    }

    .reasons {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .reason {
        min-height: 65px;
    }

    h1 {
        font-size: 46px;
    }

    h2 {
        font-size: 29px;
    }

    .top-label {
        letter-spacing: 2px;
        font-size: 9px;
    }

    .navigation {
        padding: 0 18px;
    }

    .photo-gallery {
        grid-template-columns: 1fr;
        max-width: 230px;
        gap: 25px;
    }

    .photo-two {
        transform: rotate(4deg);
    }
}

/* =================================
   20. ДОСТУПНОСТЬ
================================= */

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

/* =================================
   21. ВЗРЫВ СЕРДЕЧЕК (финал)
================================= */

.burst-heart {
    position: fixed;
    bottom: -30px;
    z-index: 200;
    pointer-events: none;
    color: var(--accent);
    opacity: 0;
    animation: burstUp var(--dur, 4s) ease-out forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes burstUp {
    0%   { transform: translate(0, 0) rotate(0deg) scale(.6); opacity: 0; }
    10%  { opacity: .9; }
    100% { transform: translate(var(--dx, 0), -105vh) rotate(var(--rot, 40deg)) scale(1.1); opacity: 0; }
}


/* =================================
   22. ВХОД С ВОПРОСОМ
================================= */

.gate {
    -webkit-backdrop-filter: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(ellipse at 15% 10%, #f1e5df 0%, transparent 38%),
        radial-gradient(ellipse at 90% 90%, #eee3dd 0%, transparent 35%),
        var(--background);
    transition: opacity 0.9s ease, visibility 0.9s ease;
}

.gate.leaving {
    opacity: 0;
    visibility: hidden;
}

.gate-card {
    width: 100%;
    max-width: 440px;
    padding: clamp(28px, 6vw, 44px);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    background: rgba(255, 253, 250, 0.8);
    box-shadow: var(--shadow-soft);
    animation: screenAppear 0.8s ease both;
}

.gate-card.shake {
    animation: gateShake 0.45s ease;
}

.gate-heart {
    font-size: 46px;
    color: #bd8885;
    margin-bottom: 18px;
    animation: heartbeat 1.8s infinite;
}

.gate-card h2 {
    font-size: clamp(26px, 6vw, 34px);
}

.gate-input {
    width: 100%;
    max-width: 260px;
    margin: 0 auto 22px;
    display: block;
    padding: 14px 18px;
    text-align: center;
    font-family: inherit;
    font-size: 16px;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-radius: 50px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.gate-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(166, 107, 115, 0.12);
}

.gate-hint {
    margin-top: 20px;
    font-size: 12px;
    font-style: italic;
    color: var(--muted);
    animation: simpleAppear 0.5s ease;
}

@keyframes gateShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(9px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(4px); }
}

/* =================================
   23. ФОНОВЫЕ СЕРДЕЧКИ (на всех экранах)
================================= */

main {
    position: relative;
    z-index: 1;
}

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

.bg-hearts span {
    position: absolute;
    bottom: -50px;
    color: var(--accent);
    opacity: 0;
    animation: bgFloat var(--dur, 16s) linear infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes bgFloat {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    12%  { opacity: var(--op, 0.25); }
    50%  { transform: translate(var(--sway, 20px), -55vh) rotate(15deg); }
    88%  { opacity: var(--op, 0.25); }
    100% { transform: translate(calc(var(--sway, 20px) * -1), -112vh) rotate(-15deg); opacity: 0; }
}


html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* =================================
   24. СЧЁТЧИК ДНЕЙ И МУЗЫКА
================================= */

.together-counter {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    padding: 7px 16px;
    white-space: nowrap;
    font-size: 11px;
    letter-spacing: 0.8px;
    color: var(--accent);
    background: rgba(255, 253, 250, 0.82);
    border: 1px solid var(--border-soft);
    border-radius: 50px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: simpleAppear 0.8s ease;
}

.together-counter strong {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 14px;
    font-weight: 600;
}

.music-button {
    position: fixed;
    top: 12px;
    right: 14px;
    z-index: 60;
    width: 38px;
    height: 38px;
    font-size: 17px;
    color: var(--accent);
    background: rgba(255, 253, 250, 0.82);
    border: 1px solid var(--border-soft);
    border-radius: 50%;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.music-button.playing {
    animation: heartbeat 1.8s infinite;
}

.music-button.off {
    opacity: 0.5;
    text-decoration: line-through;
}

@media (min-width: 600px) {
    .together-counter { top: 22px; font-size: 12px; }
    .music-button { top: 18px; right: 24px; }
}

/* =================================
   25. КРУЖОЧКИ
================================= */

.circles-label {
    margin-top: 34px;
}

.circle-videos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px;
    margin-bottom: 30px;
}

.circle-card {
    margin: 0;
    width: min(46vw, 200px);
    text-align: center;
}

.circle-video {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-soft);
    background: #e9dfd9;
    cursor: pointer;
}

.circle-card {
    position: relative;
}

.circle-card:not(.playing)::after {
    content: "▶";
    position: absolute;
    top: calc(min(46vw, 200px) / 2);
    left: 50%;
    transform: translate(-45%, -50%);
    font-size: 26px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.circle-card figcaption {
    margin-top: 10px;
    font-size: 12px;
    font-style: italic;
    color: var(--muted);
}


/* =================================
   26. ГРОМКОСТЬ
================================= */

.music-control {
    position: fixed;
    top: 12px;
    right: 14px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.music-control.hidden,
.volume-wrap.hidden {
    display: none;
}

.music-control .music-button {
    position: static;
}

.volume-wrap {
    padding: 7px 12px;
    background: rgba(255, 253, 250, 0.82);
    border: 1px solid var(--border-soft);
    border-radius: 50px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.volume-wrap input {
    display: block;
    width: 84px;
    accent-color: var(--accent);
}

@media (min-width: 600px) {
    .music-control { top: 18px; right: 24px; }
}

/* =================================
   27. АНИМАЦИИ ФОНА ПО ЭКРАНАМ
================================= */

.bg-hearts {
    opacity: 0;
    transition: opacity 0.9s ease;
}

.bg-hearts.visible {
    opacity: 1;
}

.bg-hearts.fall span {
    bottom: auto;
    top: -40px;
    animation-name: bgFall;
}

.bg-hearts.twinkle span {
    bottom: auto;
    animation-name: bgTwinkle;
    animation-timing-function: ease-in-out;
}

@keyframes bgFall {
    0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    10%  { opacity: var(--op, 0.3); }
    50%  { transform: translate(var(--sway, 20px), 55vh) rotate(180deg); }
    90%  { opacity: var(--op, 0.3); }
    100% { transform: translate(calc(var(--sway, 20px) * -1), 112vh) rotate(360deg); opacity: 0; }
}

@keyframes bgTwinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50%      { opacity: calc(var(--op, 0.3) * 2.2); transform: scale(1.15); }
}


/* =================================
   28. КОМПАКТНЫЙ ПЛЕЕР СПРАВА
================================= */
.song-player {
    position: fixed;
    right: clamp(14px, 2.4vw, 34px);
    top: 50%;
    left: auto;
    bottom: auto;
    transform: translateY(-50%);
    z-index: 70;
    width: 224px;
    max-width: calc(100vw - 28px);
    color: var(--text);
    background: transparent;
    text-align: left;
    pointer-events: none;
}
.song-player > * { pointer-events: auto; }
.player-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    text-align: left;
}
.player-track-info { display:flex; flex-direction:column; gap:2px; min-width:0; text-shadow:0 1px 10px rgba(255,253,250,.95); }
.player-eyebrow { color:var(--accent); font-size:7px; letter-spacing:1.8px; }
.player-track-info strong { font-family:'Playfair Display',Georgia,serif; font-size:13px; font-weight:500; line-height:1.25; }
.player-track-info > span:last-child { color:var(--muted); font-size:9px; }
.lyrics-expand { border:0; background:transparent; color:var(--accent); font:inherit; font-size:9px; white-space:nowrap; padding:4px 0 4px 5px; cursor:pointer; }
.lyrics-window {
    height: 78px;
    overflow: hidden;
    position: relative;
    mask-image:linear-gradient(to bottom,transparent,#000 22%,#000 78%,transparent);
    -webkit-mask-image:linear-gradient(to bottom,transparent,#000 22%,#000 78%,transparent);
    transition:height .3s ease;
}
.lyrics-list { display:flex; flex-direction:column; align-items:flex-start; gap:6px; padding:25px 0; transition:transform .25s ease; }
.lyric-line { border:0; padding:0; max-width:100%; color:rgba(93,76,73,.42); background:transparent; font-family:'Playfair Display',Georgia,serif; font-size:11px; line-height:1.35; text-align:left; cursor:pointer; transition:color .3s ease,opacity .3s ease,font-size .3s ease; text-shadow:0 1px 10px rgba(255,253,250,.95); }
.lyric-line.active { color:var(--accent); font-size:14px; opacity:1; }
.lyric-line.past { opacity:.4; }
.lyric-section { margin:3px 0 0; color:var(--accent); font-size:7px; letter-spacing:1.5px; text-transform:uppercase; opacity:.7; }
.player-controls { display:flex; align-items:center; gap:7px; margin-top:5px; text-shadow:0 1px 10px rgba(255,253,250,.95); }
.player-play { flex:0 0 25px; width:25px; height:25px; border:1px solid var(--border-soft); border-radius:50%; color:var(--accent); background:rgba(255,253,250,.55); cursor:pointer; font-size:10px; }
.player-time { color:var(--muted); font-size:8px; font-variant-numeric:tabular-nums; }
.player-progress { flex:1; min-width:0; height:2px; accent-color:var(--accent); cursor:pointer; }
.song-player.lyrics-expanded .lyrics-window { height:min(38vh,280px); overflow-y:auto; mask-image:linear-gradient(to bottom,transparent,#000 5%,#000 95%,transparent); -webkit-mask-image:linear-gradient(to bottom,transparent,#000 5%,#000 95%,transparent); }
.song-player.lyrics-expanded .lyrics-list { padding:18px 0; }
.song-player.lyrics-expanded .lyric-line { font-size:12px; }
.song-player.lyrics-expanded .lyric-line.active { font-size:15px; }
/* Старый круглый переключатель больше не дублирует кнопку плеера. */
body.player-visible .music-control .music-button { display:none; }
body.player-visible .music-control { top:14px; right:18px; }
body.player-visible .volume-wrap { padding:5px 8px; background:transparent; border:0; backdrop-filter:none; -webkit-backdrop-filter:none; }
body.player-visible .volume-wrap input { width:65px; }
@media (max-width: 900px) {
    .song-player { top:auto; bottom:70px; right:12px; width:190px; transform:none; }
    .lyrics-window { height:65px; }
    .lyrics-list { gap:5px; padding:21px 0; }
    .lyric-line { font-size:10px; }
    .lyric-line.active { font-size:12px; }
    .player-track-info strong { font-size:12px; }
    .player-controls { gap:5px; }
    body.player-visible .music-control { top:10px; right:12px; }
}
@media (max-width: 420px) {
    .song-player { width:160px; right:9px; bottom:64px; }
    .player-track-info strong { font-size:11px; }
    .lyrics-window { height:56px; }
    .lyric-line { font-size:9px; }
    .lyric-line.active { font-size:11px; }
}
@media (prefers-reduced-motion: reduce) { .lyric-line,.lyrics-window,.lyrics-list { transition:none; } }

/* Адаптивный режим плеера для планшетов и телефонов */
.player-heading-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.player-mini-play,
.player-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-soft);
    border-radius: 50%;
    color: var(--accent);
    background: rgba(255, 253, 250, .72);
    cursor: pointer;
}

@media (min-width: 600px) and (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
    /* На планшетах плеер ведёт себя как на телефоне: компактная нижняя панель. */
    .song-player {
        left: 50%;
        right: auto;
        bottom: max(12px, env(safe-area-inset-bottom));
        top: auto;
        transform: translateX(-50%);
        width: min(390px, calc(100vw - 40px));
        max-width: none;
        padding: 10px 14px;
        border: 1px solid rgba(130, 83, 91, .16);
        border-radius: 16px;
        background: rgba(255, 253, 250, .94);
        box-shadow: 0 6px 24px rgba(75, 49, 49, .10);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
    .player-heading { margin: 0; gap: 12px; align-items: center; }
    .player-track-info { gap: 1px; text-shadow: none; }
    .player-eyebrow { font-size: 7px; letter-spacing: 1.5px; }
    .player-track-info strong { font-size: 13px; }
    .player-track-info > span:last-child { font-size: 9px; }
    .player-heading-actions { gap: 9px; }
    .player-mini-play, .player-mobile-toggle {
        display: inline-flex;
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        font-size: 12px;
    }
    .player-mobile-toggle { font-size: 17px; }
    .lyrics-expand { display: none; }
    .lyrics-window, .player-controls { display: none; }
    .song-player.mobile-expanded { padding-bottom: 12px; }
    .song-player.mobile-expanded .lyrics-expand { display: inline-block; font-size: 9px; }
    .song-player.mobile-expanded .lyrics-window {
        display: block;
        height: 76px;
        margin-top: 9px;
    }
    .song-player.mobile-expanded .lyrics-list { gap: 5px; padding: 22px 0; }
    .song-player.mobile-expanded .lyric-line { font-size: 11px; }
    .song-player.mobile-expanded .lyric-line.active { font-size: 14px; }
    .song-player.mobile-expanded .player-controls {
        display: flex;
        gap: 8px;
        margin-top: 8px;
        text-shadow: none;
    }
    .song-player.mobile-expanded .player-play { width: 27px; height: 27px; }
    .song-player.mobile-expanded.lyrics-expanded .lyrics-window { height: min(32vh, 250px); }
    .song-player.mobile-expanded.lyrics-expanded .lyric-line { font-size: 12px; }
    .song-player.mobile-expanded.lyrics-expanded .lyric-line.active { font-size: 15px; }
    body.player-visible { padding-bottom: 100px; }
    body.player-visible .navigation { bottom: calc(90px + env(safe-area-inset-bottom)); }
    body.player-visible.mobile-player-expanded { padding-bottom: 205px; }
    body.player-visible.mobile-player-expanded .navigation { bottom: calc(195px + env(safe-area-inset-bottom)); }
    body.player-visible .music-control { top: 10px; right: 12px; }
    body.player-visible .volume-wrap { padding: 4px 6px; }
    body.player-visible .volume-wrap input { width: 58px; }
}

@media (max-width: 599px) {
    .song-player {
        left: 12px;
        right: 12px;
        bottom: max(8px, env(safe-area-inset-bottom));
        width: auto;
        max-width: none;
        padding: 9px 12px;
        border: 1px solid rgba(130, 83, 91, .16);
        border-radius: 16px;
        background: rgba(255, 253, 250, .94);
        box-shadow: 0 6px 24px rgba(75, 49, 49, .10);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        transform: none;
    }
    .player-heading { margin: 0; gap: 10px; align-items: center; }
    .player-track-info { gap: 1px; text-shadow: none; }
    .player-eyebrow { font-size: 6px; letter-spacing: 1.4px; }
    .player-track-info strong { font-size: 12px; }
    .player-track-info > span:last-child { font-size: 8px; }
    .player-heading-actions { gap: 7px; }
    .player-mini-play,
    .player-mobile-toggle {
        display: inline-flex;
        width: 29px;
        height: 29px;
        flex: 0 0 29px;
        font-size: 11px;
    }
    .player-mobile-toggle { font-size: 16px; }
    .lyrics-expand { display: none; }
    .lyrics-window,
    .player-controls { display: none; }
    .song-player.mobile-expanded { padding-bottom: 10px; }
    .song-player.mobile-expanded .lyrics-expand { display: inline-block; font-size: 8px; }
    .song-player.mobile-expanded .lyrics-window {
        display: block;
        height: 66px;
        margin-top: 8px;
    }
    .song-player.mobile-expanded .lyrics-list { gap: 5px; padding: 20px 0; }
    .song-player.mobile-expanded .lyric-line { font-size: 10px; }
    .song-player.mobile-expanded .lyric-line.active { font-size: 13px; }
    .song-player.mobile-expanded .player-controls {
        display: flex;
        gap: 7px;
        margin-top: 7px;
        text-shadow: none;
    }
    .song-player.mobile-expanded .player-play { width: 25px; height: 25px; }
    .song-player.mobile-expanded.lyrics-expanded .lyrics-window { height: min(34vh, 250px); }
    .song-player.mobile-expanded.lyrics-expanded .lyric-line { font-size: 11px; }
    .song-player.mobile-expanded.lyrics-expanded .lyric-line.active { font-size: 14px; }
    body.player-visible { padding-bottom: 92px; }
    body.player-visible .navigation { bottom: calc(82px + env(safe-area-inset-bottom)); }
    body.player-visible.mobile-player-expanded { padding-bottom: 184px; }
    body.player-visible.mobile-player-expanded .navigation { bottom: calc(174px + env(safe-area-inset-bottom)); }
    body.player-visible .music-control { top: 8px; right: 10px; }
    body.player-visible .volume-wrap { padding: 3px 5px; }
    body.player-visible .volume-wrap input { width: 52px; }
}

@media (max-width: 360px) {
    .song-player { left: 8px; right: 8px; padding: 8px 10px; }
    .player-track-info strong { font-size: 11px; }
    .player-mini-play, .player-mobile-toggle { width: 27px; height: 27px; flex-basis: 27px; }
}


/* =================================
   AMBIENT HEARTS — ALL SCREENS
================================= */
.ambient-hearts {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 3; /* поверх полупрозрачных карточек, но не блокирует нажатия */
}

.ambient-heart {
    position: absolute;
    bottom: -28px;
    color: rgba(226, 153, 177, 0.68);
    font-size: var(--heart-size, 12px);
    line-height: 1;
    opacity: 0;
    animation: ambientHeartRise var(--heart-duration, 8s) linear forwards;
    will-change: transform, opacity;
}

@keyframes ambientHeartRise {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) rotate(-8deg);
    }
    12% { opacity: 0.38; }
    78% { opacity: 0.24; }
    100% {
        opacity: 0;
        transform: translate3d(var(--heart-drift, 0px), -110vh, 0) rotate(14deg);
    }
}

/* The first and final screens use the same subtle global animation. */
#screen1 .floating-hearts,
#screen6 .floating-hearts {
    display: none;
}

main {
    position: relative;
    z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
    .ambient-hearts { display: none; }
}
