/* ============================================================
   FINISIT — REAL-TIME PRICE TICKER
   Fixed strip beneath the nav. Binance WebSocket-driven.
   ============================================================ */

#fin-ticker {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  height: var(--ticker-h);
  z-index: 89;
  display: flex;
  align-items: center;
  background: rgba(7, 8, 11, 0.97);
  border-bottom: 1px solid var(--border-gold);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  overflow: hidden;
  gap: 0;
}

/* ---- Status badge ---- */
.ticker__badge,
.ticker__status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 0 14px 0 16px;
  border-right: 1px solid rgba(212,184,135,0.14);
  height: 100%;
}
.ticker__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3B4456;
  transition: background 0.4s, box-shadow 0.4s;
  flex-shrink: 0;
}
.ticker__dot.is-live {
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: ticker-pulse 2.4s ease infinite;
}
@keyframes ticker-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}
.ticker__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  user-select: none;
}

/* ---- Scrolling track ---- */
.ticker__inner {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, transparent 0%, black 3%, black 97%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 3%, black 97%, transparent 100%);
}
.ticker__track {
  display: flex;
  align-items: center;
  width: max-content;
  height: 100%;
  animation: ticker-scroll 60s linear infinite;
  will-change: transform;
  /* Own compositor layer — price updates won't ripple into this layer */
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}
#fin-ticker:hover .ticker__track {
  animation-play-state: paused;
}
@keyframes ticker-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* ---- Individual asset item ---- */
.ticker__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 100%;
  white-space: nowrap;
  cursor: default;
  transition: background 0.2s;
}
.ticker__item:hover {
  background: rgba(212,184,135,0.05);
}
.ticker__sep {
  font-size: 5px;
  color: rgba(212,184,135,0.25);
  user-select: none;
  flex-shrink: 0;
}

/* ---- Coin logo badge ---- */
.ticker-coin {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-body);
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
  /* box-shadow applied inline per asset (ring color) */
}

/* ---- Symbol + Name column ---- */
.ticker__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
}
.ticker__symbol {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ivory-soft);
  letter-spacing: .04em;
  line-height: 1.2;
}
.ticker__name {
  font-family: var(--font-body);
  font-size: 8.5px;
  font-weight: 400;
  color: var(--ivory-dim);
  letter-spacing: .03em;
  line-height: 1.2;
  text-transform: uppercase;
}

/* ---- Price + Change column ---- */
.ticker__nums {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.ticker__price {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ivory);
  letter-spacing: .02em;
  line-height: 1.2;
  white-space: nowrap;
  transition: color 0.3s;
}
.ticker__price.flash {
  animation: price-flash 0.35s ease;
}
@keyframes price-flash {
  0%   { opacity: 0.4; }
  60%  { opacity: 1; }
  100% { opacity: 1; }
}
.ticker__change {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .02em;
  padding: 1px 4px;
  border-radius: 2px;
  white-space: nowrap;
  line-height: 1.4;
}
.ticker__change.is-up   {
  color: #10B981;
  background: rgba(16,185,129,0.12);
}
.ticker__change.is-down {
  color: #EF4444;
  background: rgba(239,68,68,0.12);
}
.ticker__change.is-flat {
  color: var(--ivory-dim);
  background: transparent;
}

/* ---- Legacy icon (v1 compat) ---- */
.ticker__icon {
  font-size: 11px;
  line-height: 1;
  opacity: 0.8;
}

/* ---- Light mode ---- */
[data-theme="light"] #fin-ticker {
  background: rgba(249,245,238,0.97);
  border-bottom-color: rgba(139,111,63,0.22);
}
[data-theme="light"] .ticker__badge,
[data-theme="light"] .ticker__status {
  border-right-color: rgba(139,111,63,0.14);
}
[data-theme="light"] .ticker__label  { color: #9A8E7A; }
[data-theme="light"] .ticker__symbol { color: #2C1E0A; }
[data-theme="light"] .ticker__name   { color: #9A8E7A; }
[data-theme="light"] .ticker__price  { color: #1A1610; }
[data-theme="light"] .ticker__sep    { color: rgba(139,111,63,0.30); }
[data-theme="light"] .ticker__item:hover { background: rgba(139,111,63,0.05); }
[data-theme="light"] .ticker__change.is-flat { color: #9A8E7A; }
