/* =====================================================================
   AGENT WAR ROOM — Holographic Multi-Agent Orchestration · Stylesheet
   ===================================================================== */
:root {
  --cyan: #46f0ff;
  --cyan-soft: #b8fbff;
  --teal: #1be3c8;
  --violet: #9a6bff;
  --amber: #ffb347;
  --pink: #ff6fae;
  --lime: #8effa6;
  --good: #4dffa6;
  --warn: #ffcf5a;
  --glass: rgba(8, 26, 46, 0.46);
  --glass-line: rgba(96, 224, 255, 0.32);
  --glow: 0 0 14px rgba(70, 240, 255, 0.55);
  --font-display: 'Orbitron', system-ui, sans-serif;
  --font-mono: 'Share Tech Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; height: 100%; width: 100%; overflow: hidden;
  background: radial-gradient(ellipse at 50% 32%, #0a1830 0%, #050b18 55%, #01040a 100%);
  color: var(--cyan-soft);
  font-family: var(--font-mono);
  -webkit-user-select: none; user-select: none;
}

#bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(70,240,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70,240,255,0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse at 50% 42%, #000 28%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 28%, transparent 76%);
}

#screen-fx { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.scanlines {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom,
    rgba(70,240,255,0.04) 0px, rgba(70,240,255,0.04) 1px, transparent 2px, transparent 3px);
  mix-blend-mode: screen; opacity: 0.5;
}
.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 50%, rgba(0,0,0,0.66) 100%);
}

.panel {
  position: fixed; z-index: 10;
  background: linear-gradient(160deg, var(--glass), rgba(4,16,28,0.55));
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  box-shadow: var(--glow), inset 0 0 22px rgba(70,240,255,0.07);
  border-radius: 12px;
}

/* ---------- Top bar ---------- */
#topbar { top: 14px; left: 14px; right: 14px; height: 56px; display: flex; align-items: center; gap: 22px; padding: 0 20px; }
.title {
  font-family: var(--font-display); font-weight: 900; letter-spacing: 3px;
  font-size: 17px; color: #eafdff; text-shadow: var(--glow);
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
}
.title .glyph { font-size: 18px; color: var(--cyan); }
.title .sub { font-family: var(--font-mono); font-weight: 400; font-size: 11px; letter-spacing: 2px; color: var(--violet); opacity: 0.8; }
.status { flex: 1; font-size: 12px; letter-spacing: 1.4px; color: var(--cyan); opacity: 0.85; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.author { font-size: 11px; letter-spacing: 2px; color: var(--teal); opacity: 0.8; white-space: nowrap; }

.block-h {
  font-family: var(--font-display); font-size: 11px; letter-spacing: 2.4px;
  color: var(--teal); margin-bottom: 9px;
  border-bottom: 1px solid rgba(70,240,255,0.18); padding-bottom: 5px;
  display: flex; align-items: center; justify-content: space-between;
}
.block-h small { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--cyan); opacity: 0.7; }
.block-h.gap-top { margin-top: 14px; }

/* ---------- Left mission panel ---------- */
#mission-panel { top: 84px; left: 14px; width: 280px; bottom: 14px; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; }
#goal-input {
  width: 100%; resize: vertical; min-height: 64px; padding: 11px;
  border-radius: 9px; border: 1px solid var(--glass-line); background: rgba(3,12,22,0.7);
  color: #eafdff; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; outline: none;
}
#goal-input:focus { border-color: var(--cyan); box-shadow: 0 0 14px rgba(70,240,255,0.22); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.preset {
  font-size: 10.5px; letter-spacing: 0.4px; padding: 5px 9px; border-radius: 13px;
  border: 1px solid rgba(70,240,255,0.26); background: rgba(70,240,255,0.06);
  color: var(--cyan-soft); cursor: pointer; transition: 0.15s;
}
.preset:hover { background: rgba(70,240,255,0.15); border-color: var(--cyan); }

.mode-row { display: flex; gap: 6px; }
.mode-btn {
  flex: 1; padding: 8px; border-radius: 7px; border: 1px solid transparent;
  background: rgba(70,240,255,0.05); color: var(--cyan-soft);
  font-family: var(--font-display); font-size: 10.5px; letter-spacing: 1.4px; cursor: pointer; transition: 0.15s;
}
.mode-btn:hover { background: rgba(70,240,255,0.1); }
.mode-btn.active { border-color: var(--cyan); background: rgba(70,240,255,0.14); color: #eafdff; }

.roster { display: flex; flex-direction: column; gap: 6px; }
.roster-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid rgba(70,240,255,0.16); background: rgba(70,240,255,0.04); cursor: pointer; transition: 0.15s;
}
.roster-row:hover { background: rgba(70,240,255,0.09); }
.roster-row.off { opacity: 0.36; }
.roster-dot { width: 11px; height: 11px; border-radius: 3px; box-shadow: 0 0 8px currentColor; flex: none; }
.roster-name { font-size: 12px; color: #eafdff; flex: 1; letter-spacing: 0.5px; }
.roster-role { font-size: 10px; opacity: 0.6; }

.dispatch-btn {
  margin-top: 14px; padding: 12px; border-radius: 10px; border: 1px solid var(--cyan);
  background: linear-gradient(120deg, rgba(70,240,255,0.18), rgba(154,107,255,0.18));
  color: #eafdff; font-family: var(--font-display); font-size: 13px; letter-spacing: 2px; cursor: pointer; transition: 0.15s;
}
.dispatch-btn:hover { box-shadow: var(--glow); }
.dispatch-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Center stage ---------- */
#stage { position: fixed; top: 84px; left: 310px; right: 374px; bottom: 14px; z-index: 6; }
#wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.link { fill: none; stroke: rgba(70,240,255,0.22); stroke-width: 2; stroke-dasharray: 5 7; }
.link.hot { stroke: var(--cyan); stroke-width: 2.5; opacity: 1; filter: drop-shadow(0 0 6px var(--cyan)); animation: dash 0.5s linear infinite; }
.link.done { stroke: rgba(77,255,166,0.5); stroke-dasharray: none; }
@keyframes dash { to { stroke-dashoffset: -24; } }

.agent {
  position: absolute; z-index: 2; width: 132px; text-align: center;
  transform: translate(-50%, -50%); transition: filter 0.2s;
}
.agent-core {
  width: 74px; height: 74px; margin: 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; position: relative;
  border: 1px solid var(--glass-line);
  background: radial-gradient(circle at 50% 40%, rgba(70,240,255,0.16), rgba(4,16,28,0.66));
  box-shadow: var(--glow), inset 0 0 16px rgba(70,240,255,0.1);
}
.agent-glyph { font-size: 26px; color: var(--cyan); text-shadow: var(--glow); }
.planner .agent-core { width: 92px; height: 92px; border-color: rgba(154,107,255,0.5); box-shadow: 0 0 22px rgba(154,107,255,0.5), inset 0 0 18px rgba(154,107,255,0.12); }
.planner .agent-glyph { font-size: 34px; color: #eafdff; }
.agent-ring {
  position: absolute; left: 50%; top: 37px; width: 96px; height: 96px;
  transform: translate(-50%,-50%); border-radius: 50%; border: 1px solid rgba(70,240,255,0.22);
}
.planner .agent-ring { top: 46px; width: 120px; height: 120px; border-color: rgba(154,107,255,0.3); }
.agent.working .agent-ring { animation: spin 2.4s linear infinite, ringpulse 1.6s ease-in-out infinite; border-style: dashed; }
@keyframes spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes ringpulse { 50% { border-color: var(--cyan); } }
.agent.live .agent-core { animation: bump 0.4s ease; }
@keyframes bump { 50% { transform: scale(1.12); } }

.agent-name { font-family: var(--font-display); font-size: 11px; letter-spacing: 1.3px; color: #eafdff; margin-top: 9px; }
.agent-role { font-size: 9.5px; opacity: 0.6; margin-top: 2px; letter-spacing: 0.4px; }
.agent-state {
  display: inline-block; margin-top: 6px; font-size: 9px; letter-spacing: 1px;
  padding: 2px 8px; border-radius: 6px; border: 1px solid var(--glass-line);
  color: var(--cyan); background: rgba(70,240,255,0.07);
}
.agent-state.working { color: var(--warn); border-color: rgba(255,207,90,0.4); box-shadow: 0 0 10px rgba(255,207,90,0.25); }
.agent-state.done { color: var(--good); border-color: rgba(77,255,166,0.4); box-shadow: 0 0 10px rgba(77,255,166,0.25); }

/* agent-specific accent dots */
.dot-research { color: var(--cyan); background: var(--cyan); }
.dot-analyst  { color: var(--lime); background: var(--lime); }
.dot-writer   { color: var(--amber); background: var(--amber); }
.dot-reviewer { color: var(--pink); background: var(--pink); }
.dot-design   { color: var(--violet); background: var(--violet); }

/* task token traveling along links */
.token {
  position: absolute; z-index: 3; padding: 2px 7px; border-radius: 9px; font-size: 9px; letter-spacing: 0.4px;
  background: rgba(4,16,28,0.92); border: 1px solid var(--cyan); color: var(--cyan-soft);
  box-shadow: 0 0 12px rgba(70,240,255,0.5); transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap;
}
.token.ret { border-color: var(--good); color: var(--lime); box-shadow: 0 0 12px rgba(77,255,166,0.5); }

/* synthesis card */
.synth { position: absolute; left: 8px; right: 8px; bottom: 6px; z-index: 4; padding: 12px 16px; max-height: 30%; overflow-y: auto; }
.synth-h { font-family: var(--font-display); font-size: 10px; letter-spacing: 2px; color: var(--teal); margin-bottom: 7px; }
.synth-body { font-size: 12px; line-height: 1.6; color: #eafdff; }
.synth-body .si { display: block; margin: 3px 0; opacity: 0; animation: fadein 0.4s forwards; }
.synth-body .si b { color: var(--cyan); }

/* ---------- Right log panel ---------- */
#log-panel { top: 84px; right: 14px; width: 346px; bottom: 14px; padding: 14px 16px; display: flex; flex-direction: column; }
.log { flex: 1; overflow-y: auto; font-size: 12px; line-height: 1.6; }
.log-line { margin-bottom: 4px; opacity: 0; animation: fadein 0.3s forwards; word-break: break-word; }
@keyframes fadein { to { opacity: 1; } }
.log-line .t { color: var(--teal); margin-right: 7px; }
.log-line.plan { color: var(--violet); }
.log-line.dispatch { color: var(--cyan); }
.log-line.work { color: var(--cyan-soft); opacity: 0.85; font-style: italic; }
.log-line.done { color: var(--good); }
.log-line.synth { color: #eafdff; border-left: 2px solid var(--violet); padding-left: 9px; margin: 7px 0; }
.log-line .mono { color: var(--amber); }

/* ---------- Hint ---------- */
.hint {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 9;
  font-size: 11px; letter-spacing: 1.4px; color: var(--cyan); opacity: 0.55;
  background: rgba(3,12,22,0.5); padding: 7px 15px; border-radius: 8px;
  border: 1px solid rgba(70,240,255,0.14); white-space: nowrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  #stage { left: 14px; right: 14px; top: 330px; bottom: 188px; }
  #mission-panel { top: 84px; left: 14px; right: 14px; width: auto; bottom: auto; height: 234px; }
  #log-panel { top: auto; bottom: 14px; left: 14px; right: 14px; width: auto; height: 164px; }
  .hint { display: none; }
  .synth { display: none; }
}
@media (max-width: 720px) {
  .status { display: none; }
  .author { display: none; }
  .title { font-size: 13px; letter-spacing: 1.5px; }
  .agent { width: 100px; }
  .agent-core { width: 56px; height: 56px; }
  .planner .agent-core { width: 70px; height: 70px; }
}
