:root {
  color-scheme: dark;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  background: #080613;
  color: #f9efff;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 0%, #29205a 0%, #100b29 42%, #080613 83%);
}

.game-shell {
  width: min(100%, 1400px);
  padding: clamp(14px, 2.2vw, 30px);
}

.masthead {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 6px 20px;
  margin: 0 0 12px;
}

.eyebrow, footer, button { font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace; font-weight: 800; }
.eyebrow { margin: 0; color: #f6a9dc; font-size: clamp(7px, 0.72vw, 10px); letter-spacing: .08em; }
h1 { grid-column: 1; margin: 0; font-size: clamp(23px, 4.1vw, 57px); line-height: .9; letter-spacing: -.08em; text-shadow: 3px 3px 0 #61245f, 0 0 16px #ed76d2; }
h1 span { color: #ffc860; }

button {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  border: 1px solid #9c5cbb;
  background: rgba(16, 10, 37, .82);
  color: #ffe8c3;
  padding: 10px 12px;
  font-size: 8px;
  cursor: pointer;
}
button:hover, button:focus-visible { outline: none; border-color: #ffc660; box-shadow: 0 0 14px #e576d7; }

.game-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 2px solid #8053a9;
  box-shadow: 0 0 0 4px #1b1234, 0 16px 45px rgba(0, 0, 0, .58), inset 0 0 42px #10051d;
  background: #110b28;
}

canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }

.touch-controls {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: none;
  grid-template-columns: repeat(3, 52px);
  gap: 7px;
}
.move-button, .dash-button, .jump-button, .heavy-button {
  grid-column: auto;
  grid-row: auto;
  align-self: auto;
}
.move-button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 204, 104, .72);
  border-radius: 50%;
  background: rgba(16, 8, 36, .78);
  color: #ffe1a2;
  font-size: 18px;
  line-height: 1;
  touch-action: none;
}
.move-button.is-held { background: rgba(112, 49, 119, .9); box-shadow: 0 0 18px #e576d7; }
.dash-button {
  display: grid;
  place-items: center;
  width: 62px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 132, 108, .9);
  background: rgba(64, 18, 45, .84);
  color: #ffe1a2;
  font-size: 10px;
  touch-action: none;
}
.dash-button.is-cooling { color: #826477; border-color: #4f384f; }
.jump-button, .heavy-button {
  display: grid;
  place-items: center;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 204, 104, .72);
  background: rgba(18, 10, 39, .86);
  color: #ffe1a2;
  font-size: 9px;
  touch-action: none;
}
.jump-button { width: 52px; color: #cddcff; border-color: rgba(156, 190, 255, .85); }
.heavy-button { width: 62px; color: #ffd873; border-color: rgba(255, 182, 93, .9); background: rgba(73, 38, 29, .84); }

footer { display: flex; justify-content: center; align-items: center; gap: 10px; padding-top: 12px; color: #bba4d0; font-size: clamp(7px, 0.72vw, 10px); text-align: center; }
footer i { width: 4px; height: 4px; background: #f7b858; transform: rotate(45deg); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 560px) {
  .game-shell { padding: 12px 8px; }
  .masthead { gap: 4px 10px; }
  button { padding: 9px 7px; font-size: 7px; }
  footer { gap: 7px; font-size: 6px; }
}

@media (pointer: coarse) {
  .touch-controls { display: grid; }
}
