/* קשר — a retro spy comic: a secret radio base on a Tel Aviv roof at night.
   Cream paper panels with thick ink outlines and a hard comic offset shadow, Ben-Day dots, flat colours.
   Team colours: foxes orange, owls teal. Art in assets/art (generated, cut by tools/cut_art.py). */
:root {
  --night: #16223d;
  --night2: #1d2c4d;
  --ink: #15151c;
  --paper: #f3e9d2;
  --paper2: #e6d7b2;
  --red: #e23b2e;
  --mustard: #f2b233;
  --fox: #e8742c;
  --fox-soft: #f7c6a3;
  --owl: #2a9d9f;
  --owl-soft: #a6dcd9;
  --noise: #c9bc9a;
  --jam: #15151c;
  --muted: #6d6250;
  --r: 4px;
  --shadow: 4px 4px 0 var(--ink);
  --ui: "Rubik", system-ui, sans-serif;
  --display: "Suez One", "Rubik", serif;
  --dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='2' cy='2' r='1.1' fill='%2315151c' fill-opacity='.13'/%3E%3Ccircle cx='6' cy='6' r='1.1' fill='%2315151c' fill-opacity='.13'/%3E%3C/svg%3E");
  --dots-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Ccircle cx='2.5' cy='2.5' r='1.2' fill='%23ffffff' fill-opacity='.07'/%3E%3Ccircle cx='7.5' cy='7.5' r='1.2' fill='%23ffffff' fill-opacity='.07'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--night) var(--dots-light); color: var(--paper); font-family: var(--ui); font-size: 15px; line-height: 1.45; min-height: 100vh;
  -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
[hidden] { display: none !important; }
a { color: var(--mustard); }
.small { font-size: 13px; color: var(--muted); }
.empty { margin: 4px 0; }

/* the night room behind every screen */
.backdrop { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.backdrop-shade { position: fixed; inset: 0; z-index: -1; background: rgba(22, 34, 61, .55); }
.game .backdrop-shade { background: rgba(22, 34, 61, .78); }

/* ---------------------------------------------------------------- comic basics */
.panel { position: relative; background: var(--paper) var(--dots); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 14px; }
.panel-title { font-family: var(--display); font-size: 24px; line-height: 1.05; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.btn { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--r); padding: 8px 16px; font-weight: 800;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .06s, box-shadow .06s; }
.btn:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.big { font-family: var(--display); font-weight: 400; font-size: 24px; padding: 8px 22px; width: 100%; background: var(--red); color: #fff; }
.btn.small { font-size: 13px; padding: 5px 10px; border-width: 2px; box-shadow: 2px 2px 0 var(--ink); }
.btn.ghost { background: transparent; }
.btn.amber { background: var(--red); color: #fff; }
.row2 { display: flex; gap: 8px; flex-wrap: wrap; }
.row2 > * { flex: 1; }
.tbtn { background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: var(--r); padding: 3px 9px; font-size: 13px; font-weight: 700;
  white-space: nowrap; }
.tbtn:hover { background: #fff; }
.tbtn.on { background: var(--ink); color: var(--paper); border-color: var(--paper); }
.tbtn.off { background: var(--paper2); color: var(--muted); }
.tbtn.amber { background: var(--red); color: #fff; }
.tbtn.alert { background: var(--red); color: #fff; }
.tbtn.danger { color: var(--red); }
.ticon { display: inline-flex; width: 26px; height: 26px; flex: none; }
.ticon img { width: 100%; height: 100%; object-fit: contain; }

.conn { position: fixed; top: 0; inset-inline: 0; z-index: 50; background: var(--red); color: #fff; text-align: center; padding: 6px; font-weight: 800;
  border-bottom: 3px solid var(--ink); }
#toasts { position: fixed; top: 70px; inset-inline-start: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--r); box-shadow: 3px 3px 0 var(--ink); padding: 8px 13px;
  font-weight: 700; animation: pop .2s ease-out; transition: opacity .35s, transform .35s; }
.toast.warn { background: var(--paper); }
.toast.bad { background: var(--red); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes pop { from { opacity: 0; transform: scale(.85) rotate(-2deg); } }

.modal { position: fixed; inset: 0; z-index: 40; background: rgba(15, 22, 40, .8); display: grid; place-items: center; padding: 16px; }
.players-sheet { width: min(600px, 100%); max-height: 85vh; overflow: auto; display: grid; gap: 10px; }

/* SLOP GAMES link (matches slop.grapeseedstudios.com: deep grape, lime, Rubik Wet Paint) */
.slop-link { display: inline-flex; align-items: baseline; gap: 6px; background: #120b19; border: 3px solid var(--ink); border-radius: var(--r);
  box-shadow: 3px 3px 0 var(--ink); padding: 5px 12px; text-decoration: none; color: #f6efe3; direction: ltr; }
.slop-link b { font-family: "Rubik Wet Paint", var(--display); font-weight: 400; color: #d8f244; font-size: 22px; letter-spacing: 1px; line-height: 1; }
.slop-link span { font-weight: 800; font-size: 13px; letter-spacing: 2px; }
.slop-link i { font-style: normal; font-size: 12px; color: #c9bfd6; direction: rtl; }
.slop-link:hover { background: #1d1428; }

/* avatars: comic portraits in a paper frame */
.av { width: 34px; height: 34px; flex: none; border: 2px solid var(--ink); border-radius: var(--r); background: var(--paper2); overflow: hidden; display: block; }
.av img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }

/* ---------------------------------------------------------------- home */
.home { max-width: 980px; margin: 0 auto; padding: 14px 16px 40px; display: grid; gap: 16px; }
.home-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero { position: relative; display: grid; grid-template-columns: 1fr minmax(0, 1.6fr) 1fr; align-items: end; gap: 8px; min-height: 290px; }
.hero-mid { display: grid; gap: 22px; justify-items: center; padding-bottom: 18px; }
.hero-logo { width: 100%; max-width: 480px; justify-self: center; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .25)); animation: logoIn .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes logoIn { from { transform: scale(.6) rotate(-6deg); opacity: 0; } }
.hero-mascot { width: 100%; max-height: 270px; object-fit: contain; object-position: bottom; animation: bob 3.2s ease-in-out infinite; }
.hero-mascot.owl { animation-delay: -1.6s; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-1deg); } }
.bubble { position: relative; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: var(--r); padding: 10px 14px;
  font-weight: 700; font-size: 17px; text-align: center; box-shadow: var(--shadow); max-width: 520px; justify-self: center; }
.bubble::after { content: ""; position: absolute; bottom: -14px; left: 50%; width: 22px; height: 22px; background: #fff; border-inline-end: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink); transform: translateX(-50%) rotate(45deg); border-inline-end: 0; border-right: 3px solid var(--ink); }
.home-grid { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 16px; align-items: stretch; }
.me-box { display: flex; flex-direction: column; gap: 10px; }
.name-input { width: 100%; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: var(--r); padding: 10px 12px;
  font-size: 20px; font-weight: 800; }
.name-input:focus, .clue-input:focus, .chat-input:focus, .code-tile:focus { outline: 3px solid var(--mustard); outline-offset: 1px; }
.av-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.av-pick button { padding: 0; border: 2px solid var(--ink); border-radius: var(--r); background: var(--paper2); aspect-ratio: 1; overflow: hidden; }
.av-pick button img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.av-pick button.on { outline: 3px solid var(--red); outline-offset: 1px; }
.av-pick button:disabled { opacity: .3; }
.door { display: flex; flex-direction: column; gap: 12px; }
.door .btn.big { margin-top: auto; }
.play-opts { display: grid; gap: 8px; }
.play-opt { text-align: start; background: #fff; border: 2px solid var(--ink); border-radius: var(--r); padding: 8px 12px; display: grid; gap: 2px; color: var(--ink); }
.play-opt b { font-family: var(--display); font-weight: 400; font-size: 19px; }
.play-opt span { font-size: 13px; color: var(--muted); }
.play-opt.on { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--red); }
.play-opt.on span { color: var(--paper2); }
.code-row { display: flex; gap: 8px; justify-content: center; }
.code-tile { width: 54px; height: 66px; text-align: center; font-family: var(--display); font-size: 40px; background: #fff; color: var(--ink);
  border: 3px solid var(--ink); border-radius: var(--r); text-transform: uppercase; box-shadow: 3px 3px 0 var(--ink); }
.code-tile.masked { -webkit-text-security: disc; }
.home-links { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.home-foot { text-align: center; color: var(--paper); font-size: 13px; opacity: .85; }
.pending-box { max-width: 420px; margin: 80px auto; text-align: center; }

/* ---------------------------------------------------------------- top bar & screens */
.screen { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; background: var(--ink);
  border-bottom: 3px solid var(--ink); flex-wrap: wrap; }
.tb-title { display: flex; align-items: center; gap: 10px; }
.tb-logo { height: 40px; }
.tb-sub { color: var(--mustard); font-weight: 800; font-size: 14px; }
.tb-right { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tbtn.code { letter-spacing: 1px; }

/* player chip: a little ID card */
.pchip { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 6px; border: 2px solid var(--ink); border-radius: var(--r); background: #fff;
  color: var(--ink); min-height: 44px; transition: box-shadow .1s; }
.pchip.me { background: #fff8e0; }
.pchip.away { opacity: .5; }
.pchip.speaking { box-shadow: 0 0 0 calc(2px + var(--lvl, .5) * 3px) var(--mustard); }
.pchip .av { width: 34px; height: 34px; }
.pname { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptag { font-size: 11px; font-weight: 800; border: 2px solid var(--ink); border-radius: 3px; padding: 0 5px; }
.ptag.lead { background: var(--red); color: #fff; }
.pmic { width: 18px; height: 18px; margin-inline-start: auto; fill: var(--muted); }
.pmic svg { width: 100%; height: 100%; }
.pmic[data-s="ok"] { fill: #2e8b57; }
.pmic .slash { stroke: transparent; }
.pmic[data-s="muted"] .slash, .pmic[data-s="blocked"] .slash, .pmic[data-s="hmuted"] .slash { stroke: var(--red); }
.pmic[data-s="blocked"], .pmic[data-s="hmuted"] { fill: var(--red); }
.chip-tools { display: flex; gap: 4px; }
.chip-tools .tbtn { padding: 0 6px; font-size: 12px; }

/* ---------------------------------------------------------------- lobby */
.lobby-grid { display: grid; grid-template-columns: 1fr 360px; gap: 18px; padding: 18px; flex: 1; align-items: start; }
.lobby-teams { display: grid; gap: 12px; }
.score-line { justify-self: center; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--r); padding: 4px 12px;
  font-weight: 800; box-shadow: 3px 3px 0 var(--ink); }
.teams-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.team-col { display: flex; flex-direction: column; gap: 10px; min-height: 380px; padding-top: 0; }
.team-head { display: flex; align-items: flex-end; gap: 6px; margin: -3px -14px 4px; padding: 0 14px; height: 120px; border-bottom: 3px solid var(--ink);
  background: var(--fox); overflow: hidden; }
.team-col[data-team="b"] .team-head { background: var(--owl); }
.team-head img { height: 140px; margin-bottom: -26px; }
.team-head h2 { margin: 0 0 10px; font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1; color: #fff;
  -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); }
.team-list { display: grid; gap: 6px; align-content: start; flex: 1; }
.team-note { min-height: 1em; margin: 0; font-weight: 700; }
.lobby-side { display: grid; gap: 16px; }
.invite { text-align: center; }
.invite-code { display: flex; justify-content: center; gap: 6px; margin: 4px 0 12px; }
.invite-code span { width: 50px; height: 62px; display: grid; place-items: center; background: #fff; color: var(--ink); border: 3px solid var(--ink);
  border-radius: var(--r); font-family: var(--display); font-size: 40px; box-shadow: 3px 3px 0 var(--ink); }
.invite p { margin: 10px 0 0; }
.settings { display: grid; gap: 10px; }
.set-row { display: grid; gap: 4px; }
.set-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; background: #fff; }
.seg button { flex: 1; background: transparent; border: 0; border-inline-start: 2px solid var(--ink); padding: 5px 8px; font-size: 13px; font-weight: 700; min-width: 44px; color: var(--ink); }
.seg button:first-child { border-inline-start: 0; }
.seg button.on { background: var(--ink); color: var(--paper); }
.play-text { margin: 10px 0; }
.lobby-actions { display: grid; gap: 8px; margin-top: 12px; }
.waiting { text-align: center; color: var(--muted); font-weight: 700; margin: 0; }

/* chat */
.chat { display: flex; flex-direction: column; }
.chat-log { height: 150px; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 3px; font-size: 14px; padding-inline-end: 4px; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; }
.chat-input { flex: 1; min-width: 0; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: var(--r); padding: 6px 9px; }
.chat-input:disabled { opacity: .6; }

/* ---------------------------------------------------------------- game */
.game-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; padding: 16px; flex: 1; align-items: start; }
.game-main { display: grid; gap: 14px; min-width: 0; }
.top-row { display: grid; grid-template-columns: 1fr minmax(250px, 1.2fr) 1fr; gap: 14px; align-items: start; }
.team-side { display: grid; gap: 8px; min-width: 0; }
.plate { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border: 3px solid var(--ink); border-radius: var(--r);
  background: var(--fox); color: var(--ink); box-shadow: var(--shadow); min-width: 0; overflow: hidden; transition: transform .2s; }
.plate[data-team="b"] { background: var(--owl); }
.plate .mascot { width: 64px; height: 74px; object-fit: contain; object-position: bottom; margin-block: -8px -12px; flex: none; }
.plate-body { display: grid; gap: 3px; min-width: 0; }
.plate-body b { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1; color: #fff; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.plate-lead { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate-state { margin-inline-start: auto; font-size: 13px; font-weight: 800; background: var(--paper); border: 2px solid var(--ink); border-radius: 3px;
  padding: 1px 7px; white-space: nowrap; }
.plate-state:empty { display: none; }

.plate.cheer .mascot { animation: cheer .6s ease-out 2; }
.plate.shake { animation: shake .45s; }
.plate.zap .mascot { animation: zap .25s steps(2) 4; }
.team-side.frozen .plate-state { background: var(--ink); color: var(--red); }
@keyframes cheer { 40% { transform: translateY(-14px) scale(1.12) rotate(-4deg); } }
@keyframes zap { 50% { filter: invert(1); transform: translateX(3px); } }
.plate.active { transform: rotate(-1deg) scale(1.03); }
.plate.active .plate-state { background: var(--ink); color: var(--paper); }
.dots { display: flex; gap: 3px; }
.dots i { width: 11px; height: 11px; flex: none; border-radius: 2px; border: 2px solid var(--ink); background: rgba(255, 255, 255, .35); }
.dots i.on { background: var(--ink); }

.radio-side { display: grid; grid-template-rows: auto 1fr; gap: 6px; justify-items: center; }
.lamp { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #000; background: #5a1f1a; margin-top: 2px; }
.lamp.on { background: var(--red); box-shadow: 0 0 0 4px rgba(226, 59, 46, .35); animation: blink .5s steps(1) 6; }
.radio { position: relative; display: flex; align-items: stretch; gap: 8px; background: var(--ink); border: 3px solid var(--ink); border-radius: var(--r);
  padding: 7px; box-shadow: var(--shadow); }
.disp { flex: 1; background: var(--mustard) var(--dots); color: var(--ink); border-radius: 2px; padding: 6px 12px; display: grid; align-content: center; min-height: 78px; }
.disp-main { display: flex; align-items: center; justify-content: center; gap: 12px; }
.disp-word { font-family: var(--display); font-size: 40px; line-height: 1; min-height: 40px; }
.disp-word.idle { opacity: .45; letter-spacing: 4px; }
.disp-num.in { animation: stampIn .35s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes stampIn { from { transform: scale(2.4) rotate(-30deg); opacity: 0; } }
.disp-num { font-family: var(--display); font-size: 34px; line-height: 1; background: var(--red); color: #fff; border: 3px solid var(--ink);
  min-width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; transform: rotate(8deg); }
.disp-line { text-align: center; font-size: 13px; font-weight: 800; }
.disp-clock { width: 64px; display: grid; place-items: center; font-family: var(--display); font-size: 30px; color: var(--mustard); background: #000;
  border-radius: 2px; }
.disp-clock.hurry { color: var(--red); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: .35; } }
.radio[data-team="a"] .disp { box-shadow: inset 0 -6px 0 var(--fox); }
.radio[data-team="b"] .disp { box-shadow: inset 0 -6px 0 var(--owl); }
.radio.pulse { animation: shake .5s; }
@keyframes shake { 20% { transform: translate(-3px, 1px) rotate(-1deg); } 40% { transform: translate(3px, -1px) rotate(1deg); } 60% { transform: translate(-2px, 0); } }

.board-wrap { position: relative; }
.board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.card { position: relative; background: var(--paper) var(--dots); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--r); min-height: 86px;
  display: grid; place-items: center; text-align: center; padding: 10px 6px; user-select: none; box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s, box-shadow .12s, background-color .2s; }
.card { transform: rotate(var(--tilt, 0deg)); }
.card .cw { font-weight: 900; font-size: 20px; line-height: 1.1; word-break: break-word; }

.card.long .cw { font-size: 16px; }
.card.pickable { cursor: pointer; }
.card.pickable:hover { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 5px 5px 0 var(--ink); background-color: #fff; }
.card.mine { transform: translate(-2px, -5px) rotate(-1.5deg); box-shadow: 6px 8px 0 var(--ink); }
.pins { position: absolute; bottom: 5px; inset-inline-start: 6px; display: flex; gap: 2px; }
.pins img { animation: pinIn .3s cubic-bezier(.2, 1.7, .4, 1); }
@keyframes pinIn { from { transform: translateY(-30px) scale(1.6); opacity: 0; } }
.pins img, .pins i { width: 24px; height: 24px; border-radius: 3px; border: 2px solid var(--ink); background: var(--paper2); object-fit: cover; object-position: center 20%; }
.pick-btn { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%) rotate(-3deg); z-index: 2; background: var(--red); color: #fff;
  border: 3px solid var(--ink); border-radius: var(--r); font-family: var(--display); font-size: 16px; padding: 1px 14px; box-shadow: 2px 2px 0 var(--ink); }
.stamp { position: absolute; top: -10px; inset-inline-end: -8px; width: 40px; height: 40px; pointer-events: none; }
.stamp img { width: 100%; height: 100%; object-fit: contain; }
.stamp[data-t]:not([data-t=""])::after { content: attr(data-t); position: absolute; top: 12px; inset-inline-end: 8px; font-family: var(--display); font-size: 14px;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 3px; padding: 0 6px; white-space: nowrap; transform: rotate(8deg); }
/* the operator's key: written on the slip (no tints) */
.klabel { position: absolute; top: 5px; inset-inline-start: 6px; font-size: 11px; font-weight: 900; line-height: 1.35; padding: 0 5px;
  border: 2px solid var(--ink); border-radius: 3px; background: var(--paper); }
.klabel:empty { display: none; }
.card[data-k="a"] .klabel { background: var(--fox); color: #fff; }
.card[data-k="b"] .klabel { background: var(--owl); color: #fff; }
.card[data-k="x"] .klabel { background: var(--ink); color: var(--red); }
.card.key[data-k="x"] { border-style: dashed; }
/* revealed */
.card.open { cursor: default; }
.card.open[data-k="a"] { background-color: var(--fox); }
.card.open[data-k="b"] { background-color: var(--owl); }
.card.open[data-k="a"] .cw, .card.open[data-k="b"] .cw { color: #fff; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.card.open[data-k="n"] { background-color: var(--noise); box-shadow: 1px 1px 0 var(--ink); }
.card.open[data-k="n"] .cw { color: #6b6048; text-decoration: line-through 2px; }
.card.open[data-k="x"] { background-color: var(--jam); color: var(--red); }
.card.flip { animation: flip .5s ease-out; }
@keyframes flip { 0% { transform: rotateY(0); } 50% { transform: rotateY(90deg) scale(1.05); } 100% { transform: rotateY(0); } }

.under { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-height: 56px; }
.hint { color: var(--paper); font-size: 14px; font-weight: 700; flex: 1; }
.hint.amber { color: var(--mustard); }
.console { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--mustard) var(--dots); color: var(--ink); border: 3px solid var(--ink);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 8px 10px; flex: 1; animation: pop .25s ease-out; }
.console-label { font-family: var(--display); font-size: 22px; line-height: 1; }
.clue-input { flex: 1; min-width: 140px; background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: var(--r); padding: 6px 12px;
  font-size: 20px; font-weight: 900; }
.nums { display: flex; gap: 4px; }
.num { width: 40px; height: 40px; background: #fff; border: 3px solid var(--ink); border-radius: 50%; font-family: var(--display); font-size: 20px; color: var(--ink); }
.num.on { background: var(--red); color: #fff; transform: rotate(8deg); }
.console .btn.amber { background: var(--red); color: #fff; font-family: var(--display); font-weight: 400; font-size: 18px; }

.game-side { display: grid; gap: 16px; }
.tlog { display: grid; gap: 6px; }
.tl-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; padding-bottom: 6px; border-bottom: 2px dashed var(--paper2); }
.tl-row .ticon { width: 24px; height: 24px; }
.tl-row b { font-size: 17px; font-weight: 900; }
.tl-n { background: var(--red); color: #fff; font-weight: 900; border: 2px solid var(--ink); border-radius: 50%; width: 24px; height: 24px; display: grid;
  place-items: center; font-size: 13px; }
.tl-got { display: flex; gap: 4px; flex-wrap: wrap; width: 100%; padding-inline-start: 30px; }
.tl-got i { font-style: normal; font-size: 12px; font-weight: 700; padding: 0 6px; border: 2px solid var(--ink); border-radius: 3px; background: var(--noise); }
.tl-got i[data-k="a"] { background: var(--fox); }
.tl-got i[data-k="b"] { background: var(--owl); }
.tl-got i[data-k="x"] { background: var(--jam); color: var(--red); }
.rosters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.roster-col .rh { display: flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 17px; margin-bottom: 6px; }
.roster-col .rh .ticon { width: 28px; height: 28px; }
.roster { display: grid; gap: 5px; }
.roster .pchip { padding: 3px 6px 3px 4px; min-height: 34px; font-size: 13px; gap: 6px; }
.roster .pchip .av { width: 26px; height: 26px; }

.end { position: absolute; inset: -8px; z-index: 5; background: rgba(22, 34, 61, .88); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; text-align: center; border-radius: var(--r); padding: 16px; animation: pop .35s ease-out; }
.end-mascot { height: 200px; animation: bob 1.4s ease-in-out infinite; }
.end-title { font-family: var(--display); font-weight: 400; font-size: 60px; line-height: 1; margin: 0; color: #fff; -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill; text-shadow: 5px 5px 0 var(--red); transform: rotate(-2deg); }
.end[data-team="a"] .end-title { text-shadow: 5px 5px 0 var(--fox); }
.end[data-team="b"] .end-title { text-shadow: 5px 5px 0 var(--owl); }
.end-why { margin: 0; font-weight: 700; }
.end-score { margin: 0; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--r); padding: 3px 12px; font-weight: 800; }
.end .btn.big { width: auto; min-width: 240px; }
.end .small { color: var(--paper); }

/* streamer prompt + secret window */
.secret-prompt { position: fixed; z-index: 45; bottom: 16px; left: 50%; transform: translateX(-50%); width: min(440px, calc(100vw - 32px)); text-align: center; }
.secret { max-width: 560px; margin: 0 auto; padding: 14px; display: grid; gap: 14px; }
.secret-head { background: var(--red); color: #fff; font-weight: 900; text-align: center; padding: 6px; border: 3px solid var(--ink); border-radius: var(--r); }
.secret-status { margin: 0 0 10px; font-weight: 800; }
.secret-board { grid-template-columns: repeat(4, 1fr); gap: 7px; }
.secret-board .card { min-height: 60px; box-shadow: 2px 2px 0 var(--ink); }
.secret-board .card .cw { font-size: 15px; }
.secret-board .card.open { opacity: .4; }
.secret-board .stamp { display: none; }
.legend { display: flex; gap: 10px; margin-top: 10px; font-size: 13px; font-weight: 700; flex-wrap: wrap; }
.legend span::before { content: ""; display: inline-block; width: 13px; height: 13px; margin-inline-end: 4px; vertical-align: -2px; border-radius: 2px; border: 2px solid var(--ink); }
.legend [data-k="a"]::before { background: var(--fox); }
.legend [data-k="b"]::before { background: var(--owl); }
.legend [data-k="n"]::before { background: var(--noise); }
.legend [data-k="x"]::before { background: #3b3b44; }

/* rules */
.rules { width: min(540px, 100%); display: grid; gap: 10px; text-align: center; }
.rules .x { position: absolute; top: 6px; inset-inline-end: 8px; background: transparent; border: 0; font-size: 20px; font-weight: 900; color: var(--ink); }
.rules-art { min-height: 150px; display: grid; place-items: center; background: var(--night) var(--dots-light); border: 3px solid var(--ink); border-radius: var(--r); padding: 14px; }
.rules-title { font-family: var(--display); font-weight: 400; font-size: 32px; line-height: 1.1; margin: 0; }
.rules-text { margin: 0; font-size: 16px; }
.rules-dots { display: flex; justify-content: center; gap: 5px; }
.rules-dots i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); }
.rules-dots i.on { background: var(--red); }
.mini-board { display: grid; grid-template-columns: repeat(3, 96px); gap: 8px; }
.mini-card { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 3px; padding: 10px 4px; font-weight: 900; font-size: 14px;
  box-shadow: 2px 2px 0 #000; }
.mini-card[data-k="a"] { background: var(--fox-soft); }
.mini-card[data-k="b"] { background: var(--owl-soft); }
.mini-card[data-k="n"] { background: #ddd2b6; }
.mini-card[data-k="x"] { background: #3b3b44; color: var(--paper); }
.mini-card.open[data-k="a"] { background: var(--fox); }
.mini-card.open[data-k="b"] { background: var(--owl); }
.mini-card.open[data-k="n"] { background: var(--noise); text-decoration: line-through; }
.mini-card.open[data-k="x"] { background: var(--jam); color: var(--red); }
.mini-radio { display: flex; gap: 14px; align-items: center; background: var(--mustard); color: var(--ink); border: 3px solid var(--ink); padding: 8px 20px;
  border-radius: 3px; font-family: var(--display); font-size: 44px; line-height: 1; }
.mini-radio b { background: var(--red); color: #fff; border: 3px solid var(--ink); border-radius: 50%; width: 52px; height: 52px; display: grid; place-items: center;
  font-weight: 400; font-size: 32px; }
.mini-mute { position: relative; }
.mini-mute img { height: 120px; }
.mini-mute i { position: absolute; left: 50%; top: 50%; width: 140px; height: 8px; background: var(--red); border: 2px solid var(--ink);
  transform: translate(-50%, -50%) rotate(-35deg); }
.mini-teams { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-size: 40px; color: var(--mustard); }
.mini-teams img { height: 120px; }

/* booths: everybody's portrait; waves while he talks, ON AIR for the operator who just transmitted */
.booths { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.booth { position: relative; width: 66px; display: grid; justify-items: center; gap: 2px; text-align: center; }
.booth .av { width: 54px; height: 54px; border-width: 3px; box-shadow: 2px 2px 0 var(--ink); transition: transform .12s; }
.booth-name { font-size: 11px; font-weight: 800; color: var(--paper); max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 1px 1px 0 var(--ink); }
.booth.me .booth-name { text-decoration: underline 2px; text-underline-offset: 2px; }
.booth.away { opacity: .45; }
.booth-tag { position: absolute; top: 40px; font-size: 10px; font-weight: 900; background: var(--paper); color: var(--ink); border: 2px solid var(--ink);
  border-radius: 3px; padding: 0 4px; line-height: 1.3; }
.booth.lead .av { border-color: var(--ink); background: var(--mustard); }
.booth.lead .av img { filter: saturate(.9); }
.booth.onair .booth-tag { background: var(--red); color: #fff; animation: blink .5s steps(1) 6; }
.booth.speaking .av { transform: translateY(-3px) rotate(calc(var(--lvl, .5) * 6deg - 3deg)) scale(calc(1 + var(--lvl, .5) * .08)); }
.waves { position: absolute; top: 4px; inset-inline-end: -8px; width: 22px; height: 30px; pointer-events: none; opacity: 0; transition: opacity .15s; }
.waves i { position: absolute; top: 50%; inset-inline-end: 0; border: 3px solid var(--mustard); border-inline-start: 0; border-top-color: transparent;
  border-bottom-color: transparent; border-radius: 50%; transform: translateY(-50%); animation: wave 1s ease-out infinite; }
.waves i:nth-child(1) { width: 10px; height: 12px; }
.waves i:nth-child(2) { width: 16px; height: 20px; animation-delay: .15s; }
.waves i:nth-child(3) { width: 22px; height: 28px; animation-delay: .3s; }
@keyframes wave { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
.booth.speaking .waves { opacity: 1; }
.pchip .av { position: relative; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1000px) {
  .lobby-grid, .game-grid { grid-template-columns: 1fr; }
  .top-row { grid-template-columns: 1fr 1fr; }
  .radio { grid-column: 1 / -1; order: -1; }
  .home-grid { grid-template-columns: 1fr 1fr; }
  .me-box { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .top-row { gap: 8px; }
  .booth { width: 54px; }
  .booth .av { width: 44px; height: 44px; }
  .booth-tag { top: 32px; }
  .hero { grid-template-columns: 1fr 1fr; min-height: 0; }
  .hero-logo { grid-column: 1 / -1; order: -1; max-width: 340px; }
  .hero-mascot { max-height: 170px; }
  .home-grid, .teams-row { grid-template-columns: 1fr; }
  .team-col { min-height: 0; }
  .board { grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .card { min-height: 66px; padding: 8px 3px; box-shadow: 2px 2px 0 var(--ink); border-width: 2px; }
  .card .cw { font-size: 15px; }
  .card.long .cw { font-size: 13px; }
  .stamp { width: 28px; height: 28px; top: -8px; inset-inline-end: -6px; }
  .plate { padding: 6px 8px 6px 4px; }
  .plate .mascot { width: 44px; height: 54px; }
  .plate-body b { font-size: 19px; }
  .plate-state { font-size: 11px; }
  .disp-word { font-size: 32px; }
  .topbar { padding: 6px 10px; }
  .tb-logo { height: 32px; }
  .tb-right .tbtn { font-size: 12px; padding: 2px 7px; }
  .game-grid, .lobby-grid { padding: 10px; }
  .num { width: 36px; height: 36px; }
  .mini-board { grid-template-columns: repeat(3, 1fr); }
}
.lobby .av-pick { grid-template-columns: repeat(12, 1fr); }
@media (max-width: 640px) { .lobby .av-pick { grid-template-columns: repeat(6, 1fr); } }
.chat-log::-webkit-scrollbar { display: none; }
html { scrollbar-width: thin; scrollbar-color: var(--ink) var(--night); }

/* the dial explains its number */
.disp-sub { text-align: center; font-size: 12px; font-weight: 800; min-height: 1em; }
.disp-sub:empty { display: none; }

/* what to do now */
.now { display: flex; align-items: center; gap: 12px; background: var(--paper) var(--dots); color: var(--ink); border: 3px solid var(--ink);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 8px 14px; animation: pop .25s ease-out; }
.now-icon { width: 52px; height: 52px; object-fit: contain; flex: none; }
.now-text { font-family: var(--display); font-size: 22px; line-height: 1.15; }
.now-sub { font-size: 13px; font-weight: 600; color: var(--muted); }

/* the answer after a pick: a comic caption over the board for a moment */
.result { position: absolute; z-index: 4; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-3deg); pointer-events: none;
  background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: var(--r); box-shadow: 6px 6px 0 var(--ink);
  padding: 10px 26px; text-align: center; display: grid; gap: 2px; min-width: 260px; }
.result b { font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1.05; }
.result span { font-weight: 800; }
.result[data-k="bad"] { background: var(--red); color: #fff; }
.result[data-k="x"] { background: var(--ink); color: var(--red); border-color: var(--red); }
.result[data-k="n"] { background: var(--paper2); }
.result.in { animation: burst .35s cubic-bezier(.2, 1.7, .4, 1); }
@keyframes burst { from { transform: translate(-50%, -50%) rotate(-12deg) scale(.3); opacity: 0; } }

/* the role card at the start of a game */
.intro { z-index: 42; }
.intro-card { width: min(640px, 100%); display: flex; gap: 16px; align-items: flex-end; padding: 18px 18px 18px 8px; animation: pop .3s ease-out; }
.intro-art { width: 170px; flex: none; margin-bottom: -6px; }
.intro-body { display: grid; gap: 8px; }
.intro-body h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; }
.intro-team { justify-self: start; font-weight: 900; color: #fff; background: var(--fox); border: 2px solid var(--ink); border-radius: 3px; padding: 0 8px; }
.intro-team[data-team="b"] { background: var(--owl); }
.intro-body ol { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; font-size: 15px; font-weight: 500; }
@media (max-width: 640px) {
  .intro-card { flex-direction: column; align-items: center; padding: 14px; }
  .intro-art { width: 110px; }
  .now-text { font-size: 18px; }
  .now-icon { width: 40px; height: 40px; }
  .result b { font-size: 34px; }
}
.disp-line:empty { display: none; }
