:root {
  color-scheme: dark;
  --ink: #061018;
  --panel: rgba(9, 24, 35, 0.88);
  --panel-strong: rgba(4, 17, 28, 0.95);
  --cyan: #7be7ff;
  --lime: #59f2a2;
  --red: #ff5d73;
  --gold: #ffd86b;
  --violet: #aeb2ff;
  --white: #f2f8ff;
  --muted: #a9bfd0;
  --safe-x: 28px;
  --topbar-h: 78px;
  --ticker-h: 42px;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
.frame,
#chart {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 24% 18%, rgba(123, 231, 255, 0.16), transparent 28%),
    radial-gradient(circle at 74% 54%, rgba(255, 216, 107, 0.08), transparent 24%),
    linear-gradient(135deg, #061018 0%, #101820 48%, #05070c 100%);
}

.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #061018;
  color: var(--white);
}

#chart {
  position: absolute;
  inset: 0;
}

.grid-glow,
.scanlines,
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.grid-glow {
  z-index: 100;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(123, 231, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 231, 255, 0.1) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 16%, #000 78%, transparent 100%);
}

.scanlines {
  z-index: 450;
  opacity: 0.08;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0.2) 1px,
    transparent 1px,
    transparent 4px
  );
}

.vignette {
  z-index: 420;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.38), transparent 26%, transparent 70%, rgba(0, 0, 0, 0.44)),
    radial-gradient(circle at center, transparent 54%, rgba(0, 0, 0, 0.36));
}

.topbar,
.hero-quote,
.market-board,
.watchlist-board,
.headline-panel,
.ticker {
  position: absolute;
  z-index: 500;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.52);
}

.topbar {
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 180px;
  align-items: center;
  gap: 22px;
  padding: 0 var(--safe-x);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 12px),
    linear-gradient(180deg, rgba(12, 48, 68, 0.98), rgba(4, 18, 30, 0.96));
  border-bottom: 2px solid rgba(123, 231, 255, 0.82);
  box-shadow:
    inset 0 -5px 0 rgba(0, 0, 0, 0.28),
    0 7px 18px rgba(0, 0, 0, 0.42);
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 78px;
  height: 46px;
  color: #061018;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 38%),
    linear-gradient(180deg, #ffd86b, #eaa341 58%, #a7581a);
  font-weight: 900;
  font-size: 26px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 -3px 0 rgba(65, 26, 0, 0.34),
    5px 5px 0 rgba(0, 0, 0, 0.42);
}

.brand-title {
  min-width: 0;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.market-state {
  min-width: 214px;
  padding: 10px 18px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  color: #061018;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), transparent 42%),
    linear-gradient(180deg, #8fffd1, #30c979 66%, #15925a);
  border: 2px solid rgba(255, 255, 255, 0.76);
  box-shadow:
    inset 0 -3px 0 rgba(0, 65, 45, 0.32),
    4px 4px 0 rgba(0, 0, 0, 0.28);
}

.clock {
  text-align: right;
  font-size: 27px;
  font-weight: 900;
  color: #d9f8ff;
}

.hero-quote {
  left: var(--safe-x);
  top: calc(var(--topbar-h) + 34px);
  width: min(44vw, 560px);
  padding: 20px 22px 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 80px),
    linear-gradient(180deg, rgba(9, 31, 43, 0.94), rgba(4, 17, 28, 0.86));
  border: 2px solid rgba(210, 247, 255, 0.78);
  box-shadow:
    inset 0 0 0 2px rgba(123, 231, 255, 0.16),
    9px 9px 0 rgba(0, 0, 0, 0.38);
}

.quote-label,
.board-title,
.headline-source {
  color: var(--gold);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.active-symbol {
  margin-top: 8px;
  font-size: clamp(58px, 8vw, 106px);
  line-height: 0.88;
  font-weight: 900;
}

.active-name {
  margin-top: 6px;
  color: var(--muted);
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-top: 12px;
}

.active-price {
  font-size: clamp(38px, 5vw, 62px);
  font-weight: 900;
}

.active-change {
  padding: 8px 12px;
  min-width: 126px;
  text-align: center;
  font-size: 24px;
  font-weight: 900;
  color: #061018;
  background: var(--lime);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.active-change.down {
  background: var(--red);
  color: #fff;
}

.active-change.flat {
  background: var(--violet);
}

.market-board,
.watchlist-board {
  right: var(--safe-x);
  width: 392px;
  padding: 14px;
  background: var(--panel);
  border: 2px solid rgba(210, 247, 255, 0.72);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.36);
}

.market-board {
  top: calc(var(--topbar-h) + 28px);
}

.watchlist-board {
  top: calc(var(--topbar-h) + 306px);
}

.quote-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.quote-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 92px;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.08);
  border-left: 5px solid var(--lime);
}

.quote-item.down {
  border-left-color: var(--red);
}

.quote-symbol {
  font-size: 20px;
  font-weight: 900;
}

.quote-price {
  min-width: 0;
  color: #e7f7ff;
  font-size: 18px;
  font-weight: 800;
  text-align: right;
}

.quote-change {
  color: var(--lime);
  font-size: 18px;
  font-weight: 900;
  text-align: right;
}

.quote-item.down .quote-change {
  color: var(--red);
}

.compact .quote-item {
  grid-template-columns: 74px minmax(0, 1fr) 82px;
  min-height: 38px;
}

.headline-panel {
  left: var(--safe-x);
  right: 454px;
  bottom: calc(var(--ticker-h) + 26px);
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  background:
    linear-gradient(90deg, rgba(255, 216, 107, 0.18), transparent 36%),
    var(--panel-strong);
  border-top: 2px solid rgba(255, 216, 107, 0.86);
  border-bottom: 2px solid rgba(123, 231, 255, 0.62);
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.38);
}

.headline {
  min-width: 0;
  font-size: 26px;
  line-height: 1.02;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--ticker-h);
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 9px),
    linear-gradient(180deg, #111820, #030609);
  border-top: 2px solid rgba(255, 216, 107, 0.86);
}

.ticker-text {
  display: inline-flex;
  gap: 34px;
  align-items: center;
  white-space: nowrap;
  font-size: 22px;
  font-weight: 900;
  color: #f7fbff;
  transform: translateX(100vw);
  animation: tape 36s linear infinite;
}

.ticker-up {
  color: var(--lime);
}

.ticker-down {
  color: var(--red);
}

@keyframes tape {
  from {
    transform: translateX(100vw);
  }

  to {
    transform: translateX(-100%);
  }
}

@media (max-width: 900px) {
  :root {
    --safe-x: 14px;
    --topbar-h: 64px;
    --ticker-h: 36px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 10px;
  }

  .brand-mark {
    width: 58px;
    height: 38px;
    font-size: 20px;
  }

  .brand-title {
    font-size: 22px;
  }

  .market-state {
    display: none;
  }

  .clock {
    font-size: 20px;
  }

  .hero-quote {
    width: calc(100vw - 28px);
    top: calc(var(--topbar-h) + 18px);
  }

  .market-board,
  .watchlist-board {
    width: calc(50vw - 21px);
    padding: 12px;
    top: auto;
    bottom: calc(var(--ticker-h) + 96px);
  }

  .market-board {
    left: var(--safe-x);
    right: auto;
  }

  .watchlist-board {
    right: var(--safe-x);
  }

  .headline-panel {
    left: var(--safe-x);
    right: var(--safe-x);
    bottom: calc(var(--ticker-h) + 18px);
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .headline {
    font-size: 18px;
  }

  .quote-item,
  .compact .quote-item {
    grid-template-columns: minmax(0, 1fr) 72px;
    min-height: 40px;
    padding: 0 8px;
  }

  .quote-price {
    display: none;
  }

  .quote-symbol {
    font-size: 19px;
  }

  .quote-change {
    font-size: 16px;
  }
}
