:root {
  color-scheme: dark;
  --bg: #060818;
  --bg-2: #0d1028;
  --panel: rgba(10, 18, 42, 0.72);
  --panel-strong: rgba(15, 24, 54, 0.9);
  --stroke: rgba(148, 163, 184, 0.22);
  --stroke-hot: rgba(56, 189, 248, 0.55);
  --text: #eef7ff;
  --muted: #93a4bd;
  --cyan: #22d3ee;
  --blue: #60a5fa;
  --violet: #a78bfa;
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
  --orange: #fb923c;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(34, 211, 238, 0.18), transparent 32%),
    radial-gradient(circle at 82% 16%, rgba(167, 139, 250, 0.2), transparent 35%),
    linear-gradient(135deg, #050714 0%, #090d22 45%, #0f172a 100%);
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 82%);
  z-index: -3;
}

#neural-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.72;
}

.orb {
  position: fixed;
  width: 38vmax;
  height: 38vmax;
  border-radius: 999px;
  filter: blur(62px);
  opacity: 0.18;
  pointer-events: none;
  z-index: -4;
  animation: drift 18s ease-in-out infinite alternate;
}
.orb-a { background: var(--cyan); top: -16vmax; left: -9vmax; }
.orb-b { background: var(--violet); right: -14vmax; bottom: -15vmax; animation-duration: 22s; }

.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: linear-gradient(to bottom, transparent, rgba(34, 211, 238, 0.04), transparent);
  height: 140px;
  animation: scan 9s linear infinite;
  opacity: 0.55;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 56px;
}

.glass {
  position: relative;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.82), rgba(8, 14, 32, 0.64));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(18px) saturate(140%);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(34,211,238,0.12), transparent 34%, rgba(167,139,250,0.1));
  opacity: 0.8;
}
.glass > * { position: relative; z-index: 1; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.back-link,
.source-pill,
.quality-chip,
.level-badge,
.trend-pill,
.filter {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1;
}
.back-link {
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.back-link:hover { transform: translateX(-3px); border-color: var(--stroke-hot); box-shadow: 0 0 26px rgba(34, 211, 238, .18); }
.source-pill { color: var(--muted); }

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  padding: clamp(24px, 5vw, 48px);
  min-height: 285px;
}
.eyebrow,
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--cyan);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
}
.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.78);
  animation: pulse 1.7s infinite;
}
h1 {
  margin: 14px 0 10px;
  font-size: clamp(2.45rem, 7vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
  background: linear-gradient(90deg, #fff, #a5f3fc 42%, #c4b5fd 78%, #fff);
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 0 42px rgba(34, 211, 238, 0.18);
}
.hero-subtitle {
  margin: 0;
  max-width: 680px;
  color: #c7d2fe;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  color: var(--muted);
}
.quality-chip.ok { color: var(--green); border-color: rgba(52, 211, 153, .4); }
.quality-chip.partial-stale { color: var(--amber); border-color: rgba(251, 191, 36, .46); }

.score-module {
  min-width: 235px;
  display: grid;
  justify-items: center;
  gap: 14px;
}
.score-ring {
  width: 168px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(6,8,24,0.98) 0 56%, transparent 58%),
    conic-gradient(var(--ring-color, var(--cyan)) calc(var(--score) * 1%), rgba(148,163,184,0.14) 0);
  box-shadow: 0 0 42px rgba(34, 211, 238, 0.18), inset 0 0 40px rgba(0,0,0,.35);
}
.score-ring span { font-size: 3.5rem; font-weight: 900; letter-spacing: -0.08em; }
.score-ring small { color: var(--muted); font-weight: 700; }
.score-caption { text-align: center; display: grid; gap: 10px; max-width: 270px; }
.score-scale { color: #a7b7d0; font-weight: 700; line-height: 1.35; }
.level-badge { width: fit-content; justify-self: center; font-weight: 900; }
.level-badge.calm { color: var(--green); border-color: rgba(52,211,153,.38); }
.level-badge.watch { color: var(--cyan); border-color: rgba(34,211,238,.38); }
.level-badge.warning { color: var(--amber); border-color: rgba(251,191,36,.45); }
.level-badge.risk { color: var(--red); border-color: rgba(251,113,133,.45); }

.analysis-grid {
  display: grid;
  grid-template-columns: 1.45fr .85fr;
  gap: 18px;
  margin-top: 18px;
}
.analysis-card,
.pulse-card,
.controls,
.matrix {
  padding: 24px;
}
.analysis-card h2,
.controls h2,
.matrix h2 {
  margin: 10px 0 0;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  letter-spacing: -0.04em;
}
.analysis-card p { color: #cbd5e1; font-size: 1.05rem; line-height: 1.65; }
.signal-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.signal-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.54);
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 16px;
  padding: 12px 14px;
}
.signal-list li::before { content: "◆"; color: var(--cyan); font-size: 0.8rem; margin-top: 3px; }
.pulse-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.pulse-grid div {
  min-height: 94px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(2, 6, 23, .45);
  border: 1px solid rgba(148,163,184,.16);
}
.pulse-grid span { display: block; color: #a7b7d0; font-size: .84rem; margin-bottom: 10px; }
.pulse-grid strong { font-size: 1.45rem; }
.mover-strip {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: #dbeafe;
}
.mover-strip span {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(34, 211, 238, .07);
  border: 1px solid rgba(34, 211, 238, .13);
  font-size: .9rem;
}

.insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.insight {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, .18);
  background: linear-gradient(145deg, rgba(15, 23, 42, .75), rgba(2, 6, 23, .56));
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  min-height: 128px;
}
.insight.hot { border-color: rgba(251, 113, 133, .44); box-shadow: 0 0 42px rgba(251,113,133,.1); }
.insight.watch { border-color: rgba(251, 191, 36, .4); }
.insight.ok { border-color: rgba(52, 211, 153, .34); }
.insight .emoji { font-size: 1.65rem; display: block; margin-bottom: 12px; }
.insight h3 { margin: 0 0 8px; }
.insight p { margin: 0; color: var(--muted); line-height: 1.5; }

.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.filter { cursor: pointer; font-weight: 800; transition: .22s ease; }
.filter:hover,
.filter.active { border-color: var(--stroke-hot); color: #fff; box-shadow: 0 0 28px rgba(34, 211, 238, .16); }
.legend {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #a7b7d0;
  font-size: .86rem;
}
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 0 12px currentColor; }
.dot.pressure { color: var(--red); background: var(--red); }
.dot.relief { color: var(--cyan); background: var(--cyan); }
.dot.neutral { color: var(--muted); background: var(--muted); }

.commodity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.commodity-card {
  padding: 22px;
  min-height: 430px;
  transform: translateY(14px);
  opacity: 0;
  animation: cardIn .7s ease forwards;
}
.commodity-card:nth-child(2) { animation-delay: .06s; }
.commodity-card:nth-child(3) { animation-delay: .12s; }
.commodity-card:nth-child(4) { animation-delay: .18s; }
.commodity-card:nth-child(5) { animation-delay: .24s; }
.commodity-card:nth-child(5):last-child { grid-column: span 2; }
.card-top,
.commodity-id,
.price-line,
.change-row,
.matrix-head,
.matrix-row,
.row-label,
.pressure-set { display: flex; align-items: center; }
.card-top { justify-content: space-between; gap: 14px; }
.commodity-id { gap: 13px; }
.icon-bubble {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 1.75rem;
  background: rgba(15, 23, 42, .78);
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
h3 { margin: 0; font-size: 1.25rem; }
.symbol { color: var(--muted); font-size: .9rem; }
.trend-pill { font-weight: 900; color: var(--cyan); }
.trend-pill.fallend { color: var(--red); }
.trend-pill.steigend { color: var(--green); }
.trend-pill.gemischt { color: var(--amber); }
.price-line { gap: 10px; margin: 24px 0 8px; }
.price { font-size: clamp(2.1rem, 5vw, 3.25rem); letter-spacing: -0.08em; }
.unit { color: var(--muted); }
.sparkline { width: 100%; height: 112px; margin: 4px 0 18px; overflow: visible; }
.sparkline path.area { opacity: .18; }
.sparkline path.line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px currentColor);
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 1.35s ease forwards .25s;
}
.sparkline circle { filter: drop-shadow(0 0 8px currentColor); }
.change-row { gap: 10px; flex-wrap: wrap; }
.change-chip {
  flex: 1 1 94px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(2, 6, 23, .52);
  border: 1px solid rgba(148,163,184,.14);
}
.change-chip span { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 6px; }
.change-chip strong { font-size: 1.08rem; }
.change-chip.pressure-worse strong,
.change-chip.pressure-high strong { color: var(--red); }
.change-chip.relief-better strong,
.change-chip.relief-strong strong { color: var(--cyan); }
.change-chip.neutral strong { color: var(--muted); }
.change-chip.pressure-high { border-color: rgba(251, 113, 133, .34); background: rgba(127, 29, 29, .18); }
.change-chip.relief-strong { border-color: rgba(34, 211, 238, .3); background: rgba(8, 47, 73, .18); }
.description { color: #cbd5e1; line-height: 1.58; min-height: 74px; }
.impact-box {
  padding: 14px 16px;
  border-radius: 17px;
  background: rgba(34, 211, 238, .08);
  border: 1px solid rgba(34, 211, 238, .18);
}
.impact-box span { display: block; color: var(--cyan); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 6px; }
.impact-box strong { color: #e0f2fe; font-weight: 750; }

.matrix { margin-top: 18px; }
.matrix-head { justify-content: space-between; align-items: flex-end; gap: 20px; }
.matrix-head p { max-width: 420px; color: var(--muted); line-height: 1.5; }
.comparison-matrix { display: grid; gap: 14px; margin-top: 22px; }
.matrix-row { gap: 14px; }
.row-label { width: 145px; gap: 10px; color: #dbeafe; font-weight: 800; }
.pressure-set { flex: 1; gap: 10px; }
.pressure-wrap { flex: 1; min-width: 0; }
.bar-title { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; margin-bottom: 6px; }
.pressure-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 16px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(34,211,238,.08), transparent 48%, rgba(148,163,184,.16) 48% 52%, transparent 52%, rgba(251,113,133,.09)),
    rgba(148,163,184,.1);
  overflow: hidden;
}
.zero-line {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(226, 232, 240, .62);
  box-shadow: 0 0 14px rgba(226, 232, 240, .35);
  z-index: 2;
}
.pressure-bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  min-width: 3px;
  border-radius: 999px;
  animation: growX .9s ease forwards;
}
.pressure-bar.right {
  left: 50%;
  transform-origin: left;
}
.pressure-bar.left {
  right: 50%;
  transform-origin: right;
}
.pressure-bar.center {
  left: 50%;
  transform: translateX(-50%);
}
.pressure-bar.pressure-worse {
  background: linear-gradient(90deg, #fb7185, #f97316);
  box-shadow: 0 0 16px rgba(251, 113, 133, .72);
}
.pressure-bar.relief-better {
  background: linear-gradient(90deg, #22d3ee, #38bdf8);
  box-shadow: 0 0 16px rgba(34, 211, 238, .65);
}
.pressure-bar.neutral {
  background: rgba(148, 163, 184, .7);
  box-shadow: 0 0 10px rgba(148, 163, 184, .3);
}

footer { color: var(--muted); text-align: center; padding: 30px 10px 0; font-size: .9rem; }
footer p { margin: 6px 0; }

.error-card {
  grid-column: 1 / -1;
  padding: 24px;
  border: 1px solid rgba(251,113,133,.4);
  border-radius: var(--radius-lg);
  background: rgba(127, 29, 29, .28);
}

@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(8vmax, 4vmax, 0) scale(1.12); } }
@keyframes scan { from { transform: translateY(-160px); } to { transform: translateY(calc(100vh + 160px)); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 14px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
@keyframes cardIn { to { transform: translateY(0); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 1080px) {
  .commodity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .commodity-card:nth-child(5):last-child { grid-column: 1 / -1; }
}

@media (max-width: 880px) {
  .shell { width: min(100% - 22px, 720px); padding-top: 14px; }
  .hero,
  .analysis-grid,
  .commodity-grid,
  .insights { grid-template-columns: 1fr; }
  .commodity-card:nth-child(5):last-child { grid-column: auto; }
  .hero { padding: 24px; }
  .score-module { justify-self: start; grid-template-columns: auto 1fr; text-align: left; }
  .score-ring { width: 122px; }
  .score-ring span { font-size: 2.45rem; }
  .score-caption { text-align: left; justify-items: start; }
  .level-badge { justify-self: start; }
  .controls,
  .matrix-head { align-items: flex-start; grid-template-columns: 1fr; flex-direction: column; }
  .filter-row { justify-content: flex-start; }
  .matrix-row { align-items: stretch; flex-direction: column; }
  .row-label { width: auto; }
  .pressure-set { flex-direction: column; align-items: stretch; }
}

@media (max-width: 540px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  h1 { font-size: clamp(2.6rem, 17vw, 4.2rem); }
  .analysis-card,
  .pulse-card,
  .controls,
  .matrix,
  .commodity-card { padding: 18px; border-radius: 24px; }
  .pulse-grid { grid-template-columns: 1fr; }
  .price { font-size: 2.35rem; }
  .score-module { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  #neural-bg, .scanline, .orb { display: none; }
}
