/* WASABI // 攻性防壁 — 観測モード */
:root {
  --bg: #01080a;
  --panel: rgba(2, 16, 15, 0.74);
  --line: rgba(124, 255, 178, 0.22);
  --phosphor: #7cffb2;
  --ink: #d8ffe9;
  --soft: #a9d9c2;
  --muted: #8fbfa8;
  --dim: #6e9e8c;
  --amber: #ffb020;
  --red: #ff4d6a;
  --lv: var(--phosphor);
  --font-dot: 'DotGothic16', sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  --font-jp: 'Zen Kaku Gothic New', system-ui, sans-serif;
}
body[data-level='warn'] { --lv: var(--amber); }
body[data-level='alert'] { --lv: var(--red); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font-mono); }
a { color: var(--phosphor); }
a:hover { color: var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; }

#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.scan { position: fixed; inset: 0; pointer-events: none; z-index: 3; background: repeating-linear-gradient(0deg, rgba(124, 255, 178, 0.03) 0 1px, transparent 1px 3px); }
body.is-replay .scan { background: repeating-linear-gradient(0deg, rgba(124, 255, 178, 0.07) 0 1px, transparent 1px 3px); }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 3; box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.75); transition: box-shadow 0.6s; }
body[data-level='warn'] .vignette { box-shadow: inset 0 0 140px rgba(255, 176, 32, 0.28); }
body[data-level='alert'] .vignette { animation: alertEdge 1.4s ease-in-out infinite; }
@keyframes alertEdge { 0%, 100% { box-shadow: inset 0 0 0 3px rgba(255, 77, 106, 0.8), inset 0 0 140px rgba(255, 77, 106, 0.4); } 50% { box-shadow: inset 0 0 0 3px rgba(255, 77, 106, 0.3), inset 0 0 90px rgba(255, 77, 106, 0.15); } }

/* ラベル */
.lbl { position: absolute; left: 0; top: 0; padding: 3px 7px 3px 9px; margin: -12px 0 0 10px; white-space: nowrap; font-size: 11px; line-height: 14px; background: rgba(1, 8, 10, 0.72); border-left: 2px solid var(--c); color: var(--soft); transition: opacity 0.3s; opacity: 0; display: flex; flex-direction: column; }
.lbl b { color: var(--c); font-weight: 700; letter-spacing: 0.04em; }
.lbl span { font-size: 10px; }

/* 上のバー */
.bar { position: fixed; z-index: 5; left: 0; right: 0; top: 0; height: 60px; padding: 0 24px; display: flex; align-items: center; gap: 18px; background: linear-gradient(180deg, rgba(1, 8, 10, 0.92), rgba(1, 8, 10, 0.5)); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.logo-main { font-family: var(--font-dot); font-size: 26px; letter-spacing: 0.12em; color: var(--phosphor); text-shadow: 0 0 12px rgba(124, 255, 178, 0.5); }
.logo-sub { font-size: 13px; color: var(--soft); }
.views, .modes { display: flex; gap: 6px; }
.views { margin-left: auto; }
.views button, .modes button { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid rgba(124, 255, 178, 0.3); background: transparent; color: var(--soft); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.views button b { font-family: var(--font-dot); color: var(--phosphor); }
.views button[aria-pressed='true'], .modes button[aria-pressed='true'] { border-color: var(--phosphor); background: rgba(124, 255, 178, 0.14); color: var(--ink); }
.views button:hover, .modes button:hover { border-color: var(--phosphor); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1.2s steps(2, start) infinite; }
body.is-replay .dot { background: var(--dim); animation: none; }
@keyframes blink { to { visibility: hidden; } }
.status { display: flex; align-items: center; gap: 14px; font-size: 12px; }
.lvl-label { color: var(--soft); }
.level { height: 30px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 4px; border: 1px solid var(--lv); background: color-mix(in srgb, var(--lv) 14%, transparent); color: var(--lv); }
.level b { font-family: var(--font-dot); font-size: 15px; font-weight: 400; }
.level span { font-size: 11px; }
.clock { color: var(--ink); min-width: 8.5em; }
.ops { height: 36px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border-radius: 18px; border: 1px solid rgba(255, 176, 32, 0.5); color: #ffe2a8; text-decoration: none; }
.ops svg { fill: none; stroke: currentColor; stroke-width: 1.4; }
.ops:hover { background: rgba(255, 176, 32, 0.12); color: #fff3d6; }

/* パネル */
.panel { position: fixed; z-index: 4; top: 76px; width: 300px; max-height: calc(100vh - 76px - 132px); overflow: hidden; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; backdrop-filter: blur(3px); }
.feed-panel { left: 24px; }
.stats-panel { right: 24px; overflow-y: auto; }
.panel-head, .tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
h2 { margin: 0; font-family: var(--font-dot); font-size: 15px; font-weight: 400; color: var(--phosphor); }
h3 { margin: 14px 0 6px; font-family: var(--font-dot); font-size: 13px; font-weight: 400; color: var(--phosphor); }
.sub { font-size: 10px; color: var(--dim); }
.feed { list-style: none; margin: 10px 0 0; padding: 0; }
.feed li { padding: 7px 0 8px; border-top: 1px solid rgba(124, 255, 178, 0.1); display: flex; flex-direction: column; gap: 3px; animation: feedIn 0.4s ease-out; }
.feed li.is-replay { opacity: 0.78; }
@keyframes feedIn { from { transform: translateX(-8px); } }
.f-top { display: flex; gap: 8px; font-size: 10px; color: var(--muted); align-items: center; }
.f-top b { color: var(--ink); font-weight: 400; }
.f-mid { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.f-cat { font-family: var(--font-jp); font-weight: 700; color: var(--c); white-space: nowrap; }
.f-sig { color: var(--ink); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-bot { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.f-blk { color: var(--phosphor); }
.chip { font-style: normal; font-size: 9px; padding: 0 5px; border: 1px solid var(--dim); border-radius: 3px; color: var(--dim); }
.chip.new { border-color: var(--amber); color: var(--amber); animation: blink 0.8s steps(2, start) 4; }

.big { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.big b { font-size: 42px; line-height: 1; }
.big span { font-size: 12px; color: var(--soft); }
.line { margin: 8px 0 12px; font-size: 12px; color: var(--soft); }
.amber { color: var(--amber); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.cbar-head { display: flex; justify-content: space-between; font-size: 12px; }
.cbar-head span { font-family: var(--font-jp); font-weight: 500; color: var(--c); }
.cbar-track { height: 6px; margin-top: 3px; background: rgba(124, 255, 178, 0.08); border-radius: 3px; position: relative; overflow: hidden; }
.cbar-track::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--c); border-radius: 3px; box-shadow: 0 0 8px var(--c); }
.cc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: 12px; }
.cc li { display: flex; justify-content: space-between; border-bottom: 1px solid rgba(124, 255, 178, 0.08); }
.tiles { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(124, 255, 178, 0.14); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiles div { display: flex; flex-direction: column; gap: 2px; }
.tiles span { font-size: 10px; color: var(--muted); }
.tiles b { font-size: 20px; }
.tiles b.lv { color: var(--lv); }
.demo { margin: 12px 0 0; font-family: var(--font-jp); font-size: 12px; color: var(--amber); }

/* 時間軸 */
.timeline { position: fixed; z-index: 4; left: 24px; right: 24px; bottom: 16px; height: 104px; padding: 10px 16px; background: rgba(2, 16, 15, 0.8); border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; gap: 4px; }
.tl-bars { flex: 1; display: flex; align-items: flex-end; gap: 5px; }
.tl-bar { flex: 1; height: 100%; position: relative; display: flex; flex-direction: column; justify-content: flex-end; }
.tl-bar::before { content: ''; display: block; height: calc(var(--h) * 0.62); background: rgba(124, 255, 178, 0.55); border-radius: 2px 2px 0 0; box-shadow: 0 0 6px rgba(124, 255, 178, 0.4); }
.tl-bar.hot::before { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.tl-bar.now::before { background: var(--lv); box-shadow: 0 0 10px var(--lv); }
.tl-v { position: absolute; bottom: calc(var(--h) * 0.62 + 16px); width: 100%; text-align: center; font-size: 9px; color: var(--muted); }
.tl-l { height: 14px; font-size: 9px; color: var(--dim); text-align: center; }

.ticker { display: none; }
.toast { position: fixed; z-index: 9; left: 50%; top: 72px; transform: translate(-50%, -10px); padding: 8px 14px; border-radius: 6px; background: rgba(2, 16, 15, 0.92); border: 1px solid var(--line); font-family: var(--font-jp); font-size: 13px; opacity: 0; pointer-events: none; transition: 0.3s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { position: fixed; inset: 40% 0 auto; text-align: center; font-family: var(--font-jp); }

/* 中くらいの画面: パネルを細く */
@media (max-width: 1180px) {
  .panel { width: 250px; }
  .lvl-label { display: none; }
}

/* スマホ: 3D を全面に、下にシート */
@media (max-width: 760px) {
  .bar { height: auto; padding: 10px 14px 8px; flex-wrap: wrap; gap: 8px 10px; }
  .logo-main { font-size: 20px; }
  .logo-sub { font-size: 11px; }
  .status { margin-left: auto; gap: 8px; }
  .clock, .lvl-label { display: none; }
  .ops { height: 32px; padding: 0 10px; font-size: 11px; }
  .views { order: 3; margin-left: 0; width: 100%; }
  .views button { flex: 1; justify-content: center; height: 40px; }
  .modes { order: 4; width: 100%; }
  .modes button { flex: 1; justify-content: center; height: 34px; }
  .feed-panel, .stats-panel { display: none; }
  .timeline { left: 0; right: 0; bottom: 0; height: auto; border-radius: 16px 16px 0 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 8px; }
  .tl-head .sub { display: none; }
  .tl-bars { height: 52px; flex: none; gap: 3px; }
  .tl-v { display: none; }
  .ticker { display: flex; position: fixed; z-index: 4; left: 12px; right: 12px; bottom: calc(118px + env(safe-area-inset-bottom)); padding: 10px 12px; gap: 8px; flex-wrap: wrap; align-items: baseline; border-radius: 10px; background: rgba(2, 16, 15, 0.86); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--phosphor)); font-size: 12px; }
  .ticker b { font-family: var(--font-jp); color: var(--c); font-size: 15px; }
  .tk-time, .tk-dst { color: var(--muted); font-size: 10px; }
  .lbl { font-size: 10px; }
}
