:root {
  --navy: #13264d;
  --navy-soft: #4a5a7d;
  --purple: #7755a5;
  --purple-dark: #5f3f8c;
  --purple-soft: #f1ecf8;
  --purple-line: #dccfee;
  --line: #dde2ee;
  --bg-tint: #f7f8fc;
  --danger: #c0392b;
  --danger-soft: #fdeeec;
  --ok: #1f8a5b;
  --ok-soft: #e8f6ef;
  --a: #7755a5;
  --b: #2f7fd0;
  --c: #e08a1e;
  --d: #2e9d6a;
  --shadow: 0 10px 30px rgba(19, 38, 77, 0.08), 0 2px 6px rgba(19, 38, 77, 0.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: var(--navy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.45; overflow-x: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; }
.muted { color: var(--navy-soft); }

/* ---------- Ойыншы беті ---------- */
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 0 12px; }
.top img { height: 30px; width: auto; display: block; }
.net { font-size: 12px; font-weight: 700; color: var(--ok); display: inline-flex; align-items: center; gap: 6px; }
.net::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.net.off { color: var(--danger); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 22px 18px; box-shadow: var(--shadow); }
.screen { flex: 1; display: flex; flex-direction: column; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 6px; font-weight: 800; }
.lead { margin: 0 0 18px; color: var(--navy-soft); }
label { display: block; font-weight: 700; font-size: 15px; margin: 0 0 7px; }
input[type="tel"], input[type="text"] {
  width: 100%; height: 54px; font: inherit; font-size: 17px; color: var(--navy);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--bg-tint);
  outline: none; -webkit-appearance: none; appearance: none;
}
input:focus { border-color: var(--purple); background: #fff; box-shadow: 0 0 0 4px rgba(119,85,165,.14); }
.field { margin-bottom: 16px; }
.err { color: var(--danger); font-size: 14px; margin: 6px 0 0; }
.btn {
  width: 100%; min-height: 56px; border: 0; border-radius: 14px; cursor: pointer;
  font-size: 17px; font-weight: 800; color: #fff; background: linear-gradient(180deg, #8663b5, var(--purple));
  box-shadow: 0 8px 20px rgba(119,85,165,.3);
}
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.ghost { background: #fff; color: var(--purple-dark); border: 1.5px solid var(--purple); box-shadow: none; }
.btn + .btn { margin-top: 10px; }
.pick { display: block; width: 100%; text-align: left; padding: 14px 16px; margin: 0 0 10px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--bg-tint); cursor: pointer; min-height: 56px; color: var(--navy); }
.pick b { display: block; font-size: 17px; }
.pick span { font-size: 14px; color: var(--navy-soft); }
.pick:active { border-color: var(--purple); background: var(--purple-soft); }
.center { text-align: center; }
.big-emoji { font-size: 44px; line-height: 1; margin: 6px 0 12px; }
.wait-dot { width: 64px; height: 64px; border-radius: 50%; margin: 10px auto 16px; background: var(--purple-soft);
  display: flex; align-items: center; justify-content: center; }
.wait-dot::after { content: ""; width: 22px; height: 22px; border-radius: 50%; background: var(--purple); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(.7); opacity: .6; } 50% { transform: scale(1); opacity: 1; } }
.note { font-size: 14px; color: var(--navy-soft); background: var(--purple-soft); border-radius: 12px; padding: 10px 12px; margin-top: 16px; }

/* сұрақ */
.qhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-weight: 800; }
.qnum { font-size: 15px; color: var(--purple-dark); }
.qtime { font-variant-numeric: tabular-nums; font-size: 22px; }
.bar { height: 8px; border-radius: 4px; background: #eef1f7; overflow: hidden; margin-bottom: 14px; }
.bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #8f6fbd, var(--purple)); transform-origin: left; }
.qtext { font-size: 20px; font-weight: 800; line-height: 1.3; margin: 0 0 12px; overflow-wrap: anywhere; }
.qphoto { width: 100%; max-height: 34vh; object-fit: contain; border-radius: 14px; background: var(--bg-tint); margin: 0 0 12px; display: block; }
.opts { display: grid; gap: 10px; margin-top: auto; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 10px 14px; border: 0; border-radius: 16px;
  color: #fff; font-size: 18px; font-weight: 800; text-align: left; cursor: pointer; line-height: 1.25; overflow-wrap: anywhere; }
.opt .l { flex: 0 0 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; }
.opt.a { background: var(--a); } .opt.b { background: var(--b); } .opt.c { background: var(--c); } .opt.d { background: var(--d); }
.opt:active { transform: translateY(1px); filter: brightness(.95); }
.opts.locked .opt { opacity: .35; }
.opts.locked .opt.mine { opacity: 1; outline: 4px solid var(--navy); outline-offset: 2px; }
.status { margin-top: 12px; padding: 12px 14px; border-radius: 14px; font-weight: 700; text-align: center; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.wait { background: var(--purple-soft); color: var(--purple-dark); }
.status.bad { background: var(--danger-soft); color: var(--danger); }
.result { text-align: center; }
.result .big { font-size: 30px; font-weight: 900; margin: 6px 0; }
.result .place { font-size: 46px; font-weight: 900; color: var(--purple-dark); line-height: 1; }
.toplist { list-style: none; padding: 0; margin: 14px 0 0; text-align: left; }
.toplist li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.toplist li b { min-width: 24px; color: var(--purple-dark); }
.toplist li span.t { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--navy-soft); }
.foot { text-align: center; font-size: 13px; color: var(--navy-soft); margin-top: 16px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .wait-dot::after { animation: none; } }

/* Танылған оқушы: бір басумен кіру */
#sMe h1 { font-size: 26px; }
.btn.big { font-size: 20px; padding-top: 18px; padding-bottom: 18px; margin-top: 14px; }
