@font-face { font-family: Display; src: url("/assets/bricolage-800.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: Body; src: url("/assets/dm-sans-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Body; src: url("/assets/dm-sans-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: Pixel; src: url("/assets/Silkscreen-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Pixel; src: url("/assets/Silkscreen-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
/* The whole room fits the window: no page scrolling on a TV, a laptop, an ultrawide or a short
   window. The game screen keeps 16:9 and takes what the height allows; the side panel holds
   the QR, Start and the players, and grows into any width left over. */
:root {
  --ink: #f2eee6; --muted: #8b8796; --line: #1d1c26; --pink: #ff3fae; --cyan: #3fd0ff; --gold: #ffd166; --green: #5ee08a;
  --bar: 48px;
  --pad: clamp(8px, 1.6vmin, 20px);
  --gap: clamp(8px, 1.4vmin, 20px);
  --side-min: clamp(236px, 21vw, 320px);
  --avail-h: calc(100dvh - var(--bar) - 2 * var(--pad));
  --canvas-w: min(calc(100vw - var(--side-min) - var(--gap) - 2 * var(--pad)), calc(var(--avail-h) * 16 / 9));
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--ink); font: 15px/1.45 Body, system-ui, sans-serif; }
button { font: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.bar { height: var(--bar); display: flex; align-items: center; gap: 12px; padding: 0 var(--pad); border-bottom: 1px solid var(--line); }
.wordmark { font: 800 21px Display, sans-serif; letter-spacing: -.05em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.wordmark span { color: var(--pink); }
.title { font: 800 16px Display, sans-serif; flex: 1; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { font: 700 11px Pixel, monospace; color: var(--green); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.chip { background: #0e0d14; color: #d7d3df; border: 1px solid #2c2a38; border-radius: 999px; padding: 6px 13px; font-size: 12px; white-space: nowrap; }
.chip:hover { border-color: #4a4660; }
.stage { height: calc(100dvh - var(--bar)); display: flex; gap: var(--gap); padding: var(--pad); justify-content: center; }
.screen { flex: 0 0 var(--canvas-w); width: var(--canvas-w); height: var(--avail-h); display: flex; align-items: center; position: relative; min-width: 0; }
.screen canvas { width: 100%; height: auto; aspect-ratio: 16 / 9; display: block; background: #05050a; border-radius: clamp(8px, 1.2vmin, 14px); border: 1px solid #16151e; }
.side { flex: 1 1 var(--side-min); min-width: var(--side-min); max-width: 560px; height: var(--avail-h); display: flex; flex-direction: column; gap: clamp(6px, 1.1vh, 12px); background: #07070c; border: 1px solid var(--line); border-radius: 18px; padding: clamp(10px, 1.6vh, 18px); overflow: hidden; }
.join-card { display: flex; flex-direction: column; align-items: center; gap: clamp(4px, .8vh, 10px); }
.eyebrow { font: 700 10px Pixel, monospace; letter-spacing: .12em; color: var(--cyan); text-transform: uppercase; align-self: stretch; }
.qr { width: min(100%, 34vh, 360px); aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 8px; display: grid; place-items: center; }
.qr svg { width: 100%; height: 100%; display: block; }
.code { font: 700 clamp(20px, 3.4vh, 32px) Pixel, monospace; letter-spacing: .14em; color: var(--gold); line-height: 1; }
.how { color: var(--muted); font-size: 12.5px; margin: 0; text-align: center; }
.how a { color: var(--cyan); }
.modes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mode { font: 700 10px Pixel, monospace; letter-spacing: .08em; text-transform: uppercase; border-radius: 999px; padding: 4px 10px; border: 1px solid; }
.mode.wheel { color: var(--gold); border-color: #ffd16655; }
.mode.flight { color: var(--cyan); border-color: #3fd0ff55; }
.mode.gamepad { color: #c9c4d6; border-color: #3a3746; }
.start-row { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.go { background: linear-gradient(#ff5cbc, #d92d8e); color: #1a0612; border: 0; border-radius: 999px; padding: clamp(9px, 1.4vh, 13px) 22px; font: 800 clamp(16px, 2.2vh, 19px) Display, sans-serif; letter-spacing: .01em; box-shadow: 0 0 24px #ff3fae55; }
.go:hover:not(:disabled) { filter: brightness(1.08); }
.start-hint { margin: 0; text-align: center; font: 700 10px Pixel, monospace; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.cpu { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 700 10px Pixel, monospace; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.stepper { display: inline-flex; align-items: center; border: 1px solid #2c2a38; border-radius: 999px; overflow: hidden; }
.stepper button { background: #0e0d14; color: var(--ink); border: 0; width: 32px; height: 30px; font-size: 18px; }
.stepper output { min-width: 26px; text-align: center; font: 700 14px Pixel, monospace; color: var(--gold); }
.side h3 { font: 700 10px Pixel, monospace; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; margin: 2px 0 0; }
.players { list-style: none; padding: 0; margin: 0; flex: 1 1 auto; min-height: 0; overflow: auto; }
.players li { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid #14131b; font-size: 13.5px; }
.players li.empty { color: var(--muted); }
.players i { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }
.players .name { flex: 1; overflow-wrap: anywhere; }
.players .route { font: 700 9px Pixel, monospace; letter-spacing: .06em; color: var(--green); text-transform: uppercase; }
.players button { border: 0; background: none; color: #6f6a7d; font-size: 17px; line-height: 1; }
.side-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.message { min-height: 0; margin: 0; color: var(--gold); font-size: 12.5px; }
.message:empty { display: none; }
.local-private { position: absolute; left: 12px; bottom: 12px; max-width: min(440px, 60%); max-height: 70%; overflow: auto; background: #09090fef; border: 1px solid #22202c; border-radius: 14px; padding: 14px 16px; }
.local-private h3 { margin: 0 0 6px; font: 800 15px Display, sans-serif; }
.local-private p { margin: 6px 0; color: #c9c4d6; font-size: 13px; }
.local-private input { background: #000; color: var(--ink); border: 1px solid #2c2a38; border-radius: 8px; padding: 7px 9px; width: 170px; margin-right: 6px; }
.local-private .chip { margin: 4px 6px 0 0; }
.picker { position: fixed; inset: 0; background: #000000f2; overflow: auto; z-index: 10; }
.picker-inner { max-width: 1180px; margin: 0 auto; padding: clamp(20px, 5vh, 48px) 24px; }
.picker h1 { font: 800 clamp(30px, 5vh, 46px) Display, sans-serif; letter-spacing: -.04em; margin: 0; }
.picker > .picker-inner > p { color: var(--muted); margin: 8px 0 clamp(14px, 3vh, 28px); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { text-align: left; background: #08080d; border: 1px solid #1d1c26; border-radius: 18px; overflow: hidden; padding: 0; color: var(--ink); display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.card:hover { border-color: #4a4660; transform: translateY(-2px); }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #05050a; }
.card .body { padding: 14px 16px 16px; }
.card .genre { font: 700 10px Pixel, monospace; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.card h2 { font: 800 24px Display, sans-serif; letter-spacing: -.03em; margin: 6px 0 6px; }
.card p { color: #a9a4b5; font-size: 13px; margin: 0 0 12px; }
.card .modes { justify-content: flex-start; }
[hidden] { display: none !important; }
/* Short windows: keep the essentials (QR, code, Start, players). */
@media (max-height: 760px) { .how { display: none; } }
@media (max-height: 620px) { .modes, .eyebrow, .start-hint { display: none; } .side-actions .chip { padding: 4px 10px; } }
/* Tall, narrow screens (a tablet held upright): the game on top, the panel below in two columns. */
@media (max-aspect-ratio: 11/10) {
  :root { --canvas-w: calc(100vw - 2 * var(--pad)); }
  .stage { flex-direction: column; justify-content: flex-start; }
  .screen { flex: 0 0 auto; height: auto; }
  .side { flex: 1 1 auto; height: auto; min-height: 0; max-width: none; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-rows: min-content; column-gap: var(--gap); }
  .join-card { grid-row: span 7; }
  .qr { width: min(100%, 40vw, 34vh); }
  .players { max-height: 30vh; }
  .cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) { .bar { gap: 8px; } .status, #fullscreen { display: none; } .cards { grid-template-columns: 1fr; } }
