/* ── Ticker Section ── */
.ticker {
  padding: 0;
  background: var(black);
  overflow: hidden;
  border-top: 1px solid var(--ticker-border, rgba(255, 255, 255, 0.06));
  border-bottom: 1px solid var(--ticker-border, rgba(255, 255, 255, 0.06));
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
  transition: background 0.5s ease, border-color 0.5s ease;
}

body.light .ticker {
  --bg-ticker: #e8ecf1;
  --ticker-border: rgba(0, 0, 0, 0.08);
}

/* ── Live Label ── */
.ticker-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ticker-label-color, rgba(255, 255, 255, 0.6));
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
  height: 80px;
  border-right: 1px solid var(--ticker-border, rgba(255, 255, 255, 0.06));
  flex-shrink: 0;
  z-index: 2;
  transition: color 0.5s ease, border-color 0.5s ease;
}

body.light .ticker-label {
  --ticker-label-color: rgba(0, 0, 0, 0.5);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF4D6A;
  box-shadow: 0 0 8px rgba(255, 77, 106, 0.6);
  animation: livePulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes livePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.4; }
}

/* ── Ticker Wrapper ── */
.ticker-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 3%,
    black 97%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 3%,
    black 97%,
    transparent 100%
  );
}

/* ── Ticker Track ── */
.ticker-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: tickerMove 35s linear infinite;
  padding: 16px 0;
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes tickerMove {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ── Coin Card ── */
.coin {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: var(--coin-bg, rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid var(--coin-border, rgba(255, 255, 255, 0.06));
  min-width: 260px;
  cursor: default;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.coin::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.coin:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--coin-hover-border, rgba(0, 180, 255, 0.25));
  box-shadow: 0 8px 25px var(--coin-shadow, rgba(0, 0, 0, 0.2));
}

.coin:hover::before {
  opacity: 1;
}

body.light .coin {
  --coin-bg: rgba(255, 255, 255, 0.7);
  --coin-border: rgba(0, 0, 0, 0.06);
  --coin-hover-border: rgba(0, 140, 220, 0.3);
  --coin-shadow: rgba(0, 0, 0, 0.06);
}

/* ── Coin Icon ── */
.coin-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.coin:hover .coin-icon {
  transform: scale(1.1) rotate(-5deg);
}

.coin-icon.btc {
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.2), rgba(247, 147, 26, 0.05));
  color: #F7931A;
  border: 1px solid rgba(247, 147, 26, 0.15);
}

.coin-icon.eth {
  background: linear-gradient(135deg, rgba(98, 126, 234, 0.2), rgba(98, 126, 234, 0.05));
  color: #627EEA;
  border: 1px solid rgba(98, 126, 234, 0.15);
}

.coin-icon.sol {
  background: linear-gradient(135deg, rgba(156, 106, 222, 0.2), rgba(156, 106, 222, 0.05));
  color: #9945FF;
  border: 1px solid rgba(156, 106, 222, 0.15);
}

.coin-icon.usdt {
  background: linear-gradient(135deg, rgba(38, 161, 123, 0.2), rgba(38, 161, 123, 0.05));
  color: #26A17B;
  border: 1px solid rgba(38, 161, 123, 0.15);
}

.coin-icon.bnb {
  background: linear-gradient(135deg, rgba(243, 186, 47, 0.2), rgba(243, 186, 47, 0.05));
  color: #F3BA2F;
  border: 1px solid rgba(243, 186, 47, 0.15);
}

.coin-icon.xrp {
  background: linear-gradient(135deg, rgba(0, 170, 255, 0.2), rgba(0, 170, 255, 0.05));
  color: #00AAFF;
  border: 1px solid rgba(0, 170, 255, 0.15);
}

/* ── Coin Info ── */
.coin-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.coin-info h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  transition: color 0.5s ease;
}

.coin-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.5s ease;
}

/* ── Coin Price ── */
.coin-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}

.price-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  transition: color 0.3s ease;
  font-variant-numeric: tabular-nums;
}

.price-change {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.price-change.up {
  color: #00FF88;
  background: rgba(0, 255, 136, 0.1);
}

.price-change.down {
  color: #FF4D6A;
  background: rgba(255, 77, 106, 0.1);
}

.price-change.neutral {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

body.light .price-change.neutral {
  background: rgba(0, 0, 0, 0.04);
}

/* ── Price Flash Animation ── */
.coin.flash-up .price-val {
  color: #00FF88 !important;
  animation: flashGreen 0.6s ease;
}

.coin.flash-down .price-val {
  color: #FF4D6A !important;
  animation: flashRed 0.6s ease;
}

@keyframes flashGreen {
  0% { background: rgba(0, 255, 136, 0.2); border-radius: 4px; }
  100% { background: transparent; border-radius: 4px; }
}

@keyframes flashRed {
  0% { background: rgba(255, 77, 106, 0.2); border-radius: 4px; }
  100% { background: transparent; border-radius: 4px; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .ticker-label {
    display: none;
  }

  .coin {
    min-width: 220px;
    padding: 10px 16px;
    gap: 10px;
  }

  .coin-icon {
    width: 36px;
    height: 36px;
    font-size: 17px;
    border-radius: 10px;
  }

  .coin-info h3 {
    font-size: 13px;
  }

  .coin-name {
    font-size: 10px;
  }

  .price-val {
    font-size: 13px;
  }

  .price-change {
    font-size: 11px;
    padding: 2px 6px;
  }

  .ticker-track {
    gap: 10px;
    animation-duration: 28s;
  }
}

@media (max-width: 480px) {
  .coin {
    min-width: 190px;
    padding: 8px 12px;
    gap: 8px;
  }

  .coin-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
    border-radius: 8px;
  }

  .coin-name {
    display: none;
  }

  .price-val {
    font-size: 12px;
  }

  .ticker-track {
    gap: 8px;
    animation-duration: 24s;
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none !important;
  }

  .live-dot {
    animation: none !important;
  }
}