:root {
  color-scheme: dark;
  --navy: #07172c;
  --navy-2: #0b1f3a;
  --panel: rgba(14, 37, 65, .88);
  --panel-strong: #102b4c;
  --panel-soft: #15395f;
  --line: rgba(150, 196, 225, .17);
  --text: #f4f8fc;
  --muted: #a9bfd2;
  --cyan: #42c6e8;
  --cyan-2: #16a8d0;
  --green: #49d6a0;
  --red: #ff777f;
  --amber: #f4c66b;
  --shadow: 0 22px 60px rgba(0, 0, 0, .24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--navy); }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  background: radial-gradient(circle at 80% 0%, #123b62 0, transparent 34rem),
              linear-gradient(145deg, #07172c 0%, #0a203b 55%, #07172c 100%);
  overflow-x: hidden;
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.ambient { position: fixed; z-index: -1; pointer-events: none; filter: blur(3px); opacity: .26; }
.ambient-one { width: 26rem; height: 26rem; top: 20%; left: -18rem; border: 1px solid #2b9dca; transform: rotate(45deg); box-shadow: 0 0 0 35px rgba(31, 139, 184, .07), 0 0 0 70px rgba(31, 139, 184, .04); }
.ambient-two { width: 20rem; height: 20rem; right: -13rem; bottom: 8%; border: 1px solid #2b9dca; transform: rotate(25deg); box-shadow: 0 0 0 30px rgba(31, 139, 184, .06), 0 0 0 60px rgba(31, 139, 184, .035); }
.topbar { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 16px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: #06203a; font-weight: 950; letter-spacing: -2px; font-size: 17px; background: linear-gradient(135deg, #8be7f7, #27b8de); box-shadow: 0 8px 28px rgba(48, 193, 226, .25); }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { letter-spacing: .13em; font-size: 12px; }
.brand-copy small { color: var(--muted); letter-spacing: .16em; font-size: 9px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.connection-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(5, 19, 36, .42); }
.connection-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px currentColor; }
.connection-badge.offline i { background: var(--amber); }
.install-button { color: #06223b; background: var(--cyan); border: 0; border-radius: 999px; padding: 9px 14px; font-size: 12px; font-weight: 800; }
.sound-button { color: #d8edf8; background: rgba(9, 34, 58, .78); border: 1px solid rgba(112, 190, 220, .28); border-radius: 999px; padding: 9px 13px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.sound-button.is-on { color: #06233a; background: linear-gradient(135deg, #8be7f7, #35c1df); border-color: transparent; box-shadow: 0 5px 18px rgba(48, 193, 226, .16); }
.sound-settings { display: grid; grid-template-columns: 1fr minmax(170px, 260px); align-items: center; gap: 14px 22px; margin-top: 16px; padding: 17px 21px; }
.sound-settings h2 { margin: 4px 0 5px; font-size: 15px; }
.sound-settings p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.sound-volume { display: grid; gap: 7px; }
.sound-volume label { display: flex; justify-content: space-between; color: #c7d9e8; font-size: 10px; font-weight: 800; }
.sound-volume input[type="range"] { width: 100%; accent-color: var(--cyan); cursor: pointer; }
.sound-hint { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .sound-settings { grid-template-columns: 1fr; gap: 12px; } .sound-hint { grid-column: auto; } }
@media (max-width: 520px) { .sound-button { padding: 8px 10px; font-size: 10px; } .topbar { gap: 8px; } .top-actions { gap: 6px; } }

.app-shell { width: min(940px, calc(100% - 32px)); min-height: calc(100vh - 125px); margin: 0 auto; padding: 20px 0 46px; }
.footer { width: min(940px, calc(100% - 32px)); margin: 0 auto; padding: 10px 0 22px; display: flex; justify-content: space-between; gap: 12px; color: #66829c; text-transform: uppercase; letter-spacing: .13em; font-size: 9px; }
.loading-card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.loading-card { min-height: 260px; display: grid; place-content: center; justify-items: center; color: var(--muted); gap: 16px; }
.loader { width: 30px; height: 30px; border: 3px solid rgba(66, 198, 232, .2); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero { position: relative; overflow: hidden; padding: clamp(24px, 5vw, 48px); border-radius: 28px; border: 1px solid rgba(107, 195, 225, .25); background: linear-gradient(120deg, rgba(14, 47, 79, .97), rgba(9, 29, 53, .94)); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -70px; top: -130px; width: 330px; height: 330px; border: 1px solid rgba(71, 201, 231, .22); border-radius: 50%; box-shadow: 0 0 0 35px rgba(71, 201, 231, .035), 0 0 0 70px rgba(71, 201, 231, .025); }
.eyebrow { color: var(--cyan); text-transform: uppercase; letter-spacing: .2em; font-weight: 800; font-size: 10px; }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { position: relative; z-index: 1; max-width: 640px; margin: 14px 0 8px; font-size: clamp(31px, 6vw, 52px); line-height: 1.02; letter-spacing: -.045em; }
.hero h1 span { color: var(--cyan); }
.hero p { position: relative; z-index: 1; max-width: 570px; margin: 14px 0 0; color: #b9ccdd; line-height: 1.6; font-size: 14px; }
.hero-stats { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.stat-chip { min-width: 104px; padding: 12px 14px; border-radius: 14px; background: rgba(4, 18, 34, .46); border: 1px solid rgba(143, 198, 225, .16); }
.stat-chip strong { display: block; font-size: 20px; color: #fff; }
.stat-chip small { color: var(--muted); font-size: 10px; }
.home-grid { display: grid; grid-template-columns: 1.06fr .94fr; gap: 18px; margin-top: 18px; }
.panel { padding: 24px; }
.panel h2 { font-size: 18px; letter-spacing: -.02em; margin-bottom: 7px; }
.panel-lead { color: var(--muted); font-size: 12px; line-height: 1.55; margin-bottom: 20px; }
.field { display: grid; gap: 7px; margin: 14px 0; }
.field label { font-size: 11px; color: #c7d9e8; font-weight: 700; }
.field input { width: 100%; border: 1px solid rgba(155, 197, 222, .22); background: rgba(4, 18, 34, .64); border-radius: 12px; padding: 13px 14px; color: #fff; min-height: 46px; outline: none; }
.field input::placeholder { color: #6f8aa3; }
.field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(66,198,232,.12); }
.btn { border: 0; border-radius: 13px; padding: 12px 16px; font-weight: 800; font-size: 12px; transition: transform .15s, filter .15s, background .15s; }
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: #06233a; background: linear-gradient(135deg, #69dff0, #21b4db); box-shadow: 0 8px 24px rgba(33, 180, 219, .19); }
.btn-secondary { color: #eaf6fc; background: #1a4267; border: 1px solid rgba(131, 191, 222, .22); }
.btn-ghost { color: #a9c1d5; background: rgba(5, 19, 35, .2); border: 1px solid var(--line); }
.btn-danger { color: #ffe8e8; background: rgba(174, 54, 70, .22); border: 1px solid rgba(255,119,127,.24); }
.btn-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.menu-stack { display: grid; gap: 10px; }
.menu-tile { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 15px; border-radius: 14px; border: 1px solid rgba(139, 190, 219, .14); background: rgba(7, 24, 44, .52); color: var(--text); text-align: left; }
.menu-tile:hover { border-color: rgba(66,198,232,.48); background: rgba(19, 58, 91, .6); }
.menu-tile strong { display: block; font-size: 12px; }
.menu-tile small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.tile-arrow { color: var(--cyan); font-size: 20px; }
.resume-box { border: 1px solid rgba(244,198,107,.34); background: rgba(114,80,25,.14); border-radius: 14px; padding: 14px; margin-top: 14px; }
.resume-box strong { font-size: 12px; }
.resume-box p { font-size: 11px; color: var(--muted); margin: 6px 0 12px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h1 { margin: 5px 0 0; font-size: clamp(25px, 4vw, 34px); letter-spacing: -.04em; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.exam-top { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 17px 20px; margin-bottom: 14px; }
.exam-student { font-size: 12px; color: var(--muted); }
.exam-student strong { color: var(--text); }
.timer { display: flex; align-items: center; gap: 8px; color: var(--cyan); font-variant-numeric: tabular-nums; font-weight: 900; font-size: 20px; }
.timer.warning { color: var(--amber); }
.timer.danger { color: var(--red); }
.progress-wrap { margin-top: 12px; }
.progress-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; margin-bottom: 7px; }
.progress-track { width: 100%; height: 7px; background: rgba(3, 15, 29, .8); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #19a8d3, #6ce2ee); transition: width .25s; }
.question-card { padding: clamp(20px, 4vw, 30px); }
.question-kicker { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.question-number { color: var(--cyan); letter-spacing: .13em; font-weight: 900; font-size: 11px; }
.area-tag { max-width: 65%; color: #b7d2e4; border: 1px solid rgba(110, 181, 214, .2); background: rgba(12, 53, 82, .45); border-radius: 999px; padding: 7px 10px; font-size: 9px; text-align: right; }
.question-text { font-size: clamp(17px, 3.1vw, 23px); line-height: 1.42; letter-spacing: -.02em; margin-bottom: 22px; }
.options { display: grid; gap: 10px; }
.option { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; width: 100%; text-align: left; color: #eaf3fa; background: rgba(5, 19, 36, .55); border: 1px solid rgba(142, 187, 214, .18); padding: 13px 14px; border-radius: 13px; line-height: 1.5; font-size: 13px; }
.option:hover { border-color: rgba(66,198,232,.55); background: rgba(19, 61, 94, .55); }
.option.selected { border-color: var(--cyan); background: rgba(23, 111, 143, .25); box-shadow: 0 0 0 2px rgba(66,198,232,.09) inset; }
.option-letter { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: #193c5d; color: #9edff0; font-weight: 900; font-size: 12px; }
.option.selected .option-letter { color: #06233a; background: var(--cyan); }
.question-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; }
.question-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.navigator { margin-top: 14px; padding: 18px 20px; }
.navigator-title { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; margin-bottom: 12px; }
.number-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px; }
.number-button { aspect-ratio: 1; min-width: 0; border-radius: 9px; border: 1px solid rgba(147,190,215,.16); background: rgba(4,17,31,.65); color: #9bb4c9; font-size: 11px; font-weight: 800; }
.number-button.answered { border-color: rgba(73,214,160,.4); color: var(--green); background: rgba(27,113,86,.14); }
.number-button.current { outline: 2px solid var(--cyan); outline-offset: 1px; color: white; }
.number-button:hover { border-color: var(--cyan); }
.result-hero { padding: 28px; text-align: center; background: linear-gradient(140deg, rgba(14, 53, 83, .96), rgba(8, 29, 52, .96)); }
.score-ring { width: 148px; height: 148px; margin: 8px auto 18px; display: grid; place-content: center; border-radius: 50%; background: radial-gradient(circle at center, #0d2a49 57%, transparent 59%), conic-gradient(var(--cyan) var(--score-angle, 0%), rgba(122,164,193,.16) 0); box-shadow: 0 0 35px rgba(45,190,222,.12); }
.score-ring strong { font-size: 37px; letter-spacing: -.05em; }
.score-ring small { color: var(--muted); font-size: 10px; }
.result-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 18px; }
.metric { background: rgba(4,17,31,.48); border: 1px solid var(--line); border-radius: 13px; padding: 13px 8px; }
.metric strong { display: block; font-size: 20px; }
.metric small { color: var(--muted); font-size: 9px; }
.metric.good strong { color: var(--green); }
.metric.bad strong { color: var(--red); }
.metric.blank strong { color: var(--amber); }
.result-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 14px; margin-top: 14px; }
.area-list { display: grid; gap: 13px; }
.area-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
.area-row strong { font-size: 10px; font-weight: 700; }
.area-row span { color: var(--muted); font-size: 10px; }
.area-row .progress-track { grid-column: 1 / -1; height: 5px; }
.review-list { display: grid; gap: 12px; }
.review-item { padding: 16px; border-radius: 15px; border: 1px solid var(--line); background: rgba(4,17,31,.43); }
.review-item.correct { border-left: 3px solid var(--green); }
.review-item.wrong { border-left: 3px solid var(--red); }
.review-item.blank { border-left: 3px solid var(--amber); }
.review-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; }
.review-title strong { color: var(--cyan); font-size: 10px; }
.status-label { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; font-weight: 900; }
.status-label.correct { color: var(--green); }
.status-label.wrong { color: var(--red); }
.status-label.blank { color: var(--amber); }
.review-question { font-size: 13px; line-height: 1.5; margin-bottom: 10px; }
.review-options { display: grid; gap: 6px; }
.review-option { font-size: 11px; color: #9fb6c9; padding: 7px 9px; border-radius: 8px; background: rgba(3,14,26,.38); }
.review-option.is-correct { color: #b8f1d9; background: rgba(29,124,89,.16); }
.review-option.is-selected-wrong { color: #ffd2d4; background: rgba(153,47,59,.16); }
.explanation { font-size: 11px; color: #b8cbd9; line-height: 1.6; border-top: 1px solid var(--line); margin-top: 11px; padding-top: 10px; }
.history-list { display: grid; gap: 10px; }
.history-card { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 15px; border-radius: 14px; border: 1px solid var(--line); background: rgba(4,17,31,.42); }
.history-card strong { display: block; font-size: 12px; }
.history-card small { color: var(--muted); font-size: 10px; display: block; margin-top: 5px; }
.history-score { color: var(--cyan); font-size: 20px; font-weight: 900; }
.instructions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.instruction { border: 1px solid var(--line); border-radius: 14px; background: rgba(4,17,31,.4); padding: 15px; }
.instruction strong { font-size: 12px; display: block; margin-bottom: 7px; color: var(--cyan); }
.instruction p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0; }
.empty-state { text-align: center; padding: 35px 18px; color: var(--muted); }
.empty-state strong { display: block; color: var(--text); margin-bottom: 7px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 25px); opacity: 0; pointer-events: none; z-index: 20; max-width: calc(100% - 32px); padding: 12px 17px; color: #072238; background: #b1eff7; border-radius: 12px; font-size: 12px; font-weight: 800; box-shadow: var(--shadow); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.small-note { color: #7893aa; font-size: 10px; line-height: 1.5; }
@media (max-width: 720px) {
  .topbar { width: calc(100% - 24px); padding-top: 15px; }
  .app-shell { width: calc(100% - 24px); padding-top: 12px; }
  .home-grid, .result-layout { grid-template-columns: 1fr; }
  .hero { border-radius: 21px; }
  .panel { padding: 19px; border-radius: 19px; }
  .exam-top { padding: 14px; }
  .timer { font-size: 18px; }
  .number-grid { grid-template-columns: repeat(10, 1fr); gap: 5px; }
  .number-button { border-radius: 7px; font-size: 10px; }
  .result-metrics { grid-template-columns: repeat(2, 1fr); }
  .footer { flex-direction: column; text-align: center; padding-bottom: 16px; }
  .instructions-grid { grid-template-columns: 1fr; }
}
@media (max-width: 390px) {
  .connection-badge { display: none; }
  .brand-mark { width: 39px; height: 39px; }
  .brand-copy strong { font-size: 10px; }
  .brand-copy small { font-size: 8px; }
  .question-actions .btn { flex: 1; }
  .number-grid { grid-template-columns: repeat(5, 1fr); }
  .question-kicker { align-items: flex-start; flex-direction: column; }
  .area-tag { max-width: 100%; text-align: left; }
}
