/* =========================================================
   SLAP CHAMPIONS: ULTIMATE 3D ARENA - MASTER STYLESHEET
   Clean, Sleek & Modern UI System
   - Left-Docked Menu & Name Tag to Showcase 3D Characters
   - Ultra-Punchy Comic Popups & High-Impact Damage Numbers
   ========================================================= */

:root {
  --primary-gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.45);
  --gold-dark: #b45309;
  --neon-cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.45);
  --neon-blue: #3b82f6;
  --neon-green: #10b981;
  --neon-red: #ef4444;
  --neon-purple: #8b5cf6;
  --dark-bg: #070a13;
  --dark-card: rgba(13, 19, 33, 0.84);
  --dark-card-hover: rgba(22, 32, 54, 0.94);
  --dark-card-border: rgba(255, 255, 255, 0.09);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-comic: 'Bangers', cursive, sans-serif;
  --font-condensed: 'Teko', sans-serif;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.6);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--dark-bg);
  font-family: var(--font-main);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-gold);
}

#vfx-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
}

#flash-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  transition: opacity 0.08s ease-out;
  pointer-events: none;
}

#comic-text-container, #damage-numbers-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 45;
}

.comic-popup {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-comic);
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(7, 10, 19, 0.98));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 2.5px solid currentColor;
  border-radius: var(--radius-lg);
  padding: 10px 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85), 0 0 30px currentColor, inset 0 2px 0 rgba(255, 255, 255, 0.4);
  text-shadow: 2.5px 2.5px 0 #000, -1.5px -1.5px 0 #000, 0 0 12px rgba(0, 0, 0, 0.9);
  animation: comicPopStay 2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  pointer-events: none;
  z-index: 50;
  white-space: nowrap;
}

@keyframes comicPopStay {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.5) rotate(-5deg); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1.1) rotate(2deg); }
  22% { transform: translate(-50%, -50%) scale(1.0) rotate(0deg); }
  75% { opacity: 1; transform: translate(-50%, -55%) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -85%) scale(0.92); }
}

.damage-popup {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-comic);
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  color: #ef4444;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000;
  background: rgba(13, 19, 33, 0.9);
  backdrop-filter: blur(12px);
  border: 2px solid #ef4444;
  border-radius: var(--radius-pill);
  padding: 4px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(239, 68, 68, 0.4);
  animation: damageFloat 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
  pointer-events: none;
  z-index: 48;
}

.damage-popup.crit {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  border-color: #fef08a;
  font-size: clamp(2.2rem, 3.8vw, 3.2rem);
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.9), 0 10px 30px rgba(0, 0, 0, 0.8);
  text-shadow: 2.5px 2.5px 0 #000;
}

.damage-popup.braced {
  color: #10b981;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
}

@keyframes damageFloat {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.4); }
  15% { opacity: 1; transform: translate(-50%, -24px) scale(1.15); }
  28% { transform: translate(-50%, -32px) scale(1.0); }
  75% { opacity: 1; transform: translate(-50%, -68px) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -100px) scale(0.85); }
}

#boss-dialogue-banner {
  position: absolute;
  top: 75px;
  right: 24px;
  background: rgba(13, 19, 33, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(245, 158, 11, 0.6);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg), 0 0 20px rgba(245, 158, 11, 0.35);
  z-index: 38;
  max-width: 380px;
  animation: balloonSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#boss-dialogue-banner.active {
  display: flex;
}

@keyframes balloonSlideIn {
  0% { opacity: 0; transform: translateY(-15px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.balloon-avatar {
  font-size: 1.6rem;
  background: #1e293b;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--primary-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.balloon-text-wrap {
  display: flex;
  flex-direction: column;
}

.balloon-boss-name {
  font-family: var(--font-condensed);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-gold);
  letter-spacing: 0.8px;
  line-height: 1.1;
}

.balloon-speech {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  font-style: italic;
  line-height: 1.3;
}

#top-nav-bar {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 30;
  pointer-events: auto;
}

.currency-group {
  display: flex;
  gap: 8px;
}

.currency-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 19, 33, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--dark-card-border);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  color: #fff;
  transition: border-color 0.2s ease;
}

.currency-icon {
  font-size: 1rem;
}

.gold-pill { 
  border-color: rgba(245, 158, 11, 0.35); 
}
.gem-pill { 
  border-color: rgba(6, 182, 212, 0.35); 
}

.quick-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  background: rgba(13, 19, 33, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--dark-card-border);
  color: var(--text-primary);
  font-size: 1rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow-md);
}

.icon-btn:active {
  transform: scale(0.94);
}

.spin-icon-btn {
  border-color: rgba(245, 158, 11, 0.6);
  animation: spinPulse 2.5s infinite;
}

@keyframes spinPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.65); }
}

.game-screen, .game-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: none;
  pointer-events: none;
}

.game-screen.active, .game-hud.active {
  display: flex;
  pointer-events: auto;
}

.game-hud {
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 16px 20px;
}

.hidden {
  display: none !important;
}

#screen-main-menu {
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 20px 36px 28px;
  background: linear-gradient(90deg, rgba(7, 10, 19, 0.92) 0%, rgba(7, 10, 19, 0.45) 42%, transparent 100%);
  pointer-events: none;
}

.menu-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: 420px;
  gap: 12px;
  pointer-events: auto;
}

.game-title-wrap {
  text-align: left;
  animation: floatTitle 3.5s ease-in-out infinite;
}

@keyframes floatTitle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

.title-sub {
  font-family: var(--font-condensed);
  font-size: 0.92rem;
  letter-spacing: 2.5px;
  color: var(--neon-cyan);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
  margin-bottom: 2px;
}

.game-title {
  font-family: var(--font-comic);
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: 1.5px;
  color: #fff;
  text-shadow: 
    2px 2px 0 #000,
    -1px -1px 0 #000,
    0 4px 20px rgba(0, 0, 0, 0.6);
}

.game-title .highlight {
  color: #ef4444;
  background: linear-gradient(180deg, #ff6b6b 0%, #ef4444 65%, #b91c1c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: #ef4444;
  display: inline-block;
  text-shadow: 
    2px 2px 0 #000,
    -1px -1px 0 #000,
    0 0 16px rgba(239, 68, 68, 0.65);
}

.title-badge {
  display: inline-block;
  background: linear-gradient(90deg, #dc2626, #f97316);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4);
  margin-top: 4px;
}

.current-rank-card {
  background: rgba(13, 19, 33, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 3.5px solid var(--primary-gold);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  text-align: left;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  margin-bottom: 2px;
}

.rank-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rank-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary-gold);
  letter-spacing: 0.8px;
}

.rank-next-boss {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.rank-next-boss strong {
  color: var(--neon-cyan);
}

.rank-title {
  font-family: var(--font-condensed);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  line-height: 1.1;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  border: 1.5px solid rgba(254, 240, 138, 0.8);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  color: #fff;
  font-family: var(--font-main);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(217, 119, 6, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

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

.pulse-btn {
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4); }
  50% { box-shadow: 0 8px 28px rgba(245, 158, 11, 0.7), 0 0 14px rgba(245, 158, 11, 0.4); }
}

.btn-primary .btn-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.btn-primary .btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.btn-primary .btn-text strong {
  font-family: var(--font-condensed);
  font-size: 1.45rem;
  letter-spacing: 1.2px;
  line-height: 1;
}

.btn-primary .btn-text small {
  font-size: 0.75rem;
  color: #fef3c7;
  font-weight: 600;
  opacity: 0.9;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: var(--neon-cyan);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3);
}

.btn-secondary:active {
  transform: scale(0.97);
}

.btn-secondary .btn-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.bottom-menu-row {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.btn-tertiary {
  flex: 1;
  background: rgba(13, 19, 33, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--dark-card-border);
  border-radius: var(--radius-sm);
  padding: 7px 6px;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
  white-space: nowrap;
}

.btn-tertiary:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(30, 41, 59, 0.9);
  transform: translateY(-1px);
}

.btn-tertiary:active {
  transform: scale(0.96);
}

#combat-hud {
  justify-content: space-between;
  align-items: center;
  padding-top: 55px;
  padding-bottom: 18px;
}

.vs-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 760px;
  background: rgba(13, 19, 33, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--dark-card-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  gap: 12px;
}

.fighter-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 5px;
}

.fighter-avatar-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.opponent-card .fighter-avatar-wrapper {
  flex-direction: row-reverse;
}

.avatar-ring {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1.5px solid var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
  flex-shrink: 0;
}

.opponent-card .avatar-ring {
  border-color: var(--neon-red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.avatar-img-placeholder {
  font-size: 1.35rem;
  line-height: 1;
}

.avatar-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: var(--neon-blue);
  font-size: 0.58rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.8);
  line-height: 1.1;
}

.opponent-badge {
  background: var(--neon-red);
}

.fighter-stats-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.opponent-card .fighter-stats-meta {
  align-items: flex-end;
}

.fighter-name {
  font-family: var(--font-condensed);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fighter-lvl-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.hp-bar-container {
  position: relative;
  width: 100%;
  height: 13px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
}

.hp-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.player-hp-fill {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.opponent-hp-fill {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  left: auto;
  right: 0;
}

.hp-damage-ghost {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--primary-gold);
  border-radius: var(--radius-pill);
  transition: width 0.8s ease-out;
  z-index: 1;
}

.opponent-card .hp-damage-ghost {
  left: auto;
  right: 0;
}

.hp-sheen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
}

.hp-label {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 800;
  color: #fff;
  z-index: 3;
  text-shadow: 1px 1px 2px #000;
}

.match-center-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.vs-text {
  font-family: var(--font-comic);
  font-size: 1.4rem;
  color: #ef4444;
  line-height: 1;
  text-shadow: 1px 1px 0 #000;
}

.match-round-text {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary-gold);
  text-transform: uppercase;
}

.turn-indicator {
  font-size: 0.68rem;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.turn-indicator.opp-turn {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

.turn-indicator.counter-turn {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  animation: pulseGlow 1s infinite;
}

.meter-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(13, 19, 33, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--dark-card-border);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}

.meter-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.meter-title {
  font-family: var(--font-condensed);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.meter-score-badge {
  font-size: 0.82rem;
  font-weight: 900;
  color: var(--primary-gold);
}

.curved-meter {
  position: relative;
  width: 340px;
  height: 170px;
}

.meter-legend {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0 4px;
}

.legend-item.weak { color: #ef4444; }
.legend-item.good { color: #f59e0b; }
.legend-item.perfect { color: #10b981; }

.target-crosshair {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  opacity: 0.7;
  transition: all 0.2s ease;
}

.target-crosshair.locked-on {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.crosshair-ring {
  width: 44px;
  height: 44px;
  border: 2px dashed var(--primary-gold);
  border-radius: 50%;
  animation: spinRing 4s linear infinite;
}

@keyframes spinRing {
  100% { transform: rotate(360deg); }
}

.crosshair-dot {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 4px;
  height: 4px;
  background: #ef4444;
  border-radius: 50%;
}

.crosshair-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
}

#combat-action-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  pointer-events: auto;
}

.slap-tap-button {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #991b1b 100%);
  border: 2px solid rgba(254, 202, 202, 0.8);
  border-radius: var(--radius-md);
  padding: 12px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.15s ease;
}

.slap-tap-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(220, 38, 38, 0.7);
}

.slap-tap-button:active {
  transform: translateY(1px) scale(0.98);
}

.slap-tap-button:disabled {
  opacity: 0.5;
  filter: grayscale(0.8);
  cursor: not-allowed;
  transform: none;
}

.btn-big-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.btn-big-text {
  font-family: var(--font-condensed);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1;
}

.btn-sub-hint {
  font-size: 0.68rem;
  color: #fee2e2;
  font-weight: 700;
}

.combat-sub-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.buff-btn {
  flex: 1;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.buff-btn:hover:not(:disabled) {
  border-color: #fff;
  background: rgba(30, 41, 59, 0.95);
  transform: translateY(-1px);
}

.buff-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#super-slap-group {
  flex: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.super-meter-track {
  position: relative;
  width: 100%;
  height: 14px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(245, 158, 11, 0.4);
  overflow: hidden;
}

.super-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  transition: width 0.25s ease;
}

.super-meter-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 900;
  color: #fff;
}

.super-slap-btn {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  border: 1px solid #fef08a;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.super-slap-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.6);
}

.super-slap-btn:disabled {
  opacity: 0.4;
  filter: grayscale(0.8);
  cursor: not-allowed;
}

.qte-container {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  background: rgba(13, 19, 33, 0.95);
  backdrop-filter: blur(18px);
  border: 2px solid #ef4444;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.6);
  z-index: 40;
  animation: qtePulse 0.8s infinite;
}

.qte-container.active {
  display: flex;
}

@keyframes qtePulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.04); }
}

.qte-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.qte-title {
  font-family: var(--font-condensed);
  font-size: 1.4rem;
  font-weight: 700;
  color: #ef4444;
}

.qte-dual-actions {
  display: flex;
  gap: 10px;
}

.qte-choice-btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.qte-choice-btn:hover {
  transform: scale(1.05);
}

.brace-choice {
  background: linear-gradient(135deg, #10b981, #059669);
}

.dodge-choice {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
}

/* Modal Overlay & Cards */
.game-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.game-modal.active {
  display: flex;
}

.modal-card {
  position: relative;
  background: rgba(13, 19, 33, 0.95);
  border: 1px solid var(--dark-card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--dark-card-border);
  padding-bottom: 10px;
}

.modal-header h2 {
  font-family: var(--font-condensed);
  font-size: 1.5rem;
  color: var(--primary-gold);
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: #ef4444;
}

/* Lucky Spin Wheel */
.spin-wheel-container {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  z-index: 10;
}

.wheel-disc {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 4px solid var(--primary-gold);
  position: relative;
  overflow: hidden;
  transition: transform 3.5s cubic-bezier(0.16, 1, 0.3, 1);
  background: #1e293b;
}

.wheel-slice {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
}

.slice-1 { transform: rotate(0deg); background: #3b82f6; clip-path: polygon(50% 50%, 100% 0, 100% 50%); }
.slice-2 { transform: rotate(60deg); background: #10b981; clip-path: polygon(50% 50%, 100% 0, 100% 50%); }
.slice-3 { transform: rotate(120deg); background: #f59e0b; clip-path: polygon(50% 50%, 100% 0, 100% 50%); }
.slice-4 { transform: rotate(180deg); background: #ef4444; clip-path: polygon(50% 50%, 100% 0, 100% 50%); }
.slice-5 { transform: rotate(240deg); background: #8b5cf6; clip-path: polygon(50% 50%, 100% 0, 100% 50%); }
.slice-6 { transform: rotate(300deg); background: #06b6d4; clip-path: polygon(50% 50%, 100% 0, 100% 50%); }

/* Boss Roster Cards */
.boss-cards-scroll {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 6px;
}

.boss-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--dark-card-border);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: all 0.2s ease;
}

.boss-card.unlocked {
  cursor: pointer;
}

.boss-card.unlocked:hover {
  border-color: var(--primary-gold);
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.95);
}

.boss-card.locked {
  opacity: 0.5;
}

.boss-avatar {
  font-size: 2rem;
  background: #1e293b;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.boss-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.boss-name {
  font-family: var(--font-condensed);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.boss-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.boss-stats {
  font-size: 0.72rem;
  color: var(--neon-cyan);
}

.boss-rewards {
  font-size: 0.7rem;
  color: var(--primary-gold);
}

.status-tag {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.status-tag.defeated {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid #10b981;
}

.status-tag.locked {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.btn-fight-boss {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
}

/* Upgrades & Shop Cards */
.upgrade-list, .achievements-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upgrade-item-card, .achievement-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--dark-card-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.upgrade-icon, .ach-icon {
  font-size: 1.6rem;
}

.upgrade-details, .ach-details {
  flex: 1;
}

.upgrade-name, .ach-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
}

.upgrade-level {
  font-size: 0.72rem;
  color: var(--primary-gold);
  margin-left: 6px;
}

.upgrade-desc, .ach-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.btn-upgrade-action {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn-upgrade-action.unaffordable {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-upgrade-action.maxed {
  background: #334155;
  cursor: not-allowed;
}

/* Shop Inventory Grid */
.shop-tabs {
  display: flex;
  gap: 8px;
}

.shop-tab {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--dark-card-border);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.shop-tab.active {
  background: var(--primary-gold);
  color: #fff;
  border-color: #fef08a;
}

.shop-inventory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.shop-item-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--dark-card-border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.shop-item-card.equipped {
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.shop-item-icon {
  font-size: 2rem;
}

.shop-item-name {
  font-size: 0.86rem;
  font-weight: 800;
  color: #fff;
}

.shop-item-buff {
  font-size: 0.68rem;
  color: var(--neon-cyan);
}

.btn-shop-buy, .btn-shop-equip {
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-shop-buy {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.btn-shop-equip {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.shop-tag.equipped {
  font-size: 0.7rem;
  font-weight: 800;
  color: #10b981;
}

/* Gym Training Modal */
.gym-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gym-energy-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gym-energy-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 800;
}

.gym-energy-track {
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gym-energy-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #10b981);
  transition: width 0.3s ease;
}

.gym-dummy-stage {
  position: relative;
  height: 160px;
  background: radial-gradient(circle, #1e293b 0%, #0f172a 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gym-dummy-character {
  font-size: 3rem;
  transition: transform 0.1s ease;
}

.wobble-left {
  transform: rotate(-15deg) scale(0.95);
}

.wobble-right {
  transform: rotate(15deg) scale(0.95);
}

.dummy-speech-bubble {
  position: absolute;
  top: 12px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--primary-gold);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.75rem;
  color: #fff;
  font-weight: 700;
}

.gym-dummy-stats {
  display: flex;
  justify-content: space-around;
  gap: 6px;
}

.gym-stat-pill {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--dark-card-border);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.gym-floating-coin {
  position: absolute;
  font-family: var(--font-comic);
  font-size: 1.2rem;
  color: #f59e0b;
  animation: floatUp 1.2s forwards;
  pointer-events: none;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-40px); }
}

/* Victory & Defeat Modals */
.victory-modal .fanfare-card {
  border-color: var(--primary-gold);
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.5);
  text-align: center;
}

.fanfare-banner {
  font-family: var(--font-comic);
  font-size: 2.2rem;
  color: var(--primary-gold);
}

.victory-headline {
  font-family: var(--font-condensed);
  font-size: 1.3rem;
  color: #fff;
}

.victory-avatar-showcase {
  font-size: 3rem;
  margin: 6px 0;
}

.victory-rewards {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.reward-pill {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--primary-gold);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
}

.victory-xp-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.victory-xp-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 800;
}

.victory-xp-track {
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.victory-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  transition: width 0.4s ease;
}

.match-stats-recap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.recap-pill {
  background: rgba(15, 23, 42, 0.8);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
}

.recap-lbl { color: var(--text-secondary); }
.recap-val { font-weight: 800; color: #fff; }

.victory-actions, .defeat-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.victory-sub-actions, .defeat-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.victory-bottom-row, .defeat-bottom-row {
  display: flex;
  gap: 6px;
}

.defeat-modal .defeat-card {
  border-color: #ef4444;
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.5);
  text-align: center;
}

.defeat-banner {
  font-family: var(--font-comic);
  font-size: 2rem;
  color: #ef4444;
}

.defeat-avatar-showcase {
  font-size: 3rem;
  margin: 6px 0;
}

.defeat-boss-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.defeat-boss-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 800;
}

.defeat-hp-track {
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.defeat-hp-fill {
  height: 100%;
  background: #ef4444;
}

.defeat-tip {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.3);
  padding: 6px;
  border-radius: var(--radius-sm);
}

.slowmo-overlay {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid var(--primary-gold);
  border-radius: var(--radius-pill);
  padding: 8px 24px;
  z-index: 55;
  animation: pulseGlow 1s infinite;
}

.slowmo-text {
  font-family: var(--font-comic);
  font-size: 1.4rem;
  color: var(--primary-gold);
}
