:root {
    --ea: #a78bfa;
    --ea-dim: rgba(167,139,250,0.09);
    --ea-border: rgba(167,139,250,0.20);
}
[data-theme="light"] {
    --ea: #7c3aed;
    --ea-dim: rgba(124,58,237,0.055);
    --ea-border: rgba(124,58,237,0.16);
}

#examSplash {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 24px;
    background: #0d1117;
    transition: opacity 400ms ease, transform 400ms ease;
}
[data-theme="light"] #examSplash { background: #f0f4f8; }
#examSplash.hidden { opacity: 0; transform: scale(1.03); pointer-events: none; }

#examSplash .sp-logo {
    display: flex; align-items: center; gap: 14px;
    animation: splash-pop 0.45s cubic-bezier(.34,1.56,.64,1) both;
}
#examSplash .sp-icon {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #6d28d9, #a78bfa);
    border-radius: 13px; font-size: 26px;
    filter: drop-shadow(0 0 14px rgba(167,139,250,0.5));
}
#examSplash .sp-name { font-size: 2rem; font-weight: 800; letter-spacing: -1px; color: #fff; }
[data-theme="light"] #examSplash .sp-name { color: #0f172a; }
#examSplash .sp-name span { color: #a78bfa; }
[data-theme="light"] #examSplash .sp-name span { color: #7c3aed; }
#examSplash .sp-bar-wrap {
    width: 140px; height: 3px;
    background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden;
}
[data-theme="light"] #examSplash .sp-bar-wrap { background: rgba(0,0,0,0.08); }
#examSplash .sp-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #6d28d9, #a78bfa);
    border-radius: 99px;
    animation: splash-fill 1.4s 0.1s cubic-bezier(.2,.9,.25,1) forwards;
}

.exam-site-title {
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    text-align: center; margin: 8px 0 24px;
}
.exam-site-title__logo { display: flex; align-items: center; gap: 12px; }
.exam-site-title__bigicon {
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #6d28d9, #a78bfa);
    border-radius: 12px; font-size: 22px;
    box-shadow: 0 4px 18px rgba(167,139,250,0.30);
}
.exam-site-title__name {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 800; color: #fff; letter-spacing: -0.03em;
    display: flex; align-items: baseline; line-height: 1;
}
.exam-site-title__name span { color: #a78bfa; font-weight: 800; line-height: inherit; }
[data-theme="light"] .exam-site-title__name { color: #0f172a; }
[data-theme="light"] .exam-site-title__name span { color: #7c3aed; }
.exam-site-title__sub {
    font-size: clamp(0.8rem, 2.5vw, 0.93rem);
    color: var(--muted); font-weight: 500;
}

.quarters-label {
    font-size: 11px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 11px;
}
.quarter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.quarter-item { display: flex; flex-direction: column; gap: 6px; }
.q-label {
    font-size: 11px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}

.grade-picker { display: flex; gap: 5px; }
.grade-btn {
    flex: 1;
    padding: 14px 4px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.025);
    color: var(--muted);
    font-size: 20px; font-weight: 800;
    cursor: pointer; line-height: 1;
    min-height: 54px;
    transition: border-color 0.14s, background 0.14s, color 0.14s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative; overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}
.grade-btn:hover {
    border-color: rgba(255,255,255,0.15);
    color: #e6edf3;
    background: rgba(255,255,255,0.055);
}
.grade-btn:active { transform: scale(0.93); }

/* Каждая оценка — немного разный радиус для неидеального вида */
.grade-btn[data-val="2"] { border-radius: 9px; }
.grade-btn[data-val="3"] { border-radius: 10px; }
.grade-btn[data-val="4"] { border-radius: 11px; }
.grade-btn[data-val="5"] { border-radius: 12px; }

.grade-btn.active-2 { border-color: rgba(218,54,51,0.55);  background: rgba(218,54,51,0.12);  color: #ff7070; box-shadow: 0 2px 10px rgba(218,54,51,0.18); }
.grade-btn.active-3 { border-color: rgba(210,153,34,0.55); background: rgba(210,153,34,0.12); color: #e3b341; box-shadow: 0 2px 10px rgba(210,153,34,0.18); }
.grade-btn.active-4 { border-color: rgba(88,166,255,0.55); background: rgba(88,166,255,0.12); color: #58a6ff; box-shadow: 0 2px 10px rgba(88,166,255,0.18); }
.grade-btn.active-5 { border-color: rgba(63,185,80,0.55);  background: rgba(63,185,80,0.12);  color: #3fb950; box-shadow: 0 2px 10px rgba(63,185,80,0.18); }

[data-theme="light"] .grade-btn { background: #f8fafc; border-color: #e2e8f0; color: #94a3b8; }
[data-theme="light"] .grade-btn:hover { border-color: #cbd5e1; color: #475569; background: #f1f5f9; }
[data-theme="light"] .grade-btn.active-2 { border-color: rgba(220,38,38,0.42);  background: rgba(220,38,38,0.065); color: #dc2626; }
[data-theme="light"] .grade-btn.active-3 { border-color: rgba(217,119,6,0.42);  background: rgba(217,119,6,0.065);  color: #d97706; }
[data-theme="light"] .grade-btn.active-4 { border-color: rgba(37,99,235,0.42);  background: rgba(37,99,235,0.065);  color: #2563eb; }
[data-theme="light"] .grade-btn.active-5 { border-color: rgba(22,163,74,0.42);  background: rgba(22,163,74,0.065);  color: #16a34a; }

.exam-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 16px 0 13px;
}
.exam-divider__line { flex: 1; height: 1px; background: rgba(255,255,255,0.055); }
.exam-divider__label {
    font-size: 10px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.6px; white-space: nowrap;
}
[data-theme="light"] .exam-divider__line { background: rgba(0,0,0,0.065); }

.exam-result-grade {
    text-align: center;
    font-size: 108px; font-weight: 900;
    letter-spacing: -4px; line-height: 0.95;
    margin-bottom: 8px;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
.eg-dash { color: var(--muted); font-size: 64px; letter-spacing: 0; }
.eg-2    { color: var(--danger);  text-shadow: 0 0 28px rgba(218,54,51,0.40); }
.eg-3    { color: var(--warning); text-shadow: 0 0 28px rgba(210,153,34,0.40); }
.eg-4    { color: var(--accent);  text-shadow: 0 0 28px rgba(88,166,255,0.40); }
.eg-5    { color: #22c55e; text-shadow: 0 0 26px rgba(22,197,94,0.55), 0 0 52px rgba(22,101,52,0.30); }

.info-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 11px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.045);
    border-radius: 8px; margin-bottom: 6px;
}
.info-row__label { font-size: 12px; color: var(--muted); }
.info-row__val   { font-size: 14px; font-weight: 700; color: #e6edf3; }
[data-theme="light"] .info-row { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.055); }
[data-theme="light"] .info-row__val { color: #0f172a; }

.need-box {
    margin-top: 10px; padding: 12px;
    background: var(--ea-dim);
    border: 1px solid var(--ea-border);
    border-radius: 11px;
}
.need-box__title {
    font-size: 10px; font-weight: 700; color: var(--ea);
    text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px;
}
.need-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.need-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 10px 4px; border-radius: 9px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.035);
}
/* Небольшая вариация радиуса для каждой ячейки */
.need-item:nth-child(1) { border-radius: 10px; }
.need-item:nth-child(2) { border-radius: 8px; }
.need-item:nth-child(3) { border-radius: 10px; }

[data-theme="light"] .need-item { background: rgba(0,0,0,0.018); border-color: rgba(0,0,0,0.035); }
.need-item__for {
    font-size: 9px; color: var(--muted);
    font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
}
.need-item__grade { font-size: 28px; font-weight: 900; line-height: 1.1; }
.ng-5 { color: #22c55e; }
.ng-4 { color: #58a6ff; }
.ng-3 { color: var(--warning); }
.ng-ok { color: #3fb950; font-size: 12px; font-weight: 700; text-align: center; line-height: 1.3; }
.ng-no { color: var(--danger); font-size: 12px; font-weight: 700; text-align: center; line-height: 1.3; }

.formula-hint {
    font-size: 11px; color: var(--muted); text-align: center;
    margin-top: 8px; font-family: "Courier New", monospace;
    opacity: 0.75; min-height: 16px; line-height: 1.5;
}

/* art-teaser — ссылка на статью */
.art-teaser {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 13px; margin-top: 10px;
    background: rgba(255,255,255,0.018);
    border: 1px solid rgba(255,255,255,0.055);
    border-radius: 10px; text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.art-teaser:hover { border-color: var(--ea-border); background: var(--ea-dim); }
.art-teaser__icon {
    width: 40px; height: 40px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; background: var(--ea-dim);
    border: 1px solid var(--ea-border);
    color: var(--ea); font-size: 10px; font-weight: 800;
}
.art-teaser__title { flex: 1; font-size: 13px; font-weight: 600; color: #e6edf3; }
[data-theme="light"] .art-teaser { background: rgba(0,0,0,0.018); border-color: rgba(0,0,0,0.065); }
[data-theme="light"] .art-teaser__title { color: #0f172a; }
.art-teaser__arrow { color: var(--muted); font-size: 15px; }

@media (max-width: 900px) {
    .grid { display: flex !important; flex-direction: column; gap: 13px; }
    .exam-result-col { order: -1; }
    .exam-result-grade { font-size: 88px; letter-spacing: -3px; }
    .eg-dash { font-size: 56px; }
}

@media (max-width: 600px) {
    .exam-result-grade { font-size: 76px; letter-spacing: -2px; }
    .eg-dash { font-size: 48px; }
    .grade-btn { font-size: 18px; min-height: 52px; padding: 12px 4px; }
    .quarter-grid { gap: 9px; }
    .need-item__grade { font-size: 24px; }
    .info-row__label { font-size: 11px; }
    .formula-hint { font-size: 10px; }
}

@media (max-width: 380px) {
    .grade-btn { font-size: 16px; min-height: 48px; }
    .exam-result-grade { font-size: 64px; }
    .quarter-grid { gap: 8px; }
}

@media (max-width: 320px) {
    .grade-btn { font-size: 15px; min-height: 44px; }
    .quarter-grid { gap: 6px; }
}

/* splash анимации */
#examSplash .sp-name {
    display: flex;
    align-items: baseline;
    line-height: 1;
}
#examSplash .sp-name span {
    font-weight: 800;
    line-height: inherit;
}