/* Centre Court broadcast: the stage is a television feed inside the pixel desk. The court itself is drawn on the
   canvas (art/broadcast); this file gives the stage its bezel and styles the TV graphics in the stage overlay. */

/* ---------- the feed's bezel ---------- */
.stage { background: #161a2b; }
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; border: 3px solid #161a2b; border-radius: 9px; box-shadow: inset 0 0 0 1px #3c4a73, inset 0 0 18px rgba(8, 10, 22, .55); }
.stage > .stage-overlay { z-index: 2; }

/* ---------- TV graphics ---------- */
.tv, .tv-cards { --tv-font: "Helvetica Neue", "Arial Narrow", Arial, system-ui, sans-serif; font-family: var(--tv-font); pointer-events: none; }
.tv { left: 72px; right: 8px; bottom: 8px; height: 44px; display: flex; align-items: stretch; gap: 6px; color: #f2f0e4; line-height: 1; }
.tv.with-perk { right: 132px; }
.tv.hidden, .tv .hidden { display: none; }
.tv-bug { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 104px; padding: 3px 7px; background: rgba(22, 26, 43, .86); border-left: 3px solid #ffd447; border-radius: 2px; }
.tv-row { display: flex; align-items: center; gap: 5px; height: 17px; font-size: 12px; letter-spacing: .4px; }
.tv-row b { flex: 1 1 auto; min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: clip; max-width: 74px; }
.tv-row em { flex: none; min-width: 16px; padding: 1px 4px; font-style: normal; font-weight: 800; font-size: 13px; text-align: center; color: #161a2b; background: #f2f0e4; border-radius: 2px; font-family: var(--tv-font); }
.tv-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.tv-dot.on { background: #c8f04a; box-shadow: 0 0 4px #c8f04a; }
.tv-ring { flex: none; width: 11px; height: 11px; border-radius: 50%; background: conic-gradient(#ffd447 var(--fill, 0%), #3c4a73 0); -webkit-mask: radial-gradient(circle, transparent 2.5px, #000 3px); mask: radial-gradient(circle, transparent 2.5px, #000 3px); }
.tv-side { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 2px; overflow: hidden; }
.tv-tags, .tv-info { display: flex; align-items: center; gap: 4px; height: 20px; flex-wrap: nowrap; overflow: hidden; }
.tv-tag, .tv-speed, .tv-rally { flex: none; padding: 3px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; white-space: nowrap; background: rgba(22, 26, 43, .86); border-radius: 2px; animation: tv-in .18s ease-out; }
.tv-tag.hot { color: #161a2b; background: #f08a3c; }
.tv-tag.gold { color: #161a2b; background: #ffd447; }
.tv-tag.cool { color: #161a2b; background: #7fd8f5; }
.tv-tag.red { background: #d9455f; }
.tv-speed { color: #161a2b; background: #c8f04a; }
.tv-rally { color: #ffd447; }
.tv-lower { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 0 10px; background: linear-gradient(90deg, #ffd447 0 5px, rgba(22, 26, 43, .94) 5px); border-radius: 2px; animation: tv-slide .22s ease-out; }
.tv-lower b { font-size: 15px; font-weight: 800; letter-spacing: .8px; white-space: nowrap; }
.tv-lower span { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; color: #c9cbd6; white-space: nowrap; }
.tv-lower.gold b { color: #ffd447; }
.tv-lower.loss { background: linear-gradient(90deg, #d9455f 0 5px, rgba(22, 26, 43, .94) 5px); }
@keyframes tv-in { from { transform: translateY(6px); opacity: 0; } }
@keyframes tv-slide { from { transform: translateX(-24px); opacity: 0; } }

/* title cards over the court during the walk-on */
.tv-cards { left: 50%; top: 27%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: max-content; max-width: 92%; }
.tv-card { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 16px; color: #f2f0e4; background: rgba(22, 26, 43, .92); border-top: 3px solid #ffd447; border-radius: 2px; animation: tv-in .25s ease-out; }
.tv-card b { font-size: 17px; font-weight: 800; letter-spacing: 2px; white-space: nowrap; }
.tv-card span { font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #c9cbd6; white-space: nowrap; }
.tv-card.rematch { border-top-color: #d9455f; }
.tv-card.rematch b { color: #ff8fa3; }
.tv-card.rematch::after { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, calc(.25 + .6 * var(--glare, 0))), transparent); animation: tv-glare calc(1.6s - .9s * var(--glare, 0)) linear infinite; }
.tv-card.scout { border-top-color: #7fd8f5; flex-direction: row; gap: 10px; align-items: center; }
.tv-card.scout b { font-size: 12px; letter-spacing: 1px; color: #7fd8f5; }
@keyframes tv-glare { to { left: 120%; } }

/* Second Wind: the heart in the lives chip cracks and reforms */
.tv-crack > .spr, .tv-crack > canvas { animation: tv-crack 1.2s ease-in-out; }
@keyframes tv-crack { 0% { transform: none; } 15% { transform: scale(1.35) rotate(-14deg); filter: grayscale(.8); } 30% { transform: scale(.7) rotate(12deg); filter: grayscale(1) brightness(.6); } 45% { transform: scale(.7) rotate(-10deg); filter: grayscale(1) brightness(.6); } 70% { transform: scale(1.4); filter: none; } 100% { transform: none; } }

@media (max-width: 400px) {
  .tv-bug { min-width: 92px; padding: 3px 5px; }
  .tv-row b { max-width: 58px; }
  .tv-tag, .tv-speed, .tv-rally { padding: 3px 4px; font-size: 9.5px; letter-spacing: .3px; }
}
