/* Holdout — "Locker room": near-black, safety orange, heavy condensed type. */
:root {
  --bg: #121212;
  --panel: #1C1C1C;
  --panel-2: #262626;
  --line: #2F2F2F;
  --ink: #F4F1EA;
  --ink-soft: #A8A39B;
  --ink-mute: #77726B;
  --orange: #F26A1B;
  --orange-press: #D9580C;
  --on-orange: #121212;
  --out: #5A5651;
  --danger: #FF6B5E;
  --radius: 14px;
  --font: 'Barlow', system-ui, sans-serif;
  --font-label: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-display: 'Anton', 'Impact', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--orange); }
svg.i { width: 1.2em; height: 1.2em; vertical-align: -0.22em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom));
}

/* ── Type ─────────────────────────────────────────────────────────── */

.display { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.02; margin: 0; }
.label { font-family: var(--font-label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 14px; color: var(--ink-soft); margin: 0; }
.muted { color: var(--ink-soft); }
.error { color: var(--danger); margin: 8px 0 0; font-size: 15px; }

/* ── Top bar ──────────────────────────────────────────────────────── */

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand span { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.04em; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font-family: var(--font-label); font-weight: 700; font-size: 18px; flex: none; }
.avatar.me { background: var(--orange); color: var(--on-orange); }
button.avatar { border: 0; }

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 22px; width: 100%;
  border-radius: var(--radius); border: 0;
  background: var(--orange); color: var(--on-orange);
  font-family: var(--font-label); font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: 0.06em;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); background: var(--orange-press); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:active { background: var(--panel); }
.btn.quiet { background: transparent; color: var(--ink-soft); min-height: 44px; font-size: 17px; }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid currentColor; }
.btn.google { background: var(--ink); color: #1F1F1F; text-transform: none; letter-spacing: 0; font-family: var(--font); font-weight: 600; font-size: 18px; }
.btn[disabled] { opacity: 0.55; }
.stack { display: grid; gap: 10px; margin-top: 18px; }

/* ── Sign in ──────────────────────────────────────────────────────── */

.welcome { min-height: calc(100dvh - 80px); display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 20px 4px; }
.welcome .mark { width: 96px; height: 96px; border-radius: 22px; }
.welcome h1 { font-size: 64px; }
.welcome .tag { font-size: 40px; color: var(--orange); }
.welcome p { margin: 0; color: var(--ink-soft); font-size: 18px; max-width: 30em; }
.devlogin { margin-top: 10px; padding-top: 16px; border-top: 1px dashed var(--line); }
.devlogin .row { display: flex; gap: 8px; margin-top: 8px; }
.devlogin .btn { min-height: 44px; font-size: 16px; }

/* ── Home ─────────────────────────────────────────────────────────── */

.section { margin-top: 26px; }
.section > .label { margin-bottom: 10px; }
.cards { display: grid; gap: 10px; }
.card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel);
}
.card:active { background: var(--panel-2); }
.card .tile { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); color: var(--orange); font-size: 22px; flex: none; }
.card.done .tile { color: var(--ink-soft); }
.card .body { flex: 1; min-width: 0; }
.card .title, .card .meta { display: block; }
.card .title { font-family: var(--font-display); font-size: 21px; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1.1; overflow-wrap: anywhere; }
.card .meta { font-family: var(--font-label); font-weight: 600; font-size: 15px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); margin-top: 3px; }
.pill { font-family: var(--font-label); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; white-space: nowrap; flex: none; }
.pill.in { background: var(--orange); color: var(--on-orange); }
.pill.out { background: var(--panel-2); color: var(--ink-mute); }
.pill.won { background: var(--ink); color: var(--bg); }
.empty { text-align: center; padding: 48px 12px 8px; }
.empty img { width: 72px; height: 72px; border-radius: 16px; opacity: 0.9; }
.empty h2 { font-size: 32px; margin-top: 16px; }
.empty p { color: var(--ink-soft); margin: 8px auto 0; max-width: 22em; }

/* ── Create ───────────────────────────────────────────────────────── */

.form h1 { font-size: 40px; margin-bottom: 18px; }
.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.kind {
  display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--panel); font-family: var(--font-label); font-weight: 700;
  font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft);
}
.kind svg.i { font-size: 26px; color: var(--ink); }
.kind[aria-pressed="true"] { border-color: var(--orange); color: var(--ink); background: #2A1B12; }
.kind[aria-pressed="true"] svg.i { color: var(--orange); }
.field { display: grid; gap: 6px; margin-top: 18px; }
.field input, .field textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--panel); font-size: 18px;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--orange); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--panel);
  font-family: var(--font-label); font-weight: 700; font-size: 16px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft);
}
.chip[aria-pressed="true"] { border-color: var(--orange); background: var(--orange); color: var(--on-orange); }
.summary { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border-left: 4px solid var(--orange); font-size: 16px; }

/* ── A challenge ──────────────────────────────────────────────────── */

.hero { display: grid; gap: 10px; }
.hero .kicker { display: flex; align-items: center; gap: 8px; color: var(--orange); }
.hero h1 { font-size: 44px; overflow-wrap: anywhere; }
.rule { margin: 4px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--panel); border-left: 4px solid var(--orange); }
.rule .label { font-size: 13px; color: var(--orange); }
.rule p { margin: 2px 0 0; font-size: 18px; }
.board { margin-top: 18px; padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.board .big { font-size: 76px; line-height: 0.95; }
.board .big small { font-size: 28px; color: var(--ink-soft); margin-left: 8px; }
.board .count { display: flex; align-items: baseline; gap: 10px; }
.board .clock { font-family: var(--font-display); font-size: 52px; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; line-height: 1; margin-top: 6px; }
.board .when { margin-top: 10px; font-size: 15px; color: var(--ink-soft); }
.bar { height: 10px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin: 14px 0 8px; }
.bar > span { display: block; height: 100%; width: 0; background: var(--orange); border-radius: inherit; }
.board .row { display: flex; justify-content: space-between; gap: 12px; }
.banner { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); color: var(--ink-soft); font-size: 16px; }
.winner { display: grid; gap: 4px; }
.winner .trophy { font-size: 40px; color: var(--orange); }
.winner .names { font-size: 40px; overflow-wrap: anywhere; }
.btn.out-button { min-height: 64px; font-size: 22px; background: transparent; color: var(--danger); border: 2px solid var(--danger); }
.btn.out-button:active { background: #2B1513; }
.roster { margin-top: 22px; }
.roster .label { margin-bottom: 6px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.person .name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.person .name small { display: block; font-weight: 400; color: var(--ink-mute); font-size: 14px; }
.person.is-out .name { color: var(--ink-mute); }
.person.is-out .who { text-decoration: line-through; text-decoration-color: var(--out); }
.person.is-out .avatar { color: var(--ink-mute); }
.tag { font-family: var(--font-label); font-weight: 700; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-mute); margin-left: 6px; }

/* ── Invite ───────────────────────────────────────────────────────── */

.invite { padding-top: 12px; }
.invite .kicker { color: var(--orange); font-size: 16px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.fact { padding: 12px; border-radius: 12px; background: var(--panel); }
.fact .label { font-size: 12px; }
.fact div:last-child { font-weight: 600; margin-top: 2px; }

/* ── Sheets and toast ─────────────────────────────────────────────── */

dialog.sheet {
  width: min(520px, 100%); max-width: 100%; margin: auto auto 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  border: 0; border-radius: 22px 22px 0 0; background: var(--panel); color: var(--ink);
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.65); }
dialog.sheet h2 { font-size: 34px; }
dialog.sheet p { color: var(--ink-soft); margin: 10px 0 0; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--bg);
  font-weight: 600; z-index: 10;
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
