/* wabit games: portal styles. Colour tokens follow the wabit palette; no external fonts or assets. */
:root {
  color-scheme: light dark;
  --paper: #f7f3ec;
  --paper-raised: #fffdf9;
  --paper-sunk: #eee8de;
  --ink: #1f1d1a;
  --ink-muted: #5f5a52;
  --line: #d9d2c6;
  --line-strong: #8a8378;
  --carrot: #e0611f;
  --on-carrot: #1f1d1a;
  --carrot-text: #a8410e;
  --dusk: #2b5d7d;
  --on-dusk: #f7f3ec;
  --ok: #2f6b3a;
  --danger: #a3261b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1a1917; --paper-raised: #24221f; --paper-sunk: #121110;
    --ink: #f3eee6; --ink-muted: #b3ab9f; --line: #3a3732; --line-strong: #7a736b;
    --carrot: #f07a3a; --on-carrot: #1f1d1a; --carrot-text: #f59a63;
    --dusk: #8db9dc; --on-dusk: #1a1917;
    --ok: #8fd19e; --danger: #ff9b8f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font: 400 17px/1.6 var(--sans);
}
a { color: var(--carrot-text); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--carrot); outline-offset: 2px; }
h1 { font-size: 34px; line-height: 1.2; letter-spacing: -0.015em; margin: 8px 0 16px; font-weight: 600; }
h2 { font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; margin: 32px 0 12px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--ink-muted); }
.small { font-size: 14px; line-height: 1.5; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1100px; }
main.wrap { flex: 1; padding-top: 24px; padding-bottom: 48px; }

.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 20px; letter-spacing: -0.01em; }
.brand b { font-weight: 600; color: var(--carrot-text); }
.logo { width: 30px; height: 30px; color: var(--ink); }
.nav { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; font-size: 15px; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--carrot-text); text-decoration: underline; }
.foot { color: var(--ink-muted); font-size: 13px; padding-bottom: 24px; }
.foot p { border-top: 1px solid var(--line); padding-top: 16px; margin: 0; }

form.inline { display: inline; margin: 0; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 15px/1 var(--sans); color: var(--ink); text-decoration: none; cursor: pointer;
  background: var(--paper-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  padding: 11px 16px; min-height: 42px;
}
button:hover, .button:hover { background: var(--paper-sunk); }
button.primary, .button.primary { background: var(--carrot); border-color: var(--carrot); color: var(--on-carrot); font-weight: 600; }
button.primary:hover, .button.primary:hover { filter: brightness(1.05); }
button.small, .button.small { min-height: 32px; padding: 6px 10px; font-size: 14px; border-radius: var(--radius-sm); }
button.danger { color: var(--danger); }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--ink); font: inherit; text-decoration: none; }
button.link:hover { text-decoration: underline; color: var(--carrot-text); background: none; }

input, select {
  font: 400 16px/1.4 var(--sans); color: var(--ink); background: var(--paper-raised);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; height: 44px;
}
label { display: block; font-weight: 500; font-size: 15px; }
label input, label select { margin-top: 6px; font-weight: 400; }
.hint { display: block; font-weight: 400; font-size: 13px; color: var(--ink-muted); margin-top: 4px; }
.stack { display: grid; gap: 16px; margin: 8px 0 20px; }
.stack button { justify-self: start; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 20px; }
.row label { flex: 1 1 200px; }

.card { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; margin: 0 0 24px; }
.card.narrow { max-width: 440px; margin: 24px auto; }
.card h1 { margin-top: 0; }
.card h2:first-child { margin-top: 0; }
.card.reveal { border-color: var(--carrot); }

.notice { border-radius: var(--radius-sm); padding: 10px 14px; border: 1px solid var(--line); background: var(--paper-sunk); }
.notice.error { border-color: var(--danger); color: var(--danger); }
.notice.ok { border-color: var(--ok); color: var(--ok); }
.notice.info { border-color: var(--dusk); }

.games { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.game { display: flex; flex-direction: column; background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.thumb { display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--paper-sunk); border-bottom: 1px solid var(--line); text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.initials { font: 600 56px/1 var(--sans); color: var(--dusk); letter-spacing: -0.02em; }
.game-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.game-body h2 { margin: 0; }
.game-body p { color: var(--ink-muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 8px; }
.count { font: 500 12px/1 var(--mono); background: var(--paper-sunk); border-radius: 999px; padding: 3px 7px; }

.crumbs { font-size: 14px; color: var(--ink-muted); margin-bottom: 0; }
.empty { padding: 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--ink-muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper-raised); margin-bottom: 16px; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
.list th { text-align: left; font: 500 12px/1.3 var(--mono); letter-spacing: 0.08em; color: var(--ink-muted); background: var(--paper-sunk); padding: 10px 12px; }
.list td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.list .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.list .name { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * + * { margin-left: 6px; }
.tag { display: inline-block; font: 500 11px/1 var(--mono); letter-spacing: 0.06em; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-muted); }
.tag.on { color: var(--ok); border-color: var(--ok); }
.tag.off { color: var(--danger); border-color: var(--danger); }

.copy { display: flex; gap: 8px; }
.copy input { font-family: var(--mono); font-size: 14px; }

@media (max-width: 600px) {
  h1 { font-size: 28px; }
  .list thead { display: none; }
  .list tr { display: block; padding: 8px 0; border-top: 1px solid var(--line); }
  .list tr:first-child { border-top: 0; }
  .list td { display: block; border: 0; padding: 4px 12px; text-align: left; }
  .list .num { text-align: left; }
  .row-actions { text-align: left; padding-top: 8px; }
}
