/* =====================================================================
 * Suite Space Runner — mission control design system
 * ---------------------------------------------------------------------
 * Everything is self-hosted. No web fonts, no CDNs, no external requests:
 * a trade show hall is exactly where a blocked CDN ruins your demo.
 * ===================================================================== */

:root {
  /* Brand — carried over from the original canvas palette */
  --bg:          #040710;
  --surface:     #0d0f19;
  --surface-2:   #11141c;
  --surface-3:   #171b26;
  --line:        #232838;
  --line-bright: #37405a;

  --white:  #ffffff;
  --text:   #e8ebf5;
  --muted:  #8c93a8;
  --dim:    #5c6379;

  --blue:   #325ae7;
  --blue-2: #5b7ef0;
  --blue-dk:#1e3aa8;
  --green:  #31ba7e;
  --red:    #f64f59;
  --amber:  #d1a60b;

  --glow-blue:  0 0 0 1px rgba(50,90,231,.5), 0 0 24px rgba(50,90,231,.28);
  --glow-green: 0 0 0 1px rgba(49,186,126,.5), 0 0 24px rgba(49,186,126,.25);

  --mono: ui-monospace, 'SF Mono', SFMono-Regular, 'Cascadia Mono', Menlo,
          Consolas, 'Liberation Mono', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto,
          'Helvetica Neue', Arial, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  --pad: clamp(16px, 4vw, 32px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

/* Ambient starfield + grid. Pure CSS so there's nothing to load. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1.2px 1.2px at 12% 22%, rgba(255,255,255,.55) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 78% 14%, rgba(255,255,255,.42) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 34% 68%, rgba(255,255,255,.38) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 88% 74%, rgba(255,255,255,.45) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 55% 41%, rgba(255,255,255,.30) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 22% 88%, rgba(255,255,255,.36) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 66% 92%, rgba(255,255,255,.28) 50%, transparent 51%),
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(50,90,231,.16), transparent 70%),
    linear-gradient(rgba(35,40,56,.28) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(35,40,56,.28) 1px, transparent 1px) 0 0 / 44px 100%;
}

/* ---------------------------------------------------------------------
 * Layout
 * ------------------------------------------------------------------- */

.shell {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: var(--pad) var(--pad) 56px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.shell--wide { max-width: 1200px; }

/* ---------------------------------------------------------------------
 * Masthead
 * ------------------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.masthead__badge {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(50,90,231,.45));
}

.masthead__text { min-width: 0; }

.masthead__title {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(19px, 4.4vw, 27px);
  font-weight: 800;
  letter-spacing: .10em;
  text-transform: uppercase;
  line-height: 1.05;
  background: linear-gradient(180deg, #fff 30%, #9fb4f5 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.masthead__sub {
  margin: 5px 0 0;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------------------------------------------------------------------
 * Panels — HUD frames with corner brackets
 * ------------------------------------------------------------------- */

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(18px, 4.5vw, 30px);
  margin-bottom: 18px;
}

/* Bracketed corners read as instrumentation without costing a request. */
.panel::before,
.panel::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid var(--blue);
  opacity: .65;
  pointer-events: none;
}
.panel::before { top: -1px; left: -1px;  border-right: 0; border-bottom: 0; border-radius: var(--r-lg) 0 0 0; }
.panel::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0;  border-radius: 0 0 var(--r-lg) 0; }

.panel__label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--blue-2);
  margin-bottom: 18px;
}
.panel__label::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--blue);
  box-shadow: 0 0 10px var(--blue);
  border-radius: 1px;
  transform: rotate(45deg);
}
.panel__label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-bright), transparent);
}

.panel--flush { padding: 0; overflow: hidden; }

/* ---------------------------------------------------------------------
 * Typography
 * ------------------------------------------------------------------- */

h1, h2, h3 { font-family: var(--sans); font-weight: 800; letter-spacing: .04em; }

.headline {
  margin: 0 0 10px;
  font-size: clamp(24px, 6vw, 38px);
  line-height: 1.08;
  text-transform: uppercase;
  color: var(--white);
}

.lede {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
}

.kbd {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--line-bright);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-3);
  font-size: 11px;
  color: var(--text);
}

/* ---------------------------------------------------------------------
 * Forms
 * ------------------------------------------------------------------- */

.field { margin-bottom: 18px; }

.field__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.field__optional {
  letter-spacing: .1em;
  color: var(--dim);
  text-transform: none;
  font-size: 10px;
}

.input {
  width: 100%;
  padding: 14px 15px;
  background: var(--bg);
  border: 1px solid var(--line-bright);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;              /* 16px stops iOS zooming on focus */
  line-height: 1.3;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #454b5e; }
.input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--glow-blue);
}
.input[aria-invalid='true'] {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(246,79,89,.4);
}

.field__error {
  display: none;
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--red);
}
.field__error.is-shown { display: block; }

.checkbox {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}
.checkbox input {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin: 1px 0 0;
  accent-color: var(--blue);
  cursor: pointer;
}

/* ---------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 22px;
  border: 0;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--blue-2), var(--blue));
  color: #fff;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--blue-dk), 0 12px 28px rgba(50,90,231,.32);
  transition: transform .1s, box-shadow .1s, filter .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover  { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--blue-dk), 0 6px 16px rgba(50,90,231,.3); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: grayscale(.4); }
.btn:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 3px; }

.btn--ghost {
  background: transparent;
  border: 1px solid var(--line-bright);
  color: var(--muted);
  box-shadow: none;
  font-weight: 700;
}
.btn--ghost:active { transform: none; box-shadow: none; }
.btn--ghost:hover  { border-color: var(--blue); color: var(--text); }

.btn--green {
  background: linear-gradient(180deg, #46d295, var(--green));
  box-shadow: 0 6px 0 #1d7d52, 0 12px 28px rgba(49,186,126,.3);
}
.btn--green:active { box-shadow: 0 2px 0 #1d7d52, 0 6px 16px rgba(49,186,126,.28); }

.btn--sm { width: auto; padding: 11px 18px; font-size: 12px; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 190px; width: auto; }

/* ---------------------------------------------------------------------
 * Game stage
 * ------------------------------------------------------------------- */

.stage {
  position: relative;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(50,90,231,.16);
  touch-action: none;            /* we own all touch gestures in here */
  user-select: none;
  -webkit-user-select: none;
}

/* The playfield is a fixed 720x1080, so at full shell width it would render
 * ~1170px tall — taller than most laptop viewports, forcing you to scroll
 * mid-game. Fit it to the shorter of available width and viewport height;
 * `aspect-ratio` (set by the engine) keeps the shape while both max-*
 * constraints apply. Scaling down is safe because the logical playfield
 * never changes — every player still gets the identical field. */
.stage {
  display: flex;
  justify-content: center;
}

.stage canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100dvh - 140px);
}

/* Older browsers without dvh units — dvh is what makes this correct on
 * mobile Safari, where the toolbar changes the usable height. */
@supports not (height: 100dvh) {
  .stage canvas { max-height: calc(100vh - 140px); }
}

/* While playing, the masthead and sponsor strip step aside so the whole
 * playfield fits on screen without scrolling. Branding is already carried
 * by the badge on the game's own launch-pad screen. */
body.is-playing .masthead,
body.is-playing .sponsors { display: none; }

body.is-playing .shell { justify-content: center; }

/* On phones the game also goes full-bleed horizontally. The canvas keeps
 * its fixed 720x1080 aspect — stretching it to fill would change the
 * playfield, and every player has to face the same game for the
 * leaderboard to mean anything. */
@media (max-width: 640px) {
  body.is-playing .shell {
    padding: 0;
    max-width: none;
  }
  body.is-playing .stage {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  body.is-playing #gameControls {
    padding: 0 16px;
    margin-top: 16px;
  }
}

.stage__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: rgba(4,7,16,.82);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.stage__overlay[hidden] { display: none; }

/* ---------------------------------------------------------------------
 * Score readout / result
 * ------------------------------------------------------------------- */

.readout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 22px;
}

.readout__cell {
  background: var(--surface-2);
  padding: 16px 14px;
  text-align: center;
}

.readout__k {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 7px;
}

.readout__v {
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.readout__v--green { color: var(--green); }
.readout__v--amber { color: var(--amber); }

/* Big final score */
.score-hero {
  text-align: center;
  padding: 8px 0 26px;
}
.score-hero__k {
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 12px;
}
.score-hero__v {
  font-family: var(--sans);
  font-size: clamp(58px, 18vw, 104px);
  font-weight: 900;
  line-height: .92;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff 20%, var(--blue-2) 115%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 34px rgba(50,90,231,.5));
}

.score-hero__rank {
  margin-top: 14px;
  font-size: 15px;
  letter-spacing: .06em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.badge-pill--green { background: rgba(49,186,126,.14); color: var(--green); border: 1px solid rgba(49,186,126,.42); }
.badge-pill--amber { background: rgba(209,166,11,.14); color: var(--amber); border: 1px solid rgba(209,166,11,.42); }
.badge-pill--blue  { background: rgba(50,90,231,.16);  color: var(--blue-2); border: 1px solid rgba(50,90,231,.45); }

/* ---------------------------------------------------------------------
 * Booth call-to-action — the commercial heart of the thing
 * ------------------------------------------------------------------- */

.booth {
  position: relative;
  border: 1px solid rgba(209,166,11,.4);
  border-radius: var(--r-lg);
  background:
    radial-gradient(ellipse 90% 130% at 50% 0%, rgba(209,166,11,.12), transparent 65%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  padding: clamp(20px, 5vw, 32px);
  text-align: center;
  margin-bottom: 18px;
  overflow: hidden;
}

/* Required-step treatment: a slow amber pulse on the border plus a badge.
 * This block is the entire reason people walk to the booth — it's allowed
 * to be the loudest thing on the page. */
.booth--urgent {
  animation: boothPulse 2.6s ease-in-out infinite;
}
@keyframes boothPulse {
  0%, 100% { border-color: rgba(209,166,11,.4);  box-shadow: 0 0 0 0 rgba(209,166,11,0); }
  50%      { border-color: rgba(209,166,11,.85); box-shadow: 0 0 34px 0 rgba(209,166,11,.22); }
}

.booth__step {
  display: inline-block;
  margin-bottom: 16px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--amber);
  color: #1a1503;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* Slow sweep, like a radar wipe. Respects reduced-motion below. */
.booth::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent);
  animation: sweep 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sweep { 0% { left: -60%; } 55%, 100% { left: 120%; } }

.booth__eyebrow {
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}

.booth__number {
  font-family: var(--sans);
  font-size: clamp(46px, 14vw, 78px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.01em;
  color: var(--white);
  text-shadow: 0 0 44px rgba(209,166,11,.5);
  margin: 0 0 6px;
}

.booth__where {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 22px;
}

.booth__why {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
  max-width: 46ch;
  margin: 0 auto 22px;
}

/* The raffle code — deliberately the most legible thing on the page,
   because booth staff will be typing it off a stranger's phone. */
.ticket {
  display: inline-block;
  padding: 16px 26px;
  border: 2px dashed rgba(209,166,11,.55);
  border-radius: var(--r-md);
  background: rgba(209,166,11,.07);
}
.ticket__k {
  font-size: 10px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 9px;
}
.ticket__v {
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--amber);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.prize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 22px 0 0;
  text-align: left;
}
.prize {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-3);
  padding: 15px 16px;
}
.prize__k {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 7px;
}
.prize__k--gold  { color: var(--amber); }
.prize__k--green { color: var(--green); }
.prize__v { font-size: 13.5px; line-height: 1.5; color: var(--text); }
.prize__note { font-size: 11.5px; color: var(--dim); margin-top: 6px; line-height: 1.5; }

/* ---------------------------------------------------------------------
 * Leaderboard
 * ------------------------------------------------------------------- */

.board { width: 100%; border-collapse: collapse; }

.board th {
  padding: 12px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
}
.board th:last-child, .board td:last-child { text-align: right; }

.board td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(35,40,56,.6);
  font-size: 14px;
  color: var(--text);
}
.board tr:last-child td { border-bottom: 0; }

.board__rank {
  width: 56px;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  font-size: 13px;
}
.board__score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--white);
}
.board__name { font-weight: 500; }

.board tr.is-you td { background: rgba(50,90,231,.14); }
.board tr.is-you .board__name::after {
  content: 'YOU';
  margin-left: 9px;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--blue);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  vertical-align: middle;
}

/* Medals for the podium */
.board tr:nth-child(1) .board__rank { color: #f2c43d; font-weight: 700; }
.board tr:nth-child(2) .board__rank { color: #c9d0e0; font-weight: 700; }
.board tr:nth-child(3) .board__rank { color: #d08a4a; font-weight: 700; }

.board__empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--dim);
  font-size: 13px;
}

/* ---------------------------------------------------------------------
 * Sponsors
 * ------------------------------------------------------------------- */

.sponsors {
  margin-top: auto;
  padding-top: 30px;
  text-align: center;
}

.sponsors__label {
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 16px;
}

.sponsors__presenting {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  text-decoration: none;
  color: var(--text);
}
.sponsors__presenting img { height: 42px; width: auto; object-fit: contain; }
.sponsors__presenting span {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sponsors__strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 5vw, 40px);
}
.sponsors__strip a, .sponsors__strip span {
  display: inline-flex;
  align-items: center;
  opacity: .62;
  transition: opacity .2s;
  text-decoration: none;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.sponsors__strip a:hover { opacity: 1; }
.sponsors__strip img {
  height: 26px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1) brightness(1.7);
}
.sponsors__strip a:hover img { filter: none; }

/* ---------------------------------------------------------------------
 * Status line / toasts
 * ------------------------------------------------------------------- */

.status {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: center;
  margin-top: 14px;
  font-size: 12px;
  color: var(--dim);
  min-height: 18px;
}
.status__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--dim);
  flex: 0 0 auto;
}
.status--ok   .status__dot { background: var(--green); box-shadow: 0 0 9px var(--green); }
.status--warn .status__dot { background: var(--amber); box-shadow: 0 0 9px var(--amber); }
.status--err  .status__dot { background: var(--red);   box-shadow: 0 0 9px var(--red); }
.status--ok   { color: var(--green); }
.status--warn { color: var(--amber); }
.status--err  { color: var(--red); }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------
 * Screens
 * ------------------------------------------------------------------- */

.screen { display: none; animation: fade .3s ease both; }
.screen.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------
 * Big-screen leaderboard (booth TV)
 * ------------------------------------------------------------------- */

body.bigscreen .shell { max-width: 1500px; padding: 3vh 3vw; }
body.bigscreen .masthead__title { font-size: clamp(28px, 3.6vw, 58px); }
body.bigscreen .masthead__badge { width: clamp(60px, 7vw, 104px); height: auto; }
body.bigscreen .board td { padding: clamp(10px, 1.5vh, 22px) 20px; font-size: clamp(16px, 2.1vw, 32px); }
body.bigscreen .board th { font-size: clamp(10px, 1vw, 15px); padding: 14px 20px; }
body.bigscreen .board__rank { width: clamp(60px, 6vw, 120px); font-size: clamp(16px, 2.1vw, 32px); }

/* ---------------------------------------------------------------------
 * Admin
 * ------------------------------------------------------------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}
.toolbar .input { width: auto; flex: 1 1 220px; padding: 11px 13px; font-size: 14px; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 15px 16px;
}
.stat__k { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.stat__v { font-size: 26px; font-weight: 700; color: var(--white); font-variant-numeric: tabular-nums; line-height: 1; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll .board { min-width: 860px; }
.table-scroll .board td { font-size: 13px; white-space: nowrap; }

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.tag--in  { background: rgba(49,186,126,.16); color: var(--green); }
.tag--out { background: rgba(140,147,168,.14); color: var(--dim); }

.warn-box {
  border: 1px solid rgba(209,166,11,.4);
  background: rgba(209,166,11,.07);
  border-radius: var(--r-md);
  padding: 15px 17px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 20px;
}
.warn-box strong { color: var(--amber); }

/* ---------------------------------------------------------------------
 * Utilities / accessibility
 * ------------------------------------------------------------------- */

.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 14px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a { color: var(--blue-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
