/* ============================================================
   Hgame Pro Version — Design System
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #070812;
  --bg-2: #0b0d1d;
  --bg-3: #10132a;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.075);
  --elev: #12152c;
  --text: #f2f2ff;
  --muted: #9aa0bd;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 92, 246, 0.16);
  --accent-glow: rgba(139, 92, 246, 0.45);
  --good: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  --shadow-soft: 0 10px 30px -18px rgba(0, 0, 0, 0.6);
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

[data-accent="cyan"]   { --accent: #22d3ee; --accent-2: #38bdf8; --accent-soft: rgba(34, 211, 238, 0.16); --accent-glow: rgba(34, 211, 238, 0.45); }
[data-accent="lime"]   { --accent: #a3e635; --accent-2: #34d399; --accent-soft: rgba(163, 230, 53, 0.16); --accent-glow: rgba(163, 230, 53, 0.4); }
[data-accent="orange"] { --accent: #fb923c; --accent-2: #f472b6; --accent-soft: rgba(251, 146, 60, 0.16); --accent-glow: rgba(251, 146, 60, 0.42); }
[data-accent="pink"]   { --accent: #f472b6; --accent-2: #a78bfa; --accent-soft: rgba(244, 114, 182, 0.16); --accent-glow: rgba(244, 114, 182, 0.42); }

[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4fb;
  --bg-2: #e9ebf7;
  --bg-3: #ffffff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-2: rgba(255, 255, 255, 0.95);
  --elev: #ffffff;
  --text: #15172b;
  --muted: #5d6285;
  --line: rgba(20, 22, 50, 0.1);
  --line-strong: rgba(20, 22, 50, 0.18);
  --accent-soft: rgba(139, 92, 246, 0.12);
  --shadow: 0 24px 50px -28px rgba(38, 30, 90, 0.35);
  --shadow-soft: 0 10px 24px -16px rgba(38, 30, 90, 0.28);
}

[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, a, .game-card, .chip, .icon-btn, .avatar-opt {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 12% -8%, var(--accent-soft), transparent 60%),
    radial-gradient(800px 600px at 92% 6%, rgba(34, 211, 238, 0.1), transparent 58%),
    radial-gradient(1000px 700px at 50% 110%, rgba(139, 92, 246, 0.1), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

[data-theme="light"] body::before {
  background:
    radial-gradient(900px 600px at 10% -8%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(800px 600px at 92% 4%, rgba(34, 211, 238, 0.16), transparent 58%),
    linear-gradient(180deg, #f7f8ff 0%, #eceefb 100%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--accent-glow); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout ---------- */

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(16px, 4vw, 42px);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; filter: drop-shadow(0 6px 16px var(--accent-glow)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text strong { font-size: 18px; letter-spacing: 0.2px; font-weight: 800; }
.brand-text strong em {
  font-style: normal;
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-text small { font-size: 10.5px; color: var(--muted); letter-spacing: 1.4px; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a {
  position: relative;
  padding: 9px 14px;
  border-radius: 11px;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: var(--text); background: var(--accent-soft); }
.nav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 16px;
  transition: transform 0.15s, background 0.18s, border-color 0.18s;
}
.icon-btn:hover { background: var(--panel-2); border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.96); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 0.18s, background 0.18s;
}
.user-chip:hover { border-color: var(--line-strong); background: var(--panel-2); }
.user-chip .avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; background: var(--accent-soft); }
.user-chip .meta { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.user-chip .meta b { font-size: 13px; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .meta small { font-size: 10.5px; color: var(--muted); }

.view {
  flex: 1;
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 42px) 60px;
  outline: none;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 22px 20px 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
.footer .dot { opacity: 0.5; }

/* ---------- Mobile bottom navigation ---------- */

.bottom-nav { display: none; }

/* ---------- Atoms ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-2) 55%, var(--accent)));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 24px -14px var(--accent-glow);
  transition: transform 0.15s, filter 0.18s, box-shadow 0.18s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 14px 28px -14px var(--accent-glow); }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: var(--panel); border-color: var(--line); color: var(--text); box-shadow: none; }
.btn.ghost:hover { border-color: var(--line-strong); background: var(--panel-2); filter: none; }
.btn.small { padding: 7px 13px; font-size: 12.5px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  transition: all 0.16s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }

.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.input::placeholder { color: var(--muted); opacity: 0.8; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: 0.3px; }

.muted { color: var(--muted); }
.hl { color: var(--accent-2); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.mono { font-family: var(--mono); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 34px 0 16px; }
.section-head h2 { font-size: 20px; letter-spacing: 0.2px; }
.section-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: clamp(24px, 3.6vw, 34px); letter-spacing: -0.4px; }
.page-head p { color: var(--muted); margin-top: 8px; font-size: 14px; max-width: 720px; line-height: 1.7; }

/* ---------- Home ---------- */

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 26px;
  padding: clamp(24px, 4vw, 44px);
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 300px at 85% 0%, var(--accent-soft), transparent 70%),
    linear-gradient(140deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -90px;
  bottom: -170px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 66%);
  filter: blur(10px);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 12px;
  color: var(--muted);
  width: fit-content;
}
.hero-eyebrow .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulse 2s infinite;
}
.hero h1 {
  margin-top: 18px;
  font-size: clamp(30px, 5.2vw, 52px);
  line-height: 1.06;
  letter-spacing: -1.4px;
  font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { margin-top: 16px; color: var(--muted); line-height: 1.8; font-size: 14.5px; max-width: 520px; }
.hero-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.hero-side { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; align-content: center; }
.hero-stat {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
}
.hero-stat b { display: block; font-size: 24px; letter-spacing: -0.5px; background: linear-gradient(120deg, var(--text), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stat span { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); letter-spacing: 0.6px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 30px 0 18px;
}
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.search-box { position: relative; margin-left: auto; min-width: 210px; }
.search-box .input { padding-left: 38px; }
.search-box::before {
  content: "🔍";
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.7;
  pointer-events: none;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(320px 160px at 100% 0%, var(--accent-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.game-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.game-card:hover::before { opacity: 1; }
.game-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.game-emoji {
  width: 50px; height: 50px;
  display: grid; place-items: center;
  font-size: 26px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 22px rgba(255, 255, 255, 0.03);
}
.game-fav {
  border: none;
  background: transparent;
  font-size: 17px;
  color: var(--muted);
  padding: 4px;
  border-radius: 8px;
  transition: transform 0.15s, color 0.15s;
  line-height: 1;
}
.game-fav:hover { transform: scale(1.18); color: var(--warn); }
.game-fav.on { color: var(--warn); }
.game-card h3 { font-size: 15.5px; font-weight: 650; letter-spacing: 0.1px; }
.game-card .desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; min-height: 40px; }
.game-card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.cat-badge {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
  letter-spacing: 0.4px;
}
.game-best { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.game-best b { color: var(--accent-2); font-family: var(--mono); }
.diff-dots { display: flex; gap: 3px; }
.diff-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.diff-dots i.on { background: var(--accent); }

.empty {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty b { display: block; font-size: 30px; margin-bottom: 10px; }

/* ---------- Play view ---------- */

.play-view { display: flex; flex-direction: column; gap: 16px; }
.play-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.play-title { display: flex; align-items: center; gap: 13px; }
.play-title .game-emoji { width: 44px; height: 44px; font-size: 22px; border-radius: 12px; }
.play-title h2 { font-size: 19px; letter-spacing: -0.2px; }
.play-title p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.play-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.play-hud {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.hud-item { display: flex; flex-direction: column; gap: 1px; min-width: 74px; }
.hud-item span { font-size: 10.5px; color: var(--muted); letter-spacing: 0.8px; }
.hud-item strong { font-family: var(--mono); font-size: 16px; font-weight: 600; }
.hud-hint { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }

.game-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(14px, 2.5vw, 26px);
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    radial-gradient(500px 260px at 50% 0%, var(--accent-soft), transparent 68%),
    var(--panel);
  min-height: 420px;
}

.canvas-wrap { width: 100%; position: relative; }
.canvas-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  background: #05060f;
  border: 1px solid var(--line);
  touch-action: none;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5);
}

/* 触屏虚拟按键（方向键 + 动作键） */
.touch-pad {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.touch-pad[hidden] { display: none; }
.touch-pad-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.touch-dpad {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(2, 52px);
  gap: 6px;
}
.touch-btn {
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  touch-action: none;
  transition: background 0.08s, transform 0.08s;
}
.touch-btn.up { grid-column: 2; grid-row: 1; }
.touch-btn.left { grid-column: 1; grid-row: 2; }
.touch-btn.down { grid-column: 2; grid-row: 2; }
.touch-btn.right { grid-column: 3; grid-row: 2; }
.touch-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(0.94); }
.touch-actions { display: flex; align-items: center; gap: 10px; }
.touch-btn.action {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px -14px var(--accent-glow);
}
.touch-pad-hint { font-size: 11px; color: var(--muted); text-align: center; width: 100%; margin-top: 8px; }

.game-note { font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.6; }
.game-note kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
}

.game-panel {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.game-panel h3 { font-size: 16px; }
.game-panel .sub { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.game-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.big-num { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: -1px; }
.kv { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; font-size: 13px; }
.kv span { color: var(--muted); }
.kv b { font-family: var(--mono); }

/* ---------- Generic boards ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), 1fr);
  gap: 6px;
  width: min(100%, 460px);
  margin: 0 auto;
  user-select: none;
}

.cell-btn {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  aspect-ratio: 1;
  font-family: var(--mono);
  font-size: 15px;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
  touch-action: manipulation;
}
.cell-btn:hover { border-color: var(--line-strong); }
.cell-btn:active { transform: scale(0.97); }

/* 2048 */
.g2048 { gap: 8px; padding: 8px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); }
.g2048 .cell {
  display: grid; place-items: center;
  aspect-ratio: 1;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(13px, 3.1vw, 22px);
  color: #fff;
  transition: background 0.14s, transform 0.14s;
}
.g2048 .cell.empty { background: rgba(255, 255, 255, 0.035); }
.g2048 .cell[data-v="2"]    { background: #303449; }
.g2048 .cell[data-v="4"]    { background: #3b4060; }
.g2048 .cell[data-v="8"]    { background: #8b5cf6; }
.g2048 .cell[data-v="16"]   { background: #7c3aed; }
.g2048 .cell[data-v="32"]   { background: #6d28d9; }
.g2048 .cell[data-v="64"]   { background: #db2777; }
.g2048 .cell[data-v="128"]  { background: #e11d48; }
.g2048 .cell[data-v="256"]  { background: #f97316; }
.g2048 .cell[data-v="512"]  { background: #f59e0b; }
.g2048 .cell[data-v="1024"] { background: #22d3ee; color: #04222a; }
.g2048 .cell[data-v="2048"] { background: linear-gradient(135deg, #fde047, #f97316); color: #3b1d00; box-shadow: 0 0 26px rgba(253, 224, 71, 0.5); }

/* Minesweeper */
.ms-board { gap: 3px; }
.ms-cell {
  display: grid; place-items: center;
  aspect-ratio: 1;
  border-radius: 5px;
  border: none;
  background: linear-gradient(160deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
  font-family: var(--mono);
  font-size: clamp(11px, 2.6vw, 16px);
  font-weight: 700;
  color: var(--text);
  transition: background 0.1s;
}
.ms-cell:hover { background: rgba(255, 255, 255, 0.22); }
.ms-cell.open { background: rgba(0, 0, 0, 0.28); cursor: default; }
.ms-cell.mine { background: var(--bad); }
.ms-cell.flag { background: #6d28d9; }
.ms-cell.n1 { color: #60a5fa; } .ms-cell.n2 { color: #34d399; } .ms-cell.n3 { color: #f87171; }
.ms-cell.n4 { color: #c084fc; } .ms-cell.n5 { color: #fbbf24; } .ms-cell.n6 { color: #22d3ee; }
.ms-cell.n7 { color: #f472b6; } .ms-cell.n8 { color: #e5e7eb; }

/* Memory cards */
.mem-board { gap: 9px; }
.mem-card { aspect-ratio: 1; perspective: 700px; border: none; background: transparent; padding: 0; }
.mem-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.mem-card.flipped .mem-inner, .mem-card.matched .mem-inner { transform: rotateY(180deg); }
.mem-face {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: 11px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-size: clamp(18px, 4.5vw, 28px);
}
.mem-front { background: linear-gradient(150deg, var(--accent), var(--accent-2)); color: rgba(255,255,255,0.85); font-size: 15px; }
.mem-back { background: var(--panel-2); border: 1px solid var(--line); transform: rotateY(180deg); }
.mem-card.matched .mem-back { border-color: var(--good); box-shadow: inset 0 0 0 2px rgba(52, 211, 153, 0.4); }

/* Whack */
.whack-grid { gap: 10px; }
.whack-cell {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 120%, rgba(255,255,255,0.1), rgba(0,0,0,0.18));
  overflow: hidden;
  position: relative;
  padding: 0;
}
.mole {
  position: absolute;
  left: 50%; bottom: -100%;
  width: 68%; height: 68%;
  transform: translateX(-50%);
  border-radius: 50% 50% 44% 44%;
  background: radial-gradient(circle at 50% 32%, #c084fc, #7c3aed 70%);
  transition: bottom 0.13s ease-out;
  display: grid; place-items: center; font-size: 22px;
}
.whack-cell.up .mole { bottom: 12%; }
.whack-cell.bomb .mole { background: radial-gradient(circle at 50% 32%, #fca5a5, #b91c1c 70%); }
.whack-cell.hit .mole { transform: translateX(-50%) scale(0.7); opacity: 0.2; }

/* Simon */
.simon-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.simon-pad {
  aspect-ratio: 1;
  border-radius: 18px;
  border: 2px solid var(--line);
  opacity: 0.55;
  transition: opacity 0.12s, transform 0.12s, box-shadow 0.12s;
}
.simon-pad.lit { opacity: 1; transform: scale(1.03); box-shadow: 0 0 34px currentColor; }
.simon-pad[data-c="0"] { background: #22d3ee; color: #22d3ee; }
.simon-pad[data-c="1"] { background: #a3e635; color: #a3e635; }
.simon-pad[data-c="2"] { background: #f472b6; color: #f472b6; }
.simon-pad[data-c="3"] { background: #fbbf24; color: #fbbf24; }

/* Piano (canvas) */
.piano-hint { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* Jigsaw / slide tiles */
.tile-grid { gap: 5px; }
.tile {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: clamp(14px, 3vw, 20px);
  font-weight: 700;
  background: var(--panel-2);
  color: var(--text);
  display: grid; place-items: center;
  transition: transform 0.12s, border-color 0.12s;
}
.tile:hover { border-color: var(--accent); }
.tile.blank { background: transparent; border-style: dashed; border-color: var(--line); }
.tile.sel { border-color: var(--accent-2); box-shadow: 0 0 0 2px var(--accent-soft); }

/* Sudoku */
.sdk-board { gap: 0; }
.sdk-cell {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: var(--panel-2);
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: clamp(16px, 4vw, 24px);
  font-weight: 700;
  color: var(--accent-2);
  padding: 0;
}
.sdk-cell.fixed { color: var(--text); background: rgba(255,255,255,0.09); }
.sdk-cell.sel { background: var(--accent-soft); }
.sdk-cell.err { color: var(--bad); }
.sdk-cell:nth-child(4n) { border-right: 2px solid var(--line-strong); }
.sdk-cell:nth-child(n+13):nth-child(-n+16) { border-bottom: 2px solid var(--line-strong); }

/* Lights out */
.lo-grid { gap: 6px; }
.lo-cell { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,0.3); transition: background 0.15s, box-shadow 0.15s; padding: 0; }
.lo-cell.on { background: var(--accent); box-shadow: 0 0 18px var(--accent-glow); }

/* Connect four */
.c4-board { gap: 5px; padding: 8px; border-radius: 14px; background: rgba(0,0,0,0.25); }
.c4-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.06);
  padding: 0;
  transition: background 0.12s;
}
.c4-cell.p1 { background: radial-gradient(circle at 40% 35%, #fda4af, #e11d48); }
.c4-cell.p2 { background: radial-gradient(circle at 40% 35%, #fde68a, #f59e0b); }
.c4-cell:hover { box-shadow: inset 0 0 0 2px var(--accent); }

/* Tic tac toe */
.ttt-board { gap: 8px; }
.ttt-cell {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: clamp(30px, 8vw, 46px);
  font-weight: 800;
  display: grid; place-items: center;
  transition: background 0.12s;
}
.ttt-cell.p1 { color: var(--accent-2); }
.ttt-cell.p2 { color: var(--warn); }
.ttt-cell:hover { background: rgba(255,255,255,0.1); }

/* Reversi */
.rev-board { gap: 2px; padding: 6px; border-radius: 10px; background: #14532d; }
.rev-cell {
  aspect-ratio: 1;
  border: none;
  background: #166534;
  display: grid; place-items: center;
  padding: 0;
}
.rev-cell::after {
  content: "";
  width: 74%; height: 74%;
  border-radius: 50%;
  transition: background 0.2s, transform 0.2s;
}
.rev-cell.p1::after { background: radial-gradient(circle at 38% 32%, #f8fafc, #94a3b8); }
.rev-cell.p2::after { background: radial-gradient(circle at 38% 32%, #64748b, #0f172a); }
.rev-cell.hint { box-shadow: inset 0 0 0 3px rgba(139, 92, 246, 0.7); }

/* Match 3 */
.m3-board { gap: 4px; padding: 6px; border-radius: 12px; background: rgba(0,0,0,0.28); }
.m3-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0;
  transition: transform 0.1s, box-shadow 0.12s;
}
.m3-cell.g0 { background: radial-gradient(circle at 35% 30%, #fda4af, #e11d48); }
.m3-cell.g1 { background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b); }
.m3-cell.g2 { background: radial-gradient(circle at 35% 30%, #a7f3d0, #10b981); }
.m3-cell.g3 { background: radial-gradient(circle at 35% 30%, #bfdbfe, #3b82f6); }
.m3-cell.g4 { background: radial-gradient(circle at 35% 30%, #ddd6fe, #8b5cf6); }
.m3-cell.g5 { background: radial-gradient(circle at 35% 30%, #fbcfe8, #ec4899); }
.m3-cell.sel { transform: scale(0.86); box-shadow: 0 0 0 2px #fff; }

/* Sokoban / maze */
.soko-board, .maze-board { gap: 3px; padding: 6px; border-radius: 10px; background: rgba(0,0,0,0.3); }
.soko-cell, .maze-cell { aspect-ratio: 1; border-radius: 4px; display: grid; place-items: center; font-size: clamp(12px, 3vw, 18px); background: rgba(255,255,255,0.05); }
.soko-cell.wall, .maze-cell.wall { background: #2b2f4c; }
.soko-cell.goal { background: rgba(52, 211, 153, 0.22); box-shadow: inset 0 0 0 1px rgba(52,211,153,0.4); }
.soko-cell.box { background: transparent; }
.soko-cell.box span { width: 78%; height: 78%; border-radius: 4px; background: linear-gradient(145deg, #c084fc, #7c3aed); box-shadow: inset 0 0 0 2px rgba(255,255,255,0.18); }
.soko-cell.box.on-goal span { background: linear-gradient(145deg, #6ee7b7, #059669); }
.soko-cell.player, .maze-cell.player { background: transparent; }
.soko-cell.player span, .maze-cell.player span { width: 66%; height: 66%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #67e8f9, #0891b2); box-shadow: 0 0 14px rgba(34, 211, 238, 0.6); }

/* Color sort */
.tube-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.tube {
  width: 58px;
  height: 190px;
  padding: 5px;
  border-radius: 8px 8px 16px 16px;
  border: 2px solid var(--line-strong);
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
  transition: border-color 0.15s, transform 0.15s;
}
.tube.sel { border-color: var(--accent-2); transform: translateY(-8px); box-shadow: 0 0 22px rgba(34,211,238,0.35); }
.tube .unit { flex: 0 0 24%; border-radius: 4px; }
.tube .unit.c0 { background: #f43f5e; } .tube .unit.c1 { background: #f59e0b; }
.tube .unit.c2 { background: #10b981; } .tube .unit.c3 { background: #3b82f6; }
.tube .unit.c4 { background: #a855f7; } .tube .unit.c5 { background: #ec4899; }

/* Hanoi */
.hanoi-row { display: flex; gap: 12px; justify-content: center; align-items: flex-end; width: 100%; }
.hanoi-peg { flex: 1; max-width: 140px; position: relative; height: 190px; display: flex; flex-direction: column-reverse; align-items: center; padding-bottom: 12px; cursor: pointer; border-radius: 10px; }
.hanoi-peg::before { content: ""; position: absolute; bottom: 12px; width: 6px; height: 150px; border-radius: 4px; background: var(--line-strong); }
.hanoi-peg::after { content: ""; position: absolute; bottom: 6px; width: 100%; height: 10px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); }
.hanoi-peg.sel { background: var(--accent-soft); }
.disk { height: 20px; border-radius: 6px; z-index: 1; margin-bottom: 3px; background: linear-gradient(120deg, var(--accent), var(--accent-2)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25); }

/* Peg solitaire */
.peg-board { gap: 4px; padding: 8px; border-radius: 12px; background: rgba(0,0,0,0.3); }
.peg-cell { aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,0.03); padding: 0; }
.peg-cell.peg { background: radial-gradient(circle at 35% 30%, #c084fc, #6d28d9); }
.peg-cell.sel { box-shadow: 0 0 0 2px var(--accent-2); }
.peg-cell.gone { background: transparent; border-color: transparent; }

/* Word search */
.ws-grid { gap: 2px; }
.ws-cell {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: clamp(10px, 2.2vw, 14px);
  font-weight: 600;
  padding: 0;
  color: var(--text);
}
.ws-cell.sel { background: var(--accent-soft); border-color: var(--accent); }
.ws-cell.found { background: rgba(52, 211, 153, 0.25); border-color: var(--good); color: var(--good); }
.word-list { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.word-list span { font-size: 12px; font-family: var(--mono); padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line); color: var(--muted); letter-spacing: 0.5px; }
.word-list span.done { color: var(--good); border-color: rgba(52,211,153,0.4); text-decoration: line-through; }

/* Keyboards */
.kb { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 520px; margin: 0 auto; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.kb-key {
  flex: 1;
  max-width: 44px;
  min-height: 40px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  transition: background 0.12s, opacity 0.12s;
}
.kb-key:hover { background: rgba(255,255,255,0.14); }
.kb-key.absent { opacity: 0.3; }
.kb-key.correct { background: #10b981; border-color: #10b981; color: #fff; }
.kb-key.present { background: #f59e0b; border-color: #f59e0b; color: #1a1205; }
.kb-key.wide { max-width: 70px; }

.letter-kb { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 520px; }
.letter-kb button { width: 38px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); font-family: var(--mono); text-transform: uppercase; }
.letter-kb button:disabled { opacity: 0.25; }
.letter-kb button.good { background: rgba(52,211,153,0.2); border-color: var(--good); color: var(--good); }
.letter-kb button.bad { background: rgba(248,113,113,0.18); border-color: var(--bad); color: var(--bad); }

/* Wordle */
.wordle-grid { display: flex; flex-direction: column; gap: 6px; width: min(100%, 300px); margin: 0 auto; }
.wordle-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wordle-tile {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(16px, 4vw, 22px);
  text-transform: uppercase;
  background: transparent;
  transition: background 0.2s, border-color 0.2s;
}
.wordle-tile.filled { border-color: var(--accent); }
.wordle-tile.correct { background: #10b981; border-color: #10b981; color: #fff; }
.wordle-tile.present { background: #d97706; border-color: #d97706; color: #fff; }
.wordle-tile.absent { background: #272a3d; border-color: #272a3d; color: #8b90ab; }

/* Options / quiz */
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; max-width: 520px; margin: 0 auto; }
.option {
  padding: 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 15px;
  font-weight: 600;
  transition: all 0.14s;
}
.option:hover { border-color: var(--accent); background: var(--accent-soft); }
.option.right { background: rgba(52, 211, 153, 0.22); border-color: var(--good); color: var(--good); }
.option.wrong { background: rgba(248, 113, 113, 0.18); border-color: var(--bad); color: var(--bad); }

.quiz-question { font-size: clamp(17px, 2.6vw, 22px); line-height: 1.6; text-align: center; font-weight: 600; }

.type-target {
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.4px;
  color: var(--muted);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.18);
  max-height: 180px;
  overflow: hidden;
}
.type-target .ok { color: var(--good); }
.type-target .now { background: var(--accent); color: #fff; border-radius: 3px; }
.type-target .bad { color: var(--bad); text-decoration: underline; }

.hangman-word { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; font-family: var(--mono); font-size: 26px; letter-spacing: 2px; }
.hangman-word span { min-width: 22px; border-bottom: 2px solid var(--line-strong); text-align: center; padding-bottom: 3px; }
.hangman-word span.done { border-color: var(--accent-2); color: var(--accent-2); }

/* ---------- Modal ---------- */

.modal-root { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 18px; }
.modal-root.open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 4, 12, 0.72); backdrop-filter: blur(6px); animation: fade 0.2s ease; }
.modal {
  position: relative;
  width: min(480px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(165deg, var(--bg-3), var(--bg-2));
  box-shadow: var(--shadow);
  animation: pop-in 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal.wide { width: min(620px, 100%); }
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 15px;
  line-height: 1;
}
.modal h2 { font-size: 21px; letter-spacing: -0.3px; }
.modal .modal-sub { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.6; }
.modal-body { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.tabs button {
  flex: 1;
  padding: 9px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.15s;
}
.tabs button.active { background: var(--accent-soft); color: var(--text); }

.avatar-picker { display: flex; gap: 7px; flex-wrap: wrap; }
.avatar-opt {
  width: 38px; height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 19px;
  transition: all 0.14s;
}
.avatar-opt.active { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }

.form-error {
  display: none;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  font-size: 12.5px;
}
.form-error.show { display: block; }

/* Result modal */
.result-score { text-align: center; padding: 6px 0 2px; }
.result-score .label { font-size: 12px; color: var(--muted); letter-spacing: 1.6px; text-transform: uppercase; }
.result-score .value {
  font-family: var(--mono);
  font-size: clamp(46px, 10vw, 64px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.1;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--warn);
  font-size: 12px;
  font-weight: 700;
}
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.result-stat { text-align: center; padding: 11px 6px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); }
.result-stat b { display: block; font-family: var(--mono); font-size: 16px; }
.result-stat span { font-size: 10.5px; color: var(--muted); }

.mini-rank { display: flex; flex-direction: column; gap: 4px; }
.mini-rank .row { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 9px; font-size: 12.5px; }
.mini-rank .row.me { background: var(--accent-soft); }
.mini-rank .row .idx { width: 20px; font-family: var(--mono); color: var(--muted); }
.mini-rank .row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-rank .row .sc { font-family: var(--mono); color: var(--accent-2); }

/* ---------- Leaderboard ---------- */

.rank-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.rank-toolbar select {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 13px;
  outline: none;
}

.rank-table { display: flex; flex-direction: column; gap: 6px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 0.15s, background 0.15s;
}
.rank-row:hover { border-color: var(--line-strong); }
.rank-row.me { border-color: var(--accent); background: var(--accent-soft); }
.rank-no {
  width: 34px;
  text-align: center;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.rank-no.gold { color: #fbbf24; }
.rank-no.silver { color: #cbd5e1; }
.rank-no.bronze { color: #fb923c; }
.rank-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: var(--panel-2); border: 1px solid var(--line); flex-shrink: 0; }
.rank-main { flex: 1; min-width: 0; }
.rank-main b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-main small { font-size: 11.5px; color: var(--muted); }
.rank-val { font-family: var(--mono); font-size: 16px; color: var(--accent-2); flex-shrink: 0; }
.rank-val small { font-size: 10px; color: var(--muted); margin-left: 2px; }

/* ---------- Profile ---------- */

.profile-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 26px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: radial-gradient(500px 220px at 0% 0%, var(--accent-soft), transparent 70%), var(--panel);
}
.profile-avatar {
  width: 82px; height: 82px;
  border-radius: 24px;
  display: grid; place-items: center;
  font-size: 40px;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 34px -18px var(--accent-glow);
  flex-shrink: 0;
}
.profile-id { flex: 1; min-width: 200px; }
.profile-id h1 { font-size: 25px; letter-spacing: -0.4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.level-pill { font-size: 11px; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent-2); font-weight: 700; letter-spacing: 0.5px; }
.profile-id .handle { color: var(--muted); font-size: 12.5px; margin-top: 5px; }

.xp-bar { margin-top: 14px; }
.xp-bar .track { height: 8px; border-radius: 99px; background: rgba(0,0,0,0.3); overflow: hidden; }
.xp-bar .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 16px var(--accent-glow); transition: width 0.5s ease; }
.xp-bar .lbl { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 5px; font-family: var(--mono); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 18px; }
.stat-card { padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.stat-card b { display: block; font-size: 26px; font-family: var(--mono); letter-spacing: -1px; background: linear-gradient(120deg, var(--text), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-card span { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.ach {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel);
  opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s;
}
.ach.on { opacity: 1; border-color: var(--line-strong); }
.ach .em { font-size: 24px; filter: grayscale(1); }
.ach.on .em { filter: none; }
.ach b { display: block; font-size: 13px; }
.ach small { color: var(--muted); font-size: 11.5px; line-height: 1.5; }

.recent-list { display: flex; flex-direction: column; gap: 6px; }
.recent-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; }
.recent-row .em { font-size: 18px; }
.recent-row .nm { flex: 1; }
.recent-row .tm { color: var(--muted); font-size: 11px; }
.recent-row .sc { font-family: var(--mono); color: var(--accent-2); }

/* ---------- Settings ---------- */

.settings-grid { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.setting-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  flex-wrap: wrap;
}
.setting-row .txt { flex: 1; min-width: 180px; }
.setting-row .txt b { display: block; font-size: 14px; }
.setting-row .txt small { color: var(--muted); font-size: 12px; line-height: 1.6; display: block; margin-top: 3px; }

.seg { display: flex; gap: 4px; padding: 4px; border-radius: 11px; background: rgba(0,0,0,0.2); border: 1px solid var(--line); }
.seg button { padding: 7px 14px; border-radius: 8px; border: none; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.seg button.active { background: var(--accent-soft); color: var(--text); }

.swatches { display: flex; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.swatch[data-swatch="violet"] { background: linear-gradient(135deg, #8b5cf6, #22d3ee); }
.swatch[data-swatch="cyan"] { background: linear-gradient(135deg, #22d3ee, #38bdf8); }
.swatch[data-swatch="lime"] { background: linear-gradient(135deg, #a3e635, #34d399); }
.swatch[data-swatch="orange"] { background: linear-gradient(135deg, #fb923c, #f472b6); }
.swatch[data-swatch="pink"] { background: linear-gradient(135deg, #f472b6, #a78bfa); }

.switch {
  position: relative;
  width: 46px; height: 26px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: rgba(0,0,0,0.3);
  transition: background 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { transform: translateX(20px); }

.danger-zone { border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.06); }
.btn.danger { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 10px 24px -14px rgba(239, 68, 68, 0.6); }

/* ---------- Toast ---------- */

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 240px;
  max-width: 340px;
  padding: 12px 16px;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: var(--elev);
  box-shadow: var(--shadow);
  animation: slide-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  font-size: 13px;
}
.toast.out { animation: slide-out 0.25s ease forwards; }
.toast .em { font-size: 20px; }
.toast b { display: block; font-size: 13px; }
.toast small { color: var(--muted); font-size: 11.5px; }

/* ---------- Animations ---------- */

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes slide-out { to { opacity: 0; transform: translateX(30px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.6); } 70% { box-shadow: 0 0 0 9px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.fade-up { animation: fade-up 0.4s ease both; }

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: repeat(4, 1fr); }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .brand-text small { display: none; }
}

/* 平板 / 手机：改用底部导航，放大触控目标 */
@media (max-width: 760px) {
  .nav { display: none; }
  .topbar { flex-wrap: nowrap; padding: 10px 14px; }
  #app { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-top: 1px solid var(--line);
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.2px;
  }
  .bottom-nav a.active { color: var(--text); background: var(--accent-soft); }
  .bottom-nav .bn-ico { font-size: 19px; line-height: 1; }

  .view { padding-bottom: 34px; }
  .footer { padding-bottom: 26px; }
  .toast-root {
    right: 12px;
    left: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    align-items: center;
  }
  .toast { width: 100%; max-width: 420px; }
  .modal-root { padding: 12px; }
  .modal { max-height: calc(100dvh - 24px); padding: 20px; }
  .input, input, select, textarea { font-size: 16px; }
  .btn { min-height: 42px; }
  .icon-btn { width: 42px; height: 42px; }
  .user-chip { min-height: 42px; }
}

@media (max-width: 620px) {
  .topbar { padding: 10px 12px; }
  .brand-text strong { font-size: 16px; }
  .hero-side { grid-template-columns: repeat(2, 1fr); }
  .hero-stat b { font-size: 20px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
  .game-card { padding: 13px; gap: 9px; }
  .game-emoji { width: 40px; height: 40px; font-size: 21px; border-radius: 11px; }
  .game-card .desc { display: none; }
  .hud-hint { display: none; }
  .search-box { margin-left: 0; width: 100%; }
  .toolbar { gap: 8px; }
  .result-grid { grid-template-columns: repeat(3, 1fr); }
  .option-grid { grid-template-columns: 1fr; }
  .profile-hero { padding: 18px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .rank-row { padding: 10px 12px; gap: 9px; }
  .modal { padding: 18px; }
  .game-stage { padding: 10px; min-height: 320px; border-radius: 16px; }
  .play-hud { padding: 9px 12px; gap: 8px 12px; }
  .hud-item { min-width: 62px; }
  .play-actions { margin-left: 0; width: 100%; }
  .play-actions .btn { flex: 1; }
  .play-title { width: 100%; }
  .play-title p { display: none; }
}

/* ---------- Game-specific components ---------- */

.reaction-panel { gap: 12px; }
.reaction-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 260px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.reaction-pad.waiting { background: rgba(248, 113, 113, 0.13); border-color: rgba(248, 113, 113, 0.4); }
.reaction-pad.go { background: rgba(52, 211, 153, 0.22); border-color: var(--good); }
.reaction-pad.bad { background: rgba(251, 191, 36, 0.16); border-color: var(--warn); }
.reaction-pad .rp-title { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.reaction-pad .rp-sub { font-size: 13px; color: var(--muted); }
.reaction-pad .rp-time { font-family: var(--mono); font-size: 15px; color: var(--accent-2); min-height: 20px; }

.odd-cell {
  aspect-ratio: 1;
  border: none;
  border-radius: 9px;
  padding: 0;
  transition: transform 0.1s, outline-color 0.1s;
  outline: 0 solid transparent;
}
.odd-cell:hover { transform: scale(0.95); }

.click-area {
  position: relative;
  height: 320px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
  touch-action: manipulation;
}
.click-target {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: radial-gradient(circle at 35% 30%, var(--accent-2), var(--accent));
  box-shadow: 0 0 20px var(--accent-glow);
  padding: 0;
  transition: transform 0.08s;
}
.click-target:active { transform: translate(-50%, -50%) scale(0.9); }

.lit-cell {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  box-shadow: 0 0 20px var(--accent-glow);
}

.stroop-word {
  font-family: var(--mono);
  font-size: clamp(44px, 11vw, 68px);
  font-weight: 900;
  text-align: center;
  letter-spacing: 6px;
  min-height: 96px;
  display: grid;
  place-items: center;
}

.anagram-letters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.anagram-letters span {
  width: 44px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-2);
}

.rps-arena { display: flex; align-items: center; justify-content: center; gap: 18px; }
.rps-side {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  font-size: 48px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.rps-vs { font-weight: 800; color: var(--muted); font-size: 14px; letter-spacing: 1px; }

.mm-current { display: flex; gap: 8px; justify-content: center; }
.mm-slot {
  width: 46px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
}
.mm-history { display: flex; flex-direction: column; gap: 4px; max-height: 190px; overflow-y: auto; }
.mm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
}
.mm-guess { letter-spacing: 4px; }
.mm-fb { font-size: 12px; }
.mm-fb b { margin-left: 4px; }

/* ================= v2: 社区、人机验证与审核 ================= */

.textarea { min-height: 110px; resize: vertical; line-height: 1.65; font-family: inherit; }

.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-img {
  flex: 1;
  min-height: 56px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #111427;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
}
.captcha-img svg { display: block; width: 100%; height: 56px; }
.captcha-img.ready { border-color: var(--line-strong); }

.report-btn {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.report-btn:hover { color: #fca5a5; border-color: rgba(248, 113, 113, 0.55); background: rgba(248, 113, 113, 0.1); }

.feedback-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .feedback-layout { grid-template-columns: 1fr; } }
.feedback-card, .feedback-side { padding: 22px; }
.feedback-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.feedback-card-head h2 { font-size: 18px; }
.feedback-card form { display: flex; flex-direction: column; gap: 14px; }
.feedback-success { text-align: center; padding: 26px 10px; }
.feedback-success b { font-size: 18px; display: block; margin-bottom: 8px; }
.feedback-success p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.feedback-success strong { font-family: var(--mono); color: var(--accent-2); }
.feedback-success .btn { margin-top: 16px; }

.server-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 10px;
}
.server-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn, #fbbf24); }
.server-badge.on { color: var(--good); border-color: rgba(52, 211, 153, 0.4); }
.server-badge.on i { background: var(--good); box-shadow: 0 0 8px var(--good); }
.server-badge.off { color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); }
.server-badge.off i { background: var(--bad); }

.mine-list { display: flex; flex-direction: column; gap: 8px; max-height: 440px; overflow-y: auto; }
.mine-row {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.mine-row .mine-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mine-row b { font-size: 13.5px; display: block; line-height: 1.5; }
.mine-row small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.mine-row .mine-time { margin-left: auto; font-size: 11px; color: var(--muted); }
.mine-note {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
}
.status-chip {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.status-chip.warn { color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }
.status-chip.info { color: #60a5fa; border-color: rgba(96, 165, 250, 0.4); background: rgba(96, 165, 250, 0.08); }
.status-chip.good { color: var(--good); border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }
.status-chip.bad { color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }

.feedback-tip {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
}
.feedback-tip b { font-size: 13px; }
.feedback-tip p { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 6px 0 8px; }
.feedback-tip a { font-size: 12px; }

/* ================= v2: 新增小游戏通用样式 ================= */

.ring-board { display: grid; gap: 6px; justify-content: center; }
.ring-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  transition: all 0.12s ease;
}
.ring-cell:hover { border-color: var(--line-strong); }
.ring-cell.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 14px var(--accent-soft); }

.play-grid {
  display: grid;
  gap: 8px;
  justify-content: center;
  padding: 8px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}
.play-tile {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}
.play-tile:hover { border-color: var(--accent); }
.play-tile.done { opacity: 0.35; border-color: var(--good); color: var(--good); }
.play-tile.hit { background: var(--accent-soft); border-color: var(--accent-2); }
.play-tile.empty { background: transparent; border-style: dashed; cursor: default; }

.bar-wrap {
  height: 22px;
  border-radius: 99px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}
.bar-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(52, 211, 153, 0.22);
  border-left: 1px solid rgba(52, 211, 153, 0.5);
  border-right: 1px solid rgba(52, 211, 153, 0.5);
}
.bar-thumb {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 4px;
  border-radius: 2px;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
}

.wordfall-area {
  position: relative;
  height: 300px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}
.fall-word {
  position: absolute;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(139, 92, 246, 0.14);
  font-family: var(--mono);
  font-size: 14px;
  white-space: nowrap;
}
.fall-word.danger { border-color: rgba(248, 113, 113, 0.6); background: rgba(248, 113, 113, 0.14); }

.rhythm-lanes { display: flex; gap: 6px; justify-content: center; }
.rhythm-lane {
  flex: 1;
  max-width: 74px;
  height: 300px;
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}
.rhythm-note {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.rhythm-lane .key {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.rhythm-lane.hit { box-shadow: inset 0 0 0 2px var(--accent-2); }
.rhythm-judge { text-align: center; font-family: var(--mono); font-size: 13px; min-height: 20px; }

.bubble-area { position: relative; height: 280px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a78bfa, #6d28d9);
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
  animation: bubble-rise linear forwards;
}
@keyframes bubble-rise { from { bottom: -60px; } to { bottom: 110%; } }

.mole-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 420px; margin: 0 auto; }
.mole-hole {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0.5), var(--panel-2));
  display: grid;
  place-items: center;
  font-size: 26px;
  cursor: pointer;
  user-select: none;
}
.mole-hole.on { background: radial-gradient(circle at 50% 40%, rgba(139,92,246,0.35), var(--panel-2)); }
.mole-hole.bomb.on { background: radial-gradient(circle at 50% 40%, rgba(248,113,113,0.35), var(--panel-2)); }

.falling-lane-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 380px; margin: 0 auto; }
.falling-lane {
  min-height: 240px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px;
  cursor: pointer;
  font-size: 24px;
  user-select: none;
}
.falling-lane:hover { border-color: var(--accent); }

.tap-targets { position: relative; height: 300px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.qa-option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pipe-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 20px;
  cursor: pointer;
  user-select: none;
}
.pipe-cell.connected { border-color: var(--accent); background: var(--accent-soft); }
.pipe-cell.source { box-shadow: inset 0 0 0 2px var(--accent-2); }

.coin-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.coin {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: linear-gradient(135deg, #f6d365, #d4a017);
  color: #3b2a00;
  font-family: var(--mono);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.coin.sel { box-shadow: 0 0 0 2px var(--accent-2); }

.typing-target {
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: 2px;
  text-align: center;
}
.typing-target .ok { color: var(--good); }
.typing-target .now { background: var(--accent); color: #fff; border-radius: 3px; }
.typing-target .bad { color: var(--bad); text-decoration: underline; }
