/**
 * DEPTH BREACH BENCHMARK STYLESHEET (style.css)
 * 5 Non-Overlapping Depth-Staggered Targets Across Z-Axis (2 Front, 1 Mid, 2 Back)
 * Golden Standard 3D Arena, Clean Matte Aesthetics, White Dot Aim Cursor
 * Integrates floating minimalist HUD, disabled muzzle flash, and standard ReflexBench UI
 */

: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;
}

/* ══ 1. INTRO PANEL OVERLAY ══ */
.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 (Floating Buttons as in Friend or Foe) ════ */
.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 .round-pill,
.top-header .countdown-pill,
.top-header .header-actions,
.top-header .restart-pill {
  pointer-events: auto;
}

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

.round-pill,
.countdown-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;
  margin-left: auto !important;
}

.restart-pill {
  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;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.15s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

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

/* ════ 5 NON-OVERLAPPING DEPTH-STAGGERED CARDS STAGE (Golden Standard from Source) ════ */
.cards-stage {
  position: absolute;
  top: 51%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 1160px;
  height: 520px;
  perspective: 1200px;
  transform-style: preserve-3d;
  z-index: 20;
  pointer-events: none;
  cursor: var(--cursor-fps-crosshair) !important;
}

/* Target Card Container - Semi-transparent, 8px corners, stable color */
.target-card {
  position: absolute;
  pointer-events: auto;
  width: clamp(138px, 13.8vw, 162px);
  height: clamp(232px, 23.2vw, 268px);
  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.65rem 0.5rem;
  cursor: var(--cursor-fps-crosshair) !important;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s, border-color 0.2s, filter 0.2s;
  user-select: none;
  overflow: hidden;
}

/* Symmetrical 5-Column Perspective Formation (Physically Accurate Ground Recession & Zero Overlap) */

/* Column 1: Front Left (15% X, Key [1]) */
.col-front-left {
  left: 15%;
  top: calc(50% + 28px);
  transform: translate(-50%, -50%) translateZ(65px) scale(1.05);
  z-index: 30;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75);
}
.col-front-left:hover {
  transform: translate(-50%, -53%) translateZ(65px) scale(1.07);
  background: rgba(14, 22, 38, 0.58);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Column 2: Back Left (32.5% X, Key [2]) */
.col-back-left {
  left: 32.5%;
  top: calc(50% - 30px);
  transform: translate(-50%, -50%) translateZ(-130px) scale(0.80);
  z-index: 10;
  opacity: 0.92;
  filter: brightness(0.88);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.col-back-left:hover {
  transform: translate(-50%, -53%) translateZ(-130px) scale(0.82);
  background: rgba(14, 22, 38, 0.58);
  border-color: rgba(255, 255, 255, 0.18);
  filter: brightness(1.0);
}

/* Column 3: Mid Center (50% X, Key [3]) */
.col-mid-center {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) translateZ(0px) scale(0.92);
  z-index: 20;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.6);
}
.col-mid-center:hover {
  transform: translate(-50%, -53%) translateZ(0px) scale(0.94);
  background: rgba(14, 22, 38, 0.58);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Column 4: Back Right (67.5% X, Key [4]) */
.col-back-right {
  left: 67.5%;
  top: calc(50% - 30px);
  transform: translate(-50%, -50%) translateZ(-130px) scale(0.80);
  z-index: 10;
  opacity: 0.92;
  filter: brightness(0.88);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.col-back-right:hover {
  transform: translate(-50%, -53%) translateZ(-130px) scale(0.82);
  background: rgba(14, 22, 38, 0.58);
  border-color: rgba(255, 255, 255, 0.18);
  filter: brightness(1.0);
}

/* Column 5: Front Right (85% X, Key [5]) */
.col-front-right {
  left: 85%;
  top: calc(50% + 28px);
  transform: translate(-50%, -50%) translateZ(65px) scale(1.05);
  z-index: 30;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75);
}
.col-front-right:hover {
  transform: translate(-50%, -53%) translateZ(65px) scale(1.07);
  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: 124px;
  height: 210px;
  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: 120px;
  height: 180px;
  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 {
  fill: none;
  stroke: #334155;
  stroke-width: 1.2;
  transition: stroke 0.15s;
}

.crosshair-line {
  stroke: #334155;
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
}

.bullseye-center {
  fill: #475569;
}

.ring-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  fill: #334155;
}

.sil-type-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 800;
  fill: #475569;
  letter-spacing: 0.08em;
}

/* ── THREAT STATE (Clean Red, Matte, No Excessive Glow) ── */
.silhouette-target.threat .sil-outline {
  fill: #221218;
  stroke: #ef4444;
  stroke-width: 2.2;
}

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

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

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

.silhouette-target.threat .ring-num {
  fill: rgba(239, 68, 68, 0.75);
}

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

/* ── FRIENDLY STATE (Clean Cyan, Matte) ── */
.silhouette-target.friendly .sil-outline {
  fill: #0c1c28;
  stroke: #00f0ff;
  stroke-width: 2.2;
}

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

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

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

.silhouette-target.friendly .ring-num {
  fill: rgba(0, 240, 255, 0.75);
}

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

/* Silhouette Status Badge - Sits naturally below the SVG silhouette */
.sil-badge {
  display: inline-block;
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  user-select: none;
}

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

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

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

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

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

/* Floating Feedback Popup Tags */
.fof-floating-tag {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: 120;
  transition: all 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 1;
  white-space: nowrap;
}

/* ══ 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) {
  body:has(#panelTask.active) .t-shell,
  body:has(#panelTask.active) .t-card,
  body:has(#panelTask.active) #panelTask {
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  .top-header {
    top: max(12px, env(safe-area-inset-top, 12px)) !important;
    left: 12px !important;
    right: 12px !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
  }

  .cards-stage {
    width: 100% !important;
    max-width: 100vw !important;
    height: 380px !important;
    padding: 0 !important;
  }

  /* Proportional 5-Card Dimensions with Zero Overlap */
  .target-card {
    width: clamp(52px, 15.5vw, 68px) !important;
    height: clamp(130px, 28vw, 160px) !important;
    padding: 0.35rem 0.15rem !important;
    border-radius: 6px !important;
  }

  /* Symmetrical 5-Column Spacing (20% intervals = Zero Overlap) */
  .col-front-left {
    left: 10% !important;
    top: calc(50% + 22px) !important;
    transform: translate(-50%, -50%) translateZ(40px) scale(1.02) !important;
  }

  .col-back-left {
    left: 30% !important;
    top: calc(50% - 24px) !important;
    transform: translate(-50%, -50%) translateZ(-80px) scale(0.88) !important;
  }

  .col-mid-center {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) translateZ(0px) scale(0.95) !important;
  }

  .col-back-right {
    left: 70% !important;
    top: calc(50% - 24px) !important;
    transform: translate(-50%, -50%) translateZ(-80px) scale(0.88) !important;
  }

  .col-front-right {
    left: 90% !important;
    top: calc(50% + 22px) !important;
    transform: translate(-50%, -50%) translateZ(40px) scale(1.02) !important;
  }

  .silhouette-target {
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  .target-svg {
    width: 44px !important;
    height: 84px !important;
  }

  .sil-badge {
    font-size: 0.44rem !important;
    padding: 1.5px 3px !important;
    white-space: nowrap !important;
    letter-spacing: 0.02em !important;
  }

  .floating-fof-tag {
    font-size: 0.72rem !important;
  }
}
