* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 24px 16px 32px;
  color: #f7f4ff;
  background: #10152a;
  font-family: Arial, Helvetica, sans-serif;
}

.game-page {
  width: min(100%, 980px);
  margin: 0 auto;
}

h1 {
  margin: 0 0 6px;
  color: #ff4eae;
  font-size: clamp(1.7rem, 5vw, 2.5rem);
}

.intro {
  margin: 0 0 16px;
  color: #c8c9dd;
}

.game-frame {
  overflow: hidden;
  border: 3px solid #343b60;
  border-radius: 12px;
  background: #080c1c;
  box-shadow: 0 12px 36px #05071199;
}

.game-hud {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #1c2340;
  font-weight: 700;
}

#livesLabel {
  color: #ff4eae;
  letter-spacing: 3px;
}

#gameBox {
  width: 100%;
  line-height: 0;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  touch-action: none;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  color: #c8c9dd;
}

.controls p {
  margin: 0;
  line-height: 1.45;
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(2, 44px);
  gap: 4px;
  flex: 0 0 auto;
}

.dpad button {
  border: 1px solid #66709d;
  border-radius: 9px;
  color: white;
  background: #293254;
  font-size: 1.15rem;
  touch-action: none;
  user-select: none;
}

.dpad button:active {
  background: #ff4eae;
}

.up { grid-column: 2; grid-row: 1; }
.left { grid-column: 1; grid-row: 2; }
.down { grid-column: 2; grid-row: 2; }
.right { grid-column: 3; grid-row: 2; }

@media (max-width: 560px) {
  body { padding: 16px 10px 24px; }
  .game-hud { padding: 9px 10px; font-size: 0.8rem; }
  .controls { align-items: flex-start; flex-direction: column; gap: 10px; }
}
