:root {
  --bg: #07090d;
  --bg-2: #0d1117;
  --panel: rgba(16, 20, 28, 0.86);
  --line: rgba(232, 237, 245, 0.08);
  --line-strong: rgba(232, 237, 245, 0.14);
  --text: #e8edf5;
  --muted: #8b95a5;
  --faint: #5c6573;
  --up: #3ecf8e;
  --up-dim: rgba(62, 207, 142, 0.14);
  --down: #ff5d73;
  --down-dim: rgba(255, 93, 115, 0.14);
  --warn: #e8c36a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 20px 24px 16px;
}

.bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(62, 207, 142, 0.07), transparent 60%),
    radial-gradient(800px 380px at 90% 0%, rgba(90, 140, 255, 0.08), transparent 55%),
    linear-gradient(180deg, #090c11 0%, #07090d 100%);
  z-index: 0;
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}

.top,
.board,
.foot {
  position: relative;
  z-index: 1;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 6px var(--up-dim), 0 0 18px rgba(62, 207, 142, 0.55);
}

.brand h1 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand p {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.status {
  display: flex;
  align-items: center;
  gap: 18px;
}

.live {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.live .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
}

.live.is-live .dot {
  background: var(--up);
  box-shadow: 0 0 10px var(--up);
  animation: pulse 1.6s ease-in-out infinite;
}

.live.is-stale .dot,
.live.is-error .dot {
  background: var(--warn);
  box-shadow: 0 0 10px var(--warn);
  animation: none;
}

.clock {
  text-align: right;
}

.clock #clock {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.clock .tz {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.board {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 0;
}

.card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 24px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 28%),
    var(--panel);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: var(--line-strong);
}

.card.is-up::before {
  background: linear-gradient(90deg, var(--up), transparent 80%);
}

.card.is-down::before {
  background: linear-gradient(90deg, var(--down), transparent 80%);
}

.card.skeleton {
  min-height: 420px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent),
    var(--panel);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.sym {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}

.name {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.exchange {
  margin-top: 3px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.badge.open {
  color: var(--up);
  border-color: rgba(62, 207, 142, 0.35);
  background: var(--up-dim);
}

.badge.pre,
.badge.post {
  color: var(--warn);
  border-color: rgba(232, 195, 106, 0.35);
  background: rgba(232, 195, 106, 0.1);
}

.price-block {
  margin: 22px 0 8px;
}

.price {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: clamp(42px, 6.4vw, 84px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.price.flash-up {
  animation: flash-up 0.55s ease;
}

.price.flash-down {
  animation: flash-down 0.55s ease;
}

.delta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  margin-top: 10px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.delta.up {
  color: var(--up);
}

.delta.down {
  color: var(--down);
}

.delta .pct {
  font-weight: 600;
}

.session-note {
  color: var(--muted);
  font-size: 12px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.chart {
  flex: 1;
  min-height: 120px;
  margin: 8px 0 14px;
}

.chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.stat {
  min-width: 0;
}

.stat span {
  display: block;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.error-msg {
  margin-top: 28px;
  color: var(--down);
  font-size: 14px;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.foot a {
  color: inherit;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@keyframes flash-up {
  0% {
    color: var(--up);
  }
  100% {
    color: var(--text);
  }
}

@keyframes flash-down {
  0% {
    color: var(--down);
  }
  100% {
    color: var(--text);
  }
}

@media (max-width: 860px) {
  body {
    padding: 14px 12px 10px;
  }

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

  .top {
    align-items: flex-start;
  }

  .price {
    font-size: 56px;
  }

  .card {
    min-height: 360px;
  }

  .chart {
    min-height: 96px;
  }
}

@media (max-width: 520px) {
  .status {
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
  }

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

  .foot {
    flex-direction: column;
  }
}
