/* =========================================================================
 * SYNAPTICA — neon / glass HUD
 * ========================================================================= */
:root {
  --bg: #03040a;
  --panel: rgba(10, 14, 26, 0.55);
  --panel-brd: rgba(120, 160, 255, 0.18);
  --txt: #e8eeff;
  --muted: #8fa0c8;
  --accent: #5fb0ff;
  --accent2: #46f0a0;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  background: var(--bg); color: var(--txt);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  overflow: hidden; -webkit-font-smoothing: antialiased;
}
/* framing vignette over the canvas (sits above stage, below panels) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 45%, transparent 55%, rgba(0,0,0,0.55) 100%);
}
#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: grab; touch-action: none; z-index: 0; }

/* ---- shared panel glass ---- */
.panel {
  position: fixed; z-index: 5;
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  border-radius: 14px;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 8px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* ---- top HUD ---- */
#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 18px 22px; pointer-events: none; gap: 16px; flex-wrap: wrap;
}
.brand .logo {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 800; font-size: 26px; letter-spacing: 3px;
  background: linear-gradient(90deg, #5fb0ff, #46f0a0, #b98cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 24px rgba(95,176,255,0.25);
  animation: brandPulse 4s ease-in-out infinite;
}
@keyframes brandPulse {
  0%, 100% { text-shadow: 0 0 18px rgba(95,176,255,0.20); }
  50% { text-shadow: 0 0 34px rgba(70,240,160,0.40); }
}
.brand .tag { color: var(--muted); font-size: 12px; letter-spacing: 1px; margin-top: 2px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  background: var(--panel); border: 1px solid var(--panel-brd); border-radius: 12px;
  padding: 8px 12px; min-width: 92px; backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.stat .k { display: block; font-size: 10px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.stat .v { display: block; font-size: 16px; font-weight: 700; font-family: "Space Grotesk", sans-serif; }
.stat .v.live { color: var(--accent2); text-shadow: 0 0 12px rgba(70,240,160,0.5); }

/* ---- legend ---- */
#legend { top: 92px; right: 18px; padding: 12px 14px; font-size: 12px; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; color: #cdd8f5; }
.legend-row .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }

/* ---- dock / controls ---- */
#dock { left: 18px; bottom: 18px; padding: 14px; width: 320px; max-width: calc(100vw - 36px); }
.modes { display: flex; gap: 6px; margin-bottom: 12px; }
.modes button {
  flex: 1; padding: 9px 4px; font-size: 12px; font-weight: 600;
  color: var(--muted); background: rgba(255,255,255,0.04);
  border: 1px solid transparent; border-radius: 9px; cursor: pointer;
  transition: all .15s ease; font-family: inherit;
}
.modes button:hover { color: var(--txt); background: rgba(255,255,255,0.08); }
.modes button.active {
  color: #03040a; background: linear-gradient(90deg, #5fb0ff, #46f0a0);
  box-shadow: 0 0 18px rgba(95,176,255,0.45);
}
.ctx .hint { font-size: 12.5px; line-height: 1.5; color: #c4d0ee; margin: 0 0 10px; }
.ctx .hint b { color: #fff; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow button {
  flex: 1; min-width: 90px; padding: 10px 8px; font-size: 13px; font-weight: 600;
  border-radius: 10px; cursor: pointer; font-family: inherit; transition: all .15s ease;
}
.btnrow .act {
  color: #03040a; border: none;
  background: linear-gradient(90deg, #5fb0ff, #46f0a0);
  box-shadow: 0 0 16px rgba(70,240,160,0.35);
}
.btnrow .act:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btnrow .ghost { color: var(--muted); background: rgba(255,255,255,0.05); border: 1px solid var(--panel-brd); }
.btnrow .ghost:hover { color: var(--txt); }

.mem { margin-top: 12px; }
.mem-top { display: flex; justify-content: space-between; font-size: 12px; color: #c4d0ee; margin-bottom: 6px; }
.mem-top span:last-child { color: var(--accent2); font-weight: 700; font-family: "Space Grotesk", sans-serif; }
.mem-track { height: 8px; border-radius: 6px; background: rgba(255,255,255,0.07); overflow: hidden; }
.mem-fill { height: 100%; width: 0%; border-radius: 6px;
  background: linear-gradient(90deg, #46f0a0, #5fb0ff);
  box-shadow: 0 0 12px rgba(70,240,160,0.6); transition: width .4s ease; }
.mem-sub { font-size: 11px; color: var(--muted); margin-top: 6px; }
.mem-sub b { color: #fff; }

/* ---- region info ---- */
#info { right: 18px; bottom: 18px; width: 290px; max-width: calc(100vw - 36px); padding: 14px; }
.info-name { font-family: "Space Grotesk", sans-serif; font-weight: 800; font-size: 16px; }
.info-kind { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin: 2px 0 8px; }
.info-desc { font-size: 12.5px; line-height: 1.5; color: #c4d0ee; }
#info:empty { display: none; }

/* ---- toast ---- */
#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(10px);
  z-index: 8; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: rgba(10,14,26,0.85); border: 1px solid var(--panel-brd); color: #eaf2ff;
  backdrop-filter: blur(10px); opacity: 0; pointer-events: none; transition: all .25s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- footer ---- */
#foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 4;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 6px 20px; font-size: 11px; color: var(--muted);
  background: linear-gradient(0deg, rgba(3,4,10,0.7), transparent); pointer-events: none;
}
#foot b { color: #cdd8f5; } #foot i { color: var(--accent); font-style: normal; }
#foot .src { opacity: 0.7; }

/* ---- responsive / mobile (reel-friendly, vertical) ---- */
@media (max-width: 720px) {
  .brand .logo { font-size: 20px; }
  .stats { gap: 6px; }
  .stat { min-width: 72px; padding: 6px 8px; }
  .stat .v { font-size: 13px; }
  #legend { top: auto; bottom: 230px; right: 12px; padding: 8px 10px; font-size: 10.5px; }
  #legend .legend-row { padding: 2px 0; }
  #dock { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 12px; }
  #info { display: none; }
  #foot { font-size: 9.5px; padding: 4px 12px; }
}
@media (max-width: 420px) {
  .stat:nth-child(3), .stat:nth-child(4) { display: none; }
}
