:root {
  color-scheme: dark;
  /* Keep iOS Safari from automatically inflating text on narrow screens. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  --ink: #06100b;
  --panel: #0a1510;
  --paper: #e6ffe9;
  --muted: #829989;
  --accent: #61f28c;
  --danger: #ff304f;
  --warm: #f3c85b;
  --line: #294836;
  --playfield-background-top: #07130c;
  --playfield-background-bottom: #040a06;
  --dpad-cell: 60px;
  --dpad-row: 60px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

html { background: #0c1f14; }

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  user-select: none;
  -webkit-user-select: none;
  color: var(--paper);
  background:
    radial-gradient(ellipse 72% 38% at 50% -8%, #214c2d 0%, rgba(20, 58, 34, .78) 34%, transparent 72%),
    linear-gradient(180deg, #102718 0%, #07130d 38%, #102718 100%);
}

body::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  content: "";
  opacity: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(97, 242, 140, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(97, 242, 140, .055) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 42%, black 15%, transparent 82%);
}

@media (min-width: 700px), (min-height: 700px) {
  body::before { opacity: 1; }
}

button { font: inherit; }

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

button:focus,
button:focus-visible,
input:focus,
input:focus-visible { outline: none; box-shadow: none; }

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding:
    max(clamp(18px, 3vw, 40px), env(safe-area-inset-top, 0px))
    max(clamp(18px, 3vw, 40px), env(safe-area-inset-right, 0px))
    max(clamp(18px, 3vw, 40px), env(safe-area-inset-bottom, 0px))
    max(clamp(18px, 3vw, 40px), env(safe-area-inset-left, 0px));
  max-height: 100dvh;
  overflow: hidden;
}

.loading-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% 44%, rgba(31, 91, 49, .48), transparent 40%),
    #040a06;
  opacity: 1;
  visibility: visible;
  transition: opacity .26s ease, visibility .26s ease;
}

.loading-screen.done { opacity: 0; visibility: hidden; pointer-events: none; }

.loading-art {
  position: relative;
  width: min(54vw, 220px);
  aspect-ratio: 1;
  overflow: hidden;
  filter: drop-shadow(0 0 22px rgba(97, 242, 140, .16));
}

.loading-art img {
  display: block;
  width: 100%;
  height: 100%;
}

.loading-art::after {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(110deg, transparent 22%, rgba(231, 255, 237, .9) 50%, transparent 78%);
  background-repeat: no-repeat;
  background-position: -70% 0;
  background-size: 42% 100%;
  content: "";
  -webkit-mask: url("../assets/logo.svg") center / contain no-repeat;
  mask: url("../assets/logo.svg") center / contain no-repeat;
  animation: loader-shine .9s .12s ease-out both;
  pointer-events: none;
}

.loading-screen p {
  margin: 0;
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  letter-spacing: .18em;
}

.loading-dots { display: inline-block; width: 2.4em; overflow: hidden; vertical-align: bottom; animation: loading-dots 1s steps(4, end) infinite; }

@keyframes loader-shine {
  from { background-position: -70% 0; }
  to { background-position: 170% 0; }
}

@keyframes loading-dots { from { width: 0; } to { width: 2.4em; } }

.cabinet {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.play-column { min-width: 0; }

.screen-bezel { position: relative; }
.screen-flash-extension { display: none; }

.screen-wrap {
  position: relative;
  overflow: hidden;
  contain: layout paint;
  aspect-ratio: 16 / 9;
  background: #040a06;
  border: 1px solid var(--line);
  border-radius: 8px;
  isolation: isolate;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.crt-lines { display: none; }

.crt-warmup {
  position: absolute;
  z-index: 6;
  inset: 0;
  overflow: hidden;
  background: #040a06;
  opacity: 0;
  pointer-events: none;
}

.crt-warmup::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(transparent 49.35%, rgba(115, 255, 143, .42) 49.8%, rgba(97, 242, 140, .58) 50%, rgba(115, 255, 143, .42) 50.2%, transparent 50.65%),
    radial-gradient(ellipse at center, rgba(38, 119, 61, .2), rgba(2, 7, 4, .98) 66%),
    #020704;
}

.crt-warmup.active { animation: crt-warmup .82s ease-out both; }
.crt-warmup.active::before { animation: crt-aperture .82s ease-out both; }
.screen-wrap.signal-settle .overlay-card { animation: signal-settle .58s ease-out both; }

@keyframes crt-warmup {
  0%, 72% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes crt-aperture {
  0% { clip-path: inset(49.75% 0); opacity: .72; }
  20% { clip-path: inset(47.5% 0); opacity: .9; }
  48% { clip-path: inset(4% 0); opacity: 1; }
  74%, 100% { clip-path: inset(0); opacity: .88; }
}

@keyframes signal-settle {
  0% { opacity: .45; transform: translateX(-3px) skewX(-.7deg); }
  36% { opacity: .85; transform: translateX(2px) skewX(.35deg); }
  68% { transform: translateX(-1px); }
  100% { opacity: 1; transform: none; }
}

.overlay {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(24px, 6vw, 70px);
  background: rgba(4, 10, 6, .88);
  text-align: center;
  transition: opacity .18s ease, visibility .18s;
}

.overlay:not(.active) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.overlay.centered {
  justify-content: center;
  background: rgba(4, 10, 6, .9);
  text-align: center;
}

.overlay.centered .overlay-card { margin-inline: auto; }

.overlay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(560px, 88%);
  margin-inline: auto;
}

.overlay-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: clamp(16px, 1.7vw, 19px);
  font-weight: 600;
}

.overlay-kicker.sector-kicker {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  font-size: clamp(19px, 2vw, 23px);
}

.overlay-kicker.sector-kicker strong {
  color: var(--paper);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 1.5em;
  font-weight: 700;
  letter-spacing: .02em;
}

.overlay h2 {
  width: 100%;
  margin: 0 0 16px;
  font-size: clamp(30px, 4.6vw, 54px);
  line-height: 1;
  font-weight: 560;
  letter-spacing: -0.055em;
}

.overlay h2 span { color: inherit; }

.overlay-copy {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  color: #aab3af;
  font-size: clamp(14px, 1.35vw, 16px);
  line-height: 1.55;
}

.primary-action {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 180px;
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  color: #08110e;
  background: var(--accent);
  padding: 0 20px;
  margin: clamp(28px, 3.4vw, 38px) auto 0;
  font-size: 14px;
  font-weight: 650;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 5px 0 #2e9b55, 0 11px 25px rgba(97, 242, 140, .16);
  animation: primary-idle 2.8s ease-in-out infinite;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.primary-action::before {
  position: absolute;
  top: -35%;
  bottom: -35%;
  left: -35%;
  width: 22%;
  background: rgba(255, 255, 255, .42);
  content: "";
  opacity: 0;
  transform: skewX(-22deg);
}

.primary-action:active { box-shadow: 0 2px 0 #2e9b55, 0 5px 14px rgba(97, 242, 140, .18); transform: translateY(3px) scale(.99); }
.primary-action span {
  position: relative;
  z-index: 1;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.primary-action.retry-action {
  width: auto;
  min-width: 210px;
  justify-content: center;
  align-self: center;
  padding-inline: 24px;
  margin-right: 0;
  margin-left: 0;
}

@keyframes primary-idle {
  0%, 100% { box-shadow: 0 5px 0 #2e9b55, 0 11px 25px rgba(97, 242, 140, .16); transform: translateY(0); }
  50% { box-shadow: 0 7px 0 #2e9b55, 0 16px 31px rgba(97, 242, 140, .3); transform: translateY(-2px); }
}

@keyframes primary-sweep {
  from { opacity: 0; transform: translateX(0) skewX(-22deg); }
  18% { opacity: 1; }
  to { opacity: 0; transform: translateX(680%) skewX(-22deg); }
}

.announcer {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 18px;
  transform: translate(-50%, -6px);
  border: 1px solid rgba(97, 242, 140, .38);
  border-radius: 4px;
  color: var(--paper);
  background: rgba(10, 21, 16, .95);
  padding: 7px 11px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity .12s ease, transform .12s ease;
}

.announcer.show { opacity: 1; transform: translate(-50%, 0); }
.announcer.danger {
  border-color: rgba(255, 48, 79, .9);
  color: #fff4f5;
  background: rgba(67, 2, 13, .96);
  box-shadow: 0 0 18px rgba(255, 48, 79, .28);
}

.control-deck {
  display: grid;
  grid-template-areas: "actions move";
  grid-template-columns: auto auto;
  grid-template-rows: auto;
  justify-content: center;
  align-items: start;
  min-height: 124px;
  padding: 18px clamp(20px, 4vw, 52px) 0;
  column-gap: clamp(34px, 7vw, 86px);
  row-gap: 12px;
}

body[data-control-hand="left"] .control-deck {
  grid-template-areas: "move actions";
}

.move-controls {
  grid-area: move;
  display: grid;
  justify-items: center;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, var(--dpad-cell));
  grid-template-rows: repeat(3, var(--dpad-row));
}

.swipe-pad {
  display: none;
  place-items: center;
  width: calc(var(--dpad-cell) * 3);
  min-width: calc(var(--dpad-cell) * 3);
  min-height: calc(var(--dpad-row) * 3);
  border: 1px dashed #2b4033;
  border-radius: 8px;
  color: var(--accent);
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.swipe-pad:active { cursor: grabbing; border-color: var(--accent); background: #10291a; }

.swipe-icon {
  display: block;
  width: 42px;
  height: 42px;
}

body[data-touch-control="swipe"] .dpad { display: none; }
body[data-touch-control="swipe"] .swipe-pad { display: grid; }
body[data-touch-control="hidden"] .move-controls { display: none; }
body[data-touch-control="hidden"] .control-deck {
  grid-template-areas: "actions";
  grid-template-columns: auto;
}

.control {
  appearance: none;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid #2b4033;
  color: #adb6b2;
  background: #0e1a13;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.control:not(.disabled):active {
  border-color: var(--accent);
  color: var(--accent);
  background: #10291a;
}
.control.disabled {
  color: #54675b;
  background: #0b150f;
  cursor: default;
  opacity: .5;
  pointer-events: none;
}
.direction-icon { width: 42%; height: 42%; }
.control.up .direction-icon { transform: rotate(-90deg); }
.control.left .direction-icon { transform: rotate(180deg); }
.control.down .direction-icon { transform: rotate(90deg); }
.control.up { grid-column: 2; grid-row: 1; border-radius: 4px 4px 0 0; }
.control.left { grid-column: 1; grid-row: 2; border-radius: 4px 0 0 4px; }
.control.right { grid-column: 3; grid-row: 2; border-radius: 0 4px 4px 0; }
.control.down { grid-column: 2; grid-row: 3; border-radius: 0 0 4px 4px; }
.dpad-core { grid-column: 2; grid-row: 2; background: #0e1a13; }

.game-actions {
  grid-area: actions;
  display: flex;
  justify-self: center;
  align-self: center;
  width: calc(var(--dpad-cell) * 3 - 14px);
  height: 58px;
  gap: 10px;
}

body[data-control-hand="left"] .pause-action { order: 1; }
body[data-control-hand="left"] .restart-action { order: 2; }
.restart-action { flex: 0 0 calc(42% - 5px); }
.pause-action { flex: 1 1 auto; }

.deck-action {
  appearance: none;
  display: flex;
  align-items: center;
  align-self: stretch;
  justify-content: center;
  gap: 6px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 1px solid #2b4033;
  border-radius: 5px;
  color: #b8c6bc;
  background: #0e1a13;
  padding: 5px;
  font-size: 10px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.deck-action svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.restart-action svg { width: 27px; height: 27px; }
.pause-action svg { width: 32px; height: 32px; }

.deck-action:active { border-color: var(--accent); color: var(--accent); background: #10291a; }
.deck-action:disabled { opacity: .38; pointer-events: none; }
.deck-action .play-icon { display: none; }
.deck-action.is-resume .pause-icon { display: none; }
.deck-action.is-resume .play-icon { display: block; }
.side-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand utility"
    "stats stats";
  align-items: center;
  gap: 12px 24px;
  min-width: 0;
  border-bottom: 0;
  padding: 0 0 18px;
}

.panel-heading {
  grid-area: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 40px;
  justify-self: end;
}

.quick-actions { gap: 6px; }

.top-utility-strip {
  grid-area: utility;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.quick-action {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #294332;
  border-radius: 4px;
  color: #b8c6bc;
  background: #0e1a13;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.quick-action svg {
  width: 21px;
  height: 21px;
}

.menu-quick-action {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: auto auto;
  width: 84px;
  gap: 8px;
  padding-inline: 12px;
}

.quick-menu-label {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1;
  text-transform: uppercase;
}

.quick-language-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1;
}

.language-primary {
  grid-area: auto;
  width: 46px;
  min-width: 46px;
  height: 46px;
  justify-self: start;
  padding: 0;
}

.control-mode-quick-action {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
}

.control-mode-quick-action svg { width: 21px; height: 21px; }

.control-mode-symbol { display: none; }
.control-mode-quick-action[data-mode="dpad"] .control-mode-symbol-dpad,
.control-mode-quick-action[data-mode="swipe"] .control-mode-symbol-swipe,
.control-mode-quick-action[data-mode="hidden"] .control-mode-symbol-hidden { display: block; }

.sound-icon-off { display: none !important; }
.audio-quick-action[aria-pressed="false"] .sound-icon-on { display: none; }
.audio-quick-action[aria-pressed="false"] .sound-icon-off { display: block !important; }

.quick-action:active {
  border-color: var(--accent);
  color: var(--accent);
  background: #10291a;
}

.quick-action:disabled {
  opacity: .35;
  pointer-events: none;
}

.quick-action .play-icon { display: none; }
.quick-action.is-resume .pause-icon { display: none; }
.quick-action.is-resume .play-icon { display: block; }

.signal-mark {
  grid-area: brand;
  display: inline-flex;
  align-items: baseline;
  justify-self: start;
  gap: 4px;
  color: #dfffe5;
  white-space: nowrap;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: clamp(30px, 3.7vw, 38px);
  font-weight: 750;
  letter-spacing: .08em;
  line-height: 1;
}

.signal-mark i {
  color: var(--accent);
  font-style: normal;
  font-weight: 450;
  letter-spacing: -.1em;
}

.signal-mark b {
  color: var(--accent);
  font-weight: 750;
}

.header-logo {
  grid-area: brand;
  width: 110px;
  height: 110px;
  justify-self: start;
}

.header-logo img {
  display: block;
  width: 100%;
  height: 100%;
}

.readouts {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(5, max-content);
  justify-content: center;
  column-gap: clamp(20px, 2.4vw, 36px);
  margin: 0;
}

.readouts div {
  display: block;
  padding: 0;
}

.readouts dt {
  color: var(--muted);
  font-size: 12px;
}

.readouts dd {
  margin: 6px 0 0;
  color: var(--paper);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 18px;
  font-weight: 550;
}

.count-separator {
  display: inline-block;
  margin-inline: .26em;
}

.readouts .lives {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 16px;
  color: var(--danger);
  font-size: 12px;
}

@media (min-width: 601px) and (min-height: 601px) {
  .readouts > div:last-child { min-width: 60px; }
}

.life-icon {
  display: inline-block;
  width: 16px;
  height: 18px;
}

.best-readout dd {
  display: flex;
  align-items: center;
  gap: 6px;
}

.new-high-score {
  position: static;
  flex: 0 0 auto;
  border: 1px solid rgba(208, 180, 119, .45);
  border-radius: 2px;
  color: var(--warm);
  padding: 1px 4px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.game-menu {
  width: min(610px, calc(100% - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  border: 1px solid #2b4033;
  border-radius: 8px;
  color: var(--paper);
  background: #0a1510;
  padding: 0;
  overflow: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}

.game-menu::backdrop {
  background: rgba(3, 5, 8, .78);
  backdrop-filter: blur(3px);
}

.menu-shell { min-height: 430px; padding: clamp(20px, 4vw, 32px); }

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.menu-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.menu-resume {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  color: #08110e;
  background: var(--accent);
  padding: 0 18px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.menu-resume svg { width: 17px; height: 17px; }

.menu-pages { border-top: 1px solid var(--line); padding-top: 18px; }
.menu-page[hidden] { display: none; }
.menu-page { animation: menu-page-in .16s ease both; }

.menu-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
}

.menu-logo img { display: block; width: 100%; height: 100%; }

@keyframes menu-page-in {
  from { opacity: 0; transform: translateX(7px); }
  to { opacity: 1; transform: none; }
}

.menu-nav { display: grid; gap: 8px; }
.menu-nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  border: 1px solid #2b4033;
  border-radius: 5px;
  color: var(--paper);
  background: #0e1a13;
  padding: 0 16px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.menu-nav-icon {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  color: var(--accent);
}

.menu-back {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin: 0 0 18px;
  border: 1px solid #2b4033;
  border-radius: 4px;
  color: var(--accent);
  background: #0e1a13;
  padding: 0 14px;
  font-size: 14px;
  cursor: pointer;
}

.menu-back b { color: var(--paper); font-weight: 600; }
.menu-back svg { flex: 0 0 auto; width: 20px; height: 20px; }
.menu-page h3 { margin: 0 0 12px; font-size: 13px; font-weight: 650; letter-spacing: .02em; }
.menu-page h3:not(:first-of-type) { margin-top: 22px; }
.page-copy { margin: 0 0 16px; color: #aab3af; font-size: 13px; line-height: 1.6; }

.audio-settings {
  display: grid;
  gap: 12px;
  margin-bottom: 6px;
}

.haptics-setting { margin-top: 22px; }

.volume-setting input[type="range"] {
  appearance: none;
  width: min(280px, 58%);
  height: 34px;
  margin: 0;
  border: 1px solid #2b4033;
  border-radius: 3px;
  background: #0e1a13;
  padding: 0 10px;
  cursor: pointer;
}
.volume-setting input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: #31463a;
}
.volume-setting input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--accent);
}
.volume-setting input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: #31463a;
}
.volume-setting input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--accent);
}
.volume-setting.disabled { opacity: .38; cursor: not-allowed; }
.volume-setting input[type="range"]:disabled {
  border-color: #2b4033;
  background: #0e1a13;
  cursor: not-allowed;
  filter: saturate(0);
  pointer-events: none;
}

.confirm-dialog {
  width: min(420px, calc(100% - 32px));
  border: 1px solid #365844;
  border-radius: 8px;
  color: var(--paper);
  background: #0a1510;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .62);
}

.confirm-dialog::backdrop {
  background: rgba(3, 5, 8, .82);
  backdrop-filter: blur(3px);
}

.confirm-card { padding: clamp(24px, 6vw, 34px); text-align: center; }
.confirm-card h2 { margin: 0 0 9px; font-size: 26px; letter-spacing: -.03em; }
.confirm-card p { margin: 0; color: #aab3af; font-size: 14px; line-height: 1.5; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 26px; }
.confirm-actions button {
  min-height: 48px;
  border: 1px solid #34513e;
  border-radius: 4px;
  color: var(--paper);
  background: #0e1a13;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.confirm-actions .confirm-primary { border-color: var(--accent); color: #07110b; background: var(--accent); }

.language-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin: 0 0 10px;
  color: #aab3af;
  font-size: 13px;
}

.language-picker {
  position: relative;
  width: min(230px, 58%);
}

.language-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-width: 190px;
  min-height: 44px;
  border: 1px solid #2b4033;
  border-radius: 4px;
  color: var(--paper);
  background: #0e1a13;
  padding: 0 14px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.language-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: #10291a;
}

.language-trigger svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  transition: transform .14s ease;
}

.language-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }

.language-options {
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: calc(100% + 6px);
  display: grid;
  width: 100%;
  max-height: min(320px, 58dvh);
  border: 1px solid #3d6a4d;
  border-radius: 4px;
  background: #09140d;
  padding: 5px;
  overflow-y: auto;
  box-shadow: 0 16px 42px rgba(0, 0, 0, .58);
}

.language-options[hidden] { display: none; }

.language-options button {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 3px;
  color: var(--paper);
  background: transparent;
  padding: 0 12px;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.language-options button:focus-visible,
.language-options button[aria-selected="true"] {
  color: #06100b;
  background: var(--accent);
}

.reset-score {
  width: 100%;
  min-height: 40px;
  margin: 18px 0 0;
  border: 1px solid #2b4033;
  border-radius: 4px;
  color: #b7bfbb;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.reset-score.confirming { border-color: #76505a; color: #e6a2ae; }

.play-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
}

.guide-card {
  min-height: 142px;
  border: 1px solid #294836;
  border-radius: 5px;
  background: #0d1b12;
  padding: 10px;
}

.guide-card p { margin: 9px 0 0; color: #b8c6bc; font-size: 11px; line-height: 1.42; }
.guide-card strong { display: block; margin-bottom: 3px; color: var(--paper); font-size: 12px; }
.guide-card span { display: block; }

.guide-preview {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 320 / 92;
  border: 1px solid rgba(97, 242, 140, .18);
  border-radius: 3px;
  background: #08120c;
  cursor: default;
  touch-action: none;
}

.guide-intro { margin-bottom: 14px; }
.shortcut-title { margin-top: 0 !important; }
.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.shortcut-grid > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 44px;
  border: 1px solid #294836;
  border-radius: 4px;
  color: #b8c6bc;
  background: #0d1b12;
  padding: 7px 9px;
  font-size: 11px;
}

.shortcut-grid span { flex: 1 1 100px; }
.shortcut-grid kbd {
  border: 1px solid #466552;
  border-radius: 3px;
  color: var(--accent);
  background: #08120c;
  padding: 3px 6px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10px;
  box-shadow: inset 0 -1px rgba(97, 242, 140, .18);
}

.control-preferences {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

.preference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 38px;
  padding-block: 2px;
  color: #aab3af;
  font-size: 13px;
}

.option-group {
  display: flex;
  gap: 4px;
}

.setting-option-group { flex-wrap: nowrap; }

.wrap-options { flex-wrap: wrap; justify-content: flex-end; }

.option-group button {
  min-width: 38px;
  min-height: 34px;
  border: 1px solid #2b4033;
  border-radius: 3px;
  color: var(--muted);
  background: #0e1a13;
  padding: 0 9px;
  font-size: 12px;
  cursor: pointer;
}

.option-group button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: #10291a;
}

.option-group button:focus-visible { border-color: var(--accent); color: var(--accent); background: #10291a; }

@media (hover: hover) and (pointer: fine) {
  .primary-action:hover {
    background: #93ffb3;
    box-shadow: 0 7px 0 #2e9b55, 0 16px 32px rgba(97, 242, 140, .3);
    transform: translateY(-3px) scale(1.025);
  }
  .primary-action:hover::before { animation: primary-sweep .52s ease-out both; }
  .control:not(.disabled):hover,
  .deck-action:hover,
  .quick-action:hover,
  .menu-nav button:hover,
  .option-group button:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #10291a;
  }
  .menu-resume:hover { background: #80ffaa; }
  .menu-back:hover { border-color: var(--accent); background: #10291a; }
  .volume-setting input[type="range"]:not(:disabled):hover,
  .language-trigger:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #10291a;
  }
  .confirm-actions button:hover { border-color: #52776c; background: #11241a; }
  .confirm-actions .confirm-primary:hover { background: #80ffaa; }
  .language-options button:hover { color: #06100b; background: var(--accent); }
  .reset-score:hover { border-color: #76505a; color: #e6a2ae; }
}

@media (max-width: 860px) {
  .cabinet { grid-template-columns: 1fr; }
  .side-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand utility"
      "stats stats";
    gap: 0 28px;
    border-top: 0;
    border-bottom: 0;
    padding: 0 0 16px;
  }
}

@media (min-width: 700px) {
  .control-deck,
  body[data-control-hand="left"] .control-deck {
    grid-template-areas: "actions move";
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto;
    justify-content: center;
    width: 100%;
    column-gap: clamp(28px, 5vw, 76px);
  }

  .game-actions {
    display: flex;
    justify-self: start;
    width: calc(var(--dpad-cell) * 3 - 14px);
    gap: 10px;
  }

  .game-actions .deck-action { width: auto; }
  .move-controls { justify-self: end; }

  body[data-control-hand="left"] .control-deck {
    grid-template-areas: "move actions";
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body[data-control-hand="left"] .move-controls { justify-self: start; }
  body[data-control-hand="left"] .game-actions { justify-self: end; }

  body[data-touch-control="hidden"] .control-deck,
  body[data-touch-control="hidden"][data-control-hand="left"] .control-deck {
    grid-template-areas: "actions";
    grid-template-columns: auto;
    column-gap: 0;
  }

  body[data-touch-control="hidden"] .game-actions {
    justify-self: end;
    gap: 10px;
  }
}

@media (min-width: 1100px) {
  .page-shell { padding-block: 24px; }
  .cabinet { gap: 12px; }
  .side-panel { padding-bottom: 12px; }
  .screen-bezel,
  .control-deck {
    width: 100%;
    margin-inline: auto;
  }
  .control-deck { padding-top: 12px; }
}

@media (orientation: landscape) and (min-width: 601px) {
  .cabinet {
    width: min(920px, calc(100vw - 40px));
    margin-inline: auto;
  }
}

@media (max-width: 600px) {
  :root {
    --dpad-cell: 52px;
    --dpad-row: 52px;
  }
  .swipe-pad {
    width: calc(var(--dpad-cell) * 3);
    min-width: calc(var(--dpad-cell) * 3);
  }
  .page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding:
      max(18px, env(safe-area-inset-top, 0px))
      max(14px, env(safe-area-inset-right, 0px))
      max(20px, env(safe-area-inset-bottom, 0px))
      max(14px, env(safe-area-inset-left, 0px));
  }
  .cabinet {
    flex: 1;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 18px;
  }
  .play-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .side-panel {
    border-top: 0;
    border-bottom: 0;
    row-gap: 17px;
    padding: 4px 0 22px;
  }
  .screen-bezel {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  .screen-wrap {
    aspect-ratio: 4 / 3;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }
  .screen-wrap::after {
    position: absolute;
    z-index: 2;
    inset: 0;
    background: linear-gradient(
      to bottom,
      rgba(0, 5, 2, .72) 0,
      rgba(0, 5, 2, .2) 13%,
      transparent 24%,
      transparent 76%,
      rgba(0, 5, 2, .2) 87%,
      rgba(0, 5, 2, .72) 100%
    );
    content: "";
    pointer-events: none;
  }
  .overlay { padding: 20px; }
  .overlay-card { width: 88%; }
  .overlay h2 { margin-bottom: 10px; font-size: clamp(26px, 8vw, 38px); }
  .overlay-copy { font-size: 13px; line-height: 1.4; }
  .primary-action { min-width: 190px; min-height: 42px; font-size: 13px; margin-top: 22px; }
  .control-deck {
    grid-template-areas: "actions move";
    grid-template-columns: auto auto;
    min-height: calc(var(--dpad-row) * 3 + 24px);
    margin-top: auto;
    align-content: center;
    align-items: center;
    padding: 16px 0;
    column-gap: clamp(38px, 12vw, 90px);
  }
  .move-controls,
  .dpad,
  .swipe-pad { align-self: center; justify-self: center; }
  .side-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "utility"
      "brand"
      "stats";
  }
  .top-utility-strip { justify-self: center; justify-content: center; gap: 4px; }
  .header-logo { width: 82px; height: 82px; justify-self: center; }
  .panel-heading { justify-self: auto; }
  .quick-actions { gap: 4px; }
  .quick-action { width: 48px; height: 48px; }
  .quick-action svg { width: 19px; height: 19px; }
  .quick-language-code { font-size: 13px; }
  .language-primary {
    width: 48px;
    min-width: 48px;
    height: 48px;
    padding: 0;
  }
  .control-mode-quick-action { width: 48px; padding: 0; }
  .menu-quick-action { display: grid; width: 88px; padding-inline: 10px; }
  .quick-language-code,
  .quick-menu-label { font-size: 12px; }
  .readouts {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100vw;
    gap: 4px;
    margin-right: calc(50% - 50vw);
    margin-left: calc(50% - 50vw);
    padding-right: max(4px, env(safe-area-inset-right, 0px));
    padding-left: max(4px, env(safe-area-inset-left, 0px));
  }
  .readouts div { display: block; padding: 4px 2px; text-align: center; }
  .readouts dd { margin-top: 3px; font-size: 15px; }
  .readouts dt { font-size: 10px; }
  .readouts .lives { font-size: 10px; }
  .readouts .lives { justify-content: center; gap: 4px; }
  .life-icon { width: 13px; height: 10px; }
  .life-icon::after { top: 4px; left: 3px; width: 7px; }
  .best-readout { position: relative; }
  .best-readout dd { justify-content: center; }
  .new-high-score {
    position: absolute;
    top: 7px;
    left: calc(50% + 23px);
    width: 6px;
    height: 6px;
    border: 0;
    border-radius: 50%;
    background: var(--warm);
    padding: 0;
    font-size: 0;
    line-height: 0;
    transform: none;
    box-shadow: 0 0 7px rgba(243, 200, 91, .55);
  }
  .game-menu {
    width: calc(100% - max(20px, env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px)));
    max-height: calc(100dvh - max(20px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)));
  }
}

@media (max-width: 440px) {
  .side-panel { column-gap: 8px; }
  .play-guide { grid-template-columns: 1fr; }
  .menu-shell { min-height: 0; padding: 18px; }
  .menu-header { margin-bottom: 18px; }
  .menu-resume { padding-inline: 12px; }
  .preference-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .option-group { width: 100%; }
  .option-group button { flex: 1; }
  .volume-setting input[type="range"] { width: 100%; }
  .language-setting { align-items: flex-start; flex-direction: column; gap: 8px; }
  .language-picker { width: 100%; }
  .language-trigger { min-width: 0; }
  .shortcut-grid { grid-template-columns: 1fr; }
}

@media (orientation: landscape) and (min-width: 601px) and (max-height: 1050px) {
  .page-shell { padding: 6px clamp(12px, 1.6vw, 20px); }
  .cabinet {
    width: min(1180px, calc(100vw - 40px));
    gap: 4px;
  }
  .side-panel { column-gap: 18px; row-gap: 12px; padding: 6px 0; }
  .readouts { justify-content: center; }
  .screen-bezel {
    position: relative;
    width: min(880px, 100%, calc((100dvh - 220px) * 16 / 9));
    margin-inline: auto;
  }
  .screen-bezel::before,
  .screen-bezel::after {
    position: absolute;
    inset-block: 0;
    left: 50%;
    width: min(1180px, calc(100vw - 40px));
    content: "";
    transform: translateX(-50%);
    pointer-events: none;
  }
  .screen-bezel::before {
    z-index: 0;
    background: #040a06;
  }
  body[data-game-state="active"] .screen-bezel::before {
    background: linear-gradient(
      180deg,
      var(--playfield-background-top) 0%,
      var(--playfield-background-bottom) 100%
    );
  }
  .screen-flash-extension {
    position: absolute;
    z-index: 3;
    inset-block: 0;
    left: 50%;
    display: block;
    width: min(1180px, calc(100vw - 40px));
    overflow: hidden;
    background: #040a06;
    opacity: 0;
    transform: translateX(-50%);
    pointer-events: none;
  }
  .screen-flash-extension::before {
    position: absolute;
    inset: 0;
    content: "";
    z-index: 3;
    background:
      linear-gradient(transparent 49.35%, rgba(115, 255, 143, .42) 49.8%, rgba(97, 242, 140, .58) 50%, rgba(115, 255, 143, .42) 50.2%, transparent 50.65%),
      radial-gradient(ellipse at center, rgba(38, 119, 61, .2), rgba(2, 7, 4, .98) 66%),
      #020704;
  }
  .screen-bezel:has(.crt-warmup.active) .screen-flash-extension { animation: crt-warmup .82s ease-out both; }
  .screen-bezel:has(.crt-warmup.active) .screen-flash-extension::before { animation: crt-aperture .82s ease-out both; }
  .screen-bezel::after {
    z-index: 4;
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .screen-wrap {
    z-index: 1;
    width: 100%;
    height: auto;
    max-width: none;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 0;
  }
  .control-deck {
    width: 100%;
    min-height: 0;
    padding: 10px 0 7px;
    column-gap: clamp(24px, 3vw, 42px);
    row-gap: 8px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  :root {
    --dpad-cell: 32px;
    --dpad-row: 32px;
  }
  .page-shell { padding: 6px 10px; }
  .cabinet {
    width: min(600px, calc(100vw - 20px));
    gap: 4px;
  }
  .side-panel { min-height: 38px; padding-bottom: 2px; }
  .panel-heading { min-height: 34px; }
  .quick-action { width: 34px; height: 34px; }
  .quick-action svg { width: 16px; height: 16px; }
  .header-logo { width: 56px; height: 56px; }
  .language-primary { width: auto; min-width: 58px; height: 36px; padding-inline: 7px; }
  .quick-language-code { font-size: 12px; }
  .readouts { column-gap: clamp(12px, 2.2vw, 24px); }
  .readouts dt { font-size: 9px; }
  .readouts dd { margin-top: 2px; font-size: 14px; }
  .life-icon { width: 13px; height: 14px; }
  .screen-wrap { height: min(calc(100dvh - 176px), 56.25vw); }
  .control-deck {
    min-height: 0;
    padding: 4px 0 6px;
    column-gap: clamp(18px, 3vw, 34px);
    row-gap: 0;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (hover: hover) and (pointer: fine) {
  .control-deck,
  #touch-control-quick-toggle,
  h3[data-i18n="controls"],
  .control-preferences { display: none; }
  .screen-wrap { height: min(calc(100dvh - 82px), 56.25vw); }
}

@media (max-width: 380px) {
  :root {
    --dpad-cell: 50px;
    --dpad-row: 50px;
  }
  .swipe-pad {
    width: calc(var(--dpad-cell) * 3);
    min-width: calc(var(--dpad-cell) * 3);
  }
  .control-deck {
    width: 100%;
    justify-content: space-between;
    column-gap: 12px;
    row-gap: 6px;
    padding-inline: 8px;
  }
  .overlay-copy { display: none; }
}

@media (orientation: portrait) {
  .page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
  }

  .cabinet {
    flex: 1;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .side-panel {
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "utility"
      "brand"
      "stats";
    min-height: 0;
    row-gap: 12px;
    padding-block: 2px 8px;
  }

  .play-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .screen-bezel {
    margin-top: auto;
    margin-bottom: 0;
  }

  .control-deck {
    margin-top: auto;
  }
}

@media (orientation: portrait) and (min-width: 601px) {
  .side-panel {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    grid-template-areas:
      "brand . utility"
      "stats stats stats";
    row-gap: 12px;
  }

  .header-logo {
    align-self: start;
    justify-self: start;
  }

  .top-utility-strip {
    align-self: start;
    justify-self: end;
  }
}

@media (orientation: portrait) and (max-height: 760px) {
  .page-shell { padding-bottom: 0; }

  .cabinet { gap: 4px; }

  .side-panel {
    row-gap: 8px;
    padding-bottom: 2px;
  }

  .screen-bezel { margin-top: 0; }

  .control-deck {
    flex-shrink: 0;
    padding: 10px 0 max(14px, env(safe-area-inset-bottom, 0px));
  }
}

@media (orientation: portrait) and (max-height: 650px) {
  .page-shell {
    padding:
      max(6px, env(safe-area-inset-top, 0px))
      max(10px, env(safe-area-inset-right, 0px))
      max(6px, env(safe-area-inset-bottom, 0px))
      max(10px, env(safe-area-inset-left, 0px));
  }

  .cabinet { gap: 4px; }

  .side-panel {
    min-height: 0;
    row-gap: 4px;
    padding-block: 0 2px;
  }

  .top-utility-strip { min-height: 44px; }
  .quick-action { width: 44px; height: 44px; }
  .quick-action svg { width: 18px; height: 18px; }
  .language-primary {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
  .control-mode-quick-action { width: 44px; }
  .menu-quick-action { width: 82px; padding-inline: 8px; }
  .header-logo { width: 52px; height: 52px; }

  .readouts div { padding-block: 1px; }
  .readouts dt { font-size: 9px; }
  .readouts dd { margin-top: 1px; font-size: 14px; }

  .control-deck {
    min-height: calc(var(--dpad-row) * 3 + 8px);
    padding-block: 4px;
  }
}

@media (orientation: portrait) and (max-width: 380px) and (max-height: 580px) {
  .screen-wrap { aspect-ratio: 8 / 5; }
}

@media (orientation: portrait) and (max-width: 340px) {
  .page-shell {
    padding-right: max(2px, env(safe-area-inset-right, 0px));
    padding-left: max(2px, env(safe-area-inset-left, 0px));
  }

  .control-deck {
    column-gap: 4px;
    padding-inline: 2px;
  }

  .readouts {
    gap: 1px;
    padding-right: max(2px, env(safe-area-inset-right, 0px));
    padding-left: max(2px, env(safe-area-inset-left, 0px));
  }

  .readouts div { padding-inline: 0; }
  .menu-quick-action { width: 82px; padding-inline: 7px; }
}

@media (orientation: landscape) and (max-height: 760px) {
  :root {
    --dpad-cell: clamp(44px, 5.8vw, 52px);
    --dpad-row: clamp(44px, 5.8vw, 52px);
  }

  .page-shell {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    padding:
      max(20px, env(safe-area-inset-top, 0px))
      max(16px, env(safe-area-inset-right, 0px))
      max(20px, env(safe-area-inset-bottom, 0px))
      max(16px, env(safe-area-inset-left, 0px));
  }

  .cabinet {
    display: grid;
    width: min(1180px, 100%);
    height: 100%;
    grid-template-columns: minmax(152px, 1fr) minmax(0, calc((100dvh - 84px) * 16 / 9)) minmax(156px, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
    gap: 6px clamp(6px, 1.4vw, 16px);
  }

  .side-panel,
  .play-column,
  .control-deck { display: contents; }

  .readouts {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-self: end;
    justify-content: stretch;
    width: 100%;
    column-gap: 2px;
    padding: 0 2px 3px;
  }

  .readouts div { min-width: 0; text-align: center; }
  .readouts dt { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .readouts dd { margin-top: 2px; font-size: clamp(9px, 1.3vw, 14px); white-space: nowrap; }
  .readouts .lives { justify-content: center; gap: 2px; min-height: 12px; }
  .life-icon { width: 12px; height: 13px; }
  .best-readout { position: relative; }
  .best-readout dd { justify-content: center; }
  .new-high-score {
    position: absolute;
    top: 1px;
    left: calc(50% + 20px);
    width: 5px;
    height: 5px;
    border: 0;
    border-radius: 50%;
    background: var(--warm);
    padding: 0;
    font-size: 0;
    line-height: 0;
    transform: none;
    box-shadow: 0 0 6px rgba(243, 200, 91, .55);
  }

  .header-logo {
    grid-column: 1;
    grid-row: 1 / -1;
    width: clamp(72px, 10vw, 100px);
    height: clamp(72px, 10vw, 100px);
    align-self: start;
    justify-self: center;
  }

  .screen-bezel {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    align-self: center;
  }
  .screen-bezel::before,
  .screen-bezel::after { content: none; }
  .screen-flash-extension { display: none; }

  .screen-wrap {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line);
    border-radius: 5px;
  }

  .overlay-kicker { font-size: clamp(12px, 1.8vw, 16px); }
  .overlay-kicker.sector-kicker { font-size: clamp(14px, 2vw, 19px); }
  .overlay h2 { margin-bottom: 7px; font-size: clamp(20px, 3.5vw, 38px); }
  .overlay-copy { font-size: clamp(10px, 1.5vw, 14px); }
  .overlay .btn { padding: clamp(10px, 1.8vw, 16px) clamp(16px, 2.5vw, 24px); font-size: clamp(11px, 1.8vw, 15px); }

  .top-utility-strip {
    grid-column: 3;
    grid-row: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(52px, 78px));
    grid-auto-rows: 52px;
    align-self: start;
    justify-self: center;
    width: min(100%, 162px);
    gap: 5px 6px;
  }

  .top-utility-strip .quick-actions { display: contents; }
  .top-utility-strip .quick-action,
  .top-utility-strip .language-primary,
  .top-utility-strip .control-mode-quick-action {
    width: 100%;
    min-width: 0;
    height: 52px;
  }
  .top-utility-strip .quick-action svg { width: 22px; height: 22px; }
  .top-utility-strip .language-primary { grid-column: 1; grid-row: 1; gap: 4px; padding-inline: 5px; }
  .top-utility-strip .control-mode-quick-action { grid-column: 1; grid-row: 2; padding: 0; }
  .top-utility-strip .audio-quick-action { grid-column: 2; grid-row: 1; }
  .top-utility-strip .menu-quick-action {
    display: grid;
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }
  .top-utility-strip .quick-language-code { display: inline; font-size: 13px; }
  .top-utility-strip .quick-menu-label { display: none; }
  .game-actions {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: end;
    justify-self: center;
    width: min(100%, 152px);
    height: 58px;
    gap: 7px;
    transform: none;
  }
  .game-actions .deck-action {
    width: auto;
    min-width: 0;
  }
  .restart-action svg { width: clamp(26px, 3.5vw, 30px); height: clamp(26px, 3.5vw, 30px); }
  .pause-action svg { width: clamp(30px, 4vw, 35px); height: clamp(30px, 4vw, 35px); }

  .move-controls {
    grid-column: 3;
    grid-row: 1 / -1;
    align-self: end;
    justify-self: center;
    transform: none;
  }

  .swipe-pad {
    width: calc(var(--dpad-cell) * 3);
    min-width: calc(var(--dpad-cell) * 3);
  }

  body[data-control-hand="left"] .game-actions {
    grid-column: 3;
    transform: none;
  }

  body[data-control-hand="left"] .move-controls {
    grid-column: 1;
    transform: none;
  }

  body[data-touch-control="hidden"] .move-controls { display: none; }

  .overlay { padding: 14px; }
  .overlay-kicker { margin-bottom: 5px; font-size: 14px; }
  .overlay-kicker.sector-kicker { font-size: 16px; }
  .overlay h2 { margin-bottom: 7px; font-size: clamp(24px, 4vw, 36px); }
  .overlay-copy { font-size: 11px; line-height: 1.35; }
  .primary-action { min-width: 150px; min-height: 36px; margin-top: 13px; font-size: 11px; }
}

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

@media (orientation: landscape) and (max-height: 760px) and (min-width: 640px) {
  .best-readout dd { gap: 3px; }

  .new-high-score {
    position: static;
    width: auto;
    height: auto;
    border: 1px solid rgba(208, 180, 119, .45);
    border-radius: 2px;
    background: transparent;
    padding: 1px 3px;
    color: var(--warm);
    font-size: clamp(6px, .8vw, 8px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: .03em;
    text-transform: uppercase;
    box-shadow: none;
  }
}

@media (orientation: landscape) and (max-height: 760px) and (hover: hover) and (pointer: fine) {
  .page-shell {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding:
      max(6px, env(safe-area-inset-top, 0px))
      max(10px, env(safe-area-inset-right, 0px))
      max(6px, env(safe-area-inset-bottom, 0px))
      max(10px, env(safe-area-inset-left, 0px));
  }

  .cabinet {
    display: grid;
    width: min(1180px, 100%);
    height: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 52px minmax(0, 1fr);
    align-items: stretch;
    gap: 4px;
  }

  .side-panel {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    grid-template-areas: "brand stats utility";
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 0;
    padding: 0;
  }

  .play-column {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    min-width: 0;
    min-height: 0;
  }

  .control-deck,
  h3[data-i18n="controls"],
  .control-preferences { display: none; }

  .header-logo {
    grid-area: brand;
    align-self: center;
    justify-self: center;
    width: 52px;
    height: 52px;
  }

  .readouts {
    grid-area: stats;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-self: center;
    justify-content: stretch;
    width: min(100%, 470px);
    margin: 0;
    column-gap: 2px;
    padding: 0;
  }

  .readouts div { min-width: 0; text-align: center; }
  .readouts dt { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .readouts dd { margin-top: 2px; font-size: clamp(10px, 1.35vw, 15px); white-space: nowrap; }
  .readouts .lives { justify-content: center; gap: 2px; min-height: 13px; }
  .life-icon { width: 12px; height: 13px; }
  .best-readout { position: relative; }
  .best-readout dd { justify-content: center; }

  .top-utility-strip {
    grid-area: utility;
    display: grid;
    grid-template-columns: repeat(3, 40px);
    grid-template-rows: 40px;
    align-self: center;
    justify-self: end;
    width: auto;
    gap: 4px;
  }

  .top-utility-strip .quick-actions { display: contents; }
  .top-utility-strip .quick-action,
  .top-utility-strip .language-primary,
  .top-utility-strip .control-mode-quick-action {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
  }
  .top-utility-strip .language-primary { grid-column: 1; grid-row: 1; }
  .top-utility-strip .control-mode-quick-action { display: none; }
  .top-utility-strip .audio-quick-action { grid-column: 2; grid-row: 1; }
  .top-utility-strip .menu-quick-action {
    grid-column: 3;
    grid-row: 1;
    grid-template-columns: 1fr;
    width: 40px;
    gap: 0;
    padding: 0;
  }
  .top-utility-strip .quick-action svg { width: 19px; height: 19px; }
  .top-utility-strip .quick-language-code { display: inline; font-size: 11px; }
  .top-utility-strip .quick-menu-label { display: none; }

  .screen-bezel {
    position: relative;
    align-self: center;
    width: min(100%, calc((100dvh - 68px) * 16 / 9));
    margin: 0 auto;
  }

  .screen-bezel::before,
  .screen-bezel::after {
    position: absolute;
    inset-block: 0;
    left: 50%;
    width: min(1180px, calc(100vw - 20px));
    content: "";
    transform: translateX(-50%);
    pointer-events: none;
  }
  .screen-bezel::before { z-index: 0; }
  .screen-bezel::after {
    z-index: 4;
    border: 1px solid var(--line);
    border-radius: 7px;
  }

  .screen-flash-extension {
    width: min(1180px, calc(100vw - 20px));
  }

  .screen-wrap {
    z-index: 1;
    width: 100%;
    height: auto;
    max-width: none;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 0;
  }

  .overlay { padding: clamp(8px, 2vh, 14px); }
  .overlay-kicker { margin-bottom: 3px; font-size: clamp(10px, 1.5vw, 14px); }
  .overlay-kicker.sector-kicker { font-size: clamp(12px, 1.8vw, 17px); }
  .overlay h2 { margin-bottom: 5px; font-size: clamp(20px, 3.7vw, 36px); line-height: 1.05; }
  .overlay-copy { font-size: clamp(9px, 1.25vw, 13px); line-height: 1.3; }
  .primary-action {
    min-width: clamp(136px, 32vw, 220px);
    min-height: 34px;
    margin-top: clamp(8px, 2vh, 12px);
    padding: 8px 14px;
    font-size: clamp(9px, 1.25vw, 12px);
  }
}
