:root {
  color-scheme: dark;
  --cyan: #00e5ff;
  --pink: #ff2bd6;
  --lime: #9cff00;
  --yellow: #ffe600;
  --ink: #000;
  --panel: #07121c;
  font-family: "Courier New", Courier, monospace;
  background: var(--ink);
  color: #fff;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #000; }

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: #000;
  color: #fff;
}

button, a { font: inherit; }

.topbar {
  display: flex;
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 34px);
  justify-content: space-between;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover, .topbar a:focus-visible { color: var(--cyan); }

main { padding: 12px 16px 48px; }

.game { width: fit-content; max-width: 100%; margin: 0 auto; }

.title-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow, .instructions, .scoreboard p {
  color: #a9b8c4;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.eyebrow { margin: 0 0 6px; }

h1 {
  margin: 0;
  color: var(--cyan);
  font-size: clamp(2.4rem, 9vw, 5.8rem);
  line-height: .8;
  letter-spacing: -.08em;
  text-transform: uppercase;
  text-shadow: 0 0 22px rgba(0, 229, 255, .45);
}

.sound, .controls button {
  border: 1px solid #263846;
  border-radius: 0;
  background: #07121c;
  color: #fff;
  cursor: pointer;
}

.sound { padding: 10px 12px; font-size: .7rem; text-transform: uppercase; }
.sound:hover, .sound:focus-visible { border-color: var(--cyan); outline: none; }

.scoreboard {
  display: grid;
  grid-template-columns: 1fr minmax(150px, 2fr) 1fr;
  align-items: center;
  min-height: 72px;
  text-align: center;
}

.scoreboard > div { display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.scoreboard .label { color: #a9b8c4; font-size: .72rem; text-transform: uppercase; }
.scoreboard strong { font-size: 2rem; }
.scoreboard > div:first-child strong { color: var(--cyan); }
.scoreboard > div:last-child strong { color: var(--pink); }
.scoreboard p { margin: 0; line-height: 1.4; }

.board-shell {
  width: fit-content;
  max-width: none;
  overflow: hidden;
  border: 1px solid #14232e;
  background: #000;
  box-shadow: 0 0 42px rgba(0, 229, 255, .09), 0 0 70px rgba(255, 43, 214, .06);
}

canvas {
  display: block;
  max-width: none;
  background: #000;
  outline: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: manipulation;
}

canvas:focus-visible { box-shadow: inset 0 0 0 2px #fff; }

.controls {
  display: grid;
  grid-template-columns: 72px minmax(150px, 1fr) 72px;
  gap: 8px;
  margin-top: 16px;
}

.controls button {
  min-height: 52px;
  padding: 10px;
  text-transform: uppercase;
  touch-action: none;
  user-select: none;
}

.controls button:hover, .controls button:focus-visible, .controls button.active {
  border-color: var(--lime);
  background: #10210e;
  outline: none;
}

.instructions { margin: 18px 0 0; text-align: center; line-height: 1.8; }
kbd { color: #fff; font: inherit; }

@media (max-width: 560px) {
  .title-row { align-items: center; }
  .scoreboard { grid-template-columns: 1fr 1.5fr 1fr; }
  .scoreboard .label { display: none; }
  .scoreboard p { font-size: .62rem; }
  .instructions { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
