.vhst-wrap * {
  box-sizing: border-box;
}

:root {
  --gap: 16px;
  --pad: 8px;
  --radius: 12px;
  --travel: 2000px;
  --duration: 60s;
  --bg: #0b0f14;
  --chip: #131a22;
  --chip-alt: #0f151c;
  --accent: #5eead4;
  --accent-2: #60a5fa;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --date-bg: #111827;
  --border: rgba(255, 255, 255, 0.08);
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
}

/* --- Ticker core --- */
.ticker {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  min-height: 46px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0b0f14, #0a0e13);
}

.track {
  display: flex;
  gap: 0;
  padding: 6px 0;
  animation: marquee var(--duration) linear infinite;
  will-change: transform;
}
.ticker:hover .track {
  animation-play-state: paused;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-1 * var(--travel)));
  }
}

.block {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding-left: var(--gap);
}

/* --- Game chips --- */
.date-pill {
  flex: 0 0 auto;
  background: var(--date-bg);
  color: #ff0000;
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
  font-size: var(--fs-sm);
}

.game {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--chip);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease;
  color: var(--text);
  pointer-events: auto;
  font-size: var(--fs-sm);
  line-height: 1.1;
}
.game:hover {
  transform: translateY(-1px);
  background: var(--chip-alt);
}
.abbr {
  font-weight: 700;
  min-width: 2.1ch;
  text-align: center;
}
.score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.at {
  color: #00000066;
}
.meta {
  color: var(--muted);
  font-size: 11px;
}

/* --- Modal --- */
.vhst-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2147483000;
}
.vhst-backdrop[open] {
  display: flex;
}
.vhst-modal {
  width: min(880px, 94vw);
  max-height: 86vh;
  overflow: auto;
  background: #0c1218;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  color: var(--text);
}
.vhst-modal header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0d131a 0%, #0b1016 100%);
}
.vhst-modal h3 {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 700;
}
.vhst-modal .body {
  padding: 10px;
  display: grid;
  gap: 10px;
}

/* --- Grid layout --- */
.vhst-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.vhst-grid > * {
  min-width: 0;
}
.vhst-wrap[data-cols="1"] .vhst-grid {
  grid-template-columns: 1fr;
}
@media (max-width: 640px) {
  .vhst-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Cards and lists --- */
.card {
  background: #0c131a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}
.card h4 {
  margin: 0 0 6px;
  font-size: var(--fs-sm);
  color: var(--accent-2);
  font-weight: 700;
}
.legend {
  font-size: 11px;
  color: var(--muted);
}
.list {
  display: grid;
  gap: 6px;
}
.list .item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #0b1218;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: var(--fs-xs);
  line-height: 1.15;
}
.score-list .item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}
.muted {
  color: var(--muted);
}
.kvs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
}
.kvs .score {
  font-weight: 800;
}
.close {
  appearance: none;
  border: 0;
  background: #101822;
  color: #d1d5db;
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-sm);
}
.close:hover {
  background: #122032;
}

/* --- Totals --- */
.totals {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.1;
}
.totals th,
.totals td {
  border-bottom: 1px solid var(--border);
  padding: 6px 6px;
  text-align: left;
  white-space: nowrap;
}
.totals-wrap {
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.totals th {
  position: sticky;
  top: 0;
  background: #0d141b;
}
.totals-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 900px) {
  .totals-sections {
    grid-template-columns: 1fr;
  }
}
.totals-section .section-title {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.time-chip {
  display: inline-block;
  border: 1px solid rgba(96, 165, 250, 0.6);
  border-radius: 6px;
  padding: 1px 5px;
  margin-left: 4px;
  font-size: 11px;
  color: var(--accent-2);
  background: rgba(96, 165, 250, 0.12);
  font-weight: 600;
}
.times .time-chip:first-child {
  margin-left: 0;
}
