:root {
  color-scheme: dark;
  --ink: #f4f0e8;
  --muted: #a5aaa5;
  --panel: #171b19;
  --line: #323834;
  --accent: #d6f05d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #0d100f;
  color: var(--ink);
  font-family: Pretendard, "Noto Sans KR", system-ui, sans-serif;
  display: grid;
  place-items: center;
  padding: 20px;
}

button { font: inherit; }

.game-shell {
  width: min(1180px, 100%);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

.topbar {
  min-height: 82px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { color: var(--accent); width: 38px; height: 38px; line-height: 1; flex: 0 0 auto; }
.brand-mark svg { display: block; width: 100%; height: 100%; }
h1 { margin: 0; font-size: 19px; letter-spacing: 0; }

.hud { display: flex; align-items: stretch; gap: 2px; }
.hud > div {
  width: 74px;
  padding: 7px 10px;
  border-left: 1px solid var(--line);
}
.hud span, .hud strong { display: block; }
.hud span { color: var(--muted); font-size: 10px; }
.hud strong { margin-top: 2px; font-size: 18px; font-variant-numeric: tabular-nums; }
.hud button {
  width: 42px;
  border: 1px solid var(--line);
  background: #202522;
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
}
.hud button:hover { background: #2b322e; }

.game-stage {
  position: relative;
  height: clamp(420px, 64vh, 680px);
  overflow: hidden;
  background: #111513;
}

canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 9, 8, .74);
  backdrop-filter: blur(5px);
  z-index: 3;
}
.overlay.hidden { display: none; }
.overlay-panel { text-align: center; padding: 28px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.overlay h2 { margin: 10px 0; font-size: clamp(28px, 5vw, 50px); letter-spacing: 0; }
.overlay p { color: #c1c6c1; line-height: 1.7; font-size: 14px; }
.overlay .ranking-status { min-height: 24px; margin: 8px 0 0; color: var(--accent); font-size: 12px; }
.overlay button {
  margin-top: 12px;
  min-width: 140px;
  padding: 12px 20px;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #171a13;
  font-weight: 800;
  cursor: pointer;
}
.overlay button:hover { filter: brightness(1.08); }

.result-banner {
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  padding: 9px 16px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(12, 15, 13, .86);
  font-size: 13px;
  font-weight: 800;
  transition: .22s ease;
}
.result-banner.show { opacity: 1; transform: translate(-50%, 0); }
.result-banner.hit { color: var(--accent); }
.result-banner.miss { color: #ff7a6e; }

@media (max-width: 680px) {
  body { padding: 0; display: block; }
  .game-shell { min-width: 0; min-height: 100vh; border: 0; overflow: hidden; }
  .topbar { min-height: 72px; padding: 10px 8px; gap: 8px; }
  .brand { min-width: 0; gap: 7px; }
  .brand-mark { width: 32px; height: 32px; }
  h1 { font-size: 16px; white-space: nowrap; }
  .hud { flex-shrink: 0; }
  .hud > div { width: 40px; padding: 7px 4px; }
  .hud button { width: 34px; }
  .game-stage { height: calc(100vh - 72px); min-height: 420px; }
}
