:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  padding: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Pretendard", system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  background: radial-gradient(circle at 50% 0%, #1b2233, #0e1118 70%);
  color: #e9edf5;
}

.game {
  width: 100%;
  max-width: 880px;
  height: 100%;
  max-height: 640px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
.hud { justify-content: space-between; }
.keys { color: #7f8ba1; font-size: 12px; }
.player { color: #b9c6dd; font-size: 12px; white-space: nowrap; }
.timer { color: #ffd479; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.timer.low { color: #ff7a7a; font-weight: 700; }
.score { color: #8fe3c8; font-size: 12px; white-space: nowrap; }

button {
  font: inherit;
  color: #e9edf5;
  background: #222a38;
  border: 1px solid #313c4f;
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
}
button:hover { background: #2b3547; }
button:active { transform: translateY(1px); }

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #1a2030;
  border: 1px solid #2b3444;
}
canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  background: rgba(12, 16, 24, .72);
}
.msg[hidden] { display: none; }
.msg strong { font-size: 22px; }
.msg span { font-size: 13px; color: #a8b3c7; }
.msg .ranking { font-size: 12px; color: #8fe3c8; }

@media (max-height: 480px) {
  .keys { display: none; }
}
