/* Cabinet styling shared by the hub and every game. */
/* From the brand kit (media kit / brand-tokens.css). The cabinets keep their
   own palettes, which are per-game and live in their JavaScript - these are
   the site's. */
:root {
  --bg: #090810;
  --midnight: #100D20;
  --panel: #19132D;
  --ink: #F5F0FF;
  --dim: #A39AB8;
  --yellow: #FFE64A;
  --red: #ff4b5c;
  --cyan: #47DEF5;
  --pink: #F279C6;
  --lime: #AFE83E;
  --line: #241d38;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 50% 0%, #1a1430 0%, transparent 55%),
    radial-gradient(circle at 15% 100%, #150f26 0%, transparent 45%),
    var(--bg);
  color: var(--ink);
  font-family: "DejaVu Sans Mono", ui-monospace, "Cascadia Mono", "Consolas", monospace;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); }

/* ------------------------------------------------------------------ cabinet */
.cabinet {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
}

.screen-wrap {
  position: relative;
  display: inline-block;
  border-radius: 18px;
  padding: 10px;
  background: linear-gradient(180deg, #171125, #0c0914);
  box-shadow:
    0 0 0 1px #2b2141,
    0 0 40px rgba(85, 230, 255, 0.08),
    0 22px 60px rgba(0, 0, 0, 0.8);
}

body[data-game="brickstorm"] .screen-wrap canvas { touch-action: none; }

.screen-wrap canvas {
  display: block;
  background: #000;
  border-radius: 10px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
  cursor: pointer;
}

.scanlines {
  pointer-events: none;
  position: absolute;
  inset: 10px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.22) 0px,
      rgba(0, 0, 0, 0.22) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: multiply;
  opacity: 0.7;
}

.vignette {
  pointer-events: none;
  position: absolute;
  inset: 10px;
  border-radius: 10px;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.hint {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
  line-height: 1.9;
}

.kbd {
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
}

/* -------------------------------------------------------------------- touch */
.touch {
  display: none;
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(3, 54px);
  gap: 6px;
  justify-content: center;
  touch-action: none;
  user-select: none;
}

.touch button {
  appearance: none;
  border: 1px solid #2f2549;
  background: linear-gradient(180deg, #1c1530, #120d20);
  color: var(--cyan);
  border-radius: 12px;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.touch button:active {
  background: #2a2045;
  transform: translateY(1px);
}

.touch .up { grid-area: 1 / 2; }
.touch .left { grid-area: 2 / 1; }
.touch .down { grid-area: 3 / 2; }
.touch .right { grid-area: 2 / 3; }

@media (pointer: coarse) {
  .touch { display: grid; }
  .hint .desktop-only { display: none; }
}

/* ----------------------------------------------------------- block drop pad */
.touch-pads {
  display: none;
  justify-content: center;
  align-items: flex-start;
  gap: 14px;
  touch-action: none;
  user-select: none;
}

.touch-pad {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  gap: 5px;
}

.touch-pad .pad-name {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.touch-pad button {
  appearance: none;
  height: 34px;
  padding: 0;
  border: 1px solid #2f2549;
  border-radius: 9px;
  background: linear-gradient(180deg, #1c1530, #120d20);
  color: var(--cyan);
  font: inherit;
  font-size: 9px;
  letter-spacing: 0.06em;
  line-height: 1;
}

.touch-pad[data-player="1"] button { color: var(--pink); }
.touch-pad button.fire { color: var(--yellow); }

.touch-pad button:active {
  background: #2a2045;
  transform: translateY(1px);
}

@media (pointer: coarse) {
  .touch-pads { display: flex; }
  .touch-pads.is-solo .touch-pad[data-player="1"] { display: none; }
  .touch-pads.is-online .touch-pad[data-player="1"] { display: none; }
}

/* ---------------------------------------------------------------- developer */
.dev-tools {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
}

/* The panel ships hidden and is revealed only for an admin, or on the machine
   running the server. `display: flex` above would otherwise win against the
   hidden attribute. */
.dev-tools[hidden] {
  display: none;
}

.dev-toggle {
  appearance: none;
  padding: 3px 9px;
  border: 1px dashed #332a4d;
  border-radius: 4px;
  background: transparent;
  color: #6a6184;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

.dev-toggle:hover,
.dev-toggle:focus-visible,
.dev-toggle[aria-expanded="true"],
.dev-tools.is-dev .dev-toggle {
  color: var(--yellow);
  border-color: var(--yellow);
  outline: none;
}

.dev-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0914;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.dev-panel[hidden] { display: none; }

.dev-panel label {
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dev-panel input {
  width: 62px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #07060c;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: center;
}

.dev-panel input:focus {
  outline: none;
  border-color: var(--cyan);
}

.dev-panel button {
  appearance: none;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #171125;
  color: var(--cyan);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.dev-panel button:hover,
.dev-panel button:focus-visible {
  border-color: var(--cyan);
  color: var(--ink);
  outline: none;
}

.dev-note {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dev-speed {
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------- hub */
.hub {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

/* ------------------------------------------------------------- site chrome */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 10px 14px;
  background: var(--yellow);
  color: #14100a;
  border-radius: 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  z-index: 20;
}

.skip-link:focus {
  left: 8px;
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 6, 12, 0.82);
  backdrop-filter: blur(10px);
}

.site-head-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}

/* 180px is the smallest the kit allows the full logo. */
.brand-logo {
  width: 180px;
  height: 48px;
  flex: none;
  display: block;
}

.site-nav {
  display: flex;
  gap: 18px;
  margin-right: auto;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--dim);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--yellow);
  outline: none;
}

/* -------------------------------------------------------------------- hero */
.hero {
  text-align: center;
  padding: 16px 0 52px;
}

/* The kit's banner is the headline, so it is framed rather than overlaid. */
.hero-banner img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(71, 222, 245, 0.06), 0 22px 60px rgba(0, 0, 0, 0.6);
}

.hero .hero-kicker { margin-top: 28px; }

.hero-kicker {
  margin: 0;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.hero-tag {
  margin: 10px 0 0;
  color: var(--pink);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-lead {
  max-width: 54ch;
  margin: 20px auto 0;
  color: #a79dc2;
  font-size: 13px;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.hero-cta .btn {
  padding: 12px 22px;
  font-size: 12px;
}

.hero-facts {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 30px 0 0;
  padding: 0;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-facts li::before {
  content: "•";
  color: var(--cyan);
  margin-right: 8px;
}

/* ---------------------------------------------------------------- sections */
.section {
  margin-top: 56px;
}

.section-head {
  margin-bottom: 20px;
}

.section-head h2,
.section-head h1.section-title {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--yellow);
}

.section-head p {
  margin: 8px 0 0;
  max-width: 60ch;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.7;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.how-card {
  border: 1px solid var(--line);
  border-left: 2px solid #3d2f60;
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(160deg, #130e21, #0a0713);
}

.how-card h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.how-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  color: #a79dc2;
}

/* ------------------------------------------------------------------ footer */
.site-foot {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 44px 0 28px;
  background: rgba(7, 6, 12, 0.45);
}

.site-foot-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.foot-main {
  display: grid;
  grid-template-columns: minmax(230px, 1.7fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding-bottom: 32px;
}

.foot-tag {
  margin: 12px 0 18px;
  max-width: 30ch;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.6;
}

.foot-social {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.foot-social a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dim);
  font-size: 12px;
  text-decoration: none;
}

.foot-social a:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.foot-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
}

.foot-col h2 {
  margin: 0 0 3px;
  color: var(--yellow);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.foot-col a {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
}

.foot-col a:hover { color: var(--cyan); }

.foot-note {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: #6c6383;
  font-size: 11px;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .foot-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }

  /* Wrapped onto three rows the bar is ~135px tall, which is a sixth of a
     phone screen to give up permanently. Let it scroll away instead. */
  .site-head {
    position: static;
  }

  .site-head-inner {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    gap: 14px;
  }

  .account-bar {
    margin-bottom: 0;
    margin-left: auto;
  }

  .hero {
    padding: 8px 0 40px;
  }
}

.games-head { padding: 28px 0 24px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #171126, #0b0814);
  text-decoration: none;
  color: inherit;
  padding: 18px;
  min-height: 150px;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  border-color: #3d2f60;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  outline: none;
}

.card .tag {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}

.card h2 {
  margin: 8px 0 6px;
  font-size: 19px;
  letter-spacing: 0.06em;
}

.card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: #a79dc2;
}

.card .art {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  gap: 8px;
}

.card .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--yellow);
}

.card .wisp {
  width: 14px;
  height: 15px;
  clip-path: polygon(50% 0, 100% 42%, 78% 100%, 50% 78%, 22% 100%, 0 42%);
}

.card .brick-art {
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
}

.card .brick-row {
  display: flex;
  gap: 4px;
}

.card .brick {
  width: 18px;
  height: 7px;
  border-radius: 2px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.45);
}

.card .paddle-art {
  width: 54px;
  height: 5px;
  margin-top: 3px;
  border-radius: 3px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(85, 230, 255, 0.6);
}

.card.soon {
  opacity: 0.52;
  cursor: default;
}

.card.soon:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: none;
}

.card .badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #0b0814;
  background: var(--cyan);
  border-radius: 999px;
  padding: 3px 8px;
}

.card.soon .badge {
  background: #3a2f55;
  color: #b8aee0;
}

.hub-foot {
  margin-top: 44px;
  text-align: center;
  color: #6c6383;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------- accounts */
[hidden] { display: none !important; }

.btn {
  appearance: none;
  display: inline-block;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: #1a1330;
  border: 1px solid #33264f;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { border-color: #4c3a75; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--yellow); color: #14100a; border-color: var(--yellow); font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 10px; }

.account-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  min-height: 34px;
  margin-bottom: 10px;
}

.account-note {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 4px 4px 14px;
}

.account-name {
  text-decoration: none;
  color: var(--yellow);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}

.game-account {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  min-height: 20px;
}

.game-account #game-user { color: var(--ink); }
.game-account a { color: var(--cyan); text-decoration: none; }
.game-account #save-status { color: var(--yellow); }

/* ------------------------------------------------------------ leaderboard */
.board {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.board-head h2,
.board-head h1.section-title {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.board-head span {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.board-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.board-tab {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0d0a16;
  color: var(--dim);
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 11px;
  cursor: pointer;
}

.board-tab:hover,
.board-tab:focus-visible {
  color: var(--ink);
  border-color: #3d2f60;
  outline: none;
}

.board-tab.is-active {
  color: var(--yellow);
  border-color: var(--yellow);
  background: rgba(255, 225, 77, 0.06);
}

.board-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.board-row {
  display: grid;
  grid-template-columns: 34px 1fr 60px 92px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
}

.board-row .rank { color: #6c6383; }
.board-row .who { color: var(--ink); text-decoration: none; letter-spacing: 0.08em; }
.board-row .who:hover { color: var(--cyan); }
.board-row .lvl { color: var(--dim); font-size: 10px; letter-spacing: 0.12em; text-align: right; }
.board-row .pts { text-align: right; color: var(--yellow); }
.board-row.you { border-color: #4a3a70; background: rgba(85, 230, 255, 0.05); }
.board-note { color: var(--dim); font-size: 11px; margin: 12px 2px 0; letter-spacing: 0.1em; }

/* ----------------------------------------------------------------- dialog */
.dialog {
  border: 1px solid #33264f;
  border-radius: 18px;
  padding: 0;
  background: linear-gradient(170deg, #191230, #0a0712);
  color: var(--ink);
  width: min(380px, calc(100vw - 32px));
}

.dialog::backdrop {
  background: rgba(3, 2, 8, 0.75);
  backdrop-filter: blur(3px);
}

.dialog-form {
  padding: 26px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dialog-form h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.dialog-sub {
  margin: -8px 0 4px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.dialog-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.dialog-form input {
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: #0b0814;
  border: 1px solid #33264f;
  border-radius: 8px;
  padding: 10px 12px;
}

.dialog-form input:focus { outline: none; border-color: var(--cyan); }
.dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.form-error { margin: 0; color: var(--red); font-size: 11px; min-height: 14px; }
.fineprint { margin: 0; color: #8d83aa; font-size: 11px; line-height: 1.5; text-align: center; }

.dialog-form { position: relative; }
.dialog-form [hidden] { display: none !important; }
.dialog-form h2 { letter-spacing: 0.1em; font-size: 16px; }
.dialog-sub { font-size: 12px; line-height: 1.5; letter-spacing: 0.02em; margin: -6px 0 2px; }
.dialog-form label { text-transform: none; font-size: 12px; letter-spacing: 0.04em; color: var(--ink); }
.dialog-form input { width: 100%; box-sizing: border-box; }
.dialog-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.dialog-x:hover { color: var(--ink); background: #241a3e; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #0b0814; border: 1px solid #33264f; border-radius: 10px; }
.auth-tab {
  font: inherit;
  font-size: 12px;
  padding: 9px 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
.auth-tab:hover { color: var(--ink); }
.auth-tab.is-active { background: #33264f; color: var(--ink); font-weight: 700; }
.field-help { color: var(--dim); font-size: 11px; line-height: 1.45; letter-spacing: 0.01em; }
.password-row { position: relative; display: block; }
.password-row input { padding-right: 88px; }
.password-show {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  font: inherit;
  font-size: 11px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: #241a3e;
  color: var(--ink);
  cursor: pointer;
}
.auth-warn { margin: 0; padding: 9px 11px; border-left: 3px solid var(--yellow); background: rgba(255, 210, 63, 0.08); font-size: 11px; line-height: 1.5; border-radius: 0 6px 6px 0; }
.auth-submit { width: 100%; padding: 13px 16px; font-size: 12px; }
.auth-submit:disabled { opacity: 0.55; cursor: wait; }
.form-error:empty { display: none; }
.form-error { font-size: 12px; line-height: 1.45; }

@media (max-width: 520px) {
  .board-row { grid-template-columns: 26px 1fr 58px; }
  .board-row .lvl { display: none; }
}

/* ---------------------------------------------------------- online lobby */
.online {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 3, 8, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.online-card {
  width: min(400px, 100%);
  padding: 24px;
  border: 1px solid #3a2f55;
  border-radius: 18px;
  background: linear-gradient(160deg, #191229, #0a0712);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
}

.online-kicker {
  margin: 0;
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.online-card h2 {
  margin: 6px 0 18px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#online-setup {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#online-setup > .btn { width: 100%; }

.online-join {
  display: flex;
  gap: 8px;
}

.online-join input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-align: center;
  text-transform: uppercase;
  color: var(--yellow);
  background: #07060c;
  border: 1px solid #33264f;
  border-radius: 8px;
  padding: 10px 6px 10px 12px;
}

.online-join input::placeholder {
  color: #5b5276;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
}

.online-join input:focus {
  outline: none;
  border-color: var(--cyan);
}

.online-join .btn { flex: 0 0 auto; }

.online-note {
  margin: 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.65;
  letter-spacing: 0.06em;
}

.online-room-code {
  margin: 0 0 6px;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.22em;
}

.online-room-code strong {
  display: block;
  margin-top: 4px;
  color: var(--yellow);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}

.online-role {
  margin: 0;
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#online-status { margin-top: 10px; }

.online-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.online-error {
  min-height: 16px;
  margin: 14px 0 0;
  color: var(--red);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.online-back {
  margin-top: 6px;
}

.online .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Lumen seats picker in the online lobby */
.online-seats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.online-seats select {
  background: #141021;
  color: var(--ink);
  border: 1px solid #332a4d;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.1em;
}

#online-roster { color: var(--ink); letter-spacing: 0.08em; }

/* ------------------------------------------------------------------ leagues */
.board-scope {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--dim);
  text-transform: uppercase;
}

.board-scope select {
  background: #141021;
  color: var(--ink);
  border: 1px solid #332a4d;
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  max-width: 220px;
}

.board-privacy { color: #6f6590; letter-spacing: 0.08em; text-transform: none; }

#board-season { max-width: 170px; }

.league-cadence {
  background: #141021;
  color: var(--ink);
  border: 1px solid #332a4d;
  border-radius: 6px;
  padding: 4px 6px;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.leagues { margin-top: 26px; }

.league-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }

.league-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #2a2342;
  border-radius: 9px;
  background: #110d1e;
}

.league-row.is-current { border-color: #4a3c78; background: #16112a; }
.league-row .league-name { color: var(--ink); letter-spacing: 0.08em; }
.league-row .league-meta { color: var(--dim); font-size: 10px; letter-spacing: 0.12em; }
.league-row .league-code {
  color: var(--yellow);
  letter-spacing: 0.22em;
  font-size: 11px;
}
.league-row .spacer { flex: 1 1 auto; }

.league-members {
  flex: 1 0 100%;
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.league-forms { display: flex; gap: 10px; flex-wrap: wrap; }
.league-form { display: flex; gap: 6px; }

.league-form input {
  background: #141021;
  color: var(--ink);
  border: 1px solid #332a4d;
  border-radius: 6px;
  padding: 7px 9px;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.14em;
  width: 150px;
}

.league-error { color: #ff6b6b; min-height: 14px; }

/* ------------------------------------------------------------------ profile */
.pf-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.pf-tile {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, #130e21, #0a0713);
}

.pf-tile strong { color: var(--yellow); font-size: 22px; }

.pf-tile span {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pf-list { margin: 12px 0 0; }
.pf-list:empty { display: none; }

.league-from { align-self: center; color: var(--dim); font-size: 11px; letter-spacing: 0.08em; }

/* --------------------------------------------------------------- new league */
.ln-step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 34px 0 14px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--yellow);
}

.ln-step > span[aria-hidden] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--yellow);
  color: #14100a;
  font-size: 12px;
  letter-spacing: 0;
}

.ln-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.ln-plan {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, #171126, #0b0814);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.ln-plan:hover { border-color: #4c3a75; }

.ln-plan.is-on {
  border-color: var(--yellow);
  box-shadow: 0 0 0 1px var(--yellow), 0 0 28px rgba(255, 230, 74, 0.1);
}

.ln-plan:focus-within { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* The whole card is the control, so the radio itself only needs to stay
   reachable from the keyboard. */
.ln-plan input { position: absolute; opacity: 0; }

.ln-price { font-size: 28px; font-weight: 700; color: var(--yellow); }
.ln-plan-name { font-size: 13px; letter-spacing: 0.08em; color: var(--ink); }
.ln-plan-about { font-size: 12px; line-height: 1.6; color: #a79dc2; }

.ln-both {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 14px;
  margin: 16px 0 0;
  padding: 0;
  font-size: 12px;
  color: #a79dc2;
}

.ln-both .ico { margin-right: 8px; color: var(--cyan); vertical-align: -3px; }

.ln-name {
  width: 100%;
  max-width: 460px;
  padding: 12px 14px;
  border: 1px solid #33264f;
  border-radius: 8px;
  background: #0b0814;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.ln-name:focus { outline: none; border-color: var(--cyan); }
.ln-hint { margin: 8px 0 0; max-width: 62ch; font-size: 11px; line-height: 1.7; color: var(--dim); }

.ln-pay {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #130e21;
}

.ln-consent {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  line-height: 1.7;
  color: #c3b9dd;
  cursor: pointer;
}

.ln-pay .btn:disabled { opacity: 0.6; cursor: wait; }

.ln-done {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #130e21;
  text-align: center;
}

.ln-done .game-blurb { margin-left: auto; margin-right: auto; }
.ln-done-name { margin: 16px 0 0; font-size: 22px; color: var(--ink); }

.ln-code {
  margin: 14px 0 0;
  font-size: clamp(30px, 8vw, 44px);
  font-weight: 700;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  color: var(--yellow);
}

/* ------------------------------------------------------------------- admin */
/* The arcade controls. Hidden for everyone but an admin, so these styles are
   only ever seen by one or two people - they aim to be legible rather than
   decorative. */
.admin-switches {
  display: grid;
  gap: 14px;
  margin-bottom: 12px;
}

.admin-switch {
  display: grid;
  grid-template-columns: 110px 170px;
  align-items: center;
  gap: 6px 12px;
}

.admin-switch label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.admin-switch select {
  appearance: none;
  padding: 5px 8px;
  border: 1px solid #332a4d;
  border-radius: 4px;
  background: #140f22;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}

.admin-switch select:disabled {
  opacity: 0.5;
}

.admin-hint {
  grid-column: 1 / -1;
  font-size: 10px;
  line-height: 1.5;
  color: #6a6184;
}

.admin-flagged h3 {
  margin: 14px 0 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--yellow);
}

/* A flagged run carries more than a board row does - the cabinet, how long it
   took, and what the checks disliked - so it wraps onto a second line rather
   than squeezing everything into the board's columns. */
.admin-run {
  /* board-row's own columns have no room for the cabinet name or the Drop
     button, so this row redraws the grid and gives the reasons a line of
     their own underneath. */
  grid-template-columns: 78px 1fr 52px 80px auto;
  row-gap: 4px;
}

.admin-run .rank {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-run .admin-why {
  grid-column: 1 / -1;
  font-size: 10px;
  line-height: 1.5;
  color: #ff9f6b;
}

.admin-run .btn {
  grid-column: 5;
  grid-row: 1;
  font-size: 10px;
  padding: 2px 8px;
}

/* What the arcade is actually running on. Dim until something about it is
   worth acting on. */
.admin-host {
  font-size: 10px;
  color: #6a6184;
  margin-top: 4px;
}

.admin-host.admin-warn {
  color: #ff6b6b;
}

/* ------------------------------------------------------------ preview mode */
/* The cabinet as it appears inside a landing page's preview frame: the screen
   and nothing else. Set on <html> before first paint, so none of this chrome
   flashes before it goes. */
.is-preview body {
  background: #000;
  overflow: hidden;
}

.is-preview .cabinet {
  min-height: 0;
  padding: 0;
  gap: 0;
  justify-content: flex-start;
}

.is-preview .game-account,
.is-preview .hint,
.is-preview .touch-pads,
.is-preview .dev-tools,
.is-preview .online {
  display: none !important;
}

.is-preview .screen-wrap {
  padding: 0;
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

.is-preview .screen-wrap canvas {
  border-radius: 0;
}

/* ------------------------------------------------------------- game landing */
.crumbs {
  margin: 18px 0 0;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6c6383;
}

.crumbs a { color: var(--dim); text-decoration: none; }
.crumbs a:hover { color: var(--cyan); }
.crumbs span[aria-hidden] { margin: 0 6px; }

.game-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  padding: 36px 0 12px;
}

.game-title {
  margin: 12px 0 0;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: 0.14em;
  color: var(--yellow);
  text-shadow: 0 0 24px rgba(255, 225, 77, 0.3);
}

.game-hook {
  margin: 10px 0 0;
  color: var(--pink);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.game-blurb {
  margin: 18px 0 0;
  max-width: 52ch;
  color: #a79dc2;
  font-size: 13px;
  line-height: 1.8;
}

.play-note {
  margin: 16px 0 0;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.play-btn { padding: 13px 26px; font-size: 13px; }

/* ----------------------------------------------------------- preview frame */
.game-preview { text-align: center; }

.preview-frame {
  position: relative;
  display: inline-block;
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(180deg, #171125, #0c0914);
  box-shadow:
    0 0 0 1px #2b2141,
    0 0 40px rgba(85, 230, 255, 0.08),
    0 22px 60px rgba(0, 0, 0, 0.8);
}

.preview-frame iframe {
  display: block;
  border: 0;
  border-radius: 8px;
  background: #000;
  /* The real cabinet is running in here. Clicks belong to the cover link
     above it, so the preview cannot be half-played by accident. */
  pointer-events: none;
}

.preview-cover {
  position: absolute;
  inset: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: transparent;
  transition: background 160ms ease;
}

.preview-play {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #14100a;
  background: var(--yellow);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 160ms ease, transform 160ms ease;
}

.preview-cover:hover,
.preview-cover:focus-visible {
  background: rgba(7, 6, 12, 0.45);
  outline: none;
}

.preview-cover:hover .preview-play,
.preview-cover:focus-visible .preview-play {
  opacity: 1;
  transform: scale(1);
}

.preview-note {
  margin: 12px 0 0;
  color: #6c6383;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------- how to play */
.how-split {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 28px;
  align-items: start;
}

.how-about p {
  margin: 0 0 14px;
  color: #a79dc2;
  font-size: 13px;
  line-height: 1.8;
}

.how-keys {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: linear-gradient(160deg, #130e21, #0a0713);
}

.how-keys h3 {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
}

.keys {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  font-size: 11px;
}

.keys dt {
  color: var(--dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.keys dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.tips {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.tips li {
  position: relative;
  padding-left: 20px;
  color: #a79dc2;
  font-size: 12px;
  line-height: 1.7;
}

.tips li::before {
  content: "›";
  position: absolute;
  left: 4px;
  top: -1px;
  color: var(--yellow);
  font-size: 14px;
}

/* -------------------------------------------------------------------- share */
.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.share-said {
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: 0.1em;
  word-break: break-all;
}

/* --------------------------------------------------------- the other games */
.more-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.more-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(160deg, #130e21, #0a0713);
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease;
}

.more-card:hover,
.more-card:focus-visible {
  border-color: #3d2f60;
  transform: translateY(-2px);
  outline: none;
}

.more-genre {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

.more-name {
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--ink);
}

@media (max-width: 860px) {
  .game-hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .how-split {
    grid-template-columns: 1fr;
  }
}

/* A preview frame is a fixed pixel size, so on a narrow screen it has to be
   scaled down rather than allowed to push the page sideways. */
@media (max-width: 420px) {
  .preview-frame {
    transform: scale(0.82);
    transform-origin: top center;
  }
}

/* ---------------------------------------------------------------- language */
.lang-switch {
  display: flex;
  gap: 2px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}

.lang-pick {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6c6383;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.lang-pick:hover { color: var(--ink); }

.lang-pick.is-on {
  background: #241d38;
  color: var(--yellow);
}

/* ----------------------------------------------------------- hall of fame */
.hall-explain p {
  margin: 0 0 12px;
  max-width: 68ch;
  color: #a79dc2;
  font-size: 13px;
  line-height: 1.8;
}

.hall-formula {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--yellow);
  border-radius: 8px;
  background: #130e21;
  color: var(--ink) !important;
  font-size: 12px !important;
  letter-spacing: 0.04em;
}

/* The overall board carries more per row than a score board does, so it gets
   its own columns and lets the breakdown wrap underneath. */
.hall-row {
  grid-template-columns: 34px 1fr 90px 92px;
  row-gap: 6px;
}

.hall-per {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 44px;
}

.hall-chip {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

.hall-chip b {
  color: var(--cyan);
  font-weight: 400;
}

.hall-of {
  color: #6c6383;
}

.hall-solo {
  border-color: #4a3a70;
}

.hall-mine {
  margin-top: 18px;
}

.board-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
}

/* A board tab is a link on these pages rather than a button. */
a.board-tab {
  text-decoration: none;
  display: inline-block;
}

@media (max-width: 560px) {
  .hall-row {
    grid-template-columns: 28px 1fr 78px;
  }
  .hall-row .lvl { display: none; }
  .hall-per { padding-left: 38px; }
}

/* ----------------------------------------------------------- legal pages */
.legal-page { max-width: 820px; }

.legal-warning {
  margin: 18px 0 0;
  padding: 12px 16px;
  border: 1px solid #7a2340;
  border-left: 3px solid var(--red);
  border-radius: 10px;
  background: rgba(255, 75, 92, 0.08);
  color: #ffb3bd;
  font-size: 12px;
  line-height: 1.7;
}

.legal-warning code {
  color: var(--yellow);
}

.doc {
  margin-top: 28px;
}

.doc h1 {
  margin: 0 0 6px;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0.08em;
  color: var(--yellow);
}

.doc h2 {
  margin: 34px 0 10px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
}

.doc p,
.doc li {
  color: #a79dc2;
  font-size: 13px;
  line-height: 1.85;
}

.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc strong { color: var(--ink); }
.doc code { color: var(--yellow); font-size: 12px; }

.doc-lead {
  font-size: 14px !important;
  color: #c3b9dd !important;
  margin-bottom: 18px !important;
}

.doc-date {
  margin: 0 0 20px !important;
  font-size: 11px !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6c6383 !important;
}

.doc-note {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--yellow);
  border-radius: 10px;
  background: #130e21;
}

/* Provider details: a definition list that lines up. */
.facts {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 18px;
  margin: 0 0 12px;
  font-size: 13px;
}

.facts dt {
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-top: 2px;
}

.facts dd {
  margin: 0;
  color: var(--ink);
  line-height: 1.7;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 14px;
  font-size: 12px;
}

.doc-table th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #3d2f60;
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 400;
}

.doc-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  color: #a79dc2;
  line-height: 1.6;
  vertical-align: top;
}

.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  list-style: none;
  margin: 34px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.doc-links a {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
}

/* A detail nobody has filled in yet. Loud on purpose. */
.todo {
  background: rgba(255, 75, 92, 0.18);
  color: #ffb3bd;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: 0.06em;
}

@media (max-width: 600px) {
  .facts { grid-template-columns: 1fr; gap: 2px 0; }
  .facts dd { margin-bottom: 10px; }
  .doc-table { font-size: 11px; }
  .doc-table td, .doc-table th { padding: 7px 6px; }
}

/* ------------------------------------------------------------ brand assets */
/* Interface icons from the media kit. They are drawn with currentColor, so
   one file serves a cyan heading and a dim footer alike. */
.how-icon {
  width: 22px;
  height: 22px;
  vertical-align: -5px;
  margin-right: 9px;
  opacity: 0.9;
}

.board-head h2 .board-icon {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin-right: 8px;
  opacity: 0.85;
}

/* See icon() in lib/page.php: the mask is the icon's shape, the background its
   colour, which is whatever text it sits beside. */
.ico {
  display: inline-block;
  flex: none;
  width: var(--ico-size, 16px);
  height: var(--ico-size, 16px);
  vertical-align: -0.2em;
  background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.btn .ico { margin-right: 8px; }
.card .badge .ico { margin-right: 5px; vertical-align: -1px; }
.section-head h1.section-title .ico,
.section-head h2 .ico,
.board-head h1.section-title .ico,
.board-head h2 .ico,
.doc h2 .ico { margin-right: 9px; vertical-align: -4px; color: var(--cyan); }
.how-keys h3 .ico { margin-right: 8px; vertical-align: -3px; }
.hero-kicker .ico { margin-right: 8px; color: var(--cyan); vertical-align: -3px; }
.hero-facts li::before { content: none; }
.hero-facts .ico { margin-right: 8px; color: var(--cyan); vertical-align: -3px; }
.preview-play .ico { margin-left: 3px; }

.foot-logo { display: block; width: 150px; height: auto; }

.dialog-mark {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  margin-bottom: -2px;
}

/* A banner advertising the arcade to itself: always the kit's own artwork. */
.promo {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 48px auto 0;
}

.promo img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 140ms ease;
}

.promo:hover img,
.promo:focus-visible img { border-color: var(--yellow); }
.how-keys .promo { margin-top: 18px; }

.doc-banner {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 26px;
}

.lost { text-align: center; }
.lost-logo { display: block; max-width: 100%; height: auto; margin: 28px auto 20px; }

/* ---------------------------------------------------------------- media kit */
.press-preview {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 22px 0 8px;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}

.swatch {
  padding-top: 62px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--c);
}

.swatch b, .swatch code {
  display: block;
  padding: 0 12px;
  background: #130e21;
  font-size: 11px;
  font-weight: 400;
}

.swatch b { padding-top: 10px; color: var(--ink); }
.doc .swatch code { padding-bottom: 10px; color: var(--dim); font-size: 11px; }

.kit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.kit-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(160deg, #130e21, #0a0713);
  min-width: 0;
}

/* The checkerboard is what shows a transparent file is transparent. */
.kit-sample {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 6px;
  background: repeating-conic-gradient(#292337 0 25%, #332b43 0 50%) 0 / 20px 20px;
}

.kit-sample img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.doc .kit-name {
  margin: 10px 0 2px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.doc .kit-size {
  margin: 0 0 8px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--dim);
  letter-spacing: 0.08em;
}

.kit-links { display: flex; gap: 12px; font-size: 11px; letter-spacing: 0.1em; }

/* ---------------------------------------------------- play-together layer */
.rivals-card { display: flex; flex-direction: column; gap: 10px; }
.rivals-card h2 { margin: 0; }
.rivals-card .online-note, .rivals-card .online-kicker { margin: 0; }
.rivals-card .online-kicker { margin-top: 8px; }
.rivals-wide { display: block; width: 100%; box-sizing: border-box; text-align: center; text-decoration: none; }
.rivals-code { font-size: 28px; letter-spacing: 0.3em; color: var(--yellow); }
.rivals-row { color: var(--ink); }
.rivals-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 6px; }
.rivals-chip { display: inline-flex; gap: 8px; align-items: baseline; padding: 3px 10px; border: 1px solid #33264f; border-radius: 999px; background: #0b0814; font-size: 11px; }
.rivals-chip.is-me { border-color: var(--yellow); }
.rivals-chip.is-out { opacity: 0.55; }
.rivals-name { color: var(--dim); }

/* ---------------------------------------------------- phone game controller */
.has-gamepad .touch-pads, .has-gamepad .touch { display: none !important; }
.has-gamepad body { padding-bottom: 210px; overscroll-behavior: none; }
@media (orientation: landscape) {
  .has-gamepad body { padding-bottom: 0; }
  .has-gamepad .hint, .has-gamepad .game-account { display: none; }
}
.gp-root {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 200px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 40;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.gp-root[hidden] { display: none; }
.gp-zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 52%;
  height: 100%;
  pointer-events: auto;
  touch-action: none;
}
.gp-base {
  position: absolute;
  left: 34px;
  bottom: 34px;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.14));
  border: 2px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.35);
  opacity: 0.62;
}
.gp-base.is-on { opacity: 1; }
.gp-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f4f4fa, #8a8aa0 72%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.gp-buttons {
  position: absolute;
  right: 18px;
  bottom: 22px;
  width: 170px;
  height: 160px;
  pointer-events: none;
}
.gp-btn {
  position: absolute;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45), inset 0 2px 3px rgba(255, 255, 255, 0.35);
  pointer-events: auto;
  touch-action: none;
  opacity: 0.86;
}
.gp-btn.is-on { transform: scale(0.9); opacity: 1; filter: brightness(1.3); }
.gp-b0 { background: radial-gradient(circle at 35% 30%, #ff7a84, #c8202e); }
.gp-b1 { background: radial-gradient(circle at 35% 30%, #ffe27a, #c88a10); color: #1c1408; }
.gp-b2 { background: radial-gradient(circle at 35% 30%, #7ad0ff, #1c6ac0); }
.gp-b3 { background: radial-gradient(circle at 35% 30%, #8af0a0, #1c8a44); color: #08200e; }
.gp-n1 .gp-b0 { right: 16px; bottom: 26px; width: 92px; height: 92px; font-size: 13px; }
.gp-n2 .gp-b0 { right: 0; bottom: 56px; width: 76px; height: 76px; }
.gp-n2 .gp-b1 { right: 86px; bottom: 6px; width: 76px; height: 76px; }
.gp-n3 .gp-b0 { right: 0; bottom: 40px; }
.gp-n3 .gp-b1 { right: 78px; bottom: 0; }
.gp-n3 .gp-b2 { right: 66px; bottom: 84px; }
.gp-n4 .gp-b0 { right: 0; bottom: 46px; }
.gp-n4 .gp-b1 { right: 52px; bottom: 0; }
.gp-n4 .gp-b2 { right: 104px; bottom: 46px; }
.gp-n4 .gp-b3 { right: 52px; bottom: 92px; }
.gp-start {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #fff;
  background: rgba(20, 16, 34, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.35);
  pointer-events: auto;
  touch-action: none;
}
.no-controls .touch-pads, .no-controls .touch { display: none !important; }
.gp-choose {
  margin-left: 10px;
  padding: 4px 10px;
  font: inherit;
  font-size: 11px;
  color: var(--ink);
  background: #241a3e;
  border: 1px solid #3a2f55;
  border-radius: 999px;
  cursor: pointer;
}
.gp-choose[hidden] { display: none; }

/* ---------------------------------------------------- a card is a cabinet */
.card.cab {
  --c: var(--yellow);
  display: flex;
  flex-direction: column;
  overflow: visible;
  padding: 0;
  min-height: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 250px;
  border: 0;
  border-radius: 0;
  background: none;
  filter: drop-shadow(0 16px 14px rgba(0, 0, 0, 0.55));
}
.card.cab:hover, .card.cab:focus-visible {
  border-color: transparent;
  box-shadow: none;
  transform: translateY(-4px);
}
/* the marquee: a lit box that sticks out over the screen */
.cab-marquee {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 8px;
  clip-path: polygon(0 0, 100% 0, 96% 100%, 4% 100%);
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, color-mix(in srgb, var(--c) 42%, #14121c), #16141e 92%);
  border-top: 3px solid color-mix(in srgb, var(--c) 70%, #fff);
  box-shadow: inset 0 0 22px color-mix(in srgb, var(--c) 45%, transparent);
}
.card.cab .cab-marquee h2 {
  margin: 0;
  overflow: hidden;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 8px var(--c), 0 0 2px var(--c), 0 2px 0 rgba(0, 0, 0, 0.8);
}
/* the speakers in the hood */
.cab-speakers {
  display: flex;
  justify-content: space-between;
  height: 15px;
  margin: 0 6%;
  padding: 3px 12px 0;
  background: #14121a;
}
.cab-speakers i {
  width: 26px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #3a3844 0 30%, #0a0910 72%);
  box-shadow: inset 0 0 0 1px #33313e;
}
/* the monitor, set back in the body behind its bezel and a pane of glass */
.cab-screen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  margin: 0 6%;
  padding: 7px;
  overflow: hidden;
  background: linear-gradient(90deg, #2a2832, #0c0b12 10%, #0c0b12 90%, #1c1a24);
}
.cab-screen img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 3px;
  background: #06050a;
  filter: saturate(1.1);
  transition: filter 160ms ease;
}
.cab-screen .art, .cab-screen .brick-art { margin: 0; height: auto; }
.cab-screen::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 3px;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.2) 0 16%, rgba(255, 255, 255, 0.04) 16% 34%, transparent 34%);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.7);
}
.card.cab:hover .cab-screen img, .card.cab:focus-visible .cab-screen img { filter: saturate(1.3) brightness(1.15); }
/* the control deck is the widest part of the machine, and it slopes toward you */
.cab-deck {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 30px;
  clip-path: polygon(6% 0, 94% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, #3a3844, #24222c 72%, #4a4854);
  border-bottom: 3px solid #0a0910;
}
.cab-stick {
  position: relative;
  width: 12px;
  height: 7px;
  margin-right: 14px;
  border-radius: 50%;
  background: #14121a;
}
.cab-stick::after {
  content: '';
  position: absolute;
  left: 2px;
  bottom: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a94, #c8202e);
  box-shadow: 3px 3px 0 -2px #50505e, 0 5px 0 -3px #8a8a9a;
}
.cab-btn {
  width: 9px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #fff, var(--c) 60%);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
}
/* below the deck: the door, narrower, with the words and the coin slot on it */
.cab-door {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 0 8%;
  padding: 10px 10px 12px;
  text-align: center;
  background: linear-gradient(90deg, #1c1a24, #24222c 14%, #24222c 86%, #14121a);
  border-bottom: 5px solid #06050a;
  border-radius: 0 0 3px 3px;
}
.card.cab .tag { font-size: 9px; letter-spacing: 0.12em; color: var(--c); }
.card.cab p { margin: 0; flex: 1; font-size: 11px; line-height: 1.45; color: #c8c0dc; }
.cab-coin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #fff;
  background: #7a1c24;
  border: 1px solid #e0414e;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(224, 65, 78, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.card.cab:hover .cab-coin, .card.cab:focus-visible .cab-coin {
  background: var(--c);
  border-color: #fff;
  color: #14100a;
  box-shadow: 0 0 14px var(--c);
}

.ln-b2b {
  max-width: 62ch;
  margin: 12px auto 0;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.6;
  border-left: 3px solid var(--yellow);
  border-radius: 0 6px 6px 0;
  background: rgba(255, 210, 63, 0.08);
}

/* ------------------------------------------------------------ catalogue filters */
.filters {
  margin: 0 0 22px;
  display: grid;
  gap: 10px;
}
.filters[hidden], .card[hidden], .filter-none[hidden], .filter-reset[hidden] { display: none; }
.filter-search {
  width: 100%;
  max-width: 340px;
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
  color: #f4f0ff;
  background: #0c0914;
  border: 1px solid #2b2141;
  border-radius: 8px;
}
.filter-search:focus { outline: 2px solid #55e6ff; outline-offset: 1px; }
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.filter-label {
  min-width: 68px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.chip {
  padding: 6px 12px;
  font: inherit;
  font-size: 12px;
  color: #d8d2ea;
  background: #171125;
  border: 1px solid #2b2141;
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { border-color: #55e6ff; }
.chip:focus-visible { outline: 2px solid #55e6ff; outline-offset: 1px; }
.chip[aria-pressed="true"] {
  color: #07060c;
  background: #55e6ff;
  border-color: #55e6ff;
  font-weight: 700;
}
.filter-status {
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--dim);
}
.filter-reset {
  font: inherit;
  color: #55e6ff;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}
.filter-none {
  margin: 28px 0;
  color: var(--dim);
}
.cab-marquee { position: relative; }
.cab-3d {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  padding: 1px 5px;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #07060c;
  background: #55e6ff;
  border-radius: 3px;
}
@media (max-width: 500px) {
  .filter-label { width: 100%; }
}

/* ------------------------------------------------------------ Three.js cabinets */
.stage3d {
  position: absolute;
  display: block;
  border-radius: 10px;
  background: #04030a;
  image-rendering: auto;
  pointer-events: none;
}
.screen-wrap canvas.hud3d {
  position: relative;
  z-index: 1;
  background: transparent;
}
.screen-wrap canvas.hud3d ~ .vignette { z-index: 2; }
.is-preview .stage3d { border-radius: 0; }
.view-toggle {
  font: inherit;
  color: #55e6ff;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}
