:root {
    --bg: #05060f;
    --card: #0e1430;
    --card-2: #141c44;
    --text: #e8ecff;
    --muted: #8b93c7;
    --accent: #7c5cff;
    --accent-2: #00e0ff;
    --accent-3: #ff5cf0;
    --ok: #2ee6a8;
    --bad: #ff5c8a;
    --border: #2a3566;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(1200px 700px at 15% -10%, #2a1e5c 0%, transparent 60%),
        radial-gradient(1000px 600px at 110% 20%, #0b3b5c 0%, transparent 55%),
        radial-gradient(800px 500px at 50% 120%, #3a0b5c 0%, transparent 60%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 30px 15px;
    overflow-x: hidden;
    position: relative;
}

/* ====== КОСМИЧЕСКИЙ ФОН ====== */
.stars, .stars2, .stars3 {
    position: fixed;
    inset: -300px;
    pointer-events: none;
    z-index: 0;
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}
.stars {
    background-image:
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(1px 1px at 120px 80px, #cfe3ff, transparent),
        radial-gradient(1.5px 1.5px at 300px 200px, #fff, transparent),
        radial-gradient(1px 1px at 450px 120px, #b8c6ff, transparent),
        radial-gradient(2px 2px at 600px 350px, #fff, transparent),
        radial-gradient(1px 1px at 750px 90px, #cfe3ff, transparent),
        radial-gradient(1.5px 1.5px at 900px 400px, #fff, transparent),
        radial-gradient(1px 1px at 1000px 250px, #b8c6ff, transparent);
    background-repeat: repeat;
    background-size: 1100px 500px;
    animation: twinkle 4s ease-in-out infinite alternate, starMove 60s linear infinite;
    opacity: 0.9;
}
.stars2 {
    background-image:
        radial-gradient(1px 1px at 50px 150px, #fff, transparent),
        radial-gradient(1.5px 1.5px at 250px 50px, #dcd0ff, transparent),
        radial-gradient(1px 1px at 400px 300px, #fff, transparent),
        radial-gradient(2px 2px at 700px 200px, #cfe3ff, transparent),
        radial-gradient(1px 1px at 850px 450px, #fff, transparent);
    background-repeat: repeat;
    background-size: 1000px 500px;
    animation: twinkle 6s ease-in-out infinite alternate-reverse, starMoveSlow 90s linear infinite;
    opacity: 0.7;
}
.stars3 {
    background-image:
        radial-gradient(1px 1px at 100px 100px, #ff9df0, transparent),
        radial-gradient(1px 1px at 300px 250px, #9df0ff, transparent),
        radial-gradient(1px 1px at 500px 80px, #fff, transparent),
        radial-gradient(1px 1px at 800px 300px, #9df0ff, transparent);
    background-repeat: repeat;
    background-size: 900px 400px;
    animation: twinkle 8s ease-in-out infinite alternate, starMoveDeep 120s linear infinite;
    opacity: 0.6;
}
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 1; } }
@keyframes starMove {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-1000px, 200px, 0); }
}
@keyframes starMoveSlow {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(500px, 100px, 0); }
}
@keyframes starMoveDeep {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-200px, 50px, 0); }
}

/* ====== ПЛАНЕТА ====== */
.planet {
    position: fixed;
    top: 40px; right: 40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #b8a4ff 0%, #6b4bd6 35%, #2a1b6b 75%, #100833 100%);
    box-shadow:
        inset -20px -20px 40px rgba(0,0,0,0.6),
        0 0 60px rgba(124,92,255,0.6);
    z-index: 0;
    animation: float 12s ease-in-out infinite;
    will-change: transform;
    transform: translateZ(0);
}

/* ====== ЛЕТАЮЩАЯ ТАРЕЛКА ====== */
.ufo {
    position: fixed;
    top: 120px; left: 30px;
    width: 110px; height: 70px;
    z-index: 0;
    animation: float 6s ease-in-out infinite;
    will-change: transform;
    transform: translateZ(0);
}
.ufo::before {
    content: "";
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,224,255,0.6), transparent 70%);
    animation: ufoGlow 3s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: -1;
}
.ufo .dome {
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 46px; height: 30px;
    background: radial-gradient(circle at 50% 30%, #b6f6ff, #4bb8ff 60%, #1a4f8a);
    border-radius: 50% 50% 40% 40% / 80% 80% 20% 20%;
    box-shadow: 0 0 15px rgba(120,230,255,0.9);
}
.ufo .body {
    position: absolute;
    bottom: 0; left: 0;
    width: 110px; height: 34px;
    background: linear-gradient(180deg, #8f9dff, #3a2f8f 60%, #1a1440);
    border-radius: 50% / 100% 100% 0 0;
    box-shadow: 0 0 25px rgba(124,92,255,0.7), inset 0 -6px 12px rgba(0,0,0,0.5);
}
.ufo .body::before,
.ufo .body::after {
    content: "";
    position: absolute;
    bottom: -6px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #00e0ff;
    box-shadow: 0 0 12px #00e0ff, 0 0 24px #00e0ff;
}
.ufo .body::before { left: 18px; animation: blink 1.4s infinite; }
.ufo .body::after  { right: 18px; animation: blink 1.4s infinite 0.7s; }
.ufo .beam {
    position: absolute;
    bottom: -60px; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 60px solid rgba(0,224,255,0.25);
    filter: blur(2px);
    animation: beamPulse 2.4s ease-in-out infinite;
}
.alien {
    position: absolute;
    top: -6px; left: 50%;
    transform: translateX(-50%);
    width: 26px; height: 22px;
}
.alien .head {
    width: 26px; height: 20px;
    background: linear-gradient(180deg, #a8ff8a, #3fbf5c);
    border-radius: 50% 50% 45% 45%;
    position: relative;
    box-shadow: 0 0 12px rgba(120,255,140,0.8);
}
.alien .eye {
    position: absolute;
    top: 6px;
    width: 5px; height: 7px;
    background: #0a1a0a;
    border-radius: 50%;
    animation: blinkEye 3s infinite;
}
.alien .eye.l { left: 6px; }
.alien .eye.r { right: 6px; }

@keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}
@keyframes beamPulse {
    0%, 100% { opacity: 0.35; transform: translateX(-50%) scaleY(1); }
    50%      { opacity: 0.8; transform: translateX(-50%) scaleY(1.15); }
}
@keyframes blinkEye {
    0%, 92%, 100% { transform: scaleY(1); }
    95%           { transform: scaleY(0.1); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-14px); }
}
@keyframes ufoGlow {
    from { opacity: 0.4; transform: scale(0.95); }
    to   { opacity: 1;   transform: scale(1.1); }
}

/* ====== МАЛЕНЬКИЕ ПРИШЕЛЬЦЫ ====== */
.alien-mini {
    position: fixed;
    width: 34px; height: 34px;
    z-index: 0;
    opacity: 0.85;
    animation: float 9s ease-in-out infinite;
    will-change: transform;
    transform: translateZ(0);
}
.alien-mini::before {
    content: "";
    position: absolute;
    inset: -30%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(140,255,160,0.5), transparent 65%);
    animation: miniPulse 3s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: -1;
}
@keyframes miniPulse {
    from { opacity: 0.5; }
    to   { opacity: 0.9; }
}
.alien-mini.a1 { bottom: 60px; right: 80px; animation-delay: 1s; }
.alien-mini.a2 { bottom: 140px; left: 60px; animation-delay: 2.5s; }
.alien-mini.a3 { top: 300px; right: 40px; animation-delay: 0.5s; width: 26px; height: 26px; }

/* ====== ОСНОВНОЙ КОНТЕНТ ====== */
.app {
    width: 100%;
    max-width: 760px;
    position: relative;
    z-index: 2;
}
header { text-align: center; margin-bottom: 25px; }
header h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #7c5cff, #00e0ff 50%, #ff5cf0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 24px rgba(124,92,255,0.35);
}
header p {
    color: var(--muted);
    margin-top: 8px;
    font-size: 14px;
    letter-spacing: 0.4px;
}
.card {
    background: linear-gradient(180deg, rgba(20,28,68,0.95), rgba(14,20,48,0.98));
    border-radius: 20px;
    padding: 28px 30px;
    box-shadow:
        0 10px 40px rgba(0,0,0,0.55),
        0 0 0 1px var(--border) inset,
        0 0 40px rgba(124,92,255,0.15);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 20% 0%, rgba(0,224,255,0.08), transparent 40%),
                radial-gradient(circle at 100% 100%, rgba(255,92,240,0.08), transparent 40%);
    pointer-events: none;
}
.card > * { position: relative; z-index: 1; }
.card + .card { margin-top: 18px; }

h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
h2::before {
    content: "🛸";
    font-size: 22px;
    filter: drop-shadow(0 0 8px rgba(0,224,255,0.8));
}
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.option-btn {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.option-btn:hover {
    background: rgba(124,92,255,0.18);
    border-color: var(--accent-2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,224,255,0.25);
}
.option-btn .num {
    display: inline-block;
    width: 24px; height: 24px; line-height: 24px;
    text-align: center; border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #05060f; font-size: 12px; font-weight: 800;
    margin-right: 10px;
    box-shadow: 0 0 10px rgba(0,224,255,0.6);
}
.status {
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 10px;
    margin-bottom: 18px; font-size: 14px; color: var(--muted);
}
.status .lives {
    color: var(--bad);
    font-size: 16px;
    letter-spacing: 3px;
    text-shadow: 0 0 8px rgba(255,92,138,0.7);
}
.status .score {
    font-weight: 700;
    color: var(--ok);
    text-shadow: 0 0 8px rgba(46,230,168,0.6);
}
.progress {
    height: 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 22px;
    border: 1px solid var(--border);
}
.progress > div {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
    width: 0;
    transition: width 0.35s ease;
    box-shadow: 0 0 14px rgba(0,224,255,0.8);
}
.question-text {
    font-size: 18px; font-weight: 600; line-height: 1.5;
    margin-bottom: 20px; color: var(--text);
}
.answers { display: flex; flex-direction: column; gap: 10px; }
.answer-btn {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px; padding: 13px 16px;
    font-size: 15px; color: var(--text);
    cursor: pointer; text-align: left;
    transition: all 0.15s ease; width: 100%;
}
.answer-btn:hover:not(:disabled) {
    background: rgba(124,92,255,0.14);
    border-color: var(--accent);
    transform: translateX(3px);
}
.answer-btn .letter {
    flex: 0 0 28px; height: 28px; line-height: 28px;
    text-align: center; border-radius: 8px;
    background: rgba(124,92,255,0.2);
    color: var(--accent-2);
    font-size: 13px; font-weight: 800;
    box-shadow: 0 0 8px rgba(0,224,255,0.3) inset;
}
.answer-btn.correct {
    background: rgba(46,230,168,0.12);
    border-color: var(--ok);
    box-shadow: 0 0 0 1px var(--ok) inset, 0 0 18px rgba(46,230,168,0.35);
    animation: pop 0.35s ease;
}
.answer-btn.correct .letter { background: var(--ok); color: #06251b; }
.answer-btn.wrong {
    background: rgba(255,92,138,0.12);
    border-color: var(--bad);
    box-shadow: 0 0 0 1px var(--bad) inset, 0 0 18px rgba(255,92,138,0.35);
    animation: shake 0.4s ease;
}
.answer-btn.wrong .letter { background: var(--bad); color: #2a0a14; }
.answer-btn:disabled { cursor: default; }

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.input-row { display: flex; gap: 10px; margin-top: 6px; }
.input-row input {
    flex: 1; padding: 12px 14px; font-size: 15px;
    border: 1px solid var(--border); border-radius: 12px;
    background: rgba(255,255,255,0.04);
    color: var(--text); outline: none;
    transition: all 0.2s ease;
}
.input-row input:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(0,224,255,0.25), 0 0 20px rgba(0,224,255,0.2);
}
.btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #05060f; border: none;
    border-radius: 12px; padding: 12px 22px;
    font-size: 15px; font-weight: 800; cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    letter-spacing: 0.3px;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0,224,255,0.45);
}
.btn.secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn.secondary:hover {
    background: rgba(255,255,255,0.12);
    box-shadow: 0 0 20px rgba(124,92,255,0.35);
}
.feedback {
    margin-top: 20px; padding: 14px 18px;
    border-radius: 12px; font-size: 15px; display: none;
    position: relative;
}
.feedback.ok {
    display: block;
    background: rgba(46,230,168,0.12);
    color: var(--ok);
    border: 1px solid rgba(46,230,168,0.5);
    box-shadow: 0 0 20px rgba(46,230,168,0.25);
    animation: pop 0.35s ease;
}
.feedback.bad {
    display: block;
    background: rgba(255,92,138,0.12);
    color: var(--bad);
    border: 1px solid rgba(255,92,138,0.5);
    box-shadow: 0 0 20px rgba(255,92,138,0.25);
    animation: shake 0.4s ease;
}
.feedback .correct-answer {
    display: block; margin-top: 6px;
    font-weight: 700; color: var(--text);
}
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px; margin: 20px 0;
}
.result-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 14px; padding: 16px; text-align: center;
    position: relative;
    overflow: hidden;
}
.result-item::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 12px rgba(0,224,255,0.7);
}
.result-item .value {
    font-size: 26px; font-weight: 800; color: var(--text);
    text-shadow: 0 0 12px rgba(0,224,255,0.5);
}
.result-item .label {
    font-size: 13px; color: var(--muted); margin-top: 4px;
}
.grade-badge {
    text-align: center; padding: 18px;
    border-radius: 14px; font-size: 20px;
    font-weight: 800; margin: 20px 0;
    letter-spacing: 0.4px;
    position: relative;
}
.grade-5 {
    background: rgba(46,230,168,0.12);
    color: var(--ok);
    border: 1px solid rgba(46,230,168,0.5);
    box-shadow: 0 0 30px rgba(46,230,168,0.35);
}
.grade-4 {
    background: rgba(0,224,255,0.12);
    color: var(--accent-2);
    border: 1px solid rgba(0,224,255,0.5);
    box-shadow: 0 0 30px rgba(0,224,255,0.35);
}
.grade-3 {
    background: rgba(255,200,90,0.12);
    color: #ffc85a;
    border: 1px solid rgba(255,200,90,0.5);
    box-shadow: 0 0 30px rgba(255,200,90,0.35);
}
.grade-2 {
    background: rgba(255,92,138,0.12);
    color: var(--bad);
    border: 1px solid rgba(255,92,138,0.5);
    box-shadow: 0 0 30px rgba(255,92,138,0.35);
}
.actions {
    display: flex; gap: 12px; justify-content: center;
    flex-wrap: wrap; margin-top: 20px;
}
.hidden { display: none !important; }/* ============================================================
   ЭФФЕКТЫ ВОКРУГ КАРТОЧКИ ТЕСТА
   ============================================================ */
#screen-quiz {
    position: relative;
    overflow: visible;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* --- Контейнер частиц --- */
.quiz-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

/* --- Одна частица --- */
.quiz-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
    will-change: transform, opacity;
    animation: particleFly 0.9s ease-out forwards;
}

@keyframes particleFly {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.3);
        opacity: 0;
    }
}

/* --- Подсветка карточки при правильном/неправильном --- */
#screen-quiz.quiz-correct {
    box-shadow:
        0 0 0 2px var(--ok) inset,
        0 0 40px rgba(46,230,168,0.55),
        0 10px 40px rgba(0,0,0,0.55);
    animation: cardPulseOk 0.5s ease;
}
#screen-quiz.quiz-wrong {
    box-shadow:
        0 0 0 2px var(--bad) inset,
        0 0 40px rgba(255,92,138,0.55),
        0 10px 40px rgba(0,0,0,0.55);
    animation: cardShake 0.4s ease;
}

@keyframes cardPulseOk {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.012); }
    100% { transform: scale(1); }
}
@keyframes cardShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}
/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 520px) {
    .card { padding: 20px 18px; }
    .question-text { font-size: 16px; }
    header h1 { font-size: 21px; }
    .planet { width: 90px; height: 90px; top: 15px; right: 15px; }
    .ufo { width: 80px; height: 55px; top: 70px; left: 10px; }
    .ufo .dome { width: 34px; height: 22px; }
    .ufo .body { width: 80px; height: 26px; }
    .alien-mini { display: none; }
}

/* ============================================================
   ПЕРЕКЛЮЧАТЕЛЬ ФОНА
   ============================================================ */
.theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(20,28,68,0.95), rgba(14,20,48,0.95));
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.45), 0 0 20px rgba(124,92,255,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.theme-toggle:hover {
    transform: scale(1.08) rotate(8deg);
    box-shadow: 0 8px 26px rgba(0,0,0,0.5), 0 0 28px rgba(0,224,255,0.6);
}
.theme-panel {
    position: fixed;
    top: 76px;
    right: 18px;
    width: 260px;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(20,28,68,0.98), rgba(14,20,48,0.99));
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px rgba(124,92,255,0.25);
    z-index: 49;
    animation: panelIn 0.2s ease;
}
@keyframes panelIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.theme-panel__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    text-align: center;
}
.theme-panel__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.theme-swatch {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}
.theme-swatch:hover {
    border-color: var(--accent-2);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,224,255,0.3);
}
.theme-swatch.active {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 2px rgba(0,224,255,0.45), 0 0 20px rgba(0,224,255,0.5);
}
.theme-swatch__preview {
    display: block;
    width: 100%;
    height: 40px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
}
.theme-swatch__name {
    font-size: 11px;
    color: var(--text);
    font-weight: 600;
}
body.theme-space {
    background:
        radial-gradient(1200px 700px at 15% -10%, #2a1e5c 0%, transparent 60%),
        radial-gradient(1000px 600px at 110% 20%, #0b3b5c 0%, transparent 55%),
        radial-gradient(800px 500px at 50% 120%, #3a0b5c 0%, transparent 60%),
        var(--bg) !important;
}
body.theme-dark {
    background: #08080f !important;
}
body.theme-light {
    background: #eef1f8 !important;
    color: #1a1f36;
}
body.theme-light .card {
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(245,247,252,0.98));
    border-color: #c8d2e0;
    box-shadow: 0 10px 40px rgba(20,30,60,0.15), 0 0 0 1px rgba(200,210,230,0.6) inset;
}
body.theme-light .answer-btn,
body.theme-light .option-btn {
    background: rgba(255,255,255,0.7);
    color: #1a1f36;
    border-color: #c8d2e0;
}
body.theme-light .answer-btn:hover:not(:disabled),
body.theme-light .option-btn:hover {
    background: rgba(124,92,255,0.1);
}
body.theme-light .question-text,
body.theme-light h1,
body.theme-light h2,
body.theme-light .status,
body.theme-light .result-item .value,
body.theme-light .result-item .label,
body.theme-light .feedback {
    color: #1a1f36;
}
body.theme-light header h1 {
    background: linear-gradient(90deg, #5a3fd6, #0091b8 50%, #d63fb2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
body.theme-light .theme-panel {
    background: rgba(255,255,255,0.98);
    border-color: #c8d2e0;
}
body.theme-light .theme-panel__title { color: #4a5570; }
body.theme-light .theme-swatch__name { color: #1a1f36; }
body.theme-light .theme-toggle {
    background: rgba(255,255,255,0.95);
    color: #1a1f36;
    border-color: #c8d2e0;
}

@media (max-width: 520px) {
    .theme-panel { right: 10px; left: 10px; width: auto; }
    .theme-toggle { top: 10px; right: 10px; width: 42px; height: 42px; font-size: 18px; }
}

/* ============================================================
   ФОНЫ-КАРТИНКИ
   ============================================================ */
body.theme-bg1 {
    background:
        linear-gradient(rgba(5,6,15,0.55), rgba(5,6,15,0.75)),
        url('../bg1.jpg') center / cover no-repeat fixed,
        var(--bg) !important;
}
body.theme-bg2 {
    background:
        linear-gradient(rgba(5,6,15,0.55), rgba(5,6,15,0.75)),
        url('../bg2.jpg') center / cover no-repeat fixed,
        var(--bg) !important;
}
body.theme-bg3 {
    background:
        linear-gradient(rgba(5,6,15,0.45), rgba(5,6,15,0.65)),
        url('../bg3.jpg') center / cover no-repeat fixed,
        var(--bg) !important;
}
body.theme-bg4 {
    background:
        linear-gradient(rgba(5,6,15,0.45), rgba(5,6,15,0.7)),
        url('../bg4.jpg') center / cover no-repeat fixed,
        var(--bg) !important;
}
body.theme-bg5 {
    background:
        linear-gradient(rgba(5,6,15,0.5), rgba(5,6,15,0.7)),
        url('../bg5.jpg') center / cover no-repeat fixed,
        var(--bg) !important;
}
body.theme-bg6 {
    background:
        linear-gradient(rgba(5,6,15,0.5), rgba(5,6,15,0.7)),
        url('../bg6.jpg') center / cover no-repeat fixed,
        var(--bg) !important;
}
body.theme-bg7 {
    background:
        linear-gradient(rgba(5,6,15,0.45), rgba(5,6,15,0.65)),
        url('../bg7.jpg') center / cover no-repeat fixed,
        var(--bg) !important;
}
body.theme-bg8 {
    background:
        linear-gradient(rgba(5,6,15,0.5), rgba(5,6,15,0.7)),
        url('../bg8.jpg') center / cover no-repeat fixed,
        var(--bg) !important;
}

/* ============================================================
   КНОПКИ ВВЕРХУ
   ============================================================ */
.top-buttons {
    position: fixed;
    top: 18px;
    right: 18px;
    display: flex;
    gap: 10px;
    z-index: 50;
    align-items: center;
}
.top-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(20,28,68,0.95), rgba(14,20,48,0.95));
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.45), 0 0 20px rgba(124,92,255,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.top-btn:hover {
    transform: scale(1.08) rotate(8deg);
    box-shadow: 0 8px 26px rgba(0,0,0,0.5), 0 0 28px rgba(0,224,255,0.6);
}
.theme-toggle {
    position: static !important;
    top: auto !important;
    right: auto !important;
}

/* ============================================================
   МОДАЛКА АККАУНТОВ
   ============================================================ */
.account-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 15, 0.75);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: panelIn 0.2s ease;
}
.account-modal__box {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, rgba(20,28,68,0.98), rgba(14,20,48,0.99));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 40px rgba(124,92,255,0.3);
    position: relative;
}
.account-modal__close {
    position: absolute;
    top: 12px; right: 14px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}
.account-modal__close:hover {
    color: var(--text);
    background: rgba(255,255,255,0.08);
}
.account-modal__title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 16px;
    text-align: center;
    background: linear-gradient(90deg, #7c5cff, #00e0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.account-modal__list {
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.account-modal__empty {
    color: var(--muted);
    text-align: center;
    padding: 12px;
    font-size: 14px;
}
.account-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    width: 100%;
}
.account-item:hover {
    background: rgba(124,92,255,0.14);
    border-color: var(--accent);
}
.account-item.active {
    background: rgba(46,230,168,0.1);
    border-color: var(--ok);
}
.account-item__avatar { font-size: 18px; }
.account-item__name { flex: 1; font-weight: 600; }
.account-item__check { color: var(--ok); font-weight: 800; }
.account-item__del {
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
}
.account-item__del:hover { background: rgba(255,92,138,0.2); }
.account-modal__create {
    display: flex;
    gap: 8px;
}
.account-modal__create-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    outline: none;
    font-size: 14px;
}
.account-modal__create-input:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(0,224,255,0.25);
}
.account-modal__create-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #05060f;
    font-weight: 800;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
}
.account-modal__create-btn:hover { filter: brightness(1.1); }

/* ============================================================
   ПАНЕЛЬ ИСТОРИИ
   ============================================================ */
.history-panel {
    position: fixed;
    top: 76px;
    right: 18px;
    width: 460px;
    max-height: 80vh;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(20,28,68,0.98), rgba(14,20,48,0.99));
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px rgba(124,92,255,0.25);
    z-index: 49;
    animation: panelIn 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.history-panel__head {
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 12px;
}
.history-panel__title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 6px;
}
.history-panel__user {
    font-size: 13px;
    color: var(--accent-2);
    margin-bottom: 10px;
}
.history-panel__actions {
    display: flex;
    gap: 8px;
}
.btn.secondary.small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}
.history-panel__summary {
    font-size: 13px;
    color: var(--muted);
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-bottom: 12px;
}
.history-panel__summary b { color: var(--text); }
.history-panel__list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}
.history-empty {
    color: var(--muted);
    text-align: center;
    padding: 24px 12px;
    font-size: 14px;
}
.history-group {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
    margin-bottom: 4px;
    padding-left: 4px;
}
.history-item {
    background: rgba(255,255,255,0.03);
    border-left: 4px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    transition: background 0.15s ease;
}
.history-item:hover { background: rgba(255,255,255,0.06); }
.history-item.grade-5 { border-left-color: var(--ok); }
.history-item.grade-4 { border-left-color: var(--accent-2); }
.history-item.grade-3 { border-left-color: #ffc85a; }
.history-item.grade-2 { border-left-color: var(--bad); }
.history-item__topic {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}
.history-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
}
.history-item__grade { color: var(--text); font-weight: 700; }
.history-item__acc { color: var(--accent-2); }
.history-item__score { color: var(--ok); }
.history-item__date { margin-left: auto; }

@media (max-width: 720px) {
    .history-panel {
        right: 10px; left: 10px; width: auto;
        max-height: 70vh;
    }
}
@media (max-width: 520px) {
    .top-buttons { top: 10px; right: 10px; gap: 6px; }
    .top-btn { width: 42px; height: 42px; font-size: 18px; }
}

/* ============================================================
   КОШЕЛЁК В ШАПКЕ
   ============================================================ */
.wallet {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 6px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,200,90,0.15), rgba(240,138,42,0.15));
    border: 1px solid rgba(255,200,90,0.5);
    box-shadow: 0 0 16px rgba(255,200,90,0.25);
    font-size: 16px;
    font-weight: 800;
    color: #ffc85a;
    letter-spacing: 0.5px;
}
.wallet__icon {
    font-size: 18px;
    filter: drop-shadow(0 0 6px rgba(255,200,90,0.9));
}
.wallet__amount {
    color: #ffe9a8;
    text-shadow: 0 0 10px rgba(255,200,90,0.8);
}

/* ============================================================
   ВСПЛЫВАШКА «+N ЗОЛОТА»
   ============================================================ */
.gold-toast {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translate(-50%, -20px);
    padding: 12px 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,200,90,0.95), rgba(240,138,42,0.95));
    color: #2a1a00;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 40px rgba(255,200,90,0.6), 0 0 40px rgba(255,200,90,0.4);
    opacity: 0;
    pointer-events: none;
    z-index: 200;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.gold-toast--show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ============================================================
   БЕЙДЖ «МАКС: N» ПОД ТЕМОЙ
   ============================================================ */
.option-btn {
    position: relative;
    padding-right: 80px;
}
.best-grade {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 0.3px;
    pointer-events: none;
}
.best-grade.grade-5 {
    background: rgba(46,230,168,0.15);
    color: var(--ok);
    border: 1px solid rgba(46,230,168,0.5);
    box-shadow: 0 0 10px rgba(46,230,168,0.4);
}
.best-grade.grade-4 {
    background: rgba(0,224,255,0.15);
    color: var(--accent-2);
    border: 1px solid rgba(0,224,255,0.5);
    box-shadow: 0 0 10px rgba(0,224,255,0.4);
}
.best-grade.grade-3 {
    background: rgba(255,200,90,0.15);
    color: #ffc85a;
    border: 1px solid rgba(255,200,90,0.5);
    box-shadow: 0 0 10px rgba(255,200,90,0.4);
}
.best-grade.grade-2 {
    background: rgba(255,92,138,0.15);
    color: var(--bad);
    border: 1px solid rgba(255,92,138,0.5);
    box-shadow: 0 0 10px rgba(255,92,138,0.4);
}

/* ============================================================
   ОБЩАЯ ОПТИМИЗАЦИЯ АНИМАЦИЙ
   ============================================================ */
.ufo,
.planet,
.alien-mini,
.stars,
.stars2,
.stars3 {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}
/* ============================================================
   МОДАЛКА АККАУНТОВ (вход/регистрация/восстановление)
   ============================================================ */
.account-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 15, 0.75);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: panelIn 0.2s ease;
    overflow-y: auto;
}
.account-modal__box {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(180deg, rgba(20,28,68,0.98), rgba(14,20,48,0.99));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 40px rgba(124,92,255,0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.account-modal__close {
    position: absolute;
    top: 12px; right: 14px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
}
.account-modal__close:hover {
    color: var(--text);
    background: rgba(255,255,255,0.08);
}
.account-modal__title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 16px;
    text-align: center;
    background: linear-gradient(90deg, #7c5cff, #00e0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Вкладки */
.account-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    background: rgba(255,255,255,0.04);
    padding: 4px;
    border-radius: 12px;
}
.account-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 9px;
    transition: all 0.2s ease;
}
.account-tab:hover { color: var(--text); }
.account-tab.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #05060f;
    box-shadow: 0 4px 14px rgba(124,92,255,0.4);
}

/* Форма */
.account-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.account-label {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
    margin-bottom: 2px;
}
.account-hint {
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
    margin-bottom: 4px;
    opacity: 0.85;
}
.account-input {
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%;
}
.account-input:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(0,224,255,0.25);
}
select.account-input {
    cursor: pointer;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 36px;
}
select.account-input option {
    background: #141c44;
    color: #e8ecff;
}

/* Поле пароля с глазиком */
.account-pass-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.account-pass-wrap .account-input {
    padding-right: 44px;
}
.account-eye {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: all 0.15s ease;
    line-height: 1;
}
.account-eye:hover {
    color: var(--text);
    background: rgba(255,255,255,0.08);
}
.account-eye.active {
    color: var(--accent-2);
}

/* Ошибки и подсказки */
.account-error {
    color: var(--bad);
    font-size: 13px;
    min-height: 16px;
    text-align: center;
    margin-top: 4px;
}
.account-question-text {
    padding: 12px 14px;
    background: rgba(124,92,255,0.1);
    border: 1px solid rgba(124,92,255,0.35);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

/* Кнопки */
.account-submit {
    padding: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #05060f;
    font-weight: 800;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
    margin-top: 8px;
}
.account-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0,224,255,0.45);
}
.account-link {
    background: transparent;
    border: none;
    color: var(--accent-2);
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
    text-align: center;
    transition: color 0.15s ease;
}
.account-link:hover {
    color: var(--text);
    text-decoration: underline;
}

/* Блок "Выйти" */
.account-logout {
    margin-top: 8px;
    text-align: center;
}
.account-user-info {
    padding: 12px;
    background: rgba(46,230,168,0.08);
    border: 1px solid rgba(46,230,168,0.4);
    border-radius: 10px;
    margin-bottom: 12px;
}
.account-user-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.account-user-phone {
    font-size: 13px;
    color: var(--accent-2);
}
.account-logout .btn {
    width: 100%;
}
/* ============================================================
   БЛОК «Я ВОШЁЛ» — новые кнопки
   ============================================================ */
.account-logged-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}
.account-logged-actions .btn {
    width: 100%;
    text-align: center;
}
.btn.danger {
    background: rgba(255,92,138,0.12);
    color: var(--bad);
    border: 1px solid rgba(255,92,138,0.5);
}
.btn.danger:hover {
    background: rgba(255,92,138,0.22);
    box-shadow: 0 0 20px rgba(255,92,138,0.45);
}
.account-submit.danger {
    background: linear-gradient(135deg, #ff5c8a, #d63a6b);
    color: #fff;
}
.account-submit.danger:hover {
    box-shadow: 0 8px 22px rgba(255,92,138,0.5);
}
/* ============================================================
   МОДАЛКА «С ВОЗВРАЩЕНИЕМ»
   ============================================================ */
.welcome-modal {
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 15, 0.75);
    backdrop-filter: blur(6px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.3s ease;
}
.welcome-modal--show { opacity: 1; }

.welcome-modal__box {
    background: linear-gradient(180deg, rgba(20,28,68,0.98), rgba(14,20,48,0.99));
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 40px rgba(124,92,255,0.4);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-width: 420px;
    width: 100%;
}
.welcome-modal--show .welcome-modal__box {
    transform: scale(1);
}

.welcome-modal__icon {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 12px rgba(124,92,255,0.7));
}

.welcome-modal__title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #7c5cff, #00e0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.welcome-modal__title b {
    color: #00e0ff;
    -webkit-text-fill-color: #00e0ff;
}

.welcome-modal__hint {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
    font-style: italic;
    opacity: 0.85;
}
/* ============================================================
   ВСПЛЫВАШКА «ЕЖЕДНЕВНЫЙ БОНУС»
   ============================================================ */
.bonus-toast {
    position: fixed;
    top: 150px;
    left: 50%;
    transform: translate(-50%, -20px);
    padding: 14px 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,200,90,0.95), rgba(240,138,42,0.95));
    color: #2a1a00;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0.3px;
    box-shadow: 0 10px 40px rgba(255,200,90,0.6), 0 0 40px rgba(255,200,90,0.4);
    opacity: 0;
    pointer-events: none;
    z-index: 250;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.bonus-toast--show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Строка бонуса в модалке аккаунта */
.account-user-bonus {
    font-size: 13px;
    color: #ffc85a;
    margin-top: 6px;
    font-weight: 600;
}/* ============================================================
   ЗАГОЛОВОК ЭКРАНА ТЕМ (кнопка сверху)
   ============================================================ */
.topic-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.topic-header h2 {
    margin-bottom: 0;
}
.topic-header .btn.small {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 10px;
    flex-shrink: 0;
}/* ============================================================
   КРУПНЫЕ КНОПКИ ПРЕДМЕТОВ
   ============================================================ */
#subject-list .option-btn {
    padding: 24px 26px;
    font-size: 20px;
    font-weight: 700;
    text-align: left;
    letter-spacing: 0.3px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
}
#subject-list .option-btn .subject-icon {
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(0,224,255,0.45));
    flex-shrink: 0;
}
#subject-list .option-btn .subject-name {
    line-height: 1.2;
}
#subject-list .option-btn .num {
    display: none;
}
/* ============================================================
   ПРЕДМЕТЫ — ПО ЛЕВОМУ КРАЮ (принудительно)
   ============================================================ */
#subject-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 14px !important;
}
#subject-list .option-btn {
    position: relative;
    padding: 24px 26px 24px 70px;   /* отступ слева под иконку */
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.3px;
    border-radius: 16px;
    display: block;
}
#subject-list .option-btn .subject-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(0,224,255,0.45));
}
#subject-list .option-btn .subject-name {
    display: block;
    text-align: center;
}
/* ============================================================
   ПРЕДМЕТЫ — ПРИНУДИТЕЛЬНО ПО ЛЕВОМУ КРАЮ
   ============================================================ */
#subject-list .option-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
    gap: 14px !important;
}
/* ============================================================
   ЗАБЛОКИРОВАННЫЕ ТЕМЫ (для Free-тарифа)
   ============================================================ */
.option-btn.locked {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.option-btn.locked:hover {
    transform: none;
    box-shadow: none;
    background: rgba(255,255,255,0.03);
    border-color: var(--border);
    cursor: not-allowed;
}

.topic-lock {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    filter: drop-shadow(0 0 6px rgba(255,92,138,0.8));
    pointer-events: none;
}
/* ============================================================
   ПАНЕЛЬ ТАРИФОВ (по образцу панели тем)
   ============================================================ */
.tariff-panel {
    position: fixed;
    top: 76px;
    right: 18px;
    width: 380px;
    max-height: 80vh;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(20,28,68,0.98), rgba(14,20,48,0.99));
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 30px rgba(124,92,255,0.25);
    z-index: 49;
    animation: panelIn 0.2s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.tariff-panel__title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.tariff-panel__subtitle {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.tariff-panel__current {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(124,92,255,0.12);
    border: 1px solid rgba(124,92,255,0.4);
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.tariff-panel__grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.tariff-panel__card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    transition: all 0.2s ease;
}
.tariff-panel__card.active {
    border-color: var(--ok);
    background: rgba(46,230,168,0.08);
    box-shadow: 0 0 0 2px rgba(46,230,168,0.3);
}
.tariff-panel__card-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tariff-panel__card-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-2);
    margin: 4px 0;
}
.tariff-panel__card-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}
.tariff-panel__badge {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(46,230,168,0.15);
    color: var(--ok);
    border: 1px solid rgba(46,230,168,0.5);
}
.tariff-panel__activate {
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tariff-panel__activate .account-input {
    font-family: 'Courier New', monospace;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-align: center;
    padding: 12px 14px;
}
.tariff-panel__activate .btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
}

/* На мобильных — панель на всю ширину */
@media (max-width: 520px) {
    .tariff-panel {
        right: 10px;
        left: 10px;
        width: auto;
        max-height: 75vh;
    }
}
/* ============================================================
   ГАРАНТИРОВАННОЕ СКРЫТИЕ МОДАЛОК
   ============================================================ */
.account-modal.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.account-modal.hidden * {
    display: none !important;
    visibility: hidden !important;
}
/* ============================================================
   УВЕЛИЧЕННЫЕ КНОПКИ КЛАССОВ
   ============================================================ */
#class-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

#class-list .option-btn {
    padding: 25px 30px;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(124,92,255,0.15), rgba(0,224,255,0.15));
    border: 2px solid var(--accent);
    box-shadow: 0 0 20px rgba(124,92,255,0.3);
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

#class-list .option-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0,224,255,0.5);
    background: linear-gradient(135deg, rgba(124,92,255,0.3), rgba(0,224,255,0.3));
    border-color: var(--accent-2);
}

#class-list .option-btn .subject-icon {
    font-size: 36px;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.5));
}
/* ============================================================
   АККОРДЕОН ТЕМ (ВЫПАДАЮЩИЙ СПИСОК)
   ============================================================ */
.topics-accordion {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
}

.accordion-toggle {
    width: 100%;
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #05060f;
    font-size: 18px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.accordion-toggle:hover {
    filter: brightness(1.1);
}

.accordion-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.topic-item {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topic-item:hover:not(.locked) {
    background: rgba(124, 92, 255, 0.15);
    border-color: var(--accent);
}

.topic-item.selected {
    background: rgba(46, 230, 168, 0.15);
    border-color: var(--ok);
    box-shadow: 0 0 10px rgba(46, 230, 168, 0.3);
}