/* Imposter — design system (shared by the game and the admin area) */
@font-face { font-family: "Bricolage"; src: url(/fonts/bricolage.woff2) format("woff2-variations"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(/fonts/figtree.woff2) format("woff2-variations"); font-weight: 300 900; font-display: swap; }

:root {
  --bg: #F4EFE7;
  --bg-2: #EAE3D8;
  --surface: #FFFDF9;
  --surface-2: #F7F2EA;
  --line: rgba(27, 20, 36, .10);
  --line-2: rgba(27, 20, 36, .18);
  --ink: #1B1424;
  --ink-2: #4E4558;
  --ink-3: #857B8E;
  --accent: #E8401F;         /* signal red — imposter, danger, the brand */
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(232, 64, 31, .12);
  --safe: #0E9F72;           /* civilians */
  --safe-soft: rgba(14, 159, 114, .12);
  --gold: #C98A0B;
  --gold-soft: rgba(201, 138, 11, .14);
  --shadow: 0 1px 2px rgba(27, 20, 36, .06), 0 8px 24px rgba(27, 20, 36, .08);
  --shadow-lg: 0 2px 6px rgba(27, 20, 36, .08), 0 24px 60px rgba(27, 20, 36, .16);
  --radius: 22px;
  --radius-sm: 14px;
  --font-display: "Bricolage", ui-sans-serif, system-ui, sans-serif;
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0A14; --bg-2: #151020; --surface: #1A1426; --surface-2: #221B30;
    --line: rgba(240, 232, 255, .08); --line-2: rgba(240, 232, 255, .16);
    --ink: #F4EEFA; --ink-2: #B9AFC6; --ink-3: #7E7490;
    --accent: #FF5636; --accent-soft: rgba(255, 86, 54, .16);
    --safe: #33E0A6; --safe-soft: rgba(51, 224, 166, .14);
    --gold: #FFC24A; --gold-soft: rgba(255, 194, 74, .14);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.4), 0 24px 70px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0A14; --bg-2: #151020; --surface: #1A1426; --surface-2: #221B30;
  --line: rgba(240, 232, 255, .08); --line-2: rgba(240, 232, 255, .16);
  --ink: #F4EEFA; --ink-2: #B9AFC6; --ink-3: #7E7490;
  --accent: #FF5636; --accent-soft: rgba(255, 86, 54, .16);
  --safe: #33E0A6; --safe-soft: rgba(51, 224, 166, .14);
  --gold: #FFC24A; --gold-soft: rgba(255, 194, 74, .14);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.4), 0 24px 70px rgba(0,0,0,.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--font); font-size: 17px; line-height: 1.45; -webkit-font-smoothing: antialiased; min-height: 100dvh; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3, .display { font-family: var(--font-display); font-stretch: 85%; letter-spacing: -.02em; line-height: 1.02; margin: 0; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 999px; border: 0; font-weight: 700; font-size: 17px; letter-spacing: .01em; transition: transform .18s var(--ease), background .2s, box-shadow .2s, opacity .2s; user-select: none; -webkit-user-select: none; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px -10px var(--accent); }
.btn-safe { background: var(--safe); color: #04120D; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-big { min-height: 64px; font-size: 19px; padding: 0 30px; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; border: 0; background: var(--surface-2); color: var(--ink); }
.icon-btn svg, .btn svg { width: 20px; height: 20px; flex: none; }

/* cards & fields */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.field { display: grid; gap: 8px; }
.field > label, .label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.input { width: 100%; min-height: 52px; padding: 0 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-2); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; font-size: 17px; }
textarea.input { padding: 14px 16px; min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--line); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23857B8E' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 40px; }

/* segmented control */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1 1 auto; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: transparent; font-weight: 650; font-size: 15px; color: var(--ink-2); transition: all .15s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* toggle */
.toggle { position: relative; width: 52px; height: 32px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .2s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .25s var(--spring); }
.toggle input:checked + span { background: var(--safe); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.red { background: var(--accent-soft); color: var(--accent); }
.chip.green { background: var(--safe-soft); color: var(--safe); }
.chip.gold { background: var(--gold-soft); color: var(--gold); }

.toast-wrap { position: fixed; left: 0; right: 0; top: calc(12px + env(safe-area-inset-top)); display: grid; justify-items: center; pointer-events: none; z-index: 100; padding: 0 16px; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px; box-shadow: var(--shadow-lg); animation: toastIn .3s var(--spring); max-width: 520px; }
.toast.error { background: var(--accent); color: #fff; }
@keyframes toastIn { from { transform: translateY(-20px); opacity: 0; } }

.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-stretch: 80%; letter-spacing: -.02em; }
.logo svg { width: 30px; height: 30px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* shared utilities (game + admin) */
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.errors { color: var(--accent); font-weight: 650; font-size: 15px; display: grid; gap: 4px; }
.errors:empty { display: none; }
.banner { padding: 12px 16px; border-radius: 14px; background: var(--gold-soft); color: var(--ink); font-size: 15px; font-weight: 600; }
.banner.red { background: var(--accent-soft); }
.link-btn { background: none; border: 0; color: var(--ink-2); font-weight: 650; font-size: 15px; padding: 10px 12px; border-radius: 10px; display: inline-flex; gap: 8px; align-items: center; text-decoration: none; }
.link-btn svg { width: 18px; height: 18px; }
details.adv { border-radius: 16px; border: 1px dashed var(--line-2); padding: 4px 14px; }
details.adv summary { padding: 12px 0; font-weight: 700; cursor: pointer; color: var(--ink-2); list-style: none; display: flex; justify-content: space-between; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::after { content: "+"; font-size: 20px; line-height: 1; }
details.adv[open] summary::after { content: "–"; }
