:root {
    --brand: #1a6b3a;
    --brand-light: #e8f5e9;
}

/* Remove number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ===================================================================
   ADMIN / GENERAL STYLES
   =================================================================== */

body {
    background: #f3f8f2;
    font-family: 'Lato', 'Segoe UI', system-ui, sans-serif;
}

.match-vs { line-height: 1.2; }

.navbar-brand { font-weight: 700; letter-spacing: .4px; }

.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.card-header { font-weight: 600; }

/* Standings */
.standings-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }
.standings-table .rank-1 td:first-child { color: #b8860b; font-weight: 700; }
.standings-table .rank-2 td:first-child { color: #808080; font-weight: 700; }
.standings-table .rank-3 td:first-child { color: #a0522d; font-weight: 700; }

/* Match card */
.match-card {
    background: #fff;
    border-radius: .5rem;
    padding: 1rem;
    margin-bottom: .75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.court-badge {
    background: var(--brand); color: #fff;
    font-size: .7rem; padding: .25em .6em; border-radius: 99px;
}
.match-vs { font-size: 1.3rem; color: #ccc; font-weight: 300; text-align: center; }
.team-name { font-weight: 600; }
.score-display { font-size: 1.5rem; font-weight: 700; }

/* Round header */
.round-header {
    background: var(--brand); color: #fff;
    border-radius: .5rem; padding: .6rem 1rem; margin-bottom: 1rem;
}

/* Bye pill */
.bye-pill {
    background: #fff3cd; border: 1px solid #ffc107;
    border-radius: 99px; padding: .3em .8em;
    font-size: .82rem; display: inline-flex; align-items: center; gap: .35em;
    margin: .2em;
}

/* Score inputs */
.score-input { width: 70px; text-align: center; font-size: 1.1rem; font-weight: 600; }

/* Tournament selector */
.tournament-selector {
    background: #fff; border-radius: .5rem;
    padding: .75rem 1rem; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Tournament name header (public TV screen) */
.pub-tournament-header {
    border-left: 4px solid var(--brand);
    padding-left: .85rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem .7rem;
}
.pub-tournament-name {
    display: inline;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 700;
    color: #0f2d17;
    line-height: 1.2;
    letter-spacing: .01em;
}

/* Shared pub card (light default) */
.pub-card { border: none; box-shadow: 0 2px 12px rgba(0,0,0,.12); }

/* Player names in standings */
.pub-player-name { font-size: 1.25rem; font-weight: 600; }
.pub-score       { font-size: 1.2rem; }
.rank-num        { font-size: 1.1rem; font-weight: 700; }


/* Player status badges */
.player-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: .72rem;
    padding: .15em .45em;
    border-radius: 99px;
    vertical-align: middle;
    margin-left: .3em;
}
.badge-playing {
    background: #d1fae5; color: #065f46;
    border: 1px solid #6ee7b7;
    animation: badge-pulse 1.8s ease-in-out infinite;
}
.badge-done {
    background: #dbeafe; color: #1e40af;
    border: 1px solid #93c5fd;
}
.badge-bye {
    background: #fef3c7; color: #92400e;
    border: 1px solid #fcd34d;
}
@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .55; }
}

/* Live dot */
@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .35; transform: scale(.75); }
}
.live-dot {
    display: inline-block;
    width: 8px; height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: live-pulse 1.4s ease-in-out infinite;
}

/* Stats breakdown table */
.stats-breakdown-table { font-size: .84rem; }
.stats-breakdown-table thead th {
    font-size: .72rem; text-transform: uppercase;
    letter-spacing: .3px; white-space: nowrap;
}
.sbd-sticky-col {
    position: sticky; left: 0; background: #fff;
    box-shadow: 2px 0 5px rgba(0,0,0,.07); z-index: 2;
    white-space: nowrap;
}
.stats-breakdown-table thead .sbd-sticky-col { background: #f8f9fa; z-index: 3; }
.sbd-match  { background: #d1fae5; color: #065f46; font-weight: 600; }
.sbd-bye    { background: #fef3c7; color: #92400e; font-weight: 600; }
.sbd-total  { background: #f1f5f9; }
.sbd-medal {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.4em; height: 1.4em;
    border-radius: 50%; font-size: .73rem; font-weight: 700;
    margin-right: .3em;
}
.sbd-gold   { background: #fef3c7; color: #b8860b; border: 1px solid #fcd34d; }
.sbd-silver { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }
.sbd-bronze { background: #fef0e6; color: #a0522d; border: 1px solid #fcd9b0; }
.sbd-legend { padding: .15em .55em; border-radius: 99px; font-size: .78rem; }


/* ===================================================================
   PUBLIC / TV DISPLAY — Light Tennis Theme
   Crisp white + grass green, optimised for TV and mobile
   =================================================================== */

.pub-body {
    background: #f0f7f2;
    font-family: 'Barlow Semi Condensed', 'Lato', sans-serif;
    min-height: 100vh;
}

/* Subtle court-grid texture */
.pub-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(26,107,58,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26,107,58,.04) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.pub-body > nav,
.pub-body > .container-xl { position: relative; z-index: 1; }

/* ── Navbar ─────────────────────────────────────────────── */

.pub-navbar {
    background: var(--brand) !important;
    border-bottom: 3px solid #a8cc2a;
    padding: .55rem 1.5rem;
}

.pub-navbar .navbar-brand {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.35rem;
    letter-spacing: .1em;
    color: #fff !important;
}

.pub-navbar .live-dot { background: rgba(255,255,255,.75); }
.pub-navbar .text-white-50 { color: rgba(255,255,255,.7) !important; }

/* ── Organizer message bar ───────────────────────────────── */

.org-message-bar {
    background: #fff3cd;
    border-bottom: 2px solid #ffc107;
    color: #664d03;
    padding: .55rem 1.2rem;
    font-size: .9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.org-message-bar i { font-size: 1rem; color: #e09800; flex-shrink: 0; }

.pub-tv .org-message-bar {
    font-size: 1.6rem;
    padding: .9rem 2rem;
    border-bottom-width: 4px;
}

/* ── Tournament selector ─────────────────────────────────── */

.pub-body .tournament-selector {
    background: #fff;
    border: 1px solid rgba(26,107,58,.15);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.pub-body .form-select {
    background-color: #fff;
    border-color: rgba(26,107,58,.2);
    color: #1e3a26;
}

.pub-body .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .2rem rgba(26,107,58,.12);
}

/* ── Tournament title / header ───────────────────────────── */

.pub-body h4.mb-0 {
    color: #0f2918;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 700;
}

.pub-body .text-muted { color: #6b8f77 !important; }

.pub-body .badge.bg-success   { background: var(--brand) !important; color: #fff !important; }
.pub-body .badge.bg-secondary { background: #6c757d !important;      color: #fff !important; }
.pub-body .badge.bg-dark      { background: #343a40 !important;      color: #fff !important; }

/* Alert */
.pub-body .alert-info {
    background: #e8f5ff;
    border-color: #90cdf4;
    color: #1a4a6e;
}

/* ── Leaderboard ─────────────────────────────────────────── */

.pub-lb {
    background: #fff;
    border-radius: .65rem;
    overflow: hidden;
    border: 1px solid rgba(26,107,58,.15);
    box-shadow: 0 2px 14px rgba(26,107,58,.09);
}

.pub-lb-head {
    background: var(--brand);
    padding: .55rem .95rem;
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: .84rem;
    letter-spacing: .22em;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.pub-lb-round {
    margin-left: auto;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: .72rem;
    font-weight: 500;
    letter-spacing: .06em;
    opacity: .82;
}

.pub-lb-row {
    display: flex;
    align-items: center;
    padding: .48rem .9rem;
    gap: .7rem;
    border-bottom: 1px solid #edf5ef;
}
.pub-lb-row:last-child { border-bottom: none; }

/* Rank row tints */
.pub-row-rank1 { background: #fffbec; }
.pub-row-rank2 { background: #f8fafb; }
.pub-row-rank3 { background: #fdf6f2; }

.pub-lb-rank {
    width: 1.65rem; height: 1.65rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Bebas Neue', sans-serif;
    font-size: .84rem;
    flex-shrink: 0;
}

.pub-lr1 { background: #f5c540; color: #1a0e00; border: none; }
.pub-lr2 { background: #8fa4b5; color: #fff;    border: none; }
.pub-lr3 { background: #c87550; color: #fff;    border: none; }
.pub-lrN { background: #e8eeec; color: #7a9e8a; border: none; font-size: .7rem; }

.pub-lb-name {
    flex: 1;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 600;
    font-size: .97rem;
    color: #0f2918;
}

.pub-lb-pts {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.25rem;
    color: var(--brand);
    letter-spacing: .02em;
    line-height: 1;
    min-width: 2.6rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pub-lb-games {
    font-size: .6rem;
    color: #9ab8a5;
    min-width: 2rem;
    text-align: center;
}

/* Status badges in pub light context — defaults are fine */

/* ── Active round hero ───────────────────────────────────── */

.pub-rnd-hero {
    background: linear-gradient(135deg, #1a6b3a 0%, #24934f 100%);
    border-radius: .65rem;
    padding: .75rem 1.2rem;
    margin-bottom: .9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(26,107,58,.22);
}

.pub-rnd-hero::before {
    content: '';
    position: absolute; right: -40px; top: -40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.1);
    pointer-events: none;
}
.pub-rnd-hero::after {
    content: '';
    position: absolute; right: 18px; top: 18px;
    width: 70px; height: 70px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.07);
    pointer-events: none;
}

.pub-rnd-hero .live-dot { background: rgba(255,255,255,.75); }

.pub-rnd-label {
    font-family: 'Bebas Neue', sans-serif;
    font-size: .7rem;
    letter-spacing: .3em;
    color: rgba(255,255,255,.6);
    display: block;
}

.pub-rnd-num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.6rem;
    color: #fff;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,.18);
}

.pub-rnd-badge {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: .64rem;
    font-weight: 600;
    padding: .34em .85em;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .1em;
    display: inline-flex;
    align-items: center;
    gap: .4em;
}

/* ── Broadcast match card ─────────────────────────────────── */

.pub-bc {
    background: #fff;
    border-radius: .65rem;
    overflow: hidden;
    border: 1px solid rgba(26,107,58,.14);
    box-shadow: 0 2px 10px rgba(26,107,58,.07);
}

.pub-bc-head {
    padding: .38rem .85rem;
    background: #f4faf6;
    border-bottom: 1px solid rgba(26,107,58,.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pub-bc-court {
    font-family: 'Bebas Neue', sans-serif;
    font-size: .78rem;
    letter-spacing: .22em;
    color: var(--brand);
}

.pub-bc-status {
    font-size: .6rem;
    color: #8aad97;
    display: flex;
    align-items: center;
    gap: .35em;
}
.pub-bc-status-ok { color: #059669; }

.pub-bc-row {
    display: flex;
    align-items: center;
    padding: .6rem .85rem;
    gap: .6rem;
    border-bottom: 1px solid #edf5ef;
}
.pub-bc-row:last-of-type { border-bottom: none; }

.pub-bc-team {
    flex: 1;
    color: #1e3a26;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

.pub-bc-score {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.1rem;
    color: var(--brand);
    line-height: 1;
    min-width: 2.4rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pub-bc-dash {
    font-size: 1.5rem;
    font-weight: 300;
    color: #cdddd3;
    min-width: 2.4rem;
    text-align: right;
}

/* Court badge in pub context */
.pub-body .court-badge { background: var(--brand); color: #fff; }

/* ── Next round preview ──────────────────────────────────── */

.pub-next {
    background: #fff;
    border: 1px solid rgba(26,107,58,.15);
    border-radius: .6rem;
    overflow: hidden;
    margin-bottom: .9rem;
}

.pub-next-head {
    background: var(--brand-light);
    border-bottom: 1px solid rgba(26,107,58,.13);
    padding: .45rem .9rem;
    font-family: 'Bebas Neue', sans-serif;
    font-size: .78rem;
    letter-spacing: .22em;
    color: var(--brand);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.pub-next-row {
    padding: .4rem .9rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: .88rem;
    font-weight: 500;
    border-bottom: 1px solid #edf5ef;
    color: #3a5e47;
}
.pub-next-row:last-child { border-bottom: none; }
.pub-next-row .fw-semibold { color: #0f2918; }
.pub-next-row .text-muted  { color: #8aad97 !important; }

/* ── Bye chips ───────────────────────────────────────────── */

.pub-bye-label { font-size: .66rem; font-weight: 600; color: #6b8f77; }

.pub-bye-chip {
    background: #fefce8;
    border: 1px solid #fde047;
    color: #713f12;
    border-radius: 99px;
    padding: .16em .6em;
    font-size: .76rem;
    font-weight: 600;
    font-family: 'Barlow Semi Condensed', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: .3em;
}

/* ── Accordion ───────────────────────────────────────────── */

.pub-body .accordion-item {
    background: #fff;
    border-color: rgba(26,107,58,.1);
}
.pub-body .accordion-button {
    background: #fff;
    color: #1e3a26;
    font-size: .9rem;
}
.pub-body .accordion-button:not(.collapsed) {
    background: var(--brand-light);
    color: var(--brand);
    box-shadow: inset 0 -1px 0 rgba(26,107,58,.12);
}
.pub-body .accordion-body {
    background: #f8fdf9;
    color: #3a5e47;
    font-size: .88rem;
}
.pub-body .accordion-body .border-bottom {
    border-color: rgba(26,107,58,.1) !important;
}
.pub-body .accordion-body .fw-bold { color: #0f2918; }

/* ── Finished tournament banner ─────────────────────────── */

.fin-card-dl {
    background: #fff;
    border: 1px solid rgba(26,107,58,.18);
    box-shadow: 0 2px 8px rgba(26,107,58,.07);
}

.fin-banner {
    background: linear-gradient(135deg, var(--brand) 0%, #24934f 100%);
    border: none;
    box-shadow: 0 3px 18px rgba(26,107,58,.22);
    min-height: 85px;
}

.pub-body .fin-banner .fw-bold.text-white {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.8rem !important;
    letter-spacing: .06em;
}

.pub-body .fin-banner .text-white-50 { color: rgba(255,255,255,.65) !important; }

/* ── Pub cards (finished state) ──────────────────────────── */

.pub-body .pub-card {
    background: #fff !important;
    border: 1px solid rgba(26,107,58,.13) !important;
    box-shadow: 0 2px 10px rgba(26,107,58,.07) !important;
}

.pub-body .pub-card .card-header {
    background: #f4faf6 !important;
    border-bottom: 1px solid rgba(26,107,58,.1) !important;
    color: var(--brand) !important;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: .14em;
    font-size: .82rem;
}

/* Standings table light */
.pub-body .standings-table th {
    background: #f4faf6;
    color: var(--brand);
    border-color: rgba(26,107,58,.1);
}
.pub-body .standings-table td {
    color: #1e3a26;
    border-color: rgba(26,107,58,.07);
}
.pub-body .pub-player-name { color: #0f2918; font-family: 'Barlow Semi Condensed', sans-serif; font-size: 1.05rem; }
.pub-body .pub-score { color: var(--brand); font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; line-height: 1; }
.pub-body .rank-num  { color: #4a6e57; font-family: 'Bebas Neue', sans-serif; }
.pub-body .standings-table .rank-1 td:first-child { color: #b8860b; }
.pub-body .standings-table .rank-2 td:first-child { color: #5c7a8f; }
.pub-body .standings-table .rank-3 td:first-child { color: #a0522d; }

/* Podium */
.pub-body .fin-pname { color: #0f2918; font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 600; }
.pub-body .fin-ppts  { color: #6b8f77; }
.fin-pb1 { background: #c9950a; height: 85px; }
.fin-pb2 { background: #5c6b7a; height: 62px; }
.fin-pb3 { background: #a05030; height: 46px; }
.fin-prank  { font-size: 1.1rem; font-weight: 800; color: rgba(255,255,255,.9); }
.fin-pblock { border-radius: .5rem .5rem 0 0; display: flex; align-items: center; justify-content: center; }
.fin-pslot  { text-align: center; flex: 1; max-width: 160px; }
.fin-pname  { font-weight: 700; font-size: .85rem; margin-bottom: .15rem; word-break: break-word; }
.fin-ppts   { font-size: .75rem; margin-bottom: .35rem; }
.fin-podium { display: flex; align-items: flex-end; justify-content: center; gap: .5rem; }
.fin-court-svg {
    position: absolute; right: 1.5rem; top: 50%;
    transform: translateY(-50%);
    opacity: .06; pointer-events: none;
}

/* Stats breakdown — light defaults work, just override sticky columns */
.pub-body .sbd-sticky-col { background: #fff; }
.pub-body .stats-breakdown-table thead .sbd-sticky-col { background: #f4faf6; }
.pub-body .stats-breakdown-table thead th {
    background: #f4faf6;
    color: var(--brand);
    border-color: rgba(26,107,58,.1);
}
.pub-body .stats-breakdown-table td { border-color: rgba(26,107,58,.07); }

/* Section history label */
.pub-body h6.fw-semibold {
    color: #6b8f77 !important;
    font-family: 'Barlow Semi Condensed', 'Lato', sans-serif;
    font-weight: 600;
    letter-spacing: .04em;
    font-size: .85rem !important;
}

/* ── TV / large screen ───────────────────────────────────── */

@media (min-width: 1280px) {
    .pub-bc-score  { font-size: 2.7rem; min-width: 3rem; }
    .pub-bc-team   { font-size: 1.15rem; }
    .pub-rnd-num   { font-size: 3.4rem; }
    .pub-lb-name   { font-size: 1.05rem; }
    .pub-lb-pts    { font-size: 1.5rem; min-width: 3rem; }
    .pub-lb-row    { padding: .58rem 1.05rem; }
    .pub-lb-rank   { width: 1.9rem; height: 1.9rem; font-size: .9rem; }
    .pub-bc-row    { padding: .7rem 1.05rem; }
    .pub-next-row  { font-size: .95rem; }
}

@media (min-width: 1920px) {
    .pub-bc-score  { font-size: 3.4rem; min-width: 3.8rem; }
    .pub-bc-team   { font-size: 1.35rem; }
    .pub-rnd-num   { font-size: 4.2rem; }
    .pub-lb-name   { font-size: 1.2rem; }
    .pub-lb-pts    { font-size: 1.85rem; min-width: 3.6rem; }
    .pub-lb-row    { padding: .7rem 1.25rem; }
    .pub-lb-rank   { width: 2.2rem; height: 2.2rem; font-size: 1.0rem; }
    .pub-bc-row    { padding: .85rem 1.25rem; }
}

/* ── Mobile ──────────────────────────────────────────────── */

@media (max-width: 768px) {
    .score-display { font-size: 1.2rem; }
    .match-vs      { font-size: 1rem; }
    .pub-bc-score  { font-size: 1.75rem; min-width: 2.1rem; }
    .pub-rnd-num   { font-size: 2.2rem; }
    .pub-lb-name   { font-size: .9rem; }
    .pub-lb-pts    { font-size: 1.1rem; }
    .pub-bc-team   { font-size: .9rem; }
    .pub-bc-row    { padding: .5rem .75rem; }
}

/* ===================================================================
   TV / PRESENTER MODE  (body.pub-tv)
   =================================================================== */

.pub-tv {
    background: #0d1f14;
    color: #e8f5e9;
}
/* ── TV fullscreen button ────────────────────────────────── */
#tv-fs-btn {
    display: none;
}
.pub-tv #tv-fs-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 1.2rem;
    right: 1.2rem;
    z-index: 9999;
    width: 2.8rem;
    height: 2.8rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 50%;
    cursor: pointer;
    color: rgba(255,255,255,.5);
    transition: background .2s, color .2s;
    padding: 0;
}
.pub-tv #tv-fs-btn:hover {
    background: rgba(255,255,255,.2);
    color: #fff;
}
.pub-tv #tv-fs-btn svg {
    width: 1.1rem;
    height: 1.1rem;
}

.pub-tv .pub-navbar,
.pub-tv .tournament-selector,
.pub-tv hr,
.pub-tv .pub-next,
.pub-tv .accordion,
.pub-tv h6,
.pub-tv .alert { display: none !important; }

.pub-tv > .container-xl { max-width: 100%; padding: 1.5rem 2rem; }
.pub-tv .row.g-4 > .tv-slide { display: none; }
.pub-tv .row.g-4 > .tv-slide.tv-active {
    display: block;
    flex: 0 0 100%;
    max-width: 100%;
    animation: tv-slide-in .5s ease;
}

/* Hide tournament header (title + badge row) in TV mode — slides are self-explanatory */
.pub-tv > .container-xl > .d-flex.flex-wrap { display: none; }

/* TV: tournament name + status + court info all on one line */
.pub-tv .pub-tournament-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    margin-bottom: 1rem !important;
}
.pub-tv .pub-tournament-name { display: inline; font-size: clamp(1.8rem, 3vw, 2.6rem); color: #ffffff; }
.pub-tv .pub-tournament-header .mt-1 { margin-top: 0 !important; }
.pub-tv .pub-tournament-header .badge { font-size: 1rem; }
.pub-tv .pub-tournament-header .text-muted.small { font-size: 1rem !important; }

@keyframes tv-slide-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* TV leaderboard: split ranking into columns of max 7 players */
.pub-tv .pub-lb-body {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}
.pub-tv .pub-lb-col {
    flex: 1 1 0;
    min-width: 0;
}
.pub-tv .pub-lb-col + .pub-lb-col {
    border-left: 1px solid rgba(255,255,255,.1);
}

/* ── Standings results animation (round just finished) ───────── */
.pub-tv .pub-lb-row { position: relative; }
/* rows being repositioned float above the rest */
.pub-tv .pub-lb-row[style*="transform"] { z-index: 5; }

/* glow on a player who gained points */
.pub-tv .pub-lb-row.lb-gain {
    background: linear-gradient(90deg, rgba(205,233,55,.22), rgba(205,233,55,.04) 60%, transparent);
    box-shadow: inset 0 0 0 1px rgba(205,233,55,.35);
}
.pub-tv .pub-lb-row.lb-gain .pub-lb-pts {
    text-shadow: 0 0 14px rgba(205,233,55,.7);
}

/* floating "+X" points pill */
.lb-pill {
    position: absolute;
    right: 1.4rem;
    top: 50%;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    line-height: 1;
    color: #0d1f14;
    background: #cde937;
    padding: .15em .5em;
    border-radius: .6rem;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
    pointer-events: none;
    z-index: 6;
    animation: lb-pill-rise 1.5s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes lb-pill-rise {
    0%   { opacity: 0; transform: translateY(-10%) scale(.6); }
    18%  { opacity: 1; transform: translateY(-50%) scale(1.12); }
    32%  { transform: translateY(-50%) scale(1); }
    78%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(-260%) scale(.95); }
}

/* ▲/▼ rank-change badge */
.lb-move {
    display: inline-flex;
    align-items: center;
    gap: .12em;
    margin-left: .5em;
    font-family: 'Bebas Neue', sans-serif;
    font-size: .95em;
    line-height: 1;
    padding: .12em .42em;
    border-radius: .5rem;
    vertical-align: middle;
    opacity: 0;
    animation: lb-move-in .45s ease forwards;
    animation-delay: .35s;
}
.lb-move.up   { color: #0d1f14; background: #cde937; }
.lb-move.down { color: #fff;    background: rgba(220,90,90,.85); }
@keyframes lb-move-in {
    from { opacity: 0; transform: translateY(.35em) scale(.7); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* persistent "+X" round-points badge, shown after the ▲/▼ indicator */
.lb-gainbadge {
    display: inline-flex;
    align-items: center;
    margin-left: .4em;
    font-family: 'Bebas Neue', sans-serif;
    font-size: .9em;
    line-height: 1;
    padding: .12em .42em;
    border-radius: .5rem;
    vertical-align: middle;
    color: #cde937;
    background: rgba(205,233,55,.14);
    box-shadow: inset 0 0 0 1px rgba(205,233,55,.4);
    opacity: 0;
    animation: lb-move-in .45s ease forwards;
    animation-delay: .35s;
}

/* Big leaderboard */
.pub-tv .pub-lb            { background: #14301d; border: 2px solid #1a6b3a; }
.pub-tv .pub-lb-head       { font-size: 1.6rem; padding: 1rem 1.4rem; background: #1a6b3a; color: #fff; }
.pub-tv .pub-lb-round      { font-size: 1.1rem; opacity: .85; }
.pub-tv .pub-lb-row        { padding: 1.1rem 1.4rem; border-color: rgba(255,255,255,.08); }
.pub-tv .pub-lb-rank       { width: 3.2rem; height: 3.2rem; font-size: 1.6rem; }
.pub-tv .pub-lb-name       { font-size: 2rem; color: #fff; }
.pub-tv .pub-lb-games      { font-size: 1.3rem; color: rgba(255,255,255,.6); }
.pub-tv .pub-lb-pts        { font-size: 2.6rem; color: #cde937; }
.pub-tv .pub-row-rank1     { background: linear-gradient(90deg, rgba(255,215,0,.18), transparent); }
.pub-tv .pub-row-rank2     { background: linear-gradient(90deg, rgba(192,192,192,.12), transparent); }
.pub-tv .pub-row-rank3     { background: linear-gradient(90deg, rgba(205,127,50,.12), transparent); }

/* Big match cards */
.pub-tv .pub-rnd-hero      { background: #14301d; border-color: #1a6b3a; padding: 1.4rem 1.8rem; margin-bottom: 1.5rem; }
.pub-tv .pub-rnd-label     { font-size: 1.4rem; color: rgba(255,255,255,.6); }
.pub-tv .pub-rnd-num       { font-size: 4rem; color: #cde937; }
.pub-tv .pub-rnd-badge     { font-size: 1.1rem; }
.pub-tv .pub-bc            { background: #14301d; border: 2px solid #1a6b3a; }
.pub-tv .pub-bc-head       { background: #1a6b3a; color: #fff; padding: .8rem 1.2rem; font-size: 1.2rem; }
.pub-tv .pub-bc-row        { padding: 1.2rem 1.4rem; border-color: rgba(255,255,255,.1); }
.pub-tv .pub-bc-team       { font-size: 1.85rem; color: #fff; }
.pub-tv .pub-bc-score      { font-size: 5rem; min-width: 4rem; color: #cde937; }
.pub-tv .pub-bc-dash       { font-size: 4rem; color: rgba(255,255,255,.3); }
.pub-tv .pub-bye-label     { color: rgba(255,255,255,.7); font-size: 1.5rem; }
.pub-tv .pub-bye-chip      { background: #1a6b3a; color: #fff; font-size: 1.45rem; padding: .5rem 1.15rem; }

/* Large TVs */
@media (min-width: 1920px) {
    .pub-tv .pub-bc-score  { font-size: 7rem; }
    .pub-tv .pub-lb-name   { font-size: 2.6rem; }
    .pub-tv .pub-lb-pts    { font-size: 3.4rem; }
    .pub-tv .pub-bc-team   { font-size: 2.4rem; }
}

/* ── TV slide: Results board (blue theme, shown during break) ── */

.tv-results-board {
    background: linear-gradient(135deg, #0d1f3c 0%, #163261 100%);
    border: 2px solid #3b82f6;
    border-radius: 1rem;
    color: #fff;
    min-height: 75vh;
    display: flex;
    flex-direction: column;
    padding: 2rem 2.5rem;
}
.tv-results-eyebrow {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1rem;
    letter-spacing: .35em;
    color: #93c5fd;
    margin-bottom: .3rem;
}
.tv-results-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.5rem;
    letter-spacing: .1em;
    color: #fff;
    line-height: 1;
    margin-bottom: 1.8rem;
}
.tv-results-list { display: flex; flex-direction: column; gap: .75rem; flex: 1; }
.tv-results-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(59,130,246,.25);
    border-radius: .75rem;
    padding: .9rem 1.4rem;
}
.tv-results-team {
    flex: 1;
    font-size: 1.3rem;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    gap: .3em;
    align-items: center;
}
.tv-results-team--right { justify-content: flex-end; text-align: right; }
.tv-results-score {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.5rem;
    display: flex;
    align-items: center;
    gap: .15em;
    min-width: 6rem;
    justify-content: center;
    flex-shrink: 0;
}
.tv-results-colon { color: rgba(255,255,255,.4); }
.tv-results-win   { color: #60a5fa; }
.tv-results-bye   { color: rgba(255,255,255,.5); font-size: 1rem; padding: .5rem 0; }

@media (min-width: 1920px) {
    .tv-results-title  { font-size: 5rem; }
    .tv-results-team   { font-size: 1.8rem; }
    .tv-results-score  { font-size: 5rem; min-width: 8rem; }
}

/* ── TV slide: Next round lineup board (amber theme, distinctly different) ── */

.tv-next-board {
    background: linear-gradient(135deg, #3a2008 0%, #5c2e0a 100%);
    border: 2px solid #f59e0b;
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    padding: 1.8rem 2.2rem;
    box-shadow: 0 0 40px rgba(245,158,11,.15);
}
.tv-next-board::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom,
            transparent 49.5%, rgba(255,255,255,.07) 49.5%,
            rgba(255,255,255,.07) 50.5%, transparent 50.5%),
        linear-gradient(to right,
            transparent 9%, rgba(255,255,255,.04) 9%, rgba(255,255,255,.04) 9.4%, transparent 9.4%,
            transparent 90.6%, rgba(255,255,255,.04) 90.6%, rgba(255,255,255,.04) 91%, transparent 91%);
    pointer-events: none;
    border-radius: 12px;
}

.tv-tennis-ball-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: .9rem;
}
.tv-tennis-ball-svg {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,.5));
    animation: tv-ball-bounce .75s cubic-bezier(.33,0,.66,1) infinite alternate;
}
@keyframes tv-ball-bounce {
    from { transform: translateY(0)    scaleX(1)    scaleY(1); }
    to   { transform: translateY(-14px) scaleX(.95) scaleY(1.05); }
}

.tv-next-header { text-align: center; margin-bottom: 1.6rem; }
.tv-next-eyebrow {
    display: inline-block;
    background: #f59e0b;
    color: #1a0f02;
    font-weight: 700;
    letter-spacing: .25em;
    font-size: .95rem;
    padding: .35rem 1.2rem;
    border-radius: 999px;
    margin-bottom: .8rem;
}
.tv-next-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 3.4rem;
    color: #fff;
    line-height: 1;
    letter-spacing: .04em;
}
.tv-next-num     { color: #fbbf24; margin-left: .3rem; }
.tv-next-sub     { color: rgba(255,255,255,.55); font-size: 1.05rem; margin-top: .4rem; }

.tv-next-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}
.tv-next-item {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    align-items: center;
    gap: 1.4rem;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(245,158,11,.3);
    border-radius: 10px;
    padding: 1rem 1.4rem;
}
.tv-next-court {
    width: 4.5rem; height: 4.5rem;
    border-radius: 50%;
    background: #f59e0b;
    color: #1a0f02;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.6rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(245,158,11,.4);
}
.tv-next-pair {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    color: #fff;
}
.tv-next-team {
    font-size: 2.1rem;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .5rem;
}
.tv-next-amp { color: #fbbf24; font-weight: 400; opacity: .8; }
.tv-next-vs {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4rem;
    color: #fbbf24;
    background: rgba(245,158,11,.12);
    border: 1px solid rgba(245,158,11,.4);
    border-radius: 999px;
    padding: .15rem .9rem;
    letter-spacing: .15em;
}

.tv-next-byes {
    margin-top: 1.4rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(245,158,11,.35);
    color: rgba(255,255,255,.75);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}
.tv-next-byes-label { color: #fbbf24; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .95rem; margin-right: .4rem; }
.tv-next-byes-name  { color: #fff; }
.tv-next-byes-sep   { color: rgba(255,255,255,.4); margin: 0 .4rem; }

@media (max-width: 575px) {
    .tv-next-board { padding: 1.2rem 1rem; }
    .tv-next-title { font-size: 2.4rem; }
    .tv-next-sub   { font-size: .9rem; }
    .tv-next-item  {
        grid-template-columns: 3rem 1fr;
        gap: .8rem;
        padding: .75rem 1rem;
    }
    .tv-next-court {
        width: 3rem; height: 3rem;
        font-size: 1.8rem;
    }
    .tv-next-pair {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: .35rem;
        justify-items: center;
    }
    .tv-next-vs { font-size: 1rem; padding: .1rem .6rem; }
    .tv-next-team { font-size: 1.1rem; }
}

@media (min-width: 576px) and (max-width: 767px) {
    .tv-next-title { font-size: 2.8rem; }
    .tv-next-item  { grid-template-columns: 3.5rem 1fr; gap: 1rem; }
    .tv-next-court { width: 3.5rem; height: 3.5rem; font-size: 2rem; }
    .tv-next-team  { font-size: 1.3rem; }
}

@media (min-width: 1920px) {
    .tv-next-title { font-size: 4.8rem; }
    .tv-next-team  { font-size: 2.9rem; }
    .tv-next-court { width: 6rem; height: 6rem; font-size: 3.4rem; }
    .tv-next-vs    { font-size: 1.8rem; padding: .25rem 1.2rem; }
}

/* ── TV finished screen ──────────────────────────────────────────────────── */

.tv-fin-wrap {
    position: relative;
    min-height: 94vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1.6rem;
    padding: 1rem 1rem 2rem;
    overflow: hidden;
}
.tv-fin-hero { text-align: center; position: relative; z-index: 1; }
.tv-fin-eyebrow {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    letter-spacing: .3em;
    color: rgba(255,255,255,.5);
    margin-bottom: .6rem;
}
.tv-fin-trophy-ico {
    font-size: 5rem;
    line-height: 1.15;
    animation: tv-fin-pulse 2.2s ease-in-out infinite;
}
@keyframes tv-fin-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.08); }
}
.tv-fin-winner {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 5.5rem;
    color: #fbbf24;
    line-height: 1;
    letter-spacing: .04em;
    text-shadow: 0 4px 32px rgba(251,191,36,.45);
}
.tv-fin-winpts {
    color: rgba(255,255,255,.5);
    font-size: 1.25rem;
    margin-top: .4rem;
}

/* Podium */
.tv-fin-podium-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}
.tv-fin-pslot  { text-align: center; width: 180px; }
.tv-fin-pname  {
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: .2rem;
    word-break: break-word;
}
.tv-fin-p1 .tv-fin-pname { font-size: 1.6rem; color: #fbbf24; }
.tv-fin-ppts   { font-size: .95rem; color: rgba(255,255,255,.55); margin-bottom: .4rem; }
.tv-fin-pblock { border-radius: .5rem .5rem 0 0; display: flex; align-items: center; justify-content: center; }
.tv-fin-pb1    { background: #c9950a; height: 110px; }
.tv-fin-pb2    { background: #5c6b7a; height: 80px; }
.tv-fin-pb3    { background: #a05030; height: 58px; }
.tv-fin-prank  { font-size: 2.2rem; font-weight: 800; color: rgba(255,255,255,.92); }

/* Remaining standings */
.tv-fin-standings-rest {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .6rem;
    justify-content: center;
    max-width: 960px;
    position: relative;
    z-index: 1;
}
.tv-fin-srow {
    display: flex;
    align-items: center;
    gap: .7rem;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    padding: .5rem 1rem;
    min-width: 230px;
}
.tv-fin-srank { font-family: 'Bebas Neue', sans-serif; font-size: 1.65rem; color: rgba(255,255,255,.4); width: 1.8rem; }
.tv-fin-sname { font-size: 1.5rem; color: #fff; flex: 1; }
.tv-fin-spts  { font-family: 'Bebas Neue', sans-serif; font-size: 1.75rem; color: #c5e03a; }

/* Confetti */
.tv-fin-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.tv-fin-piece {
    position: absolute;
    top: -20px;
    width: 9px;
    height: 13px;
    border-radius: 2px;
    left: calc(var(--i, 1) * 2.7%);
    animation: tv-fin-fall linear infinite;
    animation-duration: calc(4s + var(--i, 1) * 0.22s);
    animation-delay: calc(var(--i, 1) * 0.18s - 2s);
}
.tv-fin-piece-1 { background: #fbbf24; }
.tv-fin-piece-2 { background: #c5e03a; }
.tv-fin-piece-3 { background: #60a5fa; }
.tv-fin-piece-4 { background: #f472b6; }
.tv-fin-piece-5 { background: #a78bfa; }
.tv-fin-piece-6 { background: #34d399; }
@keyframes tv-fin-fall {
    0%   { transform: translateY(-30px) rotate(0deg);   opacity: .9; }
    85%  { opacity: .9; }
    100% { transform: translateY(105vh) rotate(600deg); opacity: 0; }
}
