* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #090312;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Space Grotesk", sans-serif;
  color: #fce7f3;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #0c051a;
}

/* VHS REWIND SIMULATION EFFECT */
.vhs-effect {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  transition: opacity 0.15s ease;
  overflow: hidden;
  background: rgba(14, 5, 28, 0.4);
}

.vhs-effect.active {
  opacity: 1;
}

.vhs-tracking {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  animation: scanlines 0.2s linear infinite;
}

@keyframes scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

.vhs-rewind-label {
  position: absolute;
  top: 24px;
  left: 24px;
  font-family: monospace;
  font-size: 20px;
  font-weight: 900;
  color: #ec4899;
  text-shadow: 0 0 10px rgba(236, 72, 153, 0.9), 2px 0 0 #06b6d4;
  letter-spacing: 2px;
}

/* 2026 CYBERPUNK HUD */
#hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 10;
  gap: 12px;
}

.hud-left, .hud-right {
  display: flex;
  flex-direction: column;
}

.hud-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hud-card {
  background: rgba(15, 6, 29, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: 12px;
  padding: 8px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.focus-card {
  width: 190px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.hud-tag {
  font-size: 9px;
  font-weight: 800;
  color: #f472b6;
  letter-spacing: 0.8px;
}

.focus-pct {
  font-size: 11px;
  font-weight: 900;
  color: #06b6d4;
  font-family: monospace;
}

.focus-bar-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.focus-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #22d3ee, #ec4899);
  transition: width 0.08s linear;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.7);
}

/* Stage & Objective Banner */
.stage-pill {
  background: rgba(15, 6, 29, 0.82);
  border: 1px solid rgba(236, 72, 153, 0.4);
  border-radius: 30px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.pill-label {
  font-size: 11px;
  font-weight: 900;
  color: #06b6d4;
  letter-spacing: 1px;
}

.pill-val {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  font-family: monospace;
}

/* Boss Health Bar */
.boss-hud {
  width: 280px;
  background: rgba(15, 6, 29, 0.88);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.35);
  transition: opacity 0.3s ease;
}

.boss-hud.hidden {
  display: none;
}

.boss-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.boss-name {
  font-size: 10px;
  font-weight: 900;
  color: #ef4444;
  letter-spacing: 0.8px;
}

.boss-hp-pct {
  font-size: 10px;
  font-weight: 900;
  color: #facc15;
  font-family: monospace;
}

.boss-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.boss-bar-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f97316, #eab308);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

/* Combo Card */
.combo-card {
  align-items: flex-end;
}

.combo-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.combo-badge {
  font-size: 18px;
  font-weight: 900;
  color: #ec4899;
  text-shadow: 0 0 8px rgba(236, 72, 153, 0.8);
}

.score-display {
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  font-family: monospace;
}

.style-tag {
  align-self: flex-end;
  margin-top: 2px;
}

/* OVERLAYS */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(8, 2, 18, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 16px;
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.overlay.hidden {
  display: none;
}

.menu-card {
  background: rgba(18, 8, 36, 0.92);
  border: 1px solid rgba(236, 72, 153, 0.45);
  border-radius: 20px;
  padding: 28px 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65), 0 0 40px rgba(236, 72, 153, 0.18);
  animation: cardPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.neon-glow-badge {
  display: inline-block;
  background: rgba(236, 72, 153, 0.2);
  border: 1px solid rgba(236, 72, 153, 0.6);
  color: #f472b6;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.menu-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1.2px;
  background: linear-gradient(135deg, #ffffff 0%, #fce7f3 60%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.menu-tagline {
  font-size: 11px;
  font-weight: 800;
  color: #06b6d4;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.menu-subtitle {
  font-size: 13px;
  line-height: 1.5;
  color: #cbd5e1;
  margin-bottom: 18px;
}

/* Campaign Preview */
.campaign-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.preview-item {
  background: rgba(14, 6, 28, 0.65);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 8px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
}

.stage-num {
  font-size: 14px;
  font-weight: 900;
  color: #06b6d4;
  margin-bottom: 2px;
}

/* Upgrade choices */
.upgrade-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.upgrade-card-item {
  background: rgba(14, 6, 28, 0.85);
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.upgrade-card-item:hover {
  transform: translateY(-2px);
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.15);
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.3);
}

.upgrade-title {
  font-size: 14px;
  font-weight: 900;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
}

.upgrade-tag {
  font-size: 10px;
  font-weight: 800;
  color: #06b6d4;
}

.upgrade-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
  line-height: 1.4;
}

/* Controls Guide */
.controls-guide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(10, 4, 20, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
  text-align: left;
}

.guide-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guide-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #e2e8f0;
}

.key-pill {
  display: inline-block;
  background: rgba(236, 72, 153, 0.25);
  border: 1px solid rgba(236, 72, 153, 0.5);
  color: #ffffff;
  font-weight: 800;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 50%, #be185d 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(236, 72, 153, 0.6);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  margin-top: 10px;
}

.pause-actions, .gameover-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 24px;
}

.stat-box {
  background: rgba(14, 6, 28, 0.65);
  border: 1px solid rgba(236, 72, 153, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 9px;
  font-weight: 700;
  color: #f472b6;
  letter-spacing: 0.8px;
}

.stat-val {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  font-family: monospace;
  margin-top: 4px;
}

.stat-val.highlight {
  color: #06b6d4;
  font-size: 24px;
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}

/* 2026 RESPONSIVE TOUCH CONTROLS */
.touch-controls {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 20;
}

@media (pointer: coarse), (max-width: 820px) {
  .touch-controls {
    display: flex;
  }
}

.touch-left-cluster, .touch-right-cluster {
  display: flex;
  gap: 10px;
  pointer-events: auto;
}

.touch-btn {
  background: rgba(26, 11, 48, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(236, 72, 153, 0.45);
  color: #ffffff;
  border-radius: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  width: 58px;
  height: 58px;
  transition: transform 0.08s ease, background 0.08s ease;
}

.touch-btn:active {
  transform: scale(0.92);
  background: rgba(236, 72, 153, 0.4);
}

.slash-btn {
  background: rgba(236, 72, 153, 0.35);
  border-color: rgba(236, 72, 153, 0.7);
  width: 66px;
  height: 66px;
  font-size: 13px;
}

.jump-btn {
  background: rgba(6, 182, 212, 0.25);
  border-color: rgba(6, 182, 212, 0.6);
  font-size: 11px;
}

.roll-btn {
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.6);
  font-size: 11px;
}

.slow-btn {
  background: rgba(244, 63, 94, 0.25);
  border-color: rgba(244, 63, 94, 0.6);
  font-size: 11px;
}

/* Pause decorative HUD motion with the round, without freezing overlay transitions. */
body:has(#pause-overlay:not(.hidden)) *,
body:has(#pause-overlay:not(.hidden)) *::before,
body:has(#pause-overlay:not(.hidden)) *::after {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
