/* ══════════════════════════════════════
   CLIMAX EFFECTS — A + B + D
   ══════════════════════════════════════ */

/* Keyframes */
@keyframes climax-border-pulse {
  0%,100% { box-shadow: 0 0 12px 2px rgba(245,200,66,0.25), 0 0 0 1px rgba(245,200,66,0.35); }
  50%      { box-shadow: 0 0 28px 6px rgba(245,200,66,0.55), 0 0 0 2px rgba(245,200,66,0.7); }
}
@keyframes deuce-border-pulse {
  0%,100% { box-shadow: 0 0 16px 4px rgba(255,100,30,0.3), 0 0 0 1px rgba(255,120,30,0.5); }
  50%      { box-shadow: 0 0 40px 10px rgba(255,80,20,0.65), 0 0 0 2px rgba(255,120,30,0.9); }
}
@keyframes climax-score-glow {
  0%,100% { text-shadow: 0 0 8px currentColor; opacity: 1; }
  50%      { text-shadow: 0 0 22px currentColor, 0 0 40px currentColor; opacity: 0.88; }
}
@keyframes deuce-score-glow {
  0%,100% { text-shadow: 0 0 12px currentColor; opacity: 1; }
  50%      { text-shadow: 0 0 32px currentColor, 0 0 60px currentColor; opacity: 0.82; }
}
@keyframes climax-badge-pop {
  0%   { transform: scale(0.7); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1);   opacity: 1; }
}
@keyframes climax-badge-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.75; transform: scale(0.96); }
}
@keyframes deuce-bg-sweep {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Base live-court card ──
   Previously only the climax/deuce states had any frame, so a normal card
   was transparent + border-less and vanished into the black page. Give it a
   raised surface with a clearly visible edge and shadow. */
.court-card {
  position: relative;
  background: linear-gradient(165deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  box-shadow: 0 16px 40px -22px rgba(0,0,0,0.9);
  overflow: hidden;
}

/* ── Climax card (18-18 / 19-17 / close) ── */
.court-card.climax {
  border: 2px solid rgba(245,200,66,0.6);
  border-top: 3px solid var(--gold);
  animation: climax-border-pulse 2s ease-in-out infinite;
  overflow: visible;
}
.court-card.climax::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 16px;
  pointer-events: none;
  z-index: 0;
}

/* ── Deuce card (20:20+, diff ≤ 2) ── */
.court-card.deuce {
  border: 2px solid rgba(255,110,30,0.7);
  border-top: 3px solid #ff6e1e;
  animation: deuce-border-pulse 1.2s ease-in-out infinite;
  overflow: visible;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(255,80,20,0.06) 100%);
  background-size: 200% 200%;
}

/* ── Score glow on climax ── */
.court-card.climax .court-snum {
  animation: climax-score-glow 2s ease-in-out infinite;
}
.court-card.deuce .court-snum {
  animation: deuce-score-glow 1.1s ease-in-out infinite;
}

/* ── CLIMAX badge ── */
.climax-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 2px 8px;
  border-radius: 5px;
  animation: climax-badge-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards,
             climax-badge-pulse 2s ease-in-out 0.4s infinite;
}
.climax-badge.type-climax {
  background: rgba(245,200,66,0.15);
  border: 1px solid rgba(245,200,66,0.4);
  color: var(--gold);
}
.climax-badge.type-deuce {
  background: rgba(255,110,30,0.15);
  border: 1px solid rgba(255,110,30,0.5);
  color: #ff8c42;
  animation: climax-badge-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards,
             climax-badge-pulse 1.1s ease-in-out 0.4s infinite;
}

/* Card header: match ID + LIVE badge + timer */
.court-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.court-card-id {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4em;
  letter-spacing: 4px;
  color: var(--gold);
}
.court-card-round {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--muted);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 4px;
}
.court-card-timer {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.2em;
  letter-spacing: 2px;
  margin-left: auto;
  transition: color 0.4s;
}
.court-card-timer.long-game {
  color: var(--gold);
  animation: timer-pulse 2s ease-in-out infinite;
}
@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.court-card-umpire {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* Score block — the HERO of the card */
.court-score-block {
  padding: 20px 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.court-score-row {
  display: flex;
  align-items: center;
  justify-content: center;   /* score sits in the middle of the card */
  position: relative;        /* anchors the absolutely-placed G1/G2 label */
  gap: 0;
  flex-wrap: nowrap;
}
.court-glabel {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--muted);
  background: var(--surface3);
  padding: 3px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  width: 26px;
  text-align: center;
}
.court-glabel.g2 {
  color: var(--gold);
  background: rgba(245,200,66,0.12);
}
.court-score-nums {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex: 0 0 auto;
}
.court-snum {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 5.5em;
  line-height: 1;
  letter-spacing: 0;
  min-width: 1.4ch;
  text-align: center;
}
.court-snum.red  { color: var(--red); }
.court-snum.blue { color: var(--blue); }
.court-snum.dim  { opacity: 0.3; }
.court-ssep {
  color: rgba(255,255,255,0.2);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.2em;
  line-height: 1;
  padding: 0 10px;
  flex-shrink: 0;
}
.court-g2-placeholder {
  font-size: 11px;
  color: rgba(255,255,255,0.12);
  letter-spacing: 1px;
  font-weight: 700;
  text-align: center;
}
.court-comeback-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 5px;
  margin-left: 10px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Players footer */
.court-players {
  display: flex;
  align-items: stretch;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: auto;
}
.court-team {
  flex: 1;
  padding: 14px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.court-team.blue { align-items: flex-end; border-left: 1px solid rgba(255,255,255,0.04); }
.court-player-name {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
}
.court-player-name.red  { color: var(--red); }
.court-player-name.blue { color: var(--blue); text-align: right; }
.court-team-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 5px;
}
.court-team-label.red  { color: rgba(255,59,92,0.65); }
.court-team-label.blue { color: rgba(59,142,255,0.65); text-align: right; }

/* Waiting state (no umpire yet, score = – : –) */
.court-waiting {
  padding: 14px 12px 10px;
  text-align: center;
}
.court-waiting-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4em;
  letter-spacing: 4px;
  color: rgba(255,255,255,0.12);
  line-height: 1;
}
.court-waiting-label {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 2px;
  font-weight: 700;
  margin-top: 4px;
}

.queue-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border2);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.12s, background 0.12s;
  cursor: pointer;
}
.queue-row:hover { opacity: 1; }
.queue-row:active {
  transform: scale(0.99);
  background: var(--surface2);
  transition: transform 0.08s, background 0.08s;
}
.queue-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8em;
  letter-spacing: 2px;
  color: var(--muted);
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}
.queue-mid {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1em;
  letter-spacing: 2px;
  color: var(--gold);
  flex-shrink: 0;
}
.queue-round {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--muted);
  background: var(--surface2);
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
.queue-teams {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.queue-team-names {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-vs {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.9em;
  color: var(--muted);
  letter-spacing: 2px;
  flex-shrink: 0;
}
.queue-status {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gold);
  padding: 7px 16px;
  border-radius: 8px;
  background: rgba(245,200,66,0.1);
  border: 1px solid rgba(245,200,66,0.2);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .queue-row { padding: 14px 14px; gap: 10px; }
  .queue-team-names { font-size: 13px; }
  .court-snum { font-size: 3.8em; }
  .court-player-name { font-size: 18px; }
}

