/* =============================================================
   DengiQuest - lightweight stylesheet (static build, no framework CSS)
   Goal: < 14 KB, zero always-on animations, no background drift.
   ============================================================= */

/* ===== Single-page screen visibility =====
   Only the screen with `is-active` is shown. All
   screens pre-rendered in the DOM, transitions are pure CSS class
   toggles. Zero network round-trips between states. */
.screen { display: none; }
.screen.is-active { display: block; }
[hidden] { display: none !important; }

/* ===== Custom modal ===== */
.q-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 18, 27, 0.68);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    overflow-y: auto;
    animation: qmFade 0.12s linear;
}
@keyframes qmFade { from { opacity: 0; } to { opacity: 1; } }
.q-modal-dialog {
    width: 100%;
    max-width: 360px;
    margin: auto;
}
.q-modal .q-modal-content {
    background: linear-gradient(180deg, #0b3440, #073d43);
    border: 1px solid rgba(255,215,0,0.25);
    color: #fff;
    border-radius: 20px;
    text-align: center;
    padding: 22px 18px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.55);
}
.q-modal .q-modal-content h4 {
    color: var(--gold);
    font-weight: 900;
    margin-top: 4px;
}
.q-modal .q-modal-content.win  h4 { color: var(--win); }
.q-modal .q-modal-content.loss h4 { color: var(--loss); }

.milestone-reward-modal .milestone-kicker {
    margin: 0 0 5px;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
}
.milestone-reward-modal .milestone-copy {
    margin: 6px 0 12px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
}
.milestone-rewards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 14px;
}
.milestone-rewards span {
    min-width: 0;
    padding: 10px 6px;
    border: 1px solid rgba(255, 215, 0, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.25;
}
.milestone-rewards b {
    display: block;
    color: var(--gold);
    font-size: 20px;
}

:root {
    --bg-top:        #061b2b;
    --bg-bottom:     #073d43;
    --bg-card:       rgba(5, 18, 27, 0.68);
    --bg-elev:       rgba(255, 255, 255, 0.06);

    --gold:          #FFD700;
    --gold-deep:     #FFA500;
    --gold-glow:     rgba(255, 215, 0, 0.45);

    --win:           #00E676;
    --loss:          #FF1744;
    --urgent:        #FF1744;
    --hot-pink:      #FF4081;
    --cyan:          #35d6b4;
    --coin-1:        #FFC107;
    --coin-2:        #FF6F00;

    --text:          #ffffff;
    --text-muted:    #A9BED1;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button,
input,
textarea,
select {
    font: inherit;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
}
html, body {
    height: 100%;
    margin: 0;
    overflow-x: hidden;
}

/* Defensive media constraint — keeps oversized creatives/images from
   forcing horizontal overflow inside the column. */
img, video, iframe, canvas, svg { max-width: 100%; height: auto; }

/* Desktop side-margin treatment.
   Narrow phone-aspect column centered on a dark surface. */
.mp-body {
    background: linear-gradient(180deg, #061017 0%, #091d26 48%, #1c1230 100%);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

/* The phone column. Mobile-first responsive: fills width up to 400px on
   narrow phones (full bleed), caps at 400px and centers on wider devices.
   Full width on phones, capped at 400px and centered on wider viewports. */
.mp-app {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    min-height: 100vh;
    /* Reserve bottom space for mobile browser chrome and floating controls. */
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
    position: relative;
    background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

/* Lift the column on any viewport wider than the column itself */
@media (min-width: 420px) {
    .mp-app {
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.04),
            0 24px 80px rgba(0, 0, 0, 0.6),
            0 0 140px rgba(0, 229, 255, 0.18);
    }
}

/* ===== Intro funnel — single-fold ad+question layout =====
   Tuned to fit the entire page (ad + heading + question + 3 options +
   legal footer) inside one viewport on every device down to ~640px
   tall (iPhone SE 5G). No scroll required. */

.intro-pitch {
    padding: 12px 18px 2px;
}
.intro-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 9px;
    margin-bottom: 6px;
    border-radius: 999px;
    background: rgba(255, 213, 79, 0.12);
    border: 1px solid rgba(255, 213, 79, 0.42);
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.intro-title {
    color: var(--gold);
    font-weight: 800;
    font-size: 22px;
    margin: 0;
    letter-spacing: 0;
}
.intro-sub {
    color: #fff;
    font-size: 14px;
    margin: 4px 0 0;
    line-height: 1.32;
}
.intro-sub b { color: var(--gold); }

.intro-step-two .intro-pitch {
    padding-top: 10px;
}
.intro-step-two .intro-kicker {
    display: none;
}
.intro-step-two .intro-title {
    font-size: 18px;
}
.intro-step-two .intro-sub {
    font-size: 12.5px;
}
.intro-step-two .intro-legal-footer {
    display: none;
}

.intro-success-card {
    text-align: center;
    padding: 24px 22px 22px;
}
.intro-success-check {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    border-radius: 50%;
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.44);
    color: var(--win);
    font-size: 38px;
    font-weight: 900;
    box-shadow: 0 0 24px rgba(0, 230, 118, 0.22);
}
.intro-bridge {
    color: var(--text-muted);
    font-size: 13px;
    margin: 12px 0 0;
}
.intro-bridge b {
    color: var(--gold);
}

.intro-question {
    padding: 6px 18px 8px;
}
.intro-question-text {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    margin: 10px 0 12px;
    line-height: 1.3;
}
.intro-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.intro-option {
    display: block;
    width: 100%;
    min-height: 48px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    border-radius: 12px;
    padding: 13px 16px;
    appearance: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.25;
    text-align: left;
    color: #fff;
    transition: background 0.12s, border-color 0.12s;
}
.intro-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.7);
}
/* Instant tap feedback — the option lights up the moment you tap it,
   not when the server response comes back. */
.intro-option {
    transition: background 0.18s ease, border-color 0.18s ease,
                color 0.18s ease, transform 0.25s cubic-bezier(.2,.9,.3,1.4);
}
.intro-option.pending {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.9);
    transform: scale(0.98);
}
/* Correct/wrong reveal: bounce-in effect so the color change has visual weight */
.intro-option.correct {
    background: var(--win);
    border-color: #fff;
    color: #002211;
    transform: scale(1.04);
    box-shadow: 0 0 18px rgba(0, 230, 118, 0.5);
}
.intro-option.wrong {
    background: var(--loss);
    border-color: #fff;
    color: #fff;
    transform: scale(0.96);
    box-shadow: 0 0 18px rgba(255, 23, 68, 0.45);
}

/* ===== Value-prop / social-proof block ===== */
.value-prop {
    margin: 20px 14px 0;
    padding: 18px 16px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}
.value-prop-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.value-prop-brand {
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
    flex: 0 0 auto;
    font-size: 22px;
    font-weight: 900;
    color: #e8fbf7;
    text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}
.value-prop-brand b {
    color: var(--gold);
    font-weight: 900;
}
.value-prop-logo {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(145deg, #FFE680, var(--gold) 55%, var(--gold-deep));
    color: #2a1500;
    font-weight: 900;
    font-size: 17px;
    line-height: 38px;
    text-align: center;
    flex: 0 0 auto;
}
.value-prop-tag {
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    line-height: 1.25;
}
.value-prop-list {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    line-height: 1.55;
}
.value-prop-list li {
    padding-left: 22px;
    position: relative;
    margin-bottom: 6px;
}
.value-prop-list li::before {
    content: "✓";
    position: absolute;
    left: 4px; top: 0;
    color: var(--gold);
    font-weight: 900;
}
.value-prop-list b { color: var(--gold); }
.value-prop-proof {
    color: var(--gold);
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    margin: 6px 0 10px;
}
.value-prop-login {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    text-decoration: none;
}
.value-prop-login b { color: var(--gold); }
.value-prop-login:hover { color: #fff; }

/* Tiny legal footer for the intro funnel */
.intro-legal-footer {
    text-align: center;
    padding: 8px 16px 6px;
    font-size: 10.8px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.35;
}
.intro-legal-footer a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: underline;
}

/* =========================
   HUD
   ========================= */
.q-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
}
.q-hud-left { display: flex; align-items: center; gap: 8px; }
.q-hud-right { display: flex; align-items: center; gap: 8px; }

.q-logo {
    display: inline-block;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #fff url('/assets/img/header-logo.png?v=20260717logo1') center / 82% no-repeat;
    border: 2px solid rgba(255,255,255,0.18);
    box-shadow: 0 1px 8px rgba(0,0,0,0.45), 0 0 18px rgba(255,215,0,0.22);
    text-decoration: none;
}

.q-coin-pill {
    background: rgba(0,0,0,0.4);
    border: 1.5px solid var(--gold);
    color: var(--gold);
    padding: 5px 12px 5px 28px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 14px;
    position: relative;
    min-width: 70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.q-coin-pill::before {
    content: "";
    position: absolute;
    left: 5px; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #FFE680, var(--coin-1) 60%, var(--coin-2));
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.25);
}
.q-coin-pill.pop { transform: scale(1.12); transition: transform 0.18s; }

/* XP bar + level pip */
.q-xp-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.35);
    border-radius: 18px;
    padding: 3px 8px 3px 3px;
    border: 1px solid rgba(0, 229, 255, 0.35);
}
.q-level-pip {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--cyan);
    color: #001f24;
    font-weight: 900;
    font-size: 12px;
    line-height: 24px;
    text-align: center;
}
.q-xp-bar {
    width: 60px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}
.q-xp-bar > .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--hot-pink));
    border-radius: 3px;
    width: 0%;
    transition: width 0.6s ease-out;
}

/* =========================
   Streak strip (replaces daily-login modal + ticker)
   Always visible, always available, zero clicks to engage.
   ========================= */
.streak-strip {
    background: linear-gradient(90deg, rgba(255,23,68,0.18), rgba(255,64,129,0.18));
    border-top: 1px solid rgba(255,64,129,0.35);
    border-bottom: 1px solid rgba(255,64,129,0.35);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.streak-strip .streak-fire { color: var(--gold); font-size: 14px; font-weight: 800; }
.streak-strip .streak-count { color: var(--gold); font-weight: 900; }
.streak-strip .streak-cd { color: var(--loss); font-family: 'Courier New', monospace; font-weight: 700; }
.streak-strip .streak-claim {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    min-height: 44px;
    background: var(--gold);
    color: #2a1500;
    border: 0;
    padding: 5px 10px;
    font-weight: 800;
    border-radius: 14px;
    font-size: 11px;
    cursor: pointer;
}

/* =========================
   Buttons
   ========================= */
.q-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 13px 26px;
    border-radius: 28px;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none !important;
    border: 0;
    cursor: pointer;
    text-align: center;
    transition: transform 0.05s;
    letter-spacing: 0.3px;
    line-height: 1.15;
    text-transform: uppercase;
}
.q-btn:active { transform: scale(0.96); }

.q-btn-gold {
    background: linear-gradient(180deg, #FFE680, var(--gold) 60%, var(--gold-deep));
    color: #2a1500;
    box-shadow: 0 3px 10px rgba(255,215,0,0.35), inset 0 -2px 0 rgba(0,0,0,0.15);
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}
.q-btn-gold:hover { color: #1a0900; }

/* Pulse only fires when user JUST gained the ability to act — */
/* never always-on. Activate by adding .pulse-now to a button.    */
.q-btn-gold.pulse-now { animation: btnPulse 1s ease-in-out 3; }
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 3px 10px rgba(255,215,0,0.35), inset 0 -2px 0 rgba(0,0,0,0.15); }
    50%      { box-shadow: 0 5px 18px rgba(255,215,0,0.8),  inset 0 -2px 0 rgba(0,0,0,0.15); }
}

.q-btn-pink {
    background: linear-gradient(180deg, #FF80AB, var(--hot-pink) 60%, #C2185B);
    color: #fff;
    box-shadow: 0 3px 10px rgba(255,64,129,0.4);
}

.q-btn-outline {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.35);
}

.q-btn-skip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 36px;
    background: transparent;
    color: rgba(255,255,255,0.45);
    border: 0;
    padding: 6px 12px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0;
    text-decoration: underline !important;
}
.q-btn-skip:hover { color: rgba(255,255,255,0.75); }

.q-btn-block { display: flex; width: 100%; }

/* =========================
   Question / option cards
   ========================= */
.q-question-card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 20px 16px;
    margin: 14px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.q-question-text {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
    line-height: 1.35;
}
.q-option {
    display: block;
    width: 100%;
    min-height: 48px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 14px 16px;
    appearance: none;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 700;
    font: inherit;
    color: #fff;
    line-height: 1.25;
    transition: background 0.12s;
    text-align: center;
}
.q-option:hover { background: rgba(255,255,255,0.16); }
.q-option.correct {
    background: var(--win);
    border-color: #fff;
    color: #002211;
}
.q-option.wrong {
    background: var(--loss);
    border-color: #fff;
    color: #fff;
}

/* =========================
   Tabs
   ========================= */
.q-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin: 0 14px;
    gap: 4px;
}
.q-tab {
    appearance: none;
    border: 0;
    background: transparent;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    text-align: center;
    padding: 11px 6px;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13.5px;
    border-radius: 10px 10px 0 0;
    transition: background 0.15s;
}
.q-tab.active {
    color: #fff;
    background: rgba(255,64,129,0.16);
    border-bottom: 3px solid var(--hot-pink);
}

/* =========================
   Contest cards
   ========================= */
.q-contest-card {
    background: rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 13px 14px;
    margin: 10px 14px;
    position: relative;
    border: 1px solid rgba(255,255,255,0.06);
}
.q-contest-card .badge-new {
    position: absolute;
    top: -7px; right: 12px;
    background: var(--hot-pink);
    color: #fff;
    padding: 2px 9px;
    border-radius: 9px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.q-contest-card .badge-sponsored {
    position: absolute;
    top: -7px; left: 12px;
    background: var(--cyan);
    color: #002b30;
    padding: 2px 9px;
    border-radius: 9px;
    font-size: 10.5px;
    font-weight: 800;
}
.q-contest-card h5 {
    margin: 0 0 4px;
    font-size: 15.5px;
    font-weight: 800;
}
.q-contest-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 12px;
    margin: 4px 0 10px;
}
.q-contest-prize {
    color: var(--gold);
    font-weight: 800;
    font-size: 13.5px;
}
.q-countdown { font-family: 'Courier New', monospace; font-weight: 700; }
.q-countdown.urgent { color: var(--urgent); }

.rules-box {
    text-align: left;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 14px;
    margin: 18px 0;
    font-size: 13px;
    line-height: 1.55;
    border: 1px solid rgba(255,215,0,0.2);
}
.rules-box a { color: var(--gold); }

/* =========================
   Ad slots — fixed dimensions, zero CLS
   =========================
   Container reserves calm layout space + 24px for the neutral "Реклама"
   label. Yandex fills the inner unit on push.
*/
.ad-slot {
    position: relative;
    margin: 14px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    overflow: hidden;
}
.ad-slot::before {
    content: "Реклама";
    position: absolute;
    top: 4px; left: 50%;
    transform: translateX(-50%);
    font-size: 9.5px;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    pointer-events: none;
    z-index: 1;
}
.ad-slot .yan-ad-unit {
    display: block !important;
    z-index: 2;
    width: 100%;
}

/* Responsive display unit WITHOUT full-width-responsive, so Yandex serves a
   standard rectangle (300x250 / 336x280 / 320x100) that displays in full
   rather than a full-bleed portrait that eats the screen. Reserve the largest
   expected creative plus the 24px label from first paint through no-fill so
   late ad rendering cannot move the quiz controls. */
.ad-slot--rect {
    width: 100%;
    max-width: 336px;
    height: 304px;
    min-height: 304px;
    max-height: 304px;
    padding-top: 24px;
}

/* In-feed variant: sits inline between contest cards in the home list.
   Tighter top/bottom margin to match contest-card spacing (10px/14px). */
.ad-slot--inline {
    margin: 10px 14px;
}

/* Bottom-of-content slot. Yandex serves these responsive units a 300x250 /
   320x250 rectangle (verified live), so use the same stable reservation as
   top rectangles. This prevents both clipping and no-fill layout shifts. */
.ad-slot--banner {
    width: 100%;
    max-width: 336px;
    height: 304px;
    min-height: 304px;
    max-height: 304px;
    padding-top: 24px;
}

/* Keep no-fill slots in flow so quiz content does not jump upward when
   Yandex returns unfilled / unfill-optimized. The ad creative itself is
   hidden, but the reserved container remains as calm layout space. */
.ad-slot:has(ins[data-ad-status^="unfill"]) {
    background: rgba(255,255,255,0.015);
    border: 1px solid rgba(255,255,255,0.045);
    box-shadow: none;
}
/* Same effect for browsers that don't support :has(); JS in ads.js
   adds .ad-slot--empty to the container after the Yandex status fires. */
.ad-slot--empty {
    background: rgba(255,255,255,0.015);
    border: 1px solid rgba(255,255,255,0.045);
    box-shadow: none;
}

.ad-slot:has(ins[data-ad-status^="unfill"])::before,
.ad-slot--empty::before {
    content: "";
}

.ad-slot:has(ins[data-ad-status^="unfill"]) .yan-ad-unit,
.ad-slot--empty .yan-ad-unit {
    display: none !important;
}

.ad-slot--banner .yan-ad-unit {
    display: block !important;
    width: 100% !important;
}

/* Feed — must remain after main content, never on the first screen. */
.ad-slot--feed {
    width: calc(100% - 28px);
    min-height: 280px;
    max-height: 500px;
    padding-top: 24px;
}
.ad-slot--feed .yan-ad-unit {
    display: block !important;
    width: 100%;
    max-height: 476px;
}

.ad-slot--placeholder {
    border: 1px dashed rgba(255,255,255,0.18);
}
.ad-placeholder-note {
    color: rgba(255,255,255,0.42);
    font-size: 11px;
    text-align: center;
    padding: 24px 10px 10px;
}

/* Spacer enforced before a bottom-of-screen ad to keep ~60px gap from
   the CTA above it — prevents misclick policy violations. */
.ad-spacer-cta {
    height: 60px;
    pointer-events: none;
}

/* Local-only Rewarded preview overlay. Production uses Yandex Rewarded. */
.ad-fullscreen-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 24px;
}
.ad-fullscreen-overlay.show { display: flex; }
.ad-fullscreen-overlay .ad-card {
    background: #111;
    border: 1px solid rgba(255,215,0,0.4);
    border-radius: 14px;
    padding: 28px 20px;
    max-width: 300px;
    width: 100%;
    text-align: center;
}
.ad-fullscreen-overlay .ad-fs-label {
    font-size: 12px;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
}
.ad-fullscreen-overlay .ad-fs-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.35);
    margin-top: 6px;
}
.ad-fullscreen-overlay .ad-countdown {
    font-size: 48px;
    color: var(--gold);
    margin: 12px 0;
    font-weight: 900;
}

/* =========================
   Floating bubbles (spin + fortune)
   No bobbing animation — battery cost > engagement lift.
   ========================= */
/* Anchor floating bubbles to the right edge of the MOBILE COLUMN
   (not the viewport). On mobile they sit 12px from screen edge; on
   desktop they sit 12px from the column's right edge. */
.float-stack {
    position: fixed;
    bottom: 86px;
    right: max(12px, calc(50% - 200px + 12px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
}
.float-bubble {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(145deg, #FFE680, var(--gold) 60%, var(--gold-deep));
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 24px;
}
.float-bubble.pink {
    background: linear-gradient(145deg, #FF80AB, var(--hot-pink) 60%, #C2185B);
}

/* (Modal styles live at the top of this file alongside .screen, since the
   custom .q-modal system handles dialogs.) */

/* =========================
   Score page
   ========================= */
.q-score-hero { text-align: center; padding: 26px 16px 8px; }
.q-score-hero .score-num {
    font-size: 64px;
    font-weight: 900;
    color: var(--gold);
    line-height: 1;
}
.q-score-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}
.result-reward-offer {
    width: min(100%, 420px);
    margin: 12px auto 0;
}
.result-reward-offer > span {
    display: block;
    margin-bottom: 7px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
}
.result-reward-offer .q-btn {
    min-height: 48px;
    padding: 9px 12px;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
}

/* =========================
   Quiz HUD
   ========================= */
.q-quiz-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0,0,0,0.4);
    font-weight: 800;
    border-bottom: 1px solid rgba(255,64,129,0.25);
    position: sticky;
    top: 0;
    z-index: 30;
}
.q-quiz-hud .timer { color: var(--gold); }
.q-quiz-hud .timer.urgent { color: var(--urgent); }

.q-helpers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 14px;
}
.q-helper-btn {
    min-width: 0;
    min-height: 44px;
    background: rgba(0,229,255,0.18);
    border: 1px solid var(--cyan);
    color: #fff;
    border-radius: 10px;
    padding: 5px 6px;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
}
.q-helper-btn::before { content: "📺"; font-size: 12px; }
.q-helper-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* =========================
   Reward preview (inside choice-of-reward and ad-watch screens)
   Salience: make the +N huge.
   ========================= */
.reward-preview {
    text-align: center;
    margin: 10px 0 16px;
}
.reward-preview .reward-amount {
    font-size: 56px;
    font-weight: 900;
    color: var(--gold);
    line-height: 1;
    letter-spacing: -1px;
}
.reward-preview .reward-suffix {
    display: block;
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* =========================
   Choice-of-reward grid
   ========================= */
.reward-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
}
.reward-choice {
    appearance: none;
    width: 100%;
    min-height: 78px;
    background: rgba(0,0,0,0.35);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 12px 6px;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}
.reward-choice:hover { background: rgba(255,255,255,0.08); }
.reward-choice.highlight {
    border-color: var(--gold);
    background: rgba(255,215,0,0.15);
}
.reward-choice.highlight::after {
    content: "ЛУЧШЕ";
    position: absolute;
    top: -8px; left: 50%;
    transform: translateX(-50%);
    background: var(--gold);
    color: #2a1500;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 8px;
}
.reward-choice .rc-points {
    font-size: 22px;
    font-weight: 900;
    color: var(--gold);
}
.reward-choice .rc-ads {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* =========================
   Inline +N toast (replaces sound + coin-fly)
   ========================= */
.q-toast {
    position: fixed;
    z-index: 9100;
    font-weight: 900;
    font-size: 22px;
    pointer-events: none;
    transform: translateX(-50%);
    text-shadow: 0 2px 6px rgba(0,0,0,0.55);
    animation: toastFloat 1.0s ease-out forwards;
}
@keyframes toastFloat {
    0%   { opacity: 0; transform: translate(-50%, 0)    scale(0.7); }
    20%  { opacity: 1; transform: translate(-50%, -8px) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -48px) scale(1); }
}

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

/* =========================
   Cooldown bar
   ========================= */
.cooldown-bar {
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--loss);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 8px 14px;
    text-align: center;
    font-size: 13px;
}
.cooldown-bar .cd-timer { color: var(--loss); font-weight: 900; }

/* =========================
   Spin wheel
   ========================= */
.spin-wheel-wrap { position: relative; width: 260px; height: 260px; margin: 18px auto; }
.spin-wheel {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 5px solid var(--gold);
    box-shadow: 0 0 22px rgba(255,215,0,0.35), inset 0 0 10px rgba(0,0,0,0.45);
    transition: transform 4s cubic-bezier(0.15, 0.85, 0.35, 1);
    background: conic-gradient(
        var(--hot-pink) 0 45deg,
        var(--cyan)     45deg 90deg,
        var(--gold)     90deg 135deg,
        var(--win)      135deg 180deg,
        var(--hot-pink) 180deg 225deg,
        var(--cyan)     225deg 270deg,
        var(--gold)     270deg 315deg,
        var(--win)      315deg 360deg
    );
}
.spin-pointer {
    position: absolute;
    top: -6px; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 22px solid var(--loss);
    z-index: 10;
}
.spin-prizes { position: absolute; inset: 0; pointer-events: none; }
.spin-prizes span {
    position: absolute;
    top: 50%; left: 50%;
    color: #000;
    font-weight: 900;
    font-size: 13px;
}

/* =========================
   Achievement badge
   ========================= */
.achievement-badge {
    background: linear-gradient(135deg, var(--cyan), var(--hot-pink));
    border-radius: 50%;
    width: 72px; height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.45);
}

/* =========================
   Welcome / signup / daily / etc
   ========================= */
.welcome-splash input,
.signup-input {
    min-height: 44px;
    background: rgba(0,0,0,0.35);
    border: 2px solid var(--gold);
    border-radius: 10px;
    color: #fff;
    padding: 11px;
    font-size: 15px;
    text-align: center;
    width: 100%;
    margin: 10px 0;
}
.welcome-splash input::placeholder,
.signup-input::placeholder { color: rgba(255,255,255,0.4); }

.day-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin: 12px 0;
}
.day-cell {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 6px 3px;
    text-align: center;
    font-size: 10.5px;
}
.day-cell.claimed { background: var(--win); color: #002211; }
.day-cell.today { background: var(--gold); color: #2a1500; }
.day-cell .reward { font-weight: 900; font-size: 12px; }

footer.q-footer {
    text-align: center;
    padding: 16px 14px 90px;
    color: var(--text-muted);
    font-size: 11px;
}
footer.q-footer a { color: var(--gold); margin: 0 4px; text-decoration: none; }
footer.q-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
}

/* Screen-reader-only heading for SEO / a11y crawlers. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =============================================================
   DENGIQUEST LIGHT THEME
   White-first, vibrant financial palette. Behavioural selectors and
   screen flow remain unchanged; this layer only changes presentation.
   ============================================================= */
:root {
    --bg-top:        #ffffff;
    --bg-bottom:     #f4f8ff;
    --bg-card:       #ffffff;
    --bg-elev:       #eef5ff;

    --primary:       #175cd3;
    --primary-deep:  #124ca6;
    --emerald:       #067a6f;
    --gold:          #a15c00;
    --gold-deep:     #7a4500;
    --gold-glow:     rgba(161, 92, 0, 0.22);

    --win:           #067a6f;
    --loss:          #d92d45;
    --urgent:        #d92d45;
    --hot-pink:      #d92d45;
    --cyan:          #0284c7;
    --coin-1:        #f4b740;
    --coin-2:        #e47b12;

    --text:          #0b1f33;
    --text-muted:    #667085;
    --light-line:    #d8e2f0;
    --light-shadow:  0 16px 42px rgba(23, 92, 211, 0.1);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline-color: var(--primary);
}

.mp-body {
    background:
        radial-gradient(circle at 12% 10%, rgba(23, 92, 211, 0.09), transparent 25rem),
        radial-gradient(circle at 88% 85%, rgba(6, 122, 111, 0.08), transparent 27rem),
        #f7f9fc;
    color: var(--text);
}
.mp-app {
    background:
        radial-gradient(circle at 88% 7%, rgba(161, 92, 0, 0.08), transparent 12rem),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}
@media (min-width: 420px) {
    .mp-app {
        box-shadow:
            0 0 0 1px rgba(37, 99, 235, 0.08),
            0 24px 80px rgba(37, 99, 235, 0.13);
    }
}

.q-modal { background: rgba(16, 42, 67, 0.38); }
.q-modal .q-modal-content {
    background:
        radial-gradient(circle at 90% 0%, rgba(16, 185, 129, 0.12), transparent 10rem),
        #fff;
    border-color: var(--light-line);
    color: var(--text);
    box-shadow: var(--light-shadow);
}
.q-modal .q-modal-content h4,
.milestone-rewards b { color: var(--primary); }
.milestone-rewards span {
    border-color: var(--light-line);
    background: #f5f9ff;
}

.intro-kicker {
    background: #e5faf3;
    border-color: rgba(16, 185, 129, 0.28);
    color: #067a6f;
}
.intro-title { color: var(--primary); }
.intro-sub,
.intro-question-text { color: var(--text); }
.intro-sub b,
.intro-bridge b { color: #067a6f; }
.intro-success-check {
    background: #e5faf3;
    border-color: rgba(5, 150, 105, 0.3);
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.14);
}
.intro-option {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.24);
    color: var(--text);
    box-shadow: 0 4px 13px rgba(37, 99, 235, 0.06);
}
.intro-option:hover,
.intro-option.pending {
    background: #edf5ff;
    border-color: var(--primary);
}
.intro-option.correct,
.q-option.correct {
    background: #dff8ee;
    border-color: var(--win);
    color: #065f46;
    box-shadow: 0 8px 22px rgba(5, 150, 105, 0.18);
}
.intro-option.wrong,
.q-option.wrong {
    background: #fff0f1;
    border-color: var(--loss);
    color: #b4232c;
    box-shadow: 0 8px 22px rgba(229, 72, 77, 0.16);
}

.value-prop {
    background:
        radial-gradient(circle at 100% 0%, rgba(16, 185, 129, 0.1), transparent 12rem),
        #fff;
    border-color: var(--light-line);
    box-shadow: var(--light-shadow);
}
.value-prop-brand {
    color: var(--text);
    text-shadow: none;
}
.value-prop-brand b,
.value-prop-list b,
.value-prop-login b { color: var(--primary); }
.value-prop-logo {
    background: linear-gradient(145deg, #dbeafe, #60a5fa 55%, #2563eb);
    color: #fff;
}
.value-prop-tag { color: var(--text); }
.value-prop-list { color: var(--text-muted); }
.value-prop-list li::before,
.value-prop-proof { color: var(--emerald); }
.value-prop-login { color: var(--text-muted); }
.value-prop-login:hover { color: var(--primary); }
.intro-legal-footer { color: #829ab1; }
.intro-legal-footer a { color: #486581; }

.q-header {
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(37, 99, 235, 0.08);
    backdrop-filter: blur(12px);
}
.q-logo {
    border-color: rgba(37, 99, 235, 0.16);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.16);
}
.q-coin-pill {
    background: #fff8e7;
    border-color: #e6a51b;
    color: #9a5700;
}
.q-xp-wrap {
    background: #eef5ff;
    border-color: rgba(14, 165, 233, 0.3);
}
.q-xp-bar { background: #dbe7f5; }
.q-level-pip {
    background: var(--primary);
    color: #fff;
}
.q-xp-bar > .fill {
    background: linear-gradient(90deg, var(--primary), var(--cyan), var(--emerald));
}

.streak-strip {
    background: linear-gradient(90deg, #fff8e7, #f1faf7);
    border-color: rgba(161, 92, 0, 0.2);
    color: var(--text);
}
.streak-strip .streak-fire,
.streak-strip .streak-count { color: #a15c00; }
.streak-strip .streak-claim {
    background: #a15c00;
    color: #fff;
    box-shadow: 0 6px 16px rgba(161, 92, 0, 0.2);
}

.q-btn-gold {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24);
    text-shadow: none;
}
.q-btn-gold:hover { color: #fff; }
.q-btn-pink {
    background: var(--emerald);
    box-shadow: 0 8px 20px rgba(6, 122, 111, 0.2);
}
.q-btn-outline {
    background: #fff;
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.3);
}
.q-btn-skip { color: var(--text-muted); }
.q-btn-skip:hover { color: var(--primary); }
@keyframes btnPulse {
    0%, 100% { box-shadow: 0 8px 20px rgba(37, 99, 235, 0.24); }
    50% { box-shadow: 0 11px 29px rgba(37, 99, 235, 0.44); }
}

.q-question-card {
    background: #fff;
    border-color: var(--light-line);
    box-shadow: var(--light-shadow);
}
.q-option {
    background: #f6f9fd;
    border-color: rgba(37, 99, 235, 0.12);
    color: var(--text);
}
.q-option:hover {
    background: #eaf2ff;
    border-color: rgba(37, 99, 235, 0.35);
}
.q-tabs { border-bottom-color: var(--light-line); }
.q-tab.active {
    color: var(--primary);
    background: #eaf2ff;
    border-bottom-color: var(--primary);
}
.q-contest-card {
    background: #fff;
    border-color: var(--light-line);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}
.q-contest-card .badge-new {
    background: #a15c00;
}
.q-contest-card .badge-sponsored {
    background: #dff8ee;
    color: #067a6f;
}
.q-contest-prize,
.q-score-hero .score-num,
.result-reward-offer > span,
.reward-preview .reward-amount,
.reward-choice .rc-points { color: #a15c00; }
.rules-box {
    background: #f6f9fd;
    border-color: var(--light-line);
}
.rules-box a { color: var(--primary); }

.ad-slot {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(37, 99, 235, 0.1);
}
.ad-slot--placeholder {
    border-color: rgba(37, 99, 235, 0.2);
}
.ad-placeholder-note,
.ad-slot::before { color: #829ab1; }
.ad-fullscreen-overlay { background: rgba(16, 42, 67, 0.7); }
.ad-fullscreen-overlay .ad-card {
    background: #fff;
    border-color: var(--light-line);
    color: var(--text);
    box-shadow: var(--light-shadow);
}
.ad-fullscreen-overlay .ad-fs-label { color: var(--text-muted); }
.ad-fullscreen-overlay .ad-fs-sub { color: #829ab1; }
.ad-fullscreen-overlay .ad-countdown { color: var(--primary); }

.float-bubble {
    background: linear-gradient(145deg, #60a5fa, #2563eb);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.28);
}
.float-bubble.pink {
    background: linear-gradient(145deg, #16a394, #067a6f);
}
.q-quiz-hud {
    background: rgba(255, 255, 255, 0.93);
    border-bottom-color: var(--light-line);
    box-shadow: 0 5px 16px rgba(37, 99, 235, 0.07);
    backdrop-filter: blur(12px);
}
.q-quiz-hud .timer { color: #a15c00; }
.q-helper-btn {
    background: #eaf7ff;
    border-color: rgba(14, 165, 233, 0.35);
    color: #0369a1;
}

.reward-choice {
    background: #fff;
    border-color: var(--light-line);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.06);
}
.reward-choice:hover { background: #eef5ff; }
.reward-choice.highlight {
    border-color: var(--primary);
    background: #eaf2ff;
}
.reward-choice.highlight::after {
    background: var(--primary);
    color: #fff;
}
.q-toast {
    color: var(--primary);
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.7);
}
.cooldown-bar {
    background: #fff0f1;
    border-color: rgba(229, 72, 77, 0.45);
}

.spin-wheel {
    border-color: #fff;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.17), inset 0 0 10px rgba(16, 42, 67, 0.12);
    background: conic-gradient(
        #f43f5e 0 45deg,
        #0ea5e9 45deg 90deg,
        #f4b740 90deg 135deg,
        #10b981 135deg 180deg,
        #fb7185 180deg 225deg,
        #38bdf8 225deg 270deg,
        #f8cc62 270deg 315deg,
        #34d399 315deg 360deg
    );
}
.achievement-badge {
    background: linear-gradient(135deg, var(--primary), var(--emerald));
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.2);
}
.welcome-splash input,
.signup-input {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.35);
    color: var(--text);
}
.welcome-splash input::placeholder,
.signup-input::placeholder { color: #9fb3c8; }
.day-cell {
    background: #f6f9fd;
    border-color: var(--light-line);
}
.day-cell.claimed {
    background: #dff8ee;
    color: #065f46;
}
.day-cell.today {
    background: #eaf2ff;
    border-color: var(--primary);
    color: var(--primary-deep);
}
footer.q-footer {
    color: var(--text-muted);
    border-top: 1px solid rgba(37, 99, 235, 0.08);
}
footer.q-footer a { color: var(--primary); }
