:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: #101623;
  --line: #273244;
  --text: #f8fafc;
  --muted: #95a3b8;
  --accent: #26c6a8;
  --accent-2: #7c5cff;
  --danger: #ff7a7a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(38, 198, 168, 0.2), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(124, 92, 255, 0.18), transparent 36rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, Pretendard, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.game-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.game-panel {
  width: min(100%, 1080px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 22, 35, 0.96), rgba(8, 11, 18, 0.96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  letter-spacing: 0;
}

.hud span {
  min-width: 0;
  padding: 12px 14px;
  background: #0d1320;
  color: var(--muted);
  white-space: nowrap;
}

.hud strong {
  color: var(--text);
  margin-left: 6px;
}

.hud .message {
  color: var(--accent);
  font-weight: 800;
  text-align: right;
}

.canvas-wrap {
  position: relative;
  background: #000;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 7, 12, 0.46);
  text-align: center;
}

.overlay[hidden] {
  display: none;
}

.overlay > div {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(8, 11, 18, 0.86);
  backdrop-filter: blur(10px);
}

.kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 8px 0 10px;
  font-size: clamp(36px, 8vw, 74px);
  line-height: 0.95;
}

p {
  margin: 0;
  color: var(--muted);
}

.start-button,
.controls button {
  border: 0;
  color: var(--text);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
  font-weight: 900;
}

.start-button {
  min-width: 180px;
  min-height: 48px;
  margin-top: 20px;
  border-radius: 8px;
}

.controls {
  display: none;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #0d1320;
}

.control-group {
  display: flex;
  gap: 10px;
}

.controls button {
  width: 68px;
  height: 56px;
  border-radius: 8px;
  font-size: 22px;
  touch-action: none;
}

.controls button.pressed {
  transform: translateY(2px);
  filter: brightness(1.2);
}

.controls .jump {
  width: 112px;
  background: linear-gradient(135deg, #ffb84d, #ff6f91);
}

.help {
  padding: 12px 14px 14px;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .game-shell {
    padding: 10px;
    align-items: start;
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hud .message {
    grid-column: span 2;
    text-align: left;
  }

  .controls {
    display: flex;
  }

  .help {
    display: none;
  }
}
