/* ================================================================
   CG Score Banner  v3
   - Base (regular season) styles carried over from v2
   - Adds: --playoffs ribbon, series pips, meta row (venue/broadcasts),
           --upcoming layout, accessible SR-only helper.
   ================================================================ */

.cg-score-banner {
  background: #ffffff;
  border-bottom: 1px solid #ddd;
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  line-height: 1;
  position: relative;
}

/* SR-only: visually hidden but available to screen readers */
.sb-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Edge-to-edge team color extensions */
.cg-score-banner::before,
.cg-score-banner::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 0;
}

.cg-score-banner::before {
  left: 0;
  background: var(--sb-left-color, #CE1126);
}

.cg-score-banner::after {
  right: 0;
  background: var(--sb-right-color, #6CACE4);
}

/* When the playoff ribbon is present, it lives above the main bar
   and needs its own full-width backdrop. Re-anchor the ::before/::after
   to only cover the score row height. */
.cg-score-banner--playoffs::before,
.cg-score-banner--playoffs::after {
  top: 34px;  /* ribbon height */
}
@media (max-width: 700px) {
  .cg-score-banner--playoffs::before,
  .cg-score-banner--playoffs::after { top: 30px; }
}

/* ---- PLAYOFFS RIBBON ---- */
.sb-playoff-ribbon {
  position: relative;
  z-index: 2;
  background: linear-gradient(90deg, #0a0a0a 0%, #1a1a1a 100%);
  color: #FFD34E; /* Stanley Cup gold — AAA on #0a0a0a */
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 34px;
  border-bottom: 2px solid #FFD34E;
  box-sizing: border-box;
}

.sb-playoff-title {
  color: #FFD34E;
  /* Ensure sufficient contrast; gold on near-black measures ~12:1 */
}

.sb-ribbon-sep {
  color: #FFD34E;
  opacity: 0.6;
}

.sb-series-summary {
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---- Inner layout ---- */
.sb-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  max-width: 1080px;
  margin: 0 auto;
  min-height: 70px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  position: relative;
  z-index: 1;
}

.sb-inner:hover { background: rgba(0, 0, 0, 0.02); }
.sb-inner:focus-visible {
  outline: 3px solid #0969DA; /* WCAG 2.2 focus indicator */
  outline-offset: -3px;
}

/* ---- TEAM SECTIONS ---- */
.sb-team {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  position: relative;
  overflow: hidden;
  background: #ffffff;
}

.sb-team--away { justify-content: flex-start; padding-left: 120px; }
.sb-team--home { justify-content: flex-end;   padding-right: 120px; }

/* ---- DOUBLE STRIPE ---- */
.sb-team-stripe {
  position: absolute;
  top: 0; bottom: 0;
  width: 120px;
}

.sb-team-stripe--away {
  left: 0;
  background: var(--sb-left-color, #CE1126);
  clip-path: polygon(0 0, 100% 0, 70% 100%, 0% 100%);
}
.sb-team-stripe--away::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  background: #ffffff;
  clip-path: polygon(74% 0, 80% 0, 50% 100%, 44% 100%);
}

.sb-team-stripe--home {
  right: 0;
  background: var(--sb-right-color, #6CACE4);
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0% 100%);
}
.sb-team-stripe--home::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  background: #ffffff;
  clip-path: polygon(50% 0, 56% 0, 26% 100%, 20% 100%);
}

/* Logo */
.sb-logo {
  width: 58px; height: 58px;
  object-fit: contain;
  flex-shrink: 0;
  position: absolute;
  z-index: 1;
}
.sb-team--away .sb-logo { left: 45px; }
.sb-team--home .sb-logo { right: 45px; }

/* Team info text */
.sb-team-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  position: relative;
  z-index: 1;
}
.sb-team-info--right { text-align: right; align-items: flex-end; }

.sb-city {
  font-size: 0.72rem;
  font-weight: 600;
  color: #6e6a63;
  letter-spacing: 0.02em;
}

.sb-name {
  font-size: 1rem;
  font-weight: 800;
  color: #2d2a26;
}

.sb-sog {
  font-size: 0.68rem;
  font-weight: 600;
  color: #707070; /* bumped from #999 for AA on white (4.6:1) */
  letter-spacing: 0.03em;
  margin-top: 0.1rem;
}

/* Score numbers */
.sb-score {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
  min-width: 2ch;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ---- CENTER INFO ---- */
.sb-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  min-width: 100px;
  text-align: center;
  gap: 0.15rem;
  background: #ffffff;
}

.sb-clock {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1a1a1a;
  font-variant-numeric: tabular-nums;
}

.sb-period {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: #2d2a26;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sb-situation {
  font-size: 0.68rem;
  font-weight: 800;
  color: #CE1126;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sb-final {
  font-size: 0.82rem;
  font-weight: 800;
  color: #2d2a26;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sb-start-time,
.sb-upcoming-time {
  font-size: 0.92rem;
  font-weight: 800;
  color: #2d2a26;
}

.sb-scheduled-label,
.sb-upcoming-day {
  font-size: 0.68rem;
  font-weight: 700;
  color: #5c5c5c; /* 6.4:1 on white */
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sb-upcoming-day {
  color: #CE1126; /* Canes red; 5.9:1 on white — AA compliant */
  font-weight: 800;
  letter-spacing: 0.1em;
}

/* Game number chip (Playoffs) */
.sb-game-num {
  font-size: 0.66rem;
  font-weight: 800;
  color: #0a0a0a;
  background: #FFD34E;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.1rem;
}

/* ---- SERIES PIPS ---- */
.sb-pips {
  display: inline-flex;
  gap: 4px;
  margin-top: 4px;
}
.sb-pips--home { justify-content: flex-end; }

.sb-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #2d2a26;
  background: transparent;
  display: inline-block;
  box-sizing: border-box;
}

.sb-pip--filled {
  background: #2d2a26;
}

/* On playoffs banner, filled pip = gold for visual pop (still on dark border for contrast) */
.cg-score-banner--playoffs .sb-pip--filled {
  background: #FFD34E;
  border-color: #1a1a1a;
}

/* ---- META ROW (venue + broadcasts) ---- */
.sb-meta-row {
  position: relative;
  z-index: 2;
  background: #f6f4f0;
  border-top: 1px solid #e6e1d8;
  padding: 0.45rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1.25rem;
  font-size: 0.78rem;
  color: #2d2a26;
}

.sb-venue {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
}

.sb-meta-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.sb-broadcasts {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.sb-bcast-label {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: #5c5c5c;
}

.sb-bcast {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: #ffffff;
  border: 1px solid #d1ccc0;
  border-radius: 3px;
  font-weight: 800;
  font-size: 0.74rem;
  color: #1a1a1a;
  letter-spacing: 0.03em;
}

.sb-bcast--national {
  background: #0a0a0a;
  color: #FFD34E;
  border-color: #FFD34E;
}

/* ---- LIVE pulse ---- */
.cg-score-banner--live .sb-clock::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #CE1126;
  margin-right: 6px;
  vertical-align: middle;
  animation: sb-pulse 1.6s ease-in-out infinite;
}
@keyframes sb-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .cg-score-banner--live .sb-clock::before { animation: none; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 700px) {
  .sb-playoff-ribbon {
    font-size: 0.65rem;
    padding: 0.35rem 0.5rem;
    letter-spacing: 0.06em;
    min-height: 30px;
    gap: 0.4rem;
  }
  .sb-ribbon-sep { display: none; }
  .sb-series-summary { display: block; font-size: 0.62rem; }

  .sb-team-stripe { width: 65px; }
  .sb-team--away { padding-left: 75px; }
  .sb-team--home { padding-right: 75px; }
  .sb-team--away .sb-logo { left: 30px; }
  .sb-team--home .sb-logo { right: 30px; }
  .sb-logo { width: 36px; height: 36px; }
  .sb-team { gap: 0.4rem; }
  .sb-name { font-size: 0.85rem; }
  .sb-city { font-size: 0.65rem; }
  .sb-score { font-size: 1.6rem; }
  .sb-center { min-width: 75px; padding: 0 0.5rem; }
  .sb-sog { display: none; }

  .sb-pip { width: 8px; height: 8px; border-width: 1px; }
  .sb-pips { gap: 3px; margin-top: 3px; }

  .sb-meta-row {
    font-size: 0.7rem;
    gap: 0.4rem 0.8rem;
    padding: 0.4rem 0.5rem;
  }
  .sb-bcast { font-size: 0.68rem; padding: 0.1rem 0.4rem; }
}

@media (max-width: 450px) {
  .sb-playoff-ribbon {
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.3rem 0.4rem;
  }
  .sb-team-info { display: none; }
  .sb-team-stripe { width: 45px; }
  .sb-team--away { padding-left: 55px; }
  .sb-team--home { padding-right: 55px; }
  .sb-team--away .sb-logo { left: 15px; }
  .sb-team--home .sb-logo { right: 15px; }
  .sb-logo { width: 30px; height: 30px; }
  .sb-score { font-size: 1.4rem; }
  .sb-center { min-width: 60px; }
  .sb-clock { font-size: 0.95rem; }

  /* When team-info is hidden on very small screens, show pips above the score instead */
  .sb-team { flex-direction: column; justify-content: center; padding: 0.2rem 0.5rem; }
  .sb-team--away { padding-left: 55px; }
  .sb-team--home { padding-right: 55px; }
  .sb-pips {
    display: none; /* pips shown in team-info; hidden on xs. Series summary is still in ribbon. */
  }
}

/* ---- HIGH-CONTRAST / FORCED-COLORS SUPPORT ---- */
@media (forced-colors: active) {
  .sb-pip                { border-color: CanvasText; background: Canvas; }
  .sb-pip--filled        { background: CanvasText; }
  .sb-playoff-ribbon     { background: Canvas; color: CanvasText; border-bottom-color: CanvasText; }
  .sb-bcast,
  .sb-bcast--national    { background: Canvas; color: CanvasText; border-color: CanvasText; }
  .sb-game-num           { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
}
