/* =============================================
   CSS-ПЕРЕМЕННЫЕ И БАЗА
============================================= */
:root {
    --bg: #0B0E17;
    --surface: #12162A;
    --accent: #C8FF00;
    --danger: #FF4D6A;
    --warn: #FFB800;
    --muted: #6B7394;
    --text: #E8E8EC;
    --text-dim: #9CA3BF;
    --border: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(18, 22, 42, 0.88);
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
}

/* =============================================
   ФОНОВЫЙ CANVAS И БЛОБЫ
============================================= */
#bgCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(130px);
    pointer-events: none;
    z-index: 1;
}

/* =============================================
   ЭКРАНЫ (СЕКЦИИ)
============================================= */
.screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(24px);
    padding: 20px;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

/* =============================================
   КАРТОЧКА
============================================= */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px;
    max-width: 620px;
    width: 100%;
    position: relative;
}

/* =============================================
   СТАРТОВЫЙ ЭКРАН
============================================= */
.start-desc {
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1.65;
    margin-bottom: 10px;
}

.start-meta {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 34px;
}

.start-meta i {
    margin-right: 3px;
}

.start-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 42px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 14px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(200, 255, 0, 0.25);
}

.start-btn:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

/* =============================================
   ПРОГРЕСС-БАР
============================================= */
.progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 32px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   ТАЙМЕР
============================================= */
.timer-wrap {
    position: absolute;
    top: 18px; right: 20px;
    width: 52px; height: 52px;
}

.timer-svg {
    width: 52px; height: 52px;
    transform: rotate(-90deg);
}

.timer-svg circle {
    fill: none;
    stroke-width: 3;
}

.timer-track-c {
    stroke: rgba(255, 255, 255, 0.07);
}

.timer-fill-c {
    stroke: var(--accent);
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
}

.timer-num {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    transition: color 0.5s ease;
}

/* =============================================
   ВОПРОС
============================================= */
.q-num {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 8px;
}

.q-text {
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}

.q-detail {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 22px;
    letter-spacing: 3px;
}

.visual-box {
    display: flex;
    justify-content: center;
    margin: 20px 0 24px;
}

.visual-box svg {
    max-width: 100%;
    height: auto;
}

/* =============================================
   ВАРИАНТЫ ОТВЕТОВ
============================================= */
.opts-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 15px 18px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
}

.option-btn:hover:not(.locked) {
    background: rgba(200, 255, 0, 0.06);
    border-color: rgba(200, 255, 0, 0.22);
    transform: translateX(4px);
}

.option-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.option-btn .letter {
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

/* Состояния после ответа */
.option-btn.correct {
    background: rgba(200, 255, 0, 0.1) !important;
    border-color: rgba(200, 255, 0, 0.4) !important;
    transform: none !important;
}

.option-btn.correct .letter {
    background: var(--accent);
    color: var(--bg);
}

.option-btn.wrong {
    background: rgba(255, 77, 106, 0.1) !important;
    border-color: rgba(255, 77, 106, 0.4) !important;
    transform: none !important;
}

.option-btn.wrong .letter {
    background: var(--danger);
    color: white;
}

.option-btn.dimmed {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
    transform: none !important;
}

/* =============================================
   КНОПКА "ДАЛЕЕ"
============================================= */
.next-btn {
    display: none;
    width: 100%;
    padding: 15px;
    margin-top: 22px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 14px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.next-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(200, 255, 0, 0.2);
}

.next-btn:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

.next-btn.show {
    display: block;
}

/* =============================================
   ПОДСКАЗКА КЛАВИАТУРЫ
============================================= */
.key-hint {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin-top: 14px;
    opacity: 0.7;
}

.key-hint i {
    margin-right: 3px;
}

/* =============================================
   ЭКРАН РЕЗУЛЬТАТА
============================================= */
.result-label {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 6px;
    font-family: var(--font-display);
}

.iq-num {
    font-family: var(--font-display);
    font-size: 88px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    text-align: center;
}

.iq-lvl {
    text-align: center;
    font-size: 19px;
    color: var(--text-dim);
    margin-top: 6px;
}

#bellCurve {
    display: block;
    margin: 20px auto 0;
    max-width: 100%;
}

.iq-stats {
    display: flex;
    justify-content: center;
    gap: 36px;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.iq-stat-val {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 600;
    text-align: center;
}

.iq-stat-lbl {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
    text-align: center;
}

.restart-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 34px;
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(200, 255, 0, 0.3);
    border-radius: 14px;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 26px;
}

.restart-btn:hover {
    background: rgba(200, 255, 0, 0.08);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.restart-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* =============================================
   АНИМАЦИИ
============================================= */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.anim-up {
    animation: fadeUp 0.4s ease forwards;
    opacity: 0;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(200, 255, 0, 0); }
    50%      { box-shadow: 0 0 30px 4px rgba(200, 255, 0, 0.12); }
}

.card-glow {
    animation: pulseGlow 4s ease-in-out infinite;
}

/* =============================================
   СНИЖЕННАЯ АНИМАЦИЯ
============================================= */
@media (prefers-reduced-motion: reduce) {
    .screen {
        transition: opacity 0.15s ease;
        transform: none !important;
    }

    .option-btn,
    .progress-fill,
    .next-btn,
    .start-btn,
    .restart-btn,
    .timer-fill-c {
        transition: none !important;
    }

    .anim-up {
        animation: none !important;
        opacity: 1 !important;
    }

    .card-glow {
        animation: none !important;
    }
}

/* =============================================
   АДАПТИВНОСТЬ
============================================= */
@media (max-width: 640px) {
    .card {
        padding: 28px 20px;
        border-radius: 18px;
    }
}

@media (max-width: 480px) {
    .iq-num {
        font-size: 64px;
    }

    .iq-stats {
        gap: 20px;
    }

    .iq-stat-val {
        font-size: 22px;
    }

    .q-text {
        font-size: 18px;
    }

    .q-detail {
        font-size: 22px;
    }
}