:root {
  color-scheme: dark;
  --bg: #05070b;
  --panel: rgba(7, 20, 24, 0.78);
  --panel-strong: rgba(3, 31, 37, 0.95);
  --cyan: #55ffe6;
  --cyan-soft: rgba(85, 255, 230, 0.42);
  --cyan-dim: rgba(85, 255, 230, 0.12);
  --green: #7dff9b;
  --amber: #ffb84d;
  --red: #ff5d6c;
  --text: #d9fff8;
  --muted: #75aaa4;
  --line: rgba(85, 255, 230, 0.28);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 38%, rgba(29, 190, 174, 0.17), transparent 32rem),
    radial-gradient(circle at 12% 8%, rgba(255, 184, 77, 0.08), transparent 18rem),
    linear-gradient(180deg, #0a0d13 0%, #030509 64%, #010205 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(85, 255, 230, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(85, 255, 230, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 72%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.025) 0,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 2px,
    transparent 6px
  );
  mix-blend-mode: screen;
  opacity: 0.18;
}

button,
input {
  font: inherit;
}

.console-shell {
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(14px, 2vw, 28px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(14px, 2vw, 22px);
}

.top-bar,
.bottom-dock,
.panel,
.hud-stage {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(5, 16, 21, 0.92), rgba(2, 7, 12, 0.78));
  box-shadow:
    0 0 26px rgba(85, 255, 230, 0.09),
    inset 0 0 22px rgba(85, 255, 230, 0.04);
  backdrop-filter: blur(12px);
}

.top-bar {
  min-height: 74px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 30px 100%, 0 calc(100% - 30px));
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cyan);
  color: #00110e;
  background: var(--cyan);
  box-shadow: 0 0 24px var(--cyan-soft);
  font-weight: 900;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  letter-spacing: 0;
}

.brand p,
.clock-panel strong,
.panel-title,
small,
time,
.scan-readouts span,
.status-strip span,
.command-card label {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.clock-panel {
  text-align: right;
}

.clock-panel span {
  display: block;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.08rem, 2.5vw, 1.9rem);
  font-weight: 800;
  text-shadow: 0 0 16px var(--cyan-soft);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(380px, 1.7fr) minmax(220px, 0.85fr);
  gap: clamp(14px, 1.7vw, 22px);
  align-items: stretch;
}

.panel {
  padding: 14px;
  min-height: 610px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 8px;
  border-bottom: 1px solid rgba(85, 255, 230, 0.18);
}

.panel-title b {
  color: var(--cyan);
  font-size: 0.67rem;
}

.mini-card {
  position: relative;
  padding: 13px;
  border: 1px solid rgba(85, 255, 230, 0.2);
  background:
    linear-gradient(90deg, rgba(85, 255, 230, 0.1), transparent 5px),
    rgba(2, 13, 18, 0.7);
  overflow: hidden;
}

.mini-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 42px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.mini-head,
.compact-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.mini-head span,
.compact-list span {
  font-weight: 700;
}

.mini-head b,
.compact-list b {
  color: var(--cyan);
  font-size: 0.72rem;
}

.mini-head .ok {
  color: var(--green);
}

.mini-head .warn {
  color: var(--amber);
}

.meter {
  height: 7px;
  margin: 13px 0 8px;
  background: rgba(85, 255, 230, 0.1);
  border: 1px solid rgba(85, 255, 230, 0.2);
}

.meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), #e7fff9);
  box-shadow: 0 0 18px var(--cyan-soft);
  animation: meterPulse 2.6s ease-in-out infinite;
}

.meter.amber span {
  background: linear-gradient(90deg, var(--amber), var(--cyan));
}

.sparkline {
  height: 52px;
  margin: 9px 0 6px;
  background:
    linear-gradient(150deg, transparent 0 8%, rgba(85, 255, 230, 0.82) 8.5% 10%, transparent 10.5% 20%),
    linear-gradient(25deg, transparent 0 28%, rgba(85, 255, 230, 0.54) 28.5% 31%, transparent 31.5% 100%),
    linear-gradient(rgba(85, 255, 230, 0.08) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 13px;
  border-bottom: 1px solid rgba(85, 255, 230, 0.28);
}

.compact-list {
  display: grid;
  gap: 11px;
  margin-top: auto;
}

.hud-stage {
  position: relative;
  min-height: 610px;
  padding: clamp(18px, 3vw, 34px);
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 46%, rgba(85, 255, 230, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(4, 19, 25, 0.94), rgba(1, 5, 9, 0.94));
}

.hud-stage::before {
  content: "";
  position: absolute;
  width: min(74vmin, 690px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(85, 255, 230, 0.12);
  box-shadow:
    inset 0 0 60px rgba(85, 255, 230, 0.06),
    0 0 140px rgba(85, 255, 230, 0.08);
  animation: breathe 4s ease-in-out infinite;
}

.hud-stage::after {
  content: "";
  position: absolute;
  inset: 11%;
  background:
    linear-gradient(90deg, transparent 0 16%, rgba(85, 255, 230, 0.08) 16.2% 16.5%, transparent 17%),
    linear-gradient(180deg, transparent 0 22%, rgba(85, 255, 230, 0.06) 22.2% 22.6%, transparent 23%);
  opacity: 0.8;
  z-index: -1;
}

.corner-frame {
  position: absolute;
  width: min(22%, 160px);
  height: 54px;
  border-color: var(--cyan);
  opacity: 0.75;
}

.top-left {
  top: 28px;
  left: 28px;
  border-top: 2px solid;
  border-left: 2px solid;
  transform: skewX(30deg);
}

.top-right {
  top: 28px;
  right: 28px;
  border-top: 2px solid;
  border-right: 2px solid;
  transform: skewX(-30deg);
}

.bottom-left {
  bottom: 28px;
  left: 28px;
  border-bottom: 2px solid;
  border-left: 2px solid;
  transform: skewX(-30deg);
}

.bottom-right {
  bottom: 28px;
  right: 28px;
  border-bottom: 2px solid;
  border-right: 2px solid;
  transform: skewX(30deg);
}

.status-strip {
  position: absolute;
  left: 50%;
  width: min(330px, calc(100% - 96px));
  min-height: 34px;
  transform: translateX(-50%);
  border: 1px solid rgba(85, 255, 230, 0.36);
  background: rgba(4, 30, 36, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 18px 100%, 0 50%);
}

.status-strip.upper {
  top: 22px;
}

.status-strip.lower {
  bottom: 22px;
}

.status-strip strong {
  color: var(--amber);
  font-size: 1.35rem;
  line-height: 1;
}

.hud-core {
  position: relative;
  width: min(62vmin, 520px);
  min-width: 270px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 20px rgba(85, 255, 230, 0.28));
}

.ring,
.radar-sweep,
.tick-wheel,
.center-orb {
  position: absolute;
  border-radius: 50%;
}

.ring-a {
  inset: 3%;
  border: 12px solid transparent;
  border-top-color: var(--cyan);
  border-right-color: rgba(85, 255, 230, 0.22);
  border-bottom-color: rgba(85, 255, 230, 0.5);
  animation: spin 11s linear infinite;
}

.ring-b {
  inset: 14%;
  border: 2px dashed rgba(85, 255, 230, 0.78);
  box-shadow: inset 0 0 26px rgba(85, 255, 230, 0.12);
  animation: spinReverse 16s linear infinite;
}

.ring-c {
  inset: 28%;
  border: 16px solid transparent;
  border-left-color: rgba(255, 184, 77, 0.82);
  border-top-color: rgba(85, 255, 230, 0.42);
  animation: spin 7s linear infinite;
}

.tick-wheel {
  inset: 20%;
  background: repeating-conic-gradient(
    from 2deg,
    rgba(85, 255, 230, 0.9) 0 2deg,
    transparent 2deg 8deg
  );
  mask: radial-gradient(circle, transparent 0 59%, #000 60% 62%, transparent 63%);
  animation: spin 30s linear infinite;
}

.radar-sweep {
  inset: 9%;
  background: conic-gradient(from 0deg, rgba(85, 255, 230, 0.46), transparent 28%, transparent);
  mask: radial-gradient(circle, transparent 0 18%, #000 20% 54%, transparent 56%);
  animation: spin 4.2s linear infinite;
}

.center-orb {
  width: 22%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid rgba(85, 255, 230, 0.8);
  background: radial-gradient(circle, rgba(85, 255, 230, 0.38), rgba(1, 12, 16, 0.78) 62%);
  box-shadow:
    inset 0 0 30px rgba(85, 255, 230, 0.24),
    0 0 26px rgba(85, 255, 230, 0.32);
}

.center-orb span {
  position: absolute;
  inset: 18%;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.42);
  animation: breathe 1.8s ease-in-out infinite;
}

.center-orb b {
  color: white;
  font-size: clamp(0.9rem, 2vw, 1.5rem);
}

.node {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--red);
  border-radius: 50%;
  background: rgba(255, 93, 108, 0.2);
  box-shadow: 0 0 14px rgba(255, 93, 108, 0.75);
}

.n1 { top: 18%; left: 49%; }
.n2 { top: 33%; right: 17%; }
.n3 { right: 21%; bottom: 28%; }
.n4 { bottom: 16%; left: 48%; }
.n5 { left: 19%; bottom: 35%; }
.n6 { top: 31%; left: 18%; }

.scan-readouts {
  position: absolute;
  right: clamp(18px, 4vw, 52px);
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 12px;
  width: min(180px, 26%);
}

.scan-readouts div {
  border-left: 2px solid var(--cyan);
  padding-left: 10px;
}

.scan-readouts b {
  display: block;
  color: var(--cyan);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.activity {
  display: grid;
  gap: 10px;
}

.feed-row {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 9px;
  align-items: start;
  color: #b6e7df;
  font-size: 0.82rem;
}

.feed-row time {
  color: var(--cyan);
  letter-spacing: 0;
}

.live-feed span {
  color: white;
}

.bar-grid {
  height: 92px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  align-items: end;
  padding-top: 12px;
}

.bar-grid i {
  display: block;
  min-height: 12px;
  background: linear-gradient(180deg, var(--cyan), rgba(85, 255, 230, 0.15));
  box-shadow: 0 0 12px rgba(85, 255, 230, 0.18);
  animation: barPulse 1.6s ease-in-out infinite;
}

.bar-grid i:nth-child(2n) { animation-delay: 0.2s; }
.bar-grid i:nth-child(3n) { animation-delay: 0.45s; }
.bar-grid i:nth-child(4n) { animation-delay: 0.7s; }

.command-card {
  margin-top: auto;
}

.command-card label {
  display: block;
  margin-bottom: 8px;
}

.command-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: center;
  border: 1px solid rgba(85, 255, 230, 0.34);
  background: rgba(0, 0, 0, 0.35);
  padding: 9px 10px;
}

.command-line span {
  color: var(--cyan);
  font-weight: 900;
}

.command-line input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
  caret-color: var(--cyan);
}

.bottom-dock {
  min-height: 64px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.dock-button {
  border: 1px solid rgba(85, 255, 230, 0.2);
  background: rgba(2, 18, 23, 0.72);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  cursor: pointer;
}

.dock-button .icon {
  color: var(--cyan);
  font-size: 1.1rem;
}

.dock-button.active,
.dock-button:hover {
  border-color: rgba(85, 255, 230, 0.64);
  color: white;
  box-shadow: inset 0 0 18px rgba(85, 255, 230, 0.09);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  to { transform: rotate(-360deg); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.62; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
}

@keyframes meterPulse {
  0%, 100% { filter: brightness(0.9); }
  50% { filter: brightness(1.45); }
}

@keyframes barPulse {
  0%, 100% { height: 24%; opacity: 0.55; }
  50% { height: 100%; opacity: 1; }
}

@media (max-width: 1050px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: auto;
  }

  .panel-left,
  .panel-right {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hud-stage {
    order: -1;
  }

  .panel-title,
  .command-card {
    grid-column: 1 / -1;
  }

  .hud-stage {
    min-height: min(76vh, 720px);
  }
}

@media (max-width: 680px) {
  .console-shell {
    padding: 10px;
  }

  .top-bar {
    align-items: flex-start;
    gap: 12px;
  }

  .mark {
    width: 36px;
    height: 36px;
  }

  .clock-panel strong,
  .brand p {
    display: none;
  }

  .panel-left,
  .panel-right {
    grid-template-columns: 1fr;
  }

  .hud-stage {
    min-height: 560px;
    padding: 12px;
  }

  .hud-core {
    width: min(84vw, 420px);
    min-width: 245px;
  }

  .scan-readouts {
    width: calc(100% - 40px);
    right: 20px;
    left: 20px;
    top: auto;
    bottom: 74px;
    transform: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .scan-readouts div {
    padding-left: 8px;
  }

  .status-strip {
    width: calc(100% - 56px);
  }

  .bottom-dock {
    grid-template-columns: repeat(4, minmax(46px, 1fr));
  }

  .dock-button {
    gap: 0;
  }

  .dock-button span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
