@font-face {
  font-family: 'Silkscreen';
  src: url('silkscreen-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
.arcade-site {
  --pixel-font: 'Silkscreen', monospace;
  background: radial-gradient(ellipse 970px 650px at 84% 0, #2c2034, transparent 74%), var(--page);
}
.arcade-site.embedded .site-header { display: none; }
.arcade-site.game-open { overflow: hidden; }
.arcade-shell { padding-block: 22px 36px; }
.arcade-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px 22px;
  margin-bottom: 19px;
  padding-bottom: 17px;
  border-bottom: 1px solid #594356;
}
.arcade-wordmark { width: clamp(133px, 35vw, 350px); }
.arcade-wordmark img { width: 100%; height: auto; }
.arcade-masthead p { margin-top: 7px; color: #e1cfe2; font-size: 15px; font-weight: 700; }
.lobby {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(284px, 1fr);
  align-items: start;
  gap: 16px 22px;
}
.setup { min-width: 0; overflow: clip; border: 1px solid #745a47; border-radius: 6px; background: #1a161e; }
.setup-head {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 159px;
  align-items: end;
  overflow: hidden;
  padding: 18px;
  background: #332937;
}
.setup-head img {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 43% 52%;
  image-rendering: pixelated;
}
.setup-head::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #15101aea, #15101a88 59%, #15101a19), linear-gradient(0deg, #15101acc, transparent 65%);
}
.setup-head h2 { margin: 3px 0 1px; font: 700 clamp(26px, 5vw, 49px)/.99 var(--heading-font); letter-spacing: -.04em; }
.setup-head p:last-child { font-weight: 700; color: #f1dab8; }
.setup-controls { padding: 16px 19px; }
.choice-field { min-width: 0; margin: 0 0 12px; padding: 0; border: 0; }
.choice-field legend { margin-bottom: 5px; padding: 0; font: 700 16px/1.12 var(--heading-font); }
.arcade-modes, .partner-slots, .characters { display: grid; gap: 6px; }
.arcade-modes, .partner-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.arcade-modes button { min-height: 47px; font: 700 17px/1 var(--heading-font); }
.partner-slots { margin-bottom: 7px; }
.partner-slots button, .characters button {
  min-width: 0;
  border: 1px solid #7c6871;
  border-radius: 4px;
  background: #251e28;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.partner-slots button {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: baseline;
  gap: 0 5px;
  min-height: 43px;
  padding: 6px 9px;
  text-align: left;
  color: #d5cbd5;
}
.partner-slots strong { color: var(--ink); }
.partner-slots button[aria-pressed="true"], .characters button[aria-pressed="true"] {
  border-color: var(--gold);
  background: #3b2c1b;
  color: var(--gold);
}
.characters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.characters button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 9px;
  min-height: 46px;
  padding: 4px;
  text-align: center;
}
.characters img { width: 46px; height: 46px; image-rendering: pixelated; }
.characters button[data-in-team] { border-color: #b19060; }
.characters button[aria-pressed="true"] { border-color: var(--gold); }
.mode-note { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.25; }
.start-button { width: 100%; min-height: 48px; font-size: 17px; }
.setup-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 10px; margin-top: 3px; }
.text-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: #f5dcae;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.text-button:disabled { opacity: .65; cursor: default; }
#load-error { margin-top: 6px; color: #ffb4a3; }

.levels { padding: 0; margin-top: 8px; list-style: none; }
.lobby-aside h2 { font: 700 clamp(20px, 3vw, 28px)/1 var(--heading-font); letter-spacing: -.04em; }
.levels :is(a, li > div) {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
  min-height: 54px;
  padding: 5px 7px;
  margin-bottom: 6px;
  border: 1px solid #5b495e;
  border-radius: 4px;
  background: #211b25;
  text-decoration: none;
}
.levels img { display: block; width: 80px; height: 50px; object-fit: cover; image-rendering: pixelated; }
.levels .level-hybrid img { object-fit: contain; background: #151015; image-rendering: auto; }
.levels strong { display: block; line-height: 1.14; }
.levels small { color: #d8cbd9; font-size: 12px; }
.levels [aria-current] { border-color: #cdae6c; }
.levels b { color: var(--gold); }
.records { margin-top: 18px; padding-top: 12px; border-top: 1px solid #594356; }
.records p { margin-top: 4px; color: var(--muted); }
.records ol { margin-top: 6px; padding-left: 22px; color: var(--gold); }
.records li { padding-block: 1px; font-variant-numeric: tabular-nums; }

.game-overlay {
  position: fixed;
  z-index: 10;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: #15121a;
}
.intro-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 45%, #2c2135, #110f17 72%);
}
.intro-chrome {
  width: min(100%, 935px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 7px;
}
.intro-chrome img { width: 132px; height: auto; }
#intro-map {
  align-self: center;
  width: min(100%, 935px);
  max-height: 100%;
  aspect-ratio: 320 / 192;
  object-fit: contain;
  image-rendering: pixelated;
}
.intro-caption {
  display: grid;
  place-items: center;
  padding-block: 9px;
  min-height: 47px;
  color: var(--gold);
  text-align: center;
  font: 700 clamp(17px, 4vw, 29px)/1.1 var(--heading-font);
}

.race-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding-top: env(safe-area-inset-top);
  background: #0e0e14;
}
.race-hud, .race-controls {
  width: min(100%, 1010px);
  margin-inline: auto;
  background: #1b161f;
}
.race-hud {
  position: relative;
  z-index: 1;
  padding: 7px 12px 8px;
  border-bottom: 1px solid #725846;
}
.hud-line, .hud-progress, .task-line, .relay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}
.hud-identity { flex: 1; min-width: 0; }
.hud-identity h2 { color: var(--gold); font: 700 clamp(17px, 4vw, 28px)/1 var(--heading-font); letter-spacing: -.035em; }
.hud-identity p { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.1; }
#clock { color: var(--ink); font: 700 clamp(23px, 4vw, 33px)/1 var(--heading-font); font-variant-numeric: tabular-nums; }
.compact { min-height: 44px; padding: 6px 8px; font-size: 13px; }
.hud-progress { justify-content: flex-start; gap: 7px 16px; margin-top: 5px; font-size: 13px; font-weight: 700; }
.hud-progress > div { flex: 1; min-width: 0; }
.hud-progress > div:first-child { flex: 1.45; }
.hud-progress span { display: block; margin-bottom: 3px; line-height: 1.1; }
.hud-progress progress {
  display: block;
  width: 100%;
  height: 5px;
  appearance: none;
  border: 0;
  border-radius: 1px;
  background: #534751;
  color: var(--gold);
}
progress::-webkit-progress-bar { background: #534751; border-radius: 1px; }
progress::-webkit-progress-value { background: var(--gold); border-radius: 1px; }
progress::-moz-progress-bar { background: var(--gold); border-radius: 1px; }
.checkpoints { display: flex; gap: 3px; height: 5px; }
.checkpoints i { flex: 1; background: #57505e; }
.checkpoints i.done { background: var(--flame); }
.race-view { position: relative; min-width: 0; min-height: 0; display: grid; place-items: stretch; overflow: hidden; }
.race-map { min-width: 0; width: 100%; height: 100%; min-height: 0; image-rendering: pixelated; display: block; }
.station-ready {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  pointer-events: none;
  background: #15121b70;
}
.station-ready-card {
  display: grid;
  justify-items: center;
  gap: clamp(5px, 1.5vh, 14px);
  width: min(100%, 440px);
  padding: clamp(9px, 3vh, 24px) 12px;
  text-align: center;
  font: 700 16px/1.15 var(--pixel-font);
  background: #1d1725;
  box-shadow: -4px 0 #986948, 4px 0 #986948, 0 -4px #986948, 0 4px #986948, 0 8px #100d15bc;
}
.station-ready-card p { color: #decce0; font-size: clamp(12px, 4vw, 17px); text-transform: uppercase; }
#ready-name { color: #fff0d0; font-size: clamp(17px, 5.4vw, 29px); text-transform: uppercase; }
#ready-count { color: var(--gold); font-size: clamp(37px, 12vw, 70px); line-height: 1; }
#ready-count[data-start] { color: #a8ffbd; }
.station-ready[data-race-start] .station-ready-card {
  width: min(100%, 380px);
  background: #191522ee;
  box-shadow: -4px 0 #bb8550, 4px 0 #bb8550, 0 -4px #bb8550, 0 4px #bb8550, 0 8px #100d15bc;
}
.station-ready[data-race-start] #ready-count {
  font-size: clamp(56px, 18vw, 104px);
  text-shadow: 0 5px #583b44;
}
.intro-buttons { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.sound-button[aria-pressed="false"] { color: #c1aabd; }
.sound-button[data-playing] { color: var(--gold); }
.judgement { position: absolute; inset: 0; pointer-events: none; }
.judgement-pop {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 4px;
  left: 50%;
  bottom: 16%;
  color: #a8ffbd;
  font: 700 clamp(32px, 9vw, 54px)/1 var(--pixel-font);
  text-shadow: -3px 0 #211925, 3px 0 #211925, 0 -3px #211925, 0 3px #211925, 3px 6px #211925;
  animation: judgement-rise .98s steps(15, end) both;
}
.judgement-pop[data-tone="penalty"] { color: #ff938c; }
.judgement-pop small { color: #ffe3e0; font-size: clamp(12px, 3.5vw, 18px); }
@keyframes judgement-rise {
  0% { opacity: 1; transform: translate(-50%, 7px) scale(.82); }
  16% { opacity: 1; transform: translate(-50%, -5px) scale(1.05); }
  48% { opacity: 1; transform: translate(-50%, -19px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -42px) scale(1); }
}
.pause-layer { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; background: #16121bd8; }
.pause-panel { width: min(100%, 320px); display: grid; gap: 6px; padding: 12px; background: #221a29; border: 1px solid #b28c5f; text-align: center; }
.pause-panel h2 { font: 700 23px/1.05 var(--heading-font); }
.pause-panel .text-link { justify-self: center; }
.race-controls {
  display: grid;
  gap: 5px;
  padding: 8px max(12px, env(safe-area-inset-right)) max(9px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border-top: 1px solid #725846;
}
.task-line { align-items: center; }
.task-line > div { min-width: 0; }
#current-task { color: var(--gold); font: 700 clamp(17px, 3.7vw, 26px)/1.04 var(--heading-font); letter-spacing: -.035em; }
#instruction { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.14; }
#station-score { color: var(--ink); white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.task-feedback {
  display: grid;
  align-items: center;
  min-height: 25px;
  padding-inline: 6px;
  border-left: 3px solid #685268;
  color: #f0e5ed;
  background: #2b2330;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
}
.task-feedback[data-tone="good"] { color: #ddffe6; background: #214536; border-color: #8cecaa; }
.task-feedback[data-tone="penalty"] { color: #ffe2df; background: #572e37; border-color: #ff827c; }
.game-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.button.primary.action-button {
  display: grid;
  width: 100%;
  gap: 4px;
  justify-items: stretch;
  justify-content: stretch;
  align-content: center;
  min-height: 57px;
  padding: 7px 10px;
  font-size: 17px;
  touch-action: manipulation;
  user-select: none;
}
.button.primary.action-button[aria-disabled="true"] { background: #b59b72; }
.button.primary.action-button[data-hold] {
  touch-action: none;
  -webkit-touch-callout: none;
}
.button.primary.action-button[data-hold][data-low-energy] {
  background: #30293c;
  border-color: #74667f;
  color: #e5d4e4;
}
.button.primary.action-button[data-tone="good"] { background: #a6e9b6; }
.button.primary.action-button[data-tone="penalty"] { background: #ff9f99; }
.button.primary.action-button[data-timing] {
  background: #2b2340;
  border-color: #a894b8;
  color: #fff6e8;
}
.button.primary.action-button[data-timing][data-tone="good"] { background: #215441; border-color: #9bf0b6; }
.button.primary.action-button[data-timing][data-tone="penalty"] { background: #632d3b; border-color: #ff9c96; }
.action-title { display: grid; min-width: 0; align-items: center; text-align: center; }
.action-title > span { grid-area: 1 / 1; }
.action-tip {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 9px;
  font: 700 clamp(12px, 3.8vw, 17px)/1.15 var(--pixel-font);
  letter-spacing: -.025em;
}
.action-button[data-guidance] .action-tip { display: flex; }
.action-button[data-guidance] #action-label { opacity: 0; }
.action-tip i {
  width: 16px;
  height: 15px;
  flex: 0 0 16px;
  background: currentColor;
  clip-path: polygon(31% 0, 69% 0, 69% 48%, 100% 48%, 100% 62%, 81% 62%, 81% 79%, 62% 79%, 62% 100%, 38% 100%, 38% 79%, 19% 79%, 19% 62%, 0 62%, 0 48%, 31% 48%);
  animation: action-pointer .68s steps(4, end) infinite alternate;
}
@keyframes action-pointer {
  from { transform: translateY(-3px); }
  to { transform: translateY(2px); }
}
@media (prefers-reduced-motion: reduce) {
  .action-tip i { animation: none; }
  .judgement-pop { animation-name: judgement-fade; }
}
@keyframes judgement-fade {
  from, 50% { opacity: 1; transform: translateX(-50%); }
  to { opacity: 0; transform: translateX(-50%); }
}
.effort-meter {
  position: relative;
  display: block;
  isolation: isolate;
  overflow: hidden;
  height: 16px;
  border-radius: 2px;
  background: #10121e;
  box-shadow: inset 0 0 0 1px #796e89;
}
.meter-fill, .meter-target, .meter-marker { display: block; height: 100%; }
.meter-fill { width: 0%; background: #f3cf74; }
.action-button[data-run] .meter-fill {
  background: repeating-linear-gradient(135deg, #ffe29d 0 5px, #dd9a46 5px 9px);
}
.action-button[data-low-energy] .meter-fill { background: #f4966e; }
.meter-target {
  position: absolute;
  top: 0;
  left: 31%;
  width: 36%;
  border-inline: 2px solid #fff0b6;
  background: repeating-linear-gradient(135deg, #ffdb56 0 7px, #edaa2e 7px 12px);
}
.meter-marker {
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 0 2px #0b0b14;
}
.action-button[data-tone="good"] .effort-meter { box-shadow: inset 0 0 0 2px #4aae75; }
.action-button[data-tone="penalty"] .effort-meter { box-shadow: inset 0 0 0 2px #e15d66; }
.relay-bar { min-height: 44px; color: var(--ink); font-size: 13px; font-weight: 700; }
.relay-bar .button { min-width: 90px; }

.result-screen {
  display: grid;
  place-items: center;
  place-items: safe center;
  overflow: auto;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 10%, #382336, #121015 70%);
}
.result-panel { width: min(100%, 624px); border: 1px solid #9d7d57; border-radius: 6px; overflow: hidden; background: #1d1920; }
.result-panel > img { width: 100%; height: clamp(74px, 22vh, 175px); object-fit: cover; object-position: 50% 55%; image-rendering: pixelated; }
.result-body { padding: 15px; }
.result-body h2 { margin-top: 4px; font: 700 clamp(24px, 5vw, 38px)/1.05 var(--heading-font); }
.result-time { margin: 4px 0 12px; color: var(--gold); font: 700 clamp(44px, 11vw, 77px)/.95 var(--heading-font); font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.finish-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
#share-options { margin-top: 11px; }
#share-options label { display: block; margin-bottom: 3px; }
#share-text { width: 100%; padding: 6px; border: 1px solid #6f5a73; border-radius: 4px; color: var(--ink); background: var(--page); font: inherit; resize: vertical; }

@media (max-width: 760px) {
  .arcade-shell { padding-block: 13px 24px; }
  .arcade-masthead { margin-bottom: 12px; padding-bottom: 11px; }
  .lobby { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 500px) {
  .arcade-site .header-inner { min-height: 49px; }
  .arcade-site .header-inner .text-link { font-size: 14px; }
  .arcade-wordmark { width: clamp(118px, 39vw, 201px); }
  .arcade-masthead .button { max-width: 48%; min-height: 44px; padding-inline: 8px; font-size: 13px; }
  .arcade-masthead p { margin-top: 4px; font-size: 13px; }
  .setup-head { min-height: 108px; padding: 9px 10px; }
  .setup-head .eyebrow { font-size: 12px; }
  .setup-head p:last-child { margin-top: 3px; font-size: 14px; }
  .setup-controls { padding: 9px; }
  .choice-field { margin-bottom: 9px; }
  .choice-field legend { font-size: 14px; }
  .arcade-modes button { min-height: 44px; font-size: 16px; }
  .characters button { display: grid; justify-items: center; gap: 2px; font-size: 13px; padding: 4px 2px; }
  .characters img { width: 42px; height: 42px; }
  .partner-slots button { font-size: 13px; }
  .setup-links { font-size: 14px; }
  .race-hud { padding-inline: 8px; }
  .hud-line { gap: 6px; }
  .hud-line .compact { padding-inline: 5px; }
  .intro-buttons .button { min-height: 44px; padding-inline: 6px; font-size: 13px; }
  .race-controls { gap: 4px; padding-inline: max(8px, env(safe-area-inset-left)); }
  #station-score { white-space: normal; flex: 0 0 auto; max-width: 36%; text-align: right; }
  .finish-actions > .primary { width: 100%; }
}
@media (max-height: 420px) and (orientation: landscape) {
  .race-screen { grid-template: auto minmax(0, 1fr) / minmax(0, 1fr) minmax(200px, .52fr); }
  .race-hud { grid-column: 1 / -1; width: 100%; }
  .race-controls { align-content: center; border-left: 1px solid #725846; border-top: 0; }
}
@media (max-width: 400px) and (max-height: 680px) {
  .arcade-shell { padding-top: 9px; }
  .arcade-masthead { margin-bottom: 8px; padding-bottom: 8px; }
  .setup-head { min-height: 85px; }
  .mode-note { font-size: 13px; }
}

