/* Plantilla de equipo — integrada con el sistema visual de CitySports */

.plantilla-content {
    padding-top: 10px;
}

.plantilla-grupo {
    overflow: hidden;
    margin: 8px 0 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.plantilla-grupo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 14px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.plantilla-grupo-title {
    display: flex;
    align-items: center;
    gap: 9px;
}

.plantilla-grupo-title h2 {
    margin: 0;
    color: #202124;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 600;
}

.plantilla-grupo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #f1f3f5;
    color: #667085;
    font-size: 13px;
}

.plantilla-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border-radius: 13px;
    background: #f1f3f5;
    color: #344054;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.plantilla-jugador {
    display: flex;
    align-items: center;
    min-height: 68px;
    padding: 8px 13px;
    color: inherit;
    text-decoration: none;
}

.plantilla-jugador + .plantilla-jugador {
    border-top: 1px solid #eee;
}

.jugador-foto {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    overflow: hidden;
    border-radius: 20%;
    background: #ffffff;
}

.jugador-foto img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
}

.jugador-foto-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #98a2b3;
    font-size: 15px;
}

.jugador-datos {
    min-width: 0;
    flex: 1;
    margin-left: 11px;
}

.jugador-nombre {
    overflow: hidden;
    color: #202124;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.jugador-nacimiento {
    margin-top: 3px;
    color: #8a8a8a;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 400;
}

.plantilla-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 8px 0 16px;
    padding: 38px 20px;
    border-radius: 14px;
    background: #fff;
    color: #8a8a8a;
    text-align: center;
}

.plantilla-empty i {
    margin-bottom: 10px;
    font-size: 25px;
}

.plantilla-empty strong {
    color: #454b52;
    font-size: 14px;
    font-weight: 600;
}

.plantilla-empty span {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.4;
}

@media (min-width: 481px) {
    .plantilla-jugador {
        min-height: 72px;
        padding-right: 16px;
        padding-left: 16px;
    }

    .jugador-foto {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }
}


/* Tarjeta independiente para el Director Técnico */
.plantilla-grupo-dt { margin-top: 8px; }
.plantilla-grupo-dt .plantilla-grupo-icon { background: #eaf2ff; color: #206bc4; }
.plantilla-grupo-dt .plantilla-count { min-width: 34px; border-radius: 8px; background: #eaf2ff; color: #206bc4; font-size: 11px; font-weight: 700; }

/* =========================================================
   SPA EQUIPO — encabezado, navegación y paneles
   Se carga mediante css/frontend/equipo.css.
   ========================================================= */
.team-app {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background: #eef1f4;
    color: #202124;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    overflow-x: clip;
}

.team-app-header {
    position: relative;
    isolation: isolate;
    padding: 10px 14px 18px;
    color: #fff;
    background: #4e9eaa;
    overflow: hidden;
}

.team-app-header::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    opacity: .22;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(255,255,255,.9) 1px, transparent 1.5px),
        radial-gradient(circle at 24px 18px, transparent 0 3px, rgba(255,255,255,.65) 3.5px 4.5px, transparent 5px);
    background-size: 7px 7px, 48px 42px;
    pointer-events: none;
}

.team-app-header-top {
    display: flex;
    align-items: center;
    min-height: 38px;
    gap: 12px;
}

.team-app-back {
    display: inline-flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: flex-start;
    min-width: 40px;
    min-height: 44px;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
}

.team-app-back svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.team-app-header-spacer { flex: 1 1 auto; }

.team-app-tournament-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 15px;
    border-radius: 22px;
    color: #27343a;
    background: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.team-app-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 17px 2px 0;
}

.team-app-crest {
    display: flex;
    flex: 0 0 96px;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    /* Agranda el escudo hacia arriba sin aumentar la altura del encabezado. */
    margin-top: -30px;
    margin-bottom: -30px;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255,255,255,.96);
    color: #4e9eaa;
    box-shadow: 0 1px 5px rgba(20,40,50,.12);
    font-size: 27px;
    font-weight: 800;
}

.team-app-crest img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 4px;
    object-fit: contain;
}

.team-app-identity-text { min-width: 0; }
.team-app-identity-text h1 {
    margin: 0;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: clamp(22px, 5.5vw, 29px);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -.5px;
}
.team-app-identity-text p {
    margin: 5px 0 0;
    color: rgba(255,255,255,.92);
    font-size: 14px;
    line-height: 1.35;
}
.team-app-identity-text small {
    display: block;
    margin-top: 3px;
    color: rgba(255,255,255,.78);
    font-size: 11px;
    line-height: 1.35;
}

.team-app-tabs {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    min-height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #fff;
    border-bottom: 1px solid #e2e5e8;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.team-app-tabs::-webkit-scrollbar { display: none; }
.team-app-tabs a {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 94px;
    min-height: 44px;
    padding: 0 15px;
    color: #718096;
    text-decoration: none;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
}
.team-app-tabs a.active { color: #263746; }
.team-app-tabs a.active::after {
    position: absolute;
    right: 18px;
    bottom: 0;
    left: 18px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: #4e9eaa;
    content: "";
}

.team-app-content,
.team-app .matches-content {
    min-height: 55vh;
    padding: 14px 8px 30px;
    background: #eee;
}
.team-tab-panel { margin-bottom: 14px; }
.team-summary-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 17px;
    border: 1px solid #e8eaed;
    border-radius: 15px;
    background: #fff;
}
.team-profile-logo {
    display: flex;
    flex: 0 0 68px;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    overflow: hidden;
    border-radius: 12px;
    background: #f3f5f6;
}
.team-profile-logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.team-profile-info { min-width: 0; }
.team-profile-info h1 { margin: 0; font-size: 19px; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.team-profile-tournament, .team-profile-group { margin-top: 4px; color: #667085; font-size: 12px; line-height: 1.4; }
.team-profile-group { font-weight: 600; }

.team-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    margin: 0 0 14px;
}
.team-stat {
    min-width: 0;
    padding: 13px 3px 11px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    text-align: center;
}
.team-stat strong { display: block; color: #202124; font-size: 20px; line-height: 1.2; font-weight: 750; font-variant-numeric: tabular-nums; }
.team-stat span { display: block; margin-top: 4px; color: #7b8794; font-size: 10px; font-weight: 700; }
.team-role { min-width: 0; }
.team-role > .matchday-title { margin: 3px 3px 12px; font-size: 16px; font-weight: 700; }
.team-phase-title { margin: 17px 4px 8px; color: #667085; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.team-empty { padding: 28px 15px; border-radius: 13px; background: #fff; color: #667085; text-align: center; font-size: 13px; }

/* Ajustes del componente Plantilla dentro de la SPA del equipo. */
.team-app .plantilla-content { padding-top: 0; }
.team-app .plantilla-grupo { margin: 0 0 13px; border: 0; border-radius: 14px; }
.team-app .plantilla-grupo-header { min-height: 48px; padding: 0 13px; }
.team-app .plantilla-jugador { min-height: 66px; padding: 8px 13px; }
.team-app .jugador-foto { width: 44px; height: 44px; flex-basis: 44px; }

@media (max-width: 360px) {
    .team-app-header { padding-right: 11px; padding-left: 11px; }
    .team-app-identity { gap: 10px; }
    .team-app-crest {
        flex-basis: 82px;
        width: 82px;
        height: 82px;
        margin-top: -22px;
        margin-bottom: -22px;
    }
    .team-app-tournament-link { padding: 0 11px; font-size: 11px; }
    .team-app-tabs a { min-width: auto; padding-right: 13px; padding-left: 13px; font-size: 12px; }
    .team-stats { gap: 4px; }
    .team-stat strong { font-size: 17px; }
}

@media (min-width: 481px) {
    .team-app { box-shadow: 0 0 28px rgba(22,34,46,.10); }
}

/* Plantilla por posiciones: mantener las cinco tarjetas y compactar las vacías. */
.team-app .plantilla-grupo.plantilla-grupo-vacia {
    margin-bottom: 8px;
}

.team-app .plantilla-grupo.plantilla-grupo-vacia .plantilla-grupo-header {
    min-height: 44px;
    border-bottom: 0;
}

.team-app .plantilla-grupo.plantilla-grupo-vacia .plantilla-empty {
    margin: 0;
    padding: 10px 12px 12px;
    border-radius: 0;
    background: #fff;
}

.team-app .plantilla-grupo.plantilla-grupo-vacia .plantilla-empty i {
    display: none;
}

.team-app .plantilla-grupo.plantilla-grupo-vacia .plantilla-empty strong {
    font-size: 12px;
    line-height: 1.35;
    font-weight: 500;
}

.team-app .plantilla-grupo.plantilla-grupo-vacia .plantilla-empty span {
    display: none;
}

/* Compatibilidad automática si la vista no añade la clase plantilla-grupo-vacia. */
@supports selector(.plantilla-grupo:has(.plantilla-empty)) {
    .team-app .plantilla-grupo:has(.plantilla-empty) {
        margin-bottom: 8px;
    }

    .team-app .plantilla-grupo:has(.plantilla-empty) .plantilla-grupo-header {
        min-height: 44px;
        border-bottom: 0;
    }

    .team-app .plantilla-grupo:has(.plantilla-empty) .plantilla-empty {
        margin: 0;
        padding: 10px 12px 12px;
        border-radius: 0;
    }

    .team-app .plantilla-grupo:has(.plantilla-empty) .plantilla-empty i,
    .team-app .plantilla-grupo:has(.plantilla-empty) .plantilla-empty span {
        display: none;
    }

    .team-app .plantilla-grupo:has(.plantilla-empty) .plantilla-empty strong {
        font-size: 12px;
        line-height: 1.35;
        font-weight: 500;
    }
}
