/* Load after play.css, then load generated shell-geometry.css. */
.station {
  width: min(100%, 76rem);
  padding-inline: max(.5rem, env(safe-area-inset-left)) max(.5rem, env(safe-area-inset-right));
}
.station .machine {
  position: relative;
  isolation: isolate;
  display: block;
  width: min(100%, var(--shell-max, 100%));
  margin-inline: auto;
  padding: 0;
  border: 0;
  aspect-ratio: var(--shell-ratio, 16 / 9);
  background: var(--shell-image, none) center / 100% 100% no-repeat;
  user-select: none;
  -webkit-user-select: none;
}
.station .machine .screen {
  position: absolute;
  inset: auto;
  left: var(--screen-x); top: var(--screen-y);
  width: var(--screen-w); height: var(--screen-h);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--screen-corner, 2.4%);
  background: #080e19;
}
.station .machine .screen #game {
  width: var(--game-w, 100%);
  height: auto;
  max-height: 100%;
  max-width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  flex: none;
  background: #080e19;
  image-rendering: pixelated;
}
.station .machine .screen #game:focus-visible {
  outline-offset: -3px;
}
.station .machine :is(.moves, .settings) { display: contents; }
.station .machine #move {
  position: absolute;
  left: var(--move-x); top: var(--move-y);
  width: var(--move-w); height: var(--move-h); max-width: none;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  gap: 0;
  padding: 0;
  margin: 0;
  touch-action: none;
}
.station .machine :is(#move button, #fire, #dash, #nova, #start, #sound) {
  --press-bg: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  min-height: 0;
  min-width: 0;
  color: transparent;
  text-indent: -10000px;
  overflow: hidden;
  white-space: nowrap;
  background: transparent;
  box-shadow: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.station .machine :is(#fire, #dash, #nova, #start, #sound) {
  position: absolute;
  border-radius: 36%;
  left: var(--x); top: var(--y); width: var(--w); height: var(--h);
}
.station .machine #move button:nth-child(1) { grid-area: 1 / 2; }
.station .machine #move button:nth-child(2) { grid-area: 2 / 1; }
.station .machine #move button:nth-child(3) { grid-area: 2 / 3; }
.station .machine #move button:nth-child(4) { grid-area: 3 / 2; }
.station .machine #move button { border-radius: .28rem; }
.station .machine :is(#move button,#fire,#dash,#nova,#start,#sound):is(.on,:active,[aria-pressed="true"].is-held) {
  background: rgb(13 24 63 / .22);
  box-shadow: inset 0 0 0 1px rgb(235 244 252 / .28);
}
.station .machine :is(#move button,#fire,#dash,#nova,#start,#sound):focus-visible {
  background: rgb(25 36 75 / .20);
  outline: 2px solid #fff7aa;
  outline-offset: -2px;
}
.station .machine :is(#move button,#fire,#dash,#nova,#start,#sound):disabled { opacity: 1; }
.station .machine :is(#move button,#fire,#dash,#nova,#start,#sound)[hidden] { display: none; }
/* Keep chrome below the cabinet and minimise other headings in short landscape. */
@media (any-pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  .station { padding-top: max(.18rem, env(safe-area-inset-top)); }
  .station .machine { margin-block: .18rem; }
  .station > header .label { display: none; }
  .station > header h1 { font-size: clamp(.8rem, 2vw, 1.12rem); margin: 0; }
}
/* Their source rectangles meet at corners; elliptical hit faces model the real
   buttons and leave the narrow diagonal thumb-roll corridor unambiguous. */
.station .machine :is(#fire,#dash,#nova) { clip-path: ellipse(50% 50%); }
.station .machine :is(#fire,#dash,#nova):focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px #fff7aa;
  border-radius: 50%;
}
.station .machine :is(#start,#sound) {
  left: calc(var(--x) + var(--w) / 2);
  top: calc(var(--y) + var(--h) / 2);
  transform: translate(-50%, -50%);
  width: max(44px, var(--w));
  height: max(44px, var(--h));
}
/* The wrapper still receives pointer input across all diagonal corners; these
   transparent child buttons align visible held/focus feedback on the red arms. */
.station .machine #move button[data-dir] {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--w); height: var(--h);
  grid-area: auto;
}
:root {background:#101d40;color:#eef1ff;--accent:#9ce8ed}
body {background:#101d40;}
.station-title h1 {font-size:clamp(1.05rem,3.5vw,1.8rem);letter-spacing:-.025em}
.station-title .label {font-size:.72rem;color:#c0caf1}
.console-status {display:flex;align-items:center;justify-content:space-between;gap:.4rem 1rem;flex-wrap:wrap}
.console-status .status {margin:.12rem 0 .44rem;color:#dee8ff}
.aux-keys {display:flex;gap:.4rem;margin-block:.12rem .44rem}
.aux-keys:has(> button[hidden] + button[hidden]) {display:none}
.brief section {background:#172752;border-top-color:#5878d1}
.brief p,footer {color:#d3dff2}
.station .machine #sound[aria-pressed="false"] {background:rgb(120 41 60 / .36);box-shadow:inset 0 0 0 2px #f7a9a9}
.station .machine #nova.ready {background:rgb(255 218 139 / .23);box-shadow:inset 0 0 0 2px #fff1b4}
.station .machine #nova.ready:active {background:rgb(32 21 65 / .27)}
@media (any-pointer:coarse) and (orientation:landscape) and (max-height:520px) {
  .station .machine {margin-block:.16rem}
  .station>.station-title h1 {font-size:clamp(.8rem,2vw,1.12rem)}
  .console-status .status {font-size:.8rem}
}
/* Keep tap gestures inside the game from becoming browser double-tap zoom. */
.station .machine {touch-action:none;-webkit-touch-callout:none}
/* Trade spare monitor space for a larger console, without touching tablet or phone sizing. */
@media (pointer:fine) and (not (any-pointer:coarse)) and (min-width:1232px) {
 .station {width:min(100%,100rem,max(76rem,calc((100svh - 7rem) * 2)))}
}
