:root {
  color-scheme: light dark;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #62625d;
  --border: #d5d5cf;
  --accent: #1f6f43;
  --accent-text: #ffffff;
  --error: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171716;
    --surface: #232321;
    --text: #f0f0ec;
    --muted: #aaaaa3;
    --border: #41413d;
    --accent: #4fb67f;
    --accent-text: #0c1f15;
    --error: #ff8a80;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 32rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
main.wide { max-width: 70rem; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; line-height: 1.2; }
h2 { font-size: 1.25rem; margin: 0 0 .75rem; }
a { color: var(--accent); }
.back { display: inline-block; padding: .5rem 0; margin-bottom: .5rem; }
.game-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.game-link {
  display: block;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}
.game-link:hover { border-color: var(--accent); }
.game-link strong, .game-link span { display: block; }
.game-link span { color: var(--muted); }
button {
  width: 100%;
  min-height: 48px;
  padding: .6rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: .6; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
label { display: block; font-weight: 600; margin-bottom: .35rem; }
input, textarea {
  width: 100%;
  min-height: 48px;
  padding: .6rem .75rem;
  margin-bottom: .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  font-size: 16px; /* below 16px, iOS zooms the page on focus */
  font-family: inherit;
}
.end-screen { display: grid; gap: 1.25rem; }
.share-preview {
  margin: 0 0 .6rem;
  padding: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.status { min-height: 1.45em; margin: .5rem 0 0; color: var(--muted); }
.status.error { color: var(--error); }
.status.success { color: var(--accent); font-weight: 600; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; vertical-align: top; padding: .5rem; border-bottom: 1px solid var(--border); }
pre { margin: .5rem 0 0; }
