* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #070611;
  --bg2: #0e0b22;
  --ink: #eef0ff;
  --muted: #9aa0c8;
  --accent: #8a7bff;
  --gold: #ffd36b;
}

html, body {
  height: 100%;
  background: radial-gradient(120% 90% at 50% 0%, var(--bg2), var(--bg) 70%);
  color: var(--ink);
  font-family: "Trebuchet MS", system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
}

.topbar .back {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  transition: background 0.15s, color 0.15s;
}
.topbar .back:hover { background: rgba(255, 255, 255, 0.1); color: var(--ink); }

.topbar .brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-shadow: 0 0 18px rgba(138, 123, 255, 0.6);
}

.topbar .hs {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.topbar .hs b { color: var(--gold); font-size: 15px; margin-left: 4px; }

#stage {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 4px 8px 8px;
}

#game {
  display: block;
  border-radius: 18px;
  background: linear-gradient(180deg, #0a0820, #06040f);
  box-shadow: 0 0 0 1px rgba(138, 123, 255, 0.18), 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 0 60px rgba(60, 40, 120, 0.25);
  touch-action: none;
  cursor: pointer;
}

#hud {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 18px;
  pointer-events: none;
}

.panel {
  background: rgba(12, 10, 30, 0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(138, 123, 255, 0.22);
  border-radius: 14px;
  padding: 8px 12px;
  text-align: center;
}
.panel .lbl {
  display: block;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 2px;
}
.panel.score b {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(255, 211, 107, 0.5);
  color: #fff;
}
.panel.next { padding: 6px 8px 4px; }
.panel.next #next { display: block; width: 60px; height: 60px; }

.combo {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%) scale(0.6);
  font-size: 30px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(255, 211, 107, 0.9), 0 2px 8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.combo.show { animation: pop 0.7s ease-out; }
@keyframes pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  25% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -90%) scale(1); }
}

.hint {
  flex: 0 0 auto;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 14px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  line-height: 1.5;
}

@media (max-width: 480px) {
  .topbar .brand { font-size: 15px; }
  .hint { font-size: 11px; }
}
