/* Imposter (public/arcade/imposter.js). The arcade's black CRT. The one bold thing is the secret card: an indigo card
   back with a periwinkle pixel weave and a big "?", flipping over to a white card with the word in Jersey 10, or to
   raspberry (the room's second player colour) for the imposter. Raspberry marks the imposter everywhere else too. */
.ag-stage[data-kind="imposter"] { container: ip / size; }
.ag-stage[data-kind="imposter"] .ip {
  --rasp: #e0457b; --rasp-dark: #7a1a3d; --card: #f6f7ff; --ink: #12142e; --hot: #7c8cff; --mute: var(--ac-ink-2); --line: var(--ac-line);
  position: absolute; inset: 0; display: flex; flex-direction: column; color: var(--ac-ink); font: 400 16px/1.35 var(--font);
}
.ag-stage[data-kind="imposter"] .ip [hidden] { display: none !important; }
.ag-stage[data-kind="imposter"] .ip :is(p, h3) { margin: 0; }

/* ---------- category and clock ---------- */
.ag-stage[data-kind="imposter"] .ip-head { position: relative; flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 14px 9px; }
.ag-stage[data-kind="imposter"] .ip-cat { min-width: 0; font: 400 28px/1 var(--ac-pixel); letter-spacing: .02em; color: var(--card); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-stage[data-kind="imposter"] .ip-cat span { margin-right: 4px; font: 400 14px/1 var(--font); letter-spacing: 0; color: var(--mute); }
.ag-stage[data-kind="imposter"] .ip-clock { flex: none; font: 400 30px/1 var(--ac-pixel); font-variant-numeric: tabular-nums; color: var(--card); }
.ag-stage[data-kind="imposter"] .ip-clock.low { color: var(--hot); animation: ip-blink 1s steps(1) infinite; }
@keyframes ip-blink { 50% { opacity: .4; } }
.ag-stage[data-kind="imposter"] .ip-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.ag-stage[data-kind="imposter"] .ip-bar b { position: absolute; inset: 0; background: var(--hot); transform-origin: left; }

.ag-stage[data-kind="imposter"] .ip-scroll { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 0 14px; }
.ag-stage[data-kind="imposter"] .ip[data-phase="done"] .ip-scroll { padding-bottom: 220px; }

/* ---------- the secret card ---------- */
.ag-stage[data-kind="imposter"] .ip-cardw { display: flex; justify-content: center; padding: 0 16px; }
.ag-stage[data-kind="imposter"] .ip-card { position: relative; width: min(300px, 100%); height: clamp(92px, 17cqh, 124px); margin-right: 5px; padding: 0; border: 0;
  background: none; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* turning it over: squashed flat, the other face shows, back out (a flat turn: WebKit mirrors 3D card backs) */
.ag-stage[data-kind="imposter"] .ip-card.flip { animation: ip-flip .32s steps(6, end); }
@keyframes ip-flip { 50% { transform: scaleX(.04); } }
.ag-stage[data-kind="imposter"] .ip-card:not(.open) .ip-front, .ag-stage[data-kind="imposter"] .ip-card.open .ip-back { visibility: hidden; }
.ag-stage[data-kind="imposter"] .ip-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 12px; }
.ag-stage[data-kind="imposter"] .ip-back { background: #3340a0; box-shadow: 5px 5px 0 #222b73, inset 0 0 0 6px #3340a0, inset 0 0 0 8px #7c8cff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' shape-rendering='crispEdges'%3E%3Cpath fill='%235a68e0' d='M4 4h2v2H4z'/%3E%3C/svg%3E"); }
.ag-stage[data-kind="imposter"] .ip-q { font: 400 64px/.8 var(--ac-pixel); color: var(--card); text-shadow: 4px 4px 0 #222b73; }
.ag-stage[data-kind="imposter"] .ip-hint { padding: 2px 10px; border-radius: 4px; background: #222b73; font: 700 14px/1.3 var(--font); color: var(--card); }
.ag-stage[data-kind="imposter"] .ip-front { background: var(--card); color: var(--ink); box-shadow: 5px 5px 0 #9ea3c6; }
.ag-stage[data-kind="imposter"] .ip-card.imp .ip-front { background: var(--rasp); color: #fff; box-shadow: 5px 5px 0 var(--rasp-dark); }
.ag-stage[data-kind="imposter"] .ip-big { max-width: 92%; font: 400 clamp(40px, 9cqw, 58px)/.9 var(--ac-pixel); letter-spacing: .03em; overflow-wrap: anywhere; text-align: center; }
.ag-stage[data-kind="imposter"] .ip-small { font: 400 14px/1.3 var(--font); opacity: .8; text-align: center; padding: 0 10px; }

/* ---------- the table ---------- */
.ag-stage[data-kind="imposter"] .ip-table { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 4px; padding: 16px 10px 4px; }
.ag-stage[data-kind="imposter"] .ip-seat { position: relative; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 5px;
  border: 2px solid transparent; border-radius: 12px; background: none; color: inherit; font: inherit; }
.ag-stage[data-kind="imposter"] .ip-sf { width: 44px; height: 44px; border-radius: 50%; background: #171a3a; overflow: hidden; }
.ag-stage[data-kind="imposter"] .ip-sf :is(.mface, img, svg), .ag-stage[data-kind="imposter"] .ip-cs :is(.mface, img, svg) { display: block; width: 100%; height: 100%; }
.ag-stage[data-kind="imposter"] .ip-bot { display: grid; place-items: center; width: 100%; height: 100%; background: var(--bc); color: #fff; font: 400 26px/1 var(--ac-pixel); }
.ag-stage[data-kind="imposter"] .ip-sn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 18px/1 var(--ac-pixel); letter-spacing: .02em; color: var(--mute); }
.ag-stage[data-kind="imposter"] .ip-seat.me .ip-sn { color: var(--card); }
.ag-stage[data-kind="imposter"] .ip-seat.on { border-color: var(--hot); }
.ag-stage[data-kind="imposter"] .ip-seat.on .ip-sn { color: var(--hot); }
.ag-stage[data-kind="imposter"] .ip-seat.on .ip-sf { animation: ip-talk .9s steps(2) infinite; }
@keyframes ip-talk { 50% { transform: translateY(-3px); } }
.ag-stage[data-kind="imposter"] .ip-seat.gone { opacity: .4; }
.ag-stage[data-kind="imposter"] .ip-tag { padding: 1px 6px; border-radius: 4px; background: var(--line); font: 700 11px/1.3 var(--font); color: var(--card); }
.ag-stage[data-kind="imposter"] .ip-tag.ok { background: #1c2250; color: var(--hot); }
.ag-stage[data-kind="imposter"] .ip-seat.caught { border-color: var(--rasp); }
.ag-stage[data-kind="imposter"] .ip-seat.caught .ip-sn { color: var(--rasp); }
.ag-stage[data-kind="imposter"] .ip-seat.caught .ip-tag { background: var(--rasp); color: #fff; }
.ag-stage[data-kind="imposter"] .ip-votes { position: absolute; top: 2px; right: 6px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 4px;
  background: var(--card); color: var(--ink); font: 400 18px/20px var(--ac-pixel); font-style: normal; text-align: center; }
/* voting: every chair is a button */
.ag-stage[data-kind="imposter"] .ip-table.voting .ip-seat { width: 80px; min-height: 92px; border-color: var(--line); background: #0b0c1a; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ag-stage[data-kind="imposter"] .ip-table.voting .ip-seat:disabled { cursor: default; border-color: transparent; background: none; }
.ag-stage[data-kind="imposter"] .ip-table.voting .ip-seat:not(:disabled):active { transform: translateY(2px); }
.ag-stage[data-kind="imposter"] .ip-table.voting .ip-seat.pick { border-color: var(--hot); background: #1c2250; }
.ag-stage[data-kind="imposter"] .ip-table.voting .ip-seat.pick .ip-sn { color: var(--card); }

.ag-stage[data-kind="imposter"] .ip-say { min-height: 1.35em; padding: 8px 18px 2px; text-align: center; color: var(--card); font-weight: 700; }

/* ---------- the clues ---------- */
.ag-stage[data-kind="imposter"] .ip-feed { max-width: 460px; margin: 0 auto; padding: 4px 16px 0; }
.ag-stage[data-kind="imposter"] .ip-lap { margin: 12px 0 4px; padding-bottom: 3px; border-bottom: 1px solid var(--line); font: 400 13px/1.3 var(--font); color: var(--mute); }
.ag-stage[data-kind="imposter"] .ip-clue { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.ag-stage[data-kind="imposter"] .ip-cs { flex: none; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; background: #171a3a; }
.ag-stage[data-kind="imposter"] .ip-cs .ip-bot { font-size: 17px; }
.ag-stage[data-kind="imposter"] .ip-cn { flex: none; font: 400 14px/1.3 var(--font); color: var(--mute); }
.ag-stage[data-kind="imposter"] .ip-clue .ip-cn { width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-stage[data-kind="imposter"] .ip-ct { min-width: 0; font: 400 27px/1 var(--ac-pixel); letter-spacing: .02em; color: var(--card); overflow-wrap: anywhere; }
.ag-stage[data-kind="imposter"] .ip-clue.me .ip-ct { color: var(--hot); }
.ag-stage[data-kind="imposter"] .ip-pass { font: italic 400 14px/1.3 var(--font); color: var(--mute); }
.ag-stage[data-kind="imposter"] .ip-talk { padding: 3px 0; color: var(--ac-ink); }
.ag-stage[data-kind="imposter"] .ip-talk .ip-cn { font-weight: 700; color: var(--mute); }
.ag-stage[data-kind="imposter"] .ip-talk.me .ip-cn { color: var(--hot); }
.ag-stage[data-kind="imposter"] .ip-guess .ip-cn { color: var(--rasp); }
.ag-stage[data-kind="imposter"] .ip-empty { padding: 14px 0; text-align: center; color: var(--mute); font-size: 15px; }

/* ---------- the bar ---------- */
.ag-stage[data-kind="imposter"] .ip-form { flex: none; display: flex; gap: 8px; padding: 8px 10px 10px; border-top: 2px solid var(--line); background: #0b0c1a; }
.ag-stage[data-kind="imposter"] .ip-in { flex: 1; min-width: 0; height: 46px; padding: 0 12px; border-radius: 10px; border: 2px solid var(--line); background: #10122a;
  color: var(--card); font: 400 17px/1 var(--font); outline: none; }
.ag-stage[data-kind="imposter"] .ip-in::placeholder { color: #6b7099; }
.ag-stage[data-kind="imposter"] .ip-in:focus { border-color: var(--hot); }
.ag-stage[data-kind="imposter"] .ip-go { flex: none; min-width: 74px; height: 46px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--ac-cab); color: #fff;
  font: 700 16px/1 var(--font); box-shadow: inset 0 -4px 0 var(--ac-cab-dark); cursor: pointer; }
.ag-stage[data-kind="imposter"] .ip.urgent .ip-form { background: #1c2250; }
.ag-stage[data-kind="imposter"] .ip.urgent .ip-in { border-color: var(--hot); }
.ag-stage[data-kind="imposter"] .ip[data-phase="guess"].urgent .ip-go { background: var(--rasp); box-shadow: inset 0 -4px 0 var(--rasp-dark); }

@media (prefers-reduced-motion: reduce) {
  .ag-stage[data-kind="imposter"] .ip-card.flip { animation: none; }
  .ag-stage[data-kind="imposter"] .ip-seat.on .ip-sf, .ag-stage[data-kind="imposter"] .ip-clock.low { animation: none; }
}
