:root {
  --bg: #0e0e0e;
  --bg-elevated: #141414;
  --text: #a3a3a3;
  --text-light: #d4d4d4;
  --text-grey: #6e6e6e;
  --border: rgba(255, 255, 255, 0.08);
  --danger: #d98989;
  --ok: #8fbf9f;
  --font: Manrope, system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  padding: 28px 20px 64px;
}
a { color: var(--text-light); text-underline-offset: 3px; }
.wrap { max-width: 420px; margin: 0 auto; }
.wrap.wide { max-width: 860px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.game-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  min-height: 140px;
}
.game-card h2 {
  color: var(--text-light);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.game-card .meta { margin-top: 8px; font-size: 13px; color: var(--text-grey); }
.icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #1a1a1a;
  margin-bottom: 10px;
}
textarea, select {
  font: inherit;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 11px 12px;
  resize: vertical;
  min-height: 72px;
}
select { min-height: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.filters a, .filters button {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 36px;
}
.brand {
  color: var(--text-light);
  font-weight: 500;
  letter-spacing: -0.04em;
  font-size: 18px;
  text-decoration: none;
}
h1 {
  color: var(--text-light);
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.lede { margin-top: 10px; }
.nav a { margin-left: 14px; font-size: 14px; }
form, .card {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}
label { font-size: 13px; color: var(--text-grey); display: grid; gap: 6px; }
input, button, select {
  font: inherit;
  border-radius: 10px;
}
input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 11px 12px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}
button {
  background: var(--text-light);
  color: #111;
  border: 0;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
}
button.ghost {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
}
button:disabled { opacity: 0.55; cursor: default; }
.err { color: var(--danger); font-size: 14px; min-height: 1.2em; }
.ok { color: var(--ok); }
.hint { color: var(--text-grey); font-size: 13px; }
.hidden { display: none; }
.hero-actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions a {
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
}
.hero-actions .primary { background: var(--text-light); color: #111; }
.hero-actions .secondary { border: 1px solid var(--border); }
.pill {
  display: inline-block;
  margin-right: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-light);
}
.player-frame {
  margin-top: 18px;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #050505;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.player-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
}
.ghost-link, .play-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
}
.ghost-link {
  color: var(--text-light);
  border: 1px solid var(--border);
}
.play-link {
  background: var(--text-light);
  color: #111;
}
.play-side { margin-top: 22px; }
.side-title {
  margin-top: 18px;
  color: var(--text-light);
  font-size: 16px;
  font-weight: 600;
}
.room-code {
  color: var(--text-light);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.score-list {
  margin-top: 10px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.score-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.score-list strong { color: var(--text-light); }
