:root {
    --bg: #0a1e1c;
    --bg-alt: #0f2725;
    --panel: #123330;
    --panel-2: #163c38;
    --line: #25514c;
    --teal: #2e9e8f;
    --teal-soft: #7fc6bb;
    --lime: #c9e265;
    --violet: #8a6fdf;
    --live: #e4572e;
    --text: #f2f3ee;
    --text-dim: #9cb6b0;
    --radius: 10px;
    --pad: clamp(16px, 5vw, 40px);
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
}
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(46, 158, 143, 0.2), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, rgba(138, 111, 223, 0.14), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: "Barlow Semi Condensed", sans-serif;
    -webkit-font-smoothing: antialiased;
}
.display {
    font-family: "Teko", sans-serif;
    font-weight: 600;
    letter-spacing: 0.01em;
}
a {
    color: inherit;
}
:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 2px;
}
button {
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.mesh {
    background-image:
        repeating-linear-gradient(45deg, rgba(242, 243, 238, 0.05) 0 1px, transparent 1px 20px),
        repeating-linear-gradient(-45deg, rgba(242, 243, 238, 0.05) 0 1px, transparent 1px 20px);
}
.mesh-band {
    height: 22px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px var(--pad);
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(10, 30, 28, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
}
.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "Teko", sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.brand .mark {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 3px rgba(201, 226, 101, 0.18);
    flex-shrink: 0;
}
.brand .org {
    color: var(--text-dim);
    font-size: 13px;
    font-family: "Barlow Semi Condensed", sans-serif;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}
.topbar .chip {
    font-size: 13px;
    padding: 6px 11px;
}

header.hero {
    padding: 28px var(--pad) 32px;
    border-bottom: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}
.eyebrow {
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--lime);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.eyebrow::before {
    content: "";
    width: 20px;
    height: 2px;
    background: var(--lime);
    display: inline-block;
    flex-shrink: 0;
}
h1.title {
    font-size: clamp(42px, 13vw, 108px);
    line-height: 0.92;
    margin: 12px 0 0;
    color: var(--text);
}
h1.title span {
    color: var(--teal-soft);
}
.hero-sub {
    max-width: 620px;
    margin-top: 14px;
    font-size: 17px;
    color: var(--text-dim);
    font-weight: 500;
}
.hero-meta {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
}
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.court-chumbito .dot {
    background: var(--teal);
}
.court-ponja .dot {
    background: var(--lime);
}
.court-central .dot {
    background: var(--violet);
}

.section {
    padding: 40px var(--pad);
}
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.section-head h2 {
    font-size: clamp(28px, 7vw, 44px);
    margin: 0;
    font-family: "Teko", sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-head p {
    margin: 0;
    color: var(--text-dim);
    font-size: 15px;
    max-width: 420px;
}
.live-pulse {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 0 rgba(228, 87, 46, 0.6);
    animation: pulse 1.6s infinite;
    flex-shrink: 0;
}
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(228, 87, 46, 0.55);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(228, 87, 46, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(228, 87, 46, 0);
    }
}
@media (prefers-reduced-motion: reduce) {
    .live-pulse,
    .rec-dot,
    .grain {
        animation: none;
    }
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 26px 18px;
    color: var(--text-dim);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

.live-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
.match-card {
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    position: relative;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease;
}
.match-card:hover {
    border-color: var(--teal);
}
.match-card .row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.badge-live {
    /*display: inline-flex;*/
    display: none;
    align-items: center;
    gap: 7px;
    background: rgba(228, 87, 46, 0.14);
    color: var(--live);
    border: 1px solid rgba(228, 87, 46, 0.4);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
}
.badge-live .live-pulse {
    width: 7px;
    height: 7px;
}
.badge-sched {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 700;
    border: 1px solid var(--line);
    padding: 4px 10px;
    border-radius: 999px;
}
.badge-finished {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--teal-soft);
    font-weight: 700;
    border: 1px solid var(--teal-soft);
    padding: 4px 10px;
    border-radius: 999px;
}
.badge-pending {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 700;
    border: 1px dashed var(--line);
    padding: 4px 10px;
    border-radius: 999px;
}
.team-tbd {
    color: var(--text-dim);
    font-style: italic;
    font-weight: 500;
}
.fixture-date-heading {
    font-family: "Teko", sans-serif;
    font-size: 26px;
    letter-spacing: 0.04em;
    color: var(--lime);
    text-transform: uppercase;
    margin: 28px 0 14px;
}
.fixture-date-heading:first-child {
    margin-top: 0;
}
.court-tag {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}
.teams {
    margin: 4px 0 14px;
}
.team-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 17px;
    font-weight: 600;
}
.team-line:last-child {
    border-bottom: none;
}
.team-line.winning {
    color: var(--lime);
}
.score-nums {
    display: flex;
    gap: 6px;
    font-family: "Teko", sans-serif;
    font-size: 23px;
    font-weight: 600;
    flex-shrink: 0;
}
.score-nums .set {
    min-width: 22px;
    text-align: center;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
}
.score-nums .set.set-won {
    background: rgba(201, 226, 101, 0.18);
    color: var(--lime);
}
.score-nums .set.set-lost {
    background: rgba(228, 87, 46, 0.13);
    color: rgba(228, 87, 46, 0.85);
}
.score-nums .game {
    min-width: 30px;
    text-align: center;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 600;
    flex-wrap: wrap;
}
.cam-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(46, 158, 143, 0.14);
    color: var(--teal-soft);
    border: 1px solid rgba(46, 158, 143, 0.45);
    padding: 10px 15px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    min-height: 40px;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}

/* Botón para abrir modal de cámara */
.btn-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(228, 87, 46, 0.12);
    color: white;
    border: 1px solid rgba(228, 87, 46, 0.28);
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    margin-top: 20px;
}

/* Botón "VER EN VIVO" de las cámaras fijas por cancha — más notable */
.btn-cam-live {
    width: 100%;
    justify-content: center;
    background: var(--live);
    color: #fff;
    border-color: var(--live);
    padding: 12px 16px;
    font-size: 15px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 4px 16px rgba(228, 87, 46, 0.35);
}
.btn-cam-live:hover {
    filter: brightness(1.08);
}
.btn-cam-live .live-pulse {
    background: #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
}

/* Tanteador en vivo (dentro del cuadro fijo de cámara por cancha) */
.overlay-loading {
    color: var(--text-dim);
    font-size: 14px;
    margin: 4px 0 14px;
}
.overlay-meta {
    color: var(--text-dim);
    font-size: 12px;
    margin: 4px 0 10px;
}
.overlay-teams {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}
.overlay-team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid transparent;
}
.overlay-team-row.serving {
    border-left-color: var(--lime);
    background: rgba(201, 226, 101, 0.08);
}
.overlay-team-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}
.overlay-ball {
    color: var(--lime);
    font-size: 12px;
    flex-shrink: 0;
}
.overlay-team-score {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.overlay-set-box {
    min-width: 28px;
    text-align: center;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    font-family: "Teko", sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.overlay-points-box {
    min-width: 34px;
    text-align: center;
    padding: 4px 9px;
    margin-left: 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    font-family: "Teko", sans-serif;
    font-size: 21px;
    font-weight: 700;
    color: var(--teal-soft);
}
.overlay-team-row.serving .overlay-points-box {
    background: var(--lime);
    color: var(--bg);
}

/* Modal overlay y caja */
.cam-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 120;
}
.cam-modal {
    width: min(1100px, 95%);
    max-width: 1100px;
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    position: relative;
}
.cam-modal-body {
    width: 100%;
}
.cam-modal-close {
    position: absolute;
    right: 18px;
    top: 12px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.cam-btn:hover,
.cam-btn:active {
    background: var(--teal);
    color: #08201c;
}
.cam-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.bracket-wrap {
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}
.bracket-hint {
    font-size: 13px;
    color: var(--text-dim);
    margin: 10px 2px 0;
}
.bracket {
    display: flex;
    gap: 44px;
    min-width: 900px;
    padding: 10px 4px 16px;
}
.round {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 230px;
}
.round-label {
    flex: 0 0 auto;
    font-family: "Teko", sans-serif;
    font-size: 21px;
    color: var(--lime);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.round-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.round-body > .pair,
.round-body > .slot {
    flex: 1;
    min-height: 0;
}
.pair {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
}
.pair > .slot {
    flex: 1;
    min-height: 0;
}
.pair::before {
    content: "";
    position: absolute;
    top: 25%;
    bottom: 25%;
    left: calc(100% + 18px);
    width: 1px;
    background: var(--line);
}
.pair::after {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(100% + 18px);
    width: 18px;
    height: 1px;
    background: var(--line);
}
.round:last-child .pair::before,
.round:last-child .pair::after,
.round:last-child .slot::after {
    display: none;
}
.slot {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.slot::after {
    content: "";
    position: absolute;
    right: -18px;
    top: 50%;
    width: 18px;
    height: 1px;
    background: var(--line);
}
.bmatch {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 15px;
}
.bmatch .bteam {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}
.bmatch .bteam-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bmatch .bteam:last-child {
    border-bottom: none;
}
.bmatch .bteam.win {
    color: var(--lime);
}
.bmatch .bteam .pts {
    color: var(--text-dim);
    font-family: "Teko", sans-serif;
    font-size: 18px;
}
.bmatch.tbd .bteam {
    color: var(--text-dim);
    font-style: italic;
    font-weight: 500;
}
.bmeta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 6px;
    display: flex;
    gap: 8px;
    align-items: center;
}

footer {
    padding: 26px var(--pad) calc(40px + var(--safe-b));
    color: var(--text-dim);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Bracket tabs ────────────────────────────────────────────── */
.bracket-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.bracket-tab {
    padding: 8px 20px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    font-family: "Barlow Semi Condensed", sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}
.bracket-tab:hover {
    border-color: var(--teal);
    color: var(--text);
}
.bracket-tab.active {
    background: var(--teal);
    border-color: var(--teal);
    color: #08201c;
}

/* ── Puntos del bracket — sets individuales con color ─────── */
.pts-group {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}
.pts-set {
    font-family: "Teko", sans-serif;
    font-size: 17px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
}
.pts-set.win-set {
    background: rgba(201, 226, 101, 0.18);
    color: var(--lime);
}
.pts-set.lose-set {
    background: rgba(228, 87, 46, 0.13);
    color: rgba(228, 87, 46, 0.75);
}
.pts-live {
    font-family: "Teko", sans-serif;
    font-size: 14px;
    color: var(--live);
    font-weight: 600;
}
.pts-paused {
    font-family: "Teko", sans-serif;
    font-size: 14px;
    color: var(--text-dim);
    font-weight: 600;
}

/* ── Cámara inline con overlay ───────────────────────────── */
.match-card.has-cam {
    padding-bottom: 12px;
}
.cam-slot {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
}
.cam-inline {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}
.cam-inline video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
/*
 * El contenido real de olplayer es un gráfico fijo de 480×~150px anclado
 * arriba-a-la-izquierda de su propia página (ver ol.esquinaimagen.net.ar/olplayer):
 * no es responsive al tamaño del iframe. Por eso el iframe se renderiza SIEMPRE
 * a su tamaño real (480×200, con margen para el badge de tie-break) y se
 * escala entero con transform — así nunca se recorta, solo cambia de tamaño
 * visual. transform-origin en la esquina inferior-izquierda para que quede
 * anclado ahí sin importar la escala.
 */
.overlay-iframe {
    position: absolute;
    left: 5px;
    bottom: -15px;
    width: 480px;
    height: 200px;
    border: none;
    background: transparent;
    pointer-events: none;
    z-index: 2;
    transform-origin: 0% 100%;
    transform: scale(0.44);
    will-change: transform;
}

/* Fullscreen: entra el wrapper completo (video + overlay), no el <video>
   solo, para que el overlay se siga viendo arriba del video en fullscreen. */
.cam-inline:fullscreen,
.cam-inline:-webkit-full-screen,
.cam-inline:-moz-full-screen,
.cam-inline:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
    aspect-ratio: unset;
    border-radius: 0;
}

.cam-icon-btn {
    position: absolute;
    top: 10px;
    z-index: 4;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    line-height: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    cursor: pointer;
    pointer-events: auto;
}
.cam-icon-btn svg {
    display: block;
}
.cam-icon-btn img {
    display: block;
    filter: invert(1); /* el ícono en assets/ es negro; se invierte a blanco para el botón oscuro */
}
.cam-icon-btn:hover {
    background: rgba(0, 0, 0, 0.72);
}
.cam-play-btn {
    left: 10px;
}
.cam-fs-btn {
    right: 10px;
}

/* ── Media queries ───────────────────────────────────────── */
@media (min-width: 700px) {
    .topbar {
        padding: 20px var(--pad);
    }
    .brand {
        font-size: 22px;
    }
    .brand .mark {
        width: 22px;
        height: 22px;
    }
    .brand .org {
        font-size: 15px;
    }
    header.hero {
        padding: 30px var(--pad) 40px;
    }
    .hero-sub {
        font-size: 19px;
    }
    .section {
        padding: 52px var(--pad);
    }
    .live-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 18px;
    }
    .bracket-hint {
        display: none;
    }
    footer {
        flex-direction: row;
        justify-content: space-between;
    }

    .overlay-iframe {
        left: 10px;
        bottom: -20px;
        transform: scale(0.65);
    }
}

#live-section {
    padding-top: 0px;
}
