/* roby-island (17 Nov): Multiplayer (src/mp/screen.js, the result's placings in src/race/resultview.js, Home's
   MULTIPLAYER button in src/home.js). The kit's look: outlined white type (.fx), black-edged solid buttons with a
   darker foot band, navy panels; solid colour only, no gradient scrims. Sizes in mock px (var(--m) = CSS px per
   1/1440 of the play column), so a phone and a PC window show the same centred column. */

/* ---- buttons: the Figma kit's (23 Nov "Multiplayer" frames; as .cc-row): a black edge, a white top line, a top-to-bottom
   gradient and a darker foot band ---- */
.mp-btn { position: relative; display: grid; place-items: center; box-sizing: border-box; min-height: calc(var(--m) * 138); padding: 0 calc(var(--m) * 24) calc(var(--m) * 8);
  border: 0; border-radius: calc(var(--m) * 20); cursor: pointer; font: inherit; color: #fff; touch-action: manipulation;
  --c: #5dc2fd; --c2: #2b8ce5; --d: #0159a4;
  background: linear-gradient(var(--c), var(--c2)); box-shadow: 0 0 0 calc(var(--m) * 5) #000, inset 0 calc(var(--m) * -10) 0 var(--d), inset 0 calc(var(--m) * 5) 0 #fff; }
.mp-btn > b { pointer-events: none; white-space: nowrap; max-width: 100%; }
.mp-btn:active:not(:disabled) { filter: brightness(.93); transform: translateY(calc(var(--m) * 3)); }
.mp-btn:disabled { filter: grayscale(.7) brightness(.92); cursor: default; }
.mp-btn:focus-visible { outline: calc(var(--m) * 8) solid #fff; outline-offset: calc(var(--m) * 6); }
.mp-btn[hidden] { display: none !important; }
.mp-btn.green { --c: #50de06; --c2: #0ec12a; --d: #038623; }
.mp-btn.purple { --c: #b66bff; --c2: #8a3fe0; --d: #5d22a6; }
.mp-btn.blue { --c: #5dc2fd; --c2: #2b8ce5; --d: #0159a4; }
.mp-btn.yellow { --c: #f9e51a; --c2: #fc9407; --d: #af3f01; }
.mp-btn.grey { --c: #c4c4c4; --c2: #969696; --d: #696969; }
.mp-btn.wa { --c: #50de06; --c2: #0ec12a; --d: #038623; }

/* Home: MULTIPLAYER, the mirror of CLASSIC (src/home.js MP_BOX), green with its LIVE tab */
/* 23 Nov: the Home mock's green: a white top band, the gradient, a deep foot */
.fg-btn.fh-mp { background: linear-gradient(#4ddd08, #17c425); box-shadow: 0 0 0 calc(var(--m) * 6) #000, inset 0 calc(var(--m) * -24) 0 #038623, inset 0 calc(var(--m) * 8) 0 #fff; }
button.fh-mp { cursor: pointer; }
button.fh-mp:active { filter: brightness(.93); transform: translateY(calc(var(--m) * 3)); }
.fh-mp:focus-visible { outline: calc(var(--m) * 8) solid #fff; outline-offset: calc(var(--m) * 6); }
.fh-mpsubbg { background: #038623; border-radius: calc(var(--m) * 8); }
/* GDD v1.6 (§2.4): below 30 trophies the button is grey with a lock; LATER on the MP card leaves a NEW badge */
.fg-btn.fh-mp.locked { background: #8a8f96; box-shadow: 0 0 0 calc(var(--m) * 6) #000, inset 0 calc(var(--m) * -14) 0 #5d6268, inset 0 calc(var(--m) * 6) 0 #c3c7cc; }
.fh-mp.locked .fh-mpsubbg { background: #4a4e53; }
.fh-mp.locked .fh-mpdot { transform: scale(3); animation: none; background: none; box-shadow: none; border-radius: 0; width: calc(var(--m) * 26); height: calc(var(--m) * 30);
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 30'%3E%3Crect x='2' y='12' width='22' height='16' rx='3' fill='%23ffd23f' stroke='%23000' stroke-width='3'/%3E%3Cpath d='M7 13V9a6 6 0 0 1 12 0v4' fill='none' stroke='%23000' stroke-width='4'/%3E%3C/svg%3E"); }
.fh-mp.badge::after { content: 'NEW'; position: absolute; top: calc(var(--m) * -22); right: calc(var(--m) * -14); background: #ff3b30; color: #fff; font-family: var(--font-ui); font-weight: 700; font-size: var(--f32); padding: calc(var(--m) * 4) calc(var(--m) * 12); border-radius: calc(var(--m) * 14); box-shadow: 0 0 0 calc(var(--m) * 4) #000; --ow: 4.5; }
.fh-mpdot { width: calc(var(--m) * 12); height: calc(var(--m) * 12); border-radius: 50%; background: #e22929; box-shadow: 0 0 0 calc(var(--m) * 3) #000; animation: mpPulse 1.4s ease-in-out infinite; }
@keyframes mpPulse { 50% { transform: scale(.7); opacity: .6; } }

/* ---- the screen (23 Nov: the Figma "Multiplayer" frames). The shared top bar and close bar frame it (src/chrome.js);
   the column sits between them (screen.js fit()). Cards: a black edge, a darker foot band, an inner panel. ---- */
#s-mp { background: #8fd3ff; overflow: hidden; }   /* (30 Nov: the backdrop is the column's frame: screen.js mockBackdrop) */
#s-mp .mp-col { position: absolute; left: var(--colx, 0px); width: var(--colw, 100%); top: var(--sat, 0px); bottom: var(--sab, 0px); display: flex; flex-direction: column;
  padding: calc(var(--m) * 100) calc(var(--m) * 70) calc(var(--m) * 40); box-sizing: border-box; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
#s-mp .mp-col::-webkit-scrollbar { display: none; }
#s-mp [hidden] { display: none !important; }
.mp-lobby, .mp-board { display: flex; flex-direction: column; gap: calc(var(--m) * 36); flex: 1 0 auto; }
/* the hub sits in the middle of the space, the room from the top */
.mp-hub { display: flex; flex-direction: column; gap: calc(var(--m) * 48); margin: auto 0; padding-bottom: calc(var(--m) * 60); }
.mp-roomv { display: flex; flex-direction: column; align-items: stretch; gap: calc(var(--m) * 20); margin: auto 0; }
.mp-card { position: relative; box-sizing: border-box; border-radius: calc(var(--m) * 30); padding: calc(var(--m) * 50) calc(var(--m) * 50) calc(var(--m) * 74);
  --c: #01a7f9; --d: #0259bc; --in: #006dba;
  background: var(--c); box-shadow: 0 0 0 calc(var(--m) * 6) #000, inset 0 calc(var(--m) * -24) 0 var(--d); }
.mp-card.purple { --c: #a545ff; --d: #561097; --in: #7926c7; }
.mp-in { border-radius: calc(var(--m) * 22); background: var(--in, #006dba); }
.mp-ttl { color: #fffb0c; white-space: normal; text-align: center; line-height: 1.05; }
.mp-cdesc, .mp-csub, .mp-joinerr, .mp-boardnote, .mp-empty { -webkit-text-stroke: calc(var(--m) * var(--ow, 5.5) * 2) var(--oc); paint-order: stroke fill; }
.mp-cdesc span { display: block; }
.mp-cdesc, .mp-csub { margin: 0; font: 700 var(--f40)/1.2 var(--font-ui); color: #fff; --ow: 5.5; }
.mp-csub { text-align: center; }
.mp-row { display: flex; gap: calc(var(--m) * 18); }
.mp-row > .mp-btn { flex: 1 1 0; min-width: 0; }
/* PLAY WITH FRIENDS: the people on the left, the title, the line and QUICK RACE / CREATE on the right */
.mp-fcard .mp-in { display: flex; align-items: center; gap: calc(var(--m) * 30); padding: calc(var(--m) * 20) calc(var(--m) * 34) calc(var(--m) * 38) calc(var(--m) * 40); }
.mp-fart { flex: none; width: calc(var(--m) * 258); height: auto; user-select: none; pointer-events: none; }
.mp-ftext { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--m) * 18); }
.mp-ftext .mp-ttl { text-align: left; }
.mp-ftext .mp-row { align-self: stretch; margin-top: calc(var(--m) * 20); }
/* JOIN WITH ROOM CODE: four letter boxes and JOIN */
.mp-jcard .mp-in, .mp-ended .mp-in { display: flex; flex-direction: column; align-items: center; gap: calc(var(--m) * 14); padding: calc(var(--m) * 34) calc(var(--m) * 40) calc(var(--m) * 38); }
.mp-boxes { display: flex; gap: calc(var(--m) * 15); margin-top: calc(var(--m) * 18); }
.mp-box { width: calc(var(--m) * 180); height: calc(var(--m) * 180); box-sizing: border-box; border: 0; border-radius: calc(var(--m) * 18); text-align: center; text-transform: uppercase; caret-color: #fffb0c;
  font: 700 var(--f56)/1 var(--font-ui); color: #fff; background: #00478a; padding: 0; -webkit-text-stroke: calc(var(--m) * 14) var(--oc); paint-order: stroke fill; --ow: 7; }
.mp-box::placeholder { color: transparent; -webkit-text-stroke: 0; }
/* an empty box shows the mock's dash: a white bar with a black edge */
.mp-box:placeholder-shown:not(:focus) { background: #00478a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 28'%3E%3Crect x='2.5' y='2.5' width='55' height='23' rx='4' fill='%23fff' stroke='%23000' stroke-width='5'/%3E%3C/svg%3E") center / calc(var(--m) * 60) auto no-repeat; }
.mp-box:focus { outline: calc(var(--m) * 6) solid #fffb0c; outline-offset: 0; }
.mp-box:disabled { opacity: .7; }
.mp-joinerr { min-height: calc(var(--m) * 20); margin: 0; font: 700 var(--f36)/1.15 var(--font-ui); color: #ffb3ad; text-align: center; --ow: 5.2; }
.mp-joinerr:empty { min-height: 0; }
.mp-joingo { width: calc(var(--m) * 508); margin-top: calc(var(--m) * 16); }
.mp-ended .mp-btn { width: 100%; }

/* a room: the title, then the card: ROOM CODE, the clock, the seats */
.mp-rtitle { text-align: center; }
.mp-room { display: flex; flex-direction: column; align-items: stretch; gap: calc(var(--m) * 24); padding: calc(var(--m) * 62) calc(var(--m) * 50) calc(var(--m) * 80); }
.mp-codein { display: flex; flex-direction: column; align-items: center; gap: calc(var(--m) * 26); padding: calc(var(--m) * 54) calc(var(--m) * 70) calc(var(--m) * 64); }
.mp-code { display: flex; gap: calc(var(--m) * 15); min-height: calc(var(--m) * 180); }
.mp-tile { display: grid; place-items: center; width: calc(var(--m) * 180); height: calc(var(--m) * 180); border-radius: calc(var(--m) * 22); background: #00478a; }
#s-mp[data-phase="joining"] .mp-tile .fx { color: #8fb3d9; }
.mp-share { align-self: stretch; gap: calc(var(--m) * 36); margin-top: calc(var(--m) * 36); }
.mp-btn.mp-ico { grid-auto-flow: column; gap: calc(var(--m) * 16); justify-content: center; }
.mp-i { display: block; width: calc(var(--m) * 62); height: calc(var(--m) * 62); background: center / contain no-repeat; }
.mp-i.share { background-image: url("assets/ui/mp/ic_share.5a4cb303.webp"); }
.mp-i.wa { width: calc(var(--m) * 74); height: calc(var(--m) * 74); background-image: url("assets/ui/mp/ic_whatsapp.e423ed06.webp"); }
/* the clock: a black ring, the time left in yellow, the number on navy; the line under it */
.mp-status { display: flex; flex-direction: column; align-items: center; gap: calc(var(--m) * 2); text-align: center; }
.mp-ring { position: relative; flex: none; width: calc(var(--m) * 220); height: calc(var(--m) * 220); }
.mp-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.mp-ring circle { fill: none; }
.mp-ring .trk { stroke: #000; stroke-width: 24; }
.mp-ring .fg { stroke: #fffb0c; stroke-width: 15; transition: stroke-dashoffset .25s linear; }
.mp-ring .in { fill: #00478a; stroke: #000; stroke-width: 4; }
.mp-ringnum { position: absolute; inset: 0; display: grid; place-items: center; }
.mp-ring.tick .mp-ringnum { animation: mpTick .3s ease-out; }
@keyframes mpTick { from { transform: scale(1.18); } }
.mp-statustxt { margin-top: calc(var(--m) * -26); position: relative; }
.mp-statustxt .fx { white-space: normal; line-height: 1.1; }
/* ten seats, five to a row: a name over a disc with the bird; an empty seat is … over a faint ring */
.mp-seats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: calc(var(--m) * 10); padding: calc(var(--m) * 50); }
.mp-seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: calc(var(--m) * 14); padding: calc(var(--m) * 26) 0 calc(var(--m) * 30);
  border-radius: calc(var(--m) * 28); background: #00478a; min-width: 0; }
.mp-seatname { display: flex; align-items: center; justify-content: center; height: calc(var(--m) * 60); width: 100%; padding: 0 calc(var(--m) * 8); box-sizing: border-box; overflow: hidden; }
.mp-seatname .fx { min-width: 0; max-width: 100%; overflow: hidden; text-align: center; letter-spacing: -.02em; }
.mp-seatname .fx { color: #fffb0c; }
.mp-seatbird { display: grid; place-items: center; box-sizing: border-box; width: calc(var(--m) * 160); max-width: 82%; aspect-ratio: 1; border-radius: 50%; background: #0a245a; box-shadow: 0 0 0 calc(var(--m) * 5) #000; overflow: hidden; }
.mp-seat.empty .mp-seatbird { background: none; box-shadow: inset 0 0 0 calc(var(--m) * 5) #003d76; }
.mp-seatbird canvas { width: 78% !important; height: auto !important; image-rendering: pixelated; }
.mp-seat.away { filter: grayscale(.8) brightness(.8); }
.mp-seat.tappable { cursor: pointer; }
.mp-seat.land .mp-seatbird canvas { animation: mpLand .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes mpLand { from { transform: translateY(calc(var(--m) * -220)); } 70% { transform: translateY(calc(var(--m) * 8)) scale(1.1, .9); } }
/* the room's buttons under the card, two to a row at the mock's width (one alone sits in the middle) */
.mp-actions { display: flex; justify-content: center; gap: calc(var(--m) * 36); flex: none; margin-top: calc(var(--m) * 20); }
.mp-actions > .mp-btn { flex: 0 1 calc(var(--m) * 508); min-width: 0; }
.mp-lobby.locked .mp-actions .mp-btn:disabled { filter: grayscale(.85) brightness(.75); }
.bb-close[disabled] { filter: grayscale(.85) brightness(.75); pointer-events: none; }
.mp-sound { align-self: center; border: 0; cursor: pointer; margin-top: calc(var(--m) * 10); padding: calc(var(--m) * 12) calc(var(--m) * 24); border-radius: calc(var(--m) * 16); background: #00478a; box-shadow: 0 0 0 calc(var(--m) * 5) #000, inset 0 0 0 calc(var(--m) * 5) #fffb0c; color: #fff; }
.mp-sound[hidden] { display: none !important; }
.mp-boardnote, .mp-empty { margin: 0; font: 700 var(--f36)/1.3 var(--font-ui); color: #fff; text-align: center; --ow: 5.2; }

/* MULTIPLAYER LEADERBOARD */
.mp-boardhead { text-align: center; }
.mp-boardhead .fx { white-space: normal; }
.mp-tabs { display: flex; gap: calc(var(--m) * 24); }
.mp-tab { flex: 1; height: calc(var(--m) * 120); border: 0; border-radius: calc(var(--m) * 20); cursor: pointer; background: #135092; box-shadow: 0 0 0 calc(var(--m) * 5) #000; color: #fff; }
.mp-tab.on { background: #fbb413; box-shadow: 0 0 0 calc(var(--m) * 5) #000, inset 0 calc(var(--m) * -10) 0 #c46a04; }
.mp-mecard { display: flex; align-items: center; gap: calc(var(--m) * 30); padding: calc(var(--m) * 28) calc(var(--m) * 36); border-radius: calc(var(--m) * 24); background: #fbb413; box-shadow: 0 0 0 calc(var(--m) * 6) #000, inset 0 calc(var(--m) * -10) 0 #c46a04; }
.mp-mestats .fx { white-space: normal; }
.mp-lhead, .mp-lrow { display: grid; grid-template-columns: 0.6fr 2.6fr 1fr 1.3fr 1fr; align-items: center; gap: calc(var(--m) * 12); padding: 0 calc(var(--m) * 26); text-align: center; }
.mp-lhead { color: #d6ecff; }
.mp-list { display: flex; flex-direction: column; gap: calc(var(--m) * 14); }
.mp-lrow { height: calc(var(--m) * 104); border-radius: calc(var(--m) * 18); background: #0b3a6a; box-shadow: 0 0 0 calc(var(--m) * 5) #000; }
.mp-lrow.you { background: #fbb413; box-shadow: 0 0 0 calc(var(--m) * 5) #000, inset 0 calc(var(--m) * -8) 0 #c46a04; }
.mp-lname { text-align: left; overflow: hidden; }
.mp-empty { padding: calc(var(--m) * 40) 0; }

/* the race result: the room's ten placings (src/race/resultview.js standings) */
/* 26 Nov 2026 (Basil, "Multiplayer Result" frame): the placings in one column on the blue panel; light rows, the pipes
   in a sky pill, this player's row white and a little wider; the rank badges are the Game Over board's (lb_*) */
.mp-stand { border-radius: calc(var(--m) * 20); background: #01a7f9; box-shadow: 0 0 0 calc(var(--m) * 6) #000, inset 0 calc(var(--m) * -30) 0 #0259bc; --oc: var(--oc-blue); }
.mp-sin { border-radius: calc(var(--m) * 14); background: linear-gradient(#fff, #9de4fd); }
.mp-srow { border-radius: calc(var(--m) * 12); }
.mp-srow.you { background: #fff; box-shadow: 0 0 0 calc(var(--m) * 4) #01a7f9; }
.mp-srow .mp-sbadge { pointer-events: none; }
.mp-splace { --oc: #363c53; }
.mp-spill { border-radius: calc(var(--m) * 10); background: #c5ecff; }
.mp-sname { justify-content: flex-start !important; text-align: left; overflow: hidden; }
#raceResult button.mp-btn#raceBoard { display: grid; place-items: center; background: linear-gradient(var(--c), var(--c2)); border-radius: calc(var(--m) * 26);
  box-shadow: 0 0 0 calc(var(--m) * 6) #000, inset 0 calc(var(--m) * -14) 0 #5d22a6, inset 0 calc(var(--m) * 6) 0 #fff; }   /* (23 Nov: the purple's foot by value: the result's entrance sets --d to its delay, which voided the whole shadow) */

/* the race HUD in a room: ROOM ABCD where "YOU + 9 RACERS" was */
#s-race.mp .race-left { letter-spacing: 0; }

/* 17 Nov late (Roby's playtest): the in-race ending. The winner's moment (someone else won) and your placing,
   lettered like the race's other heads; a podium is gold and bigger, other places calm (white on navy) */
#s-race .race-banner.mp-place b { font-size: min(170px, calc(var(--colw, 390px) * .26)); }
#s-race .race-banner.mp-place:not(.podium) b { background: none; color: #fff; }
#s-race .race-banner.mp-place:not(.podium) b::before { color: #0b3a6a; -webkit-text-stroke-color: #0b3a6a; }
#s-race .race-banner.mp-winner b { font-size: min(90px, calc(var(--colw, 390px) * .11), calc(var(--colw, 390px) * 1.35 / var(--n, 10))); }   /* 23 Nov dev QA: NAME WINS! (--n letters, race.js) fits the column on a desktop */
#s-race.mpend .race-feed { visibility: hidden; }
#s-race.mpfade .race-top, #s-race.mpfade .race-roster, #s-race.mpfade .race-feed, #s-race.mpfade .race-left, #s-race.mpfade .race-hint { opacity: 0; transition: opacity .25s; }
/* the spectate bar's third button (SKIP → RESULTS) once the room has settled */
#s-race.mp .race-spec > div { flex-wrap: wrap; justify-content: center; }

/* CONNECTION LOST after a reload mid-race (src/mp/flow.js restore) */
.mp-lost { display: flex; flex-direction: column; gap: calc(var(--m) * 30); align-items: stretch; text-align: center; }
.card .mp-lost .mp-lost-big { --fs: 56; --sw: 7;  color: #fff; white-space: normal; line-height: 1.15; margin: 0; }
.mp-lost-note { margin: 0; font: 700 var(--f36)/1.3 var(--font-ui); color: #d6ecff; --ow: 5.2; }

@media (prefers-reduced-motion: reduce) { .mp-seat.land .mp-seatbird canvas, .mp-ring.tick .mp-ringnum, .mp-live::before, .fh-mpdot { animation: none; } }

/* GDD v1.6 reload resume (20 Nov): RECONNECTING… while the page asks for its bird back (a solid band, no scrim) */
.mp-reconnect { position: fixed; left: 0; right: 0; top: 42%; z-index: 9000; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 16px; background: #13314d; border-top: 4px solid #ffd23f; border-bottom: 4px solid #ffd23f; pointer-events: none; }
.mp-reconnect b { font: 700 var(--f56)/1.1 var(--font-ui, sans-serif); color: #fff; letter-spacing: 1px; --ow: 7; }
.mp-reconnect small { font: 700 var(--f40)/1.2 var(--font-ui, sans-serif); color: #d6ecff; --ow: 5.5; }
/* the resume's banner sits above the 3-2-1 (the count is in the middle of the course) */
#s-race .race-banner.mp-resume { top: 12%; }
#s-race .race-banner.mp-resume b { font-size: min(44px, calc(var(--colw, 390px) * .095)); }
#s-race .race-banner.mp-resume span { font-size: var(--f56); --ow: 7; }

/* wave 5: the final-two line sits at the bottom edge of the race (src/mp/mpfx.js createFinishHud); the feed steps up over it */
.race-stage.mp-line-on .race-feed { transform: translateY(calc(var(--u) * -130)); transition: transform .2s; }
/* 23 Nov (owner: "use the grey X from the mock too"): the close bar's X is the mock's: white, rounded arms, a black edge,
   about 58 mock px across. 24 Nov (Basil's annotated Birds screen: "update the button to correct visual"): on every screen,
   the daily popup's close bar too (the 22 Nov red X is gone) */
.bb-close svg, .dp-closebar .dp-x svg { display: none; }
.bb-close::after, .dp-closebar .dp-x::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg transform='rotate(45 50 50)'%3E%3Cg fill='none' stroke='%23000' stroke-width='12'%3E%3Crect x='39' y='4' width='22' height='92' rx='11'/%3E%3Crect x='4' y='39' width='92' height='22' rx='11'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Crect x='39' y='4' width='22' height='92' rx='11'/%3E%3Crect x='4' y='39' width='92' height='22' rx='11'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / calc(var(--m) * 74) no-repeat; }
