/* ==========================================================================
   COMBAT - HIGH-PERFORMANCE MINIMALIST ARENA
   ========================================================================== */

:root {
  --bg-dark: #08090e;
  --team-cyan: #00f2fe;
  --team-cyan-subtle: rgba(0, 242, 254, 0.25);
  --team-red: #ff2a5f;
  --team-red-subtle: rgba(255, 42, 95, 0.25);

  --nav-bg: rgba(16, 18, 26, 0.72);
  --nav-border: rgba(255, 255, 255, 0.08);
  --nav-border-hover: rgba(255, 255, 255, 0.16);

  --text-primary: #f0f2f7;
  --text-secondary: #8b92a5;
  --text-muted: #52586b;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  /* Pure GPU-accelerated gradient backdrop (Zero expensive CSS filter overhead) */
  background-image:
    radial-gradient(circle at 18% 22%, rgba(0, 242, 254, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 82% 78%, rgba(255, 42, 95, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 60%),
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 36px 36px;
  color: var(--text-primary);
  font-family: var(--font-main);
  user-select: none;
  -webkit-user-select: none;
}

/* ==========================================================================
   CANVAS & FIGHTERS ARENA
   ========================================================================== */

#combat-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

#fighters-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  overflow: hidden;
  pointer-events: auto;
}

/* ==========================================================================
   SLEEK MINIMALIST FLOATING TOP BAR
   ========================================================================== */

.top-nav {
  position: fixed;
  top: 1.25rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 100;
  pointer-events: none;
  padding: 0 1rem;
}

.nav-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--nav-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--nav-border);
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-width: 480px;
}

.nav-inner:hover {
  border-color: var(--nav-border-hover);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Brand */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-glyph {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--team-cyan), #7928ca);
  box-shadow: 0 0 8px var(--team-cyan-subtle);
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* Match Score */
.match-score {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.22rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.score-team {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.score-team.cyan {
  color: var(--team-cyan);
}

.score-team.red {
  color: var(--team-red);
}

.team-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.team-dot.cyan {
  background: var(--team-cyan);
  box-shadow: 0 0 6px var(--team-cyan);
}

.team-dot.red {
  background: var(--team-red);
  box-shadow: 0 0 6px var(--team-red);
}

.score-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Nav Actions (FPS, Fighter Count, Sound) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.stat-item {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.stat-divider {
  color: var(--text-muted);
}

/* Sound Button */
.sound-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  margin-left: 0.25rem;
}

.sound-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.sound-toggle-btn.active {
  background: rgba(0, 242, 254, 0.14);
  color: var(--team-cyan);
  border-color: rgba(0, 242, 254, 0.35);
}

/* ==========================================================================
   FIGHTER SPRITES (HIGH PERFORMANCE)
   ========================================================================== */

.fighter-sprite {
  position: absolute;
  top: 0;
  left: 0;
  cursor: grab;
  will-change: transform;
  pointer-events: auto;
  user-select: none;
  -webkit-user-drag: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fighter-sprite:active {
  cursor: grabbing;
}

/* Health Bar (Minimalist Floating Line) */
.fighter-hud {
  width: 60px;
  margin-bottom: 4px;
  pointer-events: none;
}

.health-track {
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 9999px;
  overflow: hidden;
}

.health-fill {
  height: 100%;
  width: 100%;
  border-radius: 9999px;
  transition: width 0.12s linear;
}

.team-cyan .health-fill {
  background: var(--team-cyan);
}

.team-red .health-fill {
  background: var(--team-red);
}

/* Avatar Image */
.fighter-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* Fast GPU acceleration without expensive filter passes */
  transition: transform 0.08s ease-out;
}

.fighter-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* States */
.fighter-sprite.is-attacking .fighter-avatar {
  transform: scale(1.12);
}

.fighter-sprite.is-grabbed {
  z-index: 1000 !important;
}

.fighter-sprite.is-grabbed .fighter-avatar {
  transform: scale(1.22);
}

.fighter-sprite.is-stunned .fighter-avatar {
  filter: brightness(1.2);
  transform: rotate(-10deg);
}

.fighter-sprite.is-hit .fighter-avatar {
  transform: scale(0.92);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 640px) {
  .top-nav {
    top: 0.75rem;
  }

  .nav-inner {
    min-width: 0;
    width: 100%;
    padding: 0.4rem 0.85rem;
    gap: 0.85rem;
  }

  .stat-divider, #fighters-count {
    display: none;
  }
}
