/* Krondemonium on kronjam.com: an old TV gameshow stage. One bold thing: the room
   code as a marquee sign. Everything else stays quiet so the game reads from the back
   of a room. */

@font-face {
  font-family: 'Space Grotesk';
  src: url(/fonts/SpaceGrotesk-Variable.woff) format('woff');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --stage: #1b0f2e;      /* aubergine backdrop */
  --velvet: #2c1a4a;     /* panels */
  --velvet-2: #3a2560;   /* raised */
  --gold: #ffc23d;       /* marquee, main buttons */
  --pink: #ff4f8b;       /* option A, alerts */
  --lagoon: #33d9c1;     /* option B, right answers */
  --paper: #fff3e3;      /* text */
  --dim: #b8a7d1;        /* secondary text */
  --line: #4a3470;
  --display: 'Space Grotesk', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(120% 80% at 50% 0%, #2a1748 0%, var(--stage) 60%) fixed, var(--stage);
  color: var(--paper);
  font: 17px/1.5 var(--body);
  -webkit-text-size-adjust: 100%;
}
a { color: var(--gold); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.dim { color: var(--dim); }
.display { font-family: var(--display); letter-spacing: -0.02em; }

/* ---- buttons ----------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 22px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--gold); color: #2a1600; font-weight: 700; text-decoration: none;
  box-shadow: 0 4px 0 #b97f00;
  transition: transform .06s, box-shadow .06s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b97f00; }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: 0 4px 0 #b97f00; }
.btn.quiet { background: var(--velvet-2); color: var(--paper); box-shadow: 0 4px 0 #20123a; }
.btn.danger { background: transparent; color: var(--pink); box-shadow: inset 0 0 0 2px var(--pink); }
.btn.big { min-height: 72px; font-size: 1.35rem; width: 100%; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; box-shadow: none; }

/* ---- the marquee (the room code on the TV and the home page) ------------------------ */
.marquee {
  position: relative; display: inline-block; padding: calc(.3em + 14px) calc(.6em + 16px) calc(.25em + 14px);
  border-radius: 22px; background: #2a1600; color: var(--gold);
  font-family: var(--display); font-weight: 700; letter-spacing: .14em; line-height: 1;
  box-shadow: inset 0 0 0 6px #4a2d00, 0 0 60px rgba(255, 194, 61, .25);
  text-shadow: 0 0 18px rgba(255, 194, 61, .55);
}
.marquee::before {
  /* the bulbs: one evenly spaced row along each edge */
  --bulb: radial-gradient(circle, #fff3c4 0 2.5px, rgba(255, 194, 61, .95) 3.5px, transparent 4.5px);
  content: ''; position: absolute; inset: 6px; pointer-events: none;
  background:
    var(--bulb) top / 20px 12px space no-repeat,
    var(--bulb) bottom / 20px 12px space no-repeat,
    var(--bulb) left center / 12px 20px no-repeat space,
    var(--bulb) right center / 12px 20px no-repeat space;
  background-origin: border-box;
  animation: chase 1.6s steps(2) infinite;
}
@keyframes chase { 50% { filter: brightness(.55); } }
@media (prefers-reduced-motion: reduce) { .marquee::before { animation: none; } }

/* ---- faces ----------------------------------------------------------------------------- */
.face {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  background: hsl(var(--hue, 280) 55% 42%); color: #fff; font-weight: 700; font-size: .95rem;
  box-shadow: 0 0 0 2px rgba(255, 243, 227, .15);
}
.face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.face.lg { width: 96px; height: 96px; font-size: 2rem; }
.face.xl { width: 140px; height: 140px; font-size: 3rem; }

/* ---- connection banner --------------------------------------------------------------- */
.conn {
  position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 50;
  padding: 6px 14px; border-radius: 999px; background: var(--pink); color: #2a0010; font-weight: 700; font-size: .9rem;
}
.toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 12px; background: var(--paper); color: var(--stage); font-weight: 600;
}

/* ---- timer bar ----------------------------------------------------------------------- */
.timebar { --left: 1; height: 10px; border-radius: 999px; background: rgba(255, 243, 227, .12); overflow: hidden; }
.timebar::after { content: ''; display: block; height: 100%; width: calc(var(--left) * 100%); background: var(--gold); border-radius: inherit; }

/* =========================================================================================
   PHONE (play.html)
   ========================================================================================= */
body.phone main { max-width: 520px; margin: 0 auto; padding: 16px 16px 40px; }
.me {
  display: flex; align-items: center; gap: 12px; padding: 10px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.me .name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .score { font-family: var(--display); font-weight: 700; font-size: 1.4rem; color: var(--gold); }
.me .rank { font-size: .85rem; color: var(--dim); text-align: right; }
.phone h1 { font-family: var(--display); font-size: 2rem; line-height: 1.1; margin: 8px 0 12px; letter-spacing: -0.02em; }
.phone h2 { font-family: var(--display); font-size: 1.5rem; line-height: 1.2; margin: 6px 0 14px; }
.phone .prompt { font-family: var(--display); font-size: 1.55rem; line-height: 1.25; font-weight: 600; margin: 4px 0 18px; }
.phone .round-name { color: var(--dim); font-size: .9rem; margin: 0 0 4px; }
.phone .count { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--gold); }
.stack { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; }
input[type=text] {
  font: inherit; font-size: 1.2rem; color: var(--paper); background: var(--velvet);
  border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; width: 100%;
}
input[type=text]:focus { border-color: var(--gold); outline: none; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .95rem; }
.check input { width: 24px; height: 24px; margin: 0; accent-color: var(--gold); flex: none; }
.panel { background: var(--velvet); border-radius: 18px; padding: 18px; }
.panel h2, .panel p { margin: 0; }
.lives-row { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.ab { display: grid; gap: 14px; }
.ab .btn { min-height: 110px; font-size: 1.4rem; flex-direction: column; gap: 2px; border-radius: 20px; }
.ab .btn .letter { font-family: var(--display); font-size: 2.2rem; line-height: 1; }
.ab .a { background: var(--pink); color: #2a0010; box-shadow: 0 5px 0 #a8204f; }
.ab .b { background: var(--lagoon); color: #00261f; box-shadow: 0 5px 0 #13917f; }
.ab .btn.picked { outline: 4px solid var(--paper); outline-offset: 3px; }
.ab .btn.faded { opacity: .35; }
.ab.with-pics { grid-template-columns: 1fr 1fr; }
.ab.with-pics .btn { min-height: 0; padding: 10px 8px 12px; font-size: 1.1rem; justify-content: flex-start; }
.ab .btn .pic { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: rgba(255, 255, 255, .35); margin: 4px 0 2px; }
.lives { display: flex; gap: 6px; }
.life { width: 18px; height: 18px; border-radius: 50%; background: var(--pink); }
.life.lost { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.result { text-align: center; padding: 28px 10px; }
.result .big { font-family: var(--display); font-size: 3rem; font-weight: 700; line-height: 1; margin: 6px 0; }
.result.good .big { color: var(--lagoon); }
.result.bad .big { color: var(--pink); }
.pic-row { display: flex; gap: 14px; align-items: center; }
.pic-row .buttons { display: grid; gap: 8px; flex: 1; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.board { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.board li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 14px; background: var(--velvet); }
.board .pts { margin-left: auto; font-family: var(--display); font-weight: 700; color: var(--gold); }
.board .place { width: 1.6em; font-family: var(--display); font-weight: 700; color: var(--dim); }
.board li.mine { box-shadow: inset 0 0 0 2px var(--gold); }

/* home page (index.html) */
body.home main { max-width: 520px; margin: 0 auto; padding: 8vh 20px 40px; text-align: center; }
body.home .marquee { font-size: 2.2rem; margin-bottom: 26px; }
body.home input[type=text] { text-align: center; font-family: var(--display); font-size: 2rem; letter-spacing: .25em; text-transform: uppercase; }

/* =========================================================================================
   TV (tv.html): sized in vh/vw so it fills any screen; read from across a room
   ========================================================================================= */
body.tv { overflow: hidden; height: 100vh; font-size: 2.2vh; }
.tv-stage { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 3.2vh 4vw; gap: 2vh; }
.tv-top { display: flex; justify-content: space-between; align-items: baseline; gap: 2vw; }
.tv-top .round { font-family: var(--display); font-size: 3vh; font-weight: 600; }
.tv-top .round .of { color: var(--dim); font-weight: 400; margin-left: .6em; }
.tv-top .players { color: var(--dim); font-size: 2.6vh; }
.tv-bottom { display: flex; justify-content: space-between; align-items: center; gap: 2vw; color: var(--dim); font-size: 2.4vh; }
.tv-bottom .join strong { color: var(--paper); font-family: var(--display); letter-spacing: .06em; }
.tv-main { display: grid; align-content: center; min-height: 0; }

.lobby { display: grid; grid-template-columns: 1.3fr 1fr; gap: 5vw; align-items: center; }
.lobby .marquee { font-size: 13vh; }
.lobby .how { font-size: 4vh; font-family: var(--display); margin: 4vh 0 1vh; }
.lobby .how strong { color: var(--gold); }
.lobby .qr { width: 34vh; height: 34vh; border-radius: 20px; overflow: hidden; background: #fff; padding: 1.4vh; justify-self: center; }
.lobby .qr svg { display: block; width: 100%; height: 100%; }
.crowd { display: flex; flex-wrap: wrap; gap: 1.6vh; margin-top: 4vh; grid-column: 1 / -1; justify-content: center; }
.crowd .who { display: grid; justify-items: center; gap: .6vh; width: 11vh; font-size: 2vh; text-align: center; }
.crowd .who .face { width: 8vh; height: 8vh; font-size: 3vh; }
.crowd .who span.n { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crowd .more { align-self: center; color: var(--dim); font-size: 2.6vh; }

.tv .prompt { font-family: var(--display); font-weight: 700; font-size: 8.5vh; line-height: 1.08; letter-spacing: -0.025em; max-width: 24ch; margin: 0 auto; text-align: center; text-wrap: balance; }
.tv .sub { text-align: center; color: var(--dim); font-size: 3.2vh; margin-top: 3vh; }
.tv .sub strong { color: var(--gold); font-family: var(--display); }
.tv .timebar { height: 1.6vh; margin-top: 1vh; }

.tot { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4vw; height: 100%; }
.tot .q { grid-column: 1 / -1; font-family: var(--display); font-weight: 700; font-size: 6vh; text-align: center; margin: 0; }
.tot .side { position: relative; border-radius: 3vh; padding: 4vh 3vw; display: grid; align-content: end; overflow: hidden; min-height: 40vh; }
.tot .side.a { background: var(--pink); color: #2a0010; }
.tot .side.b { background: var(--lagoon); color: #00261f; }
.tot .side .letter { position: absolute; top: 2vh; left: 2.4vw; font-family: var(--display); font-size: 12vh; font-weight: 700; opacity: .35; line-height: 1; }
.tot .side .label { font-family: var(--display); font-weight: 700; font-size: 7vh; line-height: 1.05; position: relative; }
.tot .side .votes { font-size: 3.2vh; font-weight: 700; margin-top: 1vh; position: relative; }
.tot .side.has-pic { align-content: stretch; grid-template-rows: 1fr auto auto; padding-top: 3vh; }
.tot .side .pic { position: relative; width: 100%; height: 100%; min-height: 0; max-height: 46vh; object-fit: contain; border-radius: 2vh; }
.tot .side.has-pic .letter { z-index: 1; text-shadow: 0 0 2vh rgba(255, 255, 255, .6); opacity: .6; }
.tot .side .fill { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .14); height: calc(var(--share, 0) * 100%); transition: height .4s ease; }
.tot .side.wrong { filter: grayscale(.8) brightness(.45); }
.tot .side.right { box-shadow: 0 0 0 1vh var(--paper); }

.winners { list-style: none; margin: 4vh auto 0; padding: 0; display: grid; gap: 1.6vh; width: min(80vw, 110vh); }
.winners li { display: flex; align-items: center; gap: 2vw; padding: 1.6vh 2vw; border-radius: 2vh; background: var(--velvet); font-size: 3.6vh; }
.winners li:first-child { background: var(--gold); color: #2a1600; }
.winners.plain li:first-child { background: var(--velvet); color: var(--paper); }
.winners .pts { margin-left: auto; font-family: var(--display); font-weight: 700; }
.winners .secs { color: inherit; opacity: .7; font-size: 2.6vh; }
.winners .face { width: 7vh; height: 7vh; font-size: 2.6vh; }
.tv h2 { font-family: var(--display); text-align: center; font-size: 7vh; margin: 0; letter-spacing: -0.02em; }
.tv .answer { text-align: center; font-size: 4vh; color: var(--dim); margin-top: 1vh; }
.tv .answer strong { color: var(--lagoon); font-family: var(--display); }
.champion { display: grid; justify-items: center; gap: 2vh; }
.champion .face { width: 26vh; height: 26vh; font-size: 9vh; box-shadow: 0 0 0 1.2vh var(--gold), 0 0 12vh rgba(255, 194, 61, .45); }
.champion .name { font-family: var(--display); font-size: 9vh; font-weight: 700; line-height: 1; }
.champion .pts { font-size: 4vh; color: var(--gold); }

/* =========================================================================================
   HOST (host.html): a working screen on a laptop
   ========================================================================================= */
body.host-screen main { max-width: 1240px; margin: 0 auto; padding: 18px 24px 60px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; }
@media (max-width: 860px) { body.host-screen main { grid-template-columns: 1fr; } }
.host-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.host-head .code { font-family: var(--display); font-weight: 700; font-size: 2rem; letter-spacing: .14em; color: var(--gold); }
.host-head .meta { color: var(--dim); }
.host-head .spacer { flex: 1; }
.host-screen h2 { font-family: var(--display); font-size: 1.3rem; margin: 22px 0 10px; letter-spacing: -0.01em; }
.host-screen h3 { font-family: var(--display); font-size: 1.05rem; margin: 18px 0 8px; color: var(--dim); font-weight: 600; }
.now { background: var(--velvet); border-radius: 20px; padding: 20px 22px; }
.now .what { color: var(--dim); margin: 0 0 4px; }
.now .prompt { font-family: var(--display); font-size: 1.7rem; font-weight: 700; line-height: 1.2; margin: 0 0 14px; }
.now .stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 10px 0 16px; color: var(--dim); }
.now .stats strong { color: var(--paper); font-family: var(--display); font-size: 1.2rem; }
.now .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.rundown { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rundown li { padding: 6px 12px; border-radius: 999px; background: var(--velvet); font-size: .9rem; }
.rundown li.current { background: var(--gold); color: #2a1600; font-weight: 700; }
.rundown li.done { opacity: .5; }
.rundown .mode { opacity: .75; font-size: .78rem; margin-left: 6px; }
.answers { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 52vh; overflow: auto; }
.answers li { display: grid; grid-template-columns: 2.4em 1fr auto auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--velvet-2); }
.answers .n { color: var(--dim); font-variant-numeric: tabular-nums; }
.answers .who { color: var(--dim); font-size: .85rem; }
.answers .secs { color: var(--dim); font-size: .85rem; font-variant-numeric: tabular-nums; }
.answers li.right { box-shadow: inset 4px 0 0 var(--lagoon); }
.answers li.wrong { box-shadow: inset 4px 0 0 var(--pink); }
.mark { display: flex; gap: 4px; }
.mark button { min-width: 44px; min-height: 34px; border-radius: 9px; border: 0; cursor: pointer; background: rgba(255, 243, 227, .08); }
.mark button[aria-pressed=true].yes { background: var(--lagoon); color: #00261f; }
.mark button[aria-pressed=true].no { background: var(--pink); color: #2a0010; }
.side-panel { align-self: start; position: sticky; top: 14px; }
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; max-height: 70vh; overflow: auto; }
.people li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; }
.people li:hover { background: var(--velvet); }
.people .face { width: 34px; height: 34px; font-size: .8rem; }
.people .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .off .nm { color: var(--dim); }
.people .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lagoon); flex: none; }
.people .off .dot { background: var(--line); }
.people .pts { font-family: var(--display); font-weight: 700; color: var(--gold); min-width: 2.5em; text-align: right; }
.people .tools { display: none; gap: 4px; }
.people li:hover .tools, .people li:focus-within .tools { display: flex; }
.errors { color: var(--pink); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.split div { padding: 12px; border-radius: 14px; font-weight: 700; }
.split .a { background: var(--pink); color: #2a0010; }
.split .b { background: var(--lagoon); color: #00261f; }
.split .ok::after { content: ' ✓'; }
.split .pic { display: block; width: 100%; max-height: 120px; object-fit: contain; margin-bottom: 6px; border-radius: 10px; }

/* =========================================================================================
   KRONGERNUM, suggestions, and the Control screen on a phone (phase 3)
   ========================================================================================= */
/* TV: the whole screen goes over to the dance */
.kron-overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; text-align: center;
  background: radial-gradient(90% 70% at 50% 45%, #5a1f6e 0%, #2a0f3f 55%, #12071f 100%); }
.kron-overlay::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 45%, rgba(255, 194, 61, .10) 0 10deg, transparent 10deg 20deg);
  animation: kron-spin 18s linear infinite; }
.kron-inner { position: relative; display: grid; justify-items: center; gap: 2.5vh; }
.kron-title { font-family: var(--display); font-weight: 700; font-size: 14vh; line-height: .9; letter-spacing: -.02em; color: var(--gold);
  text-shadow: 0 0 4vh rgba(255, 194, 61, .45), .6vh .6vh 0 var(--pink); animation: kron-bounce .476s ease-in-out infinite alternate; }
.kron-name { font-family: var(--display); font-size: 8vh; font-weight: 700; line-height: 1; }
.kron-sub { font-size: 3.6vh; color: var(--dim); margin: 0; }
.kron-overlay .face.xl { animation: kron-sway .952s ease-in-out infinite alternate; }
@keyframes kron-spin { to { transform: rotate(360deg); } }
@keyframes kron-bounce { from { transform: translateY(0) scale(1); } to { transform: translateY(-1.2vh) scale(1.03); } }
@keyframes kron-sway { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .kron-overlay::before, .kron-title, .kron-overlay .face.xl { animation: none; } }
.sound-btn { background: rgba(255, 243, 227, .08); color: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .5vh 1.6vh; font: inherit; font-size: 2.2vh; cursor: pointer; }

/* Phone */
.kron-you { background: linear-gradient(135deg, var(--pink), #b02cff); color: #fff; border-radius: 20px; padding: 18px 20px; margin: 12px 0; text-align: center; }
.kron-you .kron-title { font-size: 2.6rem; color: var(--gold); text-shadow: 3px 3px 0 #5a0030; }
.kron-you p { margin: 6px 0 0; font-weight: 600; }
.kron-them { background: var(--velvet-2); border-radius: 14px; padding: 10px 14px; margin: 10px 0; }
.suggest { margin-top: 18px; }
.suggest summary { cursor: pointer; font-weight: 700; }
.suggest select { font: inherit; color: var(--paper); background: var(--stage); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }

/* Control screen */
.kron-host { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--velvet); border-radius: 16px; padding: 10px 14px; margin-bottom: 14px; }
.kron-host .kron-label { font-family: var(--display); font-weight: 700; color: var(--gold); }
.kron-host select, .kron-host input { font: inherit; color: var(--paper); background: var(--stage); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.kron-host select { max-width: 14em; }
.kron-host.live { display: block; padding: 18px 20px; background: linear-gradient(135deg, #4a1550, var(--velvet)); box-shadow: inset 0 0 0 2px var(--gold); }
.kron-host.live .what { color: var(--gold); font-family: var(--display); font-weight: 700; font-size: 1.3rem; margin: 0; }
.kron-host .kron-who { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; }
.kron-host .kron-who .prompt { font-family: var(--display); font-size: 1.5rem; font-weight: 700; margin: 0; }
.kron-host .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.kron-host .custom { display: inline-flex; gap: 6px; align-items: center; }
.kron-host .custom input { width: 5em; }
.suggestions { margin-top: 18px; background: var(--velvet); border-radius: 20px; padding: 6px 18px 16px; }
.suggestions .actions { display: flex; gap: 8px; margin-bottom: 10px; }
.sugg-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.sugg-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border-radius: 12px; background: var(--velvet-2); }
.sugg-list .txt { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.sugg-list .who { color: var(--dim); font-size: .85rem; }
.sugg-list .tools { display: flex; gap: 6px; align-items: center; }
.sugg-list .warn { color: var(--pink); font-size: .85rem; }
.sugg-list li.saving { opacity: .6; }

/* Touch screens can't hover: always show the player tools, under the name */
@media (hover: none) {
  .people li { flex-wrap: wrap; }
  .people .tools { display: flex; width: 100%; padding-left: 52px; }
}
@media (max-width: 600px) {
  body.host-screen main { padding: 12px 14px 48px; gap: 16px; }
  .host-head { gap: 8px 14px; }
  .host-head .code { font-size: 1.6rem; }
  .now { padding: 16px; border-radius: 16px; }
  .now .prompt { font-size: 1.35rem; }
  .now .actions .btn.big { width: 100%; }
  .answers li { grid-template-columns: 1.8em 1fr auto; }
  .answers li .secs { display: none; }
  .side-panel { position: static; }
  .people li { flex-wrap: wrap; }
  .people .tools { display: flex; width: 100%; padding-left: 52px; }
}
.kron-overlay .face.xl { width: 30vh; height: 30vh; font-size: 10vh; box-shadow: 0 0 0 1.2vh var(--gold), 0 0 14vh rgba(255, 79, 139, .55); }

/* =========================================================================================
   PHASE 4: Selected Players, Mass Delusion, Redacted, One Up
   ========================================================================================= */
.badge { display: inline-block; margin-left: 8px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: var(--gold); color: #2a1600; vertical-align: middle; }
.chip { display: inline-block; font-size: .85rem; padding: 3px 10px; border-radius: 999px; background: var(--velvet-2); margin: 2px 6px 2px 0; }
.chip.out { opacity: .5; text-decoration: line-through; }
.chip.top { background: var(--gold); color: #2a1600; font-weight: 700; }
.choices { display: grid; gap: 10px; }
.btn.picked { outline: 3px solid var(--paper); outline-offset: 2px; }

/* Redacted: black strips for the hidden words */
.strip { display: inline-block; height: .95em; vertical-align: -0.1em; background: #050208; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255, 243, 227, .12); margin: 0 .12em; }
.was-hidden { background: var(--gold); color: #2a1600; border-radius: 4px; padding: 0 .15em; }
.best-bid { font-size: 1.1rem; }
.best-bid strong { font-family: var(--display); font-size: 1.6rem; color: var(--gold); }
.bid-row { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; align-items: center; margin: 10px 0; }
.bid-row input { font: inherit; font-family: var(--display); font-size: 1.6rem; font-weight: 700; text-align: center; color: var(--paper); background: var(--stage); border: 1px solid var(--line); border-radius: 14px; padding: 10px; width: 100%; }
.bid-row .btn { padding: 12px 0; font-size: 1.4rem; }
.clues h3 { margin: 0 0 6px; }
.clues p { margin: 4px 0; }

/* TV */
.tv .kicker { text-align: center; color: var(--gold); font-family: var(--display); font-weight: 700; font-size: 3vh; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 2vh; }
.tv .prompt.small { font-size: 5vh; margin-bottom: 3vh; }
.tv .contestants { display: flex; justify-content: center; gap: 2.4vh; margin-top: 4vh; flex-wrap: wrap; }
.tv .contestants .who { display: grid; justify-items: center; gap: .6vh; }
.tv .contestants .face { width: 9vh; height: 9vh; font-size: 3.4vh; box-shadow: 0 0 0 .5vh var(--gold); }
.tv .contestants .n { font-size: 2.4vh; }
.tv .contestants .who.out { opacity: .35; filter: grayscale(1); }
.md-bars { list-style: none; padding: 0; margin: 0 auto; width: min(90vw, 150vh); display: grid; gap: 1.4vh; }
.md-bars li { display: grid; grid-template-columns: 30vh 1fr 16vh 8vh; align-items: center; gap: 2vh; font-size: 3.4vh; opacity: 0; animation: md-in .5s ease forwards; animation-delay: calc(var(--i) * .45s); }
.md-bars .label { font-family: var(--display); font-weight: 700; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-bars .bar { height: 5vh; background: rgba(255, 243, 227, .08); border-radius: 1vh; overflow: hidden; }
.md-bars .fill { display: block; height: 100%; width: calc(var(--w) * 100%); background: var(--dim); border-radius: 1vh; transform-origin: left; animation: md-grow .8s ease forwards; animation-delay: calc(var(--i) * .45s); transform: scaleX(0); }
.md-bars li.first .fill { background: var(--gold); }
.md-bars li.second .fill { background: var(--lagoon); }
.md-bars .count { color: var(--dim); font-variant-numeric: tabular-nums; }
.md-bars .medal { font-family: var(--display); font-weight: 700; color: var(--gold); }
@keyframes md-in { to { opacity: 1; } }
@keyframes md-grow { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .md-bars li, .md-bars .fill { animation: none; opacity: 1; transform: none; } }
.tv .redacted-text { line-height: 1.25; }
.bid-board { display: flex; justify-content: center; align-items: baseline; gap: 3vh; margin: 4vh 0 1vh; }
.bid-board .amount { font-family: var(--display); font-weight: 700; font-size: 16vh; line-height: 1; color: var(--gold); }
.bid-board .by { font-family: var(--display); font-weight: 700; font-size: 5vh; }
.bid-board.won .by { color: var(--lagoon); }
.bid-board.lost .by { color: var(--pink); }
.on-stage { display: grid; justify-items: center; gap: 2vh; margin-top: 3vh; }
.on-stage .face.xl { width: 24vh; height: 24vh; font-size: 8vh; box-shadow: 0 0 0 1vh var(--gold); }
.on-stage .name, .tv .champion .name { font-family: var(--display); font-weight: 700; font-size: 7vh; }
.tv .champion { display: flex; justify-content: center; gap: 6vh; flex-wrap: wrap; text-align: center; }

/* Control screen */
.contestant-line { margin: 0 0 8px; }
.pick-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); max-height: 40vh; overflow: auto; }
.pick-list li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--velvet-2); }
.pick-list input { width: 20px; height: 20px; accent-color: var(--gold); flex: none; }
.pick-list label { cursor: pointer; flex: 1; }
.pick-list.judge li .eff { display: flex; align-items: center; gap: 4px; color: var(--dim); font-size: .85rem; }
.md-groups { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 4px; max-height: 60vh; overflow: auto; }
.md-groups li { display: grid; grid-template-columns: auto 1fr auto 2.6em auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--velvet-2); }
.md-groups li.first { box-shadow: inset 4px 0 0 var(--gold); }
.md-groups li.second { box-shadow: inset 4px 0 0 var(--lagoon); }
.md-groups li.rejected { opacity: .5; }
.md-groups li.rejected strong { text-decoration: line-through; }
.md-groups input { width: 20px; height: 20px; accent-color: var(--gold); }
.md-groups .g { cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.md-groups .who { color: var(--dim); font-size: .85rem; }
.md-groups .n { font-variant-numeric: tabular-nums; color: var(--dim); white-space: nowrap; }
.md-groups .place { font-weight: 700; color: var(--gold); }
.md-groups .tools { display: flex; gap: 4px; }
.dim.small, .small { font-size: .88rem; }
@media (max-width: 600px) {
  .md-groups li { grid-template-columns: auto 1fr auto 2.6em; }
  .md-groups .tools { grid-column: 2 / -1; }
  .pick-list { grid-template-columns: 1fr 1fr; }
}

/* =========================================================================================
   PHASE 5: Tower Tumble
   ========================================================================================= */
/* TV: the tower fills the stage; the numbers sit on top */
.tt-wrap { position: relative; width: 100%; height: 76vh; }
.tower-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tt-hud { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 2vh; pointer-events: none; }
.tt-stats { display: grid; gap: .6vh; font-size: 2.8vh; color: var(--dim); }
.tt-stats strong { color: var(--paper); font-family: var(--display); }
.tt-powers { display: flex; flex-direction: column; align-items: flex-end; gap: .8vh; }
.power { font-family: var(--display); font-weight: 700; font-size: 2.6vh; padding: .6vh 1.6vh; border-radius: 999px; background: var(--velvet-2); }
.power.armed { background: var(--pink); color: #2a0010; animation: armed 1.2s ease-in-out infinite alternate; }
.power.on { background: var(--gold); color: #2a1600; }
.power.next { background: transparent; color: var(--dim); font-weight: 400; }
@keyframes armed { from { box-shadow: 0 0 0 0 rgba(255, 79, 139, .6); } to { box-shadow: 0 0 0 1.2vh rgba(255, 79, 139, 0); } }
@media (prefers-reduced-motion: reduce) { .power.armed { animation: none; } }
.tt-banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(80vw, 120vh); text-align: center; background: rgba(27, 15, 46, .88); border: 2px solid var(--gold); border-radius: 3vh; padding: 3vh 4vh; z-index: 2; display: grid; justify-items: center; gap: 1vh; }
.tt-banner .big { font-family: var(--display); font-weight: 700; font-size: 5vh; margin: 0; }
.tt-banner .sub { margin: 0; }
.tt-banner .face.xl { width: 18vh; height: 18vh; font-size: 6vh; box-shadow: 0 0 0 .8vh var(--pink); }
.tv-main:has(.tt-wrap) { position: relative; }

/* Phone */
.role-box { margin: 14px 0; display: grid; gap: 10px; }
.role-box .btn { user-select: none; -webkit-user-select: none; touch-action: none; }
.role-reveal { background: var(--stage); border: 2px solid var(--line); border-radius: 16px; padding: 14px; text-align: center; }
.role-reveal p { margin: 4px 0; }
.role-traitor { font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: var(--pink); }
.role-builder { font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: var(--lagoon); }
.tt-line { margin-top: 0; }
.tt-phone { transition: filter .4s; }
.tt-phone.fogged { filter: blur(6px) contrast(.7); }
.placer { background: var(--velvet); border-radius: 18px; padding: 14px; display: grid; gap: 10px; margin-bottom: 12px; }
.placer h2 { margin: 0; font-size: 1.2rem; }
.aim-pad { position: relative; height: 72px; border-radius: 16px; background: var(--stage); border: 1px solid var(--line); touch-action: none; cursor: ew-resize; }
.aim-pad .track { position: absolute; left: 16px; right: 16px; top: 50%; height: 4px; margin-top: -2px; background: var(--line); border-radius: 2px; }
.aim-pad .knob { position: absolute; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 14px; background: var(--gold); box-shadow: 0 4px 0 #b97f00; pointer-events: none; }
.aim-pad:focus-visible { outline: 3px solid var(--paper); outline-offset: 2px; }
.rotate-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.rotate-row .btn { font-size: 1.6rem; padding: 10px 0; }
.rotate-row .angle { font-family: var(--display); font-weight: 700; min-width: 3em; text-align: center; }
.drop-btn { font-size: 1.4rem; }
.powers { display: grid; gap: 10px; }
.power-btn { background: var(--pink); color: #2a0010; box-shadow: 0 4px 0 #9a1f4d; font-size: 1.15rem; }
.power-btn.resting { opacity: .45; animation: none; }
.powers-wait { margin: 4px 0; }

/* =========================================================================================
   PHASE 6: teams, betting and backing, knockout
   ========================================================================================= */
.t-gold { --tc: #ffc23d; } .t-pink { --tc: #ff4f8b; } .t-lagoon { --tc: #33d9c1; } .t-violet { --tc: #a77bff; }
.t-orange { --tc: #ff8a3d; } .t-blue { --tc: #4da3ff; } .t-green { --tc: #7fd18b; } .t-red { --tc: #ff5a5a; }
.team-chip { display: inline-block; margin-left: 8px; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--tc); color: #1b0f2e; vertical-align: middle; }
.badge.out { background: var(--line); color: var(--paper); }
.team-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.team-btn { background: var(--tc); color: #1b0f2e; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }

/* Phone: betting */
.bet-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; text-align: left; }
.bet-option .face { width: 40px; height: 40px; font-size: .9rem; }
.bet-option .mult { font-family: var(--display); font-weight: 700; color: var(--gold); }
.bet-option.picked .mult { color: inherit; }
.stake-row { display: grid; grid-template-columns: 1fr 7em; gap: 10px; align-items: center; }
.stake-row input { font: inherit; font-family: var(--display); font-size: 1.4rem; font-weight: 700; text-align: center; color: var(--paper); background: var(--stage); border: 1px solid var(--line); border-radius: 12px; padding: 8px; width: 100%; }

/* TV: bet cards, teams */
.bet-cards { display: flex; justify-content: center; gap: 3vh; flex-wrap: wrap; margin: 2vh 0; }
.bet-card { width: 24vh; background: var(--velvet); border-radius: 2.4vh; padding: 2.4vh 2vh; display: grid; justify-items: center; gap: 1vh; text-align: center; }
.bet-card .face.lg { width: 11vh; height: 11vh; font-size: 4vh; }
.bet-card .side-icon { font-size: 9vh; line-height: 1; }
.bet-card .name { font-family: var(--display); font-weight: 700; font-size: 3.2vh; }
.bet-card .mult { font-family: var(--display); font-weight: 700; font-size: 6vh; color: var(--gold); line-height: 1; }
.bet-card .stake-bar { width: 100%; height: 1.4vh; border-radius: 1vh; background: rgba(255, 243, 227, .1); overflow: hidden; }
.bet-card .stake-bar .fill { display: block; height: 100%; width: calc(var(--share) * 100%); background: var(--pink); transition: width .4s ease; }
.bet-card .staked { color: var(--dim); font-size: 2.2vh; }
.bet-card.side-team .mult { color: var(--lagoon); }
.bet-card.side-traitor .mult { color: var(--pink); }
.team-cols { grid-column: 1 / -1; display: flex; gap: 2vh; justify-content: center; flex-wrap: wrap; margin-top: 3vh; }
.team-col { min-width: 22vh; max-width: 40vh; border-top: .8vh solid var(--tc); background: var(--velvet); border-radius: 1.6vh; padding: 1.4vh 2vh; }
.team-col h3 { margin: 0 0 .6vh; color: var(--tc); font-family: var(--display); font-size: 3vh; }
.team-col .names { margin: 0; color: var(--dim); font-size: 2.2vh; }
.team-board { list-style: none; padding: 0; margin: 2vh auto; width: min(80vw, 110vh); display: grid; gap: 1.2vh; }
.team-board li { display: grid; grid-template-columns: 6vh 1fr auto; align-items: center; gap: 2vh; padding: 1.4vh 2.4vh; border-radius: 1.6vh; background: var(--velvet); box-shadow: inset 1vh 0 0 var(--tc); font-size: 3.6vh; }
.team-board .n { font-family: var(--display); font-weight: 700; color: var(--tc); }
.team-board .pts { font-family: var(--display); font-weight: 700; }
.winners li.out { opacity: .45; }
.tv .sub.note { margin-top: 1.4vh; }

/* Control screen */
.teams-panel { margin-top: 16px; }
.team-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.team-list li { padding: 6px 10px; border-radius: 10px; background: var(--velvet-2); box-shadow: inset 4px 0 0 var(--tc); }
.team-select { font: inherit; font-size: .85rem; color: var(--paper); background: var(--stage); border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; }
.compact-board { list-style: none; padding: 0; margin: 1vh auto 0; width: min(70vw, 90vh); display: grid; gap: .6vh; }
.compact-board li { display: grid; grid-template-columns: 5vh 1fr auto; gap: 2vh; padding: .8vh 2vh; border-radius: 1.2vh; background: rgba(255, 243, 227, .05); font-size: 2.8vh; box-shadow: inset .6vh 0 0 var(--tc, transparent); }
.compact-board li.out { opacity: .45; }
.compact-board .pts { font-family: var(--display); font-weight: 700; }
.team-board li { font-size: 3.2vh; padding: 1vh 2.4vh; }

/* =========================================================================================
   Pause, test rooms and the test bench
   ========================================================================================= */
.paused-overlay { display: none; }
body.tv.paused .paused-overlay { display: grid; position: fixed; inset: 0; z-index: 30; place-items: center; background: rgba(27, 15, 46, .72); }
.paused-overlay span { font-family: var(--display); font-weight: 700; font-size: 14vh; letter-spacing: .08em; color: var(--gold); text-transform: uppercase; }
.test-flag { display: none; }
body.tv.test-room .test-flag { display: block; position: fixed; top: 1.4vh; right: 50%; transform: translateX(50%); z-index: 31; font-family: var(--display); font-weight: 700; font-size: 2vh; letter-spacing: .2em; text-transform: uppercase; color: #1b0f2e; background: var(--lagoon); padding: .3vh 1.4vh; border-radius: 999px; }
.paused-banner { background: var(--gold); color: #2a1600; font-weight: 700; text-align: center; border-radius: 12px; padding: 10px; margin: 10px 0; }
.test-strip { margin: 0 0 6px; text-align: center; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--lagoon); }
.test-badge { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; background: var(--lagoon); color: #00261f; padding: 2px 10px; border-radius: 999px; }
body.host-screen.paused .now { outline: 3px dashed var(--gold); outline-offset: 4px; }

/* Control screen: test tools */
.test-panel { margin-top: 18px; border: 2px dashed var(--lagoon); border-radius: 20px; padding: 6px 18px 16px; }
.test-panel h2 { color: var(--lagoon); }
.test-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 8px 0; }
.test-rounds { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 6px; }
.test-rounds li { background: var(--velvet-2); border-radius: 12px; padding: 8px 10px; }
.test-rounds li.current { box-shadow: inset 4px 0 0 var(--gold); }
.test-rounds .row { display: flex; gap: 8px; align-items: center; }
.test-rounds .nm { flex: 1; min-width: 0; }
.tf-form { margin-top: 10px; }
.tf-grid { display: grid; gap: 10px 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tf { display: grid; gap: 4px; font-size: .88rem; color: var(--dim); }
.tf.check { display: flex; gap: 8px; align-items: center; }
.tf input[type=number], .tf input[type=text], .tf select { font: inherit; color: var(--paper); background: var(--stage); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
fieldset.tf { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
fieldset.tf .check { display: inline-flex; gap: 6px; align-items: center; }
.pts-input { width: 4.5em; font: inherit; font-family: var(--display); font-weight: 700; color: var(--gold); background: var(--stage); border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; text-align: right; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }

/* The test bench */
body.bench { padding: 0 16px 24px; }
.bench-bar { display: flex; gap: 14px; align-items: center; padding: 12px 0; flex-wrap: wrap; }
.bench-bar .spacer { flex: 1; }
.bench-bar select { font: inherit; color: var(--paper); background: var(--velvet); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.bench-help { margin: 0 0 12px; }
.bench-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.bench-phone p { margin: 0 0 4px; }
.bench-phone iframe { width: 100%; height: min(80vh, 760px); border: 1px solid var(--line); border-radius: 18px; background: var(--stage); }

/* The Game screen preview (preview.html, inside the show builder) */
body.preview .sound-btn { display: none; }
body.preview .tv-bottom .join { opacity: .6; }
.preview-note { position: fixed; right: 1.4vh; bottom: 1.4vh; z-index: 31; margin: 0; font-size: 2.2vh; font-weight: 600; color: #1b0f2e; background: var(--gold); padding: .3vh 1.2vh; border-radius: 999px; }

/* The Control screen's "Open the Game screen" button (until the Game screen is open) */
.launch { grid-column: 1 / -1; display: grid; gap: 6px; justify-items: start; }
.launch .launch-btn { min-height: 80px; font-size: 1.5rem; width: min(100%, 560px); animation: launch-glow 1.8s ease-in-out infinite alternate; }
.launch p { margin: 0; }
@keyframes launch-glow { to { filter: brightness(1.15) saturate(1.1); } }
@media (prefers-reduced-motion: reduce) { .launch .launch-btn { animation: none; } }
.back-link { color: var(--dim); text-decoration: none; font-weight: 600; }
.back-link:hover { color: var(--paper); }

/* ---- Game screen: a round's title and rules, and the utility rounds ---------------------- */
.intro-title, .util { display: grid; justify-items: center; text-align: center; gap: 2vh; }
.intro-name { font-family: var(--display); font-weight: 900; font-size: 15vh; line-height: .95; margin: 0; letter-spacing: -0.02em; }
.intro-sub { font-family: var(--display); font-size: 5vh; margin: 0; color: var(--dim); }
.intro-mode { font-weight: 700; font-size: 3vh; padding: .6vh 2.2vh; border-radius: 999px; background: var(--gold); color: #1e1b3a; }
.intro-rules { display: grid; grid-template-columns: 1.15fr 1fr; gap: 5vw; align-items: center; }
.rules-card { background: var(--card, #fff3e3); color: var(--card-ink, #1b0f2e); border-radius: 3vh; padding: 4vh 4vw; position: relative; }
.rules-card .kicker { margin: 0 0 1.5vh; }
.rules-list { margin: 0; padding-left: 1.2em; display: grid; gap: 2vh; font-size: 3.6vh; line-height: 1.25; font-family: var(--display); font-weight: 600; }
.rules-example { display: grid; gap: 1.6vh; justify-items: center; }
.ex-card { background: var(--card, #fff3e3); color: var(--card-ink, #1b0f2e); font-family: var(--display); font-weight: 800; font-size: 3.4vh; padding: 2vh 3vh; border-radius: 2vh; text-align: center; box-shadow: .8vh .8vh 0 var(--accent, var(--gold)); max-width: 40vw; }
.ex-row { display: flex; justify-content: space-between; gap: 3vh; width: 30vw; padding: 1.2vh 2vh; border-radius: 1.4vh; background: var(--velvet); font-size: 2.6vh; }
.ex-row.top { background: var(--accent, var(--gold)); color: #1e1b3a; font-weight: 700; }
.ex-ab { display: grid; grid-template-columns: 1fr 1fr; gap: 2vh; width: 34vw; }
.ex-side { border-radius: 2vh; padding: 2vh; min-height: 14vh; display: grid; align-content: space-between; color: #1e1b3a; font-weight: 800; font-size: 2.6vh; }
.ex-side.a { background-color: var(--pink); background-image: var(--kf-waves, none); }
.ex-side.b { background-color: var(--lagoon); background-image: var(--kf-dots, none); }
.ex-side i { font-style: normal; font-family: var(--display); font-size: 4vh; background: #f8f3e9; width: 1.3em; height: 1.3em; border-radius: 50%; display: grid; place-items: center; }
.ex-side span { background: #f8f3e9; justify-self: start; padding: .2em .5em; border-radius: .3em; }
.ex-note { margin: 0; font-size: 2.8vh; color: var(--dim); font-weight: 600; }
.ex-bars { display: grid; gap: 1.2vh; width: 32vw; }
.ex-bar { display: grid; grid-template-columns: 12vw 1fr; align-items: center; gap: 1.5vh; font-size: 2.6vh; font-weight: 700; }
.ex-bar i { display: block; height: 3.6vh; width: calc(var(--w) * 100%); border-radius: 1vh; background: var(--dim); }
.ex-bar.top i { background-color: var(--accent, var(--gold)); background-image: var(--kf-stripes, none); }
.ex-black { background: #1e1b3a; color: #1e1b3a; border-radius: .3em; padding: 0 .2em; }
.ex-bids { display: flex; gap: 2vh; }
.ex-bid { font-family: var(--display); font-weight: 900; font-size: 4.4vh; padding: 1vh 2.2vh; border-radius: 2vh; background: var(--velvet); }
.ex-bid.top { background: var(--accent, var(--gold)); color: #1e1b3a; }
.ex-line { display: flex; gap: 2vh; align-items: center; font-size: 6vh; }
.ex-line span:nth-child(even) { font-size: 3.6vh; color: var(--dim); }
.ex-tower { position: relative; width: 22vh; height: 30vh; }
.ex-tower b { position: absolute; display: block; border-radius: .5vh; border: .3vh solid rgba(30,27,58,.85); }
.ex-tower .b1 { left: 3vh; bottom: 2vh; width: 16vh; height: 4vh; background: var(--lagoon); }
.ex-tower .b2 { left: 6vh; bottom: 6vh; width: 6vh; height: 6vh; background: var(--gold); }
.ex-tower .b3 { left: 12vh; bottom: 6vh; width: 4vh; height: 8vh; background: var(--pink); }
.ex-tower .b4 { left: 5vh; bottom: 14vh; width: 13vh; height: 3vh; background: #8a6fd8; transform: rotate(-6deg); }
.ex-tower .b5 { left: 9vh; bottom: 17vh; width: 5vh; height: 5vh; background: #9ac43c; }
.ex-tower .ex-base { position: absolute; left: 0; right: 0; bottom: 0; height: 2vh; background: #3a2560; border-radius: .5vh; }
.ex-tower .ex-target { position: absolute; left: -4vh; right: -4vh; bottom: 24vh; border-top: .5vh dashed var(--gold); }
.break-clock { font-family: var(--display); font-weight: 900; font-size: 26vh; line-height: 1; font-variant-numeric: tabular-nums; }
.util .timebar { width: 60vw; }
.award-for { font-family: var(--display); font-size: 5vh; color: var(--dim); margin: 0; }
.award-title { font-family: var(--display); font-weight: 900; font-size: 11vh; line-height: 1; margin: 0; max-width: 80vw; }
.award-for.drum { animation: drum .4s steps(2) infinite; }
@keyframes drum { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .award-for.drum { animation: none; } }
.util .face.xl { width: 24vh; height: 24vh; font-size: 8vh; box-shadow: 0 0 0 1vh var(--gold); }

.rules-host, .rules-phone { margin: 0 0 14px; padding-left: 1.3em; display: grid; gap: 8px; line-height: 1.35; }
.rules-phone { font-size: 1.1rem; }
.intro-phone { text-align: center; display: grid; gap: 6px; justify-items: center; }
.intro-phone h1 { margin: 4px 0; }

/* The Game screen preview in its own window (preview.html?popout=1): controls on hover */
body.popout .po-bar { position: fixed; left: 50%; bottom: 2vh; transform: translate(-50%, 1.5vh); z-index: 40; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 16px; background: rgba(14, 12, 34, .92); box-shadow: 0 10px 30px rgba(0,0,0,.45); width: max-content; max-width: 94vw; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font: 600 14px/1 'Space Grotesk', system-ui, sans-serif; }
body.popout.po-awake .po-bar, body.popout .po-bar:focus-within { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.po-stages, .po-items { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.po-stage, .po-btn { font: inherit; color: #f8f3e9; background: transparent; border: 1px solid #47437a; border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.po-stage[aria-pressed=true] { background: #f8f3e9; color: #1e1b3a; border-color: #f8f3e9; }
.po-stage.live { background: #f6b72c; color: #1e1b3a; border-color: #f6b72c; }
.po-btn:disabled { opacity: .35; cursor: default; }
.po-label { color: #b7b2d6; min-width: 4.5em; text-align: center; }
.po-stage:focus-visible, .po-btn:focus-visible { outline: 3px solid #f6b72c; outline-offset: 2px; }

/* ---- Bribery ------------------------------------------------------------------------------ */
/* Phone: a bribe on you, the latest result, and the panel to bribe someone */
.bribe-you { background: linear-gradient(135deg, #7b2cff, var(--pink)); color: #fff; border-radius: 20px; padding: 16px 18px; margin: 12px 0; display: grid; gap: 6px; }
.bribe-you p { margin: 0; }
.bribe-from { font-size: .95rem; }
.bribe-text { font-family: var(--display); font-weight: 700; font-size: 1.45rem; line-height: 1.15; }
.bribe-note { font-size: .92rem; opacity: .92; }
.bribe-proof { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.bribe-proof .buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.bribe-you .btn.small { background: #fff; color: #3a0d55; }
.bribe-you .btn.small.quiet { background: rgba(255, 255, 255, .2); color: #fff; }
.proof-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .7); flex: none; }
.bribe-result { position: relative; border-radius: 16px; padding: 12px 40px 12px 16px; margin: 10px 0; background: var(--velvet-2); border-left: 6px solid var(--lagoon); }
.bribe-result.bad { border-left-color: var(--pink); }
.bribe-result p { margin: 0; }
.bribe-result .big { font-family: var(--display); font-weight: 700; font-size: 1.3rem; }
.bribe-result .x { position: absolute; top: 8px; right: 8px; background: none; border: 0; color: var(--dim); font-size: 1.1rem; cursor: pointer; padding: 4px 8px; }
.bribes { margin-top: 18px; display: grid; gap: 10px; }
.bribes.open { background: var(--velvet); border-radius: 18px; padding: 12px; }
.bribes h2, .bribes h3 { margin: 4px 0 0; }
.bribes h3 { font-size: 1rem; color: var(--dim); }
.bribe-toggle { width: 100%; flex-direction: row; justify-content: space-between; gap: 10px; white-space: nowrap; }
.bribe-menu, .bribe-who { display: grid; gap: 8px; }
.bribe-opt { text-align: left; font: inherit; color: var(--paper); background: var(--stage); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; cursor: pointer; }
.bribe-opt .txt { font-weight: 700; }
.bribe-opt .meta { color: var(--dim); font-size: .85rem; }
.bribe-opt:disabled { opacity: .45; cursor: default; }
.bribe-opt:not(:disabled):active { border-color: var(--gold); }
.bribe-chosen { margin: 0; background: var(--stage); border-radius: 12px; padding: 10px 12px; }
.bribe-who { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); max-height: 260px; overflow-y: auto; }
.who-btn { font: inherit; font-weight: 600; color: var(--paper); background: var(--stage); border: 2px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; overflow-wrap: anywhere; }
.who-btn.picked { border-color: var(--gold); background: var(--velvet-2); }
.bribes input[type=search] { font: inherit; color: var(--paper); background: var(--stage); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.bribe-mine { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bribe-mine li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; background: var(--stage); border-radius: 12px; padding: 8px 10px; }
.bribe-mine .txt { flex: 1 1 60%; }
.bribe-mine .chip, .bribe-host .chip { font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--velvet-2); color: var(--dim); }
.bribe-mine li.done .chip, .bribe-host li.done .chip { background: var(--lagoon); color: #00261f; }
.bribe-mine li.failed .chip, .bribe-host li.failed .chip { background: var(--pink); color: #2a0010; }

/* Control screen: the bribes waiting to be judged */
.bribe-host { background: var(--velvet); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; border: 2px solid #7b2cff; display: grid; gap: 10px; }
.bribe-host h2 { margin: 0; font-size: 1.1rem; }
.bribe-host ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bribe-host .open-b { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; background: var(--stage); border-radius: 12px; padding: 10px 12px; }
.bribe-host .open-b .what { margin: 0; }
.bribe-host .open-b .what strong { font-family: var(--display); }
.bribe-host .open-b .tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.bribe-host .proof-big { grid-column: 1 / -1; max-width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; justify-self: start; cursor: zoom-in; }
.bribe-host .proof-big.zoomed { max-height: none; cursor: zoom-out; }
.bribe-host .recent li { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--dim); }

/* Game screen: a banner when a bribe is placed or judged */
.bribe-banner { position: fixed; left: 50%; top: 9vh; z-index: 15; transform: translateX(-50%); width: min(86vw, 120vh); background: linear-gradient(135deg, #7b2cff, var(--pink)); color: #fff; border-radius: 3vh; padding: 2.4vh 3vw; display: grid; grid-template-columns: auto 1fr; gap: .6vh 2.4vw; align-items: center; box-shadow: 0 2vh 6vh rgba(0, 0, 0, .45); animation: bribe-in .5s cubic-bezier(.2, 1.4, .4, 1); }
.bribe-banner .face { width: 13vh; height: 13vh; font-size: 5vh; grid-row: span 3; }
.bribe-banner .kicker { font-size: 3vh; font-weight: 700; margin: 0; opacity: .95; }
.bribe-banner .text { font-family: var(--display); font-weight: 700; font-size: 5.4vh; line-height: 1.05; margin: 0; }
.bribe-banner .sub { font-size: 2.8vh; margin: 0; opacity: .9; }
.bribe-banner.done { background: linear-gradient(135deg, #13917f, var(--lagoon)); color: #00261f; }
.bribe-banner.failed { background: linear-gradient(135deg, #a8204f, var(--pink)); }
.bribe-count { font-weight: 700; color: #c9a6ff; margin-left: 2vw; }
@keyframes bribe-in { from { transform: translate(-50%, -6vh) scale(.9); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bribe-banner { animation: none; } }
