/* =============================================================
   DengiQuiz — стили квиз-приложения.
   Мобильный интерфейс по центру экрана: основная аудитория приходит
   с телефонов, на десктопе колонка просто центрируется.
   ============================================================= */

:root {
    --bg:          #0e1116;
    --bg-soft:     #151a22;
    --card:        #1b212b;
    --card-hi:     #232b38;
    --border:      #2c3543;
    --text:        #eef2f7;
    --text-muted:  #8d99ab;

    --gold:        #f5c451;
    --gold-dim:    #c99b32;
    --gold-glow:   rgba(245, 196, 81, 0.45);
    --cyan:        #38d9a9;
    --loss:        #ff6b6b;

    --radius:      14px;
    --shadow:      0 10px 30px rgba(0, 0, 0, 0.45);
    --app-width:   480px;
}

* { box-sizing: border-box; }

/* Любое авторское правило display перебивает браузерное [hidden] { display: none },
   независимо от специфичности. Без этой строки скрытые модалки и HUD остаются
   в потоке: они прозрачны, но перехватывают клики по всему экрану. */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

/* Прилипающий баннер РСЯ перекрывает низ экрана — резервируем место,
   иначе он накроет кнопки на экранах с длинной прокруткой. */
html.yan-floor-space body { padding-bottom: 106px; }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.mp-app {
    max-width: var(--app-width);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
}

/* ---------------- Экраны ---------------- */

.screen { display: none; padding-bottom: 32px; }
.screen.is-active { display: block; animation: screen-in 0.22s ease; }

@keyframes screen-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* ---------------- Шапка ---------------- */

.streak-strip {
    background: linear-gradient(90deg, rgba(245,196,81,0.18), rgba(56,217,169,0.12));
    border-bottom: 1px solid var(--border);
    padding: 7px 14px;
    font-size: 12.5px;
    text-align: center;
    color: var(--gold);
}

.q-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
    position: sticky;
    top: 0;
    z-index: 30;
}

.q-hud-left { display: flex; align-items: center; gap: 12px; min-width: 0; }

.q-logo {
    font-weight: 800;
    font-size: 15px;
    color: var(--gold);
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.q-logo:hover { text-decoration: none; }

.q-xp-wrap { display: flex; align-items: center; gap: 7px; min-width: 0; }

.q-level-pip {
    display: grid;
    place-items: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--gold);
    color: #1a1206;
    font-size: 11.5px;
    font-weight: 800;
    flex: none;
}

.q-xp-bar {
    width: 70px; height: 5px;
    border-radius: 3px;
    background: var(--card-hi);
    overflow: hidden;
}
.q-xp-bar .fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--cyan), var(--gold));
    transition: width 0.4s ease;
}

.q-coin-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--card-hi);
    border: 1px solid var(--gold-dim);
    color: var(--gold);
    font-weight: 800;
    font-size: 14px;
}
.q-coin-pill.bump { animation: coin-bump 0.4s ease; }

@keyframes coin-bump {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.25); box-shadow: 0 0 16px var(--gold-glow); }
    100% { transform: scale(1); }
}

/* ---------------- Кнопки ---------------- */

.q-btn {
    display: inline-block;
    padding: 13px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.q-btn:active { transform: scale(0.98); }
.q-btn:disabled { opacity: 0.5; cursor: default; }

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

.q-btn-gold {
    background: linear-gradient(180deg, var(--gold), var(--gold-dim));
    color: #1a1206;
    box-shadow: 0 6px 18px rgba(245, 196, 81, 0.22);
}

.q-btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.q-btn-outline:hover { background: var(--card); }

.q-btn-mini { padding: 6px 12px; font-size: 11.5px; margin-left: 6px; }

/* Отказ от бонуса всегда виден, но не соперничает с основным действием —
   так пользователь не чувствует, что его загнали в угол. */
.q-btn-skip {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: none;
    border: 0;
    color: var(--text-muted);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
}
.q-btn-skip:hover { color: var(--text); }

.q-btn-back {
    display: block;
    margin: 14px auto 0;
    background: none;
    border: 0;
    color: var(--text-muted);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}

.pulse-now { animation: pulse-now 2.2s ease-in-out infinite; }
@keyframes pulse-now {
    0%, 100% { box-shadow: 0 6px 18px rgba(245, 196, 81, 0.22); }
    50%      { box-shadow: 0 6px 26px rgba(245, 196, 81, 0.55); }
}

@media (prefers-reduced-motion: reduce) {
    .pulse-now, .q-coin-pill.bump { animation: none; }
    .screen.is-active { animation: none; }
}

/* ---------------- Рекламные слоты ----------------
   Место резервируется заранее: без этого страница дёргается в момент
   отрисовки блока, а сдвиг макета портит и метрики, и видимость. */

.ad-slot {
    margin: 12px 14px;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ad-slot--rect   { min-height: 250px; }
.ad-slot--banner { min-height: 100px; }

/* Пустой слот не должен оставлять дыру в макете. */
.ad-slot--empty { min-height: 0; margin: 0; }

.ad-slot--placeholder {
    border: 1px dashed var(--border);
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.02) 10px, rgba(255,255,255,0.02) 20px);
}
.ad-placeholder-note { color: var(--text-muted); font-size: 12px; }

.yan-ad-unit { width: 100%; }

/* Отступ, чтобы нижний баннер не прилипал вплотную к кнопке действия
   и случайный промах по кнопке не попадал в рекламу. */
.ad-spacer-cta { height: 18px; }

/* ---------------- Вводная воронка ---------------- */

.intro-pitch { text-align: center; padding: 6px 18px 0; }

.intro-kicker {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(245, 196, 81, 0.14);
    color: var(--gold);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.intro-title { font-size: 23px; margin: 10px 0 6px; }
.intro-sub   { color: var(--text-muted); font-size: 14.5px; margin: 0; }
.intro-sub b { color: var(--gold); }

.intro-question { padding: 18px 14px 8px; }

.intro-question-text {
    font-size: 18px;
    line-height: 1.35;
    text-align: center;
    margin: 0 0 16px;
}

.intro-options, #qOptions { display: grid; gap: 10px; }

.intro-option, .q-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 15px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.intro-option:hover, .q-option:hover { border-color: var(--gold-dim); background: var(--card-hi); }
.intro-option:active, .q-option:active { transform: scale(0.99); }

.intro-option.correct, .q-option.correct {
    border-color: var(--cyan);
    background: rgba(56, 217, 169, 0.14);
}
.intro-option.wrong, .q-option.wrong {
    border-color: var(--loss);
    background: rgba(255, 107, 107, 0.13);
}
.intro-option.locked, .q-option:disabled { cursor: default; }

/* Подсказка, купленная за просмотр рекламы. */
.q-option.hint {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-glow) inset;
}

.intro-legal-footer {
    padding: 16px 20px 8px;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.5;
    text-align: center;
}

.intro-success-card {
    text-align: center;
    padding: 20px 18px;
    margin: 8px 14px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--border);
}

.intro-success-check {
    width: 56px; height: 56px;
    margin: 0 auto 8px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(56, 217, 169, 0.16);
    color: var(--cyan);
    font-size: 30px;
}

.intro-bridge { color: var(--text-muted); font-size: 13.5px; }

/* ---------------- Главная ---------------- */

.home-earn { padding: 12px 14px 0; }

.q-tabs {
    display: flex;
    gap: 6px;
    padding: 4px 14px 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.q-tabs::-webkit-scrollbar { display: none; }

.q-tab {
    flex: none;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-muted);
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.q-tab.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #1a1206;
}

.tab-panel { padding: 12px 0 0; }

.q-contest-card {
    margin: 0 14px 12px;
    padding: 15px 16px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--border);
}

.q-contest-top { display: flex; align-items: center; gap: 8px; }
.q-contest-card h5 { margin: 0; font-size: 16px; flex: 1; }

.q-badge-new {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--cyan);
    color: #072b21;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
}

.q-contest-desc { margin: 6px 0 10px; color: var(--text-muted); font-size: 13px; }

.q-contest-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
}
.q-contest-prize { color: var(--gold); font-weight: 800; }
.q-contest-fee   { color: var(--text-muted); }

.q-contest-live { color: var(--cyan); font-size: 11.5px; margin-bottom: 10px; }

.value-prop {
    margin: 18px 14px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--bg-soft);
    border: 1px solid var(--border);
}
.value-prop-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.value-prop-brand { font-size: 17px; font-weight: 800; color: var(--text); }
.value-prop-brand b { color: var(--gold); }
.value-prop-tag { color: var(--text-muted); font-size: 12px; }
.value-prop-list { margin: 10px 0; padding-left: 18px; font-size: 13.5px; color: var(--text-muted); }
.value-prop-list li { margin-bottom: 6px; }
.value-prop-list b { color: var(--text); }
.value-prop-proof { margin: 0; font-size: 12px; color: var(--cyan); }

.q-footer {
    padding: 20px 16px 30px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}
.q-footer a { color: var(--text-muted); }
.q-footer-copy { margin-top: 6px; }

/* ---------------- Карточка входа ---------------- */

.entry-body { text-align: center; padding: 18px 16px 8px; }
.entry-body h3 { margin: 0; font-size: 20px; }
.entry-sub { color: var(--text-muted); margin: 4px 0; font-size: 13.5px; }
.entry-prize { font-size: 24px; text-shadow: 0 0 14px var(--gold-glow); margin: 10px 0 4px; }

.rules-box {
    margin: 14px 0 18px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--border);
    text-align: left;
    font-size: 13.5px;
}
.rules-box b { color: var(--gold); }
.rules-box ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-muted); }
.rules-box li { margin-bottom: 4px; }

.entry-body .q-btn-outline { margin-top: 8px; }

/* ---------------- Игра ---------------- */

.q-quiz-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    font-weight: 600;
}
.q-quiz-hud .timer { color: var(--cyan); font-variant-numeric: tabular-nums; }
.q-quiz-hud .timer.is-low { color: var(--loss); animation: pulse-now 1s ease-in-out infinite; }

.q-helpers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 10px 14px 0;
}

.q-helper-btn {
    padding: 9px 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-muted);
    font-size: 11.5px;
    font-family: inherit;
    cursor: pointer;
}
.q-helper-btn:hover:not(:disabled) { border-color: var(--gold-dim); color: var(--text); }
.q-helper-btn.used { opacity: 0.4; text-decoration: line-through; cursor: default; }

.q-question-card { padding: 16px 14px; }

.q-question-text {
    font-size: 18px;
    line-height: 1.35;
    text-align: center;
    margin-bottom: 16px;
}

/* ---------------- Результат ---------------- */

.q-score-hero { text-align: center; padding: 24px 16px 18px; }
.q-score-label { color: var(--text-muted); margin: 0; font-size: 12.5px; letter-spacing: 2px; }

.score-num {
    font-size: 58px;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.1;
    text-shadow: 0 0 26px var(--gold-glow);
}

.q-score-stats {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 12.5px;
}

.result-blurb { margin-top: 12px; font-size: 13.5px; color: var(--text-muted); }

.result-reward-offer {
    margin-top: 16px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--gold-dim);
}
.result-reward-offer > span {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--gold);
}

.cooldown-bar {
    margin: 0 14px 12px;
    padding: 11px 14px;
    border-radius: var(--radius);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted);
}
.cd-timer { color: var(--gold); font-weight: 800; font-variant-numeric: tabular-nums; }

.result-back { text-align: center; padding: 12px; }

/* ---------------- Модалки ---------------- */

.q-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(4, 6, 10, 0.72);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.q-modal.show { opacity: 1; }

.q-modal-dialog { width: 100%; max-width: 380px; }

.q-modal-content {
    padding: 22px 20px;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
    transform: translateY(10px) scale(0.98);
    transition: transform 0.2s ease;
}
.q-modal.show .q-modal-content { transform: none; }

.q-modal-content.win  { border-color: var(--cyan); }
.q-modal-content.loss { border-color: var(--loss); }
.q-modal-content h4   { margin: 8px 0; font-size: 18px; }

.modal-glyph { font-size: 38px; line-height: 1; }
.modal-hint  { font-size: 13px; color: var(--text-muted); margin: 6px 0 12px; }

.reward-preview { margin: 12px 0; }
.reward-amount {
    font-size: 40px;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 0 22px var(--gold-glow);
    line-height: 1.1;
}
.reward-suffix { font-size: 10.5px; letter-spacing: 1.6px; color: var(--text-muted); }

.milestone-kicker {
    margin: 0;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--cyan);
}

.milestone-rewards {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 12px 0;
    font-size: 13px;
    color: var(--text-muted);
}
.milestone-rewards b { color: var(--gold); font-size: 17px; display: block; }

.reward-choice-grid { display: grid; gap: 10px; margin: 12px 0; }

.reward-choice {
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
}
.reward-choice.highlight { border-color: var(--gold); box-shadow: 0 0 18px rgba(245,196,81,0.2); }
.rc-points { font-size: 26px; font-weight: 800; color: var(--gold); }
.rc-ads    { font-size: 12px; color: var(--text-muted); }

.daily-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 14px 0;
}
.daily-cell {
    padding: 8px 4px;
    border-radius: 10px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    font-size: 11px;
}
.daily-cell b { display: block; color: var(--gold); font-size: 13px; }
.daily-cell.done  { opacity: 0.45; }
.daily-cell.today { border-color: var(--gold); box-shadow: 0 0 14px rgba(245,196,81,0.25); }
.daily-day { color: var(--text-muted); }

.achievement-badge {
    width: 64px; height: 64px;
    margin: 10px auto 4px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(245, 196, 81, 0.15);
    border: 1px solid var(--gold-dim);
    font-size: 30px;
}

/* ---------------- Колесо ---------------- */

.spin-wheel-wrap {
    position: relative;
    width: 240px; height: 240px;
    margin: 14px auto;
}

.spin-pointer {
    position: absolute;
    top: -6px; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 16px solid var(--gold);
    z-index: 2;
}

.spin-wheel {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 4px solid var(--gold-dim);
    background: conic-gradient(
        var(--card)    0deg  45deg,  var(--card-hi)  45deg  90deg,
        var(--card)   90deg 135deg,  var(--card-hi) 135deg 180deg,
        var(--card)  180deg 225deg,  var(--card-hi) 225deg 270deg,
        var(--card)  270deg 315deg,  var(--card-hi) 315deg 360deg
    );
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.16, 1);
}

.spin-prizes {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}
.spin-prizes span {
    position: absolute;
    font-size: 13px;
    font-weight: 800;
    color: var(--gold);
}

/* ---------------- Плавающие бонусы ---------------- */

.float-stack {
    position: fixed;
    right: 14px;
    bottom: 20px;
    z-index: 40;
    display: grid;
    gap: 10px;
}
html.yan-floor-space .float-stack { bottom: 120px; }

.float-bubble {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 1px solid var(--gold-dim);
    background: var(--card);
    color: var(--gold);
    font-size: 22px;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: grid;
    place-items: center;
    animation: float-bob 3s ease-in-out infinite;
}
.float-bubble.pink { border-color: #e879a6; color: #e879a6; }

@keyframes float-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) { .float-bubble { animation: none; } }

/* ---------------- Тост и анимация награды ---------------- */

.q-toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translate(-50%, 12px);
    z-index: 200;
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
.q-toast.show { opacity: 1; transform: translate(-50%, 0); }

.reward-chip {
    position: fixed;
    z-index: 210;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: 800;
    color: var(--gold);
    text-shadow: 0 0 18px var(--gold-glow);
    pointer-events: none;
}
.reward-chip.fly { transition: transform 0.75s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.75s ease; opacity: 0.15; }
.reward-chip.tier-big     { font-size: 32px; }
.reward-chip.tier-jackpot { font-size: 40px; color: #fff2c9; }

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

/* ---------------- Заглушка ролика (только вне продакшена) ---------------- */

.ad-fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    place-items: center;
    background: rgba(4, 6, 10, 0.94);
}
.ad-fullscreen-overlay.show { display: grid; }

.ad-card { text-align: center; }
.ad-fs-label { color: var(--text-muted); font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase; }
.ad-countdown { font-size: 64px; font-weight: 800; color: var(--gold); }
.ad-fs-sub { color: var(--text-muted); font-size: 12px; }
