:root {
  color-scheme: dark;
  --bg: #06070d;
  --cabinet: #12151f;
  --panel: #181b28;
  --line: #32384d;
  --ink: #f5f7ff;
  --muted: #9da8c2;
  --green: #62f2a9;
  --amber: #ffcc66;
  --rose: #ff5f7e;
  --blue: #66b6ff;
  font-family: "Trebuchet MS", Verdana, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 12%, rgba(102, 182, 255, 0.18), transparent 28%),
    radial-gradient(circle at 82% 20%, rgba(255, 95, 126, 0.13), transparent 24%),
    linear-gradient(180deg, #070912 0%, #030409 100%);
  color: var(--ink);
}

button {
  font: inherit;
}

.arcade-shell {
  width: min(1280px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
}

.game-column,
.side-panel {
  background: color-mix(in srgb, var(--cabinet) 92%, black);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.game-column {
  min-width: 0;
  padding: 16px;
}

.cabinet-header,
.hud,
.compact-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: center;
}

.cabinet-header {
  grid-template-columns: 1fr auto;
  margin-bottom: 12px;
}

.eyebrow,
.hud span,
.compact-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--green);
  font-size: clamp(1.6rem, 4vw, 3.1rem);
  line-height: 1;
  text-shadow: 0 0 18px rgba(98, 242, 169, 0.45);
}

h2 {
  margin-bottom: 12px;
  color: var(--amber);
  font-size: 1rem;
}

button {
  min-width: 108px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--green) 70%, white);
  border-radius: 6px;
  background: var(--green);
  color: #06110c;
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
}

button:hover {
  filter: brightness(1.08);
}

.screen-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid #29314b;
  border-radius: 8px;
  background: #02030a;
  aspect-ratio: 3 / 2;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(2, 3, 10, 0.58);
  text-align: center;
}

.overlay.hidden {
  display: none;
}

.overlay strong {
  color: var(--green);
  font-size: clamp(1.6rem, 5vw, 4rem);
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(98, 242, 169, 0.55);
}

.overlay span {
  color: var(--ink);
  font-weight: 700;
}

.hud {
  margin-top: 12px;
}

.hud div,
.compact-stats div {
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.hud strong,
.compact-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.side-panel {
  padding: 16px;
}

.panel-section {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-section:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.panel-section p {
  color: var(--muted);
  line-height: 1.55;
}

.control-grid {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px 10px;
  align-items: center;
}

kbd {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c0f19;
  color: var(--green);
  font-weight: 900;
}

.control-grid span {
  color: var(--ink);
  font-weight: 700;
}

.timer-control {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
}

.timer-control strong {
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

.timer-control input {
  width: 100%;
  accent-color: var(--green);
}

.compact-stats {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .arcade-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .panel-section {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  .arcade-shell {
    padding: 10px;
  }

  .game-column,
  .side-panel {
    padding: 10px;
  }

  .hud {
    grid-template-columns: repeat(2, 1fr);
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .cabinet-header {
    gap: 12px;
  }
}
