:root {
  --ink: #2b1d12;
  --paper: #f2e3c0;
  --paper2: #ecd9b0;
  --card: #fbf1d6;
  --mustard: #e6a825;
  --teal: #2f9c8b;
  --rust: #cf4a2b;
  --navy: #274b5a;
  --orange: #c9762a;
  --muted-solid: #7a6647;
  --dot: rgba(242, 227, 192, .05);
  --win: #dcecca;
  --display: "Alfa Slab One", Georgia, serif;
  --head: "Oswald", system-ui, sans-serif;
  --body: "Oswald", system-ui, -apple-system, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
  --type: "Special Elite", "Courier New", monospace;
  --wordmark: "Bungee", "Alfa Slab One", sans-serif;   /* bold marquee wordmark for WIZEGUYZ */
}
* { box-sizing: border-box; }
html {
  overflow-x: hidden;
  /* iOS Safari auto-inflates text in some layouts (Chromium doesn't) — that can
     push content past the viewport and cut off the right edge. Pin it. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  overflow-x: hidden;
  max-width: 100%;
  background-color: #1e6b60;
  background-image: linear-gradient(165deg, #2b8476 0%, #1e6b60 55%, #17564d 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.45;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 16px; min-height: 100dvh; display: flex; flex-direction: column; }
.content { animation: rise .35s ease both; margin: auto 0; width: 100%; min-width: 0; }   /* center short pages, scroll tall ones */

/* speakeasy "floor": an Art-Deco gold sunburst rising from the bottom edge */
.deco-bottom { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- top bar ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; min-width: 0; }
.brand .logo { width: 40px; height: 40px; display: block; flex: 0 0 auto; }
.brand-word {
  font-family: var(--wordmark); font-weight: 400; font-size: 20px; color: var(--rust);
  text-transform: uppercase; letter-spacing: .01em; text-shadow: 2px 2px 0 var(--ink);
}
/* on the home page the big hero already spells it out — show just the logo mark there */
.wrap:has(.hero) .brand-word { display: none; }
.roomcode {
  font-family: var(--head); font-weight: 600; font-size: 13px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--card); background: var(--navy);
  border: 2px solid var(--ink); border-radius: 8px; padding: 4px 10px;
  box-shadow: 2px 2px 0 var(--ink); text-decoration: none; display: inline-block;
  flex: 0 0 auto; white-space: nowrap;
}

/* ---- hero ---- */
.hero { text-align: center; padding: 22px 0 6px; }
.hero .muted { color: #cbb488; }   /* tagline sits on the dark table, not a card */
.hero h1 {
  font-family: var(--wordmark); font-weight: 400; font-size: 47px; margin: 0; color: var(--mustard);
  text-transform: uppercase; letter-spacing: .01em; line-height: 1;
  text-shadow: 4px 4px 0 var(--ink); -webkit-text-stroke: 1.4px var(--ink); paint-order: stroke fill;
}

/* ---- cards (lit "documents" on the dark speakeasy table) ---- */
.card {
  position: relative;
  min-width: 0; max-width: 100%;   /* never let content force the card past the viewport */
  background: var(--card); border: 3px solid var(--ink); border-radius: 16px;
  padding: 22px 20px; margin: 18px 0;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .5), 0 16px 40px rgba(0, 0, 0, .45);
}
/* image-based avatars: circular framed portrait (drop-in for the old SVG) */
.avatar-img {
  display: inline-block; vertical-align: middle; border-radius: 50%;
  object-fit: cover; background: var(--card);
  border: 3px solid var(--ink); box-shadow: 1px 1px 0 var(--ink);
}
.king-avatar .avatar-img { border-width: 5px; box-shadow: 4px 4px 0 var(--ink); }

/* points-multiplier badge — its own sticker, top-right of the card */
.mult-pill {
  position: absolute; top: -15px; right: 16px; z-index: 6; white-space: nowrap;
  font-family: var(--display); font-size: 16px; letter-spacing: .01em; color: var(--ink);
  background: var(--mustard); border: 3px solid var(--ink); border-radius: 22px;
  padding: 6px 15px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(3deg);
}
.mult-pill.hot { background: var(--rust); color: #fff2e8; animation: pillpulse 1.1s ease-in-out infinite; }
@keyframes pillpulse { 0%, 100% { transform: rotate(3deg) scale(1); } 50% { transform: rotate(3deg) scale(1.09); } }
h2 {
  font-family: var(--display); font-weight: 400; font-size: 26px; margin: 0 0 14px;
  text-transform: uppercase; letter-spacing: .005em; color: var(--ink); line-height: 1.05;
}
h3 {
  font-family: var(--head); font-weight: 700; font-size: 17px; margin: 4px 0 8px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--rust);
}
p { margin: 8px 0; }
.muted { color: var(--muted-solid); }
.small { font-size: 13px; }
.big { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--teal); text-transform: uppercase; }
.link {
  word-break: break-all; background: var(--paper2); padding: 12px; border-radius: 10px;
  font-size: 14px; border: 2px dashed var(--ink); font-weight: 500;
}
.prompt-label {
  font-family: var(--head); font-weight: 600; font-size: 19px; line-height: 1.25;
  text-align: center; margin: 6px 0 16px;
}

/* ---- inputs ---- */
input[name] {
  width: 100%; padding: 14px 16px; margin: 8px 0; font-size: 16px; font-family: var(--head);
  font-weight: 500; color: var(--ink); background: #fffaf0;
  border: 3px solid var(--ink); border-radius: 12px; box-shadow: inset 2px 2px 0 rgba(43,29,18,.08);
}
input[name]::placeholder { color: #a9926b; }
input[name]:focus { outline: none; border-color: var(--rust); box-shadow: 0 0 0 3px rgba(207,74,43,.28); }

/* home: game-mode toggle */
.modes { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 16px; }
.mode { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 10px 14px;
  border: 3px solid var(--ink); border-radius: 12px; background: var(--paper2); cursor: pointer; }
.mode:has(input:checked) { background: var(--mustard); box-shadow: 3px 3px 0 var(--ink); }
.mode input { position: absolute; opacity: 0; width: 0; height: 0; }
.mode-name { font-family: var(--display); font-size: 17px; color: var(--ink); }

/* Mad Libs answer screen — story with inline fill-in blanks */
.madlibs-story { font-family: var(--head); font-weight: 500; font-size: 19px; line-height: 2.15;
  color: var(--ink); text-align: left; margin: 4px 0 16px; overflow-wrap: anywhere; }
.madlibs-story .mlblank {
  display: inline-block; width: 128px; max-width: 42vw; min-width: 0; margin: 0 2px; padding: 1px 8px;
  font-family: var(--type); font-size: 15px; font-weight: 400; text-align: center; color: var(--rust);
  background: #fffaf0; border: none; border-bottom: 2.5px solid var(--rust); border-radius: 0;
  box-shadow: none; vertical-align: baseline;
}
.madlibs-story .mlblank:focus { outline: none; background: #fff; border-bottom-color: var(--teal); box-shadow: 0 2px 0 var(--teal); }
.madlibs-story .mlblank::placeholder { color: #b79b6f; font-size: 12px; }
.mlsubmit { margin-top: 6px; }

/* ---- Drawing game ---- */
.draw-form { text-align: center; }
.draw-prompt { font-family: var(--head); font-weight: 600; font-size: 17px; margin: 2px 0 8px; color: var(--ink); }
.draw-prompt b { color: var(--rust); }
.drawpad {
  width: 100%; max-width: 340px; aspect-ratio: 1; display: block; margin: 0 auto;
  background: #fdfaf0; border: 3px solid var(--ink); border-radius: 12px;
  touch-action: none; cursor: crosshair; box-shadow: 3px 3px 0 var(--ink);
}
.draw-tools { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 12px 0 4px; }
.draw-colors { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; max-width: 340px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink); cursor: pointer; padding: 0; }
.sw.active { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); transform: scale(1.12); }
.sw.customwrap { position: relative; overflow: hidden; background: conic-gradient(red, gold, lime, aqua, blue, magenta, red); }
.sw.customwrap input[type="color"] { position: absolute; inset: -6px; width: 200%; height: 200%; border: none; padding: 0; opacity: 0; cursor: pointer; }
.draw-bottom { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.sizedot { display: inline-block; border-radius: 50%; background: var(--ink); flex: 0 0 auto; }
.sizerange { width: 120px; accent-color: var(--rust); }
.drawbtn { width: auto; font-family: var(--head); font-weight: 600; font-size: 13px; padding: 6px 12px;
  background: var(--paper2); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px;
  box-shadow: 2px 2px 0 var(--ink); cursor: pointer; text-transform: none; letter-spacing: 0; }
.drawbtn.on { background: var(--rust); color: #fff2e8; }
/* vote + reveal: drawing thumbnails laid out in a grid */
.bigfaves.drawgrid, .bigcards.drawgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drawthumb, .drawreveal { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fdfaf0;
  border-radius: 8px; display: block; }
.bigfave:has(.drawthumb) { padding: 6px; flex-direction: column; }

/* ---- buttons ---- */
button {
  width: 100%; padding: 15px 18px; margin-top: 12px; cursor: pointer;
  font-family: var(--head); font-weight: 700; font-size: 17px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--card); background: var(--rust);
  border: 3px solid var(--ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink);
  transition: transform .06s ease, box-shadow .06s ease;
}
button:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
button:disabled { background: var(--paper2); color: #a9926b; box-shadow: 2px 2px 0 rgba(43,29,18,.4); cursor: default; transform: none; }
button.ghost { background: transparent; color: var(--muted-solid); box-shadow: 3px 3px 0 rgba(43,29,18,.35); }
button.ghost:hover { color: var(--ink); }
.advance { margin-top: 20px; padding-top: 16px; border-top: 2px dashed var(--ink); }
.advance button { background: var(--teal); }
.stepnext { margin-top: 10px; background: var(--mustard); color: var(--ink); }
.btnlink {
  display: block; text-align: center; margin-top: 14px; color: var(--navy);
  text-decoration: none; font-family: var(--head); font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; font-size: 14px;
}
.btnlink:hover { text-decoration: underline; }

/* create / start-a-game primary buttons vary by color for poster pop */
form[action$="start_game"] button, form[action$="create"] button { background: var(--mustard); color: var(--ink); }

/* ---- avatar picker (all 10 wrap into two neat rows, no side-scroll) ---- */
.avatars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 8px 0 16px; }
.av {
  display: flex; align-items: center; justify-content: center; padding: 6px; min-width: 0;
  background: var(--paper2); border: 3px solid var(--ink); border-radius: 12px; cursor: pointer;
  transition: transform .1s ease, background .12s, box-shadow .1s;
}
.av .avsvg { width: 100%; height: auto; }
.av:hover { transform: translateY(-2px); }
.av input { position: absolute; opacity: 0; width: 0; height: 0; }
.av:has(input:checked) { background: var(--mustard); box-shadow: 3px 3px 0 var(--ink); transform: translateY(-2px) scale(1.03); }
/* a character someone already claimed — greyed out + not selectable */
.av.taken { opacity: .5; filter: grayscale(.85); cursor: not-allowed; position: relative; }
.av.taken:hover { transform: none; }
.av.taken::after {
  content: "taken"; position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%);
  font-family: var(--head); font-weight: 700; font-size: 9px; letter-spacing: .06em;
  text-transform: uppercase; color: #fff; background: var(--rust);
  border: 1.5px solid var(--ink); border-radius: 8px; padding: 0 5px; line-height: 1.5;
}
.avsvg { display: block; vertical-align: middle; }

/* ---- phase countdown timer ---- */
.timerbar { text-align: center; margin: -4px 0 10px; }
.timer {
  display: inline-block; min-width: 62px; padding: 3px 14px;
  font-family: var(--display); font-size: 24px; color: var(--card);
  background: var(--rust); border: 3px solid var(--ink); border-radius: 20px;
  box-shadow: 3px 3px 0 var(--ink); letter-spacing: .02em;
}
.timer.urgent { animation: tpulse .6s ease-in-out infinite; }
@keyframes tpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
/* on the navy results card the timer isn't shown, but keep contrast elsewhere */
.results-card .timer { background: var(--mustard); color: var(--ink); }

/* ---- music toggle (floating) ---- */
.musicbtn {
  position: fixed; bottom: 14px; right: 14px; z-index: 50;
  width: 46px; height: 46px; padding: 0; margin: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1; cursor: pointer;
  background: var(--card); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 50%; box-shadow: 3px 3px 0 var(--ink);
  transition: transform .06s ease, box-shadow .06s ease;
}
.musicbtn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.musicbtn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
/* dev fast-mode toggle sits just left of the music button */
.fastbtn { right: 68px; background: var(--mustard); }
.fastbtn.off { background: var(--card); opacity: .8; }
.musicbtn.muted { background: var(--paper2); opacity: .75; }

/* ---- crown / champ marker ---- */
.crown { color: var(--mustard); font-size: 1.15em; font-weight: 700; -webkit-text-stroke: 1.2px var(--ink); paint-order: stroke fill; }

/* ---- splash / transitions ---- */
#splash {
  position: fixed; inset: 0; z-index: 60;
  --glow: rgba(230, 168, 37, .3);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background-color: #17564d;
  background-image:
    radial-gradient(circle at 50% 40%, var(--glow), transparent 60%),
    linear-gradient(165deg, #1f6f63 0%, #17564d 58%, #123f39 100%);
  background-size: 100% 100%, 100% 100%;
  opacity: 1; transition: opacity .6s ease;
}
#splash.hide { opacity: 0; }
.splash-inner { text-align: center; padding: 20px; }
.splash-inner::after {   /* Art-Deco gold flourish */
  content: "◆ ◆ ◆"; display: block; margin-top: 16px; color: var(--mustard);
  font-size: 14px; letter-spacing: 8px; text-shadow: 1px 1px 0 var(--ink);
  animation: subin .5s ease .2s both;
}
.sp-title {
  display: block; font-family: var(--wordmark); font-size: 46px; color: var(--mustard);
  text-transform: uppercase; line-height: 1; opacity: 1;
  text-shadow: 4px 4px 0 var(--ink); -webkit-text-stroke: 1.6px var(--ink); paint-order: stroke fill;
  animation: popIn .55s cubic-bezier(.2,.8,.3,1.4);
}
.sp-sub {
  display: block; margin-top: 14px; font-family: var(--head); font-weight: 600; font-size: 19px;
  text-transform: uppercase; letter-spacing: .1em; color: #e7d6ab; opacity: 1;
  animation: subin .5s ease .15s both;
}
/* points-multiplier pill on the splash (matches the in-game pill) */
.sp-pill {
  display: inline-block; margin-top: 14px;
  font-family: var(--display); font-size: 18px; letter-spacing: .01em; color: var(--ink);
  background: var(--mustard); border: 3px solid var(--ink); border-radius: 22px;
  padding: 7px 18px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-2deg);
  animation: popIn .5s cubic-bezier(.2,.8,.3,1.4) .2s both;
}
.sp-pill.hot { background: var(--rust); color: #fff2e8; }
@keyframes popIn { from { transform: scale(.6); } to { transform: scale(1); } }
@keyframes subin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* loading screen (during server transitions like round build) */
#loading {
  position: fixed; inset: 0; z-index: 55; display: none;
  align-items: center; justify-content: center; background: var(--paper);
  background-image: radial-gradient(var(--dot) 1.5px, transparent 1.6px); background-size: 16px 16px;
}
#loading.on { display: flex; }
.loadbox { text-align: center; font-family: var(--head); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.dots { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; }
.dots span { width: 16px; height: 16px; border-radius: 50%; background: var(--rust); border: 2px solid var(--ink); animation: bd 1s infinite ease-in-out; }
.dots span:nth-child(2) { background: var(--mustard); animation-delay: .15s; }
.dots span:nth-child(3) { background: var(--teal); animation-delay: .3s; }
@keyframes bd { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ---- members / playing lists ---- */
.players { list-style: none; padding: 0; margin: 8px 0; }
.players li {
  padding: 11px 14px; margin: 8px 0; background: var(--paper2); border: 2px solid var(--ink);
  border-radius: 10px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.brow-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }

/* ---- answer stepper ---- */
.astep { display: none; }
.astep.active { display: block; animation: rfade .3s ease; }
/* answer phase = typewriter (like tapping out a note) */
.astep input[name] { font-family: var(--type); font-size: 20px; font-weight: 400; letter-spacing: .01em; }
.astep input[name]::placeholder { font-family: var(--type); font-size: 15px; font-weight: 400; }

/* ---- vote (one face-off per screen) ---- */
.vstep { display: none; }
.vstep.active { display: block; animation: rfade .3s ease; }
.choices { display: flex; flex-direction: row; align-items: stretch; gap: 8px; }
.choices .choice { flex: 1 1 0; min-width: 0; overflow-wrap: break-word; }
.choices .vsbig { flex: 0 0 auto; align-self: center; margin: 0; }
/* vote phase = clean bold sans (easy side-by-side comparison, no handwriting) */
.choice {
  display: flex; align-items: center; justify-content: center; min-height: 120px;
  background: var(--paper2); border: 3px solid var(--ink); border-radius: 14px;
  padding: 14px 12px; text-align: center; cursor: pointer;
  font-family: var(--head); font-size: 19px; font-weight: 600; line-height: 1.2; color: var(--ink);
  opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .4s ease, background .15s, box-shadow .15s;
}
.choice.in { opacity: 1; transform: none; }
.choice input { display: none; }
.choice:hover { background: #fff6e4; }
.choice.chosen { background: var(--mustard); box-shadow: 4px 4px 0 var(--ink); }
/* question fades up when a face-off appears */
.vstep .prompt-label { opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; }
.vstep .prompt-label.q-in { opacity: 1; transform: none; }
.vsbig {
  align-self: center; width: 46px; height: 46px; border-radius: 50%; margin: 2px 0;
  display: flex; align-items: center; justify-content: center; border: 3px solid var(--ink);
  font-family: var(--display); font-size: 16px; color: var(--card);
  background: var(--rust); box-shadow: 2px 2px 0 var(--ink); text-transform: uppercase;
}

/* ---- results reveal (one face-off per screen, A / VS / B) ---- */
#steps { margin-top: 8px; }
.rstep { display: none; }
.rstep.shown { display: block; animation: rfade .3s ease; }
@keyframes rfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.faceoff-row { display: flex; align-items: stretch; gap: 8px; }
.faceoff-row .side { flex: 1 1 0; min-width: 0; overflow-wrap: break-word; hyphens: none; }
.faceoff-row .vsbig { flex: 0 0 auto; align-self: center; margin: 0; }
.side {
  background: var(--paper2); border: 3px solid var(--ink); border-radius: 16px; padding: 16px 12px;
  display: flex; flex-direction: column; gap: 6px; text-align: center;
}
.rstep .side { opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .4s ease, border-color .25s, background .25s, box-shadow .25s; }
.rstep .side.in { opacity: 1; transform: none; }
.rstep .who, .rstep .pts { visibility: hidden; }
.rstep.scored .who, .rstep.scored .pts { visibility: visible; }
.rstep.scored .side.win { border-color: var(--ink); background: var(--win); box-shadow: 4px 4px 0 var(--teal); }
.ans { font-family: var(--hand); font-size: 23px; font-weight: 600; line-height: 1.22; color: var(--ink); }
.who { font-size: 13px; color: var(--muted-solid); font-family: var(--head); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; justify-content: center; }
.pts { font-family: var(--display); font-weight: 400; color: var(--teal); font-size: 18px; }
/* voter chips — revealed one-by-one, each settles as avatar + name */
.rstep { position: relative; }
.voters { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; margin-top: 10px; min-height: 28px; }
.voters .avsvg { margin: 0; }
.novote { font-family: var(--head); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-solid); }
.vchip { display: inline-flex; align-items: center; gap: 5px; }
.vchip .vname { font-family: var(--head); font-weight: 700; font-size: 13px; color: var(--ink); white-space: nowrap; }
/* settled voter chips stack vertically + cap the name, so they never overhang the tile */
.voters .vchip { flex-direction: column; gap: 3px; max-width: 100%; }
.voters .vchip .vname { font-size: 11px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; }
.voters .vchip.settled { opacity: 0; transform: scale(.5); transition: opacity .25s ease, transform .25s cubic-bezier(.2,.8,.3,1.5); }
.voters .vchip.settled.in { opacity: 1; transform: scale(1); }
/* the big center "jumps out" moment for each vote (then flies to its answer) */
.vote-source { display: none; }
.vote-stage { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .16s ease; }
.vote-stage.show { opacity: 1; }
.vchip.big {
  flex-direction: column; gap: 8px; background: var(--card); color: var(--ink);
  border: 4px solid var(--ink); border-radius: 18px; padding: 16px 22px; box-shadow: 6px 6px 0 var(--ink);
}
.vote-stage .vchip.big { animation: votePop .9s cubic-bezier(.2,.8,.3,1.4); }
.vote-stage .vchip.big .avsvg { width: 66px; height: 66px; }
.vote-stage .vchip.big .vname { font-size: 24px; }
@keyframes votePop { 0% { transform: scale(.3); opacity: 0; } 55% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }

/* ---- scoreboard ---- */
.board { list-style: none; padding: 0; margin: 8px 0; }
.board li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 11px 14px; margin: 8px 0; background: #fffaf0; color: var(--ink); border: 2px solid var(--ink);
  border-radius: 10px; font-weight: 700;
}
.board li:first-child { background: var(--mustard); border-width: 3px; box-shadow: 4px 4px 0 var(--ink); }
.score { font-family: var(--display); font-weight: 400; font-size: 20px; }
.standings-title {
  text-align: center; font-family: var(--display); font-size: 30px; margin: 4px 0 12px;
  color: var(--rust); text-transform: uppercase; text-shadow: 2px 2px 0 var(--ink);
}
.brow { transition: opacity .4s ease; }
.brow.p--in { animation: pop .55s cubic-bezier(.2,.8,.3,1.25); }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* ---- results = dark "reveal stage" (distinct from the light vote screen) ---- */
.results-card { background: var(--navy); color: var(--paper); }
.results-card #rtitle, .results-card .standings-title { color: var(--mustard); }
.results-card .prompt-label { color: var(--paper); }
.results-card #revealhint { color: #bcccd2; }
.results-card .vsbig { background: var(--mustard); color: var(--ink); }   /* mustard vs (vote screen uses rust) */
.results-card button.ghost { color: var(--paper); border-color: var(--paper); }

/* ---- "The Don" reveal (round winner — wiseguy flavor) ---- */
#kingcard { text-align: center; padding: 12px 0 4px; }
/* Italian tricolore ribbon across the top of the Don card */
#kingcard::before {
  content: ""; display: block; height: 6px; width: 160px; margin: 0 auto 14px; border-radius: 4px;
  border: 2px solid var(--ink);
  background: linear-gradient(90deg, #3f8f5a 0 33.3%, #f4ead0 33.3% 66.6%, #b83a2b 66.6% 100%);
}
.king-label { font-family: var(--head); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #bcccd2; margin: 0; font-size: 14px; }
.king-title { font-family: var(--display); font-size: 38px; color: var(--mustard); text-transform: uppercase; margin: 2px 0 20px; text-shadow: 3px 3px 0 var(--ink); }
.king-avatar-wrap { position: relative; display: inline-block; margin-top: 22px; }
.king-avatar { display: inline-block; animation: kingpop .6s cubic-bezier(.2,.8,.3,1.5) both; }
.king-avatar .avsvg { filter: drop-shadow(4px 4px 0 var(--ink)); }
/* crown sits ON the winner's avatar, tipped over the top edge */
.king-crown {
  position: absolute; top: -34px; left: 0; right: 0; text-align: center;
  font-size: 46px; z-index: 2; pointer-events: none;
  filter: drop-shadow(2px 3px 0 var(--ink));
  animation: crowndrop .7s cubic-bezier(.2,.8,.3,1.55) .25s both;
}
@keyframes crowndrop { 0% { transform: translateY(-40px) rotate(-18deg); opacity: 0; } 100% { transform: translateY(0) rotate(-8deg); opacity: 1; } }
.king-name { font-family: var(--display); font-size: 26px; color: var(--paper); margin-top: 12px; }
.king-sub { font-family: var(--head); font-weight: 600; color: var(--mustard); font-size: 18px; margin: 6px 0 0; letter-spacing: .04em; }
@keyframes kingpop { from { transform: scale(.3) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
/* sudden-death tie card */
#tiebreakcard { text-align: center; padding: 12px 0 6px; animation: kingpop .5s cubic-bezier(.2,.8,.3,1.5) both; }
.tb-vs { font-family: var(--display); font-size: 24px; color: var(--paper); margin: 0 0 10px; text-shadow: 2px 2px 0 var(--ink); }
.tb-board { margin: 14px 0 6px; }
.tb-board .brow.tied { background: rgba(230,168,37,.16); border-radius: 8px; }
.tb-board .brow.tied .brow-name, .tb-board .brow.tied .score { color: var(--mustard); font-weight: 700; }
#finalboard { animation: rise .4s ease both; margin-top: 20px; }

/* ---- final / gameover ---- */
#final { animation: rise .4s ease both; }
.gameover .big { animation: bounce 1.2s ease infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* =====================================================================
   PER-PHASE IDENTITIES — each of the 3 phases gets its own look + entrance
   ANSWER = teal "writing room" · VOTE = rust "arena" · RESULTS = navy stage
   ===================================================================== */

/* phase tag ribbon at the top of the card */
.phase-tag {
  display: block; width: fit-content; max-width: 100%; font-family: var(--display); font-size: 14px;
  text-transform: uppercase; letter-spacing: .03em; padding: 6px 16px; text-align: center;
  border: 3px solid var(--ink); border-radius: 22px; box-shadow: 3px 3px 0 var(--ink);
  margin: 0 auto 14px;
}
/* step-progress labels ("prompt 1 of 3", "face-off 3 of 3") centered too */
.astep > .muted.small, .vstep > .muted.small { text-align: center; }
.tag-answer { background: var(--teal); color: #07302c; }
.tag-vote { background: var(--rust); color: #fff2e8; }

/* ANSWER — cool teal card */
.phase-answer { background: #e2efe8; border-color: var(--ink); }
.phase-answer input[name] { border-color: var(--teal); }
.phase-answer input[name]:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(47,156,139,.3); }
.phase-answer .astep.active .prompt-label { animation: slamIn .4s cubic-bezier(.2,.9,.3,1.25) both; }
@keyframes slamIn { 0% { transform: scale(1.25); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* VOTE — warm rust arena; answers COLLIDE in from opposite sides + VS clash */
.phase-vote { background: #f6e1cf; border-color: var(--ink); }
.phase-vote .choices .choice:first-of-type { transform: translateX(-70px) rotate(-3deg); }
.phase-vote .choices .choice:last-of-type { transform: translateX(70px) rotate(3deg); }
.phase-vote .choices .choice.in { transform: translateX(0) rotate(0); }
.phase-vote .vsbig { background: var(--rust); }
.phase-vote .vstep.ready .vsbig { animation: vsClash .55s cubic-bezier(.2,.8,.3,1.5); }
@keyframes vsClash {
  0% { transform: scale(.3) rotate(-25deg); }
  55% { transform: scale(1.35) rotate(10deg); }
  100% { transform: scale(1) rotate(0); }
}

/* RESULTS — navy stage; answers slide in from the sides, winner celebrates */
.results-card .rstep .sideA { transform: translateX(-60px); }
.results-card .rstep .sideB { transform: translateX(60px); }
.results-card .rstep .side.in { transform: translateX(0); }
.rstep.scored .side.win { animation: winPop .55s cubic-bezier(.2,.8,.3,1.4); }
@keyframes winPop { 0% { transform: scale(1); } 45% { transform: scale(1.07) rotate(-1deg); } 100% { transform: scale(1); } }
.rstep.scored .faceoff-row .side:not(.win) { opacity: .55; filter: saturate(.55); }

/* distinct full-screen splash colour + entrance per phase */
body[data-phase="answer"] #splash { --glow: rgba(47, 156, 139, .32); }   /* teal glow */
body[data-phase="vote"]   #splash { --glow: rgba(207, 74, 43, .34); }    /* rust glow */
body[data-phase="results"] #splash { --glow: rgba(230, 168, 37, .34); }  /* gold glow */
body[data-phase="answer"] .sp-title { animation: stampIn .5s cubic-bezier(.2,.9,.3,1.2) both; }
body[data-phase="vote"]   .sp-title { animation: zoomBang .45s cubic-bezier(.2,.8,.3,1.5) both; }
@keyframes stampIn { 0% { transform: scale(1.7) rotate(-7deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes zoomBang { 0% { transform: scale(.25); opacity: 0; } 60% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }

/* ---- confetti burst (Jackbox-style pop on wins) ---- */
#confetti-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 55; }
.confetti { position: absolute; top: -14px; width: 10px; height: 14px; pointer-events: none; border-radius: 2px; }
@keyframes conffall { to { transform: translateY(112vh) rotate(720deg); } }

/* ===== 3-round game: acronym, The Big One, extravagant Don ===== */
/* round-intro — concise "here's what this round is + how it scores" box */
.round-intro {
  max-width: 440px; margin: 22px auto 4px; padding: 10px 14px; text-align: center;
  font-family: var(--head); font-weight: 400; font-size: 12.5px; line-height: 1.4;
  color: #3a5c56; background: rgba(255,255,255,.4);
  border: 1px dashed rgba(47,156,139,.6); border-radius: 12px;
}
.round-intro b { font-weight: 600; color: var(--rust); }

/* acronym prompt on the answer screen */
.acro-label {
  font-family: var(--wordmark); font-size: 32px; color: var(--rust); text-align: center;
  letter-spacing: .06em; margin: 8px 0 0; text-shadow: 2px 2px 0 var(--ink);
}

/* Big One — vote "pick your favorite" list */
.bigfaves { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 14px; }
.bigfave {
  display: block; background: var(--paper2); border: 3px solid var(--ink); border-radius: 12px;
  padding: 13px 14px; cursor: pointer; text-align: center; color: var(--ink);
  font-family: var(--head); font-weight: 600; font-size: 17px;
  transition: background .12s, box-shadow .1s, transform .08s, border-color .12s;
}
.bigfave:hover { border-color: var(--rust); }
.bigfave.chosen { background: #f6ddc9; box-shadow: 3px 3px 0 var(--ink); transform: translateY(-1px); }
.bigfave input { position: absolute; opacity: 0; width: 0; height: 0; }
.bigfave.mine { opacity: .6; cursor: default; border-style: dashed; }
.bigfave .yours { font-family: var(--head); font-weight: 700; font-size: 12px; color: var(--muted-solid); text-transform: uppercase; }

/* Big One — results: all answers on one screen, votes fly in, winner crowned */
.bigcards { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 4px; }
.bigcard {
  background: var(--card); border: 3px solid var(--ink); border-radius: 14px;
  padding: 13px 12px; text-align: center; overflow-wrap: break-word;
  opacity: 0; transform: translateY(10px);
  transition: opacity .35s ease, transform .35s ease, background .25s, box-shadow .25s, border-color .25s;
}
.bigcard.in { opacity: 1; transform: none; }
.bigcard .ans { display: block; font-family: var(--hand); font-size: 24px; font-weight: 600; line-height: 1.28; color: var(--ink); min-height: 1.28em; }
.bigcard .who { display: inline-flex; align-items: center; gap: 5px; justify-content: center; margin-top: 6px;
  font-family: var(--head); font-weight: 600; font-size: 13px; color: var(--muted-solid); }
.bigcard .pts { display: block; margin-top: 3px; font-family: var(--display); font-weight: 400; font-size: 18px; color: var(--teal); }
.bigcard .who, .bigcard .pts { visibility: hidden; }
.bigcard.named .who, .bigcard.scored .who { visibility: visible; }
.bigcard.named .who { animation: subin .35s ease both; }
.bigcard.scored .pts { visibility: visible; }
.bigcard .voters { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; margin-top: 8px; min-height: 2px; }
.bigcard.win.scored { background: var(--win); box-shadow: 5px 5px 0 var(--teal); animation: winPop .55s cubic-bezier(.2,.8,.3,1.4); }
.bigcard.win.scored::before { content: "👑"; display: block; font-size: 24px; line-height: 1; margin-bottom: 3px; }

/* ---- presence dots + ready-up ---- */
.roster li { transition: background .2s; }
.pdot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto;
  background: #8a7a5c; border: 1.5px solid var(--ink);
}
.roster li.here .pdot { background: #52c266; box-shadow: 0 0 7px rgba(82, 194, 102, .8); }
.ready-tag {
  font-family: var(--head); font-weight: 700; font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted-solid); white-space: nowrap;
}
.ready-tag.on { color: var(--teal); }

/* host early-advance: small + tucked at the bottom so it isn't an accidental tap */
.host-skip { margin-top: 26px; text-align: center; }
.host-skip button {
  width: auto; display: inline-block; margin: 0;
  font-size: 12px; font-weight: 600; padding: 7px 15px; letter-spacing: .02em;
  text-transform: none; opacity: .72; box-shadow: 2px 2px 0 rgba(43, 29, 18, .3);
}
.host-skip button:hover { opacity: 1; }
