/* Threat Radar: layout only; the scope itself is drawn on one canvas by app.js */
.tr { max-width: 1200px; margin: 0 auto; padding: 18px 16px 8px; box-sizing: border-box; }
.tr *, .tr *::before, .tr *::after { box-sizing: border-box; }
.tr-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-bottom: 18px; }
.tr-title { font: 54px/0.95 var(--font-display); letter-spacing: .04em; margin: 0; transform: rotate(-2deg); color: var(--ink); }
.tr-explain { flex: 1 1 360px; max-width: 640px; margin: 0; transform: rotate(.6deg); }

.tr-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.tr-scope { padding: 10px; overflow: hidden; }
.tr-canvas-wrap { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: min(72vh, 760px); }
#scope { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 2px; touch-action: manipulation; cursor: crosshair; }
#scope:focus-visible { outline-offset: -4px; }

.tr-ov { position: absolute; display: flex; gap: 6px; pointer-events: none; }
.tr-ov--tl { top: 8px; left: 8px; }
.tr-mode { pointer-events: auto; }
.tr-mode.is-live { color: var(--live); border-color: var(--live); }
.tr-mode.is-live::before { content: "● "; }
.tr-mode.is-demo { background: var(--yellow); color: #141210; border-color: #141210; }

.tr-tip {
  position: absolute; z-index: 3; pointer-events: none; max-width: 230px;
  background: var(--panel); color: var(--ink); border: 2.5px solid var(--panel-ink); box-shadow: 3px 3px 0 var(--panel-ink);
  padding: 7px 10px; font: 600 14px/1.35 var(--font-label); letter-spacing: .02em; border-radius: 3px;
}
.tr-tip b { font: 22px/1 var(--font-display); letter-spacing: .04em; color: var(--accent); }
.tr-tip small { display: block; font: 12px/1.4 var(--font-type); color: var(--muted); letter-spacing: 0; }
:root[data-theme="hud"] .tr-tip { box-shadow: var(--glow); border-width: 1.5px; border-radius: 8px; }

.tr-embed-count { display: none; }

.tr-scope-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 4px 2px; }
.tr-legend { margin: 0; font: 13px/1.45 var(--font-type); color: var(--ink-2); flex: 1 1 260px; }
.tr-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--red); border: 2px solid var(--panel-ink); vertical-align: -1px; }
.tr-sound { padding: 8px 12px; font-size: 13px; }
.tr-sound[aria-pressed="true"] { background: var(--yellow); color: #141210; }

.tr-side { display: grid; gap: 18px; }
.tr-box { padding: 14px 16px; }
.tr-h { font: 600 14px/1 var(--font-label); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 10px; color: var(--ink-2); }
.tr-h small { font: 11px/1 var(--font-type); letter-spacing: 0; text-transform: none; color: var(--muted); }

.tr-counters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.tr-counters div { border-left: 4px solid var(--accent); padding-left: 9px; }
.tr-counters dt { font: 500 11px/1 var(--font-label); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tr-counters dd { margin: 3px 0 0; font: 40px/1 var(--font-display); letter-spacing: .03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.tr-counters div:first-child dd { color: var(--accent); }
.tr-refused { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 14px 0 0; }
.tr-vitals { font: 12px/1.4 var(--font-type); color: var(--muted); }

.tr-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tr-board li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; font: 500 14px/1.2 var(--font-label); }
.tr-board .fl { font-size: 19px; line-height: 1; }
.tr-board .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-board .ct { font: 20px/1 var(--font-display); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.tr-board .bar { grid-column: 2 / 4; height: 6px; background: var(--paper-2); border: 1.5px solid var(--panel-ink); border-radius: 2px; overflow: hidden; }
.tr-board .bar i { display: block; height: 100%; background: var(--accent); }
.tr-board li:first-child .bar i { background: repeating-linear-gradient(-45deg, var(--accent) 0 5px, var(--yellow) 5px 8px); }

.tr-users { display: grid; gap: 3px; font: 16px/1.35 var(--font-type); }
.tr-users div { white-space: nowrap; overflow: hidden; }
.tr-users .u { background: var(--yellow); color: #141210; padding: 0 4px; }
.tr-users .x { color: var(--accent); }
.tr-users .cur::after { content: "▌"; color: var(--accent); animation: trblink 1s steps(1) infinite; }
@keyframes trblink { 50% { opacity: 0; } }

.tr-log { list-style: none; margin: 0; padding: 0; font: 13px/1.5 var(--font-type); min-height: 7.5em; }
.tr-log li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px dashed var(--line); padding: 2px 0; }
.tr-log li:first-child { color: var(--accent); }
.tr-log .tr-log-empty { color: var(--muted); border: 0; }
.tr-log .ok { font: 600 11px/1 var(--font-label); letter-spacing: .1em; text-transform: uppercase; color: var(--live); }
.tr-updated { margin: 10px 0 0; font: 11px/1.4 var(--font-type); color: var(--muted); }

@media (max-width: 900px) {
  .tr-grid { grid-template-columns: minmax(0, 1fr); }
  .tr-side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .tr-canvas-wrap { max-height: none; }
}
@media (max-width: 480px) {
  .tr { padding: 12px 12px 4px; }
  .tr-title { font-size: 42px; }
  .tr-explain { font-size: 14px; }
  .tr-scope { padding: 6px; }
  .tr-counters dd { font-size: 34px; }
}

/* embed: radar + the 24 h counter only, no scrollbars */
html.embed, html.embed body { height: 100%; overflow: hidden; }
html.embed body { background-image: none; }
html.embed .tr { padding: 0; max-width: none; height: 100%; }
html.embed .tr-head, html.embed .tr-side, html.embed .tr-scope-foot { display: none; }
html.embed .tr-grid { display: block; height: 100%; }
html.embed .tr-scope { height: 100%; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
html.embed .tr-canvas-wrap { height: 100%; aspect-ratio: auto; max-height: none; }
html.embed .tr-embed-count {
  display: block; position: absolute; left: 8px; bottom: 8px; z-index: 2; pointer-events: none;
  font-size: 13px; padding: 5px 10px; box-shadow: 3px 3px 0 var(--red);
}
html.embed .tr-embed-count b { font: 26px/1 var(--font-display); letter-spacing: .04em; color: var(--yellow); vertical-align: -2px; }
html.embed .tr-embed-sub { display: block; font-size: 11px; color: #bbb; }
@media (max-width: 420px) {
  html.embed .tr-embed-count { left: 6px; bottom: 6px; font-size: 11px; padding: 3px 8px; }
  html.embed .tr-embed-count b { font-size: 21px; }
  html.embed .tr-embed-sub { display: inline; margin-left: 4px; }
}
