:root {
  --bg: #f6f6fa;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #5b5b66;
  --border: #e3e3ea;
  --accent: #4048d9;
  --accent-text: #ffffff;
  --win: #f5b301;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f14;
    --surface: #1b1b23;
    --text: #f2f2f7;
    --muted: #a1a1ad;
    --border: #2c2c38;
    --accent: #7c83ff;
    --accent-text: #0f0f14;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }

header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
}
header.site a.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 700;
}
header.site img { width: 36px; height: 36px; border-radius: 9px; }
header.site nav a { margin-left: 16px; color: var(--muted); text-decoration: none; font-size: 15px; }

.hero { padding: 40px 0 24px; text-align: center; }
.hero img.icon { width: 112px; height: 112px; border-radius: 26px; box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(30px, 6vw, 46px); line-height: 1.12; margin: 20px 0 12px; }
.hero p.lead { font-size: 20px; color: var(--muted); max-width: 620px; margin: 0 auto 24px; }

.button {
  display: inline-block; background: var(--accent); color: var(--accent-text);
  padding: 13px 22px; border-radius: 12px; font-weight: 600; text-decoration: none;
}
.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--border); }
.small { font-size: 14px; color: var(--muted); }

.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; padding: 24px 0;
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

section { padding: 16px 0; }
section h2 { font-size: 26px; margin: 24px 0 12px; }

.game-links { display: flex; flex-wrap: wrap; gap: 10px; }
.game-links a {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 16px; text-decoration: none; color: var(--text); font-size: 15px;
}

article h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; margin: 24px 0 8px; }
article h2 { font-size: 22px; margin: 32px 0 8px; }
article .answer {
  font-size: 19px; background: var(--surface); border-left: 4px solid var(--accent);
  padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 16px 0;
}

table { width: 100%; border-collapse: collapse; margin: 12px 0; background: var(--surface); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 16px; }
th { font-weight: 600; background: var(--bg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.app-callout { display: flex; gap: 16px; align-items: center; margin: 32px 0; }
.app-callout img { width: 64px; height: 64px; border-radius: 15px; }
.app-callout p { margin: 0 0 8px; }

.sheet { display: none; }

footer.site { padding: 32px 0 48px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--border); margin-top: 32px; }
footer.site a { color: var(--muted); }

/* A game's link (/g/{id}). There is no web scoreboard: it only leads to the app. */
.invite-page { max-width: 560px; margin: 0 auto; padding: 8px 16px 32px; }
.invite-page h1 { font-size: 26px; margin: 0 0 8px; }

@media print {
  header.site, footer.site, .no-print, .app-callout { display: none !important; }
  body { background: #fff; color: #000; }
  article > *:not(.sheet) { display: none; }
  .sheet { display: block; }
  .sheet table { border: 1px solid #000; }
  .sheet th, .sheet td { border: 1px solid #000; height: 34px; }
}

header.site nav a { white-space: nowrap; }
@media (max-width: 480px) {
  header.site nav a:first-child { display: none; }
}

.invite { margin: 8px 0 20px; }
.invite-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px !important; }
[hidden] { display: none !important; }
