*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #000;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  cursor: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Courier New', monospace;
}

/* Scanlines */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.07) 2px,
    rgba(0, 0, 0, 0.07) 4px
  );
  pointer-events: none;
  z-index: 300;
}

/* Vignette */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,10,0.65) 100%);
  pointer-events: none;
  z-index: 1;
}

#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* Custom crosshair canvas — topmost layer */
#crosshairCanvas {
  position: fixed;
  inset: 0;
  z-index: 500;
  pointer-events: none;
}

#gameArea {
  position: fixed;
  inset: 0;
  z-index: 2;
}

/* === HUD === */
#hud {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Top bar */
#hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 5.5rem;
  background: linear-gradient(to bottom, rgba(0,8,6,0.75) 0%, transparent 100%);
  border-bottom: 1px solid rgba(0,255,200,0.12);
}

#hud-title {
  color: #00ffcc;
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.28em;
  text-shadow: 0 0 10px rgba(0,255,200,0.95), 0 0 30px rgba(0,255,200,0.3);
}

#hud-top-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  pointer-events: all;
}

/* Bottom status bar */
#hud-bottom {
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 0 5.5rem;
  background: linear-gradient(to top, rgba(0,8,6,0.8) 0%, transparent 100%);
  border-top: 1px solid rgba(0,255,200,0.12);
}

.hud-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.55rem 1.6rem;
  gap: 0.15rem;
}

.hud-lbl {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: rgba(0,255,200,0.45);
}

.hud-val {
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  color: #00ffcc;
  text-shadow: 0 0 8px rgba(0,255,200,0.85);
}

.hud-armed {
  color: #00ff88;
  text-shadow: 0 0 8px rgba(0,255,130,0.85);
  animation: blink-armed 3s infinite;
}

@keyframes blink-armed {
  0%, 80%, 100% { opacity: 1; }
  85% { opacity: 0.25; }
}

.hud-sep {
  width: 1px;
  background: rgba(0,255,200,0.18);
  margin: 0.35rem 0;
  align-self: stretch;
}

/* Streak display */
#streak-display {
  font-size: 0.9rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  color: #ffcc44;
  min-width: 140px;
  text-align: right;
  opacity: 0;
  transition: opacity 0.2s;
  text-shadow: 0 0 10px rgba(255,200,50,0.7);
}
#streak-display.visible { opacity: 1; }

/* Mute button */
.mute-btn {
  background: rgba(0,255,200,0.07);
  border: 1px solid rgba(0,255,200,0.22);
  color: #00ffcc;
  font-size: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
  line-height: 1;
}
.mute-btn:hover { background: rgba(0,255,200,0.18); }
.mute-btn.muted { opacity: 0.4; }

/* === FLOATING TARGETS === */
.target {
  position: absolute;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 22px rgba(0,0,0,0.9), 0 0 8px rgba(0,200,150,0.1);
  will-change: transform;
  cursor: none;
}

.target img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.target video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Kill overlay */
.kill-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}

.kill-flash {
  position: fixed;
  inset: 0;
  background: rgba(0,255,200,0.1);
  pointer-events: none;
  z-index: 50;
  animation: flash 0.2s ease forwards;
}

@keyframes flash {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Streak popup */
.streak-popup {
  position: fixed;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Courier New', monospace;
  font-size: 2.25rem;
  font-weight: bold;
  color: #ffcc44;
  text-shadow: 0 0 24px rgba(255,200,50,0.9), 0 0 60px rgba(255,200,50,0.4);
  pointer-events: none;
  z-index: 150;
  animation: streakAnim 1.6s ease forwards;
  white-space: nowrap;
}

@keyframes streakAnim {
  0%   { opacity: 0; transform: translate(-50%, -60%) scale(0.4); }
  18%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  65%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -44%) scale(0.85); }
}

/* Loading screen */
#loadingScreen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  transition: opacity 0.6s;
}
#loadingScreen.gone { opacity: 0; pointer-events: none; }

.loading-inner { text-align: center; }

.loading-title {
  font-family: 'Courier New', monospace;
  color: #00ffcc;
  font-size: 2.5rem;
  font-weight: bold;
  letter-spacing: 0.2em;
  text-shadow: 0 0 24px rgba(0,255,200,0.9);
  margin-bottom: 1.5rem;
}

.loading-text {
  font-family: 'Courier New', monospace;
  color: #556655;
  font-size: 0.875rem;
  letter-spacing: 0.15em;
  animation: blink 1.2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

#buildId {
  position: fixed;
  bottom: 0.5rem;
  right: 0.75rem;
  font-family: 'Courier New', monospace;
  font-size: 0.65rem;
  color: rgba(0,255,200,0.55);
  pointer-events: none;
  z-index: 150;
}

/* === BOSS === */
#boss-wrap {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  top: -400px;
  z-index: 260;
  pointer-events: none;
  transition: top 1.0s cubic-bezier(0.22, 1, 0.36, 1);
}
#boss-wrap.visible { top: -80px; }

#boss-img {
  width: 100%;
  display: block;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 18px rgba(255,80,0,0.75)) drop-shadow(0 6px 30px rgba(0,0,0,0.95));
}

#boss-hud {
  position: fixed;
  top: 218px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 270;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}
#boss-hud.visible { opacity: 1; }
/* Ozamatron reuses the plate but is much taller — sit above his face */
#boss-hud.oz { top: 84px; }

#boss-hud-name {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: #ff6600;
  margin-bottom: 5px;
  text-shadow: 0 0 10px rgba(255,100,0,0.8);
}

#boss-hp-track {
  width: 200px;
  height: 7px;
  background: rgba(255,80,0,0.15);
  border: 1px solid rgba(255,80,0,0.4);
  border-radius: 1px;
  overflow: hidden;
}

#boss-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #cc2200, #ff6600);
  transition: width 0.15s;
  box-shadow: 0 0 6px rgba(255,80,0,0.8);
}

.boss-panel {
  position: fixed;
  pointer-events: none;
  z-index: 265;
  transform-origin: center;
  will-change: transform;
  background: linear-gradient(135deg, #ff6600 0%, #cc3300 45%, #ff9900 100%);
  border: 2px solid rgba(255,200,80,0.55);
  box-shadow: 0 0 10px rgba(255,80,0,0.5);
}

/* === STAGE 2 === */
#stage2Canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: none;
}
#stage2Canvas.visible { display: block; }

#stage2-banner {
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 0.3em;
  color: #00ffcc;
  text-shadow: 0 0 24px rgba(0,255,200,0.9), 0 0 70px rgba(0,255,200,0.4);
  pointer-events: none;
  z-index: 160;
  opacity: 0;
  transition: opacity 0.7s ease;
  white-space: nowrap;
}
#stage2-banner.visible { opacity: 1; }

/* Ozamatron bomb indicator — lives inside the reused #boss-hud */
#oz-bombs {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.oz-slot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(0,255,130,0.6);
  background: transparent;
  box-shadow: 0 0 8px rgba(0,255,130,0.35);
}
.oz-slot.planted {
  border-color: #ff3300;
  background: radial-gradient(circle, #ff5500 30%, #881100 100%);
  box-shadow: 0 0 12px rgba(255,60,0,0.9);
  animation: blink 0.8s infinite;
}

/* Victory overlay — reuses the gameover layout with the hero palette */
#victoryScreen {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: goFadeIn 0.5s ease forwards;
}
/* Doubled selectors: .gameover-* rules sit later in this file and would win otherwise */
.gameover-title.victory-title {
  color: #00ffcc;
  text-shadow: 0 0 30px rgba(0,255,200,0.9), 0 0 70px rgba(0,255,200,0.4);
}
.gameover-sub.victory-sub { color: rgba(0,255,200,0.55); }

@media (max-width: 600px) {
  #stage2-banner { font-size: 1.2rem; }
}

/* === SHOOT HINT === */
#shoot-hint {
  position: fixed;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 160;
  opacity: 0;
  transition: opacity 0.8s ease;
}
#shoot-hint.visible { opacity: 1; }
#shoot-hint.hiding  { opacity: 0; }

.hint-crosshair {
  font-size: 2.2rem;
  color: #00ffcc;
  text-shadow: 0 0 16px rgba(0,255,200,0.9);
  animation: hint-pulse 1.2s ease-in-out infinite;
  line-height: 1;
  margin-bottom: 0.4rem;
}
.hint-text {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: rgba(0,255,200,0.75);
  text-shadow: 0 0 10px rgba(0,255,200,0.5);
}
@keyframes hint-pulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(1.18); opacity: 0.7; }
}

/* === REMINISCING BANNER === */
#reminiscing-banner {
  position: fixed;
  bottom: 22%;
  left: 50%;
  font-family: 'Courier New', monospace;
  font-size: 1.6rem;
  font-style: italic;
  letter-spacing: 0.25em;
  color: #00ffcc;
  text-shadow: 0 0 18px rgba(0,255,200,0.9), 0 0 50px rgba(0,255,200,0.4);
  pointer-events: none;
  z-index: 150;
  opacity: 0;
  transition: opacity 2s ease;
  white-space: nowrap;
}
#reminiscing-banner.visible {
  opacity: 1;
  animation: reminisce-wave 11s ease-in-out infinite;
}
@keyframes reminisce-wave {
  0%   { transform: translateX(calc(-50% - 90px)) translateY(0px); }
  28%  { transform: translateX(calc(-50% + 60px)) translateY(-12px); }
  55%  { transform: translateX(calc(-50% + 95px)) translateY(8px); }
  80%  { transform: translateX(calc(-50% - 30px)) translateY(-6px); }
  100% { transform: translateX(calc(-50% - 90px)) translateY(0px); }
}

/* === GAME OVER === */
#gameOverScreen {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: goFadeIn 0.5s ease forwards;
}

@keyframes goFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.gameover-inner { text-align: center; }

.gameover-title {
  font-family: 'Courier New', monospace;
  font-size: 4rem;
  font-weight: bold;
  letter-spacing: 0.3em;
  color: #ff4400;
  text-shadow: 0 0 30px rgba(255,80,0,0.9), 0 0 70px rgba(255,80,0,0.4);
  margin-bottom: 0.75rem;
  animation: goGlitch 2.4s infinite;
}

@keyframes goGlitch {
  0%, 88%, 100% { transform: none; }
  90% { transform: translate(-3px, 0); text-shadow: 3px 0 #00ffcc, -3px 0 #ff4400; }
  92% { transform: translate(3px, 0);  text-shadow: -3px 0 #00ffcc, 3px 0 #ff4400; }
  94% { transform: none; }
}

.gameover-sub {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  color: rgba(255,80,0,0.55);
  margin-bottom: 2.5rem;
}

.gameover-btn {
  background: transparent;
  border: 1px solid rgba(0,255,200,0.45);
  color: #00ffcc;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  padding: 0.7rem 2.2rem;
  cursor: pointer;
  text-shadow: 0 0 10px rgba(0,255,200,0.7);
  box-shadow: 0 0 15px rgba(0,255,200,0.12), inset 0 0 12px rgba(0,255,200,0.05);
  transition: background 0.2s, box-shadow 0.2s;
}
.gameover-btn:hover {
  background: rgba(0,255,200,0.1);
  box-shadow: 0 0 28px rgba(0,255,200,0.28), inset 0 0 12px rgba(0,255,200,0.08);
}

/* "Pussy mode" — the easy-out on every death screen */
.gameover-btn.easy-btn {
  display: block;
  margin: 14px auto 0;
  font-size: 0.92rem;
  border-color: rgba(255,110,205,0.5);
  color: #ff86d6;
  text-shadow: 0 0 10px rgba(255,130,215,0.7);
  box-shadow: 0 0 15px rgba(255,130,215,0.12), inset 0 0 12px rgba(255,130,215,0.05);
}
.gameover-btn.easy-btn:hover {
  background: rgba(255,130,215,0.12);
  box-shadow: 0 0 28px rgba(255,130,215,0.3), inset 0 0 12px rgba(255,130,215,0.08);
}

@media (max-width: 600px) {
  #hud-title { font-size: 0.78rem; }
  #hud-top, #hud-bottom { padding-left: 4rem; padding-right: 4rem; }
  .hud-val { font-size: 0.9rem; }
  .hud-cell { padding: 0.45rem 0.9rem; }
  .streak-popup { font-size: 1.5rem; }
}

/* === STAGE 3 — DANCE-OFF (PATTICUS MAXIMUS) === */
/* Sits below the HUD (z 100) so the mute button stays reachable. */
#danceStage {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  animation: dance-in 0.9s ease-out;
}
@keyframes dance-in { from { opacity: 0; } }

.dance-floor {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(255, 0, 200, 0.10), transparent 55%),
    radial-gradient(ellipse at 50% 115%, rgba(0, 255, 200, 0.16), transparent 60%),
    linear-gradient(180deg, rgba(6, 0, 14, 0.90), rgba(12, 0, 28, 0.94));
}
/* Two color washes pulsing on the beat grid — opacity-only, compositor cheap */
.dance-wash { position: absolute; inset: -10%; pointer-events: none; }
.dance-w1 {
  background: radial-gradient(circle at 28% 32%, rgba(255, 34, 153, 0.16), transparent 45%);
  animation: wash-pulse calc(var(--beat, 0.46s) * 4) ease-in-out infinite;
}
.dance-w2 {
  background: radial-gradient(circle at 72% 38%, rgba(136, 68, 255, 0.18), transparent 45%);
  animation: wash-pulse calc(var(--beat, 0.46s) * 4) ease-in-out infinite;
  animation-delay: calc(var(--beat, 0.46s) * 2);
}
@keyframes wash-pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.disco-ball {
  position: absolute;
  top: 4px;            /* the hud-top center band is empty — hang it above the nameplate */
  left: 50%;
  font-size: 44px;
  transform-origin: 50% -30px;
  animation: ball-swing calc(var(--beat, 0.46s) * 8) ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.55));
}
@keyframes ball-swing {
  0%, 100% { transform: translateX(-50%) rotate(-9deg); }
  50%      { transform: translateX(-50%) rotate(9deg); }
}

.dance-spot {
  position: absolute;
  left: 50%;
  top: 10vh;
  width: 360px;
  height: 360px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.10), transparent 60%);
  pointer-events: none;
}

/* --- Nameplate + crowd-hype meter --- */
#dance-hud {
  position: absolute;
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: min(440px, 94vw);
}
.dance-name {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 5px;
  color: #ffd54a;
  text-shadow: 0 0 14px rgba(255, 213, 74, 0.8), 0 0 40px rgba(255, 120, 0, 0.4);
}
.dance-sub {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.55);
}
.dance-meter-lbl {
  margin-top: 7px;
  font-size: 8px;
  letter-spacing: 3px;
  color: rgba(34, 255, 204, 0.75);
}
.dance-meter {
  margin: 3px auto 0;
  width: 240px;
  height: 8px;
  border: 1px solid rgba(255, 213, 74, 0.5);
  background: rgba(0, 0, 0, 0.45);
}
#grooveFill {
  height: 100%;
  background: linear-gradient(90deg, #22ffcc, #ffd54a);
  transform-origin: left center;
  transform: scaleX(0.5);
  transition: transform 0.18s ease-out;
}

/* --- Patticus Maximus: 23-frame dance strip (boss/patticus.png) --- */
#patticus {
  position: absolute;
  left: 50%;
  top: 14vh;
  width: 245px;    /* strip cell aspect 231:230, frames bottom-aligned */
  height: 244px;
  margin-left: -122px;
  pointer-events: none;
}
.px-bob {
  position: absolute;
  inset: 0;
  animation: px-bob var(--beat, 0.46s) ease-in-out infinite;
}
@keyframes px-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
.px-fig {
  position: absolute;
  inset: 0;
  transition: transform 0.12s ease-out;
  transform-origin: 50% 92%;   /* pivot at the feet — leans and squashes stay planted */
}
.px-sprite {
  width: 100%;
  height: 100%;
  background: url('boss/patticus.png') no-repeat 0 0;
  background-size: 2300% 100%;             /* 23 cells side by side */
  image-rendering: pixelated;              /* it's pixel art — keep it crisp */
  filter: drop-shadow(0 0 16px rgba(255, 213, 74, 0.28));
}

/* Poses — the frame swap (stage3.js s3Pose) does the dancing; these are just
   small body-english accents layered on top, pivoted at the feet. */
#patticus.pose-l .px-fig { transform: rotate(-6deg) translateX(-10px); }
#patticus.pose-r .px-fig { transform: rotate(6deg) translateX(10px); }
#patticus.pose-u .px-fig { transform: translateY(-16px); }
#patticus.pose-d .px-fig { transform: translateY(8px); }

/* Defeat — the knocked-flat frame does the work; he just settles and dims */
#patticus.defeated .px-bob { animation: none; }
#patticus.defeated .px-fig {
  transform: translateY(24px);
  transition: transform 1s cubic-bezier(0.4, 1.5, 0.6, 1);
}
#patticus.defeated .px-sprite { filter: saturate(0.6) brightness(0.85); }

.px-say {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 250px;
  padding: 7px 11px;
  background: rgba(245, 240, 228, 0.95);
  color: #1a0a20;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  text-align: center;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.px-say::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: rgba(245, 240, 228, 0.95);
}
.px-say.visible { opacity: 1; }

/* --- The 4-lane track --- */
#dance-track {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(440px, 96vw);
  height: 46vh;
  min-height: 240px;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg,
      transparent 0, transparent calc(25% - 1px),
      rgba(255, 255, 255, 0.07) calc(25% - 1px), rgba(255, 255, 255, 0.07) 25%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.12) 130px, rgba(0, 0, 0, 0) 60%);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.d-receptor, .d-arrow {
  position: absolute;
  top: 14px;
  width: 25%;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  line-height: 1;
  pointer-events: none;
}
.d-receptor span, .d-arrow span { display: block; }
.d-receptor { color: rgba(255, 255, 255, 0.20); }
.d-receptor.flash { animation: recep-flash 0.18s ease-out; }
@keyframes recep-flash {
  0%   { color: #ffffff; transform: scale(1.35); }
  100% { color: rgba(255, 255, 255, 0.20); transform: scale(1); }
}
.d-arrow { transition: opacity 0.24s; will-change: transform; }
.d-lane-0 { color: #ff2299; text-shadow: 0 0 12px #ff2299; }
.d-lane-1 { color: #22ffcc; text-shadow: 0 0 12px #22ffcc; }
.d-lane-2 { color: #ffaa22; text-shadow: 0 0 12px #ffaa22; }
.d-lane-3 { color: #8844ff; text-shadow: 0 0 14px #aa77ff; }
.d-arrow.hit    { opacity: 0; filter: brightness(2.5); }
.d-arrow.missed { opacity: 0; filter: grayscale(1); transition: opacity 0.38s; }

.lane-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.lane-btn:active { background: rgba(255, 255, 255, 0.06); }

#dance-judge {
  position: absolute;
  top: 84px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 4px;
  opacity: 0;
  pointer-events: none;
}
#dance-judge.j-perfect { color: #22ffcc; text-shadow: 0 0 14px #22ffcc; }
#dance-judge.j-good    { color: #ffd54a; text-shadow: 0 0 14px #ffd54a; }
#dance-judge.j-miss    { color: #ff3355; text-shadow: 0 0 14px #ff3355; }
#dance-judge.pop { animation: judge-pop 0.5s ease-out forwards; }
@keyframes judge-pop {
  0%   { opacity: 1; transform: scale(1.45); }
  70%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

#dance-combo {
  position: absolute;
  left: 50%;
  bottom: calc(46vh + 12px);
  transform: translateX(-50%);
  font-family: 'Courier New', monospace;
  font-size: 26px;
  font-weight: bold;
  letter-spacing: 3px;
  color: #22ffcc;
  text-shadow: 0 0 16px rgba(34, 255, 204, 0.8);
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
#dance-combo.visible { opacity: 1; }

.dance-hint {
  position: absolute;
  top: 152px;
  left: 6%;
  right: 6%;
  text-align: center;
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 0 8px #000;
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
}
.dance-hint.visible { opacity: 1; }

.dance-stats {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.85);
  margin: 14px 0 4px;
}
.dance-stats.dance-outro { color: rgba(0, 255, 200, 0.6); margin-bottom: 20px; }

/* The gallery button sits out the first S3_BTN_DELAY_MS of the victory screen */
.dance-return { transition: opacity 0.9s; }
.dance-return.btn-delayed { opacity: 0; pointer-events: none; }

@media (max-height: 640px) {
  #patticus { transform: scale(0.7); transform-origin: top center; top: 11vh; }
  .disco-ball { font-size: 32px; }
  #dance-hud { top: 46px; }
}

/* ============================================================================
   STAGE — THE SUESS (the slash-combo assault). Pure DOM; z-index 90 — above the
   game layers, below the HUD (100) so the mute button stays reachable.
   ========================================================================= */
#suessStage {
  position: fixed; inset: 0; z-index: 90;
  opacity: 0; transition: opacity 0.4s ease;
  font-family: 'Courier New', monospace; overflow: hidden;
  touch-action: none; -webkit-user-select: none; user-select: none;
  cursor: crosshair;
}
#suessStage.visible { opacity: 1; }

/* --- HP header --- */
#suess-hud {
  position: fixed; top: 40px; left: 50%; transform: translateX(-50%);
  width: min(82vw, 480px); text-align: center; pointer-events: none; z-index: 92;
}
.suess-name { font-size: 1.5rem; font-weight: bold; letter-spacing: 0.24em; color: #ff5a2a; text-shadow: 0 0 18px rgba(255,90,0,0.8); }
.suess-sub  { font-size: 0.62rem; letter-spacing: 0.24em; color: rgba(255,120,60,0.6); margin: 3px 0 8px; }
.suess-hp-track { height: 13px; border: 1px solid rgba(255,90,0,0.5); border-radius: 6px; background: rgba(255,90,0,0.08); overflow: hidden; }
#suess-hp-fill {
  height: 100%; width: 100%; transform-origin: left center;
  background: linear-gradient(90deg, #ff2a2a, #ff9a2a);
  box-shadow: 0 0 12px rgba(255,90,0,0.7); transition: transform 0.12s ease;
}
/* he's clawing life back — bar glows green while regenerating */
#suess-hud.regen .suess-hp-track { border-color: #47ff8a; box-shadow: 0 0 22px rgba(70,255,140,0.6); }
#suess-hud.regen #suess-hp-fill { background: linear-gradient(90deg, #22c55e, #7dff9a); box-shadow: 0 0 14px rgba(70,255,140,0.8); }

/* --- the man himself --- */
#suessGuy { position: fixed; left: 50%; bottom: 20vh; transform: translateX(-50%); z-index: 91; pointer-events: none; text-align: center; transition: opacity 0.16s ease; }
#suessGuy.suess-gone { opacity: 0; }   /* teleport blink — invisible + untargetable */
.suess-bob { animation: suess-bob 1.6s ease-in-out infinite; }
.suess-sprite {
  height: min(46vh, 420px); aspect-ratio: 453 / 512; margin: 0 auto;
  background-image: url('boss/suess.png'); background-size: 600% 100%; background-repeat: no-repeat; background-position-x: 0%;
  image-rendering: pixelated; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5));
}
@keyframes suess-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
#suessStage.suess-raging .suess-sprite { filter: drop-shadow(0 0 26px rgba(255,80,0,0.9)) drop-shadow(0 6px 10px rgba(0,0,0,0.5)); }
#suessStage.suess-limitbreak .suess-sprite { filter: drop-shadow(0 0 40px rgba(255,220,120,1)) brightness(1.3); }
#suessStage.suess-shake .suess-bob { animation: suess-shake 0.3s linear; }
@keyframes suess-shake {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-7px,2px); }
  40% { transform: translate(7px,-3px); } 60% { transform: translate(-5px,3px); } 80% { transform: translate(5px,-1px); }
}
#suessStage.suess-defeated .suess-sprite { filter: grayscale(0.4) drop-shadow(0 6px 10px rgba(0,0,0,0.5)); }

.suess-say {
  position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, 6px);
  min-width: 120px; max-width: 60vw; margin-bottom: 8px;
  background: rgba(10,10,14,0.9); border: 1px solid rgba(255,120,60,0.6); border-radius: 10px;
  padding: 8px 14px; font-size: 0.95rem; font-weight: bold; letter-spacing: 0.06em; color: #ffd6a0;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease;
}
.suess-say.visible { opacity: 1; transform: translate(-50%, 0); }

/* --- slash cuts --- */
#suess-slashes { position: fixed; inset: 0; z-index: 93; pointer-events: none; contain: layout paint; }
.slash {
  position: absolute; width: 340px; height: 12px; border-radius: 12px;
  background: linear-gradient(90deg, transparent, #fff 30%, #bff6ff 50%, #fff 70%, transparent);
  box-shadow: 0 0 14px 2px rgba(160,230,255,0.75);   /* single light blur — big shadows tank paint */
  transform-origin: center; opacity: 0; will-change: transform, opacity;
  animation: slash-go 0.28s ease-out forwards;
}
.slash.slash-alt {
  background: linear-gradient(90deg, transparent, #fff 30%, #ffd27a 50%, #fff 70%, transparent);
  box-shadow: 0 0 14px 2px rgba(255,190,110,0.75);
}
@keyframes slash-go {
  0%   { opacity: 0; transform: translate(-50%,-50%) rotate(var(--r,0deg)) scaleX(0.2); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,-50%) rotate(var(--r,0deg)) scaleX(1.15); }
}

/* --- crotch orbs (phase 2) --- */
.suess-orb {
  position: absolute; width: 42px; height: 42px; border-radius: 50%;
  transform: translate(-50%,-50%);
  background: radial-gradient(circle at 40% 35%, #eaffea 0%, #8affa0 35%, #2fd04a 60%, rgba(30,180,60,0.2) 80%);
  box-shadow: 0 0 16px 4px rgba(90,255,130,0.85), 0 0 30px 8px rgba(50,220,90,0.4);
  will-change: transform; pointer-events: none;
  animation: orb-pulse 0.5s ease-in-out infinite;
}
@keyframes orb-pulse { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.5); } }

/* --- combo counter --- */
#suess-combo {
  position: fixed; top: 16vh; right: 6vw; z-index: 94; text-align: right;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
  text-shadow: 0 0 18px currentColor; line-height: 0.95;
}
#suess-combo.visible { opacity: 1; }
#suess-combo.bump .combo-num { transform: scale(1.25); }
.combo-num { display: inline-block; font-size: clamp(2.6rem, 11vw, 5rem); font-weight: bold; transition: transform 0.1s ease; }
.combo-x   { display: block; font-size: 0.8rem; letter-spacing: 0.3em; opacity: 0.85; }
.combo-mult { display: block; font-size: 1.4rem; font-weight: bold; margin-top: 4px; }
#suess-combo.tier-1 { color: #9fe6ff; }
#suess-combo.tier-2 { color: #6cff9a; }
#suess-combo.tier-3 { color: #ffe14a; }
#suess-combo.tier-4 { color: #ff9a2a; }
#suess-combo.tier-5 { color: #ff4a6a; }
.combo-callout {
  position: absolute; top: 100%; right: 0; margin-top: 6px; white-space: nowrap;
  font-size: 1.2rem; font-weight: bold; letter-spacing: 0.14em; color: #fff;
  text-shadow: 0 0 16px #ff8a3a; animation: callout-go 0.9s ease-out forwards;
}
@keyframes callout-go { 0% { opacity: 0; transform: translateY(-8px) scale(0.7); } 25% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }

/* --- COMBO BREAKER banner --- */
#suess-break {
  position: fixed; top: 42vh; left: 50%; transform: translateX(-50%); z-index: 97;
  font-size: clamp(1.6rem, 7vw, 3.4rem); font-weight: bold; letter-spacing: 0.1em; color: #ff2a4a;
  text-shadow: 0 0 26px rgba(255,40,80,0.9); opacity: 0; pointer-events: none; white-space: nowrap;
}
#suess-break.go { animation: break-go 1.1s ease-out; }
@keyframes break-go {
  0% { opacity: 0; transform: translateX(-50%) scale(0.5) rotate(-4deg); }
  15% { opacity: 1; transform: translateX(-50%) scale(1.15) rotate(2deg); }
  30% { transform: translateX(-50%) scale(1) rotate(-2deg); }
  80% { opacity: 1; } 100% { opacity: 0; }
}

/* --- LIMIT gauge --- */
#suess-limit-wrap {
  position: fixed; left: 50%; bottom: 4vh; transform: translateX(-50%); z-index: 95;
  width: min(70vw, 420px); text-align: center; pointer-events: none;
}
.suess-limit-lbl { font-size: 0.68rem; letter-spacing: 0.4em; color: rgba(120,200,255,0.8); margin-bottom: 4px; }
.suess-limit-track {
  height: 16px; border: 1px solid rgba(120,200,255,0.5); border-radius: 8px;
  background: rgba(60,120,200,0.12); overflow: hidden;
}
#suess-limit-fill {
  height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, #2a6cff, #3ad1ff, #9ff6ff); box-shadow: 0 0 12px rgba(80,200,255,0.7);
}
#suess-limit-wrap.full .suess-limit-track { border-color: #ffe14a; box-shadow: 0 0 24px rgba(255,220,60,0.6); animation: limit-full 0.5s ease-in-out infinite; }
#suess-limit-wrap.full #suess-limit-fill { background: linear-gradient(90deg, #ffd23a, #fff, #ffd23a); }
@keyframes limit-full { 0%,100% { opacity: 1; } 50% { opacity: 0.65; } }

/* --- LIMIT BREAK button --- */
#suess-limit {
  position: fixed; right: 5vw; bottom: calc(4vh + 44px); z-index: 96;
  width: 116px; height: 116px; border-radius: 50%;
  background: rgba(20,26,40,0.6); border: 2px solid rgba(120,200,255,0.25); color: rgba(160,210,255,0.35);
  font-family: 'Courier New', monospace; font-size: 0.82rem; font-weight: bold; letter-spacing: 0.06em; line-height: 1.15;
  cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; touch-action: none;
  transition: transform 0.1s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
#suess-limit.ready {
  color: #fff; border-color: #ffe14a; background: rgba(60,40,10,0.6);
  box-shadow: 0 0 34px rgba(255,220,60,0.7), inset 0 0 20px rgba(255,220,60,0.25);
  animation: limit-btn 0.45s ease-in-out infinite;
}
#suess-limit.ready:active { transform: scale(0.92); }
@keyframes limit-btn { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* --- opening hint --- */
.suess-hint {
  position: fixed; bottom: calc(4vh + 52px); left: 50%; transform: translateX(-50%); z-index: 94;
  font-size: 0.72rem; letter-spacing: 0.14em; color: rgba(120,200,255,0.8); text-align: center;
  opacity: 0; transition: opacity 0.5s; pointer-events: none; white-space: nowrap;
}
.suess-hint.visible { opacity: 1; }

/* --- PARRY! / HIT! judgment pop --- */
#suess-judge {
  position: fixed; top: 34vh; left: 50%; transform: translateX(-50%); z-index: 97;
  font-size: clamp(1.6rem, 7vw, 3rem); font-weight: bold; letter-spacing: 0.12em;
  opacity: 0; pointer-events: none;
}
#suess-judge.pop { animation: suess-judge-pop 0.55s ease-out; }
@keyframes suess-judge-pop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.6); }
  25% { opacity: 1; transform: translateX(-50%) scale(1.15); }
  70% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(1); }
}
.j-parry { color: #9ff6ff; text-shadow: 0 0 20px rgba(150,240,255,0.95); }
.j-hit   { color: #ff3a3a; text-shadow: 0 0 20px rgba(255,60,60,0.95); }

/* --- game over --- */
#suessGameOver {
  position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  animation: goFadeIn 0.5s ease forwards;
}

/* --- blinking swipe prompt (nags when idle, screams on his wind-up) --- */
#suess-prompt {
  position: fixed; left: 50%; top: 30vh; transform: translateX(-50%); z-index: 94;
  font-size: clamp(1.1rem, 5vw, 2rem); font-weight: bold; letter-spacing: 0.2em;
  color: #9ff6ff; text-shadow: 0 0 18px rgba(150,240,255,0.8);
  opacity: 0; pointer-events: none; white-space: nowrap;
}
#suess-prompt.show { animation: suess-blink 0.7s steps(1) infinite; }
#suess-prompt.urgent { color: #ff5a5a; text-shadow: 0 0 22px rgba(255,70,70,0.95); animation-duration: 0.32s; }
@keyframes suess-blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }

@media (max-width: 600px) {
  .suess-name { font-size: 1.15rem; }
  #suessGuy { bottom: 22vh; }
  .suess-sprite { height: min(38vh, 340px); }
  #suess-combo { top: 14vh; right: 5vw; }
  #suess-prompt { top: 26vh; }
  .suess-hint { font-size: 0.58rem; white-space: normal; width: 82vw; }
}
