/* Night-arena look: one wide pixel-art canvas (the bench, seen from the ice), with an RPG-style dialog box underneath. */
:root {
  --night: #0c0e1c;
  --panel: #151a34;
  --line: #2d3566;
  --ink: #eef1fb;
  --muted: #9aa4cc;
  --amber: #ffcf3f;
  --hurt: #ff5f5f;
  --ok: #6fe39a;
  --pix: "Press Start 2P", ui-monospace, "Courier New", monospace;
  --term: "VT323", ui-monospace, "Courier New", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--night); }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--term);
  font-size: 22px;
  line-height: 1.15;
}
[hidden] { display: none !important; }
a { color: var(--amber); }
a:focus-visible { outline: 3px dashed var(--amber); outline-offset: 2px; }
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-block: 20px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid;
  gap: 18px;
}
header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
h1 { font-family: var(--pix); font-size: clamp(16px, 3vw, 26px); margin: 0; letter-spacing: 1px; color: var(--amber); text-shadow: 3px 3px 0 #7a3b00; }
.tag { font-family: var(--pix); font-size: 10px; color: var(--night); background: var(--amber); padding: 6px 8px; letter-spacing: 1px; }
.tag.live { background: var(--ok); }
.tag.stale { background: var(--hurt); }
.intro { display: grid; gap: 8px; flex-basis: 100%; }
.lead { margin: 0; font-size: 26px; max-width: 52ch; }
.sub { margin: 0; color: var(--muted); max-width: 70ch; }
.seatbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: -4px; }
.seatlabel { font-family: var(--pix); font-size: 10px; letter-spacing: 1px; color: var(--amber); }
.seatbar .switch { min-width: min(100%, 320px); }

.stage { position: relative; border: 4px solid var(--ink); box-shadow: 0 0 0 4px var(--night), 0 0 0 8px var(--line); background: #000; }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; image-rendering: crisp-edges; cursor: grab; touch-action: pan-y; }
canvas.dragging { cursor: grabbing; }
canvas:focus-visible { outline: 3px dashed var(--amber); outline-offset: 4px; }

.below { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 760px) { .below { grid-template-columns: minmax(0, 1fr); } }

.dialog {
  background: var(--panel);
  border: 4px solid var(--ink);
  box-shadow: inset 0 0 0 4px var(--panel), inset 0 0 0 6px var(--line);
  padding: 18px 20px 20px;
  display: grid; gap: 12px; min-width: 0; align-content: start;
}
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.who-text { min-width: 0; }
.num { font-family: var(--pix); font-size: 14px; padding: 8px 8px 6px; min-width: 44px; text-align: center; background: var(--line); }
.name { font-family: var(--pix); font-size: clamp(13px, 2vw, 18px); line-height: 1.4; overflow-wrap: anywhere; }
.team { color: var(--muted); }
.injury { font-size: 28px; color: var(--hurt); min-height: 1.2em; overflow-wrap: anywhere; }
.injury .cursor { display: inline-block; width: .5em; background: var(--hurt); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 18px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-family: var(--pix); font-size: 9px; color: var(--muted); letter-spacing: 1px; margin-bottom: 4px; text-transform: uppercase; }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.facts .small { color: var(--muted); font-size: 19px; }
.meter { display: flex; gap: 3px; margin-top: 4px; }
.meter i { flex: 1; height: 12px; background: var(--line); }
.meter i.on { background: var(--ok); }
.chip { display: inline-block; font-family: var(--pix); font-size: 9px; padding: 5px 6px 4px; letter-spacing: 1px; color: var(--night); }
.quote { margin: 0; padding-left: 12px; border-left: 4px solid var(--line); }
.quote .by { color: var(--muted); font-size: 19px; }
.note { color: var(--muted); font-size: 19px; margin: 0; }
.dialog .note.flag { color: var(--amber); }
.sources { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 19px; color: var(--muted); }
.sources b { font-family: var(--pix); font-size: 9px; font-weight: normal; letter-spacing: 1px; color: var(--muted); align-self: center; }

.side { display: grid; gap: 14px; align-content: start; min-width: 0; }
.box { border: 4px solid var(--line); padding: 14px 16px; display: grid; gap: 12px; }
.box h2 { font-family: var(--pix); font-size: 10px; letter-spacing: 1px; margin: 0; color: var(--amber); }
.keys { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.keys li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
kbd { font-family: var(--pix); font-size: 10px; background: var(--ink); color: var(--night); padding: 5px 7px 4px; box-shadow: 0 3px 0 var(--muted); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
button {
  font-family: var(--pix); font-size: 10px; letter-spacing: 1px;
  background: var(--ink); color: var(--night); border: 0; padding: 10px 12px 9px;
  box-shadow: 0 4px 0 var(--muted); cursor: pointer;
}
button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--muted); }
button:focus-visible { outline: 3px dashed var(--amber); outline-offset: 3px; }
.switch { display: grid; grid-template-columns: 1fr 1fr; border: 3px solid var(--ink); }
.switch button { box-shadow: none; background: transparent; color: var(--ink); }
.switch button[aria-pressed="true"] { background: var(--amber); color: var(--night); }
.switch button:active { transform: none; }
footer { display: grid; gap: 6px; color: var(--muted); font-size: 19px; }
footer p { margin: 0; max-width: 80ch; }
footer .fine { font-size: 17px; opacity: .8; }
.gamebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; border: 4px solid var(--line); padding: 10px 14px; margin-top: 4px; }
.gamebar.hot { border-color: var(--hurt); }
.gamebar p { margin: 0; flex: 1 1 320px; min-width: 0; }
.gamebar strong { color: var(--amber); font-weight: normal; }
.gamebar .go, .pad .go { background: var(--hurt); color: var(--night); box-shadow: 0 4px 0 #8c2a2a; }
.pad .block { background: #6fd3ff; color: var(--night); box-shadow: 0 4px 0 #2b6c8c; }
.pad { display: flex; flex-wrap: wrap; gap: 8px; }
.pad button { min-width: 56px; padding: 14px 14px 12px; touch-action: none; user-select: none; -webkit-user-select: none; }
.style { margin: 0; font-size: 19px; color: var(--ink); border-top: 2px dashed var(--line); padding-top: 10px; }
.style b { font-family: var(--pix); font-size: 9px; font-weight: normal; letter-spacing: 1px; color: var(--hurt); margin-right: 6px; }
@media (prefers-reduced-motion: reduce) { .injury .cursor { animation: none; } }
