/* Esports HUD look: near-black navy ground, cyan→violet energy accents, chamfered panels. Single dark theme. */
:root {
  color-scheme: dark;
  --bg: #070a14;
  --fill: #0e1528;
  --fill-2: #141e3a;
  --edge: rgba(120, 170, 255, 0.16);
  --ink: #eef4ff;
  --ink-2: #aab6d3;
  --muted: #6f7b99;
  --cyan: #22e4ff;
  --violet: #8b5cff;
  --pink: #ff3d8b;
  --gold: #ffc93c;
  --good: #2bf5a0;
  --bad: #ff4d6d;
  --grad: linear-gradient(100deg, var(--cyan), var(--violet));
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --tech: "Chakra Petch", "Noto Sans TC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(700px 380px at 0% -80px, rgba(34, 228, 255, 0.16), transparent 70%),
    radial-gradient(700px 420px at 100% -40px, rgba(139, 92, 255, 0.20), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
}
/* faint HUD grid, fading out downward */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(120, 170, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 255, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(#000, transparent 75%);
  mask-image: linear-gradient(#000, transparent 75%);
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
p, h1, h2, h3, dl, dd, ol { margin: 0; }
b { font-weight: 700; }
.muted { color: var(--muted); font-size: 14px; }
.num { font-family: var(--tech); font-weight: 700; font-variant-numeric: tabular-nums; }
.kicker { font-family: var(--tech); font-weight: 700; font-size: 12px; letter-spacing: 0.22em; color: var(--cyan); line-height: 1.4; }
kbd { font-family: var(--tech); font-size: 11px; padding: 0 5px; border-radius: 3px; border: 1px solid currentColor; opacity: 0.55; margin-left: 6px; }
@media (hover: none) { kbd { display: none; } }

/* ── Chamfered panels: outer layer = edge colour, ::before = fill ── */
.rank-card, .mode, .panel, .paper, .opt, .feedback, .btn, .icon-btn, .result-hero, .rv-item, .pick-btn, .sp-word, .grade-table {
  --c: 12px;
  position: relative;
  isolation: isolate;
  background: var(--edge-c, var(--edge));
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  border: 0;
}
.rank-card::before, .mode::before, .panel::before, .paper::before, .opt::before, .feedback::before, .btn::before, .icon-btn::before,
.result-hero::before, .rv-item::before, .pick-btn::before, .sp-word::before, .grade-table::before {
  content: ""; position: absolute; inset: 1px; z-index: -1;
  background: var(--fill-c, var(--fill));
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
}

.screen { max-width: 760px; margin: 0 auto; padding: 22px 16px calc(40px + env(safe-area-inset-bottom)); display: grid; gap: 20px; align-content: start; }

/* Skewed display type */
h1 span, .rank-name span, .mode-title, .res-title { display: inline-block; transform: skewX(-7deg); }

/* ── Brand ── */
.brand { display: flex; align-items: center; gap: 14px; padding-top: 8px; }
.logo { width: 60px; height: 60px; flex: none; filter: drop-shadow(0 0 14px rgba(34, 228, 255, 0.45)); }
h1 { font-weight: 900; font-size: clamp(32px, 8vw, 46px); line-height: 1.12; letter-spacing: 0.03em; }
h1 span { background: linear-gradient(100deg, #fff 30%, #9fefff 70%, #c7b3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { color: var(--ink-2); font-size: 14px; }
.brand-sub b { color: var(--gold); }

/* ── Rank card ── */
.rank-card {
  --c: 20px;
  --edge-c: linear-gradient(135deg, rgba(34, 228, 255, 0.7), rgba(139, 92, 255, 0.3) 45%, rgba(255, 61, 139, 0.5));
  --fill-c: linear-gradient(135deg, #111b38 0%, #0c1226 55%, #1a0f33 100%);
}
.rank-main { display: flex; gap: 20px; align-items: center; padding: 22px 22px 18px; }
.emblem { --glow: rgba(160, 180, 210, 0.35); flex: none; width: 104px; height: 104px; filter: drop-shadow(0 0 18px var(--glow)); }
.emblem:has(.t1) { --glow: rgba(43, 245, 160, 0.5); }
.emblem:has(.t2) { --glow: rgba(139, 92, 255, 0.65); }
.emblem:has(.t3) { --glow: rgba(255, 201, 60, 0.6); }
.emblem:has(.t4) { --glow: rgba(255, 61, 139, 0.7); }
.badge {
  --hex: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  position: relative; isolation: isolate;
  width: 100%; height: 100%;
  display: grid; place-items: center;
  clip-path: var(--hex);
  background: radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.45), transparent 50%), var(--tier, linear-gradient(160deg, #c3d0e6, #56657f 60%, #2d374b));
  font-family: var(--tech); font-weight: 700; font-size: 32px; color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.badge::before { content: ""; position: absolute; inset: 10px; z-index: -1; clip-path: var(--hex); background: rgba(5, 8, 20, 0.35); }
.badge.t1 { --tier: linear-gradient(160deg, #8dffd0, #14b87c 55%, #075c3f); }
.badge.t2 { --tier: linear-gradient(160deg, #d6c2ff, #7b4dff 55%, #34168f); }
.badge.t3 { --tier: linear-gradient(160deg, #fff2ad, #ffb81c 50%, #a85800); }
.badge.t4 { --tier: linear-gradient(120deg, #ff3d8b, #ffb347, #22e4ff, #8b5cff, #ff3d8b); background-size: 100% 100%, 300% 300%; animation: legend 6s linear infinite; font-family: var(--sans); font-weight: 900; font-size: 24px; }
@keyframes legend { to { background-position: 0 0, 300% 0; } }
.rank-info { display: grid; gap: 3px; min-width: 0; }
.rank-name { font-weight: 900; font-size: 27px; line-height: 1.3; }
.pips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.pip { width: 18px; height: 18px; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); background: rgba(170, 182, 211, 0.18); }
.pip.on { background: linear-gradient(#ffe38a, var(--gold)); filter: drop-shadow(0 0 6px rgba(255, 201, 60, 0.8)); }
.rank-next { color: var(--ink-2); font-size: 13.5px; }
.rank-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(120, 170, 255, 0.14); background: rgba(5, 8, 20, 0.35); }
.rank-stats > div { padding: 10px 16px 12px; border-right: 1px solid rgba(120, 170, 255, 0.12); display: grid; }
.rank-stats > div:last-child { border-right: 0; }
.rank-stats dt { font-size: 12px; color: var(--muted); }
.rank-stats dd { font-size: 16px; font-weight: 700; }
.rank-stats dd.num, .rank-stats dd .num { font-size: 28px; line-height: 1.15; }
.rank-stats small { font-family: var(--tech); font-size: 13px; font-weight: 700; color: #051018; background: var(--gold); padding: 0 6px; margin-left: 2px; vertical-align: 4px; }
.rank-stats small:empty { display: none; }

/* ── Modes ── */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode {
  --accent: var(--cyan);
  text-align: left; cursor: pointer; display: grid; gap: 6px; align-content: start; padding: 16px 16px 15px;
  --fill-c: linear-gradient(160deg, var(--fill-2), var(--fill) 70%);
  transition: transform 0.12s ease;
}
.mode:hover { --edge-c: color-mix(in srgb, var(--accent) 70%, transparent); }
.mode:active { transform: scale(0.98); }
.mode:focus-visible, .btn:focus-visible, .opt:focus-visible, .icon-btn:focus-visible, .pick-btn:focus-visible { outline: none; --edge-c: var(--cyan); }
.m-survival { --accent: var(--pink); }
.m-speed { --accent: var(--gold); }
.m-revenge { --accent: var(--violet); }
.mode-top { display: flex; align-items: center; gap: 8px; }
.mode-icon { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 60%, transparent)); }
.mode-en { font-family: var(--tech); font-weight: 700; font-size: 11.5px; letter-spacing: 0.2em; color: var(--accent); }
.mode-tag { font-size: 11.5px; font-weight: 700; color: #051018; background: var(--accent); padding: 0 8px; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.mode-title { font-weight: 900; font-size: 22px; line-height: 1.3; }
.mode-desc { color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.mode-best { font-family: var(--tech); font-size: 13px; color: var(--muted); margin-top: 2px; }

.mode-hero {
  grid-column: 1 / -1; padding: 22px 22px 20px; overflow: hidden; --c: 18px;
  --edge-c: linear-gradient(100deg, rgba(34, 228, 255, 0.85), rgba(139, 92, 255, 0.6));
  --fill-c: radial-gradient(420px 220px at 100% 0, rgba(139, 92, 255, 0.32), transparent 70%), radial-gradient(360px 200px at 0 100%, rgba(34, 228, 255, 0.18), transparent 70%), #0d1430;
}
.mode-hero:hover { --edge-c: linear-gradient(100deg, var(--cyan), var(--violet)); }
.mode-hero .mode-title { font-size: 36px; }
.mode-hero .mode-desc { max-width: 30em; }
.mode-art { position: absolute; right: -8px; top: 50%; width: 170px; height: 170px; transform: translateY(-50%); fill: none; stroke: rgba(34, 228, 255, 0.14); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.mode-go {
  justify-self: start; margin-top: 8px; padding: 9px 30px 9px 22px;
  font-weight: 900; font-size: 17px; letter-spacing: 0.08em; color: #051018;
  background: var(--grad);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  box-shadow: 0 0 24px rgba(34, 228, 255, 0.5);
}
.mode-go::after { content: " ▶"; font-size: 13px; }

/* ── Panels ── */
.panel { padding: 20px; display: grid; gap: 14px; --c: 16px; }
.panel-head { display: grid; gap: 2px; }
h2 { font-weight: 900; font-size: 21px; line-height: 1.35; }
.note { color: var(--ink-2); font-size: 14px; }

.skills { display: grid; gap: 11px; }
.skill { display: grid; grid-template-columns: 5.5em 1fr 4.4em; gap: 10px; align-items: center; font-size: 14px; }
.skill-name { color: var(--ink-2); white-space: nowrap; }
.skill.weak .skill-name { color: var(--pink); font-weight: 700; }
.skill-track { height: 10px; background: rgba(120, 170, 255, 0.1); overflow: hidden; -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 8px, transparent 8px 10px); mask-image: repeating-linear-gradient(90deg, #000 0 8px, transparent 8px 10px); }
.skill-fill { display: block; height: 100%; background: var(--grad); transition: width 0.4s ease; }
.skill.weak .skill-fill { background: linear-gradient(90deg, #ff7a59, var(--pink)); }
.skill-val { text-align: right; font-family: var(--tech); font-weight: 700; font-size: 16px; }
.skill-val small { font-family: var(--sans); font-weight: 400; font-size: 11px; color: var(--muted); margin-left: 2px; }

.grade-table { --c: 10px; --fill-c: #0a0f1e; }
.gt-row { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 7px 16px; border-top: 1px solid rgba(120, 170, 255, 0.1); font-size: 15px; }
.gt-row:first-child { border-top: 0; }
.gt-head { font-size: 12px; color: var(--muted); }
.gt-row.top { background: linear-gradient(90deg, rgba(255, 201, 60, 0.22), rgba(255, 201, 60, 0.03)); color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.gt-row.dim { color: var(--muted); }
.gt-row .num { font-size: 18px; }

.foot { color: var(--muted); font-size: 12.5px; display: grid; gap: 4px; padding: 0 2px; }
.linklike { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 12.5px; margin-left: 6px; }

/* ── Top bar ── */
.bar { display: flex; align-items: center; gap: 12px; min-height: 42px; }
.bar-title { font-weight: 900; font-size: 17px; }
.bar-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.icon-btn { --c: 8px; width: 42px; height: 42px; cursor: pointer; font-size: 17px; display: grid; place-items: center; }
.icon-btn:hover { --edge-c: rgba(34, 228, 255, 0.6); }
.progress-txt { font-size: 19px; color: var(--ink-2); }
.lives { letter-spacing: 2px; font-size: 17px; color: var(--pink); text-shadow: 0 0 8px rgba(255, 61, 139, 0.6); }
.combo { font-family: var(--tech); font-weight: 700; font-style: italic; color: var(--gold); font-size: 17px; text-shadow: 0 0 10px rgba(255, 201, 60, 0.6); }
.combo.pop { animation: pop 0.3s ease; }
@keyframes pop { 50% { transform: scale(1.4); } }
.progress {
  height: 8px; margin-top: -10px; background: rgba(120, 170, 255, 0.12); overflow: hidden;
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 17px);
  mask-image: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 17px);
}
.progress-fill { height: 100%; width: 0; background: var(--grad); transition: width 0.3s ease; }
.progress.time .progress-fill { background: linear-gradient(90deg, var(--gold), #ffe38a); transition: width 0.1s linear; }
.progress.time .progress-fill.low { background: linear-gradient(90deg, var(--bad), var(--pink)); }

/* ── Question card ── */
.paper {
  --c: 18px; padding: 22px 20px 20px; display: grid; gap: 14px;
  --edge-c: linear-gradient(135deg, rgba(34, 228, 255, 0.55), rgba(139, 92, 255, 0.2) 50%, rgba(120, 170, 255, 0.12));
  --fill-c: linear-gradient(180deg, #111a35, #0c1328);
}
.q-cat { display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 700; color: var(--cyan); letter-spacing: 0.08em; }
.q-cat::before { content: ""; width: 8px; height: 8px; background: var(--cyan); transform: rotate(45deg); box-shadow: 0 0 8px var(--cyan); }
.lv { display: inline-flex; gap: 3px; align-items: flex-end; height: 14px; }
.lv i { width: 4px; background: rgba(170, 182, 211, 0.22); }
.lv i:nth-child(1) { height: 6px; }
.lv i:nth-child(2) { height: 10px; }
.lv i:nth-child(3) { height: 14px; }
.lv1 i:nth-child(-n+1), .lv2 i:nth-child(-n+2) { background: var(--gold); }
.lv3 i { background: var(--pink); box-shadow: 0 0 6px rgba(255, 61, 139, 0.7); }
.passage { margin: 0; padding: 12px 15px; background: rgba(34, 228, 255, 0.06); box-shadow: inset 3px 0 0 var(--cyan); color: #dbe4f7; font-size: 16.5px; line-height: 1.95; white-space: pre-line; }
.q-text { font-weight: 700; font-size: 19px; line-height: 1.7; }
.options { list-style: none; padding: 0; display: grid; gap: 10px; }
.opt {
  --c: 10px; width: 100%; text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start;
  padding: 12px 14px; font-size: 16.5px; font-weight: 500; line-height: 1.65;
  --edge-c: rgba(120, 170, 255, 0.2); --fill-c: #121b36;
}
.opt:hover:not(:disabled) { --edge-c: rgba(34, 228, 255, 0.75); --fill-c: #162448; }
.opt:disabled { cursor: default; }
.opt-key {
  width: 28px; height: 28px; margin-top: 1px; display: grid; place-items: center;
  font-family: var(--tech); font-weight: 700; font-size: 15px; color: var(--cyan);
  background: rgba(34, 228, 255, 0.12);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.opt.right { --edge-c: var(--good); --fill-c: linear-gradient(90deg, rgba(43, 245, 160, 0.26), rgba(43, 245, 160, 0.06)), #0d1a2a; }
.opt.right .opt-key { background: var(--good); color: #04140d; }
.opt.wrong { --edge-c: var(--bad); --fill-c: linear-gradient(90deg, rgba(255, 77, 109, 0.26), rgba(255, 77, 109, 0.06)), #1a1024; }
.opt.wrong .opt-key { background: var(--bad); color: #1a0308; }
.opt.faded { opacity: 0.45; }
.paper.shake { animation: shake 0.35s ease; }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* ── Feedback ── */
.feedback { --c: 14px; padding: 16px 18px; display: grid; gap: 10px; animation: rise 0.2s ease; }
.feedback:has(.ok) { --edge-c: linear-gradient(90deg, var(--good), rgba(43, 245, 160, 0.15)); }
.feedback:has(.no) { --edge-c: linear-gradient(90deg, var(--bad), rgba(255, 77, 109, 0.15)); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.fb-verdict { font-weight: 900; font-size: 18px; }
.fb-verdict.ok { color: var(--good); }
.fb-verdict.no { color: var(--bad); }
.fb-exp { color: var(--ink-2); font-size: 15px; line-height: 1.8; }

/* ── Buttons ── */
.btn { --c: 10px; cursor: pointer; padding: 13px 22px; font-weight: 900; font-size: 16px; letter-spacing: 0.04em; display: inline-flex; justify-content: center; align-items: center; gap: 4px; }
.btn.primary { --edge-c: transparent; --fill-c: var(--grad); color: #051018; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { --edge-c: rgba(120, 170, 255, 0.3); }
.btn.ghost:hover { --edge-c: rgba(34, 228, 255, 0.7); }

/* ── Result ── */
.result-hero {
  --c: 22px; text-align: center; display: grid; gap: 4px; justify-items: center; padding: 26px 16px 24px; overflow: hidden;
  --edge-c: linear-gradient(180deg, rgba(34, 228, 255, 0.6), rgba(139, 92, 255, 0.25));
  --fill-c: radial-gradient(480px 260px at 50% 0, rgba(34, 228, 255, 0.2), transparent 70%), repeating-conic-gradient(from 0deg at 50% -10%, rgba(139, 92, 255, 0.07) 0 6deg, transparent 6deg 14deg), #0c1330;
}
.result-hero:has(.res-title.lose) {
  --edge-c: linear-gradient(180deg, rgba(255, 77, 109, 0.6), rgba(139, 92, 255, 0.2));
  --fill-c: radial-gradient(480px 260px at 50% 0, rgba(255, 77, 109, 0.18), transparent 70%), #120d24;
}
.res-kicker {
  font-family: var(--tech); font-style: italic; font-weight: 700; font-size: clamp(42px, 13vw, 80px); line-height: 1.05; letter-spacing: 0.06em;
  background: linear-gradient(100deg, #fff, var(--cyan) 45%, var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(34, 228, 255, 0.45));
  animation: slam 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
}
.result-hero:has(.res-title.lose) .res-kicker { background-image: linear-gradient(100deg, #ffd0d8, var(--bad) 50%, var(--pink)); filter: drop-shadow(0 0 18px rgba(255, 77, 109, 0.45)); }
@keyframes slam { from { opacity: 0; transform: scale(1.6); } }
.res-title { font-weight: 900; font-size: 24px; letter-spacing: 0.12em; color: var(--ink); }
.res-score { margin-top: 6px; }
.res-score .num { font-size: 66px; line-height: 1; }
.res-of { font-family: var(--tech); font-size: 26px; color: var(--muted); margin-left: 4px; }
.res-proj { color: var(--ink-2); }
.res-proj b { color: var(--gold); }
.res-combo { display: block; font-family: var(--tech); font-style: italic; font-weight: 700; color: var(--gold); }
.res-stars { display: flex; gap: 6px; min-height: 30px; align-items: center; }
.res-stars .pip { width: 26px; height: 26px; animation: starIn 0.4s ease backwards; }
.res-stars .pip:nth-child(2) { animation-delay: 0.12s; }
.res-stars .pip:nth-child(3) { animation-delay: 0.24s; }
.res-stars .pip.lost { background: var(--bad); filter: drop-shadow(0 0 6px rgba(255, 77, 109, 0.8)); }
@keyframes starIn { from { transform: scale(0) rotate(-120deg); } }
.res-rank { font-weight: 700; color: var(--ink-2); }
.res-rank.up { color: var(--gold); font-size: 19px; text-shadow: 0 0 12px rgba(255, 201, 60, 0.5); }
.res-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.review { display: grid; gap: 12px; }
.review h3 { font-weight: 900; font-size: 19px; }
.rv-item { --c: 10px; padding: 14px 16px; display: grid; gap: 6px; font-size: 14.5px; --edge-c: linear-gradient(90deg, rgba(255, 77, 109, 0.55), rgba(120, 170, 255, 0.12) 40%); }
.rv-q { font-weight: 700; font-size: 15.5px; }
.rv-ans { color: var(--good); }
.rv-mine { color: var(--bad); }
.rv-exp { color: var(--ink-2); }
.rv-perfect { text-align: center; color: var(--ink-2); padding: 10px; }

/* ── Pick ── */
.pick-intro { margin-top: -8px; }
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick-btn { --c: 12px; text-align: left; cursor: pointer; padding: 16px; display: grid; gap: 2px; --fill-c: linear-gradient(160deg, var(--fill-2), var(--fill) 70%); }
.pick-btn:hover { --edge-c: rgba(34, 228, 255, 0.7); }
.pick-btn b { font-weight: 900; font-size: 20px; }
.pick-btn span { font-family: var(--tech); color: var(--muted); font-size: 13px; }
.pick-btn.weak { --edge-c: rgba(255, 61, 139, 0.75); }
.pick-btn.weak span { color: var(--pink); }

/* ── Speed ── */
.sp-stage { min-height: 46vh; display: grid; place-items: center; align-content: center; gap: 16px; text-align: center; }
.sp-hint { font-family: var(--tech); }
.sp-word {
  --c: 18px; font-weight: 900; font-size: clamp(46px, 15vw, 86px); letter-spacing: 0.08em; line-height: 1.2; padding: 20px 28px;
  --edge-c: linear-gradient(135deg, var(--cyan), var(--violet)); --fill-c: #0e1530;
}
.sp-word.ok { --edge-c: var(--good); --fill-c: linear-gradient(180deg, rgba(43, 245, 160, 0.25), transparent), #0e1530; }
.sp-word.no { --edge-c: var(--bad); --fill-c: linear-gradient(180deg, rgba(255, 77, 109, 0.25), transparent), #0e1530; animation: shake 0.35s ease; }
.sp-fix { min-height: 1.7em; color: var(--ink-2); font-size: 16px; }
.sp-fix b { color: var(--good); font-size: 21px; }
.sp-score { font-size: 28px; min-width: 2.5em; text-align: right; color: var(--cyan); text-shadow: 0 0 12px rgba(34, 228, 255, 0.5); }
.sp-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sp-btn { --c: 16px; padding: 24px 12px; font-size: 21px; }
.sp-btn.ok { --edge-c: var(--good); --fill-c: linear-gradient(180deg, rgba(43, 245, 160, 0.2), rgba(43, 245, 160, 0.05)), var(--bg); color: var(--good); }
.sp-btn.bad { --edge-c: var(--bad); --fill-c: linear-gradient(180deg, rgba(255, 77, 109, 0.2), rgba(255, 77, 109, 0.05)), var(--bg); color: var(--bad); }
.sp-btn:active { transform: scale(0.97); }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10;
  background: var(--grad); color: #051018; font-weight: 900; padding: 10px 26px; width: max-content; max-width: calc(100vw - 32px); text-align: center;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  animation: rise 0.2s ease;
}

@media (max-width: 520px) {
  .modes { grid-template-columns: 1fr; }
  .rank-main { padding: 18px 16px 14px; gap: 14px; }
  .emblem { width: 84px; height: 84px; }
  .badge { font-size: 27px; }
  .badge.t4 { font-size: 20px; }
  .rank-name { font-size: 23px; }
  .rank-stats > div { padding: 8px 10px 10px; }
  .rank-stats dd.num, .rank-stats dd .num { font-size: 23px; }
  .mode-hero .mode-title { font-size: 32px; }
  .mode-art { width: 130px; height: 130px; right: -18px; }
  .paper { padding: 18px 15px 16px; }
  .q-text { font-size: 18px; }
  .opt { font-size: 16px; padding: 11px 12px; }
  .pick-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
