html, body { height: 100%; overflow: hidden; background: var(--ink); }
.tv { position: relative; width: 100vw; height: 100vh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); overflow: hidden; font-size: clamp(12px, 1.05vw, 26px); cursor: none; }

/* ---- latar: arena gelap, garis lapangan, horizon gold ---- */
.bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background:
  radial-gradient(90vw 60vh at 50% 108%, #0f2f86 0%, #071637 45%, transparent 75%),
  linear-gradient(180deg, #030916 0%, #050f27 60%, #071a45 100%); }
.bg::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(120deg, transparent 0 22px, #ffffff04 22px 23px); }
.court-lines { position: absolute; left: 50%; top: 66%; width: 130vw; height: 110vh; transform: translate(-50%, -50%) perspective(900px) rotateX(64deg);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), #5b8cff26 calc(50% - 1px), #5b8cff26 calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(#5b8cff22 2px, transparent 2px) 0 30% / 100% 40% no-repeat,
    linear-gradient(#5b8cff22 2px, transparent 2px) 0 70% / 100% 40% no-repeat;
  border: 2px solid #5b8cff22; opacity: .45; animation: courtDrift 40s ease-in-out infinite alternate; }
.horizon { position: absolute; left: 0; right: 0; top: 42%; height: 1px; background: var(--gold-line); opacity: .12; }
.beam { position: absolute; top: -20%; width: 18vw; height: 140%; background: linear-gradient(90deg, transparent, #5b8cff0d, transparent); transform: rotate(18deg); animation: beam 14s ease-in-out infinite; }
.beam.b2 { animation-delay: -7s; }
@keyframes courtDrift { to { transform: translate(-50%, -50%) perspective(900px) rotateX(64deg) translateY(-5%); } }
@keyframes beam { 0% { left: -25%; } 100% { left: 110%; } }

.tv > *:not(.bg):not(.overlay) { position: relative; z-index: 1; }

/* ---- header broadcast ---- */
.tv-head { display: flex; justify-content: space-between; align-items: stretch; padding: 1.3em 2.2em .5em; gap: 2em; }
.brand { display: flex; align-items: stretch; animation: wipeIn .9s var(--ease) both; min-width: 0; }
.brand .tag { display: grid; place-items: center; padding: 0 1.8em 0 1.1em; background: var(--gold-grad); color: var(--gold-ink); clip-path: polygon(0 0, 100% 0, calc(100% - .9em) 100%, 0 100%); }
.brand .tag svg { width: 2.2em; height: 2.2em; stroke-width: 1.6; }
.brand .txt { padding: .35em 1.2em .35em .6em; background: linear-gradient(90deg, #0b1f52f0, #0b1f5200); min-width: 0; }
.t-name { font-family: var(--display); font-size: 2.5em; font-weight: 800; line-height: 1; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { color: var(--muted); font-size: .95em; margin-top: .25em; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub b { color: var(--gold); font-weight: 600; }
.head-right { display: flex; align-items: center; gap: 1.2em; flex: none; }
.clock { font-family: var(--display); font-size: 2.4em; font-weight: 700; font-variant-numeric: tabular-nums; padding: 0 .5em; border-left: 2px solid var(--gold); line-height: 1; }
.livecount { display: flex; align-items: center; gap: .5em; font-weight: 700; font-size: .95em; letter-spacing: .12em; text-transform: uppercase; padding: .45em .9em; background: #ff3b4f18; border: 1px solid #ff3b4f55; color: #ffb3bb; }
.livecount:empty { display: none; }
.qr-box { display: flex; align-items: center; gap: .7em; font-size: .78em; color: var(--muted); line-height: 1.25; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.qr-box #qr { background: #fff; padding: .3em; width: 4.4em; height: 4.4em; border: 2px solid var(--gold); }
.qr-box #qr img, .qr-box #qr canvas { width: 100% !important; height: 100% !important; }
.scene-dots { display: flex; gap: .35em; }
.scene-dots i { width: 1.4em; height: .22em; background: #ffffff22; transition: all .5s var(--ease); }
.scene-dots i.on { width: 3em; background: var(--gold); }

/* ---- stage & scene ---- */
.stage { position: relative; overflow: hidden; }
.scene { position: absolute; inset: .4em 2.2em 1.1em; display: flex; flex-direction: column; gap: 1em; }
.scene.enter { animation: sceneIn .8s var(--ease) both; }
.scene.leave { animation: sceneOut .5s var(--ease-in) both; }
@keyframes sceneIn { from { opacity: 0; clip-path: inset(0 0 0 100%); transform: translateX(3%); } to { opacity: 1; clip-path: inset(0 0 0 0); transform: none; } }
@keyframes sceneOut { to { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateX(-3%); } }
.scene-title { display: flex; align-items: center; gap: .8em; font-family: var(--display); font-size: 1.6em; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; }
.scene-title .bar { width: 2.4em; height: .2em; background: var(--gold-grad); animation: grow .7s var(--ease) both; transform-origin: left; }
.scene-title .sub { color: var(--muted); font-weight: 600; letter-spacing: .14em; font-size: .7em; }

/* ---- scoreboard ---- */
.boards { flex: 1; display: grid; gap: 1.1em; min-height: 0; }
.boards.n1 { grid-template-columns: 1fr; }
.boards.n2 { grid-template-rows: 1fr 1fr; }
.boards.n3, .boards.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.boards.n5, .boards.n6 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; }

.sb { --fs: 1; position: relative; display: grid; grid-template-rows: auto 1fr 1fr; background: linear-gradient(180deg, #0a1b45f2, #061332f2); border: 1px solid var(--line); overflow: hidden; box-shadow: 0 2em 4em #0008; animation: wipeIn .8s var(--ease) both; font-size: calc(1em * var(--fs)); min-height: 0; clip-path: polygon(0 0, calc(100% - 1.2em) 0, 100% 1.2em, 100% 100%, 0 100%); }
.sb::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--gold-line); }
.boards.n1 .sb { --fs: 2.05; }
.boards.n2 .sb { --fs: 1.3; }
.boards.n3 .sb, .boards.n4 .sb { --fs: 1.02; }
.boards.n5 .sb, .boards.n6 .sb { --fs: .78; }
.sb-head { display: flex; align-items: stretch; gap: .9em; background: #050f2a; border-bottom: 1px solid var(--line); font-size: .92em; min-height: 2.4em; }
.sb-head .court { display: flex; align-items: center; gap: .5em; padding: 0 1.4em 0 1em; background: var(--gold-grad); color: var(--gold-ink); font-family: var(--display); font-weight: 800; font-size: 1.25em; letter-spacing: .1em; text-transform: uppercase; clip-path: polygon(0 0, 100% 0, calc(100% - .8em) 100%, 0 100%); }
.sb-head .round { display: flex; align-items: center; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-weight: 600; font-size: .9em; }
.sb-head .sit { margin-left: auto; display: flex; align-items: center; gap: .4em; }
.sb-head .sit .chip { font-size: .8em; padding: .25em .7em; animation: wipeIn .5s var(--ease); }
.sb-head .dur { display: flex; align-items: center; gap: .35em; padding-right: 1.6em; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-head .live-dot { align-self: center; }

.sb-row { display: grid; grid-template-columns: .45em 1.1em minmax(0, 1fr) auto auto auto; align-items: center; gap: .9em; padding-right: 1.1em; position: relative; min-height: 0; }
.sb-row + .sb-row { border-top: 1px solid #12285e; }
.sb-row .side { align-self: stretch; }
.sb-row.a .side { background: var(--a); }
.sb-row.b .side { background: var(--b); }
.sb-row.scored::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, #dfb24a40 50%, transparent 80%) no-repeat; background-size: 50% 100%; animation: sweep 1s var(--ease) both; pointer-events: none; }
.sb-row .serve-ball { font-size: 1.15em; }
.sb-team { min-width: 0; }
.sb-team .nm { font-family: var(--display); font-weight: 800; font-size: 2em; line-height: 1.02; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: .02em; }
.sb-team .pl { color: var(--muted); font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .02em; }
.sb-sets { display: flex; }
.sb-sets span { width: 1.9em; text-align: center; font-family: var(--display); font-size: 1.75em; font-weight: 700; color: var(--dim); font-variant-numeric: tabular-nums; }
.sb-sets span.w { color: var(--text); }
.sb-sets span sup { font-size: .45em; color: var(--muted); }
.sb-games, .sb-pts { overflow: hidden; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-variant-numeric: tabular-nums; }
.sb-games { width: 2em; height: 2em; font-size: 2.05em; background: #10275a; border: 1px solid var(--line2); }
.sb-pts { min-width: 2.15em; height: 1.55em; padding: 0 .15em; font-size: 2.75em; background: var(--gold-grad); color: var(--gold-ink); }
.sb.tb .sb-pts { background: linear-gradient(180deg, #8fb0ff, #2a63ff 60%, #1b44c4); color: #fff; }
.sb-row.win .nm { color: var(--gold-hi); }

/* next up */
.next-up { flex: 1; display: grid; place-items: center; text-align: center; }
.next-up .lbl { color: var(--gold); letter-spacing: .32em; text-transform: uppercase; font-size: 1.1em; font-weight: 700; margin-bottom: 1.4em; font-family: var(--display); }
.vs-wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2.4em; }
.vs-wrap .tm { font-family: var(--display); font-size: 4.2em; font-weight: 800; line-height: .95; text-transform: uppercase; }
.vs-wrap .tm small { display: block; font-family: var(--sans); font-size: .22em; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: .02em; margin-top: .5em; }
.vs-wrap .tm.l { text-align: right; animation: slideL .9s var(--ease) both; }
.vs-wrap .tm.r { text-align: left; animation: slideR .9s var(--ease) both; }
.vs-wrap .vs { width: 3.4em; height: 3.4em; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 1.8em; color: var(--gold-ink); background: var(--gold-grad); transform: rotate(45deg); animation: vsIn .8s .4s var(--spring) both; }
.vs-wrap .vs span { transform: rotate(-45deg); }
@keyframes slideL { from { opacity: 0; transform: translateX(-12%); } to { opacity: 1; transform: none; } }
@keyframes slideR { from { opacity: 0; transform: translateX(12%); } to { opacity: 1; transform: none; } }
@keyframes vsIn { from { opacity: 0; transform: rotate(45deg) scale(.3); } to { opacity: 1; transform: rotate(45deg) scale(1); } }
.last-res { margin-top: 3em; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-size: .95em; }
.last-res b { color: var(--text); }

/* bracket fit */
.fit { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.fit > div { position: absolute; left: 50%; top: 50%; transform-origin: 50% 50%; }
.fit .bracket-wrap { overflow: visible; }
.fit .b-round { min-width: 260px; }

/* jadwal */
.cols { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 2em; min-height: 0; }
.col h3 { display: flex; align-items: center; gap: .6em; font-family: var(--display); font-size: 1.25em; letter-spacing: .22em; color: var(--gold); margin: 0 0 .8em; text-transform: uppercase; }
.col h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
.sch { display: grid; gap: .5em; }
.sch-item { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) auto; align-items: stretch; background: linear-gradient(90deg, #0b1f52e8, #08173ce8); border: 1px solid var(--line); animation: wipeIn .55s var(--ease) both; }
.sch-item .ct { display: grid; place-content: center; text-align: center; background: #061332; border-right: 1px solid var(--line); padding: .5em; }
.sch-item .ct b { font-family: var(--display); font-weight: 800; font-size: 1.15em; text-transform: uppercase; color: var(--gold); }
.sch-item .ct span { font-size: .8em; color: var(--muted); font-variant-numeric: tabular-nums; }
.sch-item .mid { padding: .6em 1em; min-width: 0; }
.sch-item .rd { color: var(--muted); font-size: .75em; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; }
.sch-item .tm { font-weight: 700; font-size: 1.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sch-item .tm .w { color: var(--gold-hi); }
.sch-item .tm .v { color: var(--dim); font-weight: 500; margin: 0 .4em; }
.sch-item .res { display: grid; place-items: center; padding: 0 1em; font-family: var(--display); font-size: 1.3em; font-weight: 700; font-variant-numeric: tabular-nums; }

/* klasemen */
.groups { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(24em, 1fr)); gap: 1.2em; align-content: start; }
.groups table.standings { font-size: 1.05em; }

/* podium di TV */
.podium-scene { flex: 1; display: grid; align-items: end; padding-bottom: .5em; min-height: 0; }
.podium-scene .podium { --h: 30vh; max-width: 72em; }
.podium-scene .pd .tn { font-size: 2.1em; }
.podium-scene .pd.p1 .tn { font-size: 2.9em; }
.podium-scene .pd .pl { font-size: 1em; }
.podium-scene .pd .medal { width: 4.2em; height: 4.2em; }
.podium-scene .pd .plinth .rk { font-size: 6.5em; }
.podium-scene .podium-head { margin-bottom: 1.2em; }
.podium-scene .podium-head .t { font-size: 3.4em; }
.podium-scene .podium-head .k { font-size: 1.1em; }

/* ---- ticker ---- */
.ticker { display: flex; align-items: stretch; height: 2.9em; background: #030a1cf2; border-top: 1px solid var(--line); }
.ticker-label { display: flex; align-items: center; gap: .5em; background: var(--blue); color: #fff; padding: 0 1.6em 0 1.2em; font-family: var(--display); font-weight: 800; font-size: 1.15em; letter-spacing: .18em; clip-path: polygon(0 0, 100% 0, calc(100% - .8em) 100%, 0 100%); }
.ticker-track { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; display: flex; align-items: center; }
.ticker-move { display: inline-block; padding-left: 100%; animation: tick var(--dur, 40s) linear infinite; font-size: 1.1em; }
.ticker-move span { margin-right: 1.4em; }
.ticker-move span::after { content: ''; display: inline-block; width: .4em; height: .4em; background: var(--gold); transform: rotate(45deg); margin-left: 1.4em; vertical-align: .15em; }
.ticker-move b { color: var(--gold-hi); }
@keyframes tick { to { transform: translateX(-100%); } }

/* ---- overlay ---- */
.overlay { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
/* lower-third untuk GAME / SET / MULAI / pesan */
.l3 { position: absolute; left: 0; bottom: 12%; display: flex; align-items: stretch; animation: l3In .65s var(--ease) both; filter: drop-shadow(0 1.5em 2em #000a); }
.l3.out { animation: l3Out .45s var(--ease-in) both; }
.l3 .k { display: grid; place-items: center; padding: 0 1.1em 0 2.2em; background: var(--gold-grad); color: var(--gold-ink); font-family: var(--display); font-weight: 900; font-size: 4.2em; letter-spacing: .06em; line-height: 1.25; clip-path: polygon(0 0, 100% 0, calc(100% - .45em) 100%, 0 100%); }
.l3 .k.blue { background: linear-gradient(180deg, #5b8cff, #2a63ff 55%, #1b44c4); color: #fff; }
.l3 .body { display: grid; align-content: center; padding: .4em 3em .4em 1.2em; margin-left: -.5em; background: linear-gradient(90deg, #0b1f52 0%, #0b1f52f2 70%, #0b1f5200); min-width: 30em; }
.l3 .body .s { font-family: var(--display); font-size: 2.4em; font-weight: 800; text-transform: uppercase; line-height: 1; }
.l3 .body .c { color: var(--gold); font-size: 1em; letter-spacing: .26em; text-transform: uppercase; font-weight: 700; margin-top: .35em; }
.l3 .body .s, .l3 .body .c { animation: wipeIn .6s .25s var(--ease) both; }
@keyframes l3In { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes l3Out { to { transform: translateX(-105%); } }

/* pemenang pertandingan: panggung juara satu tingkat */
.win-stage { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(60vw 50vh at 50% 60%, #0b1f52, #030916); animation: fadeIn .5s both; }
.win-stage.out { animation: fadeOut .6s both; }
@keyframes fadeOut { to { opacity: 0; } }
.win-card { display: grid; justify-items: center; text-align: center; }
.win-card .k { font-family: var(--display); color: var(--gold); letter-spacing: .4em; font-weight: 800; font-size: 1.3em; text-transform: uppercase; animation: fadeIn .6s .2s both; }
.win-card .nm { font-family: var(--display); font-weight: 900; font-size: 6em; line-height: .95; text-transform: uppercase; margin: .15em 0 .1em; animation: dropIn .8s .9s var(--spring) both; }
.win-card .pl { color: var(--muted); font-size: 1.3em; animation: fadeIn .6s 1.2s both; }
.win-card .score { font-family: var(--display); font-weight: 700; font-size: 2.2em; letter-spacing: .1em; margin-top: .3em; font-variant-numeric: tabular-nums; animation: fadeIn .6s 1.4s both; }
.win-card .plinth1 { width: 26em; height: 8em; margin-top: 1.4em; background: linear-gradient(180deg, #2b2410, #0f0b03 85%); border-top: 3px solid var(--gold-hi); display: grid; place-items: start center; padding-top: .5em; transform-origin: bottom; animation: rise .8s .3s var(--ease) both; position: relative; overflow: hidden; }
.win-card .plinth1 span { font-family: var(--display); font-weight: 900; font-size: 5.5em; line-height: 1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.win-card .plinth1::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, #ffffff30 50%, transparent 65%); animation: sheen 3s 1.2s ease-in-out infinite; transform: translateX(-120%); }
.win-card .medal { width: 6em; height: 6em; animation: dropIn .8s .7s var(--spring) both; }

/* debu emas, halus */
.dust { position: absolute; top: -2vh; width: .35em; height: .35em; background: var(--gold-hi); border-radius: 50%; opacity: .85; animation: dust linear forwards; box-shadow: 0 0 .6em #dfb24a; }
.dust.s { width: .9em; height: .22em; border-radius: 0; background: var(--gold); }
@keyframes dust { to { transform: translate(var(--dx, 0), 110vh) rotate(540deg); opacity: .2; } }
