:root {
  color-scheme: dark;
  --bg: #101017;
  --panel: #171923;
  --text: #f1e6c8;
  --muted: #a79c87;
  --edge: #3b3243;
  --gold: #f4bc45;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(21, 23, 34, 0.94), rgba(9, 9, 14, 0.98)),
    repeating-linear-gradient(90deg, #11131d 0 48px, #0d0e15 48px 96px);
  color: var(--text);
  font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

.shell {
  width: min(100vw, 1180px);
  padding: 18px;
}

.game-panel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 36px);
  margin: 0 auto;
  border: 4px solid var(--edge);
  background: #090a10;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.48);
  image-rendering: pixelated;
}

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

.hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  text-shadow: 2px 2px #08080b;
}

.hud > div {
  min-width: 96px;
  padding: 8px 10px;
  border: 2px solid #46394a;
  background: rgba(16, 16, 23, 0.76);
  font-size: clamp(12px, 1.9vw, 18px);
}

.label {
  color: var(--gold);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 16px;
  padding: 24px;
  background: rgba(8, 8, 13, 0.78);
  text-align: center;
}

.overlay.hidden {
  display: none;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: clamp(34px, 7vw, 76px);
  line-height: 0.95;
  color: #ffe0a0;
  text-shadow: 4px 4px #4d2334;
}

p {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(14px, 2vw, 18px);
}

button {
  justify-self: center;
  min-width: 190px;
  padding: 12px 18px;
  border: 3px solid #624d37;
  background: #c9823b;
  color: #160e0d;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset -4px -4px 0 #7b412d, inset 4px 4px 0 #f3b258;
}

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

.keys {
  color: #cabca2;
  font-size: 13px;
}

kbd {
  display: inline-grid;
  min-width: 28px;
  height: 26px;
  margin: 0 3px;
  place-items: center;
  border: 2px solid #50475a;
  background: #1c1d28;
  color: #f5e6c3;
  box-shadow: inset -2px -2px 0 #101017;
}

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

  .game-panel {
    border-width: 2px;
  }

  .hud {
    top: 6px;
    left: 6px;
    right: 6px;
  }

  .hud > div {
    min-width: 0;
    padding: 6px;
  }
}
