/* ==========================================================================
   CHRONO BREACH // 时空裂隙：环带方舟 — Reticle, Compass, Waypoints, Threat Ring & Alerts
   Author: 星星恐龙
   Note: GPU compositor `will-change` hints remain strictly scoped to active nodes.
   ========================================================================== */

/* 1. 3D World-Space Objective Diamond Waypoints (6-Slot Pool) */
.hud-waypoints {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hud-wp {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

#hud-root.visible .hud-wp:not(.hidden) {
  will-change: transform, opacity;
}

.wp-diamond {
  position: absolute;
  left: 0;
  top: 0;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 1.5px solid var(--accent);
  background: rgba(8, 12, 18, 0.40);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.hud-wp[data-kind="exit"] .wp-diamond {
  border-color: var(--ivory);
}

.hud-wp[data-kind="resupply"] .wp-diamond {
  width: 10px;
  height: 10px;
  border-color: #7cd4ff;
}

.wp-chevron {
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 5px;
  color: var(--accent);
  opacity: 0;
  pointer-events: none;
}

#hud-root.visible .hud-wp.clamped:not(.hidden) .wp-chevron {
  will-change: transform, opacity;
}

.wp-chevron svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hud-wp[data-kind="exit"] .wp-chevron {
  color: var(--ivory);
}

.hud-wp[data-kind="resupply"] .wp-chevron {
  color: #7cd4ff;
}

.hud-wp.clamped .wp-chevron {
  opacity: 0.92;
}

.wp-label {
  position: absolute;
  top: 10px;
  left: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  line-height: 1.1;
  color: var(--ivory);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.88);
}

.wp-code {
  color: var(--accent);
  font-weight: 700;
}

.hud-wp[data-kind="exit"] .wp-code {
  color: var(--ivory);
}

.hud-wp[data-kind="resupply"] .wp-code {
  color: #7cd4ff;
}

.wp-sublabel {
  position: absolute;
  top: 22px;
  left: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
  color: rgba(243, 245, 248, 0.68);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.88);
}

.hud-wp.clamped .wp-sublabel {
  display: none;
}

/* 2. Top-Center Slim Horizon Bearing Scale */
.hud-compass {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 28px;
}

.compass-viewport {
  position: relative;
  width: 320px;
  height: 28px;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
}

.compass-lubber {
  position: absolute;
  left: 50%;
  top: 20px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid var(--accent);
  transform: translateX(-50%);
  z-index: 3;
}

.compass-deg {
  position: absolute;
  left: calc(100% + 6px);
  top: 2px;
  padding: 1px 5px;
  background: rgba(9, 12, 18, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--accent);
  min-width: 34px;
  text-align: center;
}

.compass-track {
  position: absolute;
  top: 0;
  left: 0;
  height: 28px;
}

#hud-root.visible .compass-track {
  will-change: transform;
}

.compass-node {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.compass-lbl {
  font-family: var(--font-cond);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.64);
  text-shadow: var(--hud-shadow);
  height: 12px;
}

.compass-node.cardinal .compass-lbl {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.compass-node.inter .compass-lbl {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.84);
}

.compass-tick {
  width: 1px;
  height: 4px;
  margin-top: 3px;
  background: rgba(255, 255, 255, 0.42);
}

.compass-node.major .compass-tick {
  height: 6px;
  background: rgba(255, 255, 255, 0.68);
}

.compass-node.cardinal .compass-tick {
  height: 8px;
  width: 1.5px;
  background: var(--accent);
}

/* 3. Center-Upper Tactical Sector & Contact Alert Banner */
.hud-alert-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 24px;
  background: linear-gradient(90deg, transparent, rgba(9, 12, 18, 0.72) 18%, rgba(9, 12, 18, 0.72) 82%, transparent);
  border-top: 1px solid var(--accent-border);
  border-bottom: 1px solid var(--accent-border);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
  white-space: nowrap;
}

.hud-alert-banner.visible {
  opacity: 1;
  will-change: opacity;
}

.hud-alert-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--gold-bright);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.92);
}

.hud-alert-banner.finale-alert {
  top: 12%;
  border-top-color: rgba(94, 228, 255, 0.68);
  border-bottom-color: rgba(228, 188, 112, 0.62);
}

.hud-alert-banner.finale-alert .hud-alert-text {
  font-size: 17px;
  letter-spacing: 0.20em;
  color: #dff8ff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95), 0 0 14px rgba(94, 228, 255, 0.28);
}

/* 4. Center Reticle, Hitmarker & Chrono Shift Ring */
.hud-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shift-ring {
  position: absolute;
  width: 46px;
  height: 46px;
  transform: rotate(-90deg);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1.4;
}

.ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-dasharray: 163.36;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.05s linear;
}

.crosshair {
  position: relative;
  width: 0;
  height: 0;
  --ch-gap: 8.5px;
  --ch-pip-opacity: 0.98;
  --ch-dot-opacity: 0.98;
  --ch-pip-color: #f6fbff;
}

#hud-root.visible .crosshair:not(.ads-hidden) {
  will-change: opacity;
}

.crosshair.ads-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.ch-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f6fbff;
  box-shadow: 0 0 0 1.25px rgba(6, 10, 16, 0.94), 0 0 5px rgba(0, 0, 0, 0.78);
  transform: translate3d(-50%, -50%, 0);
  opacity: var(--ch-dot-opacity, 0.98);
}

.crosshair.ch-locked .ch-dot {
  background: #ffffff;
  box-shadow: 0 0 0 1.25px rgba(6, 10, 16, 0.95), 0 0 6px rgba(120, 232, 255, 0.42);
}

.ch-pip {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--ch-pip-color, #f6fbff);
  border-radius: 0.75px;
  box-shadow: 0 0 0 1.25px rgba(6, 10, 16, 0.92), 0 0 6px rgba(0, 0, 0, 0.75);
  opacity: var(--ch-pip-opacity, 0.98);
}

#hud-root.visible .crosshair:not(.ads-hidden) .ch-pip {
  will-change: transform, opacity;
}

.crosshair.ch-locked .ch-pip {
  background: #ffffff;
  box-shadow: 0 0 0 1.25px rgba(6, 10, 16, 0.95), 0 0 6px rgba(120, 232, 255, 0.35);
}

.ch-top {
  width: 2.5px;
  height: 11px;
  transform: translate3d(-50%, calc(-100% - var(--ch-gap, 8.5px)), 0);
}

.ch-bottom {
  width: 2.5px;
  height: 11px;
  transform: translate3d(-50%, var(--ch-gap, 8.5px), 0);
}

.ch-left {
  height: 2.5px;
  width: 11px;
  transform: translate3d(calc(-100% - var(--ch-gap, 8.5px)), -50%, 0);
}

.ch-right {
  height: 2.5px;
  width: 11px;
  transform: translate3d(var(--ch-gap, 8.5px), -50%, 0);
}

/* Crisp Diagonal Ballistic Hitmarker */
.hitmarker {
  position: absolute;
  z-index: 3;
  width: 22px;
  height: 22px;
  opacity: 0;
  transform: scale(0.84);
  transition: opacity 0.06s ease-out, transform 0.06s ease-out;
}

.hitmarker.active {
  opacity: 1;
  transform: scale(1);
}

.hm-line {
  position: absolute;
  width: 7px;
  height: 1.5px;
  background: #ffffff;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.95);
  top: 50%;
  left: 50%;
}

.hitmarker.crit .hm-line {
  background: var(--gold-bright);
}

.hitmarker.kill .hm-line {
  background: var(--crimson);
  height: 2px;
}

.hm-1 {
  transform: translate(-10px, -7px) rotate(45deg);
}

.hm-2 {
  transform: translate(3px, -7px) rotate(-45deg);
}

.hm-3 {
  transform: translate(-10px, 5.5px) rotate(-45deg);
}

.hm-4 {
  transform: translate(3px, 5.5px) rotate(45deg);
}

.shift-denied-msg {
  position: absolute;
  top: 54px;
  padding: 3px 10px;
  background: rgba(28, 10, 14, 0.78);
  border: 1px solid rgba(255, 71, 87, 0.48);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #ff7a85;
  text-shadow: var(--hud-shadow);
  opacity: 0;
  transition: opacity 0.14s ease;
}

.shift-denied-msg.visible {
  opacity: 1;
}

/* 5. Directional Screen-Edge Red Damage Arcs */
.hud-damage-arcs {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(760px, 84vw);
  height: min(600px, 78vh);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.dmg-arc {
  position: absolute;
  width: 156px;
  height: 52px;
  opacity: 0;
  filter: drop-shadow(0 0 9px rgba(255, 34, 46, 0.86)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.96));
}

.dmg-arc.is-active {
  will-change: opacity;
}

.dmg-arc svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.dmg-arc-stroke {
  fill: none;
  stroke: #ff2a34;
  stroke-width: 5.2;
  stroke-linecap: round;
}

.dmg-arc-chevron {
  fill: none;
  stroke: #ffd4d8;
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dmg-top {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.dmg-right {
  top: 50%;
  right: -52px;
  transform: translateY(-50%) rotate(90deg);
}

.dmg-bottom {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) rotate(180deg);
}

.dmg-left {
  top: 50%;
  left: -52px;
  transform: translateY(-50%) rotate(-90deg);
}

/* 6. 360° Live Camera-Tracking Incoming-Fire & Hit Direction Ring (8-Slot Pool) */
#threat-ring-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 356px;
  height: 356px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
}

.threat-wedge {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform-origin: 50% 50%;
  transform: rotate(var(--threat-deg, 0deg));
  opacity: 0;
}

.threat-wedge:not(.hidden) {
  will-change: transform, opacity;
}

.threat-wedge-glyph {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 44px;
  height: 20px;
  transform: translateX(-50%) scale(1);
  transform-origin: 50% 50%;
  transition: transform 0.06s ease-out;
  pointer-events: none;
}

.threat-wedge-glyph svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.threat-wedge-glyph path {
  vector-effect: non-scaling-stroke;
}

.threat-wedge .wedge-hit-group,
.threat-wedge .wedge-suppress-group {
  display: none;
}

.threat-wedge.is-hit {
  z-index: 2;
}

.threat-wedge.is-hit .threat-wedge-glyph {
  width: 44px;
  height: 20px;
}

.threat-wedge.is-hit.is-fresh:not(.is-heavy) .threat-wedge-glyph {
  transform: translateX(-50%) scale(1.06);
}

.threat-wedge.is-hit .wedge-hit-group {
  display: block;
}

.wedge-hit-shadow {
  fill: none;
  stroke: rgba(6, 8, 12, 0.88);
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wedge-hit-arc {
  fill: none;
  stroke: #ff2e2e;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.wedge-hit-arc-inner {
  fill: none;
  stroke: #ffd8dc;
  stroke-width: 1.2;
  stroke-linecap: round;
}

.wedge-hit-chev-tip {
  fill: none;
  stroke: #ff2e2e;
  stroke-width: 2.0;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.threat-wedge.is-suppress {
  z-index: 1;
}

.threat-wedge.is-suppress .threat-wedge-glyph {
  width: 30px;
  height: 16px;
}

.threat-wedge.is-suppress .wedge-suppress-group {
  display: block;
}

.wedge-sup-shadow {
  fill: none;
  stroke: rgba(6, 8, 12, 0.82);
  stroke-width: 2.8;
  stroke-linecap: round;
}

.wedge-sup-arc {
  fill: none;
  stroke: #ff9d2e;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.threat-wedge.is-heavy .threat-wedge-glyph {
  transform: translateX(-50%) scale(1.06);
}
