/* Challengematic — shared site styles.
   The palette and the Anton/Inter pairing are lifted straight from the
   app's own design tokens (lib/core/theme/tokens.dart, text_styles.dart)
   so the site and the product read as one thing. */

:root {
  --ground: #FBF9F6;
  --surface: #FFFFFF;
  --sunken: #F3F1ED;
  --border: #DFE2E7;
  --rule: #E8E6E1;
  --ink: #14171A;
  --body: #3A3F45;
  --muted: #6B7280;
  --accent: #16A34A;
  --accent-soft: #DCFCE7;
  --danger: #C2410C;
  --danger-soft: #FFEDD5;

  /* One accent per game, same values the app's HUD uses. */
  --g-time: #16A34A;
  --g-bottle: #F59E0B;
  --g-all: #0EA5E9;
  --g-ping: #EC4899;
  --g-bomb: #EF4444;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0F1211;
    --surface: #171B19;
    --sunken: #131715;
    --border: #272C2A;
    --rule: #232826;
    --ink: #F0F3F1;
    --body: #C0C7C3;
    --muted: #868E8A;
    --accent: #3DD46F;
    --accent-soft: #14301F;
    --danger: #F0885B;
    --danger-soft: #33190D;

    --g-time: #3DD46F;
    --g-bottle: #FBBF24;
    --g-all: #38BDF8;
    --g-ping: #F472B6;
    --g-bomb: #F87171;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ground: #0F1211;
  --surface: #171B19;
  --sunken: #131715;
  --border: #272C2A;
  --rule: #232826;
  --ink: #F0F3F1;
  --body: #C0C7C3;
  --muted: #868E8A;
  --accent: #3DD46F;
  --accent-soft: #14301F;
  --danger: #F0885B;
  --danger-soft: #33190D;

  --g-time: #3DD46F;
  --g-bottle: #FBBF24;
  --g-all: #38BDF8;
  --g-ping: #F472B6;
  --g-bomb: #F87171;

  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.wrap.narrow { max-width: 44rem; }

/* ---- masthead, shared by every page ---- */
.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .75rem 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid var(--ink);
}
.wordmark {
  font-family: Anton, Impact, sans-serif;
  font-weight: 400;
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  letter-spacing: -.01em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1;
  margin: 0;
  text-decoration: none;
}
.wordmark .dot { color: var(--accent); }
.masthead .spacer { flex: 1 1 auto; }
.masthead nav {
  display: flex;
  gap: 1rem;
  font-size: .875rem;
}
.masthead nav a { color: var(--muted); text-decoration: none; }
.masthead nav a:hover { color: var(--accent); }

/* ---- type ---- */
h1 {
  font-family: Anton, Impact, sans-serif;
  font-weight: 400;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -.015em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--ink);
  margin: 2.5rem 0 .75rem;
}
h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
  text-wrap: balance;
  margin: 0 0 .85rem;
}
h3 {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.75rem 0 .6rem;
}
.standfirst {
  font-size: 1.0625rem;
  color: var(--body);
  margin: 0 0 1.5rem;
  max-width: 38rem;
}
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
ul { margin: 0 0 1rem; padding-left: 1.15rem; }
li { margin-bottom: .4rem; }
li::marker { color: var(--accent); }
strong { color: var(--ink); font-weight: 600; }
a { color: var(--accent); text-underline-offset: 2px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .875em;
  background: var(--sunken);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .05em .35em;
  color: var(--ink);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  font-size: .8125rem;
  color: var(--muted);
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  margin: 0;
}
.meta b { color: var(--ink); font-weight: 600; }

/* ---- legal documents: numbered because a policy is cited by number ---- */
section.clause {
  padding-top: 2.25rem;
  margin-top: 2.25rem;
  border-top: 1px solid var(--rule);
}
section.clause:first-of-type { border-top: 0; }
section.clause h2 {
  display: flex;
  gap: .75rem;
  align-items: baseline;
}
section.clause h2 .num {
  font-family: Anton, Impact, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  color: var(--accent);
  flex: 0 0 auto;
  min-width: 1.4rem;
  font-variant-numeric: tabular-nums;
}

/* ---- data inventory table ---- */
.tablewrap { overflow-x: auto; margin: 0 0 1rem; }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 32rem;
  font-size: .9375rem;
}
caption {
  text-align: left;
  font-size: .8125rem;
  color: var(--muted);
  padding-bottom: .6rem;
}
th, td {
  text-align: left;
  padding: .6rem .75rem .6rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom-color: var(--border);
  white-space: nowrap;
}
td:first-child { color: var(--ink); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

.where {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
  padding: .1rem .5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.where.device { background: var(--sunken); color: var(--body); border: 1px solid var(--border); }
.where.server { background: var(--accent-soft); color: var(--accent); }

.notcollected {
  background: var(--sunken);
  border-left: 3px solid var(--accent);
  padding: 1.1rem 1.25rem;
  margin: 0 0 1rem;
}
.notcollected ul {
  columns: 2;
  column-gap: 2rem;
  margin: 0;
  padding-left: 1.15rem;
}
.notcollected li { break-inside: avoid; margin-bottom: .3rem; }
@media (max-width: 34rem) { .notcollected ul { columns: 1; } }


/* ---- language switch ---- */
.langswitch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  background: var(--surface);
}
.langswitch button {
  font: inherit;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 0;
  border-radius: 999px;
  padding: .3rem .85rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.langswitch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--ground);
}
.langswitch button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

footer.colophon {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
  font-size: .8125rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
}
footer.colophon .spacer { flex: 1 1 auto; }
footer.colophon a { color: var(--muted); }
footer.colophon a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
