:root {
  color-scheme: dark;
  --ink: #070a08;
  --panel: #0d120e;
  --green: #76ff03;
  --green-soft: #b8ff6a;
  --red: #ff3d52;
  --gold: #ffc928;
  --paper: #eef7ee;
  --muted: #8a998c;
  font-family: "Arial Narrow", "Roboto Condensed", Impact, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% -10%, #1b3020 0, transparent 42%),
    repeating-linear-gradient(0deg, #070a08 0 2px, #090d0a 2px 4px);
}

button {
  font: inherit;
}

button:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.cabinet {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px clamp(12px, 3vw, 42px) 30px;
}

.masthead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--green);
  padding-bottom: 10px;
}

.ticker,
.eyebrow,
.mini-controls,
footer,
.status-strip {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ticker {
  margin: 0 0 3px;
  color: var(--green-soft);
  font: 800 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.ticker span {
  color: var(--red);
}

h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 72px);
  line-height: 0.82;
  letter-spacing: -0.055em;
  transform: scaleX(0.94);
  transform-origin: left bottom;
}

h1 i {
  margin-left: 0.12em;
  color: var(--green);
  font-style: normal;
  text-shadow: 4px 4px 0 #244515;
}

.utility-button,
.primary-button,
.touch-controls button {
  border: 2px solid currentColor;
  color: var(--green);
  background: #0a100b;
  box-shadow: 4px 4px 0 #1e3e15;
  cursor: pointer;
}

.utility-button {
  min-width: 112px;
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.utility-button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--green);
}

.game-frame {
  position: relative;
  overflow: hidden;
  border: 2px solid #314034;
  background: #030504;
  box-shadow:
    0 0 0 5px #111813,
    0 24px 60px rgb(0 0 0 / 48%);
}

#game {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  image-rendering: pixelated;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(90deg, rgb(4 8 5 / 90%), rgb(4 8 5 / 65%)),
    repeating-linear-gradient(0deg, transparent 0 3px, rgb(118 255 3 / 5%) 3px 4px);
  transition: opacity 120ms linear;
}

.overlay[hidden] {
  display: none;
}

.overlay-card {
  width: min(620px, 100%);
  border-left: 7px solid var(--green);
  padding: clamp(16px, 4vw, 32px);
  background: rgb(7 10 8 / 94%);
  box-shadow: 12px 12px 0 rgb(118 255 3 / 12%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font: 800 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.overlay h2 {
  margin: 0;
  font-size: clamp(30px, 7vw, 62px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

#overlay-copy {
  margin: 14px 0;
  color: #d7e4d7;
  font-size: clamp(14px, 2.4vw, 19px);
  line-height: 1.5;
}

.market-flash {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 14px;
  align-items: baseline;
  margin: 18px 0;
  border-block: 1px solid #3b493d;
  padding: 12px 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.market-flash span {
  color: var(--muted);
}

.market-flash strong {
  color: var(--red);
  font-size: clamp(24px, 5vw, 40px);
}

.market-flash small {
  grid-column: 1 / -1;
  color: var(--red);
}

.primary-button {
  min-height: 50px;
  padding: 12px 24px;
  color: var(--ink);
  background: var(--green);
  font-size: 18px;
  font-weight: 950;
}

.primary-button:active,
.touch-controls button:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #1e3e15;
}

.mini-controls {
  margin: 18px 0 0;
  color: var(--muted);
  font: 700 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.disclaimer {
  margin: 10px 0 0;
  color: #9fb2a0;
  font-size: 11px;
  line-height: 1.45;
}

.touch-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: min(520px, 100%);
  margin: 16px auto;
}

.touch-controls button {
  min-height: 58px;
  font-size: 16px;
  font-weight: 950;
  touch-action: manipulation;
}

.touch-controls span {
  display: inline-block;
  margin-right: 8px;
  font-size: 20px;
}

.status-strip {
  display: flex;
  gap: 12px;
  align-items: center;
  overflow: hidden;
  min-height: 34px;
  border-block: 1px solid #293329;
  font: 800 11px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.status-strip span {
  align-self: stretch;
  display: grid;
  place-items: center;
  padding: 0 10px;
  color: var(--ink);
  background: var(--red);
}

.status-strip p {
  margin: 0;
  white-space: nowrap;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  color: #687569;
  font: 700 9px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

footer p {
  margin: 0;
}

.unsupported {
  margin: 0;
  padding: 40px;
}

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

@media (min-width: 800px) and (hover: hover) {
  .touch-controls {
    width: 340px;
    margin-right: 0;
  }
}

@media (max-width: 640px) {
  .cabinet {
    padding: 12px 8px 22px;
  }

  .masthead {
    align-items: center;
  }

  .ticker {
    font-size: 9px;
  }

  .utility-button {
    min-width: 88px;
    padding: 8px;
    font-size: 11px;
  }

  .overlay {
    align-items: center;
    padding: 8px;
  }

  .overlay-card {
    border-left-width: 4px;
    padding: 13px;
  }

  .overlay h2 {
    font-size: 29px;
  }

  #overlay-copy,
  .market-flash,
  .mini-controls {
    display: none;
  }

  .primary-button {
    min-height: 44px;
    padding: 8px 16px;
    font-size: 14px;
  }

  .disclaimer {
    margin-top: 7px;
    font-size: 8px;
  }

  footer {
    display: block;
  }

  footer p + p {
    margin-top: 8px;
  }
}

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