:root {
  color-scheme: dark;
  --ink: #f7f4ea;
  --muted: #b8c1c5;
  --panel: rgba(14, 18, 24, 0.82);
  --line: rgba(255, 255, 255, 0.18);
  --accent: #ff5a5f;
  --accent-2: #27d4c3;
  --gold: #ffd166;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 22% 10%, rgba(39, 212, 195, 0.22), transparent 28rem),
    linear-gradient(135deg, #15171b 0%, #252832 42%, #191f24 100%);
  color: var(--ink);
  font-family:
    Inter, Pretendard, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.game-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  align-content: center;
  padding: 20px 0;
}

.topbar,
.statusbar {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.topbar {
  min-height: 104px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 16px;
}

.brand {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.brand-kicker {
  color: var(--muted);
  font-size: clamp(0.82rem, 1.4vw, 0.95rem);
  letter-spacing: 0;
}

.brand-logo {
  display: block;
  width: clamp(216px, 28vw, 360px);
  height: clamp(52px, 7vw, 78px);
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 8px;
  width: min(380px, 48vw);
}

.stat {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 10px;
  display: grid;
  gap: 1px;
}

.stat span {
  color: var(--muted);
  font-size: 0.78rem;
}

.stat b {
  color: var(--ink);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  line-height: 1;
}

.stage-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

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

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(90deg, rgba(4, 8, 12, 0.72), rgba(4, 8, 12, 0.18));
}

.overlay[hidden] {
  display: none;
}

.overlay-panel {
  width: min(420px, 92%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(12, 15, 20, 0.82);
  backdrop-filter: blur(18px);
  padding: clamp(18px, 3.5vw, 34px);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
}

.overlay-panel p {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 800;
}

.overlay-panel h1 {
  margin: 0 0 20px;
  font-size: clamp(2rem, 7vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.overlay-panel h1[hidden] {
  display: none;
}

.title-art {
  display: block;
  width: 100%;
  max-height: min(32vh, 248px);
  object-fit: contain;
  margin: -8px auto 20px;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.4));
}

.title-art[hidden] {
  display: none;
}

.overlay-score {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  padding: 14px 0;
}

.overlay-score span {
  color: var(--muted);
}

.overlay-score strong {
  color: var(--gold);
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1;
}

#startButton {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #ff9f1c);
  color: #161616;
  font-weight: 900;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(255, 90, 95, 0.25);
}

#startButton:active {
  transform: translateY(1px);
}

.statusbar {
  min-height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

#comboText {
  color: var(--gold);
}

@media (max-width: 720px) {
  .game-shell {
    width: min(100vw - 18px, 1180px);
    gap: 10px;
    padding: 9px 0;
    align-content: start;
  }

  .topbar {
    min-height: 0;
    display: grid;
  }

  .brand-logo {
    width: min(290px, 76vw);
    height: 64px;
  }

  .stats {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat {
    padding: 7px 8px;
  }

  .stage-wrap,
  .topbar,
  .statusbar {
    border-radius: 7px;
  }
}
