:root {
  --bg: #0b0614;
  --bg2: #160b28;
  --panel: #1a102e;
  --pink: #ff4da6;
  --cyan: #4de6ff;
  --gold: #ffd166;
  --text: #f4eefc;
  --muted: #9b8fb3;
  --lane-l: #c44dff;
  --lane-d: #3ecbff;
  --lane-u: #4dff7a;
  --lane-r: #ff4d4d;
  --border: #3a2a55;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 20% -10%, #2a1048 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--font);
}

#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.logo {
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--pink);
  font-size: 1.35rem;
  margin-right: 10px;
}

.tag { color: var(--muted); font-size: 0.9rem; }
.links { color: var(--muted); font-size: 0.85rem; }
.links a { color: var(--cyan); text-decoration: none; }
.links a:hover { text-decoration: underline; }
.dot { margin: 0 6px; }

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
}

.stage-wrap {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 2px var(--border),
    0 20px 50px rgba(0,0,0,0.45),
    0 0 40px rgba(255, 77, 166, 0.12);
  background: #000;
  aspect-ratio: 4 / 3;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  background: #12081f;
  touch-action: none;
  cursor: crosshair;
}

.panel {
  background: linear-gradient(180deg, var(--panel), #120a20);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px 20px;
}

.panel h2 {
  margin: 14px 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan);
}
.panel h2:first-child { margin-top: 0; }

.keys {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 2px 6px;
  margin-right: 3px;
  border-radius: 5px;
  border: 1px solid #4a3868;
  background: #241536;
  font-size: 0.78rem;
  font-family: ui-monospace, monospace;
  text-align: center;
}

.muted { color: var(--muted); line-height: 1.45; font-size: 0.9rem; }
.small { font-size: 0.78rem; }
.touch-hint { color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }

.pads {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.pads button {
  border: 0;
  border-radius: 12px;
  padding: 16px 0;
  font-size: 1.2rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.pads button:nth-child(1) { background: var(--lane-l); }
.pads button:nth-child(2) { background: var(--lane-d); }
.pads button:nth-child(3) { background: var(--lane-u); }
.pads button:nth-child(4) { background: var(--lane-r); }
.pads button:active, .pads button.active { filter: brightness(1.25); transform: scale(0.96); }

@media (max-width: 900px) {
  #pads { display: grid !important; }
  #pads[hidden] { display: grid !important; }
}
