/* Neonspeed — self-contained design system. No webfonts, no CDN, no inline CSS. */

:root {
  color-scheme: dark;
  --bg: #06060a;
  --bg-2: #0b0b13;
  --bg-3: #101019;
  --panel: rgba(17, 17, 27, 0.78);
  --panel-solid: #12121c;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #ececf5;
  --muted: #9a9ab2;
  --faint: #6a6a82;
  --cyan: #2ae7ff;
  --cyan-dim: rgba(42, 231, 255, 0.16);
  --magenta: #ff3ea5;
  --magenta-dim: rgba(255, 62, 165, 0.16);
  --lime: #b6ff44;
  --amber: #ffc857;
  --danger: #ff5a72;
  --ok: #58f0a8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --header-h: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(42, 231, 255, 0.10), transparent 60%),
    radial-gradient(760px 480px at 92% 4%, rgba(255, 62, 165, 0.09), transparent 62%),
    radial-gradient(700px 700px at 50% 110%, rgba(182, 255, 68, 0.05), transparent 65%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 20%, rgba(0, 0, 0, 0.85), transparent 78%);
  z-index: 0;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 0.6rem;
  font-weight: 750;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
small { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

::selection { background: rgba(42, 231, 255, 0.28); color: #fff; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--cyan);
  color: #041014;
  padding: 0.6rem 1rem;
  font-weight: 700;
  border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

.wrap { width: min(1120px, calc(100% - 2.5rem)); margin-inline: auto; position: relative; z-index: 1; }
.wrap-narrow { width: min(760px, calc(100% - 2.5rem)); margin-inline: auto; position: relative; z-index: 1; }

/* ------------------------------------------------------------------ header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(6, 6, 10, 0.72);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 0.92rem;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: conic-gradient(from 210deg, var(--cyan), var(--magenta), var(--lime), var(--cyan));
  box-shadow: 0 0 18px rgba(42, 231, 255, 0.45);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 5px;
  background: var(--bg);
}
.brand em { color: var(--cyan); font-style: normal; }

.nav { display: flex; align-items: center; gap: 0.25rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted);
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  font-size: 0.92rem;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: rgba(42, 231, 255, 0.12); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.who { color: var(--muted); font-size: 0.9rem; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.inline-form { display: inline; margin: 0; }

/* ------------------------------------------------------------------ buttons */
.btn {
  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.34); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-primary {
  --btn-fg: #041014;
  background: linear-gradient(135deg, var(--cyan), #7af7ff 55%, var(--lime));
  border-color: transparent;
  box-shadow: 0 8px 30px rgba(42, 231, 255, 0.28);
}
.btn-primary:hover { box-shadow: 0 10px 38px rgba(42, 231, 255, 0.4); }
.btn-hot {
  --btn-fg: #16030c;
  background: linear-gradient(135deg, var(--magenta), #ff7abf);
  border-color: transparent;
  box-shadow: 0 8px 30px rgba(255, 62, 165, 0.26);
}
.btn-ghost { background: transparent; }
.btn-sm { min-height: 34px; padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-danger { --btn-fg: #1a0409; background: var(--danger); border-color: transparent; }
.btn-link {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
}
.btn-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

/* ------------------------------------------------------------------ layout */
main { padding: 2.5rem 0 4rem; position: relative; z-index: 1; }
.section { margin: 3.5rem 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan);
  margin: 0 0 0.7rem;
}
.lede { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.center { text-align: center; }
.between { justify-content: space-between; }
.mt-1 { margin-top: 0.9rem; }
.mt-2 { margin-top: 1.25rem; }
.checklist { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.checklist li { margin-bottom: 0.4rem; }
.checklist li::marker { color: var(--cyan); }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.row-end { justify-content: flex-end; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; padding: 2.5rem 0 1rem; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 2.5rem; align-items: center; }
.hero h1 span {
  background: linear-gradient(100deg, var(--cyan), #8df8ff 35%, var(--magenta) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(42, 231, 255, 0.25));
}
.hero .lede { font-size: 1.16rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-note { margin-top: 1rem; font-size: 0.9rem; color: var(--faint); }

.hero-card {
  position: relative;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(22, 22, 34, 0.95), rgba(10, 10, 17, 0.95));
  box-shadow: var(--shadow);
  padding: 1.35rem;
  overflow: hidden;
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 62, 165, 0.18), transparent 68%);
  pointer-events: none;
}
.hero-card .mini-label { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.14em; }
.hero-card .mini-phrase { font-family: var(--mono); font-size: 1.05rem; line-height: 1.8; margin: 1rem 0 1.2rem; color: #d7d7e6; }
.hero-card .mini-phrase b { color: var(--cyan); font-weight: 500; }
.hero-card .mini-phrase i { color: var(--magenta); font-style: normal; background: var(--magenta-dim); border-radius: 3px; }
.caret {
  display: inline-block;
  width: 2px;
  height: 1.08em;
  vertical-align: -0.16em;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ------------------------------------------------------------------ panels + cards */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.panel-tight { padding: 1.1rem; }
.card {
  background: linear-gradient(170deg, rgba(20, 20, 31, 0.9), rgba(12, 12, 20, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--line-strong); }
.card h3 { margin-bottom: 0.35rem; }
.card .card-foot { margin-top: 0.9rem; font-size: 0.85rem; color: var(--faint); }
.card-hot { border-color: rgba(255, 62, 165, 0.3); box-shadow: 0 0 0 1px rgba(255, 62, 165, 0.08) inset; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; }
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.025);
}
.stat b { display: block; font-size: 1.55rem; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.stat span { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--faint); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}
.badge-cyan { color: var(--cyan); border-color: rgba(42, 231, 255, 0.4); background: var(--cyan-dim); }
.badge-hot { color: var(--magenta); border-color: rgba(255, 62, 165, 0.4); background: var(--magenta-dim); }
.badge-ok { color: var(--ok); border-color: rgba(88, 240, 168, 0.4); background: rgba(88, 240, 168, 0.1); }
.badge-warn { color: var(--amber); border-color: rgba(255, 200, 87, 0.4); background: rgba(255, 200, 87, 0.1); }
.badge-danger { color: var(--danger); border-color: rgba(255, 90, 114, 0.45); background: rgba(255, 90, 114, 0.1); }

/* ------------------------------------------------------------------ forms */
.field { margin-bottom: 1rem; }
.field > label, .label {
  display: block;
  font-size: 0.85rem;
  font-weight: 650;
  margin-bottom: 0.35rem;
  color: #c9c9da;
}
.hint { display: block; font-size: 0.8rem; color: var(--faint); margin-top: 0.3rem; }
input[type="text"], input[type="password"], input[type="email"], textarea, select {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  padding: 0.65rem 0.8rem;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(42, 231, 255, 0.16);
}
textarea { resize: vertical; min-height: 9rem; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem 0.4rem; margin: 0 0 1rem; }
legend { padding: 0 0.4rem; font-size: 0.85rem; color: var(--muted); font-weight: 650; }
.radio-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin-bottom: 0.7rem; }
.radio-card {
  display: flex;
  gap: 0.55rem;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}
.radio-card:hover { border-color: var(--line-strong); }
.radio-card input { margin-top: 0.25rem; accent-color: var(--cyan); }
.radio-card b { display: block; font-size: 0.9rem; }
.radio-card span { font-size: 0.78rem; color: var(--faint); }
.radio-card:has(input:checked) { border-color: var(--cyan); background: var(--cyan-dim); }

.alert {
  border-radius: 10px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.alert p:last-child { margin-bottom: 0; }
.alert-error { border-color: rgba(255, 90, 114, 0.5); background: rgba(255, 90, 114, 0.09); }
.alert-ok { border-color: rgba(88, 240, 168, 0.45); background: rgba(88, 240, 168, 0.08); }
.alert-warn { border-color: rgba(255, 200, 87, 0.45); background: rgba(255, 200, 87, 0.08); }
.alert-info { border-color: rgba(42, 231, 255, 0.35); background: rgba(42, 231, 255, 0.07); }

.honeypot { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.check-line { display: flex; gap: 0.55rem; align-items: start; margin-top: 0.8rem; font-size: 0.9rem; color: var(--muted); }
.check-line input { margin-top: 0.25rem; accent-color: var(--cyan); }

.credential-list, .friend-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.credential-list li, .friend-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  background: rgba(255, 255, 255, 0.02);
}
.credential-list li > div { display: grid; gap: 0.15rem; }
.credential-list li .faint { font-size: 0.8rem; }
.friend-list li form { margin: 0; }

code {
  font-family: var(--mono);
  font-size: 0.85em;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.05rem 0.3rem;
  background: rgba(255, 255, 255, 0.05);
  color: #d9f6ff;
}

.game-title { font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin-bottom: 0.15rem; }

/* ------------------------------------------------------------------ share box */
.share-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; background: rgba(255, 255, 255, 0.025); }
.share-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.share-row input { flex: 1 1 240px; font-family: var(--mono); font-size: 0.85rem; }
.share-qr-wrap { display: flex; gap: 1rem; align-items: center; margin-top: 0.9rem; flex-wrap: wrap; }
.share-qr { width: 132px; height: 132px; background: #fff; border-radius: 10px; padding: 8px; flex: 0 0 auto; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(10, 10, 17, 0.55); }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
thead th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  white-space: nowrap;
}
tbody td { padding: 0.72rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.rank { font-family: var(--mono); color: var(--faint); font-variant-numeric: tabular-nums; }
.rank-1 { color: var(--amber); text-shadow: 0 0 16px rgba(255, 200, 87, 0.5); }
.rank-2 { color: #cfd6e6; }
.rank-3 { color: #d59a6a; }
.wpm { font-family: var(--mono); font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.wpm small { font-size: 0.7rem; color: var(--faint); font-weight: 500; margin-left: 0.25rem; }
.you td { background: rgba(42, 231, 255, 0.06); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ game */
.game-shell { display: grid; gap: 1.25rem; }
.game-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.game-hud { display: flex; gap: 1.6rem; align-items: baseline; }
.hud-item { min-width: 76px; }
.hud-item b { display: block; font-family: var(--mono); font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.hud-item span { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.hud-item.accent b { color: var(--cyan); }
.hud-item.bad b { color: var(--danger); }

.mode-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.mode-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.mode-tab:hover { border-color: var(--line-strong); color: var(--text); }
.mode-tab[aria-pressed="true"] { background: var(--cyan-dim); border-color: rgba(42, 231, 255, 0.5); color: var(--cyan); }

.type-stage {
  position: relative;
  padding: 1.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 240px at 0% 0%, rgba(42, 231, 255, 0.06), transparent 60%),
    rgba(8, 8, 14, 0.72);
  min-height: 190px;
  cursor: text;
}
.type-stage:focus-within { border-color: rgba(42, 231, 255, 0.5); box-shadow: 0 0 0 3px rgba(42, 231, 255, 0.1); }
.phrase {
  font-family: var(--mono);
  font-size: clamp(1.25rem, 2.5vw, 1.7rem);
  line-height: 1.85;
  letter-spacing: 0.01em;
  color: #5d5d75;
  word-break: break-word;
  user-select: none;
}
.phrase .ok { color: #e9fbff; }
.phrase .bad { color: var(--danger); background: rgba(255, 90, 114, 0.16); border-radius: 3px; }
.phrase .cur { color: var(--text); }
.phrase .pending { color: #5d5d75; }
.type-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 1.6rem;
  font-size: 16px;
  resize: none;
  cursor: text;
  background: transparent;
  color: transparent;
  caret-color: transparent;
}
.type-input:focus { outline: none; box-shadow: none; }
.ghost-hint {
  position: absolute;
  right: 1rem;
  bottom: 0.7rem;
  font-size: 0.74rem;
  color: var(--faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}
.type-stage.is-running .ghost-hint { opacity: 0; }
.type-stage.is-done .phrase { opacity: 0.75; }

.game-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; color: var(--faint); font-size: 0.85rem; }
kbd {
  font-family: var(--mono);
  font-size: 0.74rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.1rem 0.35rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.result {
  border-radius: var(--radius);
  border: 1px solid rgba(42, 231, 255, 0.35);
  background: linear-gradient(150deg, rgba(42, 231, 255, 0.08), rgba(255, 62, 165, 0.05));
  padding: 1.4rem;
}
.result-head { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.result-wpm { font-family: var(--mono); font-size: clamp(2.6rem, 7vw, 4.2rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--cyan); text-shadow: 0 0 34px rgba(42, 231, 255, 0.35); }
.result-wpm small { font-size: 0.9rem; letter-spacing: 0.14em; color: var(--muted); text-shadow: none; margin-left: 0.35rem; }
.result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.result-grid .stat b { font-size: 1.2rem; }
.result-actions { margin-top: 1.1rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }

dialog {
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(170deg, #14141f, #0a0a11);
  color: var(--text);
  padding: 0;
  width: min(480px, calc(100% - 2rem));
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(3, 3, 8, 0.72); backdrop-filter: blur(4px); }
.dialog-body { padding: 1.6rem; }
.dialog-body h2 { margin-bottom: 0.5rem; }
.dialog-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.2rem; }

/* ------------------------------------------------------------------ key + code display */
.key-box {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  word-break: break-all;
  border: 1px dashed rgba(255, 200, 87, 0.5);
  background: rgba(255, 200, 87, 0.07);
  border-radius: 10px;
  padding: 0.8rem;
  margin: 0.6rem 0;
  color: #ffe3a3;
  user-select: all;
}
.code-chip {
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  user-select: all;
}

/* ------------------------------------------------------------------ misc */
.pill-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pill-row a, .pill-row button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}
.pill-row a[aria-current="page"], .pill-row button[aria-pressed="true"] {
  border-color: rgba(42, 231, 255, 0.5);
  background: var(--cyan-dim);
  color: var(--cyan);
}
.pill-row a:hover, .pill-row button:hover { color: var(--text); text-decoration: none; }

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

.steps { counter-reset: step; display: grid; gap: 1rem; }
.step { display: grid; grid-template-columns: 2.2rem 1fr; gap: 0.9rem; align-items: start; }
.step::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid rgba(42, 231, 255, 0.45);
  color: var(--cyan);
  font-family: var(--mono);
  font-weight: 700;
}
.step h3 { margin-bottom: 0.15rem; font-size: 1rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.offline-banner {
  background: var(--amber);
  color: #221700;
  text-align: center;
  padding: 0.5rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
}
.offline-banner[hidden] { display: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 20px);
  background: #0c0c14;
  border: 1px solid rgba(42, 231, 255, 0.5);
  color: var(--text);
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
  margin-top: 3rem;
  color: var(--faint);
  font-size: 0.88rem;
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.footer-grid h4 { color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 0.6rem; }
.footer-grid a { color: var(--muted); display: block; padding: 0.16rem 0; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.82rem; }
.footer-blurb { margin-top: 0.8rem; max-width: 32ch; }
.footer-grid > div:last-child .muted { display: block; padding: 0.16rem 0; }

/* ------------------------------------------------------------------ admin */
.admin-body .site-header { border-bottom-color: rgba(255, 200, 87, 0.25); }
.admin-body .brand-mark { background: conic-gradient(from 210deg, var(--amber), var(--danger), var(--amber)); box-shadow: 0 0 18px rgba(255, 200, 87, 0.4); }
.admin-nav a[aria-current="page"] { color: var(--amber); background: rgba(255, 200, 87, 0.12); }
.admin-grid { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; }
.admin-side { position: sticky; top: calc(var(--header-h) + 1rem); }
.admin-side a { display: block; padding: 0.5rem 0.7rem; border-radius: 8px; color: var(--muted); font-size: 0.92rem; }
.admin-side a:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); text-decoration: none; }
.admin-side a[aria-current="page"] { background: rgba(255, 200, 87, 0.12); color: var(--amber); }
.feedback-item { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin-bottom: 0.8rem; background: rgba(255, 255, 255, 0.02); }
.feedback-item header { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.4rem; }
.feedback-item h3 { margin: 0; font-size: 1rem; }
.feedback-body { white-space: pre-wrap; color: var(--muted); font-size: 0.92rem; margin: 0.5rem 0 0.8rem; }
.feedback-meta { font-size: 0.78rem; color: var(--faint); font-family: var(--mono); }
.feedback-controls { display: flex; gap: 0.6rem; align-items: end; flex-wrap: wrap; }
.feedback-controls .field { margin: 0; flex: 1 1 220px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-3, .grid-4, .stats, .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-side { position: static; display: flex; gap: 0.3rem; overflow-x: auto; }
  .admin-side a { white-space: nowrap; }
}
@media (max-width: 620px) {
  .site-header .wrap { flex-wrap: wrap; padding-block: 0.5rem; gap: 0.5rem 0.75rem; }
  .nav { order: 3; flex-basis: 100%; }
  .header-actions { margin-left: auto; }
  .grid-2, .grid-3, .grid-4, .stats, .footer-grid, .radio-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-hud { gap: 1rem; }
  .hud-item b { font-size: 1.5rem; }
  h1 { font-size: 2.15rem; }
  main { padding-top: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .hero-actions, .game-shell, .share-box { display: none; }
  body { background: #fff; color: #000; }
}
