/* =========================================================
   WHO DAT? — arcade party-game look, matched to the cover art
   (black, gold, red, blue) and the site's comic-book style.
   Styles for the WHO DAT? page.
   ========================================================= */
:root {
  --ink: #0a0a0c;
  --ink-2: #141419;
  --ink-3: #1d1d25;
  --line: #2c2c38;
  --gold: #ffc93c;
  --gold-hi: #ffe28a;
  --gold-lo: #b9831a;
  --red: #ff2a3d;
  --blue: #1fb6ff;
  --green: #2bd96b;
  --white: #f6f6f8;
  --muted: #a7a7b3;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --topbar: 56px;
  --r: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(ellipse 60% 40% at 0% 0%, rgba(255, 42, 61, .18), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(31, 182, 255, .16), transparent 70%),
    radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1.4px) 0 0 / 7px 7px,
    var(--ink);
  background-attachment: fixed;
  color: var(--white); font-family: var(--body); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { margin: 0; padding: 1rem; text-align: center; background: var(--red); }
.eyebrow { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: 0 max(.8rem, env(safe-area-inset-left)) 0 max(.8rem, env(safe-area-inset-right));
  background: rgba(10, 10, 12, .9); backdrop-filter: blur(8px);
  border-bottom: 2px solid #000; box-shadow: 0 2px 0 var(--red), 0 4px 0 var(--blue);
}
.topbar__back { color: var(--white); text-decoration: none; font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.topbar__back:hover { color: var(--gold); }
.topbar__brand {
  margin: 0; font-family: var(--display); font-size: 1.5rem; letter-spacing: .06em; color: var(--gold);
  text-shadow: -2px 0 var(--red), 2px 0 var(--blue); white-space: nowrap;
}
body[data-screen="s-home"] .topbar__brand { visibility: hidden; }
.topbar__tools { display: flex; align-items: center; gap: .45rem; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; flex: none;
  border: 2px solid var(--line); border-radius: 50%; background: var(--ink-2); cursor: pointer; font-weight: 700;
}
.icon-btn:hover { border-color: var(--gold); }
.conn { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.conn__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.conn--ok .conn__dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.conn--warn .conn__dot { background: var(--gold); }
.conn--warn { color: var(--gold); }
.conn--bad .conn__dot { background: var(--red); animation: blink 1s infinite; }
.conn--bad { color: var(--red); }
.roomtag { font-size: .75rem; font-weight: 700; letter-spacing: .1em; color: var(--muted); border: 1px solid var(--line); padding: .2rem .5rem; border-radius: 6px; }
@keyframes blink { 50% { opacity: .3; } }
@media (max-width: 560px) {
  .topbar__brand { display: none; }
  .conn__text { display: none; }
  .roomtag { display: none !important; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 46px; padding: .6rem 1.2rem; border: 3px solid #000; border-radius: 8px; cursor: pointer;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .9rem; text-decoration: none; color: var(--ink);
  box-shadow: 4px 4px 0 #000; transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #000; }
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--gold { background: var(--gold); }
.btn--blue { background: var(--blue); }
.btn--red { background: var(--red); color: var(--white); }
.btn--ghost { background: transparent; color: var(--white); border-color: var(--line); box-shadow: none; }
.btn--ghost:hover:not(:disabled) { border-color: var(--gold); box-shadow: none; transform: none; }
.btn--xl { min-height: 56px; font-size: 1.05rem; padding: .8rem 1.6rem; }
.btn--sm { min-height: 38px; padding: .35rem .8rem; font-size: .78rem; box-shadow: 3px 3px 0 #000; }
.btn--wide { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font-weight: 700; }
.row { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; }

/* ---------- screens ---------- */
.screen { padding: 1.2rem max(1rem, env(safe-area-inset-left)) 3rem; }
.panel { max-width: 480px; margin: 1.5rem auto; background: var(--ink-2); border: 3px solid #000; border-radius: var(--r); box-shadow: 6px 6px 0 var(--red); padding: 1.6rem 1.4rem; }
.panel__title { margin: 0 0 .4rem; font-family: var(--display); font-weight: 400; font-size: 2.2rem; letter-spacing: .04em; color: var(--gold); text-transform: uppercase; }
.panel__lead { margin: 0 0 1.2rem; color: var(--muted); }
.form { display: grid; gap: .9rem; }
.field { display: grid; gap: .3rem; }
.field__label { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.field__input {
  width: 100%; min-height: 48px; padding: .6rem .8rem; border: 2px solid var(--line); border-radius: 8px; background: var(--ink);
  font-size: 1.05rem;
}
.field__input:focus { border-color: var(--gold); outline: none; }
.field__input--code { font-family: var(--display); letter-spacing: .3em; font-size: 1.6rem; text-transform: uppercase; text-align: center; }
.form__error { margin: 0; min-height: 1.2em; color: #ff8a95; font-weight: 700; }
.or { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--line); }

/* ---------- home / cover ---------- */
.screen--home { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 1rem; }
.cover { margin: 0; width: min(92vw, 520px, max(260px, calc(100vh - 340px))); width: min(92vw, 520px, max(260px, calc(100dvh - 340px))); }
.cover__img {
  display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain;
  border: 3px solid #000; border-radius: 14px; background: #000;
  box-shadow: -6px 6px 0 var(--red), 6px 6px 0 var(--blue), 0 0 50px rgba(255, 201, 60, .25);
  animation: cover-in .6s ease-out both;
}
@keyframes cover-in { from { opacity: 0; transform: scale(.94) translateY(8px); } }
.home__tag { margin: 1.3rem auto .3rem; max-width: 30rem; font-weight: 700; color: var(--white); }
.home__actions { display: grid; gap: .8rem; width: min(100%, 360px); margin-top: 1rem; }

/* ---------- waiting room ---------- */
#s-wait { text-align: center; }
.room-code { margin: .2rem 0 1rem; font-family: var(--display); font-size: clamp(3rem, 14vw, 4.4rem); letter-spacing: .25em; color: var(--gold); text-shadow: -3px 0 var(--red), 3px 0 var(--blue); padding-left: .25em; }
.copy-note { min-height: 1.3em; color: var(--green); font-weight: 700; word-break: break-all; font-size: .9rem; }
.seats { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: .5rem; text-align: left; }
.seat { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border: 2px solid var(--line); border-radius: 8px; background: var(--ink); font-weight: 700; }
.seat__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.seat.is-on .seat__dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.seat--empty { color: var(--muted); border-style: dashed; font-weight: 500; }
.waiting-dots { color: var(--muted); }
.waiting-dots::after { content: "…"; animation: blink 1.2s infinite; }

/* ---------- pass the device ---------- */
.cover-screen { min-height: calc(100vh - var(--topbar)); min-height: calc(100dvh - var(--topbar)); display: grid; place-items: center; }
.pass { text-align: center; max-width: 30rem; padding: 2rem 1.4rem; background: var(--ink-2); border: 3px solid #000; border-radius: 16px; box-shadow: -6px 6px 0 var(--red), 6px 6px 0 var(--blue); }
.pass__title { margin: .4rem 0; font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 10vw, 3.6rem); line-height: 1.05; text-transform: uppercase; color: var(--white); }
.pass__msg { color: var(--muted); margin: 0 0 1.4rem; }

/* ---------- character cards ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .55rem; }
.card {
  position: relative; display: flex; flex-direction: column; padding: 0; cursor: pointer; text-align: center;
  background: var(--ink-3); border: 3px solid #000; border-radius: 10px; overflow: hidden;
  box-shadow: 3px 3px 0 #000; transform-origin: 50% 100%;
  transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), filter .3s, opacity .3s, box-shadow .2s;
}
.card:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 3px 6px 0 #000; }
.card__pic { display: block; aspect-ratio: 120 / 140; }
.card__pic svg { display: block; width: 100%; height: 100%; }
.card__name {
  display: block; padding: .25rem .2rem .3rem; font-weight: 700; font-size: .82rem; line-height: 1.15;
  background: var(--white); color: var(--ink); border-top: 3px solid #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card__x { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s; }
.card__x::before, .card__x::after {
  content: ""; position: absolute; left: 50%; top: 42%; width: 90%; height: 7px; border-radius: 4px;
  background: var(--red); box-shadow: 0 0 0 2px #000;
}
.card__x::before { transform: translate(-50%, -50%) rotate(45deg); }
.card__x::after { transform: translate(-50%, -50%) rotate(-45deg); }
/* knocked down: card tips back, goes grey, red X */
.card.is-down { transform: perspective(500px) rotateX(58deg) translateY(4px); filter: grayscale(1) brightness(.45); box-shadow: 0 0 0 #000; }
.card.is-down .card__x { opacity: 1; }
.card.is-down:hover { transform: perspective(500px) rotateX(48deg) translateY(2px); }
.card.is-secret { outline: 3px solid var(--gold); outline-offset: 2px; }
/* select mode */
.card.is-picked { outline: 4px solid var(--gold); outline-offset: 2px; transform: translateY(-4px) scale(1.03); box-shadow: 0 0 22px rgba(255, 201, 60, .6), 3px 6px 0 #000; }
.card:disabled { cursor: default; opacity: .35; }
/* guess mode */
.board--guess .card:not(.is-down) { animation: pulse 1.4s ease-in-out infinite; }
.board--guess .card:not(.is-down):hover { outline: 4px solid var(--red); outline-offset: 2px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px var(--red), 3px 3px 0 #000; } }

/* ---------- select screen ---------- */
.screen--select { max-width: 1000px; margin: 0 auto; }
.select-head { text-align: center; margin-bottom: 1rem; }
.select-title { margin: .2rem 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.9rem, 6vw, 2.8rem); text-transform: uppercase; letter-spacing: .03em; }
.select-sub { margin: 0; color: var(--muted); }
.select-bar {
  position: sticky; bottom: 0; z-index: 5; margin-top: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); background: rgba(20, 20, 25, .96); border: 3px solid #000; border-radius: 12px; box-shadow: 0 -4px 20px rgba(0, 0, 0, .5);
}
.select-bar__pick { margin: 0; font-weight: 700; }

/* ---------- game layout ---------- */
.screen--game { max-width: 1320px; margin: 0 auto; padding-top: .8rem; }
.turn {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem 1rem; margin-bottom: .9rem; padding: .7rem 1rem;
  border: 3px solid #000; border-radius: 12px; background: var(--ink-2); box-shadow: 4px 4px 0 var(--blue);
}
.turn--mine { box-shadow: 4px 4px 0 var(--gold); background: linear-gradient(90deg, rgba(255, 201, 60, .16), var(--ink-2) 60%); }
.turn--alert { box-shadow: 4px 4px 0 var(--red); background: linear-gradient(90deg, rgba(255, 42, 61, .2), var(--ink-2) 60%); animation: nudge .6s ease-out; }
@keyframes nudge { 30% { transform: translateX(-4px); } 60% { transform: translateX(4px); } }
.turn__who { margin: 0; font-family: var(--display); font-size: 1.7rem; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; }
.turn--mine .turn__who { color: var(--gold); }
.turn__step { margin: 0; color: #dcdce4; }

.game { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.1rem; align-items: start; }
.game__side { display: grid; gap: 1rem; position: sticky; top: calc(var(--topbar) + .8rem); }

.board-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .7rem; margin-bottom: .8rem; }
.mine { display: flex; align-items: center; gap: .6rem; padding: .35rem .8rem .35rem .35rem; background: var(--ink-2); border: 2px solid var(--gold); border-radius: 10px; }
.mine__pic { width: 46px; height: 54px; border-radius: 6px; overflow: hidden; border: 2px solid #000; flex: none; }
.mine__svg, .mine__svg svg { display: block; width: 100%; height: 100%; }
.mine__label { display: block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.mine__name { font-size: 1.05rem; }
.counts { display: flex; gap: .5rem; flex-wrap: wrap; }
.count { padding: .3rem .7rem; border-radius: 999px; background: var(--ink-2); border: 2px solid var(--line); font-size: .82rem; color: var(--muted); }
.count strong { color: var(--white); font-size: 1rem; }
.count--opp strong { color: var(--blue); }
.guess-banner { margin: 0 0 .7rem; padding: .6rem .9rem; border-radius: 8px; background: rgba(255, 42, 61, .18); border: 2px solid var(--red); font-weight: 700; }
.board-hint { margin: .7rem 0 0; color: var(--muted); font-size: .85rem; text-align: center; }

/* ---------- action panel ---------- */
.action { display: grid; gap: .7rem; padding: 1rem; background: var(--ink-2); border: 3px solid #000; border-radius: 12px; box-shadow: 4px 4px 0 var(--red); }
.ask { display: grid; gap: .5rem; }
.ask__label { font-family: var(--display); font-size: 1.3rem; letter-spacing: .04em; text-transform: uppercase; color: var(--gold); }
.ask__input { width: 100%; min-height: 50px; padding: .6rem .8rem; border: 2px solid var(--line); border-radius: 8px; background: var(--ink); font-size: 1rem; }
.ask__input:focus { border-color: var(--gold); outline: none; }
.ask__meta { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.ask__count { color: var(--muted); font-size: .8rem; }
.qcard { margin: .2rem 0 0; padding: .7rem .9rem; border-radius: 8px; background: var(--ink); border: 2px solid var(--line); font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.qcard--big { font-size: 1.25rem; border-color: var(--gold); }
.pending__msg { margin: .5rem 0 0; color: var(--muted); }
.pending__msg::after { content: "…"; animation: blink 1.2s infinite; }
.answer-box { display: grid; gap: .5rem; }
.answer-badge { justify-self: start; margin: 0; padding: .25rem 1rem; border: 3px solid #000; border-radius: 8px; font-family: var(--display); font-size: 2rem; letter-spacing: .08em; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.answer-badge--yes { background: var(--green); color: #04220f; }
.answer-badge--no { background: var(--red); color: var(--white); }
.answer-badge--sm { font-size: .9rem; padding: .05rem .5rem; border-width: 2px; animation: none; justify-self: end; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.answer-hint { margin: 0; color: #dcdce4; font-size: .92rem; }
.respond { display: grid; gap: .5rem; }
.respond__hint { margin: 0; color: var(--muted); font-size: .85rem; }
.yn { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .3rem; }
.yn__btn {
  min-height: 70px; border: 3px solid #000; border-radius: 12px; cursor: pointer; font-family: var(--display); font-size: 2rem; letter-spacing: .08em;
  box-shadow: 4px 4px 0 #000; transition: transform .12s, box-shadow .12s;
}
.yn__btn:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #000; }
.yn__btn:disabled { opacity: .5; }
.yn__btn--yes { background: var(--green); color: #04220f; }
.yn__btn--no { background: var(--red); color: var(--white); }
.idle { margin: 0; color: #dcdce4; }
.guess-btn { border-style: dashed; border-color: var(--red); color: #ffb3ba; }
.guess-btn.is-on { background: var(--red); color: var(--white); border-style: solid; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: 340px; background: var(--ink-2); border: 3px solid #000; border-radius: 12px; box-shadow: 4px 4px 0 var(--blue); overflow: hidden; }
.chat__head { display: flex; align-items: center; justify-content: space-between; padding: .55rem .8rem; background: linear-gradient(90deg, rgba(31, 182, 255, .25), transparent); border-bottom: 2px solid #000; }
.chat__title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.15rem; letter-spacing: .08em; color: var(--blue); }
.chat__close { display: none; }
.chat__note { margin: 0; padding: .35rem .8rem; font-size: .75rem; background: rgba(255, 201, 60, .14); color: var(--gold-hi); }
.chat__list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: .7rem; display: flex; flex-direction: column; gap: .45rem; overscroll-behavior: contain; }
.chat__empty { color: var(--muted); font-size: .9rem; text-align: center; margin: auto 0; }
.msg { max-width: 86%; padding: .4rem .65rem .45rem; border-radius: 12px; display: grid; gap: .1rem; animation: msg-in .2s ease-out; }
@keyframes msg-in { from { transform: translateY(6px); opacity: 0; } }
.msg--me { align-self: flex-end; background: var(--blue); color: #021826; border-bottom-right-radius: 3px; }
.msg--them { align-self: flex-start; background: var(--ink-3); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.msg__head { display: flex; gap: .5rem; align-items: baseline; font-size: .7rem; font-weight: 700; opacity: .8; }
.msg__text { overflow-wrap: anywhere; white-space: pre-wrap; }
.chat__form { padding: .5rem; border-top: 2px solid #000; display: grid; gap: .35rem; }
.emoji { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.emoji button { border: 0; background: none; font-size: 1.15rem; padding: .1rem .25rem; cursor: pointer; border-radius: 6px; }
.emoji button:hover { background: var(--ink-3); }
.chat__row { display: flex; gap: .4rem; }
.chat__input { flex: 1; min-width: 0; min-height: 40px; padding: .4rem .7rem; border: 2px solid var(--line); border-radius: 8px; background: var(--ink); }
.chat__input:focus { border-color: var(--blue); outline: none; }
.chat__status { margin: 0; min-height: 1em; font-size: .72rem; color: var(--muted); }
.chat__status.is-ok { color: var(--green); }
.chat__status.is-bad { color: #ff8a95; }
.chat-fab { display: none; }
.scrim { display: none; }

/* ---------- history ---------- */
.history { background: var(--ink-2); border: 3px solid #000; border-radius: 12px; overflow: hidden; }
.history__title { cursor: pointer; padding: .6rem .9rem; font-family: var(--display); font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.history__list { list-style: none; margin: 0; padding: 0 .7rem .7rem; display: grid; gap: .35rem; max-height: 260px; overflow-y: auto; }
.history__item { display: grid; grid-template-columns: auto 1fr auto; gap: .1rem .5rem; align-items: center; padding: .4rem .55rem; border-radius: 8px; background: var(--ink); font-size: .88rem; }
.history__n { color: var(--muted); font-size: .75rem; }
.history__who { font-weight: 700; color: var(--blue); }
.history__q { grid-column: 1 / 3; overflow-wrap: anywhere; }
.history__item .answer-badge { grid-row: 1 / 3; grid-column: 3; }
.history__empty { color: var(--muted); font-size: .88rem; padding: .3rem; }

/* ---------- results ---------- */
.screen--results { position: relative; text-align: center; max-width: 720px; margin: 0 auto; padding-top: 2rem; overflow: hidden; }
.res-title {
  margin: .2rem 0; font-family: var(--display); font-weight: 400; font-size: clamp(3rem, 14vw, 5.5rem); line-height: 1; text-transform: uppercase;
  color: var(--gold); text-shadow: -4px 0 var(--red), 4px 0 var(--blue), 0 0 40px rgba(255, 201, 60, .45); animation: pop .5s cubic-bezier(.3, 1.6, .5, 1);
}
.is-loss .res-title { color: var(--white); text-shadow: -3px 0 var(--red), 3px 0 var(--blue); }
.res-sub { font-size: 1.1rem; font-weight: 700; margin: .4rem 0 1.4rem; }
.reveal { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; }
.reveal__card { margin: 0; width: min(42vw, 190px); background: var(--ink-2); border: 3px solid #000; border-radius: 12px; overflow: hidden; box-shadow: 4px 4px 0 var(--blue); }
.reveal__card.is-winner { box-shadow: 4px 4px 0 var(--gold), 0 0 30px rgba(255, 201, 60, .4); }
.reveal__pic, .reveal__pic svg { display: block; width: 100%; aspect-ratio: 120 / 140; }
.reveal__none { display: grid; place-items: center; aspect-ratio: 120 / 140; font-family: var(--display); font-size: 4rem; color: var(--muted); }
.reveal__cap { padding: .5rem; display: grid; }
.reveal__who { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.reveal__name { font-size: 1.15rem; }
.res-note { min-height: 1.4em; margin: 1.2rem 0 .4rem; font-weight: 700; color: var(--gold-hi); }
.res-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.confetti__p { position: absolute; top: -20px; left: var(--x); width: 10px; height: 16px; background: var(--c); border: 1px solid #000; animation: fall var(--d) var(--delay) linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(var(--r)); } }

/* ---------- toast & dialogs ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; max-width: min(92vw, 460px);
  padding: .7rem 1.1rem; background: var(--red); color: var(--white); font-weight: 700; border: 3px solid #000; border-radius: 10px; box-shadow: 4px 4px 0 #000;
}
.dialog { max-width: min(92vw, 480px); padding: 1.4rem; color: var(--white); background: var(--ink-2); border: 3px solid #000; border-radius: 14px; box-shadow: -6px 6px 0 var(--red), 6px 6px 0 var(--blue); }
.dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(2px); }
.dialog h2 { margin: 0 0 .8rem; font-family: var(--display); font-weight: 400; font-size: 1.8rem; letter-spacing: .03em; text-transform: uppercase; color: var(--gold); }
.how { padding-left: 1.2rem; display: grid; gap: .55rem; margin: 0 0 1rem; }
.how-note { color: var(--muted); font-size: .9rem; }
.guess-pick { display: flex; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.guess-pick__pic { width: 90px; border: 3px solid #000; border-radius: 10px; overflow: hidden; flex: none; }
.guess-pick__pic svg { display: block; width: 100%; height: auto; }
.guess-pick__name { font-family: var(--display); font-size: 1.8rem; letter-spacing: .04em; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) { .game { grid-template-columns: minmax(0, 1fr) 320px; } .board { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* phones & small tablets: board first, chat becomes a slide-up drawer */
@media (max-width: 899px) {
  .game { display: flex; flex-direction: column; align-items: stretch; gap: .9rem; }
  .game__side { display: contents; }
  .action { order: 1; position: sticky; top: calc(var(--topbar) + .4rem); z-index: 6; box-shadow: 0 6px 20px rgba(0, 0, 0, .55), 4px 4px 0 var(--red); }
  .game__board { order: 2; }
  .history { order: 3; }
  .board { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
  .turn { margin-bottom: .6rem; }
  .turn__who { font-size: 1.4rem; }
  .yn__btn { min-height: 58px; }
  .answer-badge { font-size: 1.6rem; }

  .chat {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: min(72vh, 560px); height: min(72dvh, 560px);
    border-radius: 16px 16px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .7);
    padding-bottom: env(safe-area-inset-bottom);
    transform: translateY(105%); visibility: hidden; transition: transform .28s ease, visibility 0s linear .28s;
  }
  .chat-open .chat { transform: none; visibility: visible; transition: transform .28s ease; }
  .chat__close { display: grid; }
  .chat-fab {
    display: inline-flex; align-items: center; gap: .4rem; position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 45;
    padding: .7rem 1.1rem; border: 3px solid #000; border-radius: 999px; background: var(--blue); color: #021826; font-weight: 700; cursor: pointer; box-shadow: 4px 4px 0 #000;
  }
  .chat-open .chat-fab { visibility: hidden; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(0, 0, 0, .55); }
  .screen--game { padding-bottom: 6rem; }
}
.badge { min-width: 1.3rem; height: 1.3rem; padding: 0 .3rem; display: inline-grid; place-items: center; border-radius: 999px; background: var(--red); color: var(--white); font-size: .72rem; border: 2px solid #000; animation: pop .3s; }

@media (max-width: 420px) {
  .board { gap: .35rem; }
  .card { border-width: 2px; border-radius: 8px; }
  .card__name { font-size: .7rem; border-top-width: 2px; }
  .btn--xl { min-height: 52px; }
  .select-bar { flex-direction: column; align-items: stretch; text-align: center; gap: .5rem; }
  .screen { padding-left: .7rem; padding-right: .7rem; }
}

/* respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .card.is-down { transform: none; }
}
