* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --lane1: #ff3d81; --lane2: #33e0ff; --lane3: #ffd23f; --lane4: #7bff5a;
  --bg: #241a4e; --ink: #f4efff;
}
html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif; }
#game-canvas { position: fixed; inset: 0; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; }
#top-bar { position: absolute; top: 10px; left: 14px; right: 14px; display: flex;
  justify-content: space-between; font-size: 12px; letter-spacing: 2px; color: #b9a8ff; }
#top-bar span { font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
#score-label span { color: #ffd23f; text-shadow: 0 0 14px #ffd23f80; }
#combo-wrap { position: absolute; top: 22%; left: 50%; transform: translateX(-50%);
  text-align: center; opacity: 0.85; }
#combo { font-size: 44px; font-weight: 800; color: #fff; text-shadow: 0 0 18px #ff3d81; }
#combo.pop { animation: pop .22s ease-out; }
#combo-x { letter-spacing: 4px; font-size: 11px; color: #b9a8ff; }
#judge { position: absolute; top: 32%; left: 50%; transform: translateX(-50%);
  font-size: 30px; font-weight: 800; letter-spacing: 3px; }
#judge.pop { animation: pop .28s ease-out; }
@keyframes pop { 0% { transform: translateX(-50%) scale(1.5); } 100% { transform: translateX(-50%) scale(1); } }
#bars { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  width: min(420px, 84vw); display: flex; flex-direction: column; gap: 6px; }
.bar { display: flex; align-items: center; gap: 8px; }
.bar-label { font-size: 9px; letter-spacing: 2px; width: 44px; color: #b9a8ff; }
.track { flex: 1; height: 7px; background: #2a2148; border-radius: 4px; overflow: hidden; }
#hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff3d81, #33e0ff);
  border-radius: 4px; transition: width .18s; }
#hp-fill.low { background: #ff2244; animation: blink .5s infinite alternate; }
@keyframes blink { from { opacity: 1; } to { opacity: .55; } }
#prog-fill { height: 100%; background: #ffd23f; border-radius: 4px; }
body:not(.ingame) #hud { opacity: .25; }
/* overlays */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #241a4a, #0d0a1e 75%); }
.overlay.hidden { display: none; }
.panel { text-align: center; padding: 34px 28px; max-width: 560px; }
.panel h1 { font-size: clamp(34px, 8vw, 56px); letter-spacing: 2px; }
.panel h1 span { color: var(--lane2); }
.tag { color: #c9b8ff; margin: 14px 0 18px; line-height: 1.6; font-size: 15px; }
.howto { list-style: none; text-align: left; display: inline-block; color: #d9ccff;
  font-size: 14px; line-height: 2; margin-bottom: 20px; }
.howto b { color: #ffd23f; }
button, a.btn { pointer-events: auto; cursor: pointer; border: 0; border-radius: 12px;
  padding: 15px 36px; font-size: 17px; font-weight: 800; letter-spacing: 2px;
  color: #12081f; background: linear-gradient(90deg, #ffd23f, #ff3d81);
  box-shadow: 0 0 26px #ff3d8170, 0 6px 0 #6b1e40; }
button:active { transform: translateY(3px); box-shadow: 0 0 26px #ff3d8170, 0 2px 0 #6b1e40; }
.hint { margin-top: 14px; font-size: 12px; color: #8f7fc0; }
#end-stats { color: #d9ccff; line-height: 2; margin: 16px 0 22px; }
#end-stats b { color: #fff; }
/* touch pads */
#touch-controls { position: absolute; bottom: 44px; left: 0; right: 0;
  display: none; justify-content: center; gap: 10px; pointer-events: auto; }
@media (pointer: coarse) { #touch-controls { display: flex; } }
.lane-pad { width: min(23vw, 96px); height: min(23vw, 96px); border-radius: 16px;
  border: 2px solid #5a4a9a; background: #1c1440cc; color: #cbb9ff;
  font-size: 20px; font-weight: 800; padding: 0; box-shadow: none; }
.lane-pad:nth-child(1) { border-color: var(--lane1); }
.lane-pad:nth-child(2) { border-color: var(--lane2); }
.lane-pad:nth-child(3) { border-color: var(--lane3); }
.lane-pad:nth-child(4) { border-color: var(--lane4); }
.lane-pad.pressed { background: #3a2b70; transform: scale(.94); }
body { background: #241a4e; }
