/* Layout: one narrow column; the pass screen floods the whole page in the current player's color. */
:root {
  --bg: #F4F3F8;
  --surface: #FFFFFF;
  --ink: #1A1726;
  --muted: #6A6680;
  --line: #E2E0EA;
  --btn: #1A1726;
  --btn-fg: #FFFFFF;
  --caught: #1F9D55;
  --escaped: #D93A3A;
  --display: 'Bricolage Grotesque', ui-rounded, system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13111B; --surface: #1E1B29; --ink: #F2F0F8; --muted: #9C98B0; --line: #2F2B3E;
    --btn: #F2F0F8; --btn-fg: #13111B; --caught: #4ADE80; --escaped: #FF6B6B; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #13111B; --surface: #1E1B29; --ink: #F2F0F8; --muted: #9C98B0; --line: #2F2B3E;
  --btn: #F2F0F8; --btn-fg: #13111B; --caught: #4ADE80; --escaped: #FF6B6B; color-scheme: dark;
}

html { height: 100%; box-sizing: border-box; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.45;
  transition: background-color .35s ease, color .35s ease;
}
body.flood { background: var(--p); color: var(--pfg); }
#app {
  min-height: 100%; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 20px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 16px 24px;
  box-sizing: border-box;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
h1, h2 { font-family: var(--display); margin: 0; text-wrap: balance; line-height: 1.05; }

/* Top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.logo { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -.02em; }
.logo .sus { display: inline-block; transform: rotate(-12deg) translateY(-1px); color: var(--escaped); }
.ghost {
  background: none; border: 1.5px solid currentColor; border-radius: 999px;
  padding: 6px 14px; font-size: 14px; font-weight: 600; opacity: .75;
}
.ghost:hover { opacity: 1; }
.ghost.armed { opacity: 1; background: var(--escaped); border-color: var(--escaped); color: #fff; }

/* Buttons */
.btn {
  display: block; width: 100%; border: 0; border-radius: 999px;
  background: var(--btn); color: var(--btn-fg);
  padding: 16px 20px; font-size: 18px; font-weight: 700; font-family: var(--display);
  transition: transform .1s ease, opacity .2s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btns { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }

/* Setup */
.panel { background: var(--surface); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-size: 22px; display: flex; align-items: baseline; gap: 10px; }
.count { font-family: var(--body); font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.panel h2 .ghost { margin-left: auto; font-family: var(--body); font-size: 13px; padding: 4px 12px; color: var(--muted); }
.help { margin: 0; color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 8px; }
.row input, .wordform input {
  flex: 1; min-width: 0; border: 2px solid var(--line); background: var(--bg);
  border-radius: 12px; padding: 11px 12px; font-size: 16px;
}
.row input:focus, .wordform input:focus { outline: none; border-color: var(--ink); }
.add { border: 0; border-radius: 12px; background: var(--btn); color: var(--btn-fg); font-weight: 700; padding: 0 18px; }
.wordform { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
@media (max-width: 400px) {
  .wordform { grid-template-columns: 1fr 1fr; }
  .wordform .add { grid-column: 1 / -1; padding: 11px; }
}
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--p); color: var(--pfg);
  border-radius: 999px; padding: 7px 8px 7px 14px; font-weight: 700;
}
.chip button {
  border: 0; background: rgba(0,0,0,.14); color: inherit; width: 24px; height: 24px;
  border-radius: 50%; line-height: 1; font-size: 15px; display: grid; place-items: center;
}
.words { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.words li {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.words li:first-child { border-top: 0; }
.words .w { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.words .w small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.words .used .w { opacity: .45; text-decoration: line-through; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.x { border: 0; background: none; color: var(--muted); font-size: 20px; width: 32px; height: 32px; border-radius: 50%; }
.x:hover { background: var(--bg); color: var(--ink); }
.empty { border: 2px dashed var(--line); border-radius: 12px; padding: 14px; color: var(--muted); font-size: 14px; text-align: center; }
.link { background: none; border: 0; padding: 0; font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.why { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.shake { animation: shake .3s; border-color: var(--escaped) !important; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* Turn (pass screen) */
.turn { flex: 1; display: flex; flex-direction: column; gap: 22px; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.step { font-size: 14px; font-weight: 600; opacity: .8; font-variant-numeric: tabular-nums; }
.pass { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.pass h1 { font-size: clamp(48px, 15vw, 76px); font-weight: 800; letter-spacing: -.03em; overflow-wrap: anywhere; }
.dots { display: flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .25; }
.dots i.on { opacity: 1; }
.hold {
  flex: 1; min-height: 260px; position: relative; border: 0; border-radius: 28px;
  background: rgba(255,255,255,.18); color: inherit;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  display: grid; place-items: center; padding: 24px; overflow: hidden;
}
body.dark-fg .hold { background: rgba(0,0,0,.08); box-shadow: inset 0 0 0 2px rgba(0,0,0,.18); }
.hold > div { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; transition: opacity .12s; }
.hold .secret { opacity: 0; }
.hold.on .cover { opacity: 0; }
.hold.on .secret { opacity: 1; }
.hold.on { background: var(--surface); color: var(--ink); box-shadow: none; }
.fp { width: 64px; height: 64px; }
.cover strong { font-family: var(--display); font-size: 22px; font-weight: 700; }
.cover span { font-size: 14px; opacity: .8; }
.secret .big { font-family: var(--display); font-size: clamp(40px, 12vw, 60px); font-weight: 800; letter-spacing: -.02em; line-height: 1; overflow-wrap: anywhere; }
.secret .big.imp { color: var(--escaped); }
.secret .hint { font-size: 20px; font-weight: 700; }
.secret .hint b { font-family: var(--display); }
.secret small { color: var(--muted); font-size: 14px; }
.turn .btn { background: var(--pfg); color: var(--p); }

/* Discuss / vote / result */
.hero { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.hero h1 { font-size: clamp(36px, 10vw, 48px); font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 17px; }
.first {
  display: flex; align-items: center; gap: 14px; background: var(--p); color: var(--pfg);
  border-radius: var(--r); padding: 18px 20px;
}
.first .eyebrow { display: block; }
.first strong { font-family: var(--display); font-size: 30px; font-weight: 800; }
.rules { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 12px; }
.rules li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.rules li::before {
  content: counter(s); width: 30px; height: 30px; border-radius: 50%; background: var(--surface);
  display: grid; place-items: center; font-weight: 800; font-family: var(--display);
}
.vote { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vote button {
  border: 3px solid transparent; border-radius: var(--r); padding: 18px 12px;
  background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; overflow-wrap: anywhere; transition: transform .1s;
}
.vote .av {
  width: 48px; height: 48px; border-radius: 50%; background: var(--p); color: var(--pfg);
  display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 22px;
}
.vote button[aria-pressed="true"] { border-color: var(--ink); transform: scale(1.03); }
.verdict { border-radius: 28px; padding: 26px 22px; background: var(--p); color: var(--pfg); display: flex; flex-direction: column; gap: 8px; animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
.verdict h1 { font-size: clamp(44px, 13vw, 64px); font-weight: 800; letter-spacing: -.03em; }
.verdict p { margin: 0; font-size: 18px; }
.verdict .pts { display: inline-block; margin-top: 6px; align-self: flex-start; background: rgba(0,0,0,.18); padding: 6px 12px; border-radius: 999px; font-weight: 700; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.reveal-word { background: var(--surface); border-radius: var(--r); padding: 16px 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.reveal-word strong { font-family: var(--display); font-size: 26px; }
.reveal-word span { color: var(--muted); }
.board { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r); }
.board li { display: grid; grid-template-columns: 22px 14px 1fr auto; gap: 10px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.board li:first-child { border-top: 0; }
.board .rk { color: var(--muted); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.board .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--p); }
.board .nm { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.board .sc { font-family: var(--display); font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.board .delta { font-size: 13px; font-weight: 700; color: var(--caught); margin-right: 6px; font-family: var(--body); }
.section-label { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 -10px; }

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