/* =========================================================================
   NDBSA Community & Club Knockouts — Executive Stylesheet (Zero Emojis)
   ========================================================================= */
.ko-view-tabs {
    display: inline-flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    gap: 4px;
    margin-bottom: 22px;
}
.ko-view-tab {
    border: none;
    background: transparent;
    color: #475569;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 9px 18px;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.16s ease;
}
.ko-view-tab.active {
    background: #0c3b2e;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(12, 59, 46, 0.22);
}
.ko-tab-count {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #d4af37;
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 800;
}

.ko-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.ko-filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.ko-filter-pill {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}
.ko-filter-pill.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.ko-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s ease, background 0.15s ease;
}
.ko-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ko-btn-primary { background: #16a34a; color: #ffffff; }
.ko-btn-primary:hover { background: #15803d; }
.ko-btn-dark { background: #0f172a; color: #ffffff; }
.ko-btn-dark:hover { background: #1e293b; }
.ko-btn-gold { background: #d4af37; color: #0f172a; }
.ko-btn-gold:hover { background: #c49f28; }
.ko-btn-outline { background: #ffffff; color: #334155; border-color: #cbd5e1; }
.ko-btn-outline:hover { background: #f8fafc; }
.ko-btn-ghost { background: rgba(255,255,255,0.12); color: #ffffff; border-color: rgba(255,255,255,0.25); }
.ko-btn-ghost:hover { background: rgba(255,255,255,0.2); }
.ko-btn-danger { background: #b91c1c; color: #ffffff; }
.ko-btn-danger:hover { background: #991b1b; }
.ko-btn-sm { padding: 6px 12px; font-size: 0.78rem; }

.ko-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.ko-pill-slate { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.ko-pill-green { background: #dcfce7; color: #166534; }
.ko-pill-amber { background: #fef3c7; color: #92400e; }
.ko-pill-gold  { background: #fef9c3; color: #854d0e; border: 1px solid #eab308; }
.ko-pill-dark  { background: #0f172a; color: #ffffff; }

.ko-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.ko-status-open   { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.ko-status-active { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.ko-status-done   { background: #e2e8f0; color: #334155; border: 1px solid #cbd5e1; }

.ko-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
    gap: 18px;
}

.ko-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: 3px solid #0c3b2e;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ko-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.ko-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ko-code-tag {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    background: #f8fafc;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid #e2e8f0;
}
.ko-card-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}
.ko-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.84rem;
    color: #475569;
}
.ko-card-sub {
    font-size: 0.8rem;
    color: #64748b;
}
.ko-card-actions {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.ko-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 46px 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
}
.ko-empty h4 { margin: 0 0 6px 0; color: #0f172a; font-size: 1.1rem; }
.ko-empty p  { margin: 0; font-size: 0.9rem; }

/* Detail Header & Money Ledger */
.ko-detail-header {
    background: linear-gradient(135deg, #071e16 0%, #0c3b2e 60%, #124b3a 100%);
    color: #ffffff;
    padding: 22px 24px;
    border-radius: 14px;
    border-bottom: 4px solid #d4af37;
    margin-bottom: 16px;
}
.ko-ledger-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    background: #fffdf7;
    border: 1px solid #ecd078;
    border-left: 4px solid #d4af37;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
}
.ko-ledger-item span {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 2px;
}
.ko-ledger-item strong {
    font-size: 1.05rem;
    color: #0f172a;
}
.ko-ledger-payinfo {
    grid-column: 1 / -1;
    padding-top: 8px;
    border-top: 1px solid #f1e6b8;
    font-size: 0.84rem;
    color: #334155;
}

.ko-banner-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.ko-champ-banner, .ko-hb-banner {
    flex: 1 1 220px;
    padding: 14px 18px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ko-champ-banner {
    background: #0c3b2e;
    color: #ffffff;
    border: 1px solid #d4af37;
}
.ko-hb-banner {
    background: #0f172a;
    color: #ffffff;
    border: 1px solid #334155;
}
.ko-banner-kicker {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fde68a;
    font-weight: 800;
}
.ko-champ-banner strong, .ko-hb-banner strong {
    font-size: 1.35rem;
}

/* Open Sign-Up Pool Grid */
.ko-pool-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
}
.ko-pool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}
.ko-pool-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 11px 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Live Bracket Tree */
.ko-bracket-notice {
    font-size: 0.84rem;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.ko-bracket-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
}
.ko-bracket-grid {
    display: flex;
    gap: 24px;
    min-width: max-content;
    align-items: stretch;
}
.ko-round-col {
    width: 248px;
    display: flex;
    flex-direction: column;
}
.ko-round-head {
    background: #0f172a;
    color: #ffffff;
    padding: 9px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
    border-bottom: 2px solid #d4af37;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ko-round-head strong { font-size: 0.88rem; }
.ko-round-head span   { font-size: 0.72rem; color: #cbd5e1; }

.ko-round-matches {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 14px;
}
.ko-match-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #64748b;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.ko-match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
    border-color: #0c3b2e;
}
.ko-match-card.is-done { border-left-color: #d4af37; }
.ko-match-card.is-mine { border-left-color: #16a34a; box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18); }

.ko-match-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    font-size: 0.84rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 8px;
}
.ko-match-row:last-child { border-bottom: none; }
.ko-match-row.is-winner { background: #f0fdf4; font-weight: 800; color: #0c3b2e; }
.ko-match-row.is-bye    { color: #94a3b8; font-style: italic; background: #f8fafc; }

.ko-match-player {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    flex: 1;
}
.ko-player-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ko-hcp-pill {
    font-size: 0.68rem;
    font-weight: 800;
    background: #e2e8f0;
    color: #334155;
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}
.ko-brk-tag {
    font-size: 0.66rem;
    font-weight: 800;
    background: #fef9c3;
    color: #854d0e;
    padding: 1px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}
.ko-match-score {
    min-width: 28px;
    text-align: right;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

/* Modals */
.ko-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    z-index: 9995;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}
.ko-modal-box {
    background: #ffffff;
    border-radius: 14px;
    max-width: 560px;
    width: 100%;
    padding: 24px;
    position: relative;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
    max-height: 92vh;
    overflow-y: auto;
}
.ko-modal-wide { max-width: 780px; }
.ko-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.55rem;
    cursor: pointer;
    color: #64748b;
    line-height: 1;
}
.ko-field { margin-bottom: 12px; min-width: 0; }
.ko-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 4px;
}
.ko-field input, .ko-field select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: block;
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    background: #ffffff;
    color: #0f172a;
}
.ko-field input[type="date"],
.ko-field input[type="datetime-local"] {
    -webkit-appearance: none;
    appearance: none;
    min-height: 43px;
    text-align: left;
}
.ko-mf-row input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px !important;
}
.ko-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    margin: 12px 0 16px 0;
}
.ko-contact-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 12px;
    font-size: 0.86rem;
    line-height: 1.5;
}
.ko-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.ko-table th {
    background: #0f172a;
    color: #ffffff;
    text-align: left;
    padding: 8px 9px;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ko-table td {
    padding: 8px 9px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

/* =========================================================================
   1-Tap Bo1 Quick Winner Controls (Match Modal)
   ========================================================================= */
.ko-bo1-quick-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    padding: 12px;
}
.ko-bo1-quick-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
    margin-bottom: 8px;
}
.ko-bo1-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.ko-bo1-btn {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid #0c3b2e;
    background: #ffffff;
    color: #0c3b2e;
    font-weight: 800;
    font-size: 0.86rem;
    cursor: pointer;
    text-align: center;
    transition: background 0.14s ease, color 0.14s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ko-bo1-btn:hover {
    background: #0c3b2e;
    color: #ffffff;
}
@media (max-width: 480px) {
    .ko-bo1-quick-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   Desktop Dual-Bracket View (Outside TV Mode)
   ========================================================================= */
.ko-dual-desktop {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
@media (min-width: 1360px) {
    .ko-dual-desktop {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        align-items: start;
    }
}
.ko-dual-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #0f172a;
    color: #ffffff;
    border-radius: 9px 9px 0 0;
    border-bottom: 2px solid #c9a227;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.ko-dual-section-head span.ko-dual-sub {
    font-size: 0.74rem;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: none;
    letter-spacing: 0;
}
.ko-dual-panel .ko-bracket-scroll {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
}

/* =========================================================================
   Template Manager & Regulars Quick-Tick Chips
   ========================================================================= */
.ko-tpl-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    margin-bottom: 16px;
}
.ko-tpl-bar-group {
    flex: 1 1 220px;
    min-width: 0;
}
.ko-tpl-bar-group label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
    margin-bottom: 5px;
}
.ko-tpl-bar select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    background: #ffffff;
    color: #0f172a;
}
.ko-reg-panel {
    margin-bottom: 12px;
    padding: 11px 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}
.ko-reg-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.ko-reg-head strong {
    font-size: 0.8rem;
    color: #0f172a;
}
.ko-reg-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ko-reg-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.ko-reg-chip:hover {
    border-color: #0c3b2e;
    color: #0c3b2e;
}
.ko-reg-chip.is-selected {
    background: #0c3b2e;
    border-color: #0c3b2e;
    color: #ffffff;
}
.ko-reg-chip .ko-reg-hcp {
    font-size: 0.7rem;
    opacity: 0.82;
    font-weight: 700;
}

/* =========================================================================
   CLUB TV / FULLSCREEN DUAL-BRACKET BROADCAST VIEW
   Fits both Winners + Losers brackets cleanly on a single 1080p screen
   with an optional slim live-table strip pinned along the bottom.
   ========================================================================= */
body.ko-tv-mode {
    background: #071812 !important;
    color: #f8fafc;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
}
body.ko-tv-mode header,
body.ko-tv-mode nav,
body.ko-tv-mode .navbar,
body.ko-tv-mode .site-header,
body.ko-tv-mode footer,
body.ko-tv-mode #ndbsaPwaTabBar,
body.ko-tv-mode .ndbsa-install-strip,
body.ko-tv-mode .tourney-Hero-bar,
body.ko-tv-mode #tourneyOfficialPane,
body.ko-tv-mode .tourney-page-wrap > .ko-view-tabs,
body.ko-tv-mode .ko-toolbar {
    display: none !important;
}
body.ko-tv-mode main.container,
body.ko-tv-mode .page-content,
body.ko-tv-mode .tourney-page-wrap {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}
body.ko-tv-mode #tourneyKnockoutsPane,
body.ko-tv-mode #koDetailViewWrap,
body.ko-tv-mode #koDetailContent {
    display: block !important;
    width: 100%;
    height: 100dvh;
}

.ko-tv-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    background: #071812;
    color: #f8fafc;
    box-sizing: border-box;
    overflow: hidden;
}

/* Slim Broadcast Top Bar */
.ko-tv-topbar {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    background: #05120d;
    border-bottom: 1px solid rgba(201, 162, 39, 0.32);
}
.ko-tv-title-group {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
    flex-wrap: wrap;
}
.ko-tv-title {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ko-tv-meta {
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}
.ko-tv-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.ko-tv-stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 5px;
    background: rgba(201, 162, 39, 0.14);
    border: 1px solid rgba(201, 162, 39, 0.35);
    color: #fde68a;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}
.ko-tv-pin-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(201, 162, 39, 0.45);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.ko-tv-pin-chip strong {
    color: #fde68a;
    font-weight: 900;
    letter-spacing: 0.12em;
}
.ko-tv-qr-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 8px 3px 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.ko-tv-qr-pill img {
    width: 40px;
    height: 40px;
    display: block;
    background: #ffffff;
    padding: 2px;
    border-radius: 4px;
    image-rendering: pixelated;
}
.ko-tv-qr-pill span {
    font-size: 0.66rem;
    font-weight: 700;
    color: #cbd5e1;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ko-tv-clock {
    font-size: 0.84rem;
    font-weight: 700;
    color: #cbd5e1;
    font-variant-numeric: tabular-nums;
    padding: 4px 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}
.ko-tv-live-ind {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #86efac;
}
.ko-tv-live-ind::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
}
.ko-tv-exit-btn {
    padding: 5px 11px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
}
.ko-tv-exit-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

/* Main Broadcast Dual-Bracket Stage */
.ko-tv-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 16px;
    box-sizing: border-box;
    overflow: auto;
}
.ko-tv-stage.has-dual {
    grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
}
.ko-tv-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    overflow: hidden;
}
.ko-tv-pane-head {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    background: rgba(5, 18, 13, 0.85);
    border-bottom: 1px solid rgba(201, 162, 39, 0.28);
}
.ko-tv-pane-head.is-crowned {
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.22) 0%, rgba(12, 59, 46, 0.92) 55%, rgba(5, 18, 13, 0.92) 100%);
    border-bottom: 2px solid #d4af37;
}
.ko-tv-pane-champ {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #86efac;
    white-space: nowrap;
}
.ko-tv-pane-head.is-crowned .ko-tv-pane-champ {
    color: #fde68a;
    font-weight: 800;
}
.ko-tv-pane-title {
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fde68a;
}
.ko-tv-pane-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 10px;
    overflow: auto;
    display: flex;
}
.ko-tv-pane .ko-bracket-grid {
    display: flex;
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: 100%;
    align-items: stretch;
}
.ko-tv-pane .ko-round-col {
    flex: 1 1 0;
    width: auto;
    min-width: 136px;
    display: flex;
    flex-direction: column;
}
.ko-tv-pane .ko-round-head {
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 2px solid #c9a227;
    padding: 5px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}
.ko-tv-pane .ko-round-head strong {
    font-size: 0.74rem;
    font-weight: 800;
    color: #f8fafc;
}
.ko-tv-pane .ko-round-head span {
    font-size: 0.66rem;
    color: #94a3b8;
}
.ko-tv-pane .ko-round-matches {
    gap: 6px;
}
.ko-tv-pane .ko-match-card {
    background: #0d2219;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 3px solid #475569;
    border-radius: 6px;
    box-shadow: none;
}
.ko-tv-pane .ko-match-card:hover {
    transform: none;
    border-color: rgba(201, 162, 39, 0.65);
    box-shadow: none;
}
.ko-tv-pane .ko-match-card.is-done {
    border-left-color: #c9a227;
}
.ko-tv-pane .ko-match-card.is-ready {
    border-left-color: #22c55e;
}
.ko-tv-pane .ko-match-row {
    padding: 5px 8px;
    font-size: 0.78rem;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ko-tv-pane .ko-match-row.is-winner {
    background: rgba(34, 197, 94, 0.16);
    color: #ffffff;
    font-weight: 800;
}
.ko-tv-pane .ko-match-row.is-bye {
    background: rgba(255, 255, 255, 0.02);
    color: #64748b;
}
.ko-tv-pane .ko-match-score {
    color: #fde68a;
    font-size: 0.78rem;
    min-width: 22px;
}
.ko-tv-pane .ko-hcp-pill {
    background: rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    font-size: 0.64rem;
    padding: 1px 4px;
}
.ko-tv-pane .ko-brk-tag {
    background: rgba(201, 162, 39, 0.22);
    color: #fde68a;
    font-size: 0.62rem;
    padding: 1px 4px;
}

/* Auto-Density for 17-32 Player Draws so 16 Round-1 cards fit on 1080p */
.ko-tv-shell.ko-tv-dense .ko-tv-pane-body { padding: 7px 8px; }
.ko-tv-shell.ko-tv-dense .ko-tv-pane .ko-bracket-grid { gap: 7px; }
.ko-tv-shell.ko-tv-dense .ko-tv-pane .ko-round-col { min-width: 118px; }
.ko-tv-shell.ko-tv-dense .ko-tv-pane .ko-round-head { padding: 4px 7px; margin-bottom: 5px; }
.ko-tv-shell.ko-tv-dense .ko-tv-pane .ko-round-matches { gap: 4px; }
.ko-tv-shell.ko-tv-dense .ko-tv-pane .ko-match-row { padding: 3px 6px; font-size: 0.72rem; line-height: 1.2; }
.ko-tv-shell.ko-tv-dense .ko-tv-pane .ko-match-score { font-size: 0.72rem; }

/* Slim Bottom Live Table Scores Strip */
.ko-tv-live-strip {
    flex: 0 0 auto;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #04110c;
    border-top: 1px solid rgba(201, 162, 39, 0.34);
    overflow-x: auto;
}
.ko-tv-live-strip.has-live {
    display: flex;
}
.ko-tv-strip-label {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #fde68a;
    padding-right: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
}
.ko-tv-strip-label::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
}
.ko-tv-strip-items {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}
.ko-tv-strip-card {
    flex: 1 1 240px;
    max-width: 440px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 12px;
    background: rgba(13, 34, 25, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    font-size: 0.8rem;
    white-space: nowrap;
    min-width: 0;
}
.ko-tv-strip-tbl {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    flex-shrink: 0;
}
.ko-tv-strip-match {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: center;
}
.ko-tv-strip-p {
    color: #cbd5e1;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 115px;
}
.ko-tv-strip-p.is-striker {
    color: #ffffff;
    font-weight: 800;
}
.ko-tv-strip-pts {
    font-weight: 900;
    color: #fde68a;
    font-variant-numeric: tabular-nums;
    font-size: 0.88rem;
    flex-shrink: 0;
}
.ko-tv-strip-meta {
    font-size: 0.7rem;
    font-weight: 700;
    color: #86efac;
    flex-shrink: 0;
}

@media (max-width: 1279px) {
    body.ko-tv-mode { overflow: auto; }
    .ko-tv-shell { height: auto; min-height: 100dvh; overflow: visible; }
    .ko-tv-stage.has-dual { grid-template-columns: minmax(0, 1fr); }
    .ko-tv-pane { min-height: 360px; }
    .ko-tv-live-strip { position: sticky; bottom: 0; z-index: 40; }
}

/* =========================================================================
   GRAND FINAL CHAMPION BROADCAST FLARE (Winners & Losers Finals)
   ========================================================================= */
.ko-champ-flare-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10080;
    pointer-events: none;
}
.ko-champ-flare-overlay {
    position: fixed;
    inset: 0;
    z-index: 10085;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 15, 11, 0.56);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: koFlareFadeIn 0.35s ease forwards;
    cursor: pointer;
}
.ko-champ-flare-card {
    position: relative;
    overflow: hidden;
    max-width: 520px;
    width: 100%;
    padding: 28px 32px 24px 32px;
    border-radius: 14px;
    background: linear-gradient(155deg, #0b2d21 0%, #061812 100%);
    border: 1.5px solid rgba(212, 175, 55, 0.72);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 175, 55, 0.18) inset;
    text-align: center;
    color: #ffffff;
    animation: koFlareCardIn 0.42s cubic-bezier(0.2, 0.85, 0.25, 1) forwards;
}
.ko-champ-flare-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(253, 230, 138, 0.14) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: koFlareSweep 1.6s ease 0.25s forwards;
    pointer-events: none;
}
.ko-champ-flare-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px auto;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.14);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: #fde68a;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ko-champ-flare-kicker {
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #fde68a;
    margin-bottom: 6px;
}
.ko-champ-flare-name {
    font-size: clamp(1.6rem, 3.6vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.015em;
    color: #ffffff;
    line-height: 1.15;
    margin-bottom: 8px;
}
.ko-champ-flare-sub {
    font-size: 0.88rem;
    color: #cbd5e1;
    font-weight: 500;
}
.ko-champ-flare-hint {
    margin-top: 16px;
    font-size: 0.72rem;
    color: #94a3b8;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
@keyframes koFlareFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes koFlareCardIn {
    from { opacity: 0; transform: translateY(14px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes koFlareSweep {
    from { transform: translateX(-120%); }
    to { transform: translateX(120%); }
}
