/* TV mode — a fixed 1920×1080 stage scaled to fit any screen. */
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body.tv { font-family: var(--body); color: #fff; }
#stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden;
  background:
    radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--orange) 40%, transparent), transparent 60%),
    radial-gradient(900px 500px at -5% 110%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, #070c19 100%); }
#stage::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: repeating-linear-gradient(-45deg, #fff 0 2px, transparent 2px 22px); }

.tv-top { position: absolute; left: 0; right: 0; top: 0; height: 150px; display: flex; align-items: center; gap: 30px; padding: 0 50px; }
.tv-top .l1 { height: 120px; }
.tv-top .l2 { height: 112px; }
.tv-top .ttl { flex: 1; text-align: center; }
.tv-top .ttl .k { font-size: 22px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--gold2); }
.tv-top .ttl h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 70px; line-height: 1; text-transform: uppercase; letter-spacing: .02em; }
.tv-live { display: inline-flex; align-items: center; gap: 10px; background: var(--red); padding: 6px 16px; border-radius: 8px; font-weight: 900; font-size: 22px; letter-spacing: .12em; margin-left: 14px; vertical-align: middle; }
.tv-live i { width: 12px; height: 12px; border-radius: 50%; background: #fff; animation: tvpulse 1s infinite; }
@keyframes tvpulse { 50% { opacity: .25; } }

.tv-body { position: absolute; left: 50px; right: 50px; top: 170px; bottom: 150px; }
.tv-foot { position: absolute; left: 0; right: 0; bottom: 0; height: 130px; display: flex; align-items: center; justify-content: center; gap: 26px; background: rgba(0,0,0,.35); border-top: 3px solid var(--orange); }
.tv-foot .lab { font-size: 18px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold2); margin-right: 10px; }
.tv-foot .sponsor-tile { height: 92px; width: 230px; border-radius: 16px; }
.tv-foot .logo-text { font-size: 34px; }

/* ---------- Contest ---------- */
.tvc { display: grid; grid-template-columns: 760px 1fr; gap: 50px; height: 100%; }
.tv-timer { border-radius: 36px; background: rgba(255,255,255,.05); border: 3px solid rgba(255,255,255,.1); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; }
.tv-timer .phase { font-family: var(--display); font-size: 84px; text-transform: uppercase; color: var(--gold2); line-height: 1; letter-spacing: .03em; }
.tv-timer .clock { font-family: var(--display); font-size: 330px; line-height: 1; font-variant-numeric: tabular-nums; margin: 10px 0; }
.tv-timer .sub { font-size: 30px; font-weight: 700; opacity: .8; }
.tv-timer .bar { width: 80%; height: 22px; margin-top: 20px; }
.tv-timer.eating { border-color: var(--orange); box-shadow: 0 0 80px color-mix(in srgb, var(--orange) 45%, transparent) inset; }
.tv-timer.eating .phase { color: var(--orange2); animation: tvshake .5s infinite; }
.tv-timer.chewing { border-color: var(--gold); }
.tv-timer.chewing .clock { color: var(--gold); }
.tv-timer.done .clock { color: var(--orange2); }
.tv-timer.final10 .clock { color: var(--red); animation: tvbeat 1s infinite; }
@keyframes tvshake { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg) scale(1.04); } }
@keyframes tvbeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.06); } }

.tv-lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-auto-rows: 1fr; height: 100%; }
.tv-lb li { display: flex; align-items: center; gap: 22px; background: rgba(255,255,255,.06); border-radius: 20px; padding: 0 26px; border: 2px solid transparent; min-height: 0; }
.tv-lb li .rk { font-family: var(--display); font-size: 50px; width: 56px; text-align: center; color: rgba(255,255,255,.55); }
.tv-lb li .avatar { width: 64px; height: 64px; font-size: 24px; }
.tv-lb li .nm { flex: 1; font-size: 38px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-lb li .nm .tag { font-size: 18px; }
.tv-lb li .ct { font-family: var(--display); font-size: 64px; font-variant-numeric: tabular-nums; min-width: 120px; text-align: right; }
.tv-lb li.first { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 38%, transparent), rgba(255,255,255,.06)); border-color: var(--gold); }
.tv-lb li.first .rk { color: var(--gold); }
.tv-lb li.bump .ct { animation: tvbump .6s ease-out; }
@keyframes tvbump { 0% { transform: scale(1.6); color: var(--gold); } 100% { transform: none; } }

.meet { display: grid; grid-template-columns: repeat(5, 1fr); gap: 26px; align-content: center; height: 100%; }
.meet .p { text-align: center; }
.meet .avatar { width: 200px; height: 200px; margin: 0 auto 12px; border: 5px solid var(--gold); font-size: 64px; }
.meet .p b { font-size: 30px; display: block; line-height: 1.1; }

.leader-flash { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 30; background: linear-gradient(135deg, var(--orange), var(--red)); padding: 30px 70px; border-radius: 30px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: flashIn 3.2s ease forwards; }
.leader-flash .k { font-family: var(--display); font-size: 50px; color: var(--gold2); text-transform: uppercase; }
.leader-flash .n { font-family: var(--display); font-size: 110px; line-height: 1; text-transform: uppercase; }
@keyframes flashIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-6deg); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(2deg); } 20% { transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.95); } }

/* Winner */
.tv-winner { display: grid; grid-template-columns: 900px 1fr; gap: 60px; height: 100%; align-items: center; position: relative; }
.tv-winner .hero { text-align: center; }
.tv-winner .hero .k { font-family: var(--display); font-size: 64px; color: var(--gold); text-transform: uppercase; letter-spacing: .04em; }
.tv-winner .hero .avatar { width: 420px; height: 420px; margin: 20px auto; border: 12px solid var(--gold); font-size: 140px; box-shadow: 0 0 120px color-mix(in srgb, var(--gold) 50%, transparent); animation: winpop 1s cubic-bezier(.2,1.4,.4,1); }
.tv-winner .hero .n { font-family: var(--display); font-size: 110px; text-transform: uppercase; line-height: 1; }
.tv-winner .hero .c { font-size: 44px; font-weight: 900; color: var(--gold2); margin-top: 10px; }
@keyframes winpop { from { transform: scale(.2) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tv-winner .tv-lb li { padding: 0 20px; }
.tv-winner .tv-lb li .nm { font-size: 30px; }
.tv-winner .tv-lb li .ct { font-size: 48px; }
.tv-winner .tv-lb li .avatar { width: 52px; height: 52px; }

/* ---------- Tournament ---------- */
.slide { position: absolute; inset: 0; animation: slideIn .8s cubic-bezier(.2,.8,.2,1); }
@keyframes slideIn { from { opacity: 0; transform: translateX(80px); } to { opacity: 1; transform: none; } }
.slide h2 { font-family: var(--display); font-weight: 400; font-size: 64px; text-transform: uppercase; margin: 0 0 20px; letter-spacing: .02em; }
.slide h2 span { color: var(--orange2); }
.tv-table { width: 100%; border-collapse: separate; border-spacing: 0 10px; font-size: 36px; }
.tv-table th { font-size: 22px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold2); text-align: center; font-weight: 800; padding: 0 10px; }
.tv-table th:nth-child(2) { text-align: left; }
.tv-table td { background: rgba(255,255,255,.06); padding: 14px 18px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 800; }
.tv-table td:first-child { border-radius: 16px 0 0 16px; font-family: var(--display); color: var(--gold); width: 70px; }
.tv-table td:last-child { border-radius: 0 16px 16px 0; }
.tv-table td.tm { text-align: left; font-weight: 900; }
.tv-table td.tm small { display: block; font-size: 22px; color: rgba(255,255,255,.6); font-weight: 700; }
.tv-table td.tm img { width: 54px; height: 54px; border-radius: 10px; vertical-align: middle; margin-right: 14px; float: left; background: #fff; object-fit: contain; }
.tv-table tr.adv td:first-child { box-shadow: inset 8px 0 0 var(--orange); }
.tv-pools { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.tv-pools .tv-table { font-size: 30px; }

.tv-bracket { display: flex; gap: 60px; height: calc(100% - 100px); align-items: stretch; justify-content: center; }
.tv-bracket .rd { display: flex; flex-direction: column; justify-content: space-around; width: 440px; }
.tv-bracket .rd h4 { margin: 0; text-align: center; font-size: 26px; letter-spacing: .16em; text-transform: uppercase; color: var(--orange2); }
.tv-bracket .bg { background: rgba(255,255,255,.07); border-radius: 18px; overflow: hidden; border: 2px solid rgba(255,255,255,.12); opacity: 0; animation: bgIn .6s ease forwards; }
@keyframes bgIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.tv-bracket .sl { display: flex; justify-content: space-between; padding: 14px 20px; font-size: 32px; font-weight: 800; }
.tv-bracket .sl + .sl { border-top: 2px solid rgba(255,255,255,.1); }
.tv-bracket .sl.win { background: color-mix(in srgb, var(--gold) 35%, transparent); }
.tv-bracket .sl.tbd { color: rgba(255,255,255,.45); font-style: italic; font-weight: 600; }
.tv-bracket .sl .sc { font-family: var(--display); }
.tv-bracket .gn { font-size: 16px; color: rgba(255,255,255,.5); padding: 6px 20px 0; font-weight: 800; letter-spacing: .1em; }

.tv-next { display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; height: calc(100% - 100px); }
.tv-matchup { background: rgba(255,255,255,.06); border-radius: 30px; border: 3px solid var(--orange); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 30px; }
.tv-matchup .lbl { font-size: 28px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold2); font-weight: 800; }
.tv-matchup .tm { font-family: var(--display); font-size: 90px; text-transform: uppercase; line-height: 1.05; }
.tv-matchup .ch { font-size: 26px; color: rgba(255,255,255,.7); font-weight: 700; }
.tv-matchup .vs { font-family: var(--display); font-size: 60px; color: var(--orange2); margin: 18px 0; }
.tv-matchup img { width: 110px; height: 110px; border-radius: 18px; background: #fff; object-fit: contain; margin: 0 auto 8px; }
.tv-sched { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; align-content: start; }
.tv-sched li { background: rgba(255,255,255,.06); border-radius: 16px; padding: 16px 22px; display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; font-size: 30px; font-weight: 800; }
.tv-sched li .t { font-family: var(--display); color: var(--gold); font-size: 34px; }
.tv-sched li small { display: block; font-size: 18px; color: rgba(255,255,255,.55); letter-spacing: .1em; text-transform: uppercase; }

.tv-sponsors { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 40px; text-align: center; }
.tv-sponsors .big { display: flex; gap: 60px; align-items: center; }
.tv-sponsors .big img { height: 260px; }
.tv-sponsors .sponsor-tiles { gap: 30px; }
.tv-sponsors .sponsor-tile { height: 150px; width: 360px; border-radius: 24px; }
.tv-sponsors .logo-text { font-size: 54px; }
.tv-sponsors .k { font-size: 30px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold2); font-weight: 800; }

.tv-champ { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; position: relative; }
.tv-champ .k { font-family: var(--display); font-size: 80px; color: var(--gold); text-transform: uppercase; }
.tv-champ .n { font-family: var(--display); font-size: 190px; text-transform: uppercase; line-height: 1; animation: winpop 1s cubic-bezier(.2,1.4,.4,1); }
.tv-champ .c { font-size: 50px; font-weight: 900; color: var(--gold2); margin-top: 20px; }
.tv-champ img { width: 260px; height: 260px; border-radius: 30px; background: #fff; object-fit: contain; margin-bottom: 20px; }

/* Score pop-up */
.score-pop { position: absolute; left: 50%; top: 50%; z-index: 40; transform: translate(-50%, -50%); width: 1400px; background: linear-gradient(135deg, #0f1a33, #0b1224); border: 4px solid var(--orange); border-radius: 36px; box-shadow: 0 40px 120px rgba(0,0,0,.7); padding: 40px 60px; text-align: center; animation: popIn 7s ease forwards; }
.score-pop .k { font-size: 32px; letter-spacing: .2em; color: var(--gold2); font-weight: 900; text-transform: uppercase; }
.score-pop .row { display: grid; grid-template-columns: 1fr 200px 60px 200px 1fr; align-items: center; margin-top: 20px; }
.score-pop .tm { font-family: var(--display); font-size: 64px; text-transform: uppercase; line-height: 1.05; }
.score-pop .tm.w { color: var(--gold); }
.score-pop .s { font-family: var(--display); font-size: 160px; line-height: 1; }
.score-pop .dash { font-family: var(--display); font-size: 80px; opacity: .5; }
@keyframes popIn { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 8% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } 12% { transform: translate(-50%, -50%) scale(1); } 90% { opacity: 1; } 100% { opacity: 0; } }

.tv-dots { position: absolute; right: 50px; top: 160px; display: flex; gap: 10px; z-index: 5; }
.tv-dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,.25); }
.tv-dots i.on { background: var(--orange); }

.tv-ctl { position: fixed; right: 12px; bottom: 12px; z-index: 100; display: flex; gap: 8px; opacity: 0; transition: opacity .3s; }
body:hover .tv-ctl { opacity: 1; }
.tv-ctl button { background: rgba(0,0,0,.6); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 10px; padding: 8px 12px; font-weight: 700; cursor: pointer; }
.tv-offline { position: absolute; left: 50px; top: 150px; z-index: 50; background: var(--red); padding: 6px 14px; border-radius: 8px; font-weight: 900; font-size: 20px; }
.confetti { position: absolute; top: -20px; width: 18px; height: 28px; border-radius: 3px; animation: fall linear forwards; pointer-events: none; z-index: 45; }
@keyframes fall { to { top: 110%; transform: translateX(80px) rotate(720deg); } }
.tvc { grid-template-rows: minmax(0, 1fr); }
.tv-lb { min-height: 0; grid-template-rows: repeat(10, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); overflow: hidden; }
.tv-lb li { overflow: hidden; }
.tv-winner .tv-lb { height: 760px; }
.tv-winner .hero .avatar { width: 320px; height: 320px; font-size: 110px; margin: 14px auto; }
.tv-winner .hero .n { font-size: 92px; }
.tv-winner .hero .c { font-size: 38px; }

/* Time's-up alerts on the TV stage */
#stage .alarm { position: absolute; z-index: 60; }
#stage .alarm .t { font-size: 300px; }
#stage .alarm .s { font-size: 56px; margin-top: 20px; }
.tv-timer.chewing { animation: chewPulse 1s ease-in-out infinite; }
@keyframes chewPulse { 50% { box-shadow: 0 0 120px color-mix(in srgb, var(--gold) 55%, transparent) inset; border-color: #fff; } }
@media (prefers-reduced-motion: reduce) { .tv-timer.chewing { animation: none; } }

/* Fit fixes: long names shorten with … instead of stretching the board */
.tvc { grid-template-columns: 760px minmax(0, 1fr); }
.tv-lb { grid-template-columns: minmax(0, 1fr); }
.tv-lb li { min-width: 0; }
.tv-lb li .nm { min-width: 0; }
.tv-lb li .ct, .tv-lb li .rk, .tv-lb li .avatar { flex: none; }
.tv-winner { grid-template-columns: 900px minmax(0, 1fr); }
.tv-next > div { min-width: 0; overflow: hidden; }
.tv-sched li { min-width: 0; }
.tv-sched li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tv-dots { top: auto; bottom: 146px; right: auto; left: 50%; transform: translateX(-50%); }
.tv-dots { bottom: -17px; }
.tv-table.compact { border-spacing: 0 6px; font-size: 28px; }
.tv-table.compact td { padding: 7px 16px; }
.tv-table.compact td.tm small { font-size: 17px; }
.tv-table.compact td.tm img { width: 40px; height: 40px; }
.tv-bracket .rd { position: relative; padding-top: 56px; }
.tv-bracket .rd h4 { position: absolute; top: 0; left: 0; right: 0; }
