/* Fonts are bundled in ./fonts/ and referenced relatively: @font-face URLs
 * resolve against this stylesheet, so the package renders identically on an
 * air-gapped playout box — no network at render time. Licence in fonts/. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;          /* variable axis — one file covers every weight */
  font-display: block;           /* block, not swap: never flash a fallback on air */
  src: url('./fonts/Inter-Variable.woff2') format('woff2-variations');
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* The graphic's own root. `position: absolute; inset: 0` fills whatever box the
 * renderer hands us: in an iframe mount that is the frame, and inside a shadow
 * root or a positioned container it is that container. `position: fixed` would
 * escape to the browser viewport in the second case. The package never styles
 * `body` — the renderer owns the document, not the graphic. */
.score-bug-root {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.score-bug {
  position: absolute;
  top: 24px;
  left: 24px;
  font-family: 'Inter', system-ui, sans-serif;
  display: flex;
  align-items: stretch;
  transform: scale(0) translateY(-20px);
  opacity: 0;
  filter: blur(4px);
  transform-origin: top left;
}

.score-bug.visible {
  transform: scale(1) translateY(0);
  opacity: 1;
  filter: blur(0);
  transition:
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s ease,
    filter 0.4s ease;
}

.score-bug.out {
  transform: scale(0) translateY(-20px);
  opacity: 0;
  filter: blur(4px);
  transition:
    transform 0.4s cubic-bezier(0.76, 0, 0.24, 1),
    opacity 0.3s ease 0.1s,
    filter 0.3s ease 0.1s;
}

.score-bug-inner {
  display: flex;
  align-items: stretch;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 8px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.3),
    0 1px 4px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.score-team {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  gap: 14px;
  min-width: 120px;
}

.score-team-name {
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.score-team.active .score-team-name {
  color: #ffffff;
}

.score-value {
  font-size: 28px;
  font-weight: 800;
  color: #f8fafc;
  min-width: 28px;
  text-align: center;
  line-height: 1;
}

.score-team.active .score-value {
  color: #60a5fa;
}

.score-divider {
  width: 1px;
  background: rgba(148, 163, 184, 0.2);
  align-self: stretch;
}

.score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  gap: 2px;
  border-left: 1px solid rgba(148, 163, 184, 0.15);
  border-right: 1px solid rgba(148, 163, 184, 0.15);
}

.score-time {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.score-period {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* Blue accent bar on top */
.score-bug-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #2563eb 0%, #60a5fa 50%, #2563eb 100%);
}

.score-bug-inner {
  position: relative;
}

/* Goal flash animation */
.score-bug.goal .score-bug-inner {
  animation: goalFlash 0.8s ease;
}

@keyframes goalFlash {
  0% { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(37, 99, 235, 0.6); }
  25% { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 30px 8px rgba(37, 99, 235, 0.5); }
  50% { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 40px 12px rgba(37, 99, 235, 0.3); }
  100% { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* Text update animation */
.score-value.updating {
  animation: scoreUpdate 0.35s ease;
}

@keyframes scoreUpdate {
  0% { opacity: 1; transform: scale(1); }
  40% { opacity: 0; transform: scale(1.3); }
  60% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}
