/**
 * FRIEND OR FOE BENCHMARK STYLESHEET (style.css)
 * Golden Standard 3D Cyber Shooting Arena with Realistic Target Silhouettes
 * Clean, Matte Tactical Aesthetics (No Unnecessary Glow, Stable Card Colors)
 */

:root {
  --primary-accent: #ef4444;
  --secondary-accent: #00f0ff;
  --bg-dark: #060912;
  --panel-bg: #0d131f;
  --border-color: #1e293b;
}

/* ── Fullscreen Fit-to-Screen Constraints during Active Gameplay ONLY ── */
body:has(#panelTask.active) {
  overflow: hidden !important;
}

body:has(#panelTask.active) header.panda-header,
body:has(#panelTask.active) .panda-nav,
body:has(#panelTask.active) footer.panda-footer,
body:has(#panelTask.active) .t-ambient-glow,
body:has(#panelTask.active) .t-seo-container,
body:has(#panelTask.active) .t-nav {
  display: none !important;
}

body:has(#panelTask.active) .t-shell {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

body:has(#panelTask.active) .t-card {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: #060912 !important;
  box-shadow: none !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column !important;
}

body:has(#panelTask.active) #panelTask {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  position: relative !important;
  overflow: hidden !important;
}

.fof-preview-box {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem 0 1rem;
  padding: 1.25rem;
  background: rgba(13, 19, 31, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.preview-target-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 130px;
  padding: 0.85rem;
  border-radius: 10px;
  background: #0d131f;
  border: 1px solid #374151;
}

.preview-target-card.threat {
  border-color: #ef4444;
}

.preview-target-card.friendly {
  border-color: #00f0ff;
}

.preview-target-svg {
  width: 90px;
  height: 135px;
  display: block;
}

.p-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.threat-badge {
  background: #ef4444;
  color: #ffffff;
}

.friend-badge {
  background: #00f0ff;
  color: #04101e;
}

.fof-preview-caption {
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 1.5rem;
}

/* ══ 2. TASK / PLAY PANEL (Full Viewport with 3D Golden Standard Arena) ══ */
#panelTask {
  flex: 1;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  display: none;
  position: relative;
  overflow: hidden;
  background-color: #060912;
}

#panelTask.active {
  display: block;
}

/* ════ 3D WEBGL SHOOTING ARENA (Golden Standard Environment) ════ */
.fof-3d-arena {
  width: 100vw !important;
  height: 100vh !important;
  position: absolute;
  top: 0;
  left: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background-color: #060912;
  box-shadow: none !important;
  overflow: hidden;
  cursor: var(--cursor-fps-crosshair) !important;
  z-index: 1;
}

.fof-3d-arena::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(4, 7, 13, 0.75) 100%);
  pointer-events: none;
  z-index: 2;
}

#webgl-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ════ MINIMALIST TOP HUD (Standard ReflexBench Floating Buttons) ════ */
.top-header {
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  padding: 0 !important;
  z-index: 100;
  pointer-events: none;
}

.top-header .hub-pill,
.top-header .round-pill,
.top-header .header-actions,
.top-header .restart-pill {
  pointer-events: auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hub-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(13, 18, 28, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
}

.hub-pill:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
}

.round-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(13, 18, 28, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: #00f0ff;
  border-radius: 50%;
  box-shadow: 0 0 8px #00f0ff;
  animation: pulseDot 1.4s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; }
}

.countdown-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.header-actions {
  display: flex;
  align-items: center;
}

.restart-pill {
  margin-left: auto !important;
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #f87171 !important;
  border-radius: 8px !important;
  padding: 6px 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  font-family: inherit !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  transition: all 0.15s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  pointer-events: auto !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

.restart-pill:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.35) !important;
}

/* ════ CENTER 3 CLEAN CARDS STAGE (Balanced Tactical Lane Spread) ════ */
.cards-stage {
  position: absolute;
  top: 51%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(38px, 4.2vw, 62px);
  width: 100%;
  max-width: 880px;
  padding: 0 20px;
  box-sizing: border-box;
  perspective: 1200px;
  z-index: 20;
  cursor: var(--cursor-fps-crosshair) !important;
}

/* Target Card Container - Subtle Transparency, Less Rounded (8px), Stable Color */
.target-card {
  flex: 1;
  max-width: clamp(165px, 16.5vw, 198px);
  height: clamp(265px, 26.5vw, 298px);
  background: rgba(10, 16, 28, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 0.5rem;
  cursor: var(--cursor-fps-crosshair) !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s, border-color 0.2s;
  user-select: none;
  position: relative;
  overflow: visible;
}

.target-card:hover {
  transform: translateY(-4px);
  background: rgba(14, 22, 38, 0.58);
  border-color: rgba(255, 255, 255, 0.18);
}

.card-target-area {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  perspective: 1000px;
}

/* Mechanical Target Flip Inside Card */
.silhouette-target {
  width: 130px;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform-origin: bottom center;
  transform: rotateX(90deg);
  opacity: 0;
  transition: transform 0.16s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.12s;
  user-select: none;
  pointer-events: none;
}

.silhouette-target.active {
  transform: rotateX(0deg);
  opacity: 1;
}

.silhouette-target.shot-hit {
  animation: hitShake 0.18s ease-in-out;
  transform: rotateX(90deg) !important;
  opacity: 0 !important;
  transition: transform 0.2s ease-in, opacity 0.2s;
}

@keyframes hitShake {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.05) rotate(-2deg); }
  50% { transform: scale(0.98) rotate(2deg); }
  100% { transform: scale(0.95); }
}

/* ════ REALISTIC SHOOTING RANGE SILHOUETTE SVG TARGETS ════ */
.target-svg {
  width: 130px;
  height: 195px;
  display: block;
}

/* Neutral Silhouette SVG Elements */
.sil-outline {
  fill: #141b2a;
  stroke: #475569;
  stroke-width: 1.8;
  transition: fill 0.15s, stroke 0.15s;
}

.ring-line {
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1.1;
  fill: none;
}

.crosshair-line {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 0.9;
  stroke-dasharray: 2 2;
}

.bullseye-center {
  fill: #64748b;
}

.ring-num {
  fill: rgba(255, 255, 255, 0.55);
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  dominant-baseline: central;
}

.sil-type-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  dominant-baseline: central;
  fill: #64748b;
}

/* Armed Threat (Matte Crisp Red - No Fuzzy Glows) */
.silhouette-target.threat .sil-outline,
.preview-target-card.threat .sil-outline {
  fill: #1c0909;
  stroke: #ef4444;
  stroke-width: 2.2;
}

.silhouette-target.threat .ring-line,
.preview-target-card.threat .ring-line {
  stroke: rgba(239, 68, 68, 0.5);
}

.silhouette-target.threat .crosshair-line,
.preview-target-card.threat .crosshair-line {
  stroke: rgba(239, 68, 68, 0.7);
}

.silhouette-target.threat .bullseye-center,
.preview-target-card.threat .bullseye-center {
  fill: #ef4444;
}

.silhouette-target.threat .sil-type-label,
.preview-target-card.threat .sil-type-label {
  fill: #ef4444;
}

/* Friendly Civilian (Matte Crisp Cyan - No Fuzzy Glows) */
.silhouette-target.friendly .sil-outline,
.preview-target-card.friendly .sil-outline {
  fill: #051424;
  stroke: #00f0ff;
  stroke-width: 2.2;
}

.silhouette-target.friendly .ring-line,
.preview-target-card.friendly .ring-line {
  stroke: rgba(0, 240, 255, 0.5);
}

.silhouette-target.friendly .crosshair-line,
.preview-target-card.friendly .crosshair-line {
  stroke: rgba(0, 240, 255, 0.7);
}

.silhouette-target.friendly .bullseye-center,
.preview-target-card.friendly .bullseye-center {
  fill: #00f0ff;
}

.silhouette-target.friendly .sil-type-label,
.preview-target-card.friendly .sil-type-label {
  fill: #00f0ff;
}

/* Badge Below Silhouette Target - Crisp & Flat */
.sil-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 5px;
}

.silhouette-target.threat .sil-badge {
  background: #ef4444;
  color: #ffffff;
}

.silhouette-target.friendly .sil-badge {
  background: #00f0ff;
  color: #04101e;
  font-weight: 900;
}

/* Muzzle Flash & Breach Flash Overlays */
.muzzle-flash-overlay {
  display: none !important;
}

.breach-flash-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 35%, rgba(239, 68, 68, 0.45) 100%);
  opacity: 0;
  transition: opacity 0.08s ease-out;
  z-index: 60;
}

.breach-flash-overlay.active {
  opacity: 1;
}

/* ══ 3. RESULT PANEL (Standard ReflexBench UI) ══ */
#panelResult,
#panelResults {
  display: none;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  box-sizing: border-box;
  flex-direction: column;
  align-items: center;
}

#panelResult.active,
#panelResults.active {
  display: flex;
}

@media (max-width: 768px) {
  .top-header {
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
  }
  .stats-ribbon {
    gap: 0.75rem;
  }
  .cards-stage {
    gap: 8px;
    padding: 0 8px;
  }
  .target-card {
    max-width: 105px;
    height: 200px;
    padding: 0.5rem 0.25rem;
    border-radius: 12px;
  }
  .silhouette-target {
    width: 85px;
    height: 150px;
  }
  .target-svg {
    width: 80px;
    height: 125px;
  }
  .sil-badge {
    font-size: 0.48rem;
    padding: 2px 4px;
  }
}
