/* CW World, the playable build.
   REFERENCE LOCK (refero-design)
   Primary: the Waze app, as its own team and Pentagram describe it: the user's attention is on something else (here, each other),
   so controls are few, big, round and far apart; the one frequent action has its own colour and shape; everything else waits in a
   panel that slides up from the bottom; a panel asks one question and answers with large direct choices; flat colour, clean lines.
   Numbers borrowed from Google's driving-interface guidelines: targets of about 76px with clear gaps, text large enough to read at a glance.
   Kept from mood board B: its colours (sky sheet, coral, charcoal, paper), DM Sans extra-bold titles, small mono labels.
   Reject: soft shadows, thin outlines, small chips, confirm dialogs for harmless choices, playful decoration on the controls themselves
   (the characters carry the fun). The top "Test" row is a test aid and deliberately stays small. */
:root {
  color-scheme: light;
  --sheet: #a5daf0; --go: #f2674a; --ink: #23261c; --charcoal: #212223; --paper: #e8e4da; --muted: #b1afa8; --white: #ffffff;
  --display: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--charcoal); color: var(--ink); font: 400 18px/1.4 var(--display); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
#hud :focus-visible { outline-color: var(--white); }
[hidden] { display: none !important; }

/* the world */
#game { position: fixed; inset: 0; touch-action: none; }
#game canvas { display: block; width: 100%; height: 100%; outline: none; }
/* Going through a door: the picture closes to a dot on you, the room changes, and it opens again. A dark sheet over the screen with a round
   hole cut in it by a mask; main.js changes the size of the hole frame by frame, and takes the sheet away altogether when the hole is fully open.
   (The first version scaled a small hole up 320 times with a huge shadow round it. Browsers could not draw a layer that size and stopped drawing.) */
#fade { position: fixed; inset: 0; background: var(--charcoal); pointer-events: none; z-index: 5; display: none; }
/* the room's name, large, as you arrive */
#title { position: fixed; left: 0; right: 0; top: 15%; text-align: center; pointer-events: none; z-index: 6; opacity: 0; }
#title b { display: inline-block; font: 800 clamp(40px, 8vw, 88px)/1 var(--display); letter-spacing: -0.02em; color: var(--white); text-shadow: 0 3px 0 var(--ink); background: var(--ink); padding: 0.12em 0.4em 0.18em; border-radius: 0.3em; }
#title.show { animation: titlein 1.9s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes titlein { 0% { opacity: 0; transform: translateY(26px) scale(0.92); } 14% { opacity: 1; transform: none; } 78% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-18px); } }
/* the loading screen */
#boot { position: fixed; inset: 0; z-index: 20; background: var(--sheet); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; transition: opacity 0.35s ease; }
#boot b { font: 800 clamp(36px, 7vw, 64px)/1 var(--display); letter-spacing: -0.02em; }
#boot .bar { width: min(260px, 60vw); height: 14px; border-radius: 7px; background: var(--white); border: 3px solid var(--ink); overflow: hidden; }
#boot .bar i { display: block; height: 100%; width: 40%; border-radius: 4px; background: var(--go); animation: boot 1.1s ease-in-out infinite alternate; }
#boot small { font: 500 13px/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; }
#boot.gone { opacity: 0; pointer-events: none; }
@keyframes boot { from { transform: translateX(-20%); } to { transform: translateX(170%); } }
/* everything you can press gives a little under the finger, and messages pop in */
.big, .fab, .pill, .chip, .tile, .tab, .person, .sw, .dashed, .ver { transition: transform 0.1s ease; }
.big:active, .fab:active, .pill:active, .chip:active, .tile:active, .tab:active, .person:active, .sw:active, .dashed:active, .ver:active { transform: scale(0.94); }
#act:active, #act2:active { transform: scale(0.95); }
@keyframes pop { 0% { transform: translateX(-50%) scale(0.86); } 60% { transform: translateX(-50%) scale(1.05); } 100% { transform: translateX(-50%) scale(1); } }
#toast.pop { animation: pop 0.24s ease-out; }
@keyframes tick { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.dside b { display: block; transform-origin: left center; animation: tick 0.3s ease-out; }
.heard.talk { background: var(--sheet); color: var(--ink); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { #title.show, #toast.pop, .dside b, #boot .bar i { animation: none; } #title.show { opacity: 0; } }

/* heads-up display */
#hud { position: fixed; inset: 0; pointer-events: none; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* test menu: jump straight to any room. It comes out before the party. */
.jump { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; background: var(--charcoal); padding: 5px 6px 5px 12px; border-radius: 4px; pointer-events: auto; }
.jump span, .startin span { font: 500 12px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; margin-right: 6px; }
.jump span { color: var(--muted); }
.chip { font: 700 14px/1 var(--display); padding: 6px 11px 7px; border-radius: 30px; border: 2px solid var(--white); background: transparent; color: var(--white); cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--sheet); border-color: var(--sheet); color: var(--ink); }
.sep { width: 1px; height: 20px; background: #55585c; margin: 0 6px; }
.heard { background: var(--charcoal); color: var(--white); padding: 10px 12px; border-radius: 4px; font: 500 12px/1.3 var(--mono); letter-spacing: 0.03em; max-width: 100%; }
.startin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 24px; }
.startin .chip { border-color: var(--ink); color: var(--ink); font-size: 16px; padding: 8px 14px 9px; }
.startin .chip[aria-checked="true"] { background: var(--ink); color: var(--sheet); }
.where { display: inline-flex; align-items: center; gap: 10px; background: var(--charcoal); color: var(--white); padding: 7px 14px 7px 7px; border-radius: 4px; }
.where b { font-weight: 800; font-size: 17px; }
/* test aids (the room menu, stand-ins and their readouts, Start in) only show on a development address or with ?test=1 */
body:not(.testing) #jump, body:not(.testing) #startin, body:not(.testing) #lobbynote, body:not(.testing) #hearing, body:not(.testing) #heard { display: none !important; }
#codefield small { display: block; margin-top: 6px; font: 700 14px/1.2 var(--display); min-height: 1.2em; }
#codefield[hidden] { display: none; }
/* the version number: small, in the corner of the room name and under the lobby's title. It opens the change log. */
.ver { font: 500 12px/1 var(--mono); letter-spacing: 0.04em; padding: 5px 8px; border-radius: 30px; border: 1.5px solid currentColor; background: transparent; color: var(--muted); cursor: pointer; pointer-events: auto; }
.ver.light { color: var(--ink); margin: 2px 0 14px; }
#log { position: fixed; inset: 0; z-index: 9; background: rgba(21, 23, 38, 0.6); display: grid; place-items: center; padding: 16px; }
#log[hidden] { display: none; }
.logbox { width: min(560px, 100%); max-height: min(80vh, 720px); display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border-radius: 28px; padding: 18px 20px 8px; }
.logbox header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; }
.logbox h2 { margin: 0; font: 800 26px/1.1 var(--display); }
.logbox .pill { margin: 0; font-size: 16px; padding: 9px 18px 10px; }
#logbody { overflow-y: auto; margin-top: 10px; padding: 0 4px 14px 0; overscroll-behavior: contain; }
#logbody h3 { margin: 16px 0 6px; font: 800 18px/1.2 var(--display); }
#logbody h3 span { font: 500 12px/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; margin-left: 8px; }
#logbody ul { margin: 0; padding-left: 20px; }
#logbody li { font: 400 16px/1.4 var(--display); margin: 3px 0; }
.cwmark { display: block; background: var(--paper); border-radius: 3px; padding: 5px 6px; }
.cwmark svg { display: block; height: 17px; width: auto; }
#hint, #toast { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; width: max-content; max-width: calc(100% - 32px); text-align: center; background: var(--charcoal); color: var(--white); padding: 9px 16px; border-radius: 4px; font: 500 13px/1.4 var(--mono); letter-spacing: 0.03em; text-wrap: balance; transition: opacity 0.3s ease; }
#hint { bottom: max(92px, calc(env(safe-area-inset-bottom) + 86px)); } /* above the emote row */
#toast { top: max(64px, calc(env(safe-area-inset-top) + 56px)); background: var(--paper); color: var(--ink); font: 700 16px/1.3 var(--display); letter-spacing: 0; }
#hint.off, #toast:empty, #toast.off { opacity: 0; }
/* the few words that follow the pointer over something you can use */
#tip { position: fixed; transform: translate(-50%, calc(-100% - 16px)); background: var(--charcoal); color: var(--white); font: 700 14px/1 var(--display); padding: 8px 12px; border-radius: 30px; white-space: nowrap; pointer-events: none; z-index: 3; }
/* ---------- emotes ---------- */
#emotes { position: absolute; left: max(16px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom)); display: flex; gap: 8px; pointer-events: auto; }
.emo { position: relative; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--charcoal); color: var(--paper); display: grid; place-items: center; cursor: pointer; transition: transform 0.12s ease; }
.emo svg { width: 28px; height: 28px; }
.emo:hover { transform: translateY(-3px) scale(1.06); }
.emo:active { transform: scale(0.9); }
.emo[aria-pressed="true"] { background: var(--go); color: var(--ink); }
.emo kbd { position: absolute; right: -2px; bottom: -2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--paper); color: var(--ink); font: 700 11px/18px var(--mono); text-align: center; }
.emotoggle { display: none; position: absolute; left: max(22px, env(safe-area-inset-left)); bottom: calc(max(28px, env(safe-area-inset-bottom)) + 146px); width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--charcoal); color: var(--paper); place-items: center; pointer-events: auto; cursor: pointer; }
.emotoggle svg { width: 28px; height: 28px; }
/* on a phone the row is tucked away behind that button, and opens upward beside the stick */
@media (pointer: coarse), (max-width: 700px) { .emotoggle { display: grid; } .emo kbd { display: none; } #emotes { display: none; left: max(86px, calc(env(safe-area-inset-left) + 86px)); bottom: calc(max(28px, env(safe-area-inset-bottom)) + 146px); gap: 6px; } body.emo-open #emotes { display: flex; } .emo { width: 46px; height: 46px; } .emo svg { width: 24px; height: 24px; } body.darting #emotes, body.darting .emotoggle { display: none; } }
body.building #emotes, body.building .emotoggle { display: none; }
/* ---------- the games ---------- */
/* one action button, bottom centre: Throw darts in front of the board, Throw at the fireside */
#acts { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(22px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; }
#act, #act2 { pointer-events: auto; min-height: 64px; padding: 0 34px 0 28px; white-space: nowrap; }
#act2 { min-height: 54px; padding: 0 24px 0 20px; font-size: 17px; } /* the lesser of the two: charcoal, smaller */
#act svg { width: 30px; height: 30px; }
#act2 svg { width: 24px; height: 24px; }
/* the aiming panel: a picture of the board with a crosshair sweeping over it */
#darts { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(max(22px, env(safe-area-inset-bottom)) + 78px); pointer-events: auto; background: var(--paper); color: var(--ink); border-radius: 28px; padding: 14px 14px 12px; text-align: center; }
#darts canvas { display: block; width: min(250px, 32vh); height: auto; border-radius: 18px; cursor: pointer; touch-action: none; }
#darts p { margin: 8px 0 0; font: 700 15px/1.2 var(--display); max-width: min(250px, 32vh); text-wrap: balance; min-height: 1.2em; }
/* the score: a tile for each side, the one whose throw it is in ink, with a pip for each dart thrown */
#dscore { display: flex; gap: 6px; margin-bottom: 8px; }
.dside { flex: 1; min-width: 0; background: var(--white); border-radius: 14px; padding: 7px 10px 8px; text-align: left; }
.dside.on { background: var(--ink); color: var(--paper); }
.dside small { display: block; font: 500 11px/1 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dside b { display: block; font: 800 26px/1 var(--display); margin: 4px 0 6px; }
.dside .pips { display: flex; gap: 4px; }
.dside .pips i { width: 12px; height: 12px; border-radius: 3px; border: 2px solid currentColor; opacity: 0.45; }
.dside .pips i.in { background: var(--pip); border-color: var(--pip); opacity: 1; }
/* the pub quiz: the question and its four answers, top centre. Each answer carries its rug's colour and letter. Messages move down to make room. */
#quiz { position: absolute; left: 50%; transform: translateX(-50%); top: max(64px, calc(env(safe-area-inset-top) + 56px)); width: min(520px, calc(100% - 24px)); background: var(--paper); color: var(--ink); border-radius: 24px; padding: 14px 16px 12px; text-align: center; }
#quiz p { margin: 0; font: 500 12px/1.2 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; }
#quiz h3 { margin: 6px 0 10px; font: 800 clamp(19px, 2.4vw, 24px)/1.15 var(--display); text-wrap: balance; }
#qa { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#qa:empty { display: none; }
.ans { display: flex; align-items: center; gap: 8px; background: var(--white); border-radius: 14px; padding: 6px 10px 6px 6px; font: 700 15px/1.15 var(--display); text-align: left; }
.ans b { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--rug); color: var(--white); display: grid; place-items: center; font-weight: 800; }
.ans.dim { opacity: 0.35; }
#quiz .clock { display: block; height: 8px; border-radius: 4px; background: var(--muted); overflow: hidden; margin: 10px 0 8px; }
#quiz .clock i { display: block; height: 100%; background: var(--go); }
#quiz #qs { text-transform: none; letter-spacing: 0; font: 700 15px/1.2 var(--display); min-height: 1.2em; }
body.quizzing #toast, body.quizzing #gate { top: auto; bottom: 110px; }
/* the Yeti's password */
#pwform { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
#pwform[hidden] { display: none; }
#pw { width: 150px; font: 700 17px/1 var(--display); padding: 10px 14px; border-radius: 30px; border: 2px solid var(--ink); background: var(--white); color: var(--ink); }
#pwform .pill { margin-top: 0; }
/* on a wide screen the panel sits beside you, not on top of you */
@media (min-width: 900px) { #darts { left: calc(50% + 260px); bottom: 50%; transform: translate(-50%, 50%); } #darts canvas, #darts p { width: 260px; max-width: 260px; } }
body.building #acts, body.building #darts, body.building #quiz { display: none; }
@media (max-width: 700px) { #acts { flex-direction: column-reverse; gap: 8px; } }
/* on a phone the darts panel needs the room: the stick and the round buttons step aside while you throw */
@media (pointer: coarse), (max-width: 700px) { body.darting #stick, body.darting .fab, body.darting #who { display: none; } }
/* a locked door explains itself. The button is a stand-in until the puzzle and the darts game exist. */
#gate { position: absolute; left: 50%; transform: translateX(-50%); top: max(64px, calc(env(safe-area-inset-top) + 56px)); width: max-content; max-width: min(440px, calc(100% - 32px)); background: var(--paper); color: var(--ink); padding: 16px 18px 18px; border-radius: 4px; pointer-events: auto; text-align: center; }
#gate p { margin: 0 0 12px; font: 700 17px/1.3 var(--display); text-wrap: balance; }
/* the moose asking whether you mean it: the same card, in the middle of the screen */
#ask { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: max-content; max-width: min(420px, calc(100% - 32px)); background: var(--paper); color: var(--ink); padding: 18px 20px 20px; border-radius: 24px; pointer-events: auto; text-align: center; }
#ask p { margin: 0 0 14px; font: 700 18px/1.3 var(--display); text-wrap: balance; }
#ask .pair { display: flex; gap: 8px; justify-content: center; }
#ask .pill { margin-top: 0; font-size: 16px; padding: 11px 22px 12px; }
body.building #ask { display: none; }
/* rock, paper, scissors with the snowman: a card at the bottom, where the Throw button was, so the snowman stays in view */
#rps { position: absolute; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); background: var(--paper); color: var(--ink); padding: 14px 16px 14px; border-radius: 24px; pointer-events: auto; text-align: center; }
#rps p { margin: 0; }
#rpstitle { font: 800 18px/1.2 var(--display); }
#rpsscore { font: 500 12px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }
#rps .pair { display: flex; gap: 8px; justify-content: center; margin: 10px 0 8px; }
#rps .pill { margin-top: 0; font-size: 16px; padding: 10px 16px 11px 12px; display: inline-flex; align-items: center; gap: 6px; }
#rps .pill svg { width: 24px; height: 24px; }
#rps .pill:disabled { opacity: 0.4; cursor: default; }
#rps .pill.on:disabled { opacity: 1; background: var(--ink); color: var(--white); }
#rpssay { font: 700 16px/1.3 var(--display); min-height: 1.3em; }
body.building #rps { display: none; }
@media (max-width: 420px) { #rps .pill { padding: 10px 11px 11px 9px; font-size: 15px; } #rps .pill svg { width: 20px; height: 20px; } }
#gate .pill { margin-top: 0; font-size: 16px; padding: 10px 20px 11px; }
#fps { position: absolute; right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); background: var(--charcoal); color: var(--white); padding: 6px 10px; border-radius: 4px; font: 500 12px/1 var(--mono); }
#stick { display: none; position: absolute; left: max(22px, env(safe-area-inset-left)); bottom: max(28px, env(safe-area-inset-bottom)); width: 132px; height: 132px; border-radius: 50%; border: 3px solid var(--white); background: rgba(33, 34, 35, 0.55); pointer-events: auto; touch-action: none; }
#stick i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: var(--white); }
@media (pointer: coarse), (max-width: 700px) { #quiz { top: max(148px, calc(env(safe-area-inset-top) + 140px)); } #stick { display: block; } #hint { bottom: auto; top: max(148px, calc(env(safe-area-inset-top) + 140px)); } #toast, #gate { top: max(148px, calc(env(safe-area-inset-top) + 140px)); } .sep { display: none; } .jump { padding-left: 10px; } .chip { font-size: 13px; padding: 6px 9px 7px; } }

/* ---------- chunky controls ---------- */
.big { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; padding: 0 30px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); font: 800 20px/1 var(--display); cursor: pointer; }
.big.go { background: var(--go); color: var(--ink); }
.big:disabled { opacity: 0.4; cursor: default; }
.big svg { width: 26px; height: 26px; }
.fab { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); width: 78px; height: 78px; border: 0; border-radius: 50%; background: var(--go); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.fab svg { width: 38px; height: 38px; }
/* the two voice buttons sit above it: charcoal when on, pale and struck through when off; the microphone gets a ring while you talk */
.fab.mini { width: 58px; height: 58px; right: max(30px, calc(env(safe-area-inset-right) + 10px)); bottom: calc(max(24px, env(safe-area-inset-bottom)) + 92px); background: var(--charcoal); color: var(--paper); }
.fab.mini.two { bottom: calc(max(24px, env(safe-area-inset-bottom)) + 160px); }
.fab.mini svg { width: 28px; height: 28px; }
.fab.mini[aria-pressed="false"] { background: var(--paper); color: var(--ink); }
.fab.mini.talking { box-shadow: 0 0 0 5px var(--sheet); }
.fab.mini.three { bottom: calc(max(24px, env(safe-area-inset-bottom)) + 228px); }
.fab.mini.four { bottom: calc(max(24px, env(safe-area-inset-bottom)) + 296px); }
.fab.mini.three[aria-pressed="false"] { background: var(--charcoal); color: var(--paper); } /* this one opens a list; it is not an on and off switch */
.fab.mini.three[aria-pressed="true"] { background: var(--sheet); color: var(--ink); }
/* who is where: everyone at the party, by room, beside the buttons */
#who { position: fixed; right: max(104px, calc(env(safe-area-inset-right) + 94px)); bottom: max(24px, env(safe-area-inset-bottom)); width: min(280px, calc(100vw - 130px)); max-height: min(70vh, 560px); overflow-y: auto; background: var(--paper); color: var(--ink); border-radius: 24px; padding: 14px 16px 12px; overscroll-behavior: contain; }
#who section + section { margin-top: 12px; }
#who h3 { margin: 0 0 6px; font: 500 12px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
#who .here h3 { font-weight: 700; }
#who .here h3::after { content: " \00b7 you are here"; }
#who ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
#who li { font: 700 14px/1 var(--display); padding: 6px 10px; border-radius: 30px; background: var(--white); }
#who li.real { background: var(--ink); color: var(--paper); }
#who li.talking { box-shadow: 0 0 0 3px var(--sheet); }
#who li.none { background: transparent; padding-left: 0; font-weight: 500; color: #6b6a64; }
body.building #who { display: none; }
.fab:focus-visible, .sheet :focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }
/* ---------- the avatar builder ---------- */
.sheet { position: fixed; left: 50%; bottom: 0; width: min(820px, 100%); height: min(64vh, 640px); transform: translate(-50%, 100%); background: var(--paper); color: var(--ink); border-radius: 30px 30px 0 0;
  padding: 16px 20px max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sheet.open { transform: translate(-50%, 0); }
.sheethead { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sheethead h2 { margin: 0; font: 800 clamp(21px, 2.2vw, 26px)/1.1 var(--display); letter-spacing: -0.01em; text-wrap: balance; }
/* Surprise me replaces your whole look, so it must not read as the main button: a dashed outline, beside the question */
.dashed { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px 0 14px; border: 3px dashed var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 800 17px/1 var(--display); cursor: pointer; }
.dashed svg { width: 22px; height: 22px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; padding: 2px 6px; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
/* the parts sit in one slim row, so the choices underneath get the room */
.tab { flex: 0 0 auto; min-height: 48px; padding: 0 15px 0 12px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: 700 14px/1 var(--display); cursor: pointer; }
.tab svg { width: 26px; height: 26px; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.rows { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 4px 4px; margin: 0 -4px; overscroll-behavior: contain; }
.rowlabel { margin: 0 0 8px; font: 500 12px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.tile { border: 4px solid transparent; border-radius: 22px; background: var(--white); color: var(--ink); min-height: 88px; padding: 4px 4px 8px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; font: 700 14px/1.1 var(--display); cursor: pointer; }
.tile canvas { width: 62px; height: auto; display: block; }
.grid.wide .tile canvas { width: 56px; }
.tile[aria-checked="true"], .tile[aria-pressed="true"] { border-color: var(--ink); }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px; }
.sw { width: 58px; height: 58px; border-radius: 50%; border: 4px solid var(--white); cursor: pointer; }
.sw[aria-checked="true"] { outline: 4px solid var(--ink); outline-offset: 2px; }
.sheetfoot { flex: none; display: flex; gap: 10px; }
.sheetfoot .big { min-height: 54px; font-size: 19px; flex: 1; }
.sheetfoot .undo { flex: none; padding: 0 24px; }
body.building #stick, body.building #hint, body.building .fab, body.building #jump, body.building .heard { display: none; } /* nothing on screen but you and the panel */
@media (max-width: 700px) { .sheet { height: 62vh; padding-inline: 14px; border-radius: 26px 26px 0 0; } .grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; } .tab { flex-direction: column; width: 64px; min-height: 58px; padding: 0; gap: 3px; border-radius: 20px; font-size: 13px; } .sw { width: 54px; height: 54px; } .fab { width: 72px; height: 72px; } .fab.mini { width: 54px; height: 54px; right: max(29px, calc(env(safe-area-inset-right) + 9px)); bottom: calc(max(24px, env(safe-area-inset-bottom)) + 84px); } .fab.mini.two { bottom: calc(max(24px, env(safe-area-inset-bottom)) + 148px); } .fab.mini.three { bottom: calc(max(24px, env(safe-area-inset-bottom)) + 212px); } .fab.mini.four { bottom: calc(max(24px, env(safe-area-inset-bottom)) + 276px); } #who { right: max(94px, calc(env(safe-area-inset-right) + 84px)); } }
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }

/* lobby */
#lobby { position: fixed; inset: 0; overflow: auto; background: var(--sheet); }
#lobby .in { max-width: 800px; margin-inline: auto; padding: max(28px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 28px max(20px, env(safe-area-inset-left)); }
.lobbybar { position: sticky; bottom: 0; background: var(--sheet); border-top: 3px solid var(--ink); }
#lobby .lobbybar .in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding-block: 14px max(14px, env(safe-area-inset-bottom)); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { font-weight: 800; font-size: 19px; }
h1 { font-weight: 800; font-size: clamp(44px, 9vw, 84px); line-height: 0.95; letter-spacing: -0.02em; margin: clamp(32px, 7vh, 72px) 0 12px; text-wrap: balance; }
.lead { margin: 0 0 28px; font-size: clamp(18px, 1.2vw + 13px, 22px); }
.namefield { display: block; margin: 0 0 22px; max-width: 420px; }
.namefield span { display: block; margin-bottom: 8px; font: 500 12px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }
.namefield input { width: 100%; min-height: 60px; padding: 0 22px; border: 4px solid var(--white); border-radius: 999px; background: var(--white); color: var(--ink); font: 700 20px/1 var(--display); }
.namefield input::placeholder { color: #8b8a84; font-weight: 600; }
.namefield input:focus-visible { outline: none; border-color: var(--ink); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.person { appearance: none; border: 4px solid transparent; border-radius: 22px; background: var(--white); color: var(--ink); min-height: 120px; padding: 8px 6px 10px; cursor: pointer; font: 700 15px/1.15 var(--display); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.person canvas { width: 76px; height: auto; display: block; }
.person svg { width: 44px; height: 44px; margin: auto 0; }
.person[aria-checked="true"] { border-color: var(--ink); }
.person { transition: transform 0.16s cubic-bezier(0.3, 1.5, 0.5, 1), box-shadow 0.16s ease; }
.person canvas, .person svg { transition: transform 0.2s cubic-bezier(0.3, 1.6, 0.5, 1); }
@media (hover: hover) { /* a tile lifts off the page and the character on it perks up; touch screens skip this so nothing sticks */
  .person:hover { transform: translateY(-5px); box-shadow: 0 9px 0 rgba(35, 38, 28, 0.14); }
  .person:hover canvas, .person:hover svg { transform: translateY(-3px) scale(1.07); }
  .person:active { transform: translateY(-1px) scale(0.97); box-shadow: 0 3px 0 rgba(35, 38, 28, 0.14); }
}
@media (prefers-reduced-motion: reduce) { .person, .person canvas, .person svg { transition: none; } .person:hover canvas, .person:hover svg { transform: none; } }
@media (max-width: 520px) { .people { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
.pill { font: 700 19px/1 var(--display); padding: 13px 28px 14px; border-radius: 30px; border: 2px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; margin-top: 24px; }
.pill.go { background: var(--go); border-color: var(--go); }
.pill:disabled { background: transparent; border-color: var(--ink); opacity: 0.45; cursor: default; }
#join { min-width: 200px; margin-left: auto; }
.lobbybar .startin { margin-top: 0; }
.note { margin: 18px 0 0; font: 500 12px/1.5 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.nogl { background: var(--paper); padding: 16px 18px; font-weight: 700; margin-top: 24px; }
@media (prefers-reduced-motion: reduce) { #fade, #hint, #toast { transition: none; } }
