:root {
  color-scheme: dark;
  --bg: #030712;
  --panel: #0f172a;
  --accent: #38bdf8;
  --text: #e2e8f0;
  --muted: #94a3b8;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: radial-gradient(ellipse at top, #0b1224 0%, var(--bg) 55%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem;
}

.top {
  text-align: center;
}

.top h1 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #7dd3fc, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tag {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

#stage {
  position: relative;
  width: min(100vw - 1.5rem, 480px);
  aspect-ratio: 2 / 3;
  max-height: min(78vh, 720px);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.25),
    0 20px 50px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(56, 189, 248, 0.08);
  background: #050814;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

#loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 20, 0.85);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
}

#loading.hidden,
.hidden {
  display: none !important;
}

#touch-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  pointer-events: none;
}

.help {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  max-width: 36rem;
  line-height: 1.5;
}

kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  font-size: 0.75rem;
  color: #e2e8f0;
}

@media (pointer: coarse) {
  .help {
    display: none;
  }
  #touch-hint {
    display: block;
  }
}
