html, body {
  margin: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
  font-family: var(--font-sans);
}

/* Board: bottom-centred broadcast bug, not a full-width band. */
.board {
  position: fixed;
  left: 50%;
  bottom: 56px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--mh-white);
  pointer-events: none;
}

/* State pill: floats above the bug. Fixed min-width and centred content
   so the pill stays the same shape whether it shows "PRE", "HT", or
   "Q2 · 12:34". Clock+sep hide via data-stopped during stoppages. */
.state-pill {
  background: var(--mh-blue);
  color: var(--mh-white);
  padding: 6px 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  min-width: 180px;
  box-sizing: border-box;
}
.state-pill .sep { opacity: 0.5; }
.state-pill[data-stopped="true"] .sep,
.state-pill[data-stopped="true"] .clock { display: none; }

/* Bug: fixed-width grid so the score-pair stays anchored in the centre
   and crest positions don't move when scores or names change. Names
   live in 1fr slots and auto-fit via fitName() in the client JS. */
.bug {
  background: var(--mh-red);
  border-radius: 10px;
  height: 80px;
  width: 1100px;
  display: grid;
  grid-template-columns: 80px 1fr 200px 1fr 80px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.crest {
  /* Sized to fit fully inside the 80px band — no overhang. */
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0;
}

.name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  /* Defensive fallback if fitName can't shrink enough — last resort only. */
  overflow: hidden;
  text-overflow: ellipsis;
  /* min-width: 0 lets the 1fr grid track actually shrink to its allocation. */
  min-width: 0;
}
#home-name { text-align: right; }
#away-name { text-align: left; }

/* Score pair: fixed total slot. Each score gets a fixed 1.5em width so a
   single digit and a two-digit number both centre in the same space. */
.score-pair {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  font-weight: 800;
}
.score {
  font-family: var(--font-sans);
  font-size: 48px;
  line-height: 1;
  width: 1.5em;
  text-align: center;
  transition: transform 0.4s ease, color 0.4s ease;
}
.score.flash {
  transform: scale(1.25);
  color: var(--mh-blue);
}
.dash {
  font-size: 36px;
  font-weight: 700;
  opacity: 0.6;
}

/* Reconnect indicator stays top-right so OBS preview makes sense */
.status {
  position: fixed;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 14px;
}
