:root {
  --bg: #f7f6f2;
  --panel: #ffffff;
  --ink: #1d1d1b;
  --muted: #6b6a66;
  --line: #d9d7d0;
  --accent: #2f5d8a;
  --accent-ink: #ffffff;
  --disagree: #b5473b;
  --neutral: #8a8a86;
  --agree: #2d7a4f;
  --warn: #a8641b;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151614; --panel: #1f201d; --ink: #ecebe6; --muted: #a3a29c; --line: #363733;
    --accent: #7fb0e0; --accent-ink: #0d1a26; --disagree: #e4766a; --agree: #67b98b; --neutral: #9a9a95; --warn: #e0a35a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  padding: 16px; max-width: 980px; margin: 0 auto;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 .75rem; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 200px; }
input[type=text], textarea {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
}
textarea { min-height: 72px; resize: vertical; }
button {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 8px; padding: 10px 16px; min-height: 44px;
}
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--disagree); }
button:disabled { opacity: .5; cursor: default; }
a.button {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  font-weight: 600; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 8px; padding: 10px 16px; min-height: 44px; white-space: nowrap;
}
a.button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
input[type=checkbox] { width: auto; min-height: 0; margin: 0 6px 0 0; vertical-align: middle; }

/* Home page room lists */
.rooms { display: flex; flex-direction: column; gap: 8px; }
.room-card { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.room-card .room-claim { font-weight: 600; overflow-wrap: anywhere; }
.room-card .grow { min-width: 0; }
.room-card .card-actions { flex-wrap: nowrap; }
@media (max-width: 520px) { .room-card .card-actions { flex-wrap: wrap; } .room-card .card-actions > * { flex: 1 1 auto; } }
button.linkish { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; font-weight: 400; }
.filepick input[type=file] { font: inherit; font-size: .875rem; }
@media (max-width: 520px) { .room-card { flex-direction: column; align-items: stretch; } .room-card .grow { flex: none; } }
code { background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.code-big { font-size: 2.4rem; letter-spacing: .15em; font-weight: 700; font-family: ui-monospace, monospace; }
.claim { font-size: 1.35rem; font-weight: 600; margin: 0 0 .5rem; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.badge.voting { color: var(--warn); border-color: var(--warn); }
.badge.reveal { color: var(--agree); border-color: var(--agree); }
.badge.closed { color: var(--disagree); border-color: var(--disagree); }

/* The line. Seven columns, Strongly disagree on the left. */
.line { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 12px 0; }
.line .col { min-height: 120px; border-top: 3px solid var(--line); padding-top: 6px; text-align: center; }
.line .col .lbl { font-size: .72rem; line-height: 1.2; color: var(--muted); min-height: 2.4em; }
.line .col .count { font-size: 1.4rem; font-weight: 700; }
.line .col.d .lbl, .line .col.d .count { color: var(--disagree); }
.line .col.a .lbl, .line .col.a .count { color: var(--agree); }
.line .col.n .count { color: var(--neutral); }
.line .col.d { border-top-color: var(--disagree); }
.line .col.a { border-top-color: var(--agree); }
.line .col.n { border-top-color: var(--neutral); }
.chip {
  display: inline-block; margin: 2px; padding: 2px 8px; border-radius: 999px; font-size: .8rem;
  background: var(--bg); border: 1px solid var(--line); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip.moved { border-color: var(--warn); }
.chip.spot { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Participant's seven big buttons */
.picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0; }
.picker button { padding: 8px 2px; min-height: 76px; font-size: .78rem; line-height: 1.15; font-weight: 600; }
.picker button.d { color: var(--disagree); }
.picker button.a { color: var(--agree); }
.picker button.sel { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 520px) {
  .picker { grid-template-columns: 1fr; }
  .picker button { min-height: 48px; font-size: 1rem; }
  .line .col .lbl { font-size: .6rem; }
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
td:last-child { white-space: nowrap; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr.spot td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; }
.rejoin h2 { margin: 8px 0 4px; font-size: 1.1rem; }
.rejoin-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; }
.rejoin-btn svg { width: 40px; height: 50px; }
.ended { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.ended.hidden { display: none; }
.ended .panel { max-width: 520px; width: 100%; margin: 0; }
.countdown { font-size: 4rem; font-weight: 800; text-align: center; line-height: 1; margin: 8px 0; }
details summary { cursor: pointer; font-weight: 600; }
ul.questions li { margin-bottom: .4rem; }
.hidden, [hidden] { display: none !important; }
footer { margin-top: 24px; color: var(--muted); font-size: .85rem; }

/* ---- room ---------------------------------------------------------------- */
:root { --sky1: #cfe3f2; --sky2: #eaf2f8; --road: #5b5e66; --curb: #b9b3a3; --sidewalk: #d8d2c3; }
@media (prefers-color-scheme: dark) {
  :root { --sky1: #1a2430; --sky2: #232a33; --road: #3a3d44; --curb: #5d584d; --sidewalk: #4a463e; }
}
body.room { max-width: 1400px; }
.gate { max-width: 560px; margin: 24px auto; }
.topbar { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.topbar .claim { font-size: 1.25rem; }
.topbar .claim.narrowed { font-size: 1rem; font-weight: 500; color: var(--muted); margin-bottom: .2rem; }
.topbar .focus { font-size: 1.2rem; font-weight: 600; border-left: 3px solid var(--accent, #3b9ac9); padding-left: 8px; }
@media (max-width: 600px) { .topbar .focus { font-size: 1.05rem; } }
.guess { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--bg); }
.nowrap { white-space: nowrap; }
.typing-note { min-height: 1.2em; font-style: italic; }
.guess-title { font-weight: 600; margin-bottom: 4px; }
.guess-people { margin: 0 0 6px; padding-left: 1.1rem; }
.guess-people q { font-style: italic; }
.guess label { display: block; font-size: .9rem; margin-bottom: 4px; }
.guess textarea { width: 100%; min-height: 4.5em; box-sizing: border-box; }
.stage { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 12px; align-items: start; }
@media (max-width: 900px) { .stage { grid-template-columns: 1fr; } }
.street-wrap { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.street { width: 100%; aspect-ratio: 1000 / 440; }
.street-svg { width: 100%; height: 100%; display: block; border-radius: 6px; }
.street.street-3d { position: relative; aspect-ratio: 1000 / 560; overflow: hidden; border-radius: 6px; background: #1b1a1c; }
.street3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.street3d-people, .street3d-over { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.street3d-people .av-name { fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.6); stroke-width: 3px; }
.street3d-over .tag-badge { fill: var(--warn); paint-order: stroke; stroke: rgba(0,0,0,.65); stroke-width: 3px; }
.street3d-over .av-typing3d circle { fill: var(--muted); }
@media (max-width: 700px) { .street.street-3d { aspect-ratio: 4 / 3; } }
.avatar { transition: transform .9s cubic-bezier(.4,.1,.2,1); }
/* The figures: parts turn about their own box (hips, shoulders), not the street's origin. */
.avatar .av-leg, .avatar .av-arm, .avatar .av-fig, .avatar .av-lean, .avatar .av-eyes, .avatar .av-say, .avatar .av-typing, .avatar .spot-ring, .avatar .av-led { transform-box: fill-box; }
.av-leg, .av-arm { transform-origin: 50% 8%; }
.av-fig { transform-origin: 50% 100%; animation: av-breathe 3.8s ease-in-out infinite; animation-delay: calc(var(--blink, 0s) * -1); }
.av-eyes { transform-origin: 50% 50%; animation: av-blink 5.2s infinite; animation-delay: var(--blink, 0s); }
.av-lean { transform-origin: 50% 100%; transition: transform .3s ease; }
@keyframes av-breathe { 50% { transform: translateY(-.8px) scaleY(1.012); } }
@keyframes av-blink { 0%, 95%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
/* Walking: legs and arms swing in opposition, the body bobs, and leans into the walk. */
.avatar.walking .av-fig { animation: av-bob .32s ease-in-out infinite alternate; }
.avatar.walking .av-leg:first-child, .avatar.walking .av-arm.r { animation: av-swing .32s ease-in-out infinite alternate; }
.avatar.walking .av-leg:last-child, .avatar.walking .av-arm.l { animation: av-swing .32s ease-in-out infinite alternate-reverse; }
.avatar.walk-right .av-lean { transform: rotate(5deg); }
.avatar.walk-left .av-lean { transform: rotate(-5deg); }
@keyframes av-bob { from { transform: translateY(0); } to { transform: translateY(-3px); } }
@keyframes av-swing { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }
.avatar.arrived .av-fig { animation: av-land .45s ease-out; }
@keyframes av-land { 30% { transform: scale(1.06, .9); } 65% { transform: scale(.97, 1.04) translateY(-2px); } 100% { transform: none; } }
/* Has the mic: a ring that breathes at their feet, and a wave. */
.avatar .spot-ring { opacity: 0; transform-origin: 50% 50%; }
.avatar.mic .spot-ring { opacity: 1; animation: av-ring 1.6s ease-in-out infinite; }
@keyframes av-ring { 50% { transform: scale(1.18); opacity: .45; } }
.avatar.mic .av-arm.r { animation: av-wave 2.4s ease-in-out 1; }
@keyframes av-wave { 15%, 45% { transform: rotate(-150deg); } 30% { transform: rotate(-120deg); } 60%, 100% { transform: none; } }
/* Talking: a speech bubble with the start of what they said; the mouth moves for a moment. */
.avatar .av-say { transform-origin: 50% 100%; }
.avatar .av-say.pop { animation: av-pop .35s cubic-bezier(.3,1.6,.6,1); }
@keyframes av-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.avatar.talking .av-mouth { animation: av-talk .22s ease-in-out 8 alternate; }
@keyframes av-talk { to { d: path("M-3.6,-49 Q0,-44 3.6,-49"); } }
/* Typing: three dots that bounce. */
.avatar .av-typing { opacity: 0; transition: opacity .2s; }
.avatar.typing .av-typing { opacity: 1; }
.avatar .av-typing circle { fill: var(--muted); animation: av-dot 1.1s ease-in-out infinite; }
.avatar .av-typing circle:nth-of-type(2) { animation-delay: .15s; }
.avatar .av-typing circle:nth-of-type(3) { animation-delay: .3s; }
@keyframes av-dot { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-3px); } }
.avatar.hovered .av-say, .avatar.hovered .av-typing { opacity: 0; }
/* AI participants: a little antenna light that blinks. */
.av-led { animation: av-led 2.6s ease-in-out infinite; }
/* A figure turned to face left keeps the letter on its shirt the right way round. */
.av-face.flipped .av-initial { transform: scaleX(-1); }
/* Heads turn and eyes move towards whoever they are looking at (set from street.js). */
.av-look, .av-gaze { transition: transform .45s ease; }
/* The moderator's mic arm turns about the shoulder: held low, held out to whoever has the mic, or up to talk. */
.avatar.moderator .av-arm.r { transform-box: view-box; transform-origin: 15.5px -40px; transform: rotate(-18deg); transition: transform .5s cubic-bezier(.3,1.3,.6,1); }
.avatar.moderator.offer .av-arm.r { animation: none; transform: rotate(-98deg); }
.avatar.moderator.talking .av-arm.r { animation: none; transform: rotate(-166deg); }
.avatar.moderator .av-name { fill: var(--accent); font-weight: 800; }
@keyframes av-led { 50% { opacity: .35; } }
.avatar.away .av-fig { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .av-fig, .av-eyes, .av-led, .avatar.walking .av-fig, .avatar.walking .av-leg, .avatar.walking .av-arm, .avatar.arrived .av-fig, .avatar.mic .spot-ring, .avatar.mic .av-arm.r, .avatar .av-say.pop, .avatar .av-typing circle, .avatar.talking .av-mouth { animation: none !important; }
  .av-look, .av-gaze, .avatar.moderator .av-arm.r { transition: none; }
  .avatar.walk-right .av-lean, .avatar.walk-left .av-lean { transform: none; }
}
.avatar.away { opacity: .45; }
.avatar.ghost { opacity: .5; }
.avatar.you .av-name { font-weight: 800; text-decoration: underline; }
.avatar .av-tip { opacity: 0; pointer-events: none; transition: opacity .12s; }
.avatar.hovered .av-tip, .avatar.dragging .av-tip { opacity: 1; }
.avatar.draggable { cursor: grab; touch-action: none; }
.avatar.dragging { cursor: grabbing; transition: none; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .35)); }
.street-wrap .countdown { position: absolute; top: 30%; left: 0; right: 0; font-size: 6rem; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); pointer-events: none; }
.street-foot { display: flex; gap: 8px; align-items: center; margin-top: 6px; min-height: 24px; }
.spot { color: var(--accent); font-weight: 700; }
.side { display: flex; flex-direction: column; gap: 12px; min-height: 480px; }
.video { background: #000; border-radius: var(--radius); min-height: 220px; flex: 0 0 260px; overflow: hidden; position: relative; }
.video iframe { border: 0; width: 100%; height: 100%; }
.video.idle { flex: 0 0 auto; min-height: 0; }
.video-bar { align-items: center; gap: 8px; }
#micBtn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.video.idle .video-fallback { padding: 14px; }
.video-fallback { color: #ddd; text-align: center; padding: 24px; }
.transcript-wrap { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.transcript { flex: 1 1 auto; overflow-y: auto; max-height: 360px; font-size: .92rem; }
.transcript .tline { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.transcript .tline.system { color: var(--muted); font-size: .8rem; font-style: italic; }
.transcript .tline.moderator { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 4px; padding: 4px 6px; }
.transcript .tline { border-left: 3px solid var(--c, transparent); padding-left: 6px; }
.transcript .tline.system { border-left-color: transparent; }
.transcript .tline.system.on { color: var(--ink); font-style: normal; font-weight: 600; background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 4px; padding: 4px 6px; }
.transcript .tline .mark { display: inline-block; width: .7em; height: .7em; margin-right: 5px; border-radius: 50%; background: var(--c); vertical-align: baseline; }
.transcript .tline.moderator .mark { border-radius: 2px; }
.transcript .tline b { color: color-mix(in srgb, var(--c) 65%, var(--ink)); }
.transcript .tline.me b { text-decoration: underline; }
.swatch:disabled { opacity: .25; cursor: not-allowed; }
.interim { min-height: 1.2em; }
#dictate[aria-pressed="true"] { background: var(--disagree); border-color: var(--disagree); color: #fff; }
.me { margin-top: 12px; }
.swatches, .hats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; max-width: 200px; }
.swatch { width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 50%; border: 3px solid transparent; }
.swatch.sel { border-color: var(--ink); }
.hat { padding: 4px 8px; min-height: 0; font-size: .8rem; font-weight: 500; }
.figure-step { align-items: center; gap: 6px; margin-top: 4px; }
.figure-preview { min-width: 120px; height: 260px; position: relative; }
.figure-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hat.sel { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
select { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
label { display: inline-flex; gap: 6px; align-items: center; }
.room .picker button { min-height: 56px; }

/* ---- home ---------------------------------------------------------------- */
body.home { max-width: 1160px; padding: 0 16px 16px; }
.home .eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 0 0 .6rem; }
.home h2 { font-size: 1.25rem; margin-bottom: .75rem; }
.button.big, button.big { padding: 12px 22px; font-size: 1.05rem; min-height: 50px; border-radius: 10px; }
button.wide { width: 100%; }
.center { text-align: center; }
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: center;
  margin: 16px 0 20px; padding: 40px 36px 32px;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--disagree) 14%, transparent), transparent 60%),
    radial-gradient(110% 90% at 100% 100%, color-mix(in srgb, var(--agree) 16%, transparent), transparent 60%),
    var(--panel);
  border: 1px solid var(--line); border-radius: 22px;
}
.hero h1 { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.08; letter-spacing: -.01em; margin: 0 0 1rem; }
.hero h1 em { color: var(--accent); }
.hero .lede { font-size: 1.08rem; color: var(--muted); max-width: 40em; margin-bottom: 1.3rem; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.spectrum { position: relative; height: 62px; max-width: 520px; margin: 4px 10px 0; }
.spectrum .tick { position: absolute; top: 18px; width: 4px; height: 22px; border-radius: 2px; transform: translateX(-2px); }
.spectrum .tick:nth-child(1) { left: 0%; } .spectrum .tick:nth-child(2) { left: 16.66%; } .spectrum .tick:nth-child(3) { left: 33.33%; }
.spectrum .tick:nth-child(4) { left: 50%; } .spectrum .tick:nth-child(5) { left: 66.66%; } .spectrum .tick:nth-child(6) { left: 83.33%; } .spectrum .tick:nth-child(7) { left: 100%; }
.spectrum::before { content: ""; position: absolute; left: 0; right: 0; top: 27px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--disagree), var(--neutral) 50%, var(--agree)); opacity: .55; }
.tick.d3, .tick.d2, .tick.d1 { background: var(--disagree); } .tick.n { background: var(--neutral); } .tick.a1, .tick.a2, .tick.a3 { background: var(--agree); }
.tick.d2, .tick.a2 { opacity: .8; } .tick.d1, .tick.a1 { opacity: .6; }
.spectrum .dot { position: absolute; top: 0; left: calc(var(--at) * 16.66%); width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--panel); animation: bob 3.6s ease-in-out infinite; }
.spectrum .dot:nth-of-type(2n) { animation-delay: -1.2s; } .spectrum .dot:nth-of-type(3n) { animation-delay: -2.1s; }
@keyframes bob { 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .spectrum .dot { animation: none; } }
.spectrum .end { position: absolute; top: 44px; font-size: .74rem; color: var(--muted); white-space: nowrap; }
.spectrum .end.left { left: 0; } .spectrum .end.mid { left: 50%; transform: translateX(-50%); } .spectrum .end.right { right: 0; }

.latest { align-self: start; }
.latest-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px; transition: transform .15s, box-shadow .15s; }
.latest-card:hover, .latest-card:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, .18); }
.latest .thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: linear-gradient(135deg, var(--disagree), var(--neutral) 50%, var(--agree)); }
.latest .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.latest .play { position: absolute; left: 50%; top: 50%; width: 56px; height: 40px; margin: -20px 0 0 -28px; border-radius: 12px; background: rgba(220, 30, 30, .92); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.latest .play::after { content: ""; position: absolute; left: 22px; top: 11px; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; }
.latest-title { font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.latest-more { margin: 8px 2px 0; }

.quote { position: relative; box-sizing: border-box; height: 92px; overflow: hidden; display: flex; flex-direction: column; justify-content: center; margin: 0 0 20px; padding: 12px 56px 12px 22px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); }
.quote blockquote { margin: 0 0 4px; font-family: Georgia, 'Times New Roman', serif; font-size: 1.05rem; line-height: 1.35; }
.quote blockquote::before { content: '“'; } .quote blockquote::after { content: '”'; }
.quote figcaption { font-size: .8rem; color: var(--muted); }
.quote.in blockquote, .quote.in figcaption { animation: quote-in .6s ease both; }
@keyframes quote-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.quote-next { position: absolute; right: 12px; top: 50%; margin-top: -16px; min-height: 0; width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 1.05rem; }
@media (prefers-reduced-motion: reduce) { .quote.in blockquote, .quote.in figcaption { animation: none; } }

.home .hint { margin: 8px 0 0; }
.home .empty { color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 10px; margin: 0; }
.field { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.start textarea#claim { font-size: 1.1rem; min-height: 0; margin: 4px 0 8px; }
.opts { display: grid; grid-template-columns: 1.4fr .6fr; gap: 10px; margin: 12px 0 8px; }
.opts { grid-template-columns: 1fr 1fr; }
.opts select, .opts input { width: 100%; font-weight: 400; color: var(--ink); }
.opts .mod-row { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.opts .mod-row .radio { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-weight: 400; color: var(--ink); cursor: pointer; }
.opts .mod-row .radio input { width: auto; min-height: 0; margin: 0; accent-color: var(--accent); }
.opts .mod-row input[type=text] { flex: 1 1 140px; width: auto; min-width: 0; min-height: 0; }
.claims { margin-bottom: 4px; }
.start .note { margin: 0 0 6px; padding: 8px 10px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 6px; }
.claims summary { font-size: .9rem; color: var(--accent); }
.claim-ideas { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.idea { font-weight: 500; font-size: .85rem; padding: 6px 12px; min-height: 0; border-radius: 999px; background: var(--bg); }
.idea:hover { border-color: var(--accent); }
.filepick { cursor: pointer; color: var(--accent); text-decoration: underline; }
.filepick input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.filepick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.home .room-card { border-radius: 10px; }
.home footer { text-align: center; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 28px 18px 24px; gap: 22px; margin-top: 12px; }
  .latest { max-width: 420px; }
  .quote { height: 112px; }
}
@media (max-width: 600px) {
  .hero h1 br { display: none; }
  .hero-actions .button { flex: 1 1 0; padding-left: 10px; padding-right: 10px; }
  .quote { height: 168px; padding: 10px 48px 10px 14px; }
  .quote blockquote { font-size: .98rem; }
  .quote-next { right: 8px; }
  .opts { grid-template-columns: 1fr; }
}

/* Watching a Street Ep, and the join form over it */
.watchbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.watchbar .grow { min-width: 0; }
.gate-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .5); }
.gate.modal { position: fixed; z-index: 60; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.gate-close { position: absolute; top: 8px; right: 8px; min-height: 0; width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 1.3rem; line-height: 1; }

.home-main { display: flex; flex-direction: column; gap: 24px; }
.home-main > .panel { margin: 0; border-radius: 14px; padding: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.section-head h2 { margin: 0; }
.section-head .count { font-size: .85rem; color: var(--muted); font-weight: 600; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 10px; }
.ep-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.ep-card:hover, .ep-card:focus-visible { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 26px rgba(0, 0, 0, .14); }
.ep-card.mine { border-left: 4px solid var(--accent); }
.ep-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ep-claim { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-size: 1.25rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.ep-go { margin-top: auto; font-weight: 700; color: var(--accent); }
.ep-grid .empty { grid-column: 1 / -1; }
.code-form { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); }
.code-form input[type=text] { width: 7.5em; padding: 6px 10px; font-family: ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
.code-form button { min-height: 0; padding: 6px 14px; }
.start-dialog { width: min(600px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }
.start-dialog::backdrop { background: rgba(0, 0, 0, .5); }
.start-dialog .start { padding: 22px; border-top: 4px solid var(--accent); }
.start-dialog .section-head { margin-bottom: 12px; }
.start-dialog .gate-close { position: static; }
.idea-topic { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.idea { text-align: left; border-radius: 12px; }
.idea-actions { margin: 0 0 8px; font-size: .85rem; }
.idea-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.refresh { font-size: .85rem; font-weight: 600; padding: 6px 12px; min-height: 0; border-radius: 999px; }
.live-link { flex-basis: 100%; font-size: .95rem; }
.latest.in .latest-card { animation: quote-in .6s ease both; }
.ep-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ep-foot .ep-go { margin-top: 0; }
.small-btn { min-height: 0; padding: 4px 12px; font-size: .85rem; }

/* ---- the whiteboard: pops up when the moderator asks you to write something down ---- */
/* Caveat, by Impallari Type, SIL Open Font License 1.1: a marker hand that every device has. */
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/caveat-latin.woff2) format("woff2"); }
.wb-dialog { border: 0; padding: 0; background: transparent; width: min(560px, calc(100vw - 24px)); max-width: none; overflow: visible; }
.wb-dialog::backdrop { background: rgba(10, 12, 18, .55); }
.wb-dialog[open] .wb { animation: wb-in .45s cubic-bezier(.25,1.4,.5,1); }
@keyframes wb-in { from { transform: translateY(40px) rotate(-3deg) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.wb { margin: 0; padding: 12px 12px 10px; border-radius: 10px; background: linear-gradient(180deg, #e6e9ee, #b9bfc8); box-shadow: 0 18px 40px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.7); }
.wb-surface { padding: 16px 18px 12px; border-radius: 4px; background: radial-gradient(ellipse at 30% 20%, #ffffff 0%, #f6f7f9 60%, #eceef2 100%); box-shadow: inset 0 0 0 1px #a7aeb8, inset 0 2px 6px rgba(0,0,0,.12); color: #1d2433; }
.wb-title, .wb-ask, .wb-text, .board-card .wb-said { font-family: "Caveat", "Marker Felt", "Chalkboard SE", "Segoe Print", "Bradley Hand", cursive; }
.wb-title { color: #c2362b; font-size: 1.6rem; font-weight: 700; transform: rotate(-1.5deg); margin-bottom: 6px; }
.wb-ask { display: block; font-size: 1.4rem; font-weight: 600; line-height: 1.2; color: #2a3550; margin-bottom: 8px; }
.wb-text { display: block; width: 100%; box-sizing: border-box; min-height: 7.5em; resize: vertical; border: 0; outline: 0; background: transparent; color: #1d3fa8; font-size: 1.9rem; font-weight: 600; line-height: 1.2; padding: 4px 2px; caret-color: #1d3fa8; }
.wb-text::placeholder { color: rgba(29, 63, 168, .3); }
.wb-text:focus-visible { box-shadow: 0 2px 0 rgba(29, 63, 168, .25); }
.wb-note { font-size: .78rem; color: #5b6475; margin-top: 6px; }
.wb-tray { display: flex; align-items: center; gap: 8px; height: 14px; margin: 8px 6px 10px; padding: 0 10px; border-radius: 3px; background: linear-gradient(180deg, #9aa1ab, #c7ccd3); }
.wb-pen { width: 46px; height: 7px; border-radius: 4px 2px 2px 4px; background: #222; box-shadow: inset -9px 0 0 rgba(255,255,255,.35); }
.wb-pen.blue { background: #1d3fa8; } .wb-pen.red { background: #c2362b; }
.wb-eraser { width: 30px; height: 10px; margin-left: auto; border-radius: 2px; background: linear-gradient(180deg, #444 0 40%, #e9e1cf 40%); }
.wb-actions { justify-content: flex-end; gap: 8px; }
.wb-actions button:not(.primary) { background: #f4f5f7; color: #1d2433; border-color: #9aa1ab; }
/* Revealed boards in the guess box. */
.board-card { display: inline-block; margin: 4px 0 2px; padding: 6px 10px; border-radius: 4px; background: #fbfbfc; border: 3px solid #b9bfc8; color: #1d3fa8; transform: rotate(-.8deg); }
.board-card .wb-said { font-size: 1.45rem; font-weight: 600; line-height: 1.25; }
/* On the street: a board held while writing, held face down, then held up. */
.av-board .wb-marker { animation: wb-scribble .9s ease-in-out infinite; }
@keyframes wb-scribble { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(5px, 1.5px); } 50% { transform: translate(9px, -.5px); } 75% { transform: translate(3px, 2px); } }
.avatar.board-writing .av-gaze { transform: translate(0, 2.2px) !important; }
.avatar.board-writing .av-look { transform: translate(0, 1.6px) !important; }
.avatar.board-writing .av-typing { opacity: 0; }
.av-board .wb-up { transform-box: fill-box; transform-origin: 50% 100%; animation: wb-raise .6s cubic-bezier(.3,1.5,.6,1); }
@keyframes wb-raise { from { transform: translateY(14px) scaleY(.2); } to { transform: none; } }
.av-board .wb-street-text { font-family: "Caveat", "Marker Felt", "Chalkboard SE", "Segoe Print", "Bradley Hand", cursive; }
@media (prefers-reduced-motion: reduce) { .wb-dialog[open] .wb, .av-board .wb-marker, .av-board .wb-up { animation: none; } }

/* Feedback when a session ends or you leave */
.feedback { margin: 10px 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.fb-q { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.fb-pick { display: inline-flex; gap: 6px; }
.fb-pick button { min-height: 0; padding: 6px 12px; }
.fb-pick button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.fb-text { flex-direction: column; align-items: stretch; }
.fb-text textarea { width: 100%; box-sizing: border-box; font: inherit; }
