/* three.js sahnelerinin üstündeki HUD: uygulamanın kamera ekranındaki öğeler.
   Renkler Colors.swift hud* ve deck* ile aynı. Boyutlar sahne genişliğine göre (cqw). */
[data-scene] { container-type: inline-size; }

.ward-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  color: #E4E7DA;
  letter-spacing: .06em;
}

/* Nişangâh çizgileri ve çentikleri */
.hud-cross { position: absolute; background: rgba(228, 231, 218, .32); }
.hud-cross-h { left: 0; right: 0; top: 50%; height: 1px; }
.hud-cross-v { top: 0; bottom: 0; left: 50%; width: 1px; }
.hud-cross::after { content: ""; position: absolute; }
.hud-cross-h::after {
  left: 0; right: 0; top: -4px; height: 9px;
  background: repeating-linear-gradient(90deg, rgba(228, 231, 218, .4) 0 1px, transparent 1px 4.5cqw);
}
.hud-cross-v::after {
  top: 0; bottom: 0; left: -4px; width: 9px;
  background: repeating-linear-gradient(180deg, rgba(228, 231, 218, .4) 0 1px, transparent 1px 4.5cqw);
}

/* Köşe parantezleri: merkez nişangâh ve hedef kutusu */
.hud-brackets { position: absolute; }
.hud-brackets i { position: absolute; width: 28%; height: 28%; border: 0 solid currentColor; }
.hud-brackets i:nth-of-type(1) { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
.hud-brackets i:nth-of-type(2) { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
.hud-brackets i:nth-of-type(3) { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
.hud-brackets i:nth-of-type(4) { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }

.hud-center { left: 50%; top: 50%; width: 13cqw; height: 13cqw; transform: translate(-50%, -50%); color: #C6D9AE; }
.hud-center b {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%; background: #C6D9AE;
}

.hud-target { left: 0; top: 0; color: #FFB000; will-change: transform; }
.hud-target b { position: absolute; inset: 22%; border: 2px solid #FF6B5E; border-radius: 50%; }
.hud-target-label {
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  padding: .25em .7em; border-radius: .5em; background: rgba(0, 0, 0, .72);
  color: #FFB000; font-size: clamp(9px, 1.9cqw, 13px); font-weight: 700; white-space: nowrap;
}

.hud-link { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hud-link line { stroke: #7FD3F5; stroke-width: 1.5; }

/* Pusula şeridi */
.hud-compass {
  position: absolute; top: 4%; left: 50%; width: 36%; height: 48px; transform: translateX(-50%);
  overflow: hidden; border-radius: 8px; background: rgba(0, 0, 0, .3);
}
.hud-compass-strip { position: absolute; left: 0; top: 2px; will-change: transform; }
.hud-compass-strip svg { display: block; font-family: "Space Grotesk", ui-sans-serif, system-ui, sans-serif; }
.hud-compass-caret {
  position: absolute; left: 50%; bottom: 13px; width: 0; height: 0;
  border: 5px solid transparent; border-top-color: #FFB000; transform: translateX(-50%);
}
.hud-compass-value {
  position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%);
  color: #FFB000; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* Mod başlığı ve durum düğmesi */
.hud-mode { position: absolute; top: 5%; left: 3.5%; display: grid; gap: .15em; }
.hud-mode-title { color: #C6D9AE; font-size: clamp(10px, 2.2cqw, 15px); font-weight: 700; letter-spacing: .12em; }
.hud-mode-name { font-size: clamp(8px, 1.5cqw, 11px); font-weight: 600; letter-spacing: .1em; }

.hud-status {
  position: absolute; right: 3.5%; bottom: 5%; display: flex; align-items: center; gap: .9em;
  padding: .7em 1.1em; border-radius: .7em;
  background: linear-gradient(180deg, #383838, #202020);
  box-shadow: inset 0 1px 0 #4A4A4A, 0 0 0 1px #101010;
  font-size: clamp(9px, 1.7cqw, 12px); font-weight: 700; letter-spacing: .1em;
}
.hud-led { flex: none; width: .6em; height: .6em; border-radius: 50%; background: #6BE04A; box-shadow: 0 0 .7em rgba(107, 224, 74, .8); }

/* Akustik: yön okuması ve dinleme paneli */
.hud-bearing { position: absolute; top: 5%; right: 3.5%; display: grid; justify-items: end; gap: .1em; }
.hud-bearing span { color: #9AA08E; font-size: clamp(8px, 1.6cqw, 11px); font-weight: 600; }
.hud-bearing strong { font-size: clamp(16px, 4cqw, 28px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0; }

.hud-listen {
  position: absolute; left: 3.5%; bottom: 5%; width: min(44%, 16rem); padding: .8em 1em;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: .7em; background: rgba(0, 0, 0, .6);
  font-size: clamp(9px, 1.8cqw, 12px);
}
.hud-listen-head { display: flex; align-items: center; gap: .6em; color: #C6D9AE; font-weight: 700; letter-spacing: .12em; }
.hud-listen-sub { margin-top: .2em; color: #9AA08E; font-size: .85em; letter-spacing: .02em; }
.hud-bars { display: flex; align-items: flex-end; gap: 2px; height: 2.6em; margin-top: .7em; }
.hud-bars i { flex: 1; height: 10%; border-radius: 1px; background: #5E7049; }
.hud-bars i.peak { background: #A8BC8F; }

/* Manuel takip: Detection moduyla aynı kamera odak parantezleri */
.hud-track { position: absolute; left: 0; top: 0; color: #DCDFA3; will-change: transform, width, height, opacity; }
.hud-track b { position: absolute; inset: 20%; border: 2px solid #FF6B5E; border-radius: 50%; }
.hud-track .hud-target-label { color: #E4E7DA; }
.hud-hint {
  position: absolute; top: 5%; left: 50%; transform: translateX(-50%);
  padding: .45em .9em; border-radius: 999px; background: rgba(0, 0, 0, .55);
  font-size: clamp(9px, 1.6cqw, 12px); font-weight: 600; letter-spacing: .04em; white-space: nowrap;
  transition: opacity .4s ease;
}
.hud-hint.is-hidden { opacity: 0; }
.hud-led.is-off { background: #2A2A2A; box-shadow: none; }
[data-scene="manual"]:focus-visible { outline: 2px solid #C6D9AE; outline-offset: 4px; }

/* Harita lejantı */
.hud-legend {
  position: absolute; left: 3.5%; bottom: 5%; display: flex; flex-wrap: wrap; align-items: center; gap: .6em 1.4em;
  font-size: clamp(8px, 1.6cqw, 11px); font-weight: 700; letter-spacing: .08em;
}
.hud-legend > span { display: inline-flex; align-items: center; gap: .5em; }
.hud-legend i { display: inline-block; width: 1em; height: 1em; }
.hud-legend i.is-sound { border: 2px solid #FF6B5E; border-radius: 50%; }
.hud-legend i.is-vision { border: 2px dashed #FFB000; }
.hud-legend .hud-scale { color: #9AA08E; }

/* Dar sahnede kalabalığı azalt */
@container (max-width: 440px) {
  .hud-compass, .hud-status, .hud-listen-sub { display: none; }
}
