:root {
  color-scheme: dark;
  --ink: #151320;
  --paper: #fff2bf;
  --sun: #ffb347;
  --coral: #f86f60;
  --aqua: #25c7c7;
  --sea: #126a7a;
  --sand: #e5bf6a;
  --shadow: rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #1c1637 0%, #3c2254 30%, #b64b58 62%, #1b2b40 100%);
  color: var(--paper);
  font-family: "Courier New", Courier, monospace;
}

.arcade-shell {
  width: min(1040px, calc(100vw - 24px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 24px;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 12px;
}

.arcade-header {
  display: grid;
  gap: 4px;
  text-align: center;
  text-transform: uppercase;
}

.arcade-header p,
.arcade-header h1 {
  margin: 0;
}

.arcade-header p {
  color: var(--aqua);
  font-size: clamp(0.78rem, 2vw, 0.95rem);
  letter-spacing: 0;
}

.arcade-header h1 {
  color: #fff6cf;
  font-size: clamp(1.55rem, 6vw, 3.4rem);
  line-height: 1;
  text-shadow: 0 3px 0 #6f254f, 0 7px 0 var(--shadow);
  letter-spacing: 0;
}

.game-frame {
  border: 4px solid #fff2bf;
  background: #151320;
  box-shadow:
    0 0 0 4px #2d1838,
    0 18px 40px rgba(0, 0, 0, 0.45);
}

canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #16142c;
  outline: none;
}

canvas:focus-visible {
  box-shadow: inset 0 0 0 2px var(--aqua);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: clamp(0.72rem, 2vw, 0.9rem);
  line-height: 1.2;
}

.controls span {
  border: 2px solid rgba(255, 242, 191, 0.5);
  background: rgba(21, 19, 32, 0.66);
  padding: 6px 8px;
}

@media (max-width: 640px) {
  .arcade-shell {
    width: min(100vw - 12px, 1040px);
    padding-top: 10px;
    align-content: start;
  }

  .game-frame {
    border-width: 3px;
    box-shadow: 0 0 0 3px #2d1838;
  }
}
