:root {
  --bg-1: #0c0f14;
  --bg-2: #1b2230;
  --bg-3: #23324a;
  --accent: #f4b642;
  --accent-2: #ff6b6b;
  --ink: #e6eefc;
  --muted: #8fa3c7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Space Grotesk", "IBM Plex Sans", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(1200px 600px at 15% -10%, #2a3b5c 0%, transparent 60%),
    radial-gradient(900px 700px at 85% 10%, #2b3a4f 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 18px 28px;
  display: grid;
  gap: 16px;
}

.topbar {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto auto;
  align-items: center;
}

.brand {
  font-size: 22px;
  letter-spacing: 1px;
  font-weight: 700;
}

.stats {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-weight: 600;
}

.stats span {
  color: var(--ink);
  margin-left: 6px;
}

.actions {
  display: flex;
  gap: 8px;
}

button {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: #2d3a52;
  color: var(--ink);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

button:hover { transform: translateY(-1px); }
button:active { transform: translateY(1px); }

.stage {
  position: relative;
  border-radius: 18px;
  padding: 14px;
  background: rgba(18, 22, 31, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 24px 60px rgba(0,0,0,0.35);
}

#game {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: linear-gradient(180deg, #0c1220, #0f1627 70%, #0b101b);
}

.hint {
  position: absolute;
  bottom: 18px;
  left: 18px;
  color: rgba(230, 238, 252, 0.7);
  font-size: 13px;
  line-height: 1.5;
}

.footer {
  color: var(--muted);
  font-size: 13px;
}

.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 18, 0.75);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.overlay.show {
  display: flex;
}

.panel {
  width: min(420px, 90vw);
  background: #141a26;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  text-align: center;
}

.panel h1 {
  margin: 0 0 10px;
  font-size: 26px;
}

.panel p {
  margin: 0 0 18px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr;
  }
  .stats { flex-wrap: wrap; }
  .actions { justify-content: flex-start; }
}
