/* Font loaded from Google Fonts — works online.
   For offline: download woff2 from Google Fonts and place as PressStart2P.woff2 */
:root {
  --cyan: #00ffff; --mag: #ff00ff; --yel: #ffff00;
  --red:  #ff3333; --grn: #00ff88; --org: #ff8800;
  --bg:   #010108; 
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0; background: var(--bg); color: #fff;
  font-family: 'Press Start 2P', 'Courier New', 'Courier', monospace; font-weight: bold; overflow: hidden;
  -webkit-text-stroke: 0.3px currentColor; /* makes fallback font chunkier */
  text-rendering: geometricPrecision;
  touch-action: none; user-select: none;
  -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
canvas { display: block; position: absolute; top: 0; left: 0; }

/* ── HUD ── */
#hud { position: absolute; top: 0; left: 0; right: 0; z-index: 20; pointer-events: none; }
#hud-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 14px 0; gap: 8px;
}
#hud-stats { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hv { font-size: 15px; white-space: nowrap; text-shadow: 0 0 10px currentColor; letter-spacing: 2px; }
.hv.c { color: var(--cyan); } .hv.y { color: var(--yel); } .hv.m { color: var(--mag); }
.hv.r { color: var(--red); } .hv.g { color: var(--grn); }
#hud-btns { display: flex; gap: 8px; pointer-events: auto; flex-shrink: 0; }
.hbtn {
  background: rgba(0,0,0,0.75); border: 2px solid rgba(0,255,255,0.4);
  color: var(--cyan); border-radius: 8px; font-family: 'Press Start 2P', 'Courier New', 'Courier', monospace;
  cursor: pointer; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent; padding: 0;
  flex-shrink: 0;
}
.hbtn svg { width: 20px; height: 20px; stroke: var(--cyan); }
.hbtn:active { border-color: var(--cyan); box-shadow: 0 0 16px var(--cyan); }
#hud-row2 { display: flex; gap: 20px; align-items: center; padding: 8px 14px 0; pointer-events: none; }
#pwr-label { font-size: 13px; color: var(--yel); text-shadow: 0 0 8px var(--yel); display: none; align-items: center; gap: 4px; }
#pwr-label svg { width: 14px; height: 14px; }

/* ── Boss bar ── */
#boss-ui { position: absolute; top: 118px; left: 50%; transform: translateX(-50%); width: 80%; display: none; z-index: 22; text-align: center; }
#boss-lbl { font-size: 13px; color: #f33; letter-spacing: 3px; }
#boss-bar-bg { width: 100%; height: 14px; background: #1a0000; border: 2px solid #f33; margin: 6px 0 4px; box-shadow: 0 0 12px #f00; }
#boss-bar-fill { height: 100%; background: linear-gradient(90deg,#f33,#f88); transition: width .08s; }
#boss-phase { font-size: 12px; color: #f88; }

/* ── Combo & flash ── */
#combo-el { position: absolute; right: 16px; top: 116px; font-size: 16px; color: var(--mag); pointer-events: none; text-shadow: 0 0 12px var(--mag); z-index: 20; opacity: 0; transition: opacity .2s; letter-spacing: 1px; }
#lvl-flash { position: absolute; top: 42%; left: 50%; transform: translate(-50%,-50%); font-size: 24px; color: var(--yel); pointer-events: none; text-shadow: 0 0 30px var(--yel); z-index: 50; opacity: 0; transition: opacity .25s; text-align: center; line-height: 1.7; width: 90%; }

/* ── Power pips ── */
#pip-bar { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 16px; z-index: 20; pointer-events: none; align-items: center; }
.pip { width: 13px; height: 13px; border-radius: 50%; opacity: .18; transition: opacity .2s, transform .15s; }
.pip.on { opacity: 1; transform: scale(1.5); }
.pip-lbl { font-size: 7px; color: #555; }

/* ── Menus ── */
.mc {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(1,1,12,0.97); padding: 32px 26px;
  border: 2px solid var(--cyan); text-align: center; z-index: 30;
  width: min(340px, 92vw);
  box-shadow: 0 0 50px rgba(0,255,255,0.12), inset 0 0 40px rgba(0,255,255,0.025);
}
.mc .title { color: var(--cyan); font-size: 30px; margin: 0 0 6px; text-shadow: 0 0 20px var(--cyan); line-height: 1.4; }
.mc h2 { color: var(--red); font-size: 18px; margin: 0 0 16px; }
.mc .sub { font-size: 9px; color: #555; margin-bottom: 6px; }
.mc .hi  { font-size: 12px; color: var(--yel); margin-bottom: 22px; text-shadow: 0 0 8px var(--yel); }
.btn {
  display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px;
  background: rgba(0,255,255,0.06); color: var(--cyan);
  border: 2px solid var(--cyan); padding: 16px 10px;
  font-family: 'Press Start 2P', 'Courier New', 'Courier', monospace; font-size: 12px; cursor: pointer;
  margin-bottom: 12px; letter-spacing: 1px; min-height: 52px;
  transition: background .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent;
}
.btn:last-child { margin-bottom: 0; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; flex-shrink: 0; }
.btn:active,.btn:hover { background: rgba(0,255,255,0.16); box-shadow: 0 0 18px rgba(0,255,255,0.28); }
.btn.y { color:var(--yel); border-color:var(--yel); background:rgba(255,255,0,0.05); }
.btn.y:active,.btn.y:hover { background:rgba(255,255,0,0.16); }
.btn.r { color:var(--red); border-color:var(--red); background:rgba(255,51,51,0.05); }
.btn.r:active { background:rgba(255,51,51,0.16); }
.btn.g { color:var(--grn); border-color:var(--grn); background:rgba(0,255,136,0.05); }
.btn.g:active { background:rgba(0,255,136,0.16); }

/* ── Pause overlay ── */
#pause-ov { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; z-index: 26; background: rgba(0,0,0,0.65); }
#pause-ov.on { display: flex; }
#pause-inner { text-align: center; width: min(320px, 90vw); }
#pause-inner .pt { font-size: 26px; color: var(--cyan); text-shadow: 0 0 22px var(--cyan); margin-bottom: 26px; letter-spacing: 3px; }

/* ── Settings ── */
#settings-panel {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: rgba(1,1,12,0.98); padding: 24px 20px;
  border: 2px solid var(--cyan); z-index: 40;
  width: min(340px, 94vw); display: none;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 0 40px rgba(0,255,255,0.14);
}
#settings-panel h3 { font-size: 15px; color: var(--cyan); text-align: center; margin: 0 0 20px; letter-spacing: 2px; display: flex; align-items: center; justify-content: center; gap: 10px; }
#settings-panel h3 svg { width: 18px; height: 18px; stroke: var(--cyan); }
.sr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 8px; }
.sl { font-size: 10px; color: #bbb; flex: 1; }
.sv { font-size: 10px; color: var(--cyan); width: 30px; text-align: right; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 120px; height: 5px; background: #142a2a; border-radius: 3px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); cursor: pointer; }
.sdiv { border: none; border-top: 1px solid #111a1a; margin: 16px 0; }
.stitle { font-size: 9px; color: #555; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; }
.ctip { font-size: 9px; color: #555; line-height: 2.4; text-align: center; margin-top: 6px; }
#settings-panel::-webkit-scrollbar { width: 3px; }
#settings-panel::-webkit-scrollbar-thumb { background: #142a2a; }

/* ── Feedback / link-style button ── */
a.btn { text-decoration: none; }
.btn.m { color: var(--mag); border-color: var(--mag); background: rgba(255,0,255,0.05); }
.btn.m:active, .btn.m:hover { background: rgba(255,0,255,0.16); box-shadow: 0 0 18px rgba(255,0,255,0.28); }

/* ── About block in settings ── */
.about { font-size: 9px; color: var(--cyan); line-height: 2.2; text-align: center; }
.about a { color: var(--cyan); }

/* ── Noscript fallback ── */
.noscript-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; font-size: 12px; line-height: 2; color: var(--cyan); }

/* ── Visually hidden but readable by crawlers and screen readers ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
