/* NFPA 13 engel kuralları: 3B sahneler (js/obstruction-viz.js). Renkler style.css token'larından. */
.oviz {
  --o-ok: #34D399;
  --o-bad: #F87171;
  --o-na: #94A3B8;
  --o-line: rgba(240, 230, 255, 0.14);
  margin: 32px 0;
  background: var(--card-solid);
  border: 1px solid var(--card-border-hover);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.oviz:not(.is-ready):not(:has(.oviz-still)) { display: none; }
/* Ekrana gelmeden kurulmayan sahnenin yeri (js/obstruction-viz.js build) */
.oviz.is-pending { display: block; }
.oviz.is-pending::before { content: ""; display: block; aspect-ratio: 16 / 10; background: #07060f; }
/* Durağan kare (images/viz): WebGL / JS yokken ve sahne kurulana dek görünür, Google Görseller'e girer */
.oviz .oviz-still { display: block; width: 100%; height: auto; border: 0; border-radius: 0; }
.oviz.is-ready .oviz-still { display: none; }
.oviz.is-pending:has(.oviz-still)::before { display: none; }
.oviz:not(.is-ready) figcaption { padding-top: 14px; }

.oviz-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #07060f;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.oviz-stage:active { cursor: grabbing; }
.oviz-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.oviz-ann { pointer-events: none; }

.oviz-hud {
  position: absolute; left: 14px; top: 14px; right: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  pointer-events: none;
}
.oviz-pill {
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em;
  padding: 5px 11px; border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.oviz-pill.ok { color: #A7F3D0; background: rgba(52, 211, 153, 0.18); border: 1px solid rgba(52, 211, 153, 0.55); }
.oviz-pill.bad { color: #FECACA; background: rgba(248, 113, 113, 0.2); border: 1px solid rgba(248, 113, 113, 0.6); }
.oviz-pill.na { color: #E2E8F0; background: rgba(148, 163, 184, 0.18); border: 1px solid rgba(148, 163, 184, 0.5); }
.oviz-hud-t {
  font-size: 0.82rem; line-height: 1.35; color: #EEE8FF;
  padding: 5px 11px; border-radius: 9px;
  background: rgba(8, 6, 20, 0.66);
  border: 1px solid rgba(240, 230, 255, 0.1);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}
.oviz-hint {
  position: absolute; right: 12px; bottom: 10px;
  font-size: 0.72rem; color: rgba(240, 230, 255, 0.5);
  pointer-events: none;
}

.oviz-ctrl { display: grid; gap: 16px; padding: 18px 20px 4px; }
.oviz-chips { display: grid; gap: 8px; }
.oviz-lbl, .oviz-slider label > span {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}
.oviz-chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.oviz-chiprow button {
  font: inherit; font-size: 0.86rem; cursor: pointer;
  padding: 7px 14px; border-radius: 999px;
  color: var(--text-secondary); background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--o-line);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.oviz-chiprow button:hover { color: var(--text); border-color: rgba(240, 230, 255, 0.3); }
.oviz-chiprow button.on { color: #fff; background: rgba(249, 115, 22, 0.18); border-color: var(--accent-fire); }

.oviz-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 24px; }
.oviz-slider { display: grid; gap: 8px; }
.oviz-slider[hidden] { display: none; }
.oviz-slider label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.oviz-slider output { font-size: 0.92rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.oviz-slider input[type=range] {
  --k: 50%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; margin: 6px 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent-fire) 0 var(--k), rgba(240, 230, 255, 0.14) var(--k) 100%);
}
.oviz-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 4px solid var(--accent-fire);
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.45);
}
.oviz-slider input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 4px solid var(--accent-fire);
  box-shadow: 0 2px 10px rgba(249, 115, 22, 0.45);
}

.oviz-read { margin: 0; font-size: 0.92rem; line-height: 1.65; color: var(--text-secondary); font-variant-numeric: tabular-nums; }

.oviz-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-bottom: 6px; }
.oviz-btn {
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  padding: 8px 15px; border-radius: 999px;
  color: var(--text-secondary); background: transparent; border: 1px solid var(--o-line);
  transition: color var(--transition), border-color var(--transition);
}
.oviz-btn:hover { color: var(--text); border-color: var(--accent-fire); }
.oviz button:focus-visible, .oviz input:focus-visible { outline: 2px solid var(--accent-fire); outline-offset: 3px; }
.oviz-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 0.8rem; color: var(--text-muted); }
.oviz-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.oviz-legend i:first-child { margin-left: 0; }
.oviz-legend .lg-wet { background: linear-gradient(135deg, #4FB4FF, #1E6FD0); box-shadow: 0 0 8px rgba(79, 180, 255, 0.6); }
.oviz-legend .lg-dry { background: #2B2836; border: 1px solid rgba(240, 230, 255, 0.2); }
.oviz-legend .lg-ring { border-radius: 50%; border: 2px solid var(--o-ok); }

.oviz figcaption {
  margin: 0; padding: 4px 20px 18px;
  text-align: left; font-style: normal;
  font-size: 0.85rem; line-height: 1.6; color: var(--text-secondary);
}
.oviz figcaption strong { color: var(--text); }

/* Sahnede seçili tablo satırı */
.data-table tr.is-on td { background: rgba(249, 115, 22, 0.13); color: var(--text); }
.data-table tr.is-on td:first-child { box-shadow: inset 3px 0 0 var(--accent-fire); }
.data-table tr td { transition: background 0.25s; }

@media (max-width: 640px) {
  .oviz { margin: 26px -6px; }
  .oviz-stage { aspect-ratio: 1 / 1.02; }
  .oviz.is-pending::before { aspect-ratio: 1 / 1.02; }
  .oviz-hud { left: 10px; top: 10px; right: 10px; }
  .oviz-hud-t { font-size: 0.76rem; }
  .oviz-ctrl { padding: 16px 16px 4px; }
  .oviz figcaption { padding: 4px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .oviz-pill, .data-table tr td { transition: none; }
}
