function Ticker({ items }) {
  return (
    <div style={{ borderTop: '1px solid var(--night-line)', background: 'var(--night-2)', padding: '10px 0', overflow: 'hidden', whiteSpace: 'nowrap' }}>
      <div style={{ display: 'inline-flex', gap: 32, animation: 'tickerScroll 40s linear infinite', paddingLeft: '100%' }}>
        {[...items, ...items].map((it, i) => (
          <span key={i} style={{ fontFamily: 'var(--font-mono)', fontSize: 13, color: 'var(--night-fg-2)', display: 'inline-flex', gap: 8, alignItems: 'center' }}>
            <span style={{ color: 'var(--flag)' }}>▸</span>
            <span style={{ color: 'var(--night-fg-3)' }}>{it.cp}</span>
            <span style={{ color: 'var(--night-fg)', fontWeight: 600 }}>BIB {it.bib}</span>
            <span style={{ color: 'var(--night-fg)' }}>{it.name}</span>
            <span style={{ color: 'var(--night-fg-3)' }}>{it.time}</span>
            <span style={{ color: it.delta.startsWith('-') ? 'var(--green)' : 'var(--flag)' }}>{it.delta}</span>
          </span>
        ))}
      </div>
      <style>{`@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }`}</style>
    </div>
  );
}
window.Ticker = Ticker;
