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

:root {
    --bg: #0d0d0d;
    --surface: #1a1a1f;
    --surface-border: #2a2a30;
    --text: #e8e8e8;
    --text-secondary: #888;
    --text-accent: #c9a87c;
    --content-width: 640px;
}

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--bg);
    color: var(--text);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.01em;
}

/* Progress bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: linear-gradient(90deg, var(--text-accent), var(--text));
    z-index: 100;
    transition: width 0.3s ease;
}

/* Screen base */
.screen {
    min-height: 100vh;
    min-height: 100dvh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Countdown screen */
.screen--countdown {
    padding: 0 24px;
}

.countdown-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.countdown-value {
    font-size: 2.8rem;
    line-height: 1.1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.countdown-label {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 10px;
}

.countdown-sep {
    font-size: 2.8rem;
    line-height: 1.1;
    color: var(--text-accent);
    padding-top: 2px;
}

.cake-button {
    margin-top: 56px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease;
    position: relative;
}

.cake-button:hover {
    transform: scale(1.05);
}

.cake-button:active {
    transform: scale(0.94);
}

.cake-button::before {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 22px;
    padding: 4px;
    background: conic-gradient(
        #ff6b6b, #ffa94d, #ffe066, #69db7c, #4dabf7, #b197fc, #f06595, #ff6b6b
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rainbow-spin 4s linear infinite;
}

@keyframes rainbow-spin {
    to { transform: rotate(360deg); }
}

.cake-img {
    width: 210px;
    height: auto;
    display: block;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

/* ---- Play button (main page) ---- */
.play-button {
    margin-top: 56px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease;
    position: relative;
}

.play-button:hover {
    transform: scale(1.05);
}

.play-button:active {
    transform: scale(0.94);
}

.play-button::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 30px;
    padding: 4px;
    background: conic-gradient(
        #ff6b6b, #ffa94d, #ffe066, #69db7c, #4dabf7, #b197fc, #f06595, #ff6b6b
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rainbow-spin 4s linear infinite;
}

.play-img {
    width: 170px;
    height: 170px;
    object-fit: cover;
    display: block;
    border-radius: 26px;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

/* HBtobobrishki page */
.hbt-text {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 0 24px;
}

/* /HBtobobrishki — gift choice page */
.choice-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 20px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.choice-card {
    max-width: 560px;
    width: 100%;
}

.choice-text {
    font-size: 1.3rem;
    line-height: 1.9;
    color: var(--text);
}

.choice-footnote {
    font-size: 0.8rem;
    color: #555;
    margin-top: 26px;
    line-height: 1.6;
}

.choice-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

.choice-btn {
    font-family: inherit;
    font-size: 1.15rem;
    padding: 18px 46px;
    border-radius: 40px;
    cursor: pointer;
    border: 1px solid var(--surface-border);
    color: var(--text);
    background: var(--surface);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.choice-btn:hover {
    transform: translateY(-3px);
}

.choice-btn--easy:hover,
.choice-btn--easy:focus {
    border-color: #f06595;
    box-shadow: 0 0 24px rgba(240, 101, 149, 0.35);
}

.choice-btn--hard:hover,
.choice-btn--hard:focus {
    border-color: #c9a87c;
    box-shadow: 0 0 24px rgba(201, 168, 124, 0.4);
}

.choice-screen.is-locked .choice-card {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.choice-result {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 620px;
    text-align: center;
    font-size: 1.35rem;
    line-height: 1.7;
    z-index: 10;
    padding: 30px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.choice-result.is-visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    animation: result-fade 0.8s ease forwards;
}

.choice-result.is-wrong {
    border-color: #f06595;
    color: #f9b8d0;
}

.choice-result.is-right {
    border-color: #c9a87c;
    color: #f4e3bf;
}

.result-main {
    margin: 0 0 10px;
}

.result-small {
    font-size: 0.8rem;
    margin-top: 10px;
}

@keyframes result-fade {
    to { opacity: 1; }
}

.rain-emoji {
    position: fixed;
    top: -8vh;
    z-index: 100;
    animation: fall 4.5s linear infinite;
    pointer-events: none;
    opacity: 0.9;
}

@keyframes fall {
    to { transform: translateY(115vh) rotate(360deg); }
}

/* Light theme for /HBtobobrishki gift choice page */
.page-choice {
    background: linear-gradient(160deg, #fff6ec 0%, #ffe8ef 50%, #eef4ff 100%);
    color: #4a3f35;
}

.page-choice .choice-card {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 26px;
    padding: 44px 38px;
    box-shadow: 0 18px 60px rgba(120, 90, 60, 0.15);
    backdrop-filter: blur(10px);
}

.page-choice .choice-text {
    color: #4a3f35;
}

.page-choice .choice-footnote {
    color: #9a8d80;
}

.page-choice .choice-btn {
    background: #ffffff;
    border: 1px solid #f0e0d4;
    color: #4a3f35;
    box-shadow: 0 6px 20px rgba(120, 90, 60, 0.12);
}

.page-choice .choice-btn:hover {
    transform: translateY(-3px);
}

.page-choice .choice-btn--easy:hover,
.page-choice .choice-btn--easy:focus {
    border-color: #f78fb0;
    box-shadow: 0 0 28px rgba(247, 143, 176, 0.4);
}

.page-choice .choice-btn--hard:hover,
.page-choice .choice-btn--hard:focus {
    border-color: #c9a87c;
    box-shadow: 0 0 28px rgba(201, 168, 124, 0.45);
}

.page-choice .choice-result {
    background: #ffffff;
    border: 1px solid #f0e0d4;
    color: #4a3f35;
    box-shadow: 0 20px 60px rgba(120, 90, 60, 0.2);
}

.page-choice .choice-result.is-wrong {
    border-color: #f78fb0;
    color: #b04a6f;
}

.page-choice .choice-result.is-right {
    border-color: #e2c79a;
    color: #8a6d3f;
}

.page-choice .result-small {
    color: #a99b8c;
}

/* Hmyrov gift page (/hmyrov) */
.page-hmyrov .choice-screen {
    justify-content: center;
    padding: 24px 16px;
}

.page-hmyrov .choice-card {
    max-width: 560px;
    width: 100%;
}

.ticket-card {
    max-width: 500px;
}

.ticket-text {
    font-size: 1.15rem;
    line-height: 1.75;
    text-align: center;
    color: #4a3f35;
    margin-bottom: 28px;
}

.ticket-photo {
    width: 100%;
    display: block;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
}

.ticket-download {
    display: block;
    width: fit-content;
    margin: 26px auto 0;
    text-decoration: none;
    text-align: center;
}

/* Audio control (top of the card) */
.audio-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 30px;
    padding: 12px 18px;
    background: rgba(255, 246, 233, 0.7);
    border: 1px solid #f0e0d4;
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(120, 90, 60, 0.1);
}

.audio-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: linear-gradient(145deg, #ffb27d, #f27d56);
    color: #fff;
    font-size: 1.35rem;
    line-height: 1;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(242, 125, 86, 0.45);
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.audio-btn:hover {
    transform: scale(1.06);
}

.audio-btn:active {
    transform: scale(0.94);
}

.audio-btn.playing {
    background: linear-gradient(145deg, #7ecb9a, #4aa873);
    box-shadow: 0 6px 18px rgba(74, 168, 115, 0.45);
}

.audio-label {
    font-size: 0.98rem;
    color: #8a6d3f;
    font-style: italic;
    line-height: 1.4;
}

.page-hmyrov .hmyrov-message {
    width: 100%;
    text-align: center;
    font-size: 1.08rem;
    line-height: 1.85;
    color: #4a3f35;
}

.page-hmyrov .hmyrov-message p {
    margin-bottom: 22px;
}

.page-hmyrov .hmyrov-message p:first-child {
    font-size: 1.45rem;
    font-weight: 600;
    color: #9a6540;
    letter-spacing: 0.01em;
    margin-bottom: 26px;
}

.page-hmyrov .hmyrov-message p:last-child {
    margin-bottom: 0;
}

.page-hmyrov .cond-buttons {
    margin-top: 26px;
}

@media (max-width: 600px) {
    .page-hmyrov .choice-card {
        padding: 28px 20px;
    }

    .page-hmyrov .hmyrov-message {
        font-size: 1rem;
        line-height: 1.8;
    }

    .page-hmyrov .hmyrov-message p:first-child {
        font-size: 1.25rem;
    }

    .audio-control {
        padding: 10px 14px;
    }

    .audio-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
}

/* Date calendar page (/HBtobobrishki and /HBtobobrishki1) */
.cal-title {
    font-weight: 600;
}

.cal-subtitle {
    margin-top: 14px;
    font-size: 0.95rem;
    color: #a99b8c;
    line-height: 1.6;
}

.page-calendar .choice-screen {
    align-items: flex-start;
    padding-top: 56px;
}

.cal-wrap {
    margin-top: 32px;
}

.cal-head {
    font-size: 1.15rem;
    font-weight: 600;
    color: #4a3f35;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    justify-items: center;
    margin-top: 14px;
}

.cal-cell {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    font-size: 0.95rem;
}

.cal-wd {
    font-size: 0.75rem;
    color: #b7a795;
    font-weight: 600;
}

.cal-day {
    border: 1px solid #f0e0d4;
    background: #ffffff;
    color: #4a3f35;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.cal-day:hover {
    transform: translateY(-2px);
    border-color: #f78fb0;
    box-shadow: 0 4px 14px rgba(247, 143, 176, 0.25);
}

.cal-day:disabled {
    opacity: 0.35;
    cursor: default;
    background: #f7f1ea;
    border-color: #efe4d8;
    transform: none;
    box-shadow: none;
}

.cal-day.selected {
    background: linear-gradient(135deg, #ffc2d4, #ffd7b3);
    border-color: #f78fb0;
    color: #7a2f4e;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(247, 143, 176, 0.4);
    transform: translateY(-2px);
}

.cal-confirm {
    margin-top: 26px;
    font-size: 1rem;
    line-height: 1.7;
    color: #8a6d3f;
    min-height: 1.7em;
}

.cal-submit {
    margin-top: 24px;
    font-family: inherit;
    font-size: 1.05rem;
    padding: 14px 40px;
    border-radius: 40px;
    cursor: pointer;
    border: 1px solid #f0e0d4;
    color: #4a3f35;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(120, 90, 60, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.cal-submit:hover:not(:disabled) {
    transform: translateY(-3px);
    border-color: #f78fb0;
    box-shadow: 0 0 28px rgba(247, 143, 176, 0.4);
}

.cal-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.cond-buttons {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cond-buttons .cal-submit {
    margin-top: 0;
    width: 100%;
}

.cond-buttons .cal-submit--secondary {
    background: #fff6e9;
    color: #9a6540;
    border-color: #eccab0;
}

.cond-buttons .cal-submit--secondary:hover:not(:disabled) {
    border-color: #e2a07a;
    box-shadow: 0 0 28px rgba(226, 160, 122, 0.4);
}

.cal-wrap.is-locked .cal-day:not(.selected) {
    opacity: 0.45;
}

.cal-wrap.is-locked .cal-submit {
    display: none;
}

.scroll-hint {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 1.2s ease;
}

.scroll-hint.visible {
    opacity: 0.4;
}

.scroll-arrow {
    font-size: 1.4rem;
    color: var(--text-secondary);
    display: block;
    animation: float 2.5s ease-in-out infinite;
}

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

/* Chapters */
.chapters {
    width: 100%;
    padding: 0 16px;
}

.chapter {
    min-height: 100vh;
    min-height: 100dvh;
    scroll-snap-align: start;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.chapter.visible {
    opacity: 1;
    transform: translateY(0);
}

.chapter-inner {
    max-width: var(--content-width);
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 44px 36px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.chapter-inner p {
    font-size: 1.1rem;
    line-height: 2;
    margin-bottom: 1.4em;
    color: var(--text);
}

.chapter-inner p:last-child {
    margin-bottom: 0;
}

.chapter-inner h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--text-accent);
    margin: 0 0 1.2em;
}

.chapter-inner hr {
    display: none;
}

.chapter-inner strong {
    font-weight: 700;
    color: var(--text-accent);
}

.chapter-inner em {
    font-style: italic;
    color: var(--text-secondary);
}

/* Emphasis block — for emotionally important paragraphs */
.chapter-inner p.lead {
    font-size: 1.2rem;
    color: var(--text-accent);
    text-align: center;
    line-height: 1.9;
}

.chapter-inner p.thought {
    border-left: 2px solid var(--text-accent);
    padding-left: 20px;
    margin-left: 8px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Photos */
.chapter-inner figure.photo {
    margin: 2.2em 0;
}

.chapter-inner figure.photo img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    border: 1px solid var(--surface-border);
}

.chapter-inner figure.photo figcaption {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 14px;
    font-style: italic;
}

/* Outro */
.screen--outro {
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
}

.outro-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 2.5s ease;
    font-style: italic;
}

.outro-text.visible {
    opacity: 1;
}

/* Mobile */
@media (max-width: 600px) {
    .chapter-inner {
        padding: 32px 22px;
        border-radius: 12px;
    }

    .chapter-inner p {
        font-size: 1rem;
        line-height: 1.9;
    }

    .chapter-inner p.lead {
        font-size: 1.1rem;
    }

    .chapter {
        padding: 24px 0;
    }

    .scroll-hint {
        bottom: 35px;
    }

    .countdown-value,
    .countdown-sep {
        font-size: 2rem;
    }

    .countdown-item {
        min-width: 56px;
    }

    .cake-img {
        width: 160px;
    }

    .play-img {
        width: 138px;
        height: 138px;
    }

    /* Calendar page on mobile */
    .page-calendar .choice-screen {
        align-items: flex-start;
        padding: 36px 14px 48px;
    }

    .page-calendar .choice-card {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .page-calendar .cal-title {
        font-size: 1.12rem;
        line-height: 1.8;
    }

    .page-calendar .cal-head {
        font-size: 1.05rem;
        margin-bottom: 10px;
    }

    .page-calendar .cal-grid {
        gap: 5px;
        margin-top: 12px;
    }

    .page-calendar .cal-cell {
        font-size: 0.9rem;
    }

    .page-calendar .cal-submit {
        width: 100%;
        padding: 15px 20px;
    }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .chapter-inner {
        padding: 40px 32px;
    }
}