/* Live attack map (s1-attack-map.v1.js): full-screen SOC view over the admin panel. */
html.s1am-open, html.s1am-open body { overflow: hidden; }

.s1am-launch {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; margin-right: 8px;
  border: 1px solid #ff336655; border-radius: 9px; background: linear-gradient(180deg, #ff33661f, #ff33660a);
  color: #ffd1dc; font: 700 12.5px system-ui, sans-serif; cursor: pointer; white-space: nowrap;
}
.s1am-launch:hover { border-color: #ff3366; background: #ff336633; color: #fff; }
.s1am-launch i { width: 7px; height: 7px; border-radius: 50%; background: #ff3366; box-shadow: 0 0 0 0 #ff3366aa; animation: s1am-ping 1.8s infinite; }

.s1am {
  --bg: #03070d; --line: #12304a; --glass: rgba(5, 13, 24, .78); --txt: #d8ecff; --mut: #7f9bb8; --cy: #22d3ee;
  position: fixed; inset: 0; z-index: 2000; background: var(--bg); color: var(--txt);
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  display: grid; grid-template-columns: 330px 1fr 300px; grid-template-rows: auto 1fr auto; animation: s1am-in .35s ease-out;
}
.s1am::after { /* red edge flash on serious hits */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 30;
  box-shadow: inset 0 0 120px 10px rgba(255, 30, 70, var(--s1am-flash, 0)); transition: box-shadow .1s;
}

/* map */
.s1am-map { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; user-select: none; background: #050b14; }
.s1am-map:active { cursor: grabbing; }
.s1am-tiles { position: absolute; inset: 0; }
.s1am-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; will-change: transform; }
.s1am-tile img { position: absolute; inset: 0; width: 256px; height: 256px; pointer-events: none; }
.s1am-tile img:first-child { filter: brightness(.62) contrast(1.25); }
.s1am-tile img.s1am-lbl { opacity: .55; }
.s1am-tint { position: absolute; inset: 0; pointer-events: none; background: #0b3a66; mix-blend-mode: color; opacity: .75; }
.s1am-canvas { position: absolute; inset: 0; pointer-events: none; }
.s1am-fx { /* vignette, scanlines and a faint grid */
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, .72) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px),
    linear-gradient(rgba(34, 211, 238, .045) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(34, 211, 238, .045) 1px, transparent 1px) 0 0 / 64px 64px;
}

/* glass panels */
.s1am-top, .s1am-panel, .s1am-bottom, .s1am-card, .s1am-note, .s1am-err {
  position: relative; z-index: 10; background: var(--glass); backdrop-filter: blur(10px) saturate(1.3);
  border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.s1am-top {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; margin: 12px 12px 0; padding: 10px 14px; border-radius: 14px;
}
.s1am-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.s1am-title h2 { margin: 0; font-size: 16px; letter-spacing: .04em; text-transform: uppercase; color: #fff; text-shadow: 0 0 18px rgba(34, 211, 238, .45); }
.s1am-title small { color: var(--mut); font-size: 11.5px; }
.s1am-live { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; border: 1px solid #ff336677; color: #ff8fab; font: 800 10.5px system-ui; letter-spacing: .14em; }
.s1am-live i { width: 7px; height: 7px; border-radius: 50%; background: #ff3366; animation: s1am-ping 1.6s infinite; }
.s1am-live.off { border-color: #64748b; color: #94a3b8; }
.s1am-live.off i { background: #64748b; animation: none; }
.s1am-kpis { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.s1am-kpi { display: grid; min-width: 86px; padding: 5px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(2, 8, 16, .6); }
.s1am-kpi b { font: 800 18px ui-monospace, "JetBrains Mono", monospace; color: #fff; text-shadow: 0 0 12px rgba(34, 211, 238, .35); font-variant-numeric: tabular-nums; }
.s1am-kpi:first-child b { color: #ff8fab; text-shadow: 0 0 14px rgba(255, 51, 102, .5); }
.s1am-kpi span { color: var(--mut); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.s1am-clock { font: 600 14px ui-monospace, monospace; color: var(--cy); font-variant-numeric: tabular-nums; }
.s1am-x { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: rgba(2, 8, 16, .6); color: var(--txt); font-size: 15px; cursor: pointer; }
.s1am-x:hover { border-color: #ff3366; color: #fff; }

.s1am-panel { margin: 12px; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.s1am-feed { grid-column: 1; grid-row: 2; }
.s1am-side { grid-column: 3; grid-row: 2; overflow-y: auto; }
.s1am-panel h3 { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; font: 800 11px system-ui; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); }
.s1am-side h3:not(:first-child) { margin-top: 18px; }
.s1am-count { margin-left: auto; padding: 1px 7px; border-radius: 99px; background: rgba(34, 211, 238, .12); color: var(--cy); font-size: 10.5px; letter-spacing: 0; }
.s1am-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding-right: 4px; min-height: 0; }
.s1am-list::-webkit-scrollbar, .s1am-side::-webkit-scrollbar { width: 6px; }
.s1am-list::-webkit-scrollbar-thumb, .s1am-side::-webkit-scrollbar-thumb { background: #1d3b57; border-radius: 6px; }

.s1am-ev {
  display: grid; gap: 3px; width: 100%; padding: 8px 10px 8px 12px; text-align: left; cursor: pointer; color: inherit; font: inherit;
  border: 1px solid rgba(255, 255, 255, .05); border-left: 3px solid var(--c); border-radius: 9px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 12%, transparent), rgba(2, 8, 16, .5) 60%);
}
.s1am-ev:hover { border-color: color-mix(in srgb, var(--c) 45%, transparent); border-left-color: var(--c); }
.s1am-ev.new { animation: s1am-slide .45s cubic-bezier(.2, .9, .3, 1.2), s1am-glow 2.2s ease-out; }
.s1am-ev.ok { opacity: .82; }
.s1am-ev.old { opacity: .5; filter: saturate(.6); }
.s1am-ev.old:hover { opacity: .85; filter: none; }
.s1am-sep { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; color: var(--mut); font: 700 10.5px system-ui; letter-spacing: .12em; text-transform: uppercase; }
.s1am-sep::before, .s1am-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.s1am-wait { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px dashed var(--line); border-radius: 9px; color: var(--mut); font-size: 12px; }
.s1am-wait i { width: 7px; height: 7px; border-radius: 50%; background: var(--cy); animation: s1am-ping 1.6s infinite; }
.s1am-ev-h { display: flex; align-items: center; gap: 8px; }
.s1am-tag { padding: 1px 7px; border-radius: 5px; background: color-mix(in srgb, var(--c) 22%, transparent); color: color-mix(in srgb, var(--c) 70%, #fff); font: 800 10.5px system-ui; letter-spacing: .04em; text-transform: uppercase; }
.s1am-ev time { margin-left: auto; color: var(--mut); font: 11px ui-monospace, monospace; }
.s1am-ev-ip { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.s1am-ev-ip b { font: 700 12.5px ui-monospace, monospace; color: #fff; }
.s1am-ev-ip span:last-child { color: var(--mut); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s1am-flag { font-size: 14px; }
.s1am-flag.big { font-size: 28px; }
.s1am-ev-u { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: #fde68a; }
.s1am-ev-u span { padding: 0 6px; border-radius: 4px; background: rgba(250, 204, 21, .14); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.s1am-ev-d { font: 11px ui-monospace, monospace; color: #9fb6cc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.s1am-bars { display: grid; gap: 8px; }
.s1am-bar-l { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 3px; }
.s1am-bar-l b { font: 700 12px ui-monospace, monospace; color: #fff; }
.s1am-bar-t { height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.s1am-bar-t i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 55%, transparent), var(--c)); box-shadow: 0 0 10px var(--c); transition: width .6s ease; }
.s1am-rank { display: grid; gap: 4px; }
.s1am-r { display: grid; grid-template-columns: 1fr auto 34px; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 7px; background: rgba(2, 8, 16, .45); font-size: 12px; color: inherit; border: 1px solid transparent; text-align: left; font-family: inherit; }
.s1am-r b { font: 700 12px ui-monospace, monospace; color: #fff; }
.s1am-r em { font-style: normal; color: var(--mut); font-size: 11px; text-align: right; }
.s1am-r code { font: 12px ui-monospace, monospace; }
.s1am-r-ip { cursor: pointer; }
.s1am-r-ip:hover { border-color: var(--line); }
.s1am-empty { color: var(--mut); font-size: 12px; padding: 4px 2px; }

.s1am-bottom {
  grid-column: 1 / -1; grid-row: 3; display: flex; align-items: center; gap: 14px; margin: 0 12px 12px; padding: 8px 12px; border-radius: 14px; flex-wrap: wrap;
}
.s1am-togs { display: flex; gap: 6px; }
.s1am-tog { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; font-size: 12px; background: rgba(2, 8, 16, .5); }
.s1am-tog input { accent-color: var(--cy); margin: 0; }
.s1am-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; flex: 1; justify-content: center; color: var(--mut); font-size: 11.5px; }
.s1am-legend span { display: inline-flex; align-items: center; gap: 5px; }
.s1am-legend i { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.s1am-zoom { display: flex; gap: 4px; }
.s1am-zoom button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: rgba(2, 8, 16, .6); color: var(--txt); cursor: pointer; font-size: 15px; }
.s1am-zoom button:hover { border-color: var(--cy); }

.s1am-note { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); padding: 4px 12px; border-radius: 99px; font-size: 11px; color: var(--mut); white-space: nowrap; }
.s1am-err { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); padding: 8px 14px; border-radius: 10px; border-color: #ff336688; color: #ffd1dc; }
.s1am-err[hidden], .s1am-card[hidden] { display: none; }

.s1am-card { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); width: min(360px, calc(100vw - 32px)); border-radius: 14px; padding: 14px; animation: s1am-pop .25s ease-out; }
.s1am-card-x { position: absolute; top: 6px; right: 8px; background: none; border: 0; color: var(--mut); font-size: 20px; cursor: pointer; }
.s1am-card-h { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.s1am-card-h b { display: block; font: 800 15px ui-monospace, monospace; color: #fff; }
.s1am-card-h small { color: var(--mut); }
.s1am-card dl { display: grid; grid-template-columns: 80px 1fr; gap: 4px 10px; margin: 0 0 10px; font-size: 12px; }
.s1am-card dt { color: var(--mut); }
.s1am-card dd { margin: 0; overflow-wrap: anywhere; }
.s1am-card dd.mono { font: 11px ui-monospace, monospace; color: #9fb6cc; }
.s1am-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.s1am-chips span { padding: 2px 8px; border-radius: 99px; font-size: 11px; background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.s1am-card-f { display: flex; align-items: center; gap: 10px; }
.s1am-btn { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(34, 211, 238, .1); color: var(--txt); cursor: pointer; font-size: 12px; }
.s1am-btn:hover { border-color: var(--cy); }
.s1am-hint { color: var(--mut); font-size: 11px; }

@keyframes s1am-in { from { opacity: 0; transform: scale(1.015); } to { opacity: 1; transform: none; } }
@keyframes s1am-ping { 0% { box-shadow: 0 0 0 0 rgba(255, 51, 102, .7); } 70% { box-shadow: 0 0 0 8px rgba(255, 51, 102, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 51, 102, 0); } }
@keyframes s1am-slide { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes s1am-glow { 0% { box-shadow: 0 0 0 1px var(--c), 0 0 22px color-mix(in srgb, var(--c) 60%, transparent); } 100% { box-shadow: none; } }
@keyframes s1am-pop { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translateX(-50%); } }

@media (max-width: 1200px) {
  .s1am { grid-template-columns: 290px 1fr 0; }
  .s1am-side { display: none; }
}
@media (max-width: 760px) {
  .s1am { grid-template-columns: 1fr; grid-template-rows: auto 1fr 40% auto; }
  .s1am-top { flex-wrap: wrap; gap: 8px; padding: 10px 52px 10px 12px; }
  .s1am-title small, .s1am-clock, .s1am-kpi:nth-child(n+4) { display: none; }
  .s1am-title h2 { font-size: 14px; }
  .s1am-kpis { margin-left: 0; width: 100%; flex-wrap: nowrap; }
  .s1am-kpi { flex: 1; min-width: 0; padding: 4px 8px; }
  .s1am-kpi b { font-size: 16px; }
  .s1am-x { position: absolute; top: 10px; right: 10px; }
  .s1am-feed { grid-column: 1; grid-row: 3; margin: 0 12px 8px; }
  .s1am-bottom { grid-row: 4; }
  .s1am-legend, .s1am-note { display: none; }
}
@media (prefers-reduced-motion: reduce) { .s1am, .s1am-ev.new, .s1am-card { animation: none; } }
