:root {
  --gba: #2a3d86;
  --gba-hi: #3c54a8;
  --gba-lo: #1a2758;
  --screen-well: #0b0c10;
  --lcd: #090b12;
  --btn: #1b1c24;
  --btn-hi: #3a3c48;
  --ab: #c45c78;
  --ab-hi: #e08098;
  --ink: #e8e0c8;
  --s: 3;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 700px at 50% 20%, #12182c 0%, #07080c 55%, #050508 100%);
  color: var(--ink);
  font-family: "Press Start 2P", ui-monospace, monospace;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px 40px;
}

.skip {
  position: absolute;
  left: -999px;
}

.site-title {
  margin: 0 0 14px;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: #8eb4e8;
  text-shadow: 0 0 12px #2868b088;
}

.device {
  background: linear-gradient(160deg, var(--gba-hi) 0%, var(--gba) 42%, var(--gba-lo) 100%);
  border-radius: 28px 28px 80px 80px;
  padding: 18px 18px 28px;
  box-shadow:
    0 0 0 3px #0c1228,
    0 18px 50px #000000aa,
    inset 0 1px 0 #8aa0e088,
    inset 0 -8px 16px #10183888;
  max-width: 100%;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 8px 10px;
  font-size: 7px;
  letter-spacing: 0.18em;
  color: #c8d8f8;
  opacity: 0.85;
}

.screen-well {
  background: var(--screen-well);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: inset 0 0 0 3px #05060a, inset 0 8px 16px #000000cc;
}

#stage {
  width: calc(240px * var(--s));
  height: calc(160px * var(--s));
  max-width: calc(100vw - 64px);
  position: relative;
}

#screen {
  width: 240px;
  height: 160px;
  transform: scale(var(--s));
  transform-origin: top left;
  position: relative;
  background: var(--lcd);
  overflow: hidden;
}

#game {
  width: 240px;
  height: 160px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  background: #000;
}

.speaker {
  width: 48px;
  height: 8px;
  margin: 12px auto 0;
  background: repeating-linear-gradient(90deg, #1a2450 0 3px, transparent 3px 6px);
  opacity: 0.5;
  border-radius: 2px;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px 4px;
  user-select: none;
  touch-action: manipulation;
}

.dpad {
  position: relative;
  width: 96px;
  height: 96px;
}

.dpad button {
  position: absolute;
  width: 32px;
  height: 32px;
  background: var(--btn);
  border: 0;
  color: #889;
  box-shadow: inset 0 1px 0 var(--btn-hi), 0 3px 0 #05060a;
  border-radius: 4px;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
}

.dpad button:active { transform: translateY(2px); box-shadow: inset 0 1px 0 #000; }

.dpad .u { left: 32px; top: 0; }
.dpad .d { left: 32px; bottom: 0; }
.dpad .l { left: 0; top: 32px; }
.dpad .r { right: 0; top: 32px; }

.ab {
  display: flex;
  gap: 14px;
  align-items: center;
}

.ab button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 35% 30%, var(--ab-hi), var(--ab));
  color: #2a1020;
  font-family: inherit;
  font-size: 10px;
  box-shadow: 0 4px 0 #5a2038, inset 0 2px 0 #f0a0b088;
  cursor: pointer;
}

.ab button:active { transform: translateY(3px); box-shadow: 0 1px 0 #5a2038; }

.ab .b { transform: translateY(12px); }
.ab .b:active { transform: translateY(15px); }

.start-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 4px 0 8px;
}

.start-row button {
  border: 0;
  background: #1a2450;
  color: #9ab;
  font-family: inherit;
  font-size: 6px;
  letter-spacing: 0.12em;
  padding: 6px 14px;
  border-radius: 10px;
  transform: rotate(-18deg);
  cursor: pointer;
}

.hint {
  margin-top: 18px;
  font-size: 8px;
  line-height: 1.9;
  text-align: center;
  color: #7a8aa8;
  max-width: 520px;
}

.hint kbd {
  color: #d0d8f0;
  background: #1a2238;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 8px;
}

footer {
  margin-top: 22px;
  font-size: 7px;
  color: #4a5870;
  letter-spacing: 0.12em;
}

@media (max-width: 640px) {
  .hint .desk { display: none; }
  .device { border-radius: 18px 18px 48px 48px; padding: 12px 10px 16px; }
  .controls { padding: 12px 8px 0; }
}

@media (min-width: 641px) {
  .controls, .start-row { display: none; }
}
