/* --------------------------------------------------------------------------
   TORNEOS (val-tournaments.php)
   --------------------------------------------------------------------------
   UI de calendario/resultados/equipos. Datos de ejemplo por ahora; la
   estructura esta pensada para mapear con PandaScore mas adelante.
   -------------------------------------------------------------------------- */

.tourn-body { background: var(--bg-dark); min-height: 100vh; }

.tourn-main {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: var(--sp-11) var(--sp-9) 80px;
}

/* ── Cabecera ─────────────────────────────────────────────────────── */
.tourn-header { margin-bottom: 28px; }
.tourn-header h1 {
    font-size: var(--fs-4xl);
    font-weight: var(--fw-extrabold);
    color: var(--text-white);
    margin-bottom: var(--sp-2);
}
.tourn-header h1 span { color: var(--brand-accent); }
.tourn-subtitle { font-size: var(--fs-md); color: var(--text-muted); }

/* ── Filtros: tabs + selector ─────────────────────────────────────── */
.tourn-filters {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-9);
    flex-wrap: wrap;
}

/* Las pestañas de torneos usan el componente unificado .seg .seg--accent
   (components/buttons.css); el markup lleva tourn-tab solo como hook de JS.
   Ya no hay estilos de boton duplicados aqui. */

.tourn-league { margin-left: auto; }

/* ── Layout 66 / 34 ───────────────────────────────────────────────── */
.tourn-layout { display: flex; gap: var(--sp-7); align-items: flex-start; }
.tourn-col-main { flex: 0 0 66%; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-5); }
.tourn-col-side { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-7); }

/* ── Etiqueta de dia ──────────────────────────────────────────────── */
.tourn-daylabel {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: var(--ls-md);
    color: var(--text-muted);
    margin: var(--sp-3) 0 2px;
}
.tourn-daylabel-live { color: var(--brand-accent); }

/* ── Tarjeta de partido ───────────────────────────────────────────── */
.tourn-match {
    /* superficie (fondo, borde, radio) = .card (components/cards.css) */
    padding: var(--sp-5) var(--sp-6);
    margin-bottom: var(--sp-3);
    transition: border-color var(--t-fast);
}
.tourn-match-live { border-color: color-mix(in srgb, var(--valorant-red) 40%, transparent); }

.tourn-match-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-4);
}
.tourn-match-league { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-gray); }

.tourn-live-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    font-size: var(--fs-3xs);
    font-weight: var(--fw-extrabold);
    color: var(--brand-accent);
    letter-spacing: var(--ls-sm);
}
.tourn-live-dot {
    width: 7px; height: 7px;
    border-radius: var(--radius-circle);
    background: var(--brand-accent);
    animation: tourn-pulse 1.4s ease-in-out infinite;
}
@keyframes tourn-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.tourn-match-body { display: flex; align-items: center; justify-content: space-between; }

.tourn-team { display: flex; align-items: center; gap: var(--sp-4); flex: 1; min-width: 0; }
.tourn-team-right { justify-content: flex-end; }
.tourn-team-name {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tourn-team-logo {
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-extrabold);
    color: var(--text-gray);
    overflow: hidden;
}
.tourn-team-logo img {
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 3px;
    box-sizing: border-box;
}
.tourn-empty { color: var(--text-gray); font-size: var(--fs-md); padding: var(--sp-7) 2px; }
.tourn-score-ff { gap: var(--sp-2); }
.tourn-ff-badge { font-size: var(--fs-3xs); font-weight: var(--fw-bold); color: var(--text-gray);
    background: var(--tint-3); padding: 1px var(--sp-2); border-radius: var(--radius-xs); letter-spacing: var(--ls-sm); }

/* Roster desplegable por equipo */
.tourn-team-toggle { cursor: pointer; border-radius: var(--radius-sm); }
.tourn-team-toggle:hover { background: rgba(255,255,255,.04); }
.tourn-team-chev { margin-left: auto; color: var(--text-gray); transition: transform var(--t-fast); }
.tourn-team-toggle.open .tourn-team-chev { transform: rotate(180deg); }
.tourn-roster { padding: var(--sp-2) 0 var(--sp-3) var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-2); }
.tourn-pl { display: flex; align-items: center; gap: var(--sp-4); }
.tourn-pl-av { position: relative; flex-shrink: 0; width: 34px; height: 34px; }
.tourn-pl-img { display: block; width: 34px; height: 34px; border-radius: var(--radius-circle, 50%); object-fit: cover; background: var(--bg-input); flex-shrink: 0; }
.tourn-pl-img-ph { background: var(--bg-input); }
.tourn-pl-info { display: flex; flex-direction: column; min-width: 0; }
.tourn-pl-name { color: var(--text-white); font-size: var(--fs-md); font-weight: var(--fw-bold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tourn-pl-flag { position: absolute; right: -3px; bottom: -1px; width: 16px; height: 12px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 2px var(--bg-surface, #151515); }
.tourn-pl-role { font-size: var(--fs-2xs); color: var(--text-gray); text-transform: uppercase; letter-spacing: var(--ls-sm); }
.tourn-pl-loading { color: var(--text-gray); font-size: var(--fs-sm); padding: var(--sp-1) 0; }

/* Marcador (en vivo / resultado) */
.tourn-score {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    font-size: var(--fs-3xl);
    font-weight: var(--fw-extrabold);
    color: var(--text-white);
    padding: 0 var(--sp-6);
}
.tourn-score-sep { color: var(--text-muted); font-size: var(--fs-lg); }
.tourn-score-win { color: var(--green); }

/* Hora (proximo partido) */
.tourn-time { text-align: center; min-width: 76px; padding: 0 var(--sp-5); }
.tourn-time-val { font-size: var(--fs-lg); font-weight: var(--fw-extrabold); color: var(--text-white); }
.tourn-time-bo { font-size: var(--fs-3xs); color: var(--text-muted); }

/* ── Paneles laterales ────────────────────────────────────────────── */
.tourn-panel-title {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-card-title);
    font-weight: var(--fw-extrabold);
    letter-spacing: var(--ls-xs);
    color: var(--text-white);
    /* Titulo estilo widget: linea separadora a sangre (padding lateral --sp-7). */
    border-bottom: 1px solid var(--border);
    padding: 0 var(--sp-7) var(--sp-4);
    margin: 0 calc(-1 * var(--sp-7)) var(--sp-5);
}
.tourn-panel-title svg { color: var(--brand-accent); }
.tourn-panel-divider { height: 1px; background: var(--border); margin: 0;}

.tourn-event-name { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--text-white); }
.tourn-event-meta { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }

.tourn-rank-row { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-2) 0; }

.tourn-rank-row .tourn-team-logo { width: 30px; height: 30px; font-size: var(--fs-3xs); }
.tourn-rank-name { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-white); }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .tourn-layout { flex-direction: column; }
    .tourn-col-main, .tourn-col-side { flex: 1 1 auto; width: 100%; }
}

/* --------------------------------------------------------------------------
   VSHELL — Tournaments con el rediseño estilo Vercel (body.vshell)
   Partidos como filas dentro de un panel (dia = franja), 2/3 – 1/3 con los
   paneles de contexto a la derecha; "en directo" = barra roja fina.
   -------------------------------------------------------------------------- */
.vshell.tourn-body { background: var(--bg-dark); }
.vshell .tourn-header { margin-bottom: var(--sp-9); }
.vshell .tourn-filters { margin-bottom: var(--sp-8); }
.vshell .tourn-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--sp-9); }
.vshell .tourn-col-main { flex: none; gap: 0; }
.vshell .tourn-col-side { gap: var(--sp-9); }

/* Lista de partidos */
.vshell .tourn-panel-tab { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); overflow: hidden; }
.vshell .tourn-daylabel {
    margin: 0; padding: var(--sp-4) var(--sp-7) var(--sp-3);
    background: rgba(255,255,255,.02); border-bottom: 1px solid var(--border-subtle);
    font-size: var(--fs-sm); font-weight: var(--fw-semibold); letter-spacing: 0; text-transform: none; color: var(--text-white);
}
.vshell .tourn-daylabel-live { color: var(--brand-accent); }
.vshell .tourn-match {
    margin: 0; padding: var(--sp-4) var(--sp-7);
    border: 0; border-bottom: 1px solid var(--border-subtle); border-radius: 0;
}
.vshell .tourn-panel-tab > .tourn-match:last-child { border-bottom: 0; }
.vshell .tourn-match:hover { background: rgba(255,255,255,.02); }
.vshell .tourn-match-live { box-shadow: inset 2px 0 0 var(--brand-accent); }
.vshell .tourn-match-top { margin-bottom: var(--sp-3); }
.vshell .tourn-team-logo { background: none; border: 1px solid var(--border-subtle); }
.vshell .tourn-score { font-size: var(--fs-2xl); }
.vshell .tourn-panel-tab > .tourn-empty { padding: var(--sp-9) var(--sp-7); }

/* Paneles de la derecha: titulo = cabecera del panel */
.vshell .tourn-col-side .card { padding: 0 var(--sp-7) var(--sp-5); }
.vshell .tourn-panel-title {
    min-height: 48px; padding: 0 var(--sp-7); margin: 0 calc(-1 * var(--sp-7)) var(--sp-4);
    border-bottom-color: var(--border-subtle);
    font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: 0;
}
.vshell .tourn-panel-divider { background: var(--border-subtle); margin: var(--sp-4) 0; }
@media (max-width: 1000px) { .vshell .tourn-layout { grid-template-columns: 1fr; } }
