:root {
  color-scheme: dark;
  --bg: #060409;
  --panel: #110a1f;
  --panel-2: #0b0614;
  --panel-3: #1a102d;
  --text: #f5f0ff;
  --muted: #d8ccf4;
  --dim: #9585bc;
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.2);
  --orange: #ff8a3d;
  --gold: #f5d0a8;
  --green: #64d28a;
  --blue: #7cc7ff;
  --red: #ff7d7d;
  --line: rgba(255, 255, 255, 0.09);
  --line-hot: rgba(245, 208, 168, 0.28);
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-poster: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --font-script: "Courier Prime", "Courier New", monospace;
  --font-brand: Orbitron, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 178, 110, 0.15), transparent 55%),
    radial-gradient(circle at 12% 30%, rgba(124, 58, 237, 0.17), transparent 44%),
    radial-gradient(circle at 88% 70%, rgba(255, 138, 61, 0.09), transparent 43%);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.58) 100%);
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 30;
  opacity: 0.045;
  pointer-events: none;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.letterbox {
  height: 26px;
  margin: 0 calc(50% - 50vw);
  background: #000;
  position: relative;
}

.letterbox::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 178, 110, 0.55), rgba(124, 58, 237, 0.55), transparent);
}

.letterbox.top::after {
  bottom: 0;
}

.letterbox.bottom {
  margin-top: 16px;
}

.letterbox.bottom::after {
  top: 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 0 24px;
}

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

.brand-mark {
  width: clamp(68px, 10vw, 104px);
  height: auto;
  filter: drop-shadow(0 12px 30px rgba(124, 58, 237, 0.35));
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-family: var(--font-script);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-family: var(--font-poster);
  font-size: clamp(44px, 8vw, 84px);
  font-weight: 400;
  line-height: 0.95;
  text-transform: uppercase;
  background: linear-gradient(90deg, #fff, #d9c9ff 42%, #ffb37d 78%, #fff);
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 18px 40px rgba(124, 58, 237, 0.24));
}

h2 {
  color: #fff;
  font-size: 18px;
}

.status-pill {
  border: 1px solid rgba(255, 138, 61, 0.34);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.45), rgba(255, 138, 61, 0.42));
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.24);
  font-weight: 800;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  overflow-x: auto;
  padding: 0 0 8px;
  scrollbar-color: rgba(245, 208, 168, 0.5) transparent;
}

.tab-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  font: 800 13px var(--font-body);
  letter-spacing: 0;
  min-height: 42px;
  padding: 10px 13px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tab-button:hover,
.tab-button.is-active {
  border-color: rgba(255, 138, 61, 0.42);
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.44), rgba(255, 138, 61, 0.28));
  color: #fff;
}

.tab-button:hover {
  transform: translateY(-1px);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.summary-grid,
.panel-grid {
  display: grid;
  gap: 12px;
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

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

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(17, 10, 31, 0.96), rgba(11, 6, 20, 0.96));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
}

.metric {
  min-height: 132px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--orange), var(--gold));
  opacity: 0.7;
}

.metric.primary {
  border-color: var(--line-hot);
  background:
    radial-gradient(circle at 20% 0%, rgba(245, 208, 168, 0.14), transparent 42%),
    linear-gradient(180deg, #1c1230, #0b0614);
}

.metric span,
.metric small,
.panel-title span,
dt {
  color: var(--muted);
}

.metric span {
  font-family: var(--font-script);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric strong {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1;
  letter-spacing: 0;
}

.metric small {
  font-size: 13px;
}

.panel {
  min-height: 230px;
  padding: 18px;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.panel-title span {
  font-family: var(--font-script);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.settings-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.settings-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

dt {
  font-size: 14px;
}

dd {
  margin: 0;
  color: #fff;
  font-weight: 800;
  text-align: right;
}

.compact dd {
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

.history-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.history-grid div {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 6px;
  display: block;
  min-height: 82px;
  padding: 12px;
}

.history-grid dd {
  margin-top: 10px;
  text-align: left;
  font-size: 24px;
}

canvas {
  width: 100%;
  height: 260px;
  display: block;
  background: #0b0614;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 6px;
}

.forecast-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.forecast-tile {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 6px;
  min-height: 92px;
  padding: 10px;
}

.forecast-tile strong,
.forecast-tile span {
  display: block;
}

.forecast-tile strong {
  color: #fff;
  font-size: 18px;
  margin: 6px 0 3px;
}

.forecast-tile span {
  color: var(--muted);
  font-size: 12px;
}

.event-list {
  display: grid;
  gap: 8px;
}

.event-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 6px;
  display: grid;
  gap: 6px;
  grid-template-columns: 170px 1fr;
  min-height: 52px;
  padding: 10px 12px;
}

.event-row span,
.empty-note {
  color: var(--muted);
}

.event-row strong {
  color: #fff;
  font-size: 15px;
}

.empty-note {
  margin: 0;
}

.placeholder-panel {
  min-height: 280px;
}

.placeholder-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.placeholder-grid div {
  min-height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.025)),
    radial-gradient(circle at 12% 0%, rgba(245, 208, 168, 0.14), transparent 38%);
  padding: 14px;
}

.placeholder-grid strong,
.placeholder-grid span {
  display: block;
}

.placeholder-grid strong {
  color: #fff;
  font-size: 16px;
  margin-bottom: 10px;
}

.placeholder-grid span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
  }

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

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

  .history-grid {
    grid-template-columns: 1fr;
  }

  .placeholder-grid {
    grid-template-columns: 1fr;
  }

  .event-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 22px, 1180px);
  }

  .brand-mark {
    width: 58px;
  }

  h1 {
    font-size: 42px;
  }

  .settings-list div {
    display: grid;
  }

  dd {
    text-align: left;
  }
}
