:root{
    --tv-bg:#f2f4f9;
    --tv-surface:#ffffff;
    --tv-surface-soft:#f4f6fb;
    --tv-surface-muted:#edf1f7;
    --tv-border:#e6ebf3;
    --tv-text:#7f8793;
    --tv-text-strong:#1f2c44;
    --tv-text-muted:#b0b6c0;
    --tv-shadow:0 16px 36px rgba(136,149,171,.12);
}

html,
body{
    margin:0;
    padding:0;
    width:1920px;
    height:1080px;
    overflow:hidden;
    font-family:"Segoe UI",Arial,sans-serif;
    color:var(--tv-text-strong);
    background:var(--tv-bg);
}

body{
    display:grid;
    grid-template-rows:96px 1fr 70px;
    gap:18px;
    padding:16px;
    box-sizing:border-box;
}

body.scoreboard-page--with-ticker{
    grid-template-rows:78px 1fr 60px;
    gap:12px;
    padding:10px 8px 8px;
}

body.scoreboard-page--no-ticker{
    grid-template-rows:96px 1fr;
    gap:14px;
}

.tv-header{
    display:grid;
    grid-template-columns:1fr auto 1fr;
    align-items:center;
    padding:0 24px;
    background:var(--tv-surface);
    border-radius:24px;
    box-shadow:var(--tv-shadow);
}

body.scoreboard-page--with-ticker .tv-header{
    padding:0 20px;
    border-radius:20px;
}

.tv-header__left,
.tv-header__right{
    display:flex;
    align-items:center;
    gap:12px;
}

.tv-header__left{
    justify-self:start;
}

.tv-header__right{
    justify-self:end;
}

.tv-header__center{
    display:flex;
    align-items:center;
    justify-self:center;
    gap:18px;
}

.tv-header__logo{
    height:64px;
    object-fit:contain;
}

body.scoreboard-page--with-ticker .tv-header__logo{
    height:56px;
}

.tv-header__title{
    font-size:42px;
    font-weight:900;
    color:#111d36;
    white-space:nowrap;
}

body.scoreboard-page--with-ticker .tv-header__title{
    font-size:30px;
}

.tv-header__link{
    color:#111d36;
    font-size:24px;
    font-weight:700;
    text-decoration:none;
}

.scoreboard{
    min-height:0;
}

.scoreboard__grid{
    width:100%;
    height:100%;
    min-height:0;
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    grid-template-rows:repeat(2, minmax(0, 1fr));
    gap:32px 30px;
    padding:6px 4px 12px;
    box-sizing:border-box;
    align-items:stretch;
}

body.scoreboard-page--with-ticker .scoreboard__grid{
    gap:16px 16px;
    padding:2px 4px 2px;
}

body.scoreboard-page--no-ticker .scoreboard__grid{
    gap:24px 24px;
    padding:4px 2px 4px;
}

.scoreboard__card{
    min-height:0;
    padding:18px 20px 28px;
    border-radius:24px;
    background:var(--tv-surface);
    box-shadow:var(--tv-shadow);
    display:flex;
    flex-direction:column;
    overflow:hidden;
    align-self:stretch;
    border:1px solid rgba(230,235,243,.92);
    backdrop-filter:blur(6px);
    transition:opacity .25s ease, filter .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.scoreboard__card--hidden{
    display:none;
}

.scoreboard__card--playing{
    opacity:1;
    filter:none;
    border-color:rgba(214,223,236,.96);
    box-shadow:0 18px 38px rgba(136,149,171,.16);
}

.scoreboard__card--warmup{
    opacity:.9;
    filter:saturate(.92);
}

.scoreboard__card--queued,
.scoreboard__card--finished{
    opacity:.72;
    filter:saturate(.82);
}

.scoreboard__header{
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto auto;
    gap:18px;
    align-items:center;
    padding-bottom:14px;
    border-bottom:1px solid var(--tv-border);
}

.scoreboard__court{
    display:flex;
    align-items:center;
    gap:14px;
    min-width:0;
}

.scoreboard__qr{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:4px;
    flex:0 0 auto;
}

.scoreboard__qr-image{
    width:82px;
    height:82px;
    object-fit:contain;
    padding:6px;
    border-radius:14px;
    background:#ffffff;
    box-shadow:0 6px 16px rgba(136,149,171,.14);
}

.scoreboard__qr-label{
    font-size:10px;
    font-weight:700;
    color:#b2b9c4;
}

.scoreboard__court-name{
    font-size:26px;
    font-weight:500;
    color:#9da4b0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.scoreboard__status{
    display:flex;
    justify-content:center;
}

.scoreboard__badge{
    padding:10px 24px;
    border-radius:999px;
    font-size:15px;
    font-weight:800;
    text-transform:uppercase;
    white-space:nowrap;
    background:#d3d8e0;
    color:#ffffff;
}

.scoreboard__badge--live{
    background:#cddcf8;
    color:#4f78d0;
}

.scoreboard__badge--finished{
    background:#cfd4db;
    color:#ffffff;
}

.scoreboard__badge--queue{
    background:#dbe3f1;
    color:#6b7fa6;
}

.scoreboard__badge--warmup{
    background:#f5deae;
    color:#9d6a00;
}

.scoreboard__set-label{
    justify-self:end;
    font-size:19px;
    font-weight:500;
    letter-spacing:.04em;
    color:#b0b6c0;
}

.scoreboard__player{
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap:16px;
    align-items:center;
    padding:14px 0;
    border-bottom:1px solid var(--tv-border);
}

.scoreboard__player-name{
    display:grid;
    grid-template-rows:repeat(2, minmax(0, auto));
    gap:6px;
    min-width:0;
    min-height:74px;
    align-content:center;
}

.scoreboard__player-name--single{
    display:flex;
    align-items:center;
}

.scoreboard__player-name--winner .scoreboard__player-line span{
    font-weight:800;
    color:#4b5563;
}

.scoreboard__player-line{
    display:grid;
    grid-template-columns:14px minmax(0, 1fr);
    align-items:start;
    gap:8px;
    min-width:0;
    min-height:30px;
}

.scoreboard__player-line span{
    display:block;
    min-width:0;
    font-size:25px;
    font-weight:600;
    line-height:1.12;
    color:#777f8d;
    white-space:normal;
    overflow-wrap:anywhere;
}

.scoreboard__serve-ball{
    width:14px;
    height:14px;
    margin-top:10px;
    flex:0 0 14px;
    visibility:hidden;
}

.scoreboard__serve-ball--active{
    visibility:visible;
}

.scoreboard__score{
    display:flex;
    align-items:center;
    gap:12px;
    flex:0 0 auto;
}

.scoreboard__game-points{
    width:50px;
    height:50px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    font-size:22px;
    font-weight:800;
    background:#d8dde6;
    color:#6d7581;
}

.scoreboard__game-points--hidden{
    display:none;
}

.scoreboard__sets{
    display:flex;
    gap:10px;
}

.scoreboard__set{
    width:58px;
    height:66px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:14px;
    font-size:34px;
    font-weight:800;
    background:#d8dde6;
    color:#6d7581;
}

.scoreboard__set--win{
    background:#cfd4db;
    color:#666f7d;
}

.scoreboard__set--empty{
    background:#eff2f7;
    color:#b9bec7;
}

.scoreboard__footer{
    margin-top:auto;
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap:12px;
    align-items:end;
    padding:8px 6px 0;
}

.scoreboard__footer-meta{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    min-width:0;
}

.scoreboard__category,
.scoreboard__stage,
.scoreboard__umpire,
.scoreboard__time{
    display:inline-flex;
    align-items:center;
    min-height:36px;
    margin-bottom:4px;
    padding:7px 11px;
    border-radius:14px;
    background:var(--tv-surface-soft);
    color:#9ca3af;
    font-size:20px;
    font-weight:600;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.scoreboard__category{
    max-width:100%;
}

.scoreboard__stage{
    max-width:100%;
}

.scoreboard__umpire{
    max-width:100%;
}

.scoreboard__time{
    min-width:88px;
    justify-content:center;
}

.ticker{
    background:#101828;
    display:flex;
    align-items:center;
    overflow:hidden;
    height:70px;
    padding:0 20px;
    border-radius:20px;
    box-shadow:0 14px 30px rgba(16,24,40,.26);
}

body.scoreboard-page--with-ticker .ticker{
    height:60px;
    border-radius:16px;
}

.ticker__text{
    white-space:nowrap;
    font-size:34px;
    font-weight:600;
    color:#f8fafc;
    display:inline-block;
    transform:translateX(200vw);
    animation:tickerMove linear infinite;
}

@keyframes tickerMove{
    from{ transform:translateX(200vw); }
    to{ transform:translateX(-100%); }
}
