:root {
  --ink: #e6ecf5;
  --muted: #9aa8bc;
  --bat-gold: #f2c84b;
  --bat-gold-soft: rgba(242, 200, 75, 0.28);
  --bat-blue: #7dc0ff;
  --bat-blue-soft: rgba(125, 192, 255, 0.24);
  --warn: #ffd36b;
  --good: #43d5a2;
  --critical: #ff7a72;
  --panel: rgba(6, 13, 25, 0.84);
  --panel-border: rgba(121, 158, 204, 0.26);
  --shadow: 0 18px 56px rgba(0, 0, 0, 0.56);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: "Rajdhani", sans-serif;
  background:
    radial-gradient(ellipse at 50% -12%, rgba(120, 140, 168, 0.26), transparent 45%),
    radial-gradient(circle at 18% 28%, rgba(56, 82, 114, 0.23), transparent 34%),
    radial-gradient(circle at 84% 22%, rgba(48, 74, 103, 0.2), transparent 32%),
    linear-gradient(180deg, #01040a 0, #050b15 32%, #03070f 100%);
  overflow-x: hidden;
}

.cave-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.cave-vault {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% -8%, rgba(108, 132, 160, 0.32), transparent 46%),
    radial-gradient(ellipse at 10% 40%, rgba(74, 99, 131, 0.2), transparent 42%),
    radial-gradient(ellipse at 90% 38%, rgba(70, 96, 128, 0.2), transparent 40%),
    linear-gradient(180deg, rgba(6, 11, 19, 0.95), rgba(1, 3, 8, 0.98));
}

.cave-mouth-light {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(820px, 78vw);
  height: 48vh;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(169, 199, 232, 0.22), rgba(116, 151, 191, 0.08) 42%, transparent 72%);
  filter: blur(2px);
}

.cave-rock-texture {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(132deg, rgba(176, 197, 223, 0.02) 0 2px, transparent 2px 52px),
    repeating-linear-gradient(28deg, rgba(176, 197, 223, 0.015) 0 1px, transparent 1px 44px);
  opacity: 0.55;
}

.command-floor {
  position: relative;
  z-index: 1;
  max-width: none;
  margin: 0;
  padding: 18px;
  min-height: 100vh;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.command-floor::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 12% 20%, rgba(81, 120, 166, 0.12), transparent 34%),
    radial-gradient(ellipse at 88% 24%, rgba(81, 120, 166, 0.1), transparent 32%),
    repeating-linear-gradient(155deg, rgba(192, 211, 236, 0.018) 0 1px, transparent 1px 70px);
  pointer-events: none;
}

.command-floor > :not(.cave-section) {
  position: relative;
  z-index: 3;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(120, 157, 203, 0.3);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, rgba(142, 174, 214, 0.15), transparent 48%),
    linear-gradient(130deg, rgba(10, 21, 35, 0.95), rgba(4, 11, 20, 0.96));
}

.topbar,
.action-dock,
.kpi-row,
.floor-zones,
.footer-row {
  max-width: calc(100% - 350px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--bat-gold);
  font: 700 0.74rem/1 "IBM Plex Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.55rem, 1.8vw, 2.2rem);
  letter-spacing: 0.02em;
}

.objective {
  margin: 8px 0 0;
  max-width: 56ch;
  font-size: 0.95rem;
  color: #b1c0d5;
}

.meta {
  display: grid;
  gap: 8px;
}

.meta p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed rgba(130, 168, 214, 0.2);
  font: 600 0.85rem/1.25 "Rajdhani", sans-serif;
  padding-bottom: 6px;
}

.meta span {
  color: #89a0bd;
}

.meta strong {
  text-align: right;
}

.status-pill {
  margin-top: 6px;
  border-radius: 999px;
  border: 1px solid var(--bat-blue);
  color: #d8ecff;
  background: rgba(66, 131, 195, 0.2);
  padding: 7px 12px;
  width: fit-content;
  font: 700 0.78rem/1 "IBM Plex Mono", monospace;
}

.status-pill.bad {
  border-color: rgba(255, 122, 114, 0.9);
  background: rgba(125, 42, 37, 0.46);
  color: #ffe2df;
}

.action-dock {
  margin-top: 14px;
  padding: 12px;
  background:
    radial-gradient(circle at 50% 0, rgba(103, 150, 205, 0.12), transparent 56%),
    linear-gradient(155deg, rgba(9, 18, 32, 0.94), rgba(4, 10, 19, 0.96));
}

.action-controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(200px, auto);
  gap: 10px;
  align-items: end;
}

.action-control {
  display: grid;
  gap: 6px;
}

.action-control span {
  color: #9bb1ce;
  font: 700 0.66rem/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.action-control select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(123, 161, 209, 0.36);
  background: rgba(7, 15, 27, 0.92);
  color: #d8e7fa;
  padding: 8px 9px;
  font: 600 0.83rem/1.2 "Rajdhani", sans-serif;
}

.action-control select:focus-visible {
  outline: 1px solid rgba(242, 200, 75, 0.72);
  border-color: rgba(242, 200, 75, 0.72);
}

.action-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.action-buttons button {
  border-radius: 8px;
  border: 1px solid rgba(130, 172, 224, 0.44);
  background:
    linear-gradient(155deg, rgba(14, 34, 58, 0.78), rgba(7, 18, 31, 0.94));
  color: #e2eefc;
  padding: 8px 10px;
  font: 700 0.72rem/1 "IBM Plex Mono", monospace;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.action-buttons button:hover,
.action-buttons button:focus-visible {
  border-color: rgba(242, 200, 75, 0.72);
  transform: translateY(-1px);
}

.kpi-row {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(162px, 1fr));
  gap: 10px;
}

.kpi {
  border: 1px solid rgba(116, 154, 200, 0.28);
  border-radius: 12px;
  padding: 12px;
  background:
    radial-gradient(circle at 50% 0, rgba(111, 150, 195, 0.14), transparent 58%),
    linear-gradient(145deg, rgba(10, 21, 36, 0.94), rgba(5, 12, 22, 0.97));
}

.kpi-button {
  all: unset;
  box-sizing: border-box;
  border: 1px solid rgba(116, 154, 200, 0.28);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 0, rgba(111, 150, 195, 0.14), transparent 58%),
    linear-gradient(145deg, rgba(10, 21, 36, 0.94), rgba(5, 12, 22, 0.97));
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.kpi-button:hover,
.kpi-button:focus-visible {
  border-color: rgba(242, 200, 75, 0.66);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.kpi-label {
  margin: 0;
  color: #8ea5c3;
  font: 700 0.73rem/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-value {
  margin: 8px 0 0;
  font-family: "Orbitron", sans-serif;
  font-size: 1.5rem;
}

.zone {
  border: 1px solid rgba(117, 154, 201, 0.28);
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 50% 0, rgba(92, 130, 176, 0.1), transparent 58%),
    linear-gradient(150deg, rgba(8, 17, 31, 0.94), rgba(4, 10, 18, 0.96));
  padding: 14px;
}

.zone-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.zone-header h2 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 1.03rem;
}

.zone-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.cave-section {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.cave-section .zone-header {
  display: none;
}

.cave-layout {
  margin-top: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 0;
}

.cave-stage {
  position: relative;
  min-height: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 102%, rgba(12, 30, 52, 0.86), rgba(5, 12, 22, 0.95) 45%, rgba(2, 6, 12, 0.98) 72%, rgba(1, 3, 8, 1) 100%),
    linear-gradient(180deg, rgba(22, 33, 48, 0.44), rgba(4, 9, 17, 0.98));
}

.cave-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 10%, rgba(132, 172, 224, 0.14), transparent 34%),
    radial-gradient(circle at 84% 12%, rgba(242, 200, 75, 0.1), transparent 28%),
    radial-gradient(circle at 50% 58%, rgba(67, 105, 151, 0.14), transparent 45%),
    repeating-linear-gradient(
      160deg,
      rgba(188, 208, 239, 0.03) 0 1px,
      transparent 1px 60px
    );
  z-index: 0;
  pointer-events: none;
}

.cave-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0 58%, rgba(2, 6, 12, 0.62) 100%);
  z-index: 0;
  pointer-events: none;
}

.cave-depth {
  position: absolute;
  inset: 8% 9% 13%;
  border-radius: 50% / 45%;
  border: 1px solid rgba(103, 149, 205, 0.25);
  background:
    radial-gradient(ellipse at 50% 36%, rgba(126, 175, 234, 0.18), rgba(31, 65, 102, 0.16) 40%, rgba(8, 18, 33, 0.18) 72%, transparent 100%),
    radial-gradient(ellipse at 42% 74%, rgba(10, 24, 43, 0.52), transparent 66%);
  box-shadow:
    inset 0 0 0 30px rgba(41, 84, 134, 0.08),
    inset 0 0 0 64px rgba(22, 49, 80, 0.06),
    0 28px 60px rgba(0, 0, 0, 0.44);
  animation: caveBreathe 12s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}

.cave-ceiling {
  position: absolute;
  inset: 0 0 auto 0;
  height: 32%;
  background:
    radial-gradient(ellipse at 8% -12%, rgba(71, 87, 110, 0.5), transparent 42%),
    radial-gradient(ellipse at 50% -8%, rgba(70, 86, 108, 0.44), transparent 48%),
    radial-gradient(ellipse at 88% -14%, rgba(62, 80, 106, 0.5), transparent 42%),
    linear-gradient(180deg, rgba(22, 33, 48, 0.88), rgba(7, 14, 24, 0));
  pointer-events: none;
  z-index: 2;
}

.stalactite {
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 0;
  border-bottom: 84px solid rgba(64, 85, 108, 0.8);
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.42));
  opacity: 0.9;
}

.stalactite.s1 {
  left: 4%;
  border-left-width: 22px;
  border-right-width: 22px;
  border-bottom-width: 110px;
}

.stalactite.s2 {
  left: 15%;
  border-left-width: 13px;
  border-right-width: 13px;
  border-bottom-width: 76px;
}

.stalactite.s3 {
  left: 27%;
  border-left-width: 20px;
  border-right-width: 20px;
  border-bottom-width: 98px;
}

.stalactite.s4 {
  left: 42%;
  border-left-width: 14px;
  border-right-width: 14px;
  border-bottom-width: 86px;
}

.stalactite.s5 {
  left: 56%;
  border-left-width: 23px;
  border-right-width: 23px;
  border-bottom-width: 112px;
}

.stalactite.s6 {
  left: 68%;
  border-left-width: 15px;
  border-right-width: 15px;
  border-bottom-width: 80px;
}

.stalactite.s7 {
  left: 81%;
  border-left-width: 21px;
  border-right-width: 21px;
  border-bottom-width: 100px;
}

.stalactite.s8 {
  left: 92%;
  border-left-width: 12px;
  border-right-width: 12px;
  border-bottom-width: 70px;
}

.cave-wall {
  position: absolute;
  top: 16%;
  bottom: 0;
  width: 14%;
  background:
    radial-gradient(circle at 50% 20%, rgba(96, 127, 164, 0.22), transparent 48%),
    linear-gradient(180deg, rgba(22, 36, 55, 0.8), rgba(6, 12, 22, 0.92));
  pointer-events: none;
  z-index: 2;
}

.cave-wall.left {
  left: 0;
  clip-path: polygon(0 0, 100% 10%, 70% 100%, 0 100%);
}

.cave-wall.right {
  right: 0;
  clip-path: polygon(30% 8%, 100% 0, 100% 100%, 0 100%);
}

.bat-swarm {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.bat {
  position: absolute;
  width: 28px;
  height: 12px;
  background: rgba(13, 24, 36, 0.72);
  clip-path: polygon(0 52%, 12% 30%, 25% 52%, 39% 24%, 50% 52%, 61% 24%, 75% 52%, 88% 30%, 100% 52%, 85% 62%, 73% 56%, 61% 78%, 50% 58%, 39% 78%, 27% 56%, 15% 62%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
  animation: batHover var(--bdur, 6s) ease-in-out infinite;
  animation-delay: var(--bdelay, 0s);
  opacity: 0.8;
}

.bat.b1 {
  top: 16%;
  left: 17%;
  --bdur: 7s;
}

.bat.b2 {
  top: 14%;
  left: 33%;
  --bdur: 5.8s;
  --bdelay: -1.2s;
}

.bat.b3 {
  top: 18%;
  left: 49%;
  --bdur: 7.6s;
  --bdelay: -0.8s;
}

.bat.b4 {
  top: 13%;
  left: 68%;
  --bdur: 6.2s;
  --bdelay: -1.6s;
}

.bat.b5 {
  top: 17%;
  left: 83%;
  --bdur: 6.8s;
  --bdelay: -0.5s;
}

.bat-signal-beam {
  position: absolute;
  left: 50%;
  top: 6%;
  width: 300px;
  height: 190px;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(242, 200, 75, 0.4), rgba(242, 200, 75, 0.09) 62%, transparent 76%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: blur(0.2px);
  pointer-events: none;
  z-index: 2;
}

.bat-signal-beam::after {
  content: "";
  position: absolute;
  top: 14%;
  left: 50%;
  width: 100px;
  height: 42px;
  transform: translateX(-50%);
  background: rgba(3, 8, 14, 0.76);
  clip-path: polygon(0 56%, 10% 40%, 24% 56%, 36% 28%, 50% 60%, 64% 28%, 76% 56%, 90% 40%, 100% 56%, 86% 66%, 74% 58%, 64% 82%, 50% 66%, 36% 82%, 26% 58%, 14% 66%);
  box-shadow: 0 0 0 1px rgba(242, 200, 75, 0.24);
}

.waterfall {
  position: absolute;
  right: 10%;
  top: 20%;
  width: 10%;
  height: 62%;
  border-radius: 10px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(134, 195, 255, 0.6) 0 8px,
      rgba(73, 133, 194, 0.28) 8px 16px
    );
  opacity: 0.48;
  filter: blur(0.4px);
  animation: waterfallFlow 2.4s linear infinite;
  pointer-events: none;
  z-index: 2;
}

.waterfall::after {
  content: "";
  position: absolute;
  left: -28%;
  right: -28%;
  bottom: -6%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(141, 201, 255, 0.26), transparent 70%);
}

.cave-lake {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 4%;
  height: 18%;
  border-radius: 100% 100% 12px 12px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(117, 178, 236, 0.28), rgba(25, 54, 88, 0.26) 60%, rgba(4, 10, 18, 0.08) 100%),
    repeating-linear-gradient(110deg, rgba(124, 189, 255, 0.1) 0 2px, transparent 2px 16px);
  box-shadow:
    inset 0 10px 30px rgba(5, 16, 30, 0.7),
    0 0 24px rgba(60, 116, 173, 0.2);
  animation: lakeShift 7.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

.stalagmites {
  position: absolute;
  inset: auto 6% 3%;
  height: 24%;
  z-index: 3;
  pointer-events: none;
}

.stg {
  position: absolute;
  bottom: 0;
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 110px solid rgba(55, 77, 102, 0.76);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.38));
}

.stg.stg1 {
  left: 2%;
  border-left-width: 22px;
  border-right-width: 22px;
}

.stg.stg2 {
  left: 20%;
  border-left-width: 15px;
  border-right-width: 15px;
  border-bottom-width: 92px;
}

.stg.stg3 {
  left: 38%;
  border-left-width: 20px;
  border-right-width: 20px;
  border-bottom-width: 118px;
}

.stg.stg4 {
  left: 58%;
  border-left-width: 14px;
  border-right-width: 14px;
  border-bottom-width: 86px;
}

.stg.stg5 {
  left: 74%;
  border-left-width: 17px;
  border-right-width: 17px;
  border-bottom-width: 102px;
}

.stg.stg6 {
  left: 90%;
  border-left-width: 23px;
  border-right-width: 23px;
}

.catwalk {
  position: absolute;
  left: 24%;
  right: 24%;
  top: 56%;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(81, 129, 182, 0.62), rgba(27, 51, 80, 0.78));
  box-shadow:
    0 0 0 1px rgba(112, 157, 209, 0.44),
    0 3px 20px rgba(0, 0, 0, 0.35);
  z-index: 3;
  pointer-events: none;
}

.catwalk::before,
.catwalk::after {
  content: "";
  position: absolute;
  top: 100%;
  width: 2px;
  height: 24px;
  background: rgba(89, 127, 173, 0.48);
}

.catwalk::before {
  left: 14%;
}

.catwalk::after {
  right: 14%;
}

.cave-rings {
  position: absolute;
  inset: 13% 16% 14%;
  border-radius: 50%;
  border: 1px solid rgba(119, 168, 230, 0.28);
  box-shadow:
    inset 0 0 0 56px rgba(44, 96, 154, 0.06),
    inset 0 0 0 112px rgba(44, 96, 154, 0.06),
    inset 0 0 0 168px rgba(44, 96, 154, 0.05);
  animation: pulseRing 7.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

.batmobile-bay {
  position: absolute;
  left: 16%;
  bottom: 12%;
  width: 230px;
  height: 90px;
  pointer-events: none;
  z-index: 3;
}

.batmobile {
  position: absolute;
  inset: auto 0 0 0;
  height: 46px;
  background:
    linear-gradient(180deg, rgba(19, 34, 55, 0.88), rgba(5, 11, 20, 0.94));
  clip-path: polygon(0 70%, 6% 58%, 12% 40%, 28% 22%, 44% 26%, 58% 20%, 72% 24%, 86% 34%, 98% 52%, 100% 72%, 92% 78%, 82% 82%, 66% 84%, 42% 86%, 21% 84%, 8% 82%);
  border: 1px solid rgba(100, 146, 203, 0.4);
  box-shadow: 0 5px 24px rgba(0, 0, 0, 0.48);
}

.batmobile::before,
.batmobile::after {
  content: "";
  position: absolute;
  bottom: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(112, 150, 196, 0.55);
  background: rgba(6, 13, 24, 0.88);
}

.batmobile::before {
  left: 34px;
}

.batmobile::after {
  right: 30px;
}

.terminal-wall {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  width: 46%;
  height: 20%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  pointer-events: none;
  z-index: 3;
}

.terminal {
  border-radius: 6px;
  border: 1px solid rgba(96, 154, 218, 0.28);
  background:
    repeating-linear-gradient(
      180deg,
      rgba(88, 167, 255, 0.2) 0 4px,
      rgba(88, 167, 255, 0.04) 4px 8px
    ),
    linear-gradient(180deg, rgba(9, 24, 41, 0.85), rgba(4, 10, 19, 0.92));
  box-shadow: inset 0 0 16px rgba(83, 166, 255, 0.22);
  animation: terminalPulse 2.7s ease-in-out infinite;
}

.terminal.t2 {
  animation-delay: -0.4s;
}

.terminal.t3 {
  animation-delay: -1.2s;
}

.terminal.t4 {
  animation-delay: -0.8s;
}

.cave-fog {
  position: absolute;
  left: -8%;
  right: -8%;
  bottom: -8%;
  height: 38%;
  background:
    radial-gradient(ellipse at 26% 24%, rgba(122, 174, 232, 0.12), transparent 48%),
    radial-gradient(ellipse at 72% 16%, rgba(242, 200, 75, 0.08), transparent 50%),
    radial-gradient(ellipse at center, rgba(16, 32, 52, 0.34), rgba(6, 13, 24, 0));
  filter: blur(8px);
  opacity: 0.66;
  animation: fogDrift 14s ease-in-out infinite;
  pointer-events: none;
  z-index: 4;
}

.batcomputer {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 118px;
  height: 118px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(242, 200, 75, 0.56);
  background:
    radial-gradient(circle, rgba(242, 200, 75, 0.27), rgba(242, 200, 75, 0.04) 58%, transparent 66%),
    radial-gradient(circle, rgba(115, 176, 246, 0.24), rgba(115, 176, 246, 0.04) 72%, transparent 84%);
  box-shadow:
    0 0 28px rgba(242, 200, 75, 0.28),
    0 0 48px rgba(76, 145, 214, 0.2);
  pointer-events: none;
  z-index: 4;
}

.batcomputer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 50px;
  height: 20px;
  transform: translate(-50%, -50%);
  background: rgba(7, 15, 24, 0.72);
  clip-path: polygon(0 56%, 10% 40%, 24% 56%, 36% 28%, 50% 60%, 64% 28%, 76% 56%, 90% 40%, 100% 56%, 86% 66%, 74% 58%, 64% 82%, 50% 66%, 36% 82%, 26% 58%, 14% 66%);
  box-shadow: 0 0 0 1px rgba(242, 200, 75, 0.35);
}

.agent-swarm {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.agent-drone {
  all: unset;
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  border-radius: 12px;
  padding: 7px 10px;
  background: rgba(6, 14, 27, 0.9);
  border: 1px solid rgba(129, 167, 214, 0.38);
  color: #d8e7fa;
  cursor: pointer;
  min-width: 112px;
  text-align: left;
  animation: drift var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.agent-drone:hover,
.agent-drone:focus-visible {
  border-color: rgba(242, 200, 75, 0.75);
  box-shadow: 0 0 0 1px rgba(242, 200, 75, 0.24), 0 12px 30px rgba(0, 0, 0, 0.38);
}

.agent-drone.core {
  background: linear-gradient(145deg, rgba(12, 23, 39, 0.96), rgba(7, 14, 24, 0.96));
}

.agent-drone.sub {
  background: linear-gradient(145deg, rgba(8, 19, 34, 0.93), rgba(6, 12, 22, 0.95));
}

.drone-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: middle;
}

.agent-drone.online .drone-dot {
  background: var(--good);
  box-shadow: 0 0 0 6px rgba(67, 213, 162, 0.16);
}

.agent-drone.watching .drone-dot {
  background: var(--warn);
  box-shadow: 0 0 0 6px rgba(255, 211, 107, 0.17);
}

.agent-drone.degraded .drone-dot {
  background: var(--critical);
  box-shadow: 0 0 0 6px rgba(255, 122, 114, 0.19);
}

.drone-name {
  font-family: "Orbitron", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  display: inline-block;
  vertical-align: middle;
}

.drone-meta {
  display: block;
  margin-top: 3px;
  font: 700 0.62rem/1 "IBM Plex Mono", monospace;
  color: #9db2d0;
}

.cave-legend {
  align-self: start;
  margin: 132px 16px 16px 0;
  max-height: calc(100vh - 188px);
  border: 1px solid rgba(121, 158, 204, 0.34);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0, rgba(100, 146, 198, 0.12), transparent 56%),
    linear-gradient(160deg, rgba(7, 14, 25, 0.92), rgba(5, 11, 21, 0.96));
  padding: 10px;
  display: grid;
  gap: 10px;
  overflow: auto;
  backdrop-filter: blur(5px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.legend-section {
  display: grid;
  gap: 7px;
}

.legend-title {
  margin: 0;
  color: var(--bat-gold);
  font: 700 0.68rem/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.legend-tab {
  all: unset;
  display: block;
  border: 1px solid rgba(123, 161, 209, 0.3);
  border-radius: 9px;
  padding: 7px 8px;
  cursor: pointer;
  background: linear-gradient(145deg, rgba(10, 21, 36, 0.92), rgba(5, 12, 22, 0.96));
  transition: border-color 140ms ease, transform 140ms ease;
}

.legend-tab:hover,
.legend-tab:focus-visible {
  border-color: rgba(242, 200, 75, 0.68);
  transform: translateX(2px);
}

.legend-name {
  display: block;
  font-family: "Orbitron", sans-serif;
  font-size: 0.76rem;
}

.legend-stats {
  display: block;
  margin-top: 2px;
  color: #9cb1cf;
  font: 700 0.61rem/1 "IBM Plex Mono", monospace;
}

.legend-empty {
  margin: 0;
  font-size: 0.8rem;
  color: #8ea2be;
}

.floor-zones {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
}

.agent-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.agent-card {
  all: unset;
  cursor: pointer;
  display: block;
  border: 1px solid rgba(124, 160, 206, 0.3);
  border-radius: 12px;
  padding: 12px;
  background:
    radial-gradient(circle at 88% 0, rgba(112, 152, 198, 0.12), transparent 50%),
    linear-gradient(145deg, rgba(9, 18, 33, 0.94), rgba(4, 10, 18, 0.96));
  transition: border-color 140ms ease, transform 140ms ease;
}

.agent-card:hover,
.agent-card:focus-visible {
  border-color: rgba(242, 200, 75, 0.67);
  transform: translateY(-1px);
}

.agent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.agent-name {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 0.95rem;
}

.agent-role {
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 0.84rem;
  min-height: 2.2em;
}

.signal {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.signal.online {
  background: var(--good);
  box-shadow: 0 0 0 7px rgba(67, 213, 162, 0.16);
}

.signal.watching {
  background: var(--warn);
  box-shadow: 0 0 0 7px rgba(255, 211, 107, 0.17);
}

.signal.degraded {
  background: var(--critical);
  box-shadow: 0 0 0 7px rgba(255, 122, 114, 0.17);
}

.agent-stats {
  margin: 0;
  display: grid;
  gap: 4px;
  color: #b5c8e2;
  font: 700 0.7rem/1.3 "IBM Plex Mono", monospace;
}

.footer-row {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
}

.event-panel,
.endpoint-panel {
  border: 1px solid rgba(116, 154, 200, 0.3);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0, rgba(105, 146, 196, 0.1), transparent 58%),
    linear-gradient(150deg, rgba(8, 17, 31, 0.94), rgba(4, 10, 18, 0.96));
  padding: 14px;
}

.event-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.event {
  border: 1px solid rgba(124, 161, 208, 0.28);
  border-radius: 10px;
  padding: 8px 10px;
  background: linear-gradient(145deg, rgba(9, 18, 32, 0.9), rgba(5, 11, 22, 0.92));
}

.event.warn {
  border-color: rgba(255, 211, 107, 0.5);
}

.event.critical {
  border-color: rgba(255, 122, 114, 0.56);
}

.event-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: #9eb1cc;
  font: 700 0.67rem/1 "IBM Plex Mono", monospace;
}

.event p {
  margin: 0;
  font-size: 0.9rem;
}

.endpoint-panel a {
  color: var(--bat-blue);
  font-family: "IBM Plex Mono", monospace;
  word-break: break-all;
  text-decoration: none;
}

.endpoint-panel a:hover {
  text-decoration: underline;
}

.hint {
  color: var(--muted);
  font-size: 0.78rem;
}

.agent-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  width: min(430px, calc(100vw - 24px));
  height: calc(100vh - 24px);
  padding: 12px;
  overflow: auto;
  z-index: 12;
  border-radius: 14px;
  border: 1px solid rgba(124, 161, 208, 0.4);
  background:
    radial-gradient(circle at 50% 0, rgba(106, 153, 211, 0.16), transparent 48%),
    linear-gradient(155deg, rgba(6, 15, 28, 0.97), rgba(3, 8, 15, 0.99));
  box-shadow: var(--shadow);
}

.agent-panel.hidden {
  display: none;
}

.close-btn {
  border: 1px solid rgba(140, 180, 228, 0.45);
  color: var(--ink);
  background: rgba(20, 44, 75, 0.58);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font: 700 0.75rem/1 "IBM Plex Mono", monospace;
}

.close-btn:hover {
  border-color: rgba(242, 200, 75, 0.75);
}

.panel-role {
  margin: 4px 0 10px;
  color: var(--muted);
}

.panel-meta {
  border: 1px solid rgba(124, 161, 208, 0.3);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  background: linear-gradient(145deg, rgba(8, 18, 32, 0.9), rgba(5, 12, 22, 0.95));
  color: #bbcee7;
  font: 700 0.7rem/1.4 "IBM Plex Mono", monospace;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task {
  border: 1px solid rgba(124, 161, 208, 0.3);
  border-radius: 10px;
  padding: 10px;
  background: linear-gradient(145deg, rgba(7, 16, 29, 0.9), rgba(4, 10, 19, 0.94));
}

.task-button {
  all: unset;
  box-sizing: border-box;
  border: 1px solid rgba(124, 161, 208, 0.3);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  display: block;
  background: linear-gradient(145deg, rgba(7, 16, 29, 0.9), rgba(4, 10, 19, 0.94));
  transition: border-color 140ms ease, transform 140ms ease;
}

.task-button:hover,
.task-button:focus-visible {
  border-color: rgba(242, 200, 75, 0.68);
  transform: translateY(-1px);
}

.task h4,
.task-button h4 {
  margin: 0 0 5px;
  font-family: "Orbitron", sans-serif;
  font-size: 0.88rem;
}

.task .task-meta,
.task-button .task-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font: 700 0.66rem/1.4 "IBM Plex Mono", monospace;
}

.task p,
.task-button p {
  margin: 0;
  color: #d5e4f8;
  font-size: 0.84rem;
}

@keyframes pulseRing {
  0%,
  100% {
    opacity: 0.68;
    transform: scale(1);
  }
  50% {
    opacity: 0.92;
    transform: scale(1.02);
  }
}

@keyframes caveBreathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.015);
    opacity: 1;
  }
}

@keyframes batHover {
  0%,
  100% {
    transform: translate(0, 0) scale(0.9);
    opacity: 0.72;
  }
  25% {
    transform: translate(7px, -6px) scale(1);
    opacity: 0.85;
  }
  50% {
    transform: translate(-4px, -10px) scale(0.92);
    opacity: 0.74;
  }
  75% {
    transform: translate(6px, -2px) scale(1.02);
    opacity: 0.84;
  }
}

@keyframes drift {
  0% {
    transform: translate(-50%, -50%) translate(0, 0);
  }
  25% {
    transform: translate(-50%, -50%) translate(var(--dx), calc(var(--dy) * -1));
  }
  50% {
    transform: translate(-50%, -50%) translate(calc(var(--dx) * -1), calc(var(--dy) * -0.2));
  }
  75% {
    transform: translate(-50%, -50%) translate(calc(var(--dx) * 0.45), var(--dy));
  }
  100% {
    transform: translate(-50%, -50%) translate(0, 0);
  }
}

@keyframes waterfallFlow {
  0% {
    background-position-y: 0;
  }
  100% {
    background-position-y: 80px;
  }
}

@keyframes lakeShift {
  0%,
  100% {
    background-position: 0 0;
    transform: scaleX(1);
  }
  50% {
    background-position: 30px 0;
    transform: scaleX(1.02);
  }
}

@keyframes terminalPulse {
  0%,
  100% {
    box-shadow: inset 0 0 16px rgba(83, 166, 255, 0.2);
    opacity: 0.8;
  }
  50% {
    box-shadow: inset 0 0 24px rgba(83, 166, 255, 0.36);
    opacity: 1;
  }
}

@keyframes fogDrift {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.6;
  }
  50% {
    transform: translateX(16px);
    opacity: 0.74;
  }
}

@media (max-width: 1100px) {
  .topbar,
  .action-dock,
  .kpi-row,
  .floor-zones,
  .footer-row {
    max-width: 100%;
  }

  .action-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-buttons {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .cave-layout {
    grid-template-columns: 1fr;
  }

  .cave-legend {
    display: none;
  }

  .batmobile-bay {
    transform: scale(0.85);
    transform-origin: left bottom;
  }

  .terminal-wall {
    width: 56%;
  }

  .bat-signal-beam {
    width: 240px;
    height: 160px;
  }
}

@media (max-width: 980px) {
  .action-controls {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    justify-content: stretch;
  }

  .action-buttons button {
    flex: 1;
  }

  .topbar,
  .floor-zones,
  .footer-row {
    grid-template-columns: 1fr;
  }

  .command-floor {
    margin: 0;
    padding: 12px;
  }

  .agent-panel {
    inset: auto 8px 8px 8px;
    width: auto;
    height: 72vh;
  }

  .cave-stage {
    min-height: 100%;
  }

  .bat-swarm {
    display: none;
  }

  .catwalk {
    left: 20%;
    right: 20%;
    top: 60%;
  }

  .terminal-wall {
    width: 64%;
    top: 26%;
  }
}
