.crypto-ticker {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 90;
  display: flex;
  align-items: stretch;
  height: 36px;
  background: rgba(10,14,20,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  user-select: none;
}

.ticker-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  background: rgba(0,197,102,0.08);
  border-right: 1px solid var(--border-subtle);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--green);
  flex-shrink: 0;
}

.ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: ticker-pulse 2s infinite;
}

@keyframes ticker-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 0 20px;
  height: 100%;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  will-change: transform;
}

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

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  padding: 4px 10px;
  border-radius: 999px;
  transition: background 180ms ease, transform 180ms ease;
}
a.ticker-item {
  cursor: pointer;
}
a.ticker-item:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-1px);
}
a.ticker-item:hover .ticker-symbol {
  color: var(--green);
}
.ticker-item.ticker-no-page {
  cursor: default;
}
.ticker-item.ticker-empty {
  cursor: default;
  padding: 0;
}

.ticker-coin-img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ticker-symbol {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.ticker-price {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.ticker-change {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 999px;
}

.ticker-change.pos {
  color: var(--green);
  background: rgba(0,197,102,0.1);
}

.ticker-change.neg {
  color: var(--red-bright);
  background: rgba(229,67,96,0.1);
}

.ticker-empty {
  color: var(--text-tertiary);
  font-size: 11px;
  letter-spacing: 0.2em;
}

@media (max-width: 640px) {
  .crypto-ticker {
    height: 32px;
    font-size: 11px;
    /* Sit below the navbar which grows to include the safe-area on notch iPhones */
    top: calc(64px + env(safe-area-inset-top));
  }
  .ticker-label { padding: 0 12px; font-size: 9px; }
  .ticker-track { gap: 20px; padding: 0 14px; animation-duration: 45s; }
  .ticker-coin-img { width: 14px; height: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}
