:root {
  --bg: #07090f;
  --ink: #eef2f7;
  --muted: #8b95a7;
  --gold: #d4af37;
  --gold-soft: #f3e5ab;
  --up: #0ecb81;
  --down: #f6465d;
  --glass: rgba(8, 12, 20, 0.62);
  --line: rgba(212, 175, 55, 0.28);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html,
body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  min-height: 100dvh;
}

.chart {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.78;
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 18% 12%, rgba(212, 175, 55, 0.12), transparent 55%),
    radial-gradient(700px 420px at 88% 82%, rgba(14, 203, 129, 0.08), transparent 60%),
    radial-gradient(520px 320px at 70% 18%, rgba(80, 120, 255, 0.07), transparent 62%);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 48%, rgba(7, 9, 15, 0.28) 82%, rgba(7, 9, 15, 0.62) 100%);
}

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

.ticker {
  position: fixed;
  top: var(--safe-top);
  left: 0;
  right: 0;
  z-index: 6;
  height: 36px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 9, 15, 0.72);
  backdrop-filter: blur(12px);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker var(--ticker-duration, 22s) ease-in-out infinite alternate;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-row {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 18px;
  height: 36px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tick b {
  color: var(--gold-soft);
  font-weight: 500;
}

.tick .px {
  color: var(--ink);
}

.tick .ch {
  font-weight: 500;
}

.tick .ch.up {
  color: var(--up);
}

.tick .ch.down {
  color: var(--down);
}

.hud {
  position: fixed;
  z-index: 6;
  top: calc(52px + var(--safe-top));
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: "IBM Plex Mono", monospace;
  pointer-events: none;
}

.hud-left {
  left: 20px;
}

.hud-right {
  right: 20px;
  text-align: right;
}

.hud-pair {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--gold-soft);
}

.hud-tf,
.hud-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.hud-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b7280;
  box-shadow: 0 0 0 0 rgba(14, 203, 129, 0.5);
}

.hud-live.live i {
  background: var(--up);
  animation: pulse 1.6s ease-out infinite;
}

.hud-live.sim i {
  background: var(--gold);
}

.hud-right strong {
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.hud-change {
  font-size: 12px;
}

.hud-change.up {
  color: var(--up);
}

.hud-change.down {
  color: var(--down);
}

.stage {
  position: relative;
  z-index: 5;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(72px + var(--safe-top)) 20px calc(56px + var(--safe-bottom));
  pointer-events: none;
}

.card {
  pointer-events: auto;
  width: min(560px, 100%);
  padding: clamp(22px, 4vw, 36px);
  text-align: center;
  background: rgba(9, 13, 22, 0.78);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(22px) saturate(140%);
  animation: rise 0.9s ease both;
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 22px;
}

.logo {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.28));
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.9;
}

.brand-name {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #fff6d4 0%, #d4af37 58%, #9a7418 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.42em;
  color: var(--muted);
  margin-top: 6px;
}

.kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

h1 {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(1.7rem, 5.4vw, 3rem);
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin-bottom: 12px;
}

.lead {
  color: var(--muted);
  font-size: clamp(0.92rem, 2.2vw, 1.05rem);
  line-height: 1.55;
  max-width: 42ch;
  margin: 0 auto 22px;
}

.progress {
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress span {
  display: block;
  height: 100%;
  width: 42%;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-soft), var(--gold), transparent);
  background-size: 200% 100%;
  animation: shimmer 2.4s linear infinite;
}

.pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pills li {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.03);
}

.foot {
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: var(--safe-bottom);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  height: 40px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

.foot .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(var(--ticker-shift, 0px)); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(14, 203, 129, 0.55); }
  100% { box-shadow: 0 0 0 10px rgba(14, 203, 129, 0); }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@media (max-width: 720px) {
  .chart {
    opacity: 0.62;
  }

  .hud-left,
  .hud-right {
    top: calc(46px + var(--safe-top));
  }

  .hud-live span {
    display: none;
  }

  .hud-left {
    left: 12px;
  }

  .hud-right {
    right: 12px;
  }

  .hud-right strong {
    font-size: 16px;
  }

  .logo {
    width: 52px;
    height: 52px;
  }

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

  .card {
    border-radius: 18px;
    padding: 20px 16px 22px;
  }

  .foot {
    font-size: 10px;
    letter-spacing: 0.08em;
    padding: 0 12px;
  }
}

@media (max-width: 420px) {
  .hud-tf,
  .kicker {
    letter-spacing: 0.08em;
  }

  .brand-sub {
    letter-spacing: 0.28em;
  }

  .pills li {
    font-size: 10px;
    padding: 6px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track,
  .progress span,
  .hud-live.live i,
  .card {
    animation: none;
  }
}
