/* Imagine This: "gallery opening, printed on a risograph".
   Cream paper with grain, two spot inks (fluorescent pink + blue) that print slightly off-register,
   pictures hung as framed prints with museum wall labels, and rubber-stamp winners. */
@import url("/fonts/fonts.css"); /* hosted with the game: no requests to Google */

:root {
  --paper: #f2ecdf;
  --sheet: #fbf8f1;
  --ink: #1a1817;
  --muted: #6e675e;
  --rule: #d6ccba;
  --pink: #ff48b0;
  --blue: #006aa8;
  --yellow: #ffe800;
  --orange: #ff6c2f;
  --green: #00784a;
  --red: #c52f2b;
  --pink-ink: #c2187e; /* pink for text: the fill pink is too light to read on paper */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Schibsted Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  --lift: 0 1px 0 rgba(26, 24, 23, .05), 0 14px 28px -18px rgba(60, 40, 10, .45);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box }
html { background: var(--paper) }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.45;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
/* Paper grain over the page, and two halftone ink blots in the corners. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--grain); opacity: .22; mix-blend-mode: multiply;
}
html::before, html::after {
  content: ""; position: fixed; z-index: -2; pointer-events: none; border-radius: 50%; mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 68%); mask-image: radial-gradient(circle, #000 0, transparent 68%);
}
html::before { width: 52vmax; height: 52vmax; right: -18vmax; bottom: -20vmax; opacity: .55;
  background: radial-gradient(circle, var(--pink) 34%, transparent 37%) 0 0 / 13px 13px }
html::after { width: 40vmax; height: 40vmax; left: -16vmax; top: -16vmax; opacity: .4;
  background: radial-gradient(circle, var(--blue) 30%, transparent 33%) 0 0 / 11px 11px }

main { max-width: 900px; margin: auto; padding: 22px 16px 90px }

/* ---------- Type ---------- */
h1, h2, h3 { margin: .35em 0; line-height: 1.12; font-family: var(--serif); font-weight: 700; letter-spacing: -.01em;
  font-variation-settings: "SOFT" 60, "WONK" 0 }
h1 { font-size: clamp(28px, 4.4vw, 44px); font-weight: 800 }
h2 { font-size: 1.5em }
h3 { font-size: 1.15em }
.muted { color: var(--muted) }
.center { text-align: center }
a { color: var(--blue); font-weight: 700; text-underline-offset: 3px }
/* Small all-caps label lines ("ROUND 2 OF 5", "ROOM CODE") */
.kicker, .card > .muted:first-child { font-family: var(--mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted) }

/* The logo: blue ink with a pink plate printed a few pixels off-register. */
.logo {
  position: relative; display: block; width: fit-content; margin: 2px auto 14px; color: var(--blue);
  font-family: var(--serif); font-style: italic; font-weight: 900; font-size: clamp(36px, 7vw, 64px); line-height: 1;
  letter-spacing: -.03em; font-variation-settings: "SOFT" 100, "WONK" 1;
}
.logo::after {
  content: attr(data-text); position: absolute; inset: 0; color: var(--pink); mix-blend-mode: multiply;
  transform: translate(4px, 3px); pointer-events: none;
}
.tagline { text-align: center; font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--muted); margin: -4px 0 18px }

/* ---------- Cards (sheets of paper) ---------- */
.card {
  position: relative; background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 4px;
  padding: 20px; margin: 18px 0; box-shadow: var(--lift);
  animation: print-in .5s cubic-bezier(.2, .9, .3, 1.2) both;
}
.card:nth-of-type(2) { animation-delay: .05s }
.card:nth-of-type(3) { animation-delay: .1s }
/* "Prints in": the pink plate lands first, then settles under the ink. */
@keyframes print-in { from { opacity: 0; transform: translateY(10px); box-shadow: 8px 6px 0 var(--pink) } }
/* A strip of masking tape on featured cards */
.taped::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 110px; height: 24px; translate: -50% 0; rotate: -3deg;
  background: rgba(255, 232, 0, .55); mix-blend-mode: multiply; border-left: 2px dashed rgba(0,0,0,.08); border-right: 2px dashed rgba(0,0,0,.08);
}

/* ---------- Buttons & inputs ---------- */
button, input, textarea, select { font: inherit }
button, a.button, .file-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: var(--sheet); text-decoration: none;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 12px 22px; min-height: 50px;
  font-family: var(--sans); font-weight: 700; font-size: 17px; letter-spacing: .01em; cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s;
  margin: 4px 4px 4px 0;
}
button:hover:not(:disabled), a.button:hover, .file-button:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--pink) }
button:active:not(:disabled), a.button:active, .file-button:active { transform: none; box-shadow: none }
button:focus-visible, a.button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px }
button:disabled { opacity: .45; cursor: not-allowed }
button.alt, a.button.alt { background: transparent; color: var(--ink) }
button.alt:hover:not(:disabled), a.button.alt:hover { box-shadow: 4px 4px 0 var(--blue); background: var(--sheet) }
button.small { min-height: 34px; padding: 4px 14px; font-size: 14px }
#start, #next, #again, #join, #gen, #submit, #sendCaption, #addPrompt, #endWriting {
  background: var(--pink); color: var(--ink); font-size: 19px; padding: 14px 30px; font-weight: 800
}
#start:hover:not(:disabled), #next:hover, #again:hover, #join:hover, #gen:hover:not(:disabled), #submit:hover,
#sendCaption:hover, #addPrompt:hover, #endWriting:hover { box-shadow: 5px 5px 0 var(--blue) }
.leave { background: transparent; color: var(--muted); border-color: var(--rule); margin-top: 30px; font-weight: 500 }

input, textarea, select {
  width: 100%; padding: 13px 14px; border-radius: 4px; border: 1.5px solid var(--ink);
  background: #fff; color: var(--ink); font-size: 17px; font-weight: 500; margin: 6px 0;
}
input::placeholder, textarea::placeholder { color: #7a7163 }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--blue); outline-offset: 1px }
textarea { min-height: 100px; resize: vertical }
label { font-weight: 700 }

/* ---------- Layout helpers ---------- */
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px }
.big-number { font-family: var(--serif); font-weight: 900; font-style: italic; font-size: 84px; line-height: 1; color: var(--blue);
  text-shadow: 4px 3px 0 var(--pink); font-variation-settings: "SOFT" 100, "WONK" 1 }
/* Badges look like ink stamps */
.badge {
  display: inline-block; font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); border: 2px solid currentColor; border-radius: 3px; padding: 4px 10px; margin: 8px 0;
  transform: rotate(-2.5deg); mix-blend-mode: multiply; box-shadow: inset 0 0 0 2px var(--sheet), inset 0 0 0 3px currentColor;
}
.bonus { color: var(--pink-ink); font-weight: 800 }
.warning { color: var(--red); font-weight: 700 }
.notice { background: var(--yellow); border-radius: 2px; padding: 8px 12px; font-weight: 700; mix-blend-mode: multiply }
.tag { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border: 1px solid currentColor; border-radius: 3px }
.tag.in { color: var(--green) }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); vertical-align: middle }
.dot.off { background: var(--red) }

/* ---------- Room code & QR ---------- */
.code {
  font-family: var(--mono); font-weight: 500; font-size: 68px; letter-spacing: .18em; color: var(--ink); line-height: 1.05;
  text-shadow: 3px 2px 0 var(--pink);
}
.join { display: flex; gap: 22px; align-items: center; justify-content: space-between; flex-wrap: wrap }
.qr { width: 200px; height: 200px; background: #fff; border: 1.5px solid var(--ink); padding: 10px; transform: rotate(1.5deg); box-shadow: var(--lift) }

/* ---------- Players & colors ---------- */
.player-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 2px; margin: 0;
  border-bottom: 1px dashed var(--rule); animation: pop-in .4s cubic-bezier(.2, 1.4, .4, 1) both;
}
.player-row:last-child { border-bottom: 0 }
.player-row .name { font-weight: 800; font-size: 18px }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pc, var(--blue)); color: var(--pt, var(--sheet)); font-family: var(--serif); font-weight: 800; font-size: 19px;
  box-shadow: 2px 2px 0 var(--ink);
}
.avatar.ai { font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: .05em; background: var(--ink) }
img.avatar { box-shadow: 0 0 0 2.5px var(--pc, var(--blue)), 2px 2px 0 2.5px var(--ink) }
.avatar.big { width: 96px; height: 96px; font-size: 44px }
.avatar.big.ai { font-size: 30px }
/* Names get a highlighter stripe in the player's ink */
.player-name { color: var(--ink); font-weight: 800; background: linear-gradient(transparent 58%, color-mix(in srgb, var(--pc, var(--pink)) 55%, transparent) 58%, color-mix(in srgb, var(--pc, var(--pink)) 55%, transparent) 92%, transparent 92%); padding: 0 2px }
@keyframes pop-in { from { transform: scale(.6); opacity: 0 } }

/* ---------- Settings ---------- */
.settings label { display: block; margin-bottom: 6px }
.setting-row { display: flex; gap: 14px; flex-wrap: wrap }
.setting-row label { flex: 1; min-width: 170px }
.setting-help { margin-top: -2px; font-size: 15px }
.toggle {
  display: flex !important; gap: 12px; align-items: flex-start; background: #fff; border: 1.5px solid var(--rule);
  border-radius: 4px; padding: 12px 14px; margin: 10px 0; cursor: pointer; font-weight: 500;
}
.toggle:has(input:checked) { border-color: var(--ink); box-shadow: 3px 3px 0 var(--pink) }
.toggle input { width: 22px; height: 22px; flex: none; margin: 2px 0 0; accent-color: var(--ink) }
.toggle.disabled { opacity: .5; cursor: not-allowed }

/* ---------- Countdown ---------- */
#countdown {
  display: inline-block; font-family: var(--mono); font-weight: 500; font-size: 30px; padding: 4px 16px; letter-spacing: .04em;
  background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 4px;
}
#countdown:empty { display: none }
#countdown.urgent { background: var(--red); border-color: var(--red); color: var(--sheet); animation: pulse-urgent .5s steps(2) infinite }
@keyframes pulse-urgent { 50% { background: var(--ink); border-color: var(--ink) } }

/* ---------- Pictures: framed prints with wall labels ---------- */
.submission {
  background: #fff; border: 1px solid var(--rule); border-radius: 2px; padding: 12px 12px 14px; box-shadow: var(--lift);
  animation: print-in .5s cubic-bezier(.2, .9, .3, 1.2) both; color: var(--ink); text-align: left;
}
.grid > :nth-child(2) { animation-delay: .08s } .grid > :nth-child(3) { animation-delay: .16s }
.grid > :nth-child(4) { animation-delay: .24s } .grid > :nth-child(5) { animation-delay: .32s }
.grid > :nth-child(6) { animation-delay: .4s }
.submission:nth-child(odd) { rotate: -.6deg } .submission:nth-child(even) { rotate: .5deg }
.submission img { width: 100%; display: block; outline: 1px solid rgba(0,0,0,.08) }
.submission p { font-family: var(--serif); font-style: italic; font-size: 18px; margin: 10px 2px 0 }
.submission h3 { font-family: var(--mono); font-weight: 500; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 10px }
button.submission { width: 100%; font-weight: 500; display: block; border-radius: 2px }
button.submission:hover { box-shadow: 5px 5px 0 var(--pink); transform: translate(-2px, -2px) }
.preview { max-width: 100%; max-height: 340px; margin-top: 12px; border: 10px solid #fff; outline: 1px solid var(--rule); box-shadow: var(--lift) }
.preview.full { width: 100%; max-height: none; display: block }
.caption-image { display: block; width: min(100%, 540px); margin: 14px auto; border: 14px solid #fff; outline: 1.5px solid var(--ink); box-shadow: var(--lift) }
.painting { font-family: var(--serif); font-style: italic; font-size: 24px; padding: 30px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px }
/* Museum wall label under a picture */
.wall-label { display: inline-block; text-align: left; background: var(--sheet); border: 1px solid var(--rule); padding: 10px 16px 12px; min-width: min(100%, 320px); box-shadow: var(--lift) }
.wall-label .title { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.25 }
.wall-label .by { font-family: var(--mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 6px }

/* ---------- Aperture spinner ---------- */
.aperture { width: 96px; height: 96px; overflow: visible }
.aperture circle, .aperture line { fill: none; stroke-width: 4.5; stroke-linecap: round }
.aperture .ap-ink { stroke: var(--blue); mix-blend-mode: multiply; transform-origin: 50px 50px; animation: spin 2.4s linear infinite }
.aperture .ap-ghost { stroke: var(--pink); mix-blend-mode: multiply }
.aperture.fast .ap-ink { animation-duration: .7s }
.aperture.big { width: 150px; height: 150px }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- Captions ---------- */
.captions, .caption-votes { display: grid; gap: 12px; margin: 14px 0 }
.caption-card {
  background: var(--sheet); border-left: 5px solid var(--pink); padding: 14px 18px; font-family: var(--serif); font-style: italic; font-size: 22px;
  box-shadow: var(--lift); animation: print-in .4s cubic-bezier(.2, .9, .3, 1.2) both;
}
.caption-card:nth-child(3n+2) { border-left-color: var(--blue) } .caption-card:nth-child(3n) { border-left-color: var(--orange) }
.caption-card b { font-family: var(--sans); font-style: normal }
.caption-vote { text-align: left; justify-content: flex-start; font-family: var(--serif); font-style: italic; font-size: 19px; font-weight: 500; padding: 16px 20px; width: 100%; border-radius: 4px }

/* ---------- Results reveal ---------- */
.spotlight { text-align: center; animation: unveil .6s cubic-bezier(.2, .9, .3, 1.1) both }
.spotlight img { display: block; margin: 12px auto 18px; width: min(100%, 560px); border: 16px solid #fff; outline: 1.5px solid var(--ink); box-shadow: 0 30px 50px -25px rgba(40, 25, 5, .6); transform: rotate(-.8deg) }
.spotlight .idea { font-family: var(--serif); font-size: 24px; font-style: italic }
.spotlight .big-caption { font-size: 32px }
.spotlight .artist { font-size: 44px; margin: 10px 0 }
.spotlight .place { font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase }
.spotlight.dim { opacity: .25; transition: opacity .3s }
@keyframes unveil { from { opacity: 0; clip-path: inset(0 0 100% 0) } to { clip-path: inset(0 0 0 0) } }
.drum { margin: 40px auto 10px; display: flex; justify-content: center }
.results-title { font-style: italic; font-size: clamp(36px, 5vw, 56px) }

/* ---------- Reactions: word stickers ---------- */
.reactions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px }
.reactions button {
  font-family: var(--serif); font-style: italic; font-weight: 900; font-size: 24px; line-height: 1.1; letter-spacing: -.01em; text-wrap: balance;
  min-height: 96px; padding: 10px 14px; margin: 0; border-radius: 6px; color: var(--sheet); background: var(--rc, var(--ink)); border-color: var(--rc, var(--ink));
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.reactions button:nth-child(odd) { rotate: -1.5deg } .reactions button:nth-child(even) { rotate: 1.5deg }
.reactions button:hover { box-shadow: 4px 4px 0 var(--ink) }
.reactions button.pop { animation: pop .3s }
@keyframes pop { 50% { transform: scale(1.12) rotate(-5deg) } }
.floater {
  position: fixed; bottom: -80px; pointer-events: none; z-index: 10; padding: 6px 16px 8px;
  font-family: var(--serif); font-style: italic; font-weight: 900; font-size: 34px; line-height: 1; white-space: nowrap;
  color: var(--sheet); background: var(--rc, var(--ink)); border-radius: 6px; box-shadow: 3px 3px 0 var(--ink);
  animation: float-up 3s ease-out forwards;
}
@keyframes float-up { from { transform: rotate(var(--tilt, -6deg)) } to { transform: translateY(-95vh) rotate(calc(var(--tilt, -6deg) * -2)) scale(1.15); opacity: 0 } }

/* ---------- Final podium & awards ---------- */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 24px 0 }
.podium-spot { text-align: center; flex: 1; max-width: 220px; animation: rise .7s cubic-bezier(.2, 1.2, .4, 1) both }
.place-1 { animation-delay: .6s } .place-2 { animation-delay: .3s }
@keyframes rise { from { transform: translateY(80px); opacity: 0 } }
/* Rosette ribbon above each podium spot */
.medal {
  width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font: 500 15px var(--mono); letter-spacing: .04em; color: var(--ink); background: var(--mc, var(--yellow));
  box-shadow: 0 0 0 4px var(--sheet), 0 0 0 5.5px var(--ink); mix-blend-mode: multiply;
}
.place-1 .medal { --mc: var(--yellow) } .place-2 .medal { --mc: #cfd8e3 } .place-3 .medal { --mc: #f2a675 }
.podium-name { font-family: var(--serif); font-weight: 800; font-size: 24px; margin-top: 8px; overflow-wrap: anywhere }
.podium-score { font-family: var(--mono); color: var(--muted) }
.podium-block {
  border: 1.5px solid var(--ink); border-bottom: 0; margin-top: 10px; padding-top: 10px;
  font-family: var(--serif); font-style: italic; font-weight: 900; font-size: 48px; color: var(--sheet); text-shadow: 2px 2px 0 var(--ink);
}
.place-1 .podium-block { height: 170px; background: radial-gradient(circle, rgba(0,0,0,.14) 28%, transparent 30%) 0 0 / 10px 10px, var(--pink) }
.place-2 .podium-block { height: 120px; background: radial-gradient(circle, rgba(0,0,0,.14) 28%, transparent 30%) 0 0 / 10px 10px, var(--blue) }
.place-3 .podium-block { height: 90px; background: radial-gradient(circle, rgba(0,0,0,.14) 28%, transparent 30%) 0 0 / 10px 10px, var(--orange) }
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px }
.award {
  background: #fff; border: 1px solid var(--rule); padding: 16px 14px; text-align: center; box-shadow: var(--lift);
  animation: pop-in .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.award b { display: block; font-family: var(--serif); font-style: italic; font-size: 22px; margin: 4px 0 }
.award:nth-child(2) { animation-delay: .1s } .award:nth-child(3) { animation-delay: .2s } .award:nth-child(4) { animation-delay: .3s }
.award-emoji { font: 500 12px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--red) }

/* ---------- TV extras ---------- */
.mute { position: fixed; top: 14px; right: 14px; z-index: 20; min-height: 44px; width: 44px; padding: 0; background: var(--sheet); color: var(--ink) }
.mute svg { width: 22px; height: 22px }
.subtitle {
  /* Announcer subtitles sit at the very top (over the logo) so they never cover prompts or pictures. */
  position: fixed; left: 50%; top: 10px; transform: translateX(-50%); max-width: min(70vw, 820px);
  background: var(--ink); color: var(--sheet); font-size: 20px; font-weight: 500; line-height: 1.3; padding: 10px 22px;
  border-radius: 4px; z-index: 30; text-align: center; box-shadow: 4px 4px 0 var(--pink);
  animation: pop-in .25s ease-out;
}
.subtitle[hidden] { display: none }

/* ---------- Effects (fx.js) ---------- */
.confetti { position: fixed; top: -20px; width: 10px; height: 16px; z-index: 40; pointer-events: none; mix-blend-mode: multiply; animation: confetti-fall linear forwards }
.confetti.dot { width: 12px; height: 12px; border-radius: 50% }
@keyframes confetti-fall { to { transform: translate(var(--dx), 110vh) rotate(var(--spin)) } }
.shake { animation: shake .5s }
@keyframes shake { 20% { transform: translate(-8px, 4px) rotate(-1deg) } 40% { transform: translate(8px, -4px) rotate(1deg) } 60% { transform: translate(-6px, 2px) } 80% { transform: translate(5px, -2px) } }
/* Rubber stamp */
.stamp {
  display: inline-block; font-family: var(--mono); font-weight: 500; font-size: 34px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--red); padding: 4px 16px; border: 4px solid currentColor; border-radius: 6px; background: rgba(251, 248, 241, .85);
  box-shadow: inset 0 0 0 3px rgba(251, 248, 241, .85), inset 0 0 0 5px currentColor; transform: rotate(-9deg); mix-blend-mode: multiply;
  animation: stamp .4s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes stamp { from { transform: scale(2.6) rotate(-9deg); opacity: 0 } }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr }
  .code { font-size: 48px }
  .qr { width: 160px; height: 160px }
  .spotlight .artist { font-size: 34px }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important }
}
.player-row .score { margin-left: auto; font-family: var(--serif); font-weight: 900; font-size: 26px }
.lead { white-space: nowrap; display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--red); border: 1.5px solid currentColor; padding: 1px 6px; border-radius: 3px; rotate: -3deg }
/* The phone's "you" chip in your player color */
.me-chip { display: flex; align-items: center; gap: 10px; margin: 0 auto 6px; width: fit-content; background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 999px; padding: 4px 16px 4px 4px; font-weight: 800; font-size: 17px; box-shadow: 3px 3px 0 var(--pc) }
.me-chip[hidden] { display: none }
.me-chip b { font-family: var(--mono); font-weight: 500; color: var(--muted) }

/* ---------- Face-Off battles ---------- */
.battle-prompt { text-align: center; font-size: clamp(26px, 3.4vw, 40px); margin: 6px auto 16px; max-width: 900px; font-style: italic }
.muted-light { color: var(--muted); font-weight: 500 }
.battle { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center }
.fighter {
  position: relative; background: #fff; border: 1px solid var(--rule); padding: 14px 14px 16px;
  box-shadow: var(--lift); text-align: center; transition: opacity .4s, transform .4s;
}
.fighter.left { animation: from-left .6s cubic-bezier(.2, 1.2, .4, 1) both; transform: rotate(-1.2deg) }
.fighter.right { animation: from-right .6s cubic-bezier(.2, 1.2, .4, 1) .15s both; transform: rotate(1.2deg) }
@keyframes from-left { from { transform: translateX(-60vw) rotate(-12deg) } }
@keyframes from-right { from { transform: translateX(60vw) rotate(12deg) } }
.fighter img { width: 100%; display: block; outline: 1px solid rgba(0,0,0,.08) }
.fighter-idea { font-family: var(--serif); font-style: italic; font-size: 20px; margin: 12px 4px 4px }
.fighter.lost { opacity: .5; filter: grayscale(.8); transform: scale(.95) rotate(0) }
.fighter .stamp { position: absolute; top: 22px; left: 50%; translate: -50% 0; white-space: nowrap }
.stamp.sweep { color: var(--pink-ink) }
.vs {
  font-family: var(--serif); font-style: italic; font-weight: 900; font-size: 40px; color: var(--sheet); background: var(--ink);
  width: 92px; height: 92px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding-bottom: 6px;
  box-shadow: 5px 4px 0 var(--pink); font-variation-settings: "SOFT" 100, "WONK" 1;
  animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) .5s both, vs-pulse 1.4s ease-in-out 1.1s infinite; z-index: 2;
}
@keyframes vs-pulse { 50% { transform: scale(1.06) rotate(-5deg) } }
.fighter-name { font-size: 22px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; background: none }
.vote-bar { position: relative; height: 32px; background: var(--paper); border: 1.5px solid var(--ink); overflow: hidden; margin: 12px 0 6px }
.vote-fill { height: 100%; width: var(--pct); animation: fill 1.2s cubic-bezier(.2, .9, .3, 1) .3s both; mix-blend-mode: multiply }
@keyframes fill { from { width: 0 } }
.vote-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 500 }
.voter-chips { display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 44px }
.voter-chips .name-chip { animation: pop-in .4s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: 1s }
.name-chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 15px; line-height: 1.3; white-space: nowrap;
  background: color-mix(in srgb, var(--pc, var(--pink)) 22%, var(--sheet)); border: 1.5px solid var(--pc, var(--pink)); color: var(--ink);
}
.points { font-family: var(--serif); font-style: italic; font-weight: 900; font-size: 28px; color: var(--pink-ink) }
.battle-status { margin-top: 12px }
.pill { display: inline-block; background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 999px; padding: 4px 16px; margin-left: 8px }
#nextBattle { margin-top: 20px }
.recap { display: grid; gap: 4px }
.recap-card { padding: 12px 16px }
.recap-row { display: grid; grid-template-columns: 110px 1fr 110px; gap: 12px; align-items: center; text-align: center }
.recap-row img { width: 110px; height: 110px; object-fit: cover; border: 5px solid #fff; outline: 1px solid var(--rule); opacity: .55; filter: grayscale(.7) }
.recap-row img.win { opacity: 1; filter: none; box-shadow: 4px 4px 0 var(--pink) }
.recap-score { font-weight: 700; font-size: 18px }
/* Phone: voting in a battle */
.battle-vote { display: grid; gap: 16px }
.battle-vote button { background: #fff; color: var(--ink); border: 1px solid var(--rule); border-radius: 2px; text-align: center; width: 100%; padding: 12px; display: block }
.battle-vote button p { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 19px; margin: 10px 0 2px }
.battle-vote img { width: 100%; display: block }
.battle-vote .letter { font-family: var(--serif); font-size: 28px }
@media (max-width: 700px) {
  .battle { grid-template-columns: 1fr }
  .vs { margin: -10px auto; width: 70px; height: 70px; font-size: 30px }
}

/* ---------- Redraws of the same screen: no entrance animations (stops the "refresh" flash) ---------- */
.settled .card, .settled .submission, .settled .player-row:not(.fresh), .settled .caption-card,
.settled .award, .settled .podium-spot, .settled .spotlight, .settled .badge { animation: none }

/* ---------- Sound settings panel ---------- */
.volume-panel {
  position: fixed; top: 68px; right: 14px; z-index: 25; width: 250px; background: var(--sheet);
  border: 1.5px solid var(--ink); border-radius: 4px; box-shadow: 5px 5px 0 var(--blue); padding: 14px 16px; animation: pop-in .2s ease-out;
}
.volume-panel[hidden] { display: none }
.volume-panel label { display: block; font: 500 13px var(--mono); letter-spacing: .12em; text-transform: uppercase; margin: 4px 0 10px }
.volume-panel input[type=range] { width: 100%; padding: 0; margin: 6px 0 0; border: 0; accent-color: var(--ink); background: none }
.volume-panel button { width: 100%; margin: 4px 0 0 }

/* ---------- Who has voted ---------- */
.vote-status { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin: 6px 0 12px }
.voter-strip { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 8px 0 }
.voter { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 700;
  opacity: .4; filter: grayscale(1); transition: opacity .3s, filter .3s }
.voter.done { opacity: 1; filter: none }
.voter.done::after {
  content: "✓"; position: absolute; top: -6px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800;
  background: var(--ink); color: var(--sheet); border: 2px solid var(--sheet);
}
.voter.fresh .avatar { animation: voted .7s cubic-bezier(.2, 1.8, .4, 1) }
.voter.fresh::after { animation: pop-in .5s cubic-bezier(.2, 1.8, .4, 1) .15s both }
@keyframes voted { 0% { transform: scale(.6) } 50% { transform: scale(1.3) rotate(-10deg) } 100% { transform: scale(1) } }

/* ---------- TV screen: fit everything on one screen ---------- */
.tv main { max-width: 1200px; padding-top: 8px }
/* The logo sits in a fixed-height band at the top; announcer subtitles appear in that same band. */
.tv .logo { font-size: clamp(28px, 3.2vw, 42px); margin: 0 auto 4px; height: 72px; line-height: 72px }
.tv .subtitle { top: 8px; max-height: 64px; font-size: 18px; padding: 8px 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.tv .subtitle[hidden] { display: none }
.tv h1 { font-size: clamp(24px, 2.6vw, 38px) }
.tv .card { padding: 16px 20px; margin: 14px 0 }
.tv .grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) }
.tv .grid .submission img { max-height: 30vh; object-fit: cover }
.tv .spotlight img { width: auto; max-width: 100%; max-height: 46vh; margin: 8px auto 14px }
.tv .spotlight .artist { font-size: 32px; margin: 2px 0 }
.tv .spotlight h2 { margin: 2px 0 }
.tv #skipReveal { position: fixed; right: 16px; bottom: 16px; z-index: 15 }
.host-corner { position: fixed; left: 16px; bottom: 16px; z-index: 15; display: flex; gap: 8px; align-items: center }
.corner-button { width: auto; opacity: .75; background: var(--sheet) !important }
.corner-button:hover, .corner-button:focus-visible { opacity: 1 }
.corner-button[hidden] { display: none }
.tv .spotlight .idea { font-size: 20px }
.tv .fighter img { max-height: 40vh; object-fit: cover }
.tv .battle-prompt { font-size: clamp(22px, 2.6vw, 34px); margin: 4px auto 12px }
.tv .caption-image { width: auto; max-width: 100%; max-height: 42vh }
.tv .recap-row img { width: 90px; height: 90px }
.tv .podium-block { font-size: 38px }
.tv .place-1 .podium-block { height: 130px } .tv .place-2 .podium-block { height: 95px } .tv .place-3 .podium-block { height: 70px }

/* ---------- Scoring extras ---------- */
.badges { display: flex; gap: 10px; flex-wrap: wrap; align-items: center }
.center .badges, .badges.center, .center.badges { justify-content: center }
/* Double / triple point rounds: a highlighter label */
.boost {
  display: inline-block; font: 500 14px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
  background: var(--yellow); padding: 5px 12px; transform: rotate(1.5deg); mix-blend-mode: multiply; margin: 8px 0;
}
.boost.x3 { background: var(--pink); color: var(--ink); mix-blend-mode: normal; animation: pulse-boost 1.6s ease-in-out infinite }
@keyframes pulse-boost { 50% { transform: rotate(-1.5deg) scale(1.05) } }
.place-no { font: 500 15px var(--mono); color: var(--muted); width: 22px; text-align: center }
.gain { font-family: var(--mono); font-weight: 500; color: var(--green) }
.player-row.house { opacity: .7 }
.player-row.house .name { font-weight: 700 }
.card-tag { color: var(--pink-ink) }
.caption-meta { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-style: normal }
.mini-chips { display: inline-flex; gap: 4px; flex-wrap: wrap }
.mini-chips .name-chip { font-size: 12px; padding: 1px 8px }

/* Spotlight Card on the phone */
.spotlight-card {
  display: grid; gap: 4px; background: var(--ink); color: var(--sheet); padding: 14px 16px; border-radius: 6px; margin: 10px 0;
  box-shadow: 4px 4px 0 var(--pink); animation: print-in .5s both;
}
.spotlight-card b { font-family: var(--serif); font-style: italic; font-size: 22px }
.spotlight-card span { opacity: .85; font-size: 15px }
.spotlight-card button { margin-top: 8px; background: var(--pink); color: var(--ink); border-color: var(--pink) }
.spotlight-card.played { background: var(--pink); color: var(--ink); box-shadow: 4px 4px 0 var(--ink) }

/* ---------- Forgery ---------- */
.forgery-guess, .forgery-reveal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 28px; align-items: center }
.forgery-guess .caption-image, .forgery-reveal .caption-image { width: 100%; margin: 0 }
.forgery-reveal .spotlight { text-align: center }
.forgery-reveal .wall-label { min-width: 0; width: 100% }
.stamp.authentic { color: var(--blue) }
.caption-card.real { border-left-color: var(--blue); background: #fff }
@media (max-width: 800px) { .forgery-guess, .forgery-reveal { grid-template-columns: 1fr } }

/* ---------- Telephoto ---------- */
.chain-progress { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 16px }
.chain-dot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font: 500 13px var(--mono); text-transform: uppercase; letter-spacing: .08em; opacity: .4; transition: opacity .3s }
.chain-dot.done { opacity: 1 }
.chain-dot.done::after {
  content: "✓"; position: absolute; top: -6px; right: calc(50% - 30px); width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--ink); color: var(--sheet); border: 2px solid var(--sheet);
}
.chain-stage { min-height: 52vh; display: flex; align-items: center; justify-content: center }
.chain-stage .spotlight img { max-height: 52vh; width: auto; max-width: 100% }
.relay-text { max-width: 820px; animation: print-in .5s both }
.relay-text .title { font-size: clamp(26px, 3.4vw, 40px) }
.film-strip { display: flex; gap: 12px; overflow-x: auto; padding: 12px 4px; justify-content: center }
.thumb { width: 92px; height: 92px; flex: none; object-fit: cover; border: 5px solid #fff; outline: 1px solid var(--rule); box-shadow: var(--lift) }
.text-thumb { background: var(--sheet); font: italic 500 12px/1.3 var(--serif); padding: 6px; overflow: hidden; border-width: 1px }
.lost-photo {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 1; width: 100%; max-height: 52vh; min-height: 120px;
  font: 500 13px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: center;
  background: repeating-linear-gradient(-45deg, var(--paper) 0 10px, var(--sheet) 10px 20px); border: 1px dashed var(--rule);
}
.lost-photo.thumb { width: 92px; min-height: 0; font-size: 9px }
.strip-dot { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1.5px solid var(--ink); display: flex; align-items: center; justify-content: center; font: 500 13px var(--mono); background: var(--sheet) }
.strip-dot.seen { background: var(--ink); color: var(--sheet) }
.strip-dot.now { background: var(--pink); border-color: var(--pink); color: var(--ink); transform: scale(1.15) }
.step-tile.best { box-shadow: 5px 5px 0 var(--pink) }
.step-tile .lead { display: inline-block; margin-top: 6px }
.lens { display: grid; gap: 2px; background: var(--yellow); mix-blend-mode: multiply; padding: 10px 14px; border-radius: 3px; margin-top: 10px }
.lens b { font-family: var(--serif); font-style: italic; font-size: 24px }
.battle-vote .kicker { display: block; margin-bottom: 8px }

/* ---------- Highlight reel ---------- */
.reel { position: fixed; inset: 0; z-index: 50; background: #151312; display: flex; align-items: center; justify-content: center; padding: 30px }
.reel[hidden] { display: none }
.reel-slide { display: grid; gap: 22px; justify-items: center; animation: print-in .6s both }
.reel-frame { width: min(68vh, 80vw); aspect-ratio: 1; overflow: hidden; border: 18px solid #fff; box-shadow: 0 40px 80px -30px #000 }
.reel-frame img { width: 100%; height: 100%; object-fit: cover; display: block; animation: kenburns 5.4s ease-out both }
@keyframes kenburns { from { transform: scale(1.14) translate(calc(var(--pan, 1) * 2%), 1%) } to { transform: scale(1) } }
.reel .wall-label { max-width: min(68vh, 80vw) }
.reel-close { position: absolute; top: 16px; right: 16px; color: var(--sheet); border-color: var(--sheet) }

/* ---------- Opening screen: the game modes hang like prints on a gallery wall ---------- */
.menu { display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 4vw, 60px); align-items: center; min-height: 68vh; padding: 6px 0 30px }
.menu-side { display: grid; gap: 14px; align-content: center; justify-items: start }
.menu-list { display: grid; gap: 4px; justify-items: start }
button.menu-item {
  position: relative; display: block; background: none; border: 0; border-radius: 0; box-shadow: none; margin: 0; min-height: 0;
  padding: 4px 0 4px 30px; text-align: left; color: var(--muted); white-space: nowrap;
  font-family: var(--serif); font-style: italic; font-weight: 800; font-size: clamp(28px, 3.3vw, 46px); line-height: 1.08; letter-spacing: -.02em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  transition: color .18s, transform .25s cubic-bezier(.2, 1.3, .4, 1), text-shadow .2s;
}
/* A pink ink dot marks the selected mode. */
button.menu-item::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 15px; height: 15px; border-radius: 50%; background: var(--pink);
  transform: translateY(-50%) scale(0); transition: transform .22s cubic-bezier(.2, 1.5, .4, 1); mix-blend-mode: multiply;
}
button.menu-item:hover:not(:disabled) { box-shadow: none; transform: translateX(10px); background: none }
button.menu-item.on { color: var(--blue); transform: translateX(10px); text-shadow: 3px 2px 0 rgba(255, 72, 176, .5) }
button.menu-item.on::before { transform: translateY(-50%) scale(1) }
/* The focused mode is always the selected one, so the ink dot and color show focus. */
button.menu-item:focus-visible { outline: none }
.menu-item.locked .menu-name::after {
  content: "needs the AI"; margin-left: 10px; font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); vertical-align: middle;
}
.menu-hint { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; color: var(--muted); margin: 4px 0 0 }

.showcase { display: grid; grid-template-columns: 1.1fr 1fr; gap: 30px; align-items: center }
/* The print: a framed sheet hanging on a pin, a little crooked. */
.print {
  position: relative; margin: 0; padding: 16px; background: var(--sheet); border: 1.5px solid var(--ink);
  box-shadow: var(--lift), 12px 14px 0 -4px rgba(26, 24, 23, .1);
  rotate: var(--tilt, -1.5deg); transition: rotate .35s ease;
  animation: hang .6s cubic-bezier(.2, 1.25, .3, 1) both;
}
.print::before { content: ""; position: absolute; top: -9px; left: 50%; width: 11px; height: 11px; border-radius: 50%; background: var(--ink); translate: -50% 0; box-shadow: 2px 2px 0 var(--pink) }
.print:hover { rotate: 0deg }
/* Everything inside the print is sized in cqw (percent of the print's width), so the example round scales as one piece. */
.print-art {
  container-type: inline-size; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--rule);
  background: radial-gradient(circle, rgba(0, 120, 191, .16) 28%, transparent 31%) 0 0 / 11px 11px, var(--paper);
}
.print figcaption { margin-top: 10px; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted) }
@keyframes hang { from { opacity: 0; transform: translateY(-22px) rotate(-5deg) } }

/* ---------- Example rounds (the mode previews) ---------- */
.scene { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 3cqw; padding: 5cqw; font-size: 3.4cqw; line-height: 1.25; transition: opacity .4s }
.scene.fade { opacity: 0 }
.scene.resetting, .scene.resetting .b, .scene.resetting .sc-bar i { transition: none !important }
/* Each piece pops in on its beat. */
.scene .b { opacity: 0; transform: translateY(6%) scale(.95); transition: opacity .35s ease, transform .5s cubic-bezier(.2, 1.35, .4, 1) }
.scene .b.on { opacity: 1; transform: none }

.sc-prompt {
  background: var(--ink); color: var(--sheet); padding: 2.6cqw 3.4cqw; box-shadow: 1.2cqw 1cqw 0 var(--pink);
  font-family: var(--serif); font-weight: 800; font-size: 5.4cqw; line-height: 1.1;
}
.sc-prompt span { display: block; margin-bottom: 1cqw; font-family: var(--mono); font-weight: 500; font-size: 2.5cqw; letter-spacing: .14em; text-transform: uppercase; opacity: .7 }
.sc-pic { position: relative; background: #fff; padding: 1.2cqw; border: 1px solid var(--ink); box-shadow: 0 1cqw 2.4cqw -1.4cqw rgba(60, 40, 10, .5) }
.sc-pic img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover }
.sc-entry { display: grid; gap: 1.4cqw; min-width: 0 }
.sc-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.6cqw; align-items: start }
.sc-cap { font-size: 2.8cqw; line-height: 1.2 }
.sc-name { display: block; font-weight: 800; font-size: 3cqw; color: var(--pc) }
.sc-foot { padding: 1.2cqw; text-align: center; background: var(--yellow); mix-blend-mode: multiply; font-family: var(--mono); font-size: 2.7cqw; letter-spacing: .08em; text-transform: uppercase }

/* Rubber stamps: they slam down big, then settle. */
.sc-stamp {
  position: absolute; z-index: 2; right: -2cqw; bottom: -2cqw; rotate: -8deg; white-space: nowrap;
  padding: .6cqw 1.4cqw; border: .5cqw solid currentColor; border-radius: .6cqw; background: rgba(251, 248, 241, .92); color: var(--red);
  font-family: var(--mono); font-weight: 500; font-size: 2.6cqw; letter-spacing: .1em; text-transform: uppercase;
}
.scene .sc-stamp.b { transform: scale(2.2) }
.scene .sc-stamp.b.on { transform: none }
.sc-stamp.tally { top: -2cqw; bottom: auto; left: -1.5cqw; right: auto; rotate: 4deg; color: var(--blue) }
.sc-stamp.sticker { border: 0; background: var(--pink); color: #fff; font-weight: 800; font-size: 4.2cqw; padding: .5cqw 2cqw }
.sc-stamp.sticker.s1 { top: 62%; left: 6%; right: auto; bottom: auto; rotate: -10deg }
.sc-stamp.sticker.s2 { top: 34%; right: 8%; left: auto; bottom: auto; rotate: 9deg; background: var(--orange) }
.sc-stamp.fake { color: var(--muted) }

/* Caption Contest */
.scene.caption .sc-pic img, .scene.forgery .sc-pic img { aspect-ratio: 16 / 9 }
.sc-bubbles { display: grid; gap: 2cqw }
.sc-bubble { position: relative; padding: 1.6cqw 2.4cqw; background: var(--sheet); border: 1px solid var(--ink); border-radius: 2cqw; font-size: 3cqw }
.sc-bubble .sc-name { display: inline; margin-right: 1.2cqw }
.sc-bubble .sc-stamp, .sc-option .sc-stamp { right: -1.5cqw; top: 50%; bottom: auto; translate: 0 -50% }

/* Face-Off */
.sc-battle { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2cqw; align-items: center }
.sc-vs { font-family: var(--serif); font-style: italic; font-weight: 900; font-size: 7cqw; color: var(--pink-ink) }
.sc-bars { display: grid; gap: 1.4cqw }
.sc-bar { display: grid; grid-template-columns: 1fr 14cqw; gap: 2cqw; align-items: center; font-family: var(--mono); font-size: 2.7cqw }
.sc-bar i { display: block; height: 2.4cqw; width: 0; background: var(--pc); border-radius: 0 .8cqw .8cqw 0; transition: width .9s cubic-bezier(.2, .9, .3, 1) .15s }
.sc-bars.on .sc-bar i { width: var(--w) }

/* Forgery */
.sc-ask { text-align: center; font-family: var(--serif); font-weight: 800; font-size: 4.8cqw }
.sc-options { display: grid; gap: 1.8cqw }
.sc-option { position: relative; padding: 1.8cqw 2.4cqw; background: var(--sheet); border: 1px solid var(--ink); font-size: 3cqw; font-style: italic; transition: background .3s }
.sc-option.real .sc-stamp { color: var(--green) }
.sc-option.real:has(.sc-stamp.on) { background: #e3f3e8 }

/* Telephoto */
.sc-step { display: grid; grid-template-columns: 1fr 30cqw; gap: 3cqw; align-items: center }
.sc-said { font-size: 3.1cqw; font-style: italic }
.sc-said .sc-name { font-style: normal }
.sc-lens { display: inline-block; margin-bottom: 1cqw; padding: .5cqw 1.4cqw; background: var(--blue); color: #fff; font-family: var(--mono); font-style: normal; font-size: 2.4cqw; letter-spacing: .12em; text-transform: uppercase }
.sc-lens.start { background: var(--ink) }

/* The museum wall label next to the print. */
.wall-label {
  display: grid; gap: 10px; justify-items: start; padding: 18px 20px; background: var(--sheet); border: 1px solid var(--rule); box-shadow: var(--lift);
  animation: label-in .45s .12s ease-out both;
}
.wall-label h2 { margin: 0; font-size: clamp(28px, 3vw, 40px) }
.wall-label .pitch { margin: 0; font-size: 18px; line-height: 1.4 }
.facts { list-style: none; margin: 2px 0 4px; padding: 0; display: grid; gap: 7px; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted) }
.facts li::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 10px; background: var(--pink); vertical-align: 1px; mix-blend-mode: multiply }
#playMode { background: var(--pink); color: var(--ink); font-size: 19px; padding: 14px 30px; font-weight: 800 }
#playMode:hover:not(:disabled) { box-shadow: 5px 5px 0 var(--blue) }
@keyframes label-in { from { opacity: 0; transform: translateY(10px) } }

/* The lobby's "Game" line, with Change game. */
.mode-pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border: 1.5px dashed var(--rule); border-radius: 4px; padding: 10px 14px; margin: 6px 0 }
.mode-pick h3 { margin: 2px 0 0; font-size: 26px }

@media (max-width: 960px) { .showcase { grid-template-columns: 1fr } .print { width: 100%; max-width: 440px; justify-self: center } }
@media (max-width: 760px) { .menu { grid-template-columns: 1fr; min-height: 0 } }
@media (prefers-reduced-motion: reduce) {
  .print, .wall-label { animation: none }
  button.menu-item, button.menu-item::before, .print, .scene, .scene .b, .sc-bar i { transition: none }
}

/* ---------- TV lobby: one screen, no scrolling ----------
   Left: room code, QR and players. Right: settings and Start. Each column fits the screen height;
   if the settings or the player list run long, they scroll inside their own card. */
.lobby-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap }
@media (min-width: 1000px) and (min-height: 600px) {
  .tv main:has(.lobby) { padding-bottom: 14px }
  .tv .lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; height: calc(100dvh - 104px) }
  .tv .lobby-col { display: flex; flex-direction: column; gap: 14px; min-height: 0 }
  .tv .lobby .card { margin: 0 }
  .tv .lobby .join { flex: none; flex-wrap: nowrap; align-items: flex-start }
  .tv .lobby .join p { margin: 8px 0 0; font-size: 16px }
  .tv .lobby .qr { width: 210px; height: 210px; flex: none }
  .tv .lobby .players-card, .tv .lobby .settings { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain }
  .tv .lobby .players-card h2, .tv .lobby .settings h2 { margin-top: 0 }
  .tv .lobby .player-row { padding: 7px 2px; min-width: 0 }
  /* Players in two columns, so a full room of 12 fits without scrolling. */
  .tv .lobby .players-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; align-content: start }
  .tv .lobby .players-card > :not(.player-row) { grid-column: 1 / -1 }
  /* Bigger selfies: picture on the left, name on top, status and Remove underneath. */
  .tv .lobby .player-row {
    display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: "av name name" "av status btn";
    column-gap: 12px; row-gap: 2px; align-items: center
  }
  .tv .lobby .player-row { border-bottom: 0; padding: 6px 2px }
  /* The four dropdowns share one row; everything else in the settings spans the full width. */
  .tv .lobby .settings { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 12px; align-content: start }
  .tv .lobby .mode-pick { padding: 6px 14px }
  .tv .lobby .mode-pick h3 { font-size: 22px }
  .tv .lobby .settings > * { grid-column: 1 / -1 }
  .tv .lobby .settings > .setting-row { display: contents }
  .tv .lobby .settings > .setting-row > label { grid-column: auto; min-width: 0; font-size: 15px }
  .tv .lobby .settings > .setting-row > label:only-child { grid-column: 1 / -1 } /* Telephoto has just one */
  .tv .lobby .toggle { padding: 6px 12px; margin: 4px 0; font-size: 15px; line-height: 1.3 }
  .tv .lobby .settings { padding-block: 12px }
  .tv .lobby .settings .setting-help { margin: 2px 0 6px }
  .tv .lobby .toggle .muted { font-size: 13.5px }
  .tv .lobby .settings > p.setting-help:last-child { font-size: 13px; line-height: 1.35; margin-bottom: 0 }
  .tv .lobby .player-row .avatar { grid-area: av; width: 60px; height: 60px; font-size: 26px }
  .tv .lobby .player-row .name { grid-area: name; justify-self: start; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100% }
  .tv .lobby .player-row > .muted { grid-area: status; font-size: 14px; white-space: nowrap }
  .tv .lobby .player-row .remove-player { grid-area: btn; justify-self: start; min-height: 26px; padding: 1px 10px; font-size: 12.5px; margin: 0 }  /* Compact settings so they fit beside the room code. */
  .tv .lobby .settings select, .tv .lobby .settings input[type=text] { padding: 9px 12px; margin: 4px 0 }
  .tv .lobby .settings label { margin-bottom: 4px }
  .tv .lobby .toggle { padding: 8px 12px; margin: 7px 0 }
  .tv .lobby .setting-help { font-size: 14px; margin: 4px 0 8px }
  .tv .lobby .mode-pick { margin: 0 0 4px }
  .tv .lobby-actions { flex: none }
  .tv .lobby-actions #start { flex: 1; margin: 0 }
}

/* ---------- TV voting screen: every entry fits on one screen ----------
   The grid fills the space under the heading; each picture is shown whole (no cropping), as big as its cell allows. */
@media (min-width: 900px) and (min-height: 560px) {
  .tv main:has(.vote-screen) { padding-bottom: 14px }
  .tv .vote-screen { display: flex; flex-direction: column; height: calc(100dvh - 104px); min-height: 0 }
  .tv .vote-screen > h2 { margin: 2px 0; font-size: clamp(20px, 2.2vw, 30px) }
  .tv .vote-screen > .vote-cta { margin: 0; font-weight: 700; font-size: 18px }
  .tv .vote-screen > .vote-cta .muted-light { font-size: 16px }
  .tv .vote-screen .vote-status { margin: 4px 0 10px }
  .tv .vote-grid {
    flex: 1; min-height: 0; display: grid; gap: 16px;
    grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows, 1), minmax(0, 1fr));
  }
  /* Each card is its square picture plus its text. fitGrid() (host.html) measures the space and sets --pic,
     the picture size at which every card fits in its cell, so nothing runs off the bottom of the screen. */
  .tv .vote-grid { align-items: center; justify-items: center }
  .tv .vote-grid .submission { min-height: 0; margin: 0; width: max-content; max-width: 100% }
  .tv .vote-grid .submission img { width: var(--pic, 180px); height: var(--pic, 180px); max-width: none; max-height: none; aspect-ratio: 1; object-fit: cover; display: block }
  .tv .vote-grid .submission p {
    width: var(--pic, 180px); /* the caption wraps to the picture's width instead of widening the card */
    margin: 8px 2px 0; font-size: clamp(14px, 1.3vw, 18px); line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
}

/* ---------- Round results: every entry at once, with votes and points ---------- */
.result-card { position: relative; transition: box-shadow .25s, transform .25s, opacity .25s }
.result-card.best { box-shadow: 0 0 0 3px var(--pink), var(--lift) }
/* The entry the announcer is talking about lifts out; the others dim a little. */
.result-card.speaking { z-index: 2; transform: translateY(-4px) scale(1.02); box-shadow: 0 0 0 4px var(--blue), 0 18px 30px -16px rgba(40, 25, 5, .5) }
.results-entries:has(.speaking) .result-card:not(.speaking) { opacity: .5 }
.settled .result-card .stamp { animation: none }
.result-stamps { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start }
.result-stamps:empty { display: none }
.result-stamps.on-pic { position: absolute; top: -10px; right: -12px; z-index: 1; flex-direction: column; align-items: flex-end }
.result-card .stamp { font-size: 14px; padding: 3px 10px; border-width: 3px; margin: 0 }
/* Place on its own small line; votes on the left and points on the right underneath. */
.result-meta { display: grid; grid-template-columns: 1fr auto; align-items: baseline; column-gap: 10px; margin-top: 8px; font-family: var(--mono); font-size: 14px }
.result-meta .place-tag { grid-column: 1 / -1; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted) }
.result-meta .tally b { font-weight: 500 }
.result-meta .pts { font-weight: 500; font-size: 18px; color: var(--green) }
.result-artist { margin-top: 2px; font-size: 18px }
.result-card p { margin: 4px 2px 0 }
.caption-card.result-card .result-meta { margin: 0 0 6px }
.caption-card.result-card .result-stamps { margin-top: 6px }

@media (min-width: 900px) and (min-height: 560px) {
  .tv main:has(.results-screen) { padding-bottom: 14px }
  .tv .results-screen { display: flex; flex-direction: column; height: calc(100dvh - 104px); min-height: 0 }
  .tv .results-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap }
  .tv .results-head .results-title { margin: 0; font-size: clamp(28px, 3vw, 42px) }
  .tv .results-head p { margin: 0 }
  .tv .results-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 22px; margin-top: 12px }
  .tv .results-entries { min-height: 0; display: flex; flex-direction: column }
  .tv .results-grid { flex: 1; padding-top: 10px }
  .tv .results-grid { padding-top: 14px }
  .tv .results-grid .result-artist { width: var(--pic, 180px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
  .tv .results-grid .result-meta { width: var(--pic, 180px) }
  .tv .results-side { margin: 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column }
  .tv .results-side h2 { margin-top: 0 }
  .tv .results-side .player-row { padding: 6px 2px; flex-wrap: nowrap }
  .tv .results-side .lead { display: none }
  .tv .results-side .score { font-size: 22px }
  .tv .results-side .gain { font-size: 14px }
  .tv .results-side .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap } /* place 1 already says who leads; keeps each row on one line */
  .tv .results-side #next { margin-top: auto; align-self: stretch }
  .tv .results-caption { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px }
  .tv .results-caption .caption-image { max-height: 32vh; align-self: center }
  .tv .results-caption .captions { margin: 0; min-height: 0; overflow-y: auto; padding: 4px }
}

/* ---------- Phone: making a picture fits on one screen ---------- */
body:has(.submit-view) .logo { font-size: 30px; margin-bottom: 6px }
.submit-view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px }
.submit-view .card { margin: 0; padding: 12px 16px }
.submit-view .card h2 { margin: 4px 0; font-size: 1.25em }
.submit-view .badge { margin: 2px 0 }
.submit-view label { margin-top: 2px }
.submit-view textarea { min-height: 60px; margin: 2px 0 }
.submit-view .tip { margin: 0; font-size: 14px }
.submit-view button, .submit-view .file-button { margin: 0 }
.refs-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
.refs-row .muted { font-size: 14px }
/* Pictures take at most about a quarter of the screen each; the remix source shrinks once your own picture is made. */
.submit-view .remix-source { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center }
.submit-view .remix-source .preview { grid-column: 2; grid-row: 1 / span 2; display: block; max-height: 24dvh; width: auto; max-width: 45vw; margin: 0; border-width: 5px }
.submit-view:has(#preview img) .remix-source .preview { max-height: 12dvh }
.submit-view #preview .preview { display: block; max-height: 22dvh; width: auto; max-width: 100%; margin: 0 auto 8px; border-width: 6px }
.submit-view #preview .row { flex-wrap: nowrap; gap: 8px }
.submit-view #preview .row button, .submit-view #preview #submit, .submit-view #preview #again { flex: 1; min-width: 0; min-height: 46px; padding: 8px 10px; font-size: 15px; white-space: nowrap }
/* The round header: round label and badges on the left, the timer on the right, then the prompt. */
.submit-view .round-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center }
.submit-view .round-card > * { grid-column: 1 / -1 }
.submit-view .round-card > .muted:first-child, .submit-view .round-card > .badges { grid-column: 1 }
.submit-view .round-card > #countdown { grid-column: 2; grid-row: 1 / span 2; font-size: 24px; padding: 2px 12px; margin: 0 }
.submit-view .round-card .badges { gap: 6px }
.submit-view .round-card .badge, .submit-view .round-card .boost { font-size: 11px; padding: 2px 8px; margin: 2px 0 }
.submit-view .round-card > h2:not(#countdown) { font-size: 1.1em; line-height: 1.2; margin: 6px 0 0 }
.submit-view .round-card .notice, .submit-view .round-card p { margin: 6px 0 0; font-size: 14px }
.captions-toggle { display: flex !important; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; margin: 4px 0 8px; cursor: pointer }
.captions-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink) }

/* ---------- Home page: fits one screen ----------
   Phones: join, host, and a "First time?" bar that opens on tap. Wide screens: join and host on the left, how it works on the right. */
main.landing { padding-bottom: 16px }
.landing .logo { margin-bottom: 6px }
.landing .tagline { margin: 0 0 12px; font-size: 18px }
.landing-grid { display: grid; gap: 12px }
.landing-col { display: grid; gap: 12px; align-content: start; min-width: 0 }
.landing .card { margin: 0; padding: 16px 18px }
.landing h2 { margin: 2px 0 8px }
.join-fields { display: grid; gap: 8px }
.join-fields input { margin: 0 }
.landing .toggle { margin: 10px 0; padding: 8px 12px }
.landing #join { margin: 0 }
.landing #err:empty { display: none }
.host-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap }
.host-card h2 { margin-bottom: 2px }
.host-card p { margin: 0; font-size: 15px }
.host-card button { margin: 0 }
.how-to summary { position: relative; cursor: pointer; padding-right: 28px; font-family: var(--serif); font-weight: 700; font-size: 19px; list-style: none }
.how-to summary::-webkit-details-marker { display: none }
.how-to summary::after { content: "+"; position: absolute; right: 0; top: 50%; translate: 0 -50%; font: 500 24px var(--mono); color: var(--blue) }
.how-to[open] summary::after { content: "−" }
.how-to summary .muted { display: block; font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase }
.how-to summary:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px }
.how-to h2 { display: none } /* on phones the bar is the heading */
.how-to[open] summary { margin-bottom: 8px }
.how-to p { margin: 0 0 10px }
.how-to ol { margin: 0; padding-left: 22px; display: grid; gap: 8px }
.how-to li { padding-left: 2px; line-height: 1.4 }
@media (min-width: 900px) {
  .landing-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 18px }
  .how-to summary { display: none } /* always open here */
  .how-to h2 { display: block; margin-top: 2px }
}

/* Selfie: take one with the camera, or pick one from the camera roll. */
.selfie-buttons { display: flex; gap: 10px; flex-wrap: wrap }
.selfie-buttons .file-button { margin: 0 }
.file-button.alt { background: transparent; color: var(--ink) }

/* ---------- A refused picture: the likely words, highlighted ---------- */
.flag-box { background: #fff; border: 1.5px solid var(--red); border-left-width: 6px; border-radius: 4px; padding: 12px 14px; margin: 4px 0 12px; animation: print-in .4s both }
.flag-box b { color: var(--red) }
.flag-box.soft { border-color: var(--blue) }
.flag-box.soft b { color: var(--blue) }
.flag-box .flag-text { font-family: var(--serif); font-style: italic; font-size: 18px; margin: 8px 0 }
.flag-box ul { margin: 6px 0; padding-left: 18px }
.flag-box li { margin: 4px 0 }
.flag-box mark { background: color-mix(in srgb, var(--red) 28%, transparent); color: var(--ink); padding: 0 2px; border-radius: 2px; font-style: normal }
.flag-box p.muted { font-size: 14px; margin: 6px 0 0 }

/* Big TVs: the voting and results screens use the full width, so pictures can grow. */
@media (min-width: 900px) and (min-height: 560px) {
  .tv main:has(.vote-screen), .tv main:has(.results-screen) { max-width: min(1760px, 100vw) }
}
@media (min-width: 900px) and (min-height: 560px) {
  /* Leave room at the bottom for the host's "Close voting" button. */
  .tv .vote-screen .vote-grid { margin-bottom: 46px }
  /* The scoreboard scrolls on its own, so "Next round" always stays on screen. */
  .tv .results-side { overflow: hidden }
  .tv .results-side .side-scores { flex: 1; min-height: 0; overflow-y: auto; margin-bottom: 10px }
  .tv .results-side .side-scores:has(.player-row:nth-child(8)) .player-row { padding: 3px 2px }
  .tv .results-side .side-scores:has(.player-row:nth-child(8)) .avatar { width: 30px; height: 30px; font-size: 14px }
  .tv .results-side .side-scores:has(.player-row:nth-child(8)) .score { font-size: 18px }
}

/* ---------- Legal pages (privacy, terms, cookies, report) and the site footer ---------- */
.legal { max-width: 760px }
.legal h1 { margin-bottom: 4px }
.legal .updated { margin-top: 0 }
.legal h2 { font-size: 1.3em; margin-top: 1.4em }
.legal p, .legal li { line-height: 1.6 }
.legal table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 15px }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--rule) }
.legal th { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted) }
.legal .summary { background: var(--sheet); border: 1.5px solid var(--ink); border-radius: 4px; padding: 14px 18px }
.legal .summary li { margin: 4px 0 }
.site-footer { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin: 24px auto 8px; font-size: 14px }
.site-footer a { color: var(--muted); font-weight: 500 }
.legal-note { font-size: 13px; color: var(--muted); margin: 8px 0 0 }
.legal-note a { color: var(--muted) }
/* Hidden from view but still reachable by keyboard and screen readers (e.g. the file picker inside a button). */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }
.file-button:focus-within { outline: 3px solid var(--blue); outline-offset: 3px }
.consent-done { font-size: 14px; color: var(--muted); margin: 10px 0 }
.text-button { background: none; border: 0; padding: 0; margin: 0 0 0 4px; font: inherit; font-weight: 600; color: var(--blue); text-decoration: underline; cursor: pointer; width: auto; min-height: 0; box-shadow: none }
.text-button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 15px; margin: 10px 0; cursor: pointer }
.file-button.disabled { opacity: .45; cursor: not-allowed }
.consent input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--ink) }
.field-label { display: block; font-size: 14px; font-weight: 700; margin: 8px 0 2px }
.age-block { border-left: 6px solid var(--red) }
