/* Pocket Arcade — shared tokens and basics for every portal page.
   These values are the default "Storefront" theme. Another theme is one stylesheet in themes/ that
   overrides tokens (and any selectors it needs) under html[data-theme="<id>"]; the markup never changes.
   Light/dark: no data-scheme follows the system, data-scheme="light"/"dark" is the visitor's choice. */

:root {
  --bg: #f4f5f6;
  --surface: #ffffff;
  --fg: #16171a;
  --muted: #5a5e66;
  --faint: #6f747c;
  --line: #dfe1e5;
  --chip: #e8eaed;
  --inv: #ffffff;
  --shadow: #0000004d;
  --font-ui: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: var(--font-ui);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    --bg: #0f1012; --surface: #18191c; --fg: #f1f2f4; --muted: #a3a7af; --faint: #8a8f98;
    --line: #2a2c31; --chip: #202226; --inv: #0f1012; --shadow: #000000a6;
    color-scheme: dark;
  }
}
:root[data-scheme="dark"] {
  --bg: #0f1012; --surface: #18191c; --fg: #f1f2f4; --muted: #a3a7af; --faint: #8a8f98;
  --line: #2a2c31; --chip: #202226; --inv: #0f1012; --shadow: #000000a6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap {
  max-width: 1240px; margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* Appearance menu (mode + theme), used in the home header. */
.menu-anchor { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  box-shadow: 0 16px 40px -12px var(--shadow);
}
.menu-label { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.menu-label + * { margin-bottom: 4px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; background: var(--chip); border-radius: 8px; }
.seg button { height: 30px; border: 0; border-radius: 6px; background: transparent; font-size: 14px; font-weight: 500; color: var(--muted); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px var(--shadow); }
.themes { display: grid; gap: 2px; margin-top: 12px; }
.themes button { display: flex; justify-content: space-between; align-items: center; height: 34px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; font-size: 14px; }
.themes button:hover { background: var(--chip); }
.themes button[aria-checked="true"]::after { content: '✓'; font-weight: 700; }

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