:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050714;
  color: #f7f7ff;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(48, 92, 255, .25), transparent 35rem),
    radial-gradient(circle at 85% 25%, rgba(255, 65, 148, .14), transparent 32rem),
    #050714;
}

button { font: inherit; }

.shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 42px 0 30px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #7ed8ff;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.45rem, 8vw, 5.7rem);
  line-height: .9;
  letter-spacing: -.065em;
  background: linear-gradient(95deg, #fff 20%, #ffe85b 48%, #ff63ae);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 690px;
  margin: 16px 0 0;
  color: #aeb8d5;
  font-size: clamp(.96rem, 2vw, 1.12rem);
  line-height: 1.55;
}

.key-guide {
  display: grid;
  gap: 8px;
  padding: 15px 17px;
  border: 1px solid #273051;
  border-radius: 16px;
  background: rgba(12, 17, 38, .78);
  color: #b8c2df;
  font-size: .78rem;
  white-space: nowrap;
}

kbd {
  display: inline-grid;
  min-width: 23px;
  height: 23px;
  margin-right: 3px;
  place-items: center;
  border: 1px solid #465177;
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #161d38;
  color: #fff;
  font: 700 .68rem ui-monospace, SFMono-Regular, Menlo, monospace;
}

.game-card {
  padding: clamp(10px, 2vw, 18px);
  border: 1px solid rgba(116, 135, 200, .28);
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(19, 25, 52, .96), rgba(8, 11, 28, .94));
  box-shadow: 0 26px 75px rgba(0, 0, 0, .42);
}

.canvas-frame {
  overflow: hidden;
  aspect-ratio: 3 / 2;
  border: 1px solid #242b4a;
  border-radius: 17px;
  background: #000;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  outline: none;
  touch-action: none;
}

canvas:focus-visible {
  box-shadow: inset 0 0 0 3px #ffdf4f;
}

.touch-controls {
  display: none;
  grid-template-columns: repeat(3, 58px);
  grid-template-areas:
    ". up ."
    "left pause right"
    ". down .";
  justify-content: center;
  gap: 7px;
  margin-top: 16px;
}

.control {
  width: 58px;
  height: 48px;
  border: 1px solid #3b466d;
  border-radius: 13px;
  background: linear-gradient(#232d53, #151c38);
  color: #f5f7ff;
  box-shadow: 0 4px 0 #080c1d;
  font-weight: 900;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.control:active {
  translate: 0 3px;
  box-shadow: 0 1px 0 #080c1d;
}

.up { grid-area: up; }
.left { grid-area: left; }
.pause { grid-area: pause; color: #ffe552; }
.right { grid-area: right; }
.down { grid-area: down; }

.touch-hint {
  display: none;
  margin: 10px 0 2px;
  color: #8490b3;
  text-align: center;
  font-size: .78rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 4px 0;
  color: #707b9e;
  font-size: .75rem;
}

footer p { margin: 0; }
.source { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 760px), (pointer: coarse) {
  .shell { padding-top: 25px; }
  .hero { grid-template-columns: 1fr; gap: 15px; }
  .key-guide { display: none; }
  .touch-controls { display: grid; }
  .touch-hint { display: block; }
  footer { flex-direction: column; gap: 5px; }
}

@media (max-width: 460px) {
  .shell { width: min(100% - 16px, 1120px); }
  .game-card { border-radius: 18px; }
  .canvas-frame { border-radius: 11px; }
}
