/* Who's the Rat? - shared styles for TV, phone and admin */
:root {
  --ink: #160f2b;
  --ink-2: #1d1538;
  --panel: #241b45;
  --line: #3a2f63;
  --paper: #f5f0ff;
  --muted: #a89cc8;
  --amber: #ffb627;
  --amber-ink: #2a1a00;
  --mint: #4fe0b0;
  --pink: #ff5d8a;
  --display: 'Bricolage Grotesque', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  background-image: radial-gradient(1200px 600px at 85% -10%, #2c1f5c 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #2a1240 0%, transparent 55%);
  background-attachment: fixed;
  color: var(--paper);
  font-family: var(--body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; line-height: 1.05; margin: 0; }

/* ---- buttons */
.btn {
  border: 0; border-radius: 999px; padding: 0.8em 1.4em; font-weight: 700;
  background: var(--panel); color: var(--paper); box-shadow: inset 0 0 0 2px var(--line);
  min-height: 48px; transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--amber); color: var(--amber-ink); box-shadow: 0 6px 0 #b97c00; }
.btn.primary:active { box-shadow: 0 2px 0 #b97c00; transform: translateY(4px); }
.btn.danger { background: var(--pink); color: #2b0012; box-shadow: none; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: inset 0 0 0 2px var(--line); background: var(--panel); color: var(--muted); transform: none; }

/* ---- logo */
.logo { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; display: inline-flex; align-items: baseline; gap: .25em; white-space: nowrap; }
.logo .q { color: var(--pink); }
.logo .tail { display: inline-block; width: 1.4em; height: .9em; position: relative; top: .05em; }

/* ---- shared bits */
.avatar { font-size: 1.6em; line-height: 1; }
.pill { display: inline-flex; align-items: center; gap: .4em; padding: .25em .7em; border-radius: 999px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); font-size: .85em; }
.pill.rat { background: var(--pink); color: #2b0012; box-shadow: none; }
.pill.cleared { background: var(--mint); color: #00261a; box-shadow: none; }
.muted { color: var(--muted); }
.swatch { display: inline-block; width: 1em; height: 1em; border-radius: 4px; vertical-align: -0.15em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.swatch.striped { background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.45) 0 3px, transparent 3px 7px) !important; }

/* =================================================================== TV */
body.tv { overflow: hidden; height: 100vh; font-size: clamp(14px, 1.15vw, 26px); }
.tv-shell { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; padding: 1.4em 2em 1em; gap: 1em; }
.tv-top { display: flex; align-items: center; gap: 1.5em; }
.tv-top .logo { font-size: 1.9em; }
.tv-top .spacer { flex: 1; }
.join-chip { display: flex; align-items: center; gap: .8em; padding: .35em .5em .35em 1em; background: var(--panel); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.join-chip b { font-family: var(--display); font-size: 1.3em; letter-spacing: .08em; color: var(--amber); }
.join-chip img { width: 2.6em; height: 2.6em; border-radius: 6px; background: #fff; }

.track { display: flex; align-items: center; gap: .5em; }
.track .pip { width: 2.1em; height: 2.1em; border-radius: 50%; display: grid; place-items: center; background: var(--ink-2); box-shadow: inset 0 0 0 2px var(--line); font-size: .9em; }
.track .pip.now { box-shadow: inset 0 0 0 3px var(--amber); }
.track .pip.win { background: var(--mint); color: #00261a; box-shadow: none; }
.track .pip.lose { background: var(--pink); color: #2b0012; box-shadow: none; }
.track .score { font-family: var(--display); font-size: 1.4em; margin: 0 .3em; }
.track .score .m { color: var(--mint); } .track .score .p { color: var(--pink); }

.timer { position: relative; width: 3.6em; height: 3.6em; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 7; }
.timer .bg { stroke: var(--line); }
.timer .fg { stroke: var(--amber); stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
.timer.low .fg { stroke: var(--pink); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 1.25em; }

.stage { min-height: 0; position: relative; }
.stage > section { height: 100%; }

/* lobby */
.lobby { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.3fr); gap: 2.5em; align-items: stretch; }
.lobby .joinbox { background: var(--paper); color: var(--ink); border-radius: var(--r-lg); padding: 1.6em; display: flex; flex-direction: column; gap: 1em; justify-content: center; }
.lobby .joinbox h2 { font-size: 2.2em; }
.lobby .joinbox .qr { width: min(100%, 22em); aspect-ratio: 1; align-self: center; }
.lobby .joinbox .qr img { width: 100%; height: 100%; display: block; }
.lobby .joinbox .url { font-size: 1.15em; text-align: center; word-break: break-all; }
.lobby .joinbox .code { font-family: var(--display); font-size: 3.4em; text-align: center; letter-spacing: .14em; line-height: 1; }
.lobby .right { display: flex; flex-direction: column; gap: 1.1em; min-height: 0; }
.lobby .right h2 { font-size: 2.6em; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5em, 1fr)); gap: .55em; align-content: start; overflow: hidden; flex: 1; }
.roster.dense { grid-template-columns: repeat(auto-fill, minmax(6.6em, 1fr)); font-size: .85em; }
.chip { display: flex; align-items: center; gap: .5em; padding: .45em .6em; border-radius: var(--r-md); background: var(--panel); min-width: 0; position: relative; }
.chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.chip.ready { box-shadow: inset 0 0 0 2px var(--mint); }
.chip.off { opacity: .4; }
.chip.done::after { content: '✓'; position: absolute; right: .5em; color: var(--mint); font-weight: 800; }
.chip.israt { background: var(--pink); color: #2b0012; }
.chip.iscleared { box-shadow: inset 0 0 0 2px var(--mint); }
.chip.spect { opacity: .55; font-style: italic; }
.settings { display: flex; flex-wrap: wrap; gap: .6em; align-items: center; }
.seg { display: inline-flex; background: var(--ink-2); border-radius: 999px; padding: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: .35em .9em; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed='true'] { background: var(--amber); color: var(--amber-ink); }
.toggle { display: inline-flex; align-items: center; gap: .5em; padding: .4em .9em; border-radius: 999px; background: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); border: 0; font-weight: 700; color: var(--muted); }
.toggle[aria-pressed='true'] { color: var(--paper); box-shadow: inset 0 0 0 2px var(--mint); }
.toggle[aria-pressed='true']::before { content: '●'; color: var(--mint); }
.toggle[aria-pressed='false']::before { content: '○'; }
.startrow { display: flex; align-items: center; gap: 1em; }
.startrow .btn { font-size: 1.3em; padding: .7em 2em; }

/* big moments */
.center { display: grid; place-items: center; text-align: center; height: 100%; }
.big-title { font-size: clamp(3em, 7vw, 7.5em); }
.big-title .pink { color: var(--pink); }
.lede { font-size: 1.5em; max-width: 36em; margin: .6em auto 0; color: var(--muted); }
.phone-hint { display: inline-flex; gap: .6em; align-items: center; margin-top: 1.4em; font-size: 1.3em; padding: .6em 1.2em; border-radius: 999px; background: var(--panel); }

/* briefing */
.brief { display: grid; grid-template-columns: auto 1fr; gap: 2em; align-items: center; max-width: 70em; margin: 0 auto; height: 100%; }
.brief .icon { font-size: 9em; line-height: 1; filter: drop-shadow(0 12px 30px rgba(0,0,0,.4)); }
.brief .kind { color: var(--amber); font-weight: 700; font-size: 1.3em; }
.brief h2 { font-size: 4.6em; margin: .1em 0 .25em; }
.brief p { font-size: 1.6em; margin: 0 0 .6em; max-width: 30em; }
.brief .how { color: var(--muted); font-size: 1.3em; }

/* action */
.action { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.6em; height: 100%; min-height: 0; }
.board { background: var(--ink-2); border-radius: var(--r-lg); padding: 1.3em 1.5em; display: flex; flex-direction: column; gap: .9em; min-height: 0; box-shadow: inset 0 0 0 1px var(--line); }
.board h3 { font-size: 1.6em; display: flex; align-items: center; gap: .5em; }
.board .sub { color: var(--muted); }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.side { display: flex; flex-direction: column; gap: 1em; min-height: 0; }
.clueboard { flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: .55em; }
.clueboard .empty { color: var(--muted); padding: 1em 0; }
.clue-note { background: #fff7e0; color: #2a1a00; border-radius: var(--r-sm); padding: .6em .8em; font-size: 1.02em; transform: rotate(var(--tilt, 0deg)); box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.clue-note b { display: block; font-size: .78em; color: #7a5a00; }
.progress { background: var(--ink-2); border-radius: var(--r-lg); padding: 1em 1.2em; box-shadow: inset 0 0 0 1px var(--line); }
.progress .bar { height: .8em; border-radius: 999px; background: var(--line); overflow: hidden; margin: .5em 0; }
.progress .bar i { display: block; height: 100%; background: var(--mint); transition: width .3s ease; }
.minis { display: flex; flex-wrap: wrap; gap: .2em; font-size: 1.15em; }
.minis span { opacity: .35; }
.minis span.on { opacity: 1; }

/* engine views */
.wires { display: flex; flex-direction: column; gap: .7em; }
.wire { display: grid; grid-template-columns: 4em 1fr 7em; align-items: center; gap: 1em; font-size: 1.2em; }
.wire .cable { height: 1.1em; border-radius: 999px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.3); }
.wire .cable.striped { background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.45) 0 12px, transparent 12px 28px) !important; }
.wire .slot { font-family: var(--display); color: var(--muted); }
.dials { display: flex; gap: 1em; justify-content: center; }
.dials span { width: 2.2em; height: 2.8em; font-family: var(--display); font-size: 4em; display: grid; place-items: center; background: var(--panel); border-radius: var(--r-md); box-shadow: inset 0 0 0 3px var(--line); color: var(--muted); }
.lanes { display: grid; gap: 4px; }
.lanes div { background: var(--panel); border-radius: 6px; display: grid; place-items: center; min-height: 2.3em; color: var(--muted); }
.lanes .ship { background: var(--amber); color: var(--amber-ink); font-weight: 800; }
.lanes .hd { background: transparent; font-weight: 700; color: var(--muted); }
.tilelist { display: flex; flex-wrap: wrap; gap: .6em; }
.tilelist > div { background: var(--panel); border-radius: var(--r-md); padding: .7em 1em; font-size: 1.2em; font-weight: 700; }
.mem-stage { display: grid; place-items: center; height: 100%; }
.mem-card { width: 14em; height: 14em; border-radius: 30px; display: grid; place-items: center; font-family: var(--display); font-size: 2.6em; background: var(--panel); transition: transform .15s ease; }
.mem-card.flash { transform: scale(1.06); }
.mem-pos { font-size: 1.6em; margin-top: .6em; color: var(--muted); text-align: center; }
.glyphs { display: flex; gap: .4em; justify-content: center; flex-wrap: wrap; }
.glyphs span { font-size: 3.6em; width: 1.4em; height: 1.6em; display: grid; place-items: center; background: var(--panel); border-radius: var(--r-md); }
.grid-map { display: grid; gap: 4px; width: min(100%, 50vh); margin: 0 auto; }
.grid-map div { aspect-ratio: 1; }
.grid-map .hd { aspect-ratio: auto; }
.grid-map div { background: #2f6b4f; border-radius: 4px; display: grid; place-items: center; font-size: 1.4em; }
.grid-map .hd { background: transparent; color: var(--muted); font-size: 1em; font-weight: 700; }
.grid-map .lm { background: #c8a96a; }
.table { width: 100%; border-collapse: collapse; font-size: 1.1em; }
.table td, .table th { padding: .45em .6em; text-align: left; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 700; }
.table.compact { font-size: .95em; }
.table.compact td, .table.compact th { padding: .28em .5em; }
.pattern-wrap { display: grid; grid-template-columns: auto 1fr; gap: 2em; align-items: center; }
.pgrid { display: grid; grid-template-columns: repeat(3, 4.2em); gap: 6px; }
.ptile { width: 4.2em; height: 4.2em; border-radius: 10px; background: var(--panel); display: grid; place-items: center; font-size: 1em; line-height: 1; text-align: center; }
.ptile.missing { background: transparent; border: 3px dashed var(--amber); font-family: var(--display); color: var(--amber); }
.ptile.missing span { font-size: 2em; }
.spares { display: flex; flex-wrap: wrap; gap: .6em; }
.spares .ptile { position: relative; }
.spares .ptile b { position: absolute; top: 2px; left: 6px; font-size: .8em; color: var(--muted); }

/* resolution / verdict */
.stamp { font-family: var(--display); font-size: clamp(2.6em, 5vw, 5.6em); max-width: 100%; padding: .05em .4em; border: .08em solid currentColor; border-radius: .2em; transform: rotate(-6deg); display: inline-block; animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.stamp.good { color: var(--mint); }
.stamp.bad { color: var(--pink); }
@keyframes stamp { from { transform: rotate(-6deg) scale(2.2); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 1; } }
.result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2em; align-items: center; height: 100%; }
.result .left { text-align: center; min-width: 0; padding: 0 .5em; }
.result .left p { font-size: 1.5em; }
.answers { display: grid; gap: .8em; }
.answers .row { background: var(--ink-2); border-radius: var(--r-md); padding: .8em 1em; }
.answers .row small { color: var(--muted); display: block; }
.answers .row b { font-size: 1.25em; }
.answers ul { margin: .3em 0 0; padding-left: 1.2em; }
.answers li { margin: .2em 0; }

.accuse { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2em; height: 100%; }
.accuse .main { display: flex; flex-direction: column; justify-content: center; gap: 1em; }
.accuse h2 { font-size: 5em; }
.meter { background: var(--ink-2); border-radius: var(--r-lg); padding: 1.2em; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: .5em; }
.meter .cap { color: var(--muted); font-size: .95em; }
.meter .row { display: grid; grid-template-columns: 7em 1fr 2em; gap: .6em; align-items: center; }
.meter .row i { height: .7em; border-radius: 999px; background: var(--pink); display: block; }
.verdict { text-align: center; }
.verdict .who { font-size: 8em; line-height: 1; margin-bottom: .1em; }
.verdict h2 { font-size: 4.5em; }
.tally { display: flex; justify-content: center; gap: 1.2em; flex-wrap: wrap; margin-top: 1em; font-size: 1.2em; color: var(--muted); }

.finale { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2em; height: 100%; align-items: center; }
.finale h2 { font-size: 5.5em; }
.finale .winrats { color: var(--pink); }
.finale .wininn { color: var(--mint); }
.awards { display: grid; gap: .7em; }
.award { display: grid; grid-template-columns: auto 1fr; gap: .2em 1em; align-items: center; background: var(--ink-2); border-radius: var(--r-md); padding: .8em 1em; }
.award .avatar { grid-row: span 2; font-size: 2.4em; }
.award b { font-size: 1.2em; }
.ratline { display: flex; flex-wrap: wrap; gap: .6em; margin: 1em 0; }

.tv-bottom { display: flex; align-items: center; gap: .6em; }
.tv-bottom .ticker { flex: 1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-bottom .btn { min-height: 0; padding: .45em 1em; font-size: .9em; }
.paused-banner { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(22, 15, 43, .78); z-index: 10; font-family: var(--display); font-size: 6em; }

.splash { display: grid; place-items: center; height: 100vh; text-align: center; padding: 2em; }
.splash .logo { font-size: clamp(3em, 8vw, 8em); }
.splash p { font-size: 1.4em; color: var(--muted); max-width: 32em; margin: .8em auto 1.6em; }

/* =================================================================== PHONE */
body.phone { font-size: 17px; min-height: 100vh; min-height: 100dvh; }
.ph { max-width: 560px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; min-height: 100vh; min-height: 100dvh; }
.ph-top { display: flex; align-items: center; gap: 10px; }
.ph-top .logo { font-size: 1.25em; }
.ph-top .spacer { flex: 1; }
.ph-top .me { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.ph-timer { font-family: var(--display); font-size: 1.1em; padding: 2px 10px; border-radius: 999px; background: var(--panel); min-width: 3.2em; text-align: center; }
.ph-timer.low { background: var(--pink); color: #2b0012; }
.card { background: var(--panel); border-radius: var(--r-lg); padding: 16px; box-shadow: inset 0 0 0 1px var(--line); }
.card h2 { font-size: 1.5em; margin-bottom: 6px; }
.card h3 { font-size: 1.15em; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; }
.field input { padding: 14px; border-radius: var(--r-md); border: 0; background: var(--ink-2); box-shadow: inset 0 0 0 2px var(--line); font-size: 1.15em; width: 100%; }
.field input.code { text-transform: uppercase; letter-spacing: .3em; font-family: var(--display); font-size: 1.6em; text-align: center; }
.avpick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.avpick button { font-size: 1.6em; aspect-ratio: 1; border-radius: 12px; border: 0; background: var(--ink-2); }
.avpick button[aria-pressed='true'] { background: var(--amber); }
.avpick button:disabled { opacity: .25; }
.full { width: 100%; }
.err { color: var(--pink); font-weight: 700; min-height: 1.2em; }

.role-card { border-radius: var(--r-lg); min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; background: repeating-linear-gradient(135deg, #2b2152 0 14px, #251c48 14px 28px); box-shadow: inset 0 0 0 2px var(--line); gap: 8px; }
.role-card .big { font-family: var(--display); font-size: 2.6em; line-height: 1; }
.role-card.rat { background: var(--pink); color: #2b0012; box-shadow: none; }
.role-card.innocent { background: var(--mint); color: #00261a; box-shadow: none; }
.role-card .emoji { font-size: 4.2em; line-height: 1; }

.clue { background: #fff7e0; color: #2a1a00; border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.clue.fake { background: #ffd6e2; color: #3b0016; }
.clue .tag { font-size: .8em; font-weight: 700; opacity: .75; }
.clue .txt { font-size: 1.12em; font-weight: 700; }
.clue button { align-self: flex-start; border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(0,0,0,.12); font-weight: 700; min-height: 40px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; border-radius: var(--r-md); padding: 14px; background: var(--ink-2); box-shadow: inset 0 0 0 2px var(--line); min-height: 52px; font-weight: 700; }
.opt[aria-pressed='true'] { box-shadow: inset 0 0 0 3px var(--amber); background: #3a2a10; }
.opt .num { margin-left: auto; font-family: var(--display); background: var(--amber); color: var(--amber-ink); border-radius: 999px; min-width: 1.8em; height: 1.8em; display: grid; place-items: center; }
.slotrow { margin-bottom: 12px; }
.slotrow > div:first-child { font-weight: 700; margin-bottom: 6px; }
.segs { display: flex; flex-wrap: wrap; gap: 6px; }
.segs button { flex: 1 1 30%; border: 0; border-radius: 12px; padding: 12px 8px; background: var(--ink-2); box-shadow: inset 0 0 0 2px var(--line); font-weight: 700; min-height: 48px; font-size: .95em; }
.segs button[aria-pressed='true'] { background: var(--amber); color: var(--amber-ink); box-shadow: none; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { border: 0; border-radius: 14px; background: var(--ink-2); box-shadow: inset 0 0 0 2px var(--line); font-family: var(--display); font-size: 1.6em; padding: 12px 0; }
.keydisp { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.keydisp span { width: 52px; height: 64px; border-radius: 12px; background: var(--ink-2); display: grid; place-items: center; font-family: var(--display); font-size: 2em; box-shadow: inset 0 0 0 2px var(--line); }
.keydisp span.on { box-shadow: inset 0 0 0 3px var(--amber); }
.tog { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r-md); background: var(--ink-2); box-shadow: inset 0 0 0 2px var(--line); width: 100%; border: 0; text-align: left; min-height: 52px; }
.tog .lab { flex: 1; font-weight: 700; }
.tog .state { font-family: var(--display); padding: 4px 10px; border-radius: 999px; background: var(--line); font-size: .85em; min-width: 5.5em; text-align: center; }
.tog[aria-pressed='true'] { box-shadow: inset 0 0 0 3px var(--amber); }
.tog[aria-pressed='true'] .state { background: var(--amber); color: var(--amber-ink); }
.pgrid-ph { display: grid; gap: 4px; }
.pgrid-ph button, .pgrid-ph div { aspect-ratio: 1; border: 0; border-radius: 8px; background: #2f6b4f; font-size: 1.1em; display: grid; place-items: center; padding: 0; min-height: 36px; }
.pgrid-ph .hd { background: transparent; color: var(--muted); font-weight: 700; font-size: .9em; }
.pgrid-ph .lm { background: #c8a96a; }
.pgrid-ph button[aria-pressed='true'] { background: var(--amber); }
.seqline { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; margin-bottom: 10px; }
.seqline span { background: var(--amber); color: var(--amber-ink); border-radius: 999px; padding: 6px 12px; font-weight: 700; }
.seqline .ph-empty { color: var(--muted); padding: 6px 0; }
.submit-bar { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 8px; padding-top: 6px; }
.submit-bar .btn { flex: 1; }
.done-box { text-align: center; padding: 8px 0; }
.vote-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.vote-list button { border: 0; border-radius: var(--r-md); padding: 12px 8px; background: var(--ink-2); box-shadow: inset 0 0 0 2px var(--line); display: flex; align-items: center; gap: 8px; font-weight: 700; min-height: 56px; text-align: left; overflow: hidden; }
.vote-list button span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-list button[aria-pressed='true'] { background: var(--pink); color: #2b0012; box-shadow: none; }
.overlay { position: fixed; inset: 0; background: rgba(22,15,43,.9); display: grid; place-items: center; z-index: 20; text-align: center; padding: 30px; font-family: var(--display); font-size: 1.6em; }
.banner { border-radius: var(--r-lg); padding: 18px; text-align: center; }
.banner.good { background: var(--mint); color: #00261a; }
.banner.bad { background: var(--pink); color: #2b0012; }
.banner h2 { font-size: 2em; }

/* =================================================================== ADMIN */
body.admin { font-size: 15px; }
.adm { max-width: 1300px; margin: 0 auto; padding: 18px; }
.adm header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.adm header .logo { font-size: 1.5em; }
.adm .cols { display: grid; grid-template-columns: 420px 1fr; gap: 16px; align-items: start; }
.adm .filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.adm input, .adm select, .adm textarea { background: var(--ink-2); border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; padding: 8px 10px; }
.adm textarea { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; min-height: 260px; }
.adm .list { max-height: calc(100vh - 170px); overflow: auto; border-radius: var(--r-md); background: var(--ink-2); }
.adm .item { display: grid; grid-template-columns: 1fr auto; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.adm .item:hover, .adm .item.sel { background: var(--panel); }
.adm .item small { color: var(--muted); }
.adm .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.adm label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .9em; }
.adm .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.adm .btn { min-height: 0; padding: 8px 14px; font-size: .95em; }
.adm .msg { padding: 10px; border-radius: 8px; margin: 8px 0; white-space: pre-wrap; }
.adm .msg.ok { background: #0e3a2c; } .adm .msg.bad { background: #4a1426; }
.adm pre { white-space: pre-wrap; background: var(--ink-2); padding: 10px; border-radius: 8px; font-size: 12.5px; max-height: 420px; overflow: auto; }
.adm .status { font-size: .8em; padding: 2px 8px; border-radius: 999px; align-self: start; justify-self: end; }
.adm .status.live { background: var(--mint); color: #00261a; } .adm .status.draft { background: var(--amber); color: var(--amber-ink); } .adm .status.off { background: var(--line); }

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