:root {
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --accent: #0284c7;
    --accent-light: #e0f2fe;
    --correct: #16a34a;
    --correct-light: #dcfce7;
    --wrong: #dc2626;
    --wrong-light: #fee2e2;
    --in-progress: #f59e0b;
    --in-progress-light: #fef3c7;
    --stats: #7c3aed;
    --stats-light: #ede9fe;
    --key: #e2e8f0;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
    --shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    gap: 8px;
}

/* ============ ЭКРАН ПРИВЕТСТВИЯ ============ */
.welcome-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #e0f2fe 0%, #f1f5f9 50%, #dcfce7 100%);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.4s ease;
}
.welcome-screen.hidden { display: none; }

.welcome-card {
    background: var(--card);
    border-radius: 28px;
    padding: 32px 36px 28px;
    max-width: 980px;
    width: 100%;
    box-shadow: 0 25px 70px rgba(2, 132, 199, 0.18);
    border: 1px solid rgba(2, 132, 199, 0.08);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: auto;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 0;
    align-items: stretch;
}

.welcome-main {
    min-width: 0;
    padding-right: 32px;
    border-right: 2px dashed var(--key);
}

.welcome-side {
    padding-left: 32px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.welcome-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.welcome-logo img { width: 100%; height: 100%; object-fit: contain; }

.welcome-title {
    font-size: 28px; font-weight: 800; color: var(--accent);
    text-align: center; margin-bottom: 6px; letter-spacing: 0.5px;
}
.welcome-subtitle {
    font-size: 14px; color: var(--muted); text-align: center;
    margin-bottom: 20px; font-weight: 600;
}

.welcome-info {
    background: var(--accent-light); border-radius: 14px;
    padding: 14px 18px; margin-bottom: 20px;
    font-size: 13.5px; line-height: 1.55; color: #075985;
}
.welcome-info b { color: var(--accent); }
.welcome-info .info-row {
    display: flex; gap: 10px; align-items: flex-start; margin-bottom: 6px;
}
.welcome-info .info-row:last-child { margin-bottom: 0; }
.welcome-info .info-icon { font-size: 17px; flex-shrink: 0; line-height: 1.4; }

.form-row { display: flex; gap: 12px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.form-group.narrow { flex: 0 0 130px; }

.form-label {
    font-size: 12px; font-weight: 800; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.8px; padding-left: 4px;
}
.form-input {
    font-family: inherit; font-size: 17px; font-weight: 700;
    padding: 13px 15px; border-radius: 13px;
    border: 3px solid var(--key); background: var(--bg);
    color: var(--text); outline: none; transition: all 0.2s; width: 100%;
}
.form-input:focus {
    border-color: var(--accent); background: #fff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.12);
}
.form-input::placeholder { color: #94a3b8; font-weight: 600; }
.form-input.error { border-color: var(--wrong); background: var(--wrong-light); }

.form-hint { font-size: 11px; color: var(--muted); padding-left: 4px; font-weight: 600; }
.form-hint.error { color: var(--wrong); }

.form-error-box {
    display: none; background: var(--wrong-light); color: #991b1b;
    border-radius: 12px; padding: 11px 14px;
    font-size: 13px; font-weight: 700; margin-bottom: 16px;
    border-left: 4px solid var(--wrong);
    animation: shake 0.4s ease; line-height: 1.4;
}
.form-error-box.show { display: block; }
.form-error-box.warning {
    background: var(--in-progress-light); color: #92400e;
    border-left-color: var(--in-progress);
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.start-btn {
    width: 100%; background: var(--accent); color: #fff;
    border: none; border-radius: 15px; font-size: 18px; font-weight: 800;
    padding: 16px; cursor: pointer; transition: all 0.15s;
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.3);
    font-family: inherit; text-transform: uppercase; letter-spacing: 1px;
}
.start-btn:hover { background: #0369a1; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(2, 132, 199, 0.4); }
.start-btn:active { transform: scale(0.98); }

.welcome-policy { margin-top: 14px; text-align: center; }
.policy-link {
    display: inline-block; font-size: 12.5px; font-weight: 600;
    color: var(--muted); text-decoration: none;
    transition: color 0.15s; line-height: 1.4;
}
.policy-link:hover { color: var(--accent); }
@media (max-width: 700px) { .policy-link { font-size: 11.5px; } }

/* ============ БОКОВАЯ ПАНЕЛЬ ПРОФИЛЕЙ ============ */
.profiles-section { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.profiles-header { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.profiles-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.profiles-title {
    font-size: 13px; font-weight: 800; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.8px;
}
.profiles-count {
    font-size: 11px; font-weight: 800; color: var(--accent);
    background: var(--accent-light); padding: 3px 10px; border-radius: 10px;
}

.import-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--bg); border: 2px solid var(--key); border-radius: 10px;
    padding: 9px 12px; font-size: 12px; font-weight: 800; color: var(--muted);
    cursor: pointer; transition: all 0.15s; font-family: inherit;
    text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; width: 100%;
}
.import-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.import-btn .import-icon { font-size: 16px; line-height: 1; }

.profiles-list {
    display: flex; flex-direction: column; gap: 8px;
    max-height: 340px; overflow-y: auto; padding: 4px 8px 4px 2px;
}
.profiles-list::-webkit-scrollbar { width: 6px; }
.profiles-list::-webkit-scrollbar-thumb { background: var(--key); border-radius: 3px; }
.profiles-list::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.profile-chip {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg); border: 3px solid var(--key); border-radius: 13px;
    padding: 9px 12px 9px 9px; cursor: pointer; transition: all 0.15s;
    font-weight: 700; font-size: 14px; color: var(--text);
    position: relative; flex-shrink: 0;
}
.profile-chip:hover { border-color: var(--accent); background: var(--accent-light); transform: translateX(-2px); }
.profile-chip .avatar {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #38bdf8);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 18px; flex-shrink: 0;
}
.profile-chip .p-info { flex: 1; min-width: 0; }
.profile-chip .p-name { line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-chip .p-class { font-size: 11px; color: var(--muted); font-weight: 700; }
.profile-chip .p-delete {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--wrong); color: #fff; border: none;
    font-size: 18px; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.15s, transform 0.15s;
    flex-shrink: 0; font-family: Arial, sans-serif;
    padding: 0; margin: 0; line-height: 26px; text-align: center;
}
.profile-chip .p-delete:hover { background: #b91c1c; transform: scale(1.12); }

.profiles-empty {
    color: var(--muted); font-size: 13px; font-weight: 600;
    text-align: center; padding: 20px 8px;
}

.bulk-actions {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--key);
}
.bulk-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--bg); border: 2px solid var(--key); border-radius: 10px;
    padding: 9px 12px; font-size: 12px; font-weight: 800; color: var(--muted);
    cursor: pointer; transition: all 0.15s; font-family: inherit;
    text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; width: 100%;
}
.bulk-btn.save-all:hover { border-color: var(--correct); color: var(--correct); background: var(--correct-light); }
.bulk-btn.delete-all:hover { border-color: var(--wrong); color: var(--wrong); background: var(--wrong-light); }
.bulk-btn .bulk-icon { font-size: 15px; line-height: 1; }

/* ============ ШАПКА ============ */
.header {
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0; flex-wrap: wrap;
}

/* Обёртки для мобильной раскладки.
   На десктопе display: contents — ведут себя как прямые дети .header. */
.header-top,
.header-actions-row { display: contents; }

h1 {
    font-size: 25px; color: var(--accent); font-weight: 800;
    letter-spacing: 0.5px; white-space: nowrap; flex-shrink: 0;
    display: flex; align-items: center; gap: 8px;
}
h1 img { width: 52px; height: 52px; object-fit: contain; vertical-align: middle; margin-right: 4px; }

.current-profile {
    display: flex; align-items: center; gap: 10px;
    background: var(--card); border: 3px solid var(--accent); border-radius: 14px;
    padding: 6px 12px 6px 8px; cursor: pointer; transition: all 0.15s;
    box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.current-profile:hover { background: var(--accent-light); transform: translateY(-1px); }
.current-profile .avatar {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), #38bdf8);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 18px; flex-shrink: 0; padding-bottom: 1px;
}
.current-profile .cp-name {
    font-size: 14px; font-weight: 800; color: var(--text);
    line-height: 1.1; white-space: nowrap;
}
.current-profile .cp-class { font-size: 11px; color: var(--muted); font-weight: 700; }
.current-profile .cp-switch { font-size: 21px; color: var(--accent); font-weight: 800; margin-left: 0; white-space: nowrap; }

.range-switch {
    display: flex; gap: 4px; flex-wrap: wrap;
    flex: 1 1 auto; justify-content: flex-end; min-width: 0;
}
.range-btn {
    background: var(--card); color: var(--muted);
    border: 2px solid var(--key); border-radius: 10px;
    font-family: inherit; font-size: 12px; font-weight: 800;
    padding: 6px 10px; cursor: pointer; transition: all 0.15s;
    white-space: nowrap; letter-spacing: 0.3px; box-shadow: var(--shadow-xs);
}
.range-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.range-btn:not(.active):hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }

.modes {
    display: flex; gap: 6px; flex: 1 1 auto;
    justify-content: flex-end; flex-wrap: wrap; min-width: 0;
}
.mode-btn {
    background: var(--card); color: var(--muted);
    border: 3px solid var(--key); border-radius: 12px;
    font-size: 18px; font-weight: 700; padding: 8px 12px;
    cursor: pointer; transition: all 0.15s; box-shadow: var(--shadow-xs);
    position: relative; white-space: nowrap; font-family: inherit; line-height: 1;
}
.mode-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }
.mode-btn:hover:not(.active) { border-color: var(--accent); color: var(--text); }
.mode-btn.in-progress::after {
    content: ''; position: absolute; top: -4px; right: -4px;
    background: var(--in-progress); width: 12px; height: 12px;
    border-radius: 50%; border: 2px solid #fff;
}
.mode-btn .mode-text { display: inline; }
.mode-btn .mode-sign { display: inline; }

.icon-btn {
    height: 42px; padding: 0 16px; border-radius: 21px;
    background: var(--card); cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-xs); font-family: inherit;
    font-size: 13px; font-weight: 800; letter-spacing: 1px;
    flex-shrink: 0; border: 3px solid transparent;
    white-space: nowrap; text-transform: uppercase;
}
.icon-btn.export-btn { color: var(--correct); border-color: var(--correct); }
.icon-btn.export-btn:hover { background: var(--correct-light); transform: scale(1.03); }
.icon-btn.reset-btn { color: var(--wrong); border-color: var(--wrong); }
.icon-btn.reset-btn:hover { background: var(--wrong-light); transform: scale(1.03); }
.icon-btn.stats-btn { color: var(--stats); border-color: var(--stats); }
.icon-btn.stats-btn:hover { background: var(--stats-light); transform: scale(1.03); }
.icon-btn.settings-btn { color: var(--accent); border-color: var(--accent); }
.icon-btn.settings-btn:hover { background: var(--accent-light); transform: scale(1.03); }
.icon-btn.pause-cat { color: var(--in-progress); border-color: var(--in-progress); }
.icon-btn.pause-cat:hover { background: var(--in-progress-light); transform: scale(1.03); }
.icon-btn:active { transform: scale(0.97); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.icon-btn.hidden { display: none !important; }

/* ============ ПАНЕЛЬ ПРОГРЕССА ============ */
.dashboard {
    background: var(--card); border-radius: 16px; padding: 12px 16px;
    box-shadow: var(--shadow-sm); display: flex; align-items: center;
    gap: 16px; flex-shrink: 0;
}

.total-block { display: flex; flex-direction: column; min-width: 110px; flex-shrink: 0; }
.total-label { font-size: 16px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.total-value { font-size: 24px; font-weight: 900; color: var(--accent); font-family: 'Courier New', monospace; line-height: 1; margin-top: 3px; }
.total-value .total-of { font-size: 15px; color: var(--muted); }
.total-bar { width: 100%; height: 6px; background: var(--key); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.total-bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--accent), var(--correct));
    width: 0%; transition: width 0.5s ease; border-radius: 3px;
}

.progress-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; flex: 1; min-width: 0; }

.progress-cell {
    aspect-ratio: 1 / 1; border-radius: 12px; background: var(--key);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-family: 'Courier New', monospace; font-weight: 900; color: var(--muted);
    font-size: clamp(14px, 2.4vh, 28px); position: relative;
    transition: transform 0.2s, border-color 0.2s, background 0.2s, color 0.2s;
    cursor: pointer; border: 3px solid transparent; overflow: hidden;
    line-height: 1; padding: 2px;
}
.progress-cell:hover { transform: scale(1.06); z-index: 3; border-color: var(--accent); box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15); }
.progress-cell.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent); box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25); }
.progress-cell.in-progress { background: var(--in-progress-light); color: #b45309; }
.progress-cell.in-progress::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, var(--in-progress) var(--fill-pct, 0%), transparent var(--fill-pct, 0%));
    opacity: 0.35; pointer-events: none;
}
.progress-cell.done { background: var(--correct-light); color: var(--correct); }
.progress-cell.done::after {
    content: '✓'; position: absolute; top: 3px; right: 3px;
    background: var(--correct); color: #fff; width: 16px; height: 16px;
    border-radius: 50%; font-size: 10px; display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff; font-family: Arial, sans-serif; font-weight: 900; line-height: 1;
}
.progress-cell.locked { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; opacity: 0.7; }
.progress-cell.locked::after { content: '🔒'; position: absolute; top: 2px; right: 2px; font-size: 12px; line-height: 1; }
.progress-cell.locked:hover { transform: none; border-color: transparent; box-shadow: none; }

.progress-cell-num {
    font-size: 1em; line-height: 1; position: relative; z-index: 1;
    font-weight: 800; white-space: nowrap; letter-spacing: -0.5px;
}
.progress-cell-sub {
    display: none; font-size: 0.6em; line-height: 1; margin-top: 2px;
    opacity: 0.9; position: relative; z-index: 1;
    font-family: 'Segoe UI', sans-serif; font-weight: 600; white-space: nowrap;
}
.progress-cell.in-progress .progress-cell-sub { display: block; }

/* ============ ИГРОВАЯ ЗОНА ============ */
.gameArea {
    flex: 1; display: flex; flex-direction: column;
    gap: 10px; min-height: 0; overflow: hidden; position: relative;
}

.top-row {
    flex: 1; display: flex; justify-content: center;
    align-items: stretch; gap: 15px; min-height: 0; overflow: hidden;
}

.board {
    flex: 1; background: var(--card); border-radius: 20px;
    padding: 15px 30px; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm); border: 5px solid transparent;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.board.correct { border-color: var(--correct); background: var(--correct-light); box-shadow: 0 3px 12px rgba(22, 163, 74, 0.15); }
.board.wrong { border-color: var(--wrong); background: var(--wrong-light); box-shadow: 0 3px 12px rgba(220, 38, 38, 0.15); }

.question {
    font-size: clamp(60px, 10vh, 120px); font-weight: 800;
    font-family: 'Courier New', monospace; letter-spacing: 4px;
    display: flex; align-items: center; justify-content: center;
    gap: 16px; color: var(--text); line-height: 1; white-space: nowrap;
}

.answer-box {
    display: inline-block; min-width: 110px;
    border-bottom: 8px solid var(--accent); color: var(--accent);
    text-align: center; font-weight: 900; transition: all 0.2s;
}
.answer-box.empty { color: #cbd5e1; border-bottom-color: #cbd5e1; }

.enter-side {
    flex: 0 0 190px; background: var(--accent); color: #fff;
    border: none; border-radius: 18px; font-size: 16px; font-weight: 800;
    cursor: pointer; transition: all 0.15s; box-shadow: 0 1px 2px rgba(2, 132, 199, 0.25);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 10px; text-transform: uppercase; letter-spacing: 1px;
}
.enter-side:hover { background: #0369a1; box-shadow: 0 1px 2px rgba(2, 132, 199, 0.35); }
.enter-side:active { transform: scale(0.97); }
.enter-side .icon { font-size: 32px; line-height: 1; }

/* ============ КЛАВИАТУРА ============ */
.bottom-row { flex: 0 0 auto; height: clamp(200px, 30vh, 400px); display: flex; }
.bottom-row.hidden { display: none !important; }

.keypad-block {
    flex: 1; background: var(--card); border-radius: 20px;
    padding: 12px; box-shadow: var(--shadow-sm); display: flex; min-width: 0;
}
.keypad {
    display: grid; grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(2, 1fr); gap: 10px;
    width: 100%; max-width: 100%; margin: 0 auto;
}
.key {
    background: var(--bg); color: var(--text);
    border: 3px solid var(--key); border-radius: 16px;
    font-size: clamp(24px, 4vh, 42px); font-weight: 800;
    cursor: pointer; transition: all 0.1s; font-family: 'Courier New', monospace;
    line-height: 1; display: flex; align-items: center; justify-content: center; min-height: 0;
}
.key:hover { background: var(--accent-light); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(2, 132, 199, 0.15); }
.key:active { transform: scale(0.96); box-shadow: none; }
.key.clear-key {
    grid-column: 6; grid-row: 1 / span 2;
    background: #e2e8f0; color: #475569; border-color: #cbd5e1; font-family: Arial, sans-serif;
}
.key.clear-key:hover { background: #cbd5e1; border-color: #94a3b8; color: #334155; }
.key.clear-key .icon { font-size: clamp(28px, 4.5vh, 48px); line-height: 1; font-weight: 400; }

/* ============ ОВЕРЛЕЙ СЕССИИ ============ */
.session-overlay {
    position: absolute;
    inset: 0;
    background: var(--card);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    animation: fadeIn 0.25s ease;
    padding: 20px;
}
.session-overlay.hidden { display: none !important; }
.session-overlay__inner {
    text-align: center;
    max-width: 620px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(12px, 2vh, 20px);
}
.session-overlay__emoji {
    font-size: clamp(52px, 9vh, 96px);
    line-height: 1;
    animation: countdownPulse 2s ease infinite;
}
.session-overlay__title {
    font-size: clamp(24px, 4.5vh, 42px);
    font-weight: 800;
    color: var(--accent);
    line-height: 1.15;
}
.session-overlay__text {
    font-size: clamp(14px, 2.2vh, 20px);
    color: var(--muted);
    font-weight: 700;
    line-height: 1.5;
    max-width: 520px;
}
.session-overlay__buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(10px, 1.6vh, 16px);
    margin-top: clamp(8px, 1.5vh, 16px);
    width: 100%;
}
.session-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-family: inherit;
    font-size: clamp(16px, 2.4vh, 22px);
    font-weight: 800;
    padding: clamp(12px, 1.8vh, 18px) clamp(28px, 5vw, 52px);
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 260px;
    max-width: 100%;
}
.session-btn:hover { background: #0369a1; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(2, 132, 199, 0.4); }
.session-btn:active { transform: scale(0.98); }
.session-btn.primary { background: var(--accent); }
.session-btn.restart { background: var(--wrong); box-shadow: 0 6px 18px rgba(220, 38, 38, 0.3); }
.session-btn.restart:hover { background: #b91c1c; box-shadow: 0 10px 24px rgba(220, 38, 38, 0.4); }
.session-btn .session-btn__icon { font-size: 1.1em; line-height: 1; }

/* ============ ЭКРАН "КАТЕГОРИЯ ПРОЙДЕНА" ============ */
.category-done {
    display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; padding: 25px; background: var(--card);
    border-radius: 28px; border: 5px solid var(--correct);
    box-shadow: 0 6px 24px rgba(22, 163, 74, 0.12);
    animation: fadeIn 0.3s ease; text-align: center; min-height: 0;
}
.category-done.show { display: flex; }
.category-done .done-title { font-size: clamp(24px, 4.5vh, 42px); color: var(--correct); font-weight: 800; line-height: 1.2; }
.category-done .done-title .cat-num { color: var(--accent); font-family: 'Courier New', monospace; }
.category-done .done-next { font-size: clamp(14px, 2.2vh, 20px); color: var(--muted); font-weight: 700; }
.category-done .done-next b { color: var(--text); font-family: 'Courier New', monospace; }
.countdown-big { font-size: clamp(48px, 10vh, 88px); font-weight: 900; color: var(--accent); font-family: 'Courier New', monospace; line-height: 1; animation: countdownPulse 1s ease infinite; }
@keyframes countdownPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: 0.85; } }
.countdown-label { font-size: clamp(10px, 1.6vh, 15px); color: var(--muted); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.countdown-bar { width: 100%; max-width: 480px; height: 12px; background: var(--key); border-radius: 6px; overflow: hidden; }
.countdown-fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--correct)); border-radius: 6px; transition: width 0.1s linear; }

/* ============ ФИНАЛЬНЫЙ ЭКРАН ============ */
.finish {
    display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center;
    gap: 20px; padding: 30px; background: var(--card);
    border-radius: 28px; border: 5px solid var(--correct);
    box-shadow: 0 6px 24px rgba(22, 163, 74, 0.12);
    animation: fadeIn 0.3s ease; text-align: center; min-height: 0;
}
.finish.show { display: flex; }
.finish h2 { font-size: clamp(26px, 5.5vh, 48px); color: var(--correct); font-weight: 800; }
.finish p { font-size: clamp(14px, 2.2vh, 20px); color: var(--muted); }
.restart-btn {
    background: var(--accent); color: #fff; border: none;
    border-radius: 16px; font-size: clamp(16px, 2.4vh, 22px); font-weight: 800;
    padding: clamp(12px, 1.8vh, 16px) 40px; cursor: pointer;
    transition: all 0.15s; box-shadow: 0 6px 18px rgba(2, 132, 199, 0.3);
}
.restart-btn:hover { background: #0369a1; transform: translateY(-3px); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { transform: scale(0.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ============ МОДАЛЬНОЕ ОКНО ============ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px);
    z-index: 3000; align-items: center; justify-content: center;
    padding: 20px; animation: fadeIn 0.2s ease;
}
.modal-overlay.show { display: flex; }
.modal-overlay#modal { z-index: 3100; }

.modal {
    background: var(--card); border-radius: 24px;
    padding: 30px 35px 25px; max-width: 440px; width: 100%;
    box-shadow: var(--shadow-lg); text-align: center;
    animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal.wide { max-width: 560px; }
.modal.stats-modal { max-width: 780px; text-align: left; }
.modal-icon { font-size: 52px; margin-bottom: 8px; line-height: 1; }
.modal h3 { font-size: 22px; color: var(--text); margin-bottom: 10px; font-weight: 800; }
.modal p { font-size: 15px; color: var(--muted); margin-bottom: 22px; line-height: 1.5; }
.modal-buttons { display: flex; gap: 10px; justify-content: center; }
.modal-btn {
    flex: 1; padding: 14px 18px; font-size: 16px; font-weight: 800;
    border-radius: 14px; cursor: pointer; transition: all 0.15s;
    border: 3px solid transparent; font-family: inherit;
}
.modal-btn.cancel { background: var(--bg); color: var(--text); border-color: var(--key); }
.modal-btn.cancel:hover { background: var(--key); }
.modal-btn.confirm { background: var(--wrong); color: #fff; }
.modal-btn.confirm:hover { background: #b91c1c; transform: translateY(-2px); }
.modal-btn.primary { background: var(--accent); color: #fff; }
.modal-btn.primary:hover { background: #0369a1; transform: translateY(-2px); }

.hidden { display: none !important; }

/* ============ СТАТИСТИКА (полноэкранная модалка) ============ */

/* Оверлей статистики — без отступов */
#statsModal.modal-overlay {
    padding: 0;
    background: rgba(15, 23, 42, 0.75);
}

/* Сама модалка — на весь экран, без скруглений и полей */
#statsModal .modal.stats-modal {
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    padding: 0;
    margin: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    animation: none;
    box-shadow: none;
    overflow: hidden;
}

.stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 28px;
    background: var(--card);
    border-bottom: 2px solid var(--key);
    flex-shrink: 0;
}
.stats-header h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.stats-header .stats-close-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--key);
    background: var(--bg);
    color: var(--text);
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: Arial, sans-serif;
    line-height: 1;
    padding: 0;
}
.stats-header .stats-close-btn:hover {
    background: var(--wrong-light);
    border-color: var(--wrong);
    color: var(--wrong);
    transform: scale(1.05);
}

.stats-tabs-wrap {
    padding: 14px 28px 0;
    background: var(--card);
    border-bottom: 2px solid var(--key);
    flex-shrink: 0;
}
.stats-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    justify-content: flex-start;
}
.stats-tab {
    background: var(--bg);
    color: var(--muted);
    border: 2px solid var(--key);
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    padding: 11px 20px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}
.stats-tab:hover { border-color: var(--stats); color: var(--stats); }
.stats-tab.active { background: var(--stats); color: #fff; border-color: var(--stats); }

.stats-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px 32px;
    min-height: 0;
}
.stats-content::-webkit-scrollbar { width: 10px; }
.stats-content::-webkit-scrollbar-track { background: var(--bg); }
.stats-content::-webkit-scrollbar-thumb { background: var(--key); border-radius: 5px; }
.stats-content::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.stats-empty {
    text-align: center; color: var(--muted);
    font-size: 18px; font-weight: 600; padding: 60px 20px;
}

.stats-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px; margin-bottom: 24px;
}
.stats-card {
    background: var(--bg); border: 2px solid var(--key);
    border-radius: 14px; padding: 16px 18px;
}
.stats-card-label {
    font-size: 13px; font-weight: 800; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.stats-card-value {
    font-size: 26px; font-weight: 900; color: var(--accent);
    font-family: 'Courier New', monospace; line-height: 1.1;
}

.stats-section-title {
    font-size: 17px; font-weight: 800; color: var(--text);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin: 24px 0 12px; padding-bottom: 8px;
    border-bottom: 3px solid var(--accent-light);
}
.stats-section-title:first-child { margin-top: 0; }

.stats-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.stats-table th, .stats-table td {
    padding: 12px 16px; text-align: left;
    border-bottom: 1px solid var(--key); vertical-align: top;
}
.stats-table th {
    font-size: 13px; font-weight: 800; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.4px;
    background: var(--bg); white-space: nowrap;
    position: sticky; top: 0; z-index: 1;
}
.stats-table tr:hover td { background: var(--accent-light); }
.stats-table .num { font-family: 'Courier New', monospace; white-space: nowrap; }
.stats-table .correct-col { color: var(--correct); font-weight: 800; }
.stats-table .wrong-col { color: var(--wrong); font-weight: 800; }

.stats-history-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.stats-history-item {
    background: var(--bg); border: 1px solid var(--key);
    border-radius: 10px; padding: 10px 14px; font-size: 15px;
    display: flex; flex-wrap: wrap; gap: 14px;
    font-family: 'Courier New', monospace;
}
.stats-history-item .lbl { color: var(--muted); font-family: 'Segoe UI', sans-serif; font-weight: 700; }
.stats-history-item .correct-col { color: var(--correct); font-weight: 800; }
.stats-history-item .wrong-col { color: var(--wrong); font-weight: 800; }

/* ============ НАСТРОЙКИ ============ */

/* Модалка настроек — колонка: шапка / скролл-контент / футер с кнопками.
   Ограничена по высоте, чтобы на мобильных не уезжала за экран. */
#settingsModal .modal.settings-modal {
    display: flex;
    flex-direction: column;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    padding: 0;
    text-align: left;
    overflow: hidden;
}

/* Шапка настроек */
.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 28px 16px;
    border-bottom: 2px solid var(--key);
    flex-shrink: 0;
    background: var(--card);
}
.settings-header h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.settings-header .settings-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--key);
    background: var(--bg);
    color: var(--text);
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: Arial, sans-serif;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
.settings-header .settings-close-btn:hover {
    background: var(--wrong-light);
    border-color: var(--wrong);
    color: var(--wrong);
    transform: scale(1.05);
}

/* Скроллируемая область контента настроек */
.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px 8px;
    min-height: 0;
}
.settings-body::-webkit-scrollbar { width: 8px; }
.settings-body::-webkit-scrollbar-track { background: var(--bg); }
.settings-body::-webkit-scrollbar-thumb { background: var(--key); border-radius: 4px; }
.settings-body::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Футер с кнопками — прижат к низу модалки */
.settings-footer {
    display: flex;
    gap: 12px;
    padding: 16px 28px 20px;
    border-top: 2px solid var(--key);
    background: var(--card);
    flex-shrink: 0;
}
.settings-footer .modal-btn {
    flex: 1;
    padding: 14px 18px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s;
    border: 3px solid transparent;
    font-family: inherit;
}

.settings-section { text-align: left; margin-bottom: 22px; }
.settings-section:last-child { margin-bottom: 8px; }
.settings-section-title {
    font-size: 14px; font-weight: 800; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px;
}
.settings-checkboxes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.settings-checkbox {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg); border: 2px solid var(--key); border-radius: 12px;
    padding: 10px 14px; cursor: pointer; transition: all 0.15s;
    font-size: 16px; font-weight: 700; color: var(--text);
}
.settings-checkbox:hover { border-color: var(--accent); background: var(--accent-light); }
.settings-checkbox input { width: 22px; height: 22px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.settings-checkbox.disabled {
    opacity: 0.45; cursor: not-allowed; pointer-events: none;
    background: var(--key);
}
.settings-select {
    width: 100%; padding: 12px 14px; border-radius: 12px;
    border: 2px solid var(--key); background: var(--bg);
    font-family: inherit; font-size: 17px; font-weight: 700;
    color: var(--text); cursor: pointer; outline: none; transition: all 0.15s;
}
.settings-select:focus { border-color: var(--accent); background: #fff; }
.settings-hint { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5; font-weight: 600; }

/* ============ АДАПТАЦИЯ ============ */
@media (max-height: 750px) {
    h1 { font-size: 15px; }
    h1 img { width: 42px; height: 42px; }
    .mode-btn { font-size: 15px; padding: 6px 8px; }
    .range-btn { font-size: 11px; padding: 5px 8px; }
    .icon-btn { height: 34px; font-size: 11px; padding: 0 12px; }
    .total-value { font-size: 20px; }
    .total-value .total-of { font-size: 12px; }
    .progress-cell { font-size: clamp(12px, 2vh, 20px); border-radius: 10px; }
    .progress-cell-sub { font-size: 0.55em; }
    .progress-cell.done::after { width: 13px; height: 13px; font-size: 8px; top: 2px; right: 2px; }
    .progress-cell.locked::after { font-size: 10px; }
    .enter-side { flex-basis: 130px; font-size: 13px; }
    .enter-side .icon { font-size: 24px; }
    .question { font-size: clamp(44px, 8vh, 80px); letter-spacing: 3px; gap: 12px; }
    .answer-box { min-width: 80px; border-bottom-width: 6px; }
    .bottom-row { height: clamp(100px, 18vh, 170px); }
}

@media (max-width: 900px) {
    .welcome-card { grid-template-columns: 1fr; gap: 22px; padding: 26px 22px 22px; max-width: 560px; }
    .welcome-main { padding-right: 0; border-right: none; }
    .welcome-side { padding-left: 0; padding-top: 20px; border-top: 2px dashed var(--key); }
    .welcome-logo { width: 100px; height: 100px; }
    .profiles-list { max-height: none; overflow-y: visible; flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .profile-chip { flex: 0 1 auto; }
    .profile-chip:hover { transform: translateY(-2px); }
    .bulk-actions { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .bulk-btn { width: auto; }

    h1 { font-size: 16px; }
    h1 img { width: 42px; height: 42px; }
    .current-profile .cp-name { font-size: 12px; }
    .mode-btn { font-size: 16px; padding: 7px 10px; }
    .range-btn { font-size: 11px; padding: 5px 8px; }
    .icon-btn { padding: 0 12px; font-size: 11px; height: 36px; }
    .modes { gap: 4px; }

    .stats-header { padding: 14px 20px; }
    .stats-header h3 { font-size: 20px; }
    .stats-tabs-wrap { padding: 12px 20px 0; }
    .stats-content { padding: 18px 20px 24px; }
    .stats-tab { font-size: 14px; padding: 9px 14px; }
    .stats-table { font-size: 14px; }
    .stats-table th, .stats-table td { padding: 9px 11px; }
    .stats-card-value { font-size: 22px; }
    .stats-section-title { font-size: 15px; }
}

/* ============ МОБИЛЬНАЯ ШАПКА (<=700px) ============ */
@media (max-width: 700px) {
    html, body { overflow-x: hidden; overflow-y: auto; }
    body { padding: 8px; gap: 6px; }

    .welcome-card { padding: 22px 18px 20px; border-radius: 22px; }
    .welcome-title { font-size: 22px; }
    .welcome-logo { width: 80px; height: 80px; }
    .form-row { flex-direction: column; gap: 10px; }
    .form-group.narrow { flex: 1; }

    /* Шапка на мобильных — построчно */
    .header {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 6px;
        padding: 0;
    }

    .header-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
    }
    .header-top h1 {
        font-size: 25px;
        min-width: 0;
        flex: 1 1 auto;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .header-top h1 img { width: 36px; height: 36px; margin-right: 2px; }

    .current-profile {
        padding: 4px 8px 4px 6px;
        flex-shrink: 0;
        margin-left: 0;
    }
    .current-profile .avatar { width: 32px; height: 32px; font-size: 18px; }
    .current-profile .cp-name { font-size: 14px; }
    .current-profile .cp-class { font-size: 11px; }
    .current-profile .cp-switch { font-size: 20px; }

    .header-actions-row {
        display: flex;
        flex-wrap: nowrap;
        gap: 5px;
        justify-content: flex-end;
        width: 100%;
    }
    .header-actions-row::-webkit-scrollbar { display: none; }

    .icon-btn {
        height: 30px;
        padding: 0 10px;
        font-size: 11px;
        letter-spacing: 0.4px;
        border-width: 2px;
        border-radius: 15px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .range-switch {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        justify-content: stretch;
        background: var(--card);
        border-radius: 20px;
        padding: 12px;
        box-shadow: var(--shadow-sm);
        width: 100%;
        flex: 1 1 100%;
    }
    .range-btn {
        font-size: 11px;
        padding: 6px 2px;
        border-width: 2px;
        border-radius: 8px;
        text-align: center;
        letter-spacing: 0;
    }

    .modes {
        gap: 5px;
        justify-content: stretch;
        width: 100%;
        flex: 1 1 100%;
    }
    .mode-btn {
        font-size: 20px;
        padding: 8px 6px;
        flex: 1;
        min-width: 0;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .mode-btn .mode-text { display: none; }
    .mode-btn .mode-sign { display: inline; }

    .dashboard { padding: 8px 10px; gap: 10px; align-items: stretch; }
    .total-block { min-width: 60px; }
    .total-label { font-size: 11px; }
    .total-value { font-size: 18px; }
    .total-value .total-of { font-size: 11px; }

    .progress-grid { grid-template-columns: repeat(10, 1fr); gap: 3px; }
    .progress-cell { font-size: clamp(9px, 2.4vw, 14px); border-radius: 6px; border-width: 2px; padding: 1px; }
    .progress-cell-num { letter-spacing: -1px; }
    .progress-cell-sub { font-size: 0.5em; margin-top: 1px; }
    .progress-cell.done::after { width: 10px; height: 10px; font-size: 6px; top: 1px; right: 1px; border-width: 1px; }
    .progress-cell.locked::after { font-size: 9px; top: 1px; right: 1px; }

    .top-row { flex-direction: column; gap: 6px; overflow: hidden; }
    .board { padding: 15px; border-radius: 14px; overflow: hidden; }
    .question { font-size: 42px; letter-spacing: 2px; gap: 5px; }
    .answer-box { min-width: 52px; border-bottom-width: 4px; }

    .enter-side {
        flex: 0.6; padding: 12px; font-size: 18px; border-radius: 14px;
        flex-direction: row; justify-content: center; gap: 8px;
    }
    .enter-side .icon { font-size: 20px; }

    .bottom-row { flex-direction: column; gap: 6px; }
    .keypad-block { padding: 8px; }
    .keypad { gap: 5px; grid-template-columns: repeat(6, 1fr); }
    .key { font-size: 22px; padding: 12px 0; border-radius: 10px; border-width: 2px; }
    .key.clear-key .icon { font-size: 26px; }

    .session-overlay { border-radius: 22px; padding: 16px; }
    .session-overlay__emoji { font-size: 56px; }
    .session-overlay__title { font-size: 26px; }
    .session-overlay__text { font-size: 14px; }
    .session-btn {
        font-size: 16px;
        padding: 14px 22px;
        min-width: 0;
        width: 100%;
        max-width: 340px;
    }

    /* Статистика на весь экран — мобильная адаптация */
    .stats-header { padding: 12px 14px; gap: 10px; }
    .stats-header h3 { font-size: 17px; gap: 6px; }
    .stats-header .stats-close-btn { width: 38px; height: 38px; font-size: 20px; }
    .stats-tabs-wrap { padding: 10px 14px 0; }
    .stats-tabs { gap: 6px; margin-bottom: 10px; }
    .stats-tab { font-size: 13px; padding: 8px 12px; border-radius: 10px; }
    .stats-content { padding: 14px 14px 20px; }
    .stats-cards { grid-template-columns: 1fr; gap: 10px; }
    .stats-card { padding: 12px 14px; }
    .stats-card-value { font-size: 20px; }
    .stats-section-title { font-size: 14px; margin: 18px 0 8px; }
    .stats-table { font-size: 13px; }
    .stats-table th, .stats-table td { padding: 8px 9px; }
    .stats-history-item { font-size: 13px; padding: 8px 10px; gap: 8px; }
    .stats-empty { font-size: 15px; padding: 40px 12px; }

    /* Настройки на мобильных — ужимаем отступы, оставляем скролл */
    #settingsModal { padding: 10px; }
    #settingsModal .modal.settings-modal {
        max-height: 92vh;
        border-radius: 20px;
    }
    .settings-header { padding: 14px 16px 12px; gap: 10px; }
    .settings-header h3 { font-size: 18px; gap: 6px; }
    .settings-header .settings-close-btn { width: 36px; height: 36px; font-size: 20px; }
    .settings-body { padding: 14px 16px 6px; }
    .settings-footer { padding: 12px 16px 14px; gap: 8px; }
    .settings-footer .modal-btn { font-size: 14px; padding: 12px 14px; border-radius: 12px; }

    .settings-checkboxes { grid-template-columns: 1fr; gap: 6px; }
    .settings-checkbox { font-size: 15px; padding: 10px 12px; }
    .settings-section-title { font-size: 13px; }
    .settings-select { font-size: 16px; padding: 11px 12px; }
    .settings-hint { font-size: 12px; }
}

@media (max-width: 400px) {
    .progress-grid { gap: 2px; }
    .progress-cell { font-size: 9px; border-radius: 4px; border-width: 1px; }
    .progress-cell-num { letter-spacing: -1.2px; }
    .progress-cell-sub { font-size: 0.45em; }
    .progress-cell.done::after { width: 8px; height: 8px; font-size: 5px; }
    .progress-cell.locked::after { font-size: 8px; }

    .mode-btn { font-size: 18px; padding: 6px 4px; }
    .range-btn { font-size: 10px; padding: 5px 2px; }
    .icon-btn { height: 28px; padding: 0 8px; font-size: 9px; }

    .question { font-size: 34px; gap: 4px; letter-spacing: 1px; }
    .key { font-size: 20px; padding: 10px 0; }

    .stats-header h3 { font-size: 15px; }
    .stats-header .stats-close-btn { width: 34px; height: 34px; font-size: 18px; }
    .stats-tab { font-size: 12px; padding: 7px 10px; }
    .stats-card-value { font-size: 18px; }
    .stats-table { font-size: 12px; }
    .stats-table th, .stats-table td { padding: 6px 7px; }

    .settings-header h3 { font-size: 16px; }
    .settings-header .settings-close-btn { width: 32px; height: 32px; font-size: 18px; }
    .settings-body { padding: 12px 12px 4px; }
    .settings-footer { padding: 10px 12px 12px; }
    .settings-footer .modal-btn { font-size: 13px; padding: 11px 10px; }
}