:root {
  color-scheme: dark;
  --void: #02050d;
  --navy: #061123;
  --panel: rgba(5, 15, 28, 0.72);
  --panel-strong: rgba(7, 20, 36, 0.9);
  --cyan: #6be7ff;
  --cyan-soft: rgba(107, 231, 255, 0.42);
  --violet: #7e62ff;
  --violet-soft: rgba(126, 98, 255, 0.34);
  --good: #42f2a4;
  --risk: #ff4f73;
  --amber: #f3b64b;
  --ice: #eaf8ff;
  --muted: #8da5b8;
  --line: rgba(164, 224, 255, 0.18);
  --shadow: 0 28px 100px rgba(0, 0, 0, 0.54);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--void);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ice);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 50% 32%, rgba(107, 231, 255, 0.16), transparent 25rem),
    radial-gradient(circle at 78% 18%, rgba(126, 98, 255, 0.18), transparent 23rem),
    linear-gradient(180deg, #02050d 0%, #061123 100%);
  overflow-x: hidden;
}

#hudBackdrop,
.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#hudBackdrop {
  z-index: 0;
}

.scanline {
  z-index: 1;
  opacity: 0.42;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 5px),
    radial-gradient(circle at center, transparent 0 46%, rgba(0,0,0,0.34) 100%);
  mix-blend-mode: screen;
}

.terminal-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 14px;
}

.hud-frame,
.hud-panel {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(99,224,255,0.10), transparent 20%),
    linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: var(--shadow), inset 0 0 34px rgba(107, 231, 255, 0.055);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.hud-frame::before,
.hud-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--cyan-soft), transparent 18% 82%, var(--violet-soft)),
    linear-gradient(180deg, rgba(255,255,255,0.06), transparent 18%);
  opacity: 0.44;
  mask-image: linear-gradient(#000 0 2px, transparent 2px calc(100% - 2px), #000 calc(100% - 2px));
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(360px, 1.35fr) minmax(180px, 0.4fr);
  gap: 12px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-glyph {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--cyan-soft);
  color: var(--cyan);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 0 20px rgba(99, 224, 255, 0.28), inset 0 0 18px rgba(99, 224, 255, 0.12);
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
strong,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 2px 0 0;
  font-size: clamp(16px, 2vw, 24px);
  line-height: 1.06;
}

h2 {
  margin: 3px 0 0;
  font-size: 15px;
  line-height: 1.15;
}

.authority-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.authority-strip span,
.semantic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 7px;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--ice);
  background: rgba(255,255,255,0.045);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
  text-align: center;
}

.status-badge {
  display: inline-flex;
  max-width: 100%;
  width: fit-content;
  min-width: 0;
  text-align: left;
}

.authority-strip span {
  border-color: rgba(255, 79, 115, 0.42);
  color: #ffd5dd;
  white-space: nowrap;
}

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

.clock-stack strong {
  display: block;
  margin-top: 4px;
  color: var(--cyan);
  font-size: 12px;
}

.news-console {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.news-lane {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(107, 231, 255, 0.18);
  background: rgba(3, 8, 16, 0.72);
  overflow: hidden;
}

.lane-label {
  z-index: 2;
  padding: 8px;
  color: var(--cyan);
  background: rgba(6, 17, 35, 0.92);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.lane-track {
  display: flex;
  width: max-content;
  gap: 52px;
  white-space: nowrap;
  will-change: transform;
}

.lane-track span {
  color: #d6f6ff;
  font-size: 12px;
  font-weight: 650;
}

.crawl-slow {
  animation: crawl 58s linear infinite;
}

.crawl-medium {
  animation: crawl 45s linear infinite;
}

.crawl-fast {
  animation: crawl 34s linear infinite;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.14fr) minmax(280px, 0.9fr);
  gap: 12px;
  margin-top: 12px;
  align-items: start;
}

.left-stack,
.right-stack,
.core-column {
  display: grid;
  gap: 12px;
}

.hud-panel {
  min-height: 188px;
  padding: 12px;
}

.panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.panel-head .semantic {
  display: block;
  justify-self: start;
  max-width: 100%;
  word-break: break-word;
}

.asset-grid,
.hud-rows,
.alert-list,
.proof-chain {
  display: grid;
  gap: 8px;
}

.asset-card,
.hud-row,
.alert-item,
.proof-node {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.035);
  transition: border-color 180ms ease, filter 180ms ease, transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.asset-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.asset-symbol {
  display: grid;
  place-items: center;
  height: 54px;
  border: 1px solid var(--cyan-soft);
  color: var(--cyan);
  font-weight: 900;
  box-shadow: inset 0 0 22px rgba(99, 224, 255, 0.13);
}

.asset-card p,
.asset-card small,
.alert-item span,
.hud-row span,
.proof-node span {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.asset-card strong,
.hud-row strong,
.alert-item strong,
.proof-node strong {
  display: block;
  color: var(--ice);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.hud-row,
.alert-item,
.proof-node {
  padding: 9px;
}

.proof-node {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
}

.proof-node i {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--cyan-soft);
  color: var(--cyan);
  font-style: normal;
  font-size: 10px;
}

.market-core {
  display: grid;
  place-items: center;
  min-height: min(52vw, 560px);
  aspect-ratio: 1.12;
  isolation: isolate;
}

.core-orbit,
.core-spokes,
.core-center,
.radial-node {
  position: absolute;
}

.core-orbit {
  inset: 12%;
  border: 1px solid rgba(99, 224, 255, 0.28);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(107, 231, 255, 0.2), inset 0 0 26px rgba(107, 231, 255, 0.09);
}

.orbit-one {
  background: conic-gradient(from 0deg, transparent 0 17%, rgba(107,231,255,0.92) 20%, transparent 23% 54%, rgba(107,231,255,0.5) 57%, transparent 61%);
  animation: rotateClockwise 38s linear infinite;
}

.orbit-two {
  inset: 21%;
  border-color: rgba(126, 98, 255, 0.48);
  background: conic-gradient(from 120deg, transparent 0 12%, rgba(126,98,255,0.86) 13.2%, transparent 15.8% 64%, rgba(126,98,255,0.6) 66%, transparent 69%);
  animation: rotateCounter 52s linear infinite;
}

.orbit-three {
  inset: 31%;
  border-style: dashed;
  border-color: rgba(99, 224, 255, 0.32);
  animation: rotateClockwise 68s linear infinite;
}

.core-spokes {
  inset: 7%;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, rgba(107,231,255,0.34) 0 0.7deg, transparent 0.7deg 14deg),
    radial-gradient(circle, transparent 0 41%, rgba(107,231,255,0.14) 42% 42.5%, transparent 43%);
  opacity: 0.55;
  mask-image: radial-gradient(circle, transparent 0 30%, #000 31% 74%, transparent 75%);
}

.core-center {
  z-index: 3;
  display: grid;
  place-items: center;
  width: 164px;
  height: 164px;
  border: 1px solid var(--cyan-soft);
  border-radius: 50%;
  text-align: center;
  background: radial-gradient(circle, rgba(99,224,255,0.18), rgba(5,15,28,0.88) 62%, rgba(115,85,255,0.16));
  box-shadow: 0 0 48px rgba(99, 224, 255, 0.28), inset 0 0 42px rgba(99, 224, 255, 0.16);
  animation: coreBreath 6.2s ease-in-out infinite;
}

.core-center strong {
  color: var(--ice);
  font-size: 16px;
}

.core-center span {
  max-width: 128px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.radial-node {
  z-index: 4;
  width: 140px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(3, 8, 16, 0.78);
  box-shadow: 0 0 24px rgba(99, 224, 255, 0.10);
}

.radial-node span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.radial-node strong {
  display: block;
  margin-top: 3px;
  color: var(--ice);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.node-a { top: 8%; left: 50%; transform: translateX(-50%); }
.node-b { top: 46%; right: 2%; }
.node-c { bottom: 8%; left: 50%; transform: translateX(-50%); }
.node-d { top: 46%; left: 4%; }

.mid-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.severity-success {
  border-color: rgba(66, 242, 164, 0.38);
  color: #baffdf;
}

.severity-warning {
  border-color: rgba(243, 182, 75, 0.44);
  color: #ffe4aa;
}

.severity-critical {
  border-color: rgba(255, 79, 115, 0.52);
  color: #ffd4dd;
  box-shadow: 0 0 28px rgba(255, 79, 115, 0.12);
}

.severity-info {
  border-color: rgba(99, 224, 255, 0.32);
  color: #c9f6ff;
}

.stale {
  opacity: 0.78;
  animation: staleBreath 5.8s ease-in-out infinite;
}

.change-accepted-evidence {
  animation: acceptedPulse 1.2s ease-out 1 both;
}

.change-new-data {
  animation: dataFlash 1.35s ease-out 1 both;
}

.change-green-flip,
.change-red-flip {
  animation: flipSignal 1.1s ease-in-out 1 both;
}

.change-blocker {
  animation: blockerShimmer 1.45s ease-in-out 1 both;
}

.asset-card:hover,
.hud-row:hover,
.alert-item:hover,
.proof-node:hover,
.radial-node:hover,
.asset-card:focus-within,
.hud-row:focus-within,
.alert-item:focus-within,
.proof-node:focus-within {
  border-color: rgba(107, 231, 255, 0.66);
  background: rgba(107, 231, 255, 0.055);
  filter: brightness(1.12);
  transform: scale(1.008);
  box-shadow: 0 0 28px rgba(107, 231, 255, 0.12);
}

@keyframes crawl {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

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

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

@keyframes coreBreath {
  0%, 100% { transform: scale(0.985); box-shadow: 0 0 40px rgba(99, 224, 255, 0.22), inset 0 0 34px rgba(99, 224, 255, 0.12); }
  50% { transform: scale(1.015); box-shadow: 0 0 78px rgba(107, 231, 255, 0.4), inset 0 0 56px rgba(126, 98, 255, 0.2); }
}

@keyframes acceptedPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(99, 224, 255, 0); }
  50% { box-shadow: 0 0 22px rgba(99, 224, 255, 0.22); }
}

@keyframes dataFlash {
  0% { filter: brightness(1.55); }
  100% { filter: brightness(1); }
}

@keyframes flipSignal {
  0%, 74%, 100% { transform: translateX(0); }
  78% { transform: translateX(-1px); }
  80% { transform: translateX(1px); }
  82% { transform: translateX(-1px); }
  84% { transform: translateX(0); }
}

@keyframes staleBreath {
  0%, 100% { border-color: rgba(243, 182, 75, 0.18); }
  50% { border-color: rgba(243, 182, 75, 0.64); }
}

@keyframes blockerShimmer {
  0%, 100% { box-shadow: inset 0 0 0 rgba(255, 79, 115, 0), 0 0 16px rgba(115, 85, 255, 0.08); }
  50% { box-shadow: inset 0 0 22px rgba(255, 79, 115, 0.12), 0 0 34px rgba(115, 85, 255, 0.18); }
}

@media (max-width: 1180px) {
  .topbar,
  .command-grid,
  .mid-panels {
    grid-template-columns: 1fr;
  }

  .clock-stack {
    text-align: left;
  }

  .market-core {
    min-height: 520px;
  }
}

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

  .topbar {
    min-height: auto;
  }

  .authority-strip span {
    min-height: 22px;
    font-size: 8px;
  }

  .semantic {
    font-size: 8px;
    line-height: 1.25;
    padding: 4px 6px;
  }

  .news-lane {
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: 32px;
  }

  .lane-label {
    padding: 8px 6px;
    font-size: 8px;
  }

  .lane-track {
    gap: 34px;
  }

  .lane-track span {
    font-size: 10px;
  }

  .market-core {
    min-height: 390px;
    aspect-ratio: auto;
  }

  .core-center {
    width: 128px;
    height: 128px;
  }

  .radial-node {
    width: 112px;
    padding: 7px;
  }

  .node-a { top: 5%; }
  .node-b { top: 42%; right: 8px; }
  .node-c { bottom: 5%; }
  .node-d { top: 42%; left: 8px; }

  .radial-node strong {
    font-size: 10px;
  }

  .asset-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 8px;
  }

  .asset-symbol {
    height: 44px;
  }
}

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

  .lane-track {
    transform: translateX(0);
  }
}
