:root {
  --bg: #0f1220;
  --panel: rgba(15, 18, 32, 0.82);
  --text: #f5f7ff;
  --muted: #a9b0c7;
  --accent: #ffd166;
  --line: rgba(255, 255, 255, 0.1);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  background: var(--accent);
  color: #1d1d1d;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }

.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: #555;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* --- Game ------------------------------------------------------------- */

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  pointer-events: none;
}
.hud a { pointer-events: auto; }
.user { display: flex; gap: 10px; align-items: center; background: var(--panel); padding: 8px 14px 8px 8px; border-radius: 999px; }
.name { font-weight: 600; }
.link { color: var(--accent); font-size: 12px; text-decoration: none; }
.stats { display: flex; gap: 6px; }
.stats > div { background: var(--panel); border-radius: 10px; padding: 6px 12px; text-align: center; min-width: 64px; }
.label { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stats span:not(.label) { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.overlay { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(10, 12, 24, 0.35); }
.panel { background: var(--panel); backdrop-filter: blur(6px); border-radius: 16px; padding: 28px; max-width: 380px; width: 100%; text-align: center; }
.panel h1 { margin: 0 0 8px; font-size: 32px; }
.panel p { color: var(--muted); margin: 0 0 18px; line-height: 1.45; }
.buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.panel .hint { font-size: 12px; margin: 18px 0 0; }
.board { list-style: none; margin: 18px 0 0; padding: 0; text-align: left; }
.board:empty { display: none; }
.board li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.board .score { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { width: 12px; height: 12px; border-radius: 50%; }

@media (max-width: 560px) {
  .hud { padding: 10px; }
  .stats > div { min-width: 0; padding: 6px 8px; }
  .stats span:not(.label) { font-size: 16px; }
  .user { padding-right: 8px; }
  .user .link { display: none; }
}
/* Long names shrink with "…" so the score boxes always fit. */
.user { white-space: nowrap; min-width: 0; }
.user > div { min-width: 0; }
.name { overflow: hidden; text-overflow: ellipsis; }
.stats { flex: none; }
