/* Livery Edition in-game frame. Single source for all eight game pages; Trunk
   copies it into each game's dist/<slug>/ via <link data-trunk rel="css">.
   Transcribed from designs/design_handoff_games_library_livery/4a-game-frame.html,
   with the frame going full-bleed instead of a centred 960px artboard. */

/* Chakra Petch, self-hosted (latin subset, italic only). The files come from
   web/static/fonts/, copied in beside this stylesheet by rel="copy-dir". */
@font-face {
  font-family: 'Chakra Petch';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/chakra-petch-italic-400.woff2) format('woff2');
}
@font-face {
  font-family: 'Chakra Petch';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/chakra-petch-italic-600.woff2) format('woff2');
}
@font-face {
  font-family: 'Chakra Petch';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/chakra-petch-italic-700.woff2) format('woff2');
}

:root {
  color-scheme: dark;
  --navy: #0f2350;
  --gold: #c9a227;
  --garnet: #a81d42;
  --viridian: #157f5f;
  --text: #e9ecf4;
  --muted: rgba(233, 236, 244, 0.55);
  --hairline: rgba(255, 255, 255, 0.25);
}
/* Hard edges everywhere: the zero radius is part of the direction. */
* { box-sizing: border-box; border-radius: 0; }

/* The frame owns the viewport: a fixed 100vh column that never scrolls, so
   winit's startup canvas.focus() has no scrollable ancestor to jump. */
body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  background: var(--navy);
  color: var(--text);
  font-family: 'Chakra Petch', system-ui, sans-serif;
}
.frame { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Livery band */
.band { height: 8px; display: flex; flex: none; }
.band .b1 { flex: 6; background: var(--gold); }
.band .b2 { flex: 2; background: var(--garnet); }
.band .b3 { flex: 1; background: var(--viridian); }

/* Top chrome */
.chrome { display: flex; align-items: center; gap: 18px; padding: 14px 22px; flex: none; flex-wrap: wrap; }
.back {
  font-weight: 700;
  font-style: italic;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--gold);
  color: var(--navy);
  padding: 8px 20px 8px 14px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.back:hover { background: #dbb62f; color: var(--navy); }
.divider { width: 1.5px; height: 22px; background: var(--hairline); transform: skewX(-20deg); flex: none; }
.title { margin: 0; font-weight: 700; font-style: italic; font-size: 16px; text-transform: uppercase; letter-spacing: 0.5px; }
.session { font-size: 12px; font-style: italic; color: var(--muted); }
.controls { margin-left: auto; display: flex; gap: 12px; }
.controls button,
.controls .quit {
  font-family: inherit;
  font-size: 12px;
  font-style: italic;
  color: rgba(233, 236, 244, 0.85);
  background: none;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  padding: 6px 12px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.controls button:hover { border-color: var(--gold); color: var(--gold); }
/* The client un-hides #copy-link once a room exists; keep it hidden until then. */
.controls button[hidden] { display: none; }
.controls .quit { background: var(--garnet); border-color: var(--garnet); color: var(--text); }
.controls .quit:hover { background: #c22450; border-color: #c22450; color: var(--text); }
/* The invite button takes the supporting viridian, filled the way .quit is
   filled with garnet. Text only — the client replaces the whole text content
   with "Copied!" on click, so an icon child would be wiped. */
#copy-link { background: var(--viridian); border-color: var(--viridian); color: var(--text); }
#copy-link:hover { background: #1a9a73; border-color: #1a9a73; color: var(--text); }

/* Stage + viewport. The stage is a size container so the viewport can take the
   larger of the two fits without ever distorting: width is the smaller of the
   stage width and (stage height x the game's ratio). content-box sizing keeps
   the ratio on the canvas area rather than the border box. */
.stage {
  flex: 1;
  min-height: 0;
  padding: 0 22px;
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewport {
  box-sizing: content-box;
  width: min(100cqw - 3px, calc(100cqh * var(--ar)) - 3px, var(--max-w, 960px));
  aspect-ratio: var(--ar);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: #000;
  position: relative;
}
@supports not (container-type: size) {
  /* 132px = band + chrome + status strip. */
  .viewport { width: min(100%, calc((100vh - 132px) * var(--ar)), var(--max-w, 960px)); }
}
/* The border lives on the wrapper, never on the canvas: mouse input is relative
   to the padding edge and touch to the border edge, so an inset canvas skews
   clicks. */
.viewport canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.viewport:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; display: grid; place-items: center; }
.viewport:fullscreen canvas {
  position: static;
  width: min(100vw, calc(100vh * var(--ar)));
  aspect-ratio: var(--ar);
  height: auto;
}

/* Status strip */
.status { display: flex; align-items: center; gap: 12px; padding: 12px 22px 16px; flex: none; min-height: 52px; }
.tick { height: 5px; transform: skewX(-20deg); flex: none; }
.t1 { width: 42px; background: var(--garnet); }
.t2 { width: 20px; background: var(--gold); }
.t3 { width: 10px; background: var(--viridian); }
/* The reference's .meta slot, minus its uppercase: these are real sentences
   (Backgammon's is a long key-hints line) and shouting them reads badly. */
#status {
  margin: 0;
  margin-left: auto;
  text-align: right;
  font-style: italic;
  font-size: 12px;
  color: rgba(233, 236, 244, 0.5);
  letter-spacing: 1px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
