:root {
  --bg: #f6f6f4;
  --fg: #1d1d1f;
  --muted: #6b6b70;
  --card: #ffffff;
  --line: #dcdcd8;
  --accent: #2f5bd3;
  --ok: #1f7a3d;
  --err: #b42318;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416;
    --fg: #ececee;
    --muted: #9a9aa2;
    --card: #1e1e22;
    --line: #2e2e34;
    --accent: #8aa8ff;
    --ok: #6fd08f;
    --err: #ff8a80;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* Game list */
.list { max-width: 40rem; margin: 0 auto; padding: 24px 16px 48px; }
.list h1 { font-size: 1.5rem; margin: 0 0 16px; }
.games { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.games a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px; padding: 14px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  color: var(--fg); text-decoration: none; font-size: 1.1rem; font-weight: 600;
  text-transform: capitalize;
}
.games a:hover, .games a:focus-visible { border-color: var(--accent); outline: none; }
.badge {
  flex: none; font-size: .75rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px;
}
.note { color: var(--muted); }
.error { color: var(--err); }

/* Player */
.player { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #000; }
.bar {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 6px 12px; padding-top: max(6px, env(safe-area-inset-top));
  background: var(--card); border-bottom: 1px solid var(--line); font-size: .9rem;
}
.bar a { color: var(--accent); text-decoration: none; font-weight: 600; padding: 6px 0; }
.bar .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: capitalize; }
#status { flex: none; color: var(--muted); }
#status.ok { color: var(--ok); }
#status.error { color: var(--err); }
.stage { flex: 1; min-height: 0; position: relative; }
#game { position: absolute; inset: 0; }
