/* ===========================================================================
   THE OPERATION: FOOTWORK BOSS CAMPAIGN - PHASE 4: BOSS ARENA
   Combat Arena Stylesheet, Multi-Phase Boss HUD, Hazards & Stingers
   =========================================================================== */

/* ── 1. FULLSCREEN ARENA SHELL ─────────────────────────────────────────── */
.boss-arena-root {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100000;
  background: #03060d;
  color: #fff;
  font-family: 'Chakra Petch', -apple-system, sans-serif;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  touch-action: none;
}

/* CRT Scanline Overlay */
.arena-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.25) 0px,
    rgba(0, 0, 0, 0.25) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 10;
  opacity: 0.65;
}

/* Vignette & Chromatic Aberration Edge */
.arena-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.85), inset 0 0 40px var(--faction-glow, #ff0055);
  z-index: 11;
}

/* Main 60fps Interactive Combat Canvas */
#boss-arena-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: crosshair;
}

/* ── 2. TOP COMBAT HUD ─────────────────────────────────────────────────── */
.arena-top-hud {
  position: relative;
  z-index: 20;
  padding: 10px 14px 6px;
  background: linear-gradient(180deg, rgba(4, 7, 14, 0.96) 65%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.arena-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: #94a3b8;
}

.arena-sector-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--faction-glow, #ff0055);
  font-weight: 700;
}

.arena-timer-pill {
  background: rgba(220, 20, 60, 0.2);
  border: 1px solid #ff1744;
  color: #ff5252;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  animation: arena-timer-pulse 1s infinite alternate;
}

@keyframes arena-timer-pulse {
  from { opacity: 0.7; transform: scale(0.98); }
  to   { opacity: 1; transform: scale(1.02); }
}

/* Boss Status Bar */
.arena-boss-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(10, 15, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.arena-boss-avatar-frame {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 5px;
  overflow: hidden;
  border: 2px solid var(--faction-glow, #ff0055);
  flex-shrink: 0;
  background: #020408;
}

.arena-boss-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.arena-boss-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.arena-boss-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
}

.arena-phase-pips {
  display: flex;
  gap: 4px;
}

.phase-pip {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  border: 1px solid var(--faction-glow, #ff0055);
  background: transparent;
  transition: all 0.3s;
}

.phase-pip.pip-cleared {
  background: var(--faction-glow, #ff0055);
  box-shadow: 0 0 6px var(--faction-glow, #ff0055);
}

.phase-pip.pip-active {
  background: #fff;
  box-shadow: 0 0 8px #fff;
  animation: pip-glow 0.8s ease-in-out infinite alternate;
}

@keyframes pip-glow {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

/* Boss Health Bar Track */
.arena-hp-track {
  width: 100%;
  height: 9px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.arena-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff1744, var(--faction-glow, #ff0055));
  transition: width 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 8px var(--faction-glow, #ff0055);
}

.arena-hp-shield-layer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(0, 240, 255, 0.6);
  box-shadow: 0 0 6px #00f0ff;
  transition: width 0.25s ease;
}

/* Player Status & Active Objective Bar */
.arena-sub-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.player-integrity-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 255, 157, 0.3);
  color: #00ff9d;
}

.integrity-track {
  width: 70px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.integrity-fill {
  height: 100%;
  width: 100%;
  background: #00ff9d;
  transition: width 0.2s ease, background 0.3s;
}

.integrity-low {
  background: #ff1744 !important;
  animation: integrity-flash 0.5s infinite alternate;
}

@keyframes integrity-flash {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

.arena-objective-badge {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── 3. MID-SCREEN HAZARD BANNER ────────────────────────────────────────── */
.arena-hazard-alert {
  position: absolute;
  top: 130px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  background: rgba(180, 0, 40, 0.92);
  border: 1px solid #ff1744;
  padding: 6px 14px;
  border-radius: 4px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 23, 68, 0.5);
  animation: hazard-slide-in 0.3s ease-out;
  pointer-events: none;
  white-space: nowrap;
}

@keyframes hazard-slide-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ── 4. BOTTOM TACTICAL COMBAT CONTROLS ─────────────────────────────────── */
.arena-bottom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 12px 16px 20px;
  background: linear-gradient(0deg, rgba(3, 6, 12, 0.98) 70%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: auto;
}

.arena-ctrl-btn {
  height: 52px;
  border-radius: 6px;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-dodge {
  flex: 1;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid #00f0ff;
  color: #00f0ff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.btn-dodge:active {
  background: rgba(0, 240, 255, 0.35);
  transform: scale(0.97);
}

.btn-fire-beam {
  flex: 2;
  background: var(--faction-glow, #ff0055);
  border: 1px solid #fff;
  color: #000;
  font-weight: 800;
  box-shadow: 0 0 20px var(--faction-glow, #ff0055);
}

.btn-fire-beam:active {
  filter: brightness(1.25);
  transform: scale(0.98);
}

.btn-interact {
  flex: 1.2;
  background: rgba(255, 183, 0, 0.15);
  border: 1px solid #ffb700;
  color: #ffb700;
  box-shadow: 0 0 12px rgba(255, 183, 0, 0.3);
  display: none;
}

.btn-interact.interact-visible {
  display: flex;
  animation: interact-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes interact-pulse {
  from { box-shadow: 0 0 8px rgba(255, 183, 0, 0.4); transform: scale(0.98); }
  to   { box-shadow: 0 0 18px rgba(255, 183, 0, 0.8); transform: scale(1.02); }
}

/* ── 5. CINEMATIC STINGERS & OVERLAYS ───────────────────────────────────── */

/* Phase Transition Stinger */
.arena-phase-stinger {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 12, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: stinger-fade-in 0.3s ease-out;
  pointer-events: auto;
}

.stinger-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--faction-glow, #ff0055);
  text-shadow: 0 0 25px var(--faction-glow, #ff0055);
}

.stinger-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: #cbd5e1;
  letter-spacing: 0.08em;
  max-width: 340px;
  text-align: center;
  line-height: 1.4;
}

@keyframes stinger-fade-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

/* Victory Conquest Screen */
.arena-victory-overlay {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: radial-gradient(circle at center, rgba(16, 26, 44, 0.98), #03060c 90%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  text-align: center;
  gap: 14px;
  animation: victory-pop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: auto;
}

@keyframes victory-pop {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.victory-crest {
  font-size: 3.5rem;
  color: var(--faction-glow, #ff0055);
  filter: drop-shadow(0 0 25px var(--faction-glow, #ff0055));
  animation: victory-crest-spin 1s ease-out;
}

@keyframes victory-crest-spin {
  0% { transform: scale(0) rotate(-180deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.victory-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

.victory-boss-strike {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: #94a3b8;
  text-decoration: line-through;
  text-decoration-color: #ff1744;
  letter-spacing: 0.08em;
}

.victory-reward-card {
  width: 100%;
  max-width: 360px;
  background: rgba(10, 18, 32, 0.85);
  border: 1px solid var(--faction-glow, #ff0055);
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
}

.reward-cr-tag {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffb700;
  letter-spacing: 0.05em;
  text-shadow: 0 0 12px rgba(255, 183, 0, 0.5);
}

.reward-asset-name {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #00ff9d;
}

.reward-asset-desc {
  font-family: 'Space Mono', monospace;
  font-size: 0.68rem;
  color: #94a3b8;
  line-height: 1.35;
}

.btn-victory-continue {
  width: 100%;
  max-width: 360px;
  height: 48px;
  background: var(--faction-glow, #ff0055);
  border: 1px solid #fff;
  color: #000;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 20px var(--faction-glow, #ff0055);
  margin-top: 6px;
}

.btn-victory-continue:hover {
  filter: brightness(1.2);
}

/* Defeat Screen */
.arena-defeat-overlay {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(15, 2, 6, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  gap: 14px;
  animation: stinger-fade-in 0.3s ease-out;
  pointer-events: auto;
}

.defeat-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ff1744;
  text-shadow: 0 0 20px rgba(255, 23, 68, 0.6);
}

.defeat-sub {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: #cbd5e1;
  max-width: 320px;
  line-height: 1.4;
}

.arena-defeat-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  margin-top: 10px;
}

.btn-retry {
  flex: 1.5;
  height: 46px;
  background: #ff1744;
  border: 1px solid #fff;
  color: #fff;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
}

.btn-retreat {
  flex: 1;
  height: 46px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #cbd5e1;
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
}
