/* ==========================================================================
   Detalle público de partido (/partidos/{id})
   Diseño cohesivo con /partidos (estilo Flashscore + identidad Fair Play Kids)
   Paleta estricta: Negro / Neutros oscuros, Blanco y Rojo corporativo (#dc3545)
   ========================================================================== */

.fpk-md-wrap {
    color: #ffffff;
}

.fpk-md-inner {
    max-width: 840px;
    margin: 0 auto;
}

/* Barra superior de navegación */
.fpk-md-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.fpk-md-pill-btn {
    background-color: #111116;
    border: 1px solid #252530;
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.46rem 1.05rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.fpk-md-pill-btn:hover,
.fpk-md-pill-btn:focus {
    background-color: #181820;
    border-color: #dc3545;
    color: #ffffff;
}

.fpk-md-pill-btn.is-accent {
    border-color: rgba(220, 53, 69, 0.55);
    background-color: rgba(220, 53, 69, 0.14);
}

.fpk-md-pill-btn.is-accent:hover {
    background-color: rgba(220, 53, 69, 0.24);
    border-color: #dc3545;
}

/* Alertas de sesión corporativas */
.fpk-md-alert {
    background-color: #121217;
    border: 1px solid #252530;
    border-left: 3px solid #ffffff;
    border-radius: 10px;
    padding: 0.78rem 1rem;
    margin-bottom: 1rem;
    color: #ffffff;
    font-size: 0.86rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.fpk-md-alert.is-error {
    border-left-color: #dc3545;
}

/* Tarjeta principal del marcador (coherente con /partidos) */
.fpk-md-card {
    background-color: #111116;
    border: 1px solid #22222b;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

/* Cabecera del torneo / Amistoso + etiqueta de categoría con acento rojo corporativo */
.fpk-md-comp-bar {
    background-color: #0c0c10;
    border-bottom: 1px solid #1e1e26;
    padding: 0.65rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.fpk-md-comp-left {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex-wrap: wrap;
}

.fpk-md-comp-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.fpk-md-comp-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    line-height: 1.25;
}

a.fpk-md-comp-title:hover {
    color: #ff4d5a;
}

.fpk-md-phase-tag {
    font-size: 0.7rem;
    font-weight: 600;
    color: #ff4d5a;
    background-color: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.35);
    border-radius: 5px;
    padding: 0.12rem 0.45rem;
    flex-shrink: 0;
}

.fpk-md-comp-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.fpk-md-standings-link {
    font-size: 0.76rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.62);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.fpk-md-standings-link:hover {
    color: #ffffff;
}

.fpk-md-cat-square {
    background-color: rgba(220, 53, 69, 0.14);
    border: 1px solid rgba(220, 53, 69, 0.45);
    border-radius: 6px;
    padding: 0.25rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.15;
    white-space: nowrap;
    display: inline-block;
}

/* Fecha y hora */
.fpk-md-datetime-bar {
    padding: 0.85rem 1rem 0.2rem;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.fpk-md-dot {
    color: rgba(255, 255, 255, 0.3);
}

/* Bloque central de escudos y marcador */
.fpk-md-scoreboard {
    padding: 1.25rem 1.25rem 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 1.25rem;
}

.fpk-md-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
}

/* Escudos limpios y flotantes sin cuadrado alrededor */
.fpk-md-crest-wrap {
    width: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    background: transparent;
    border: none;
    flex-shrink: 0;
}

.fpk-md-crest-img {
    width: 100%;
    height: 100%;
    max-width: 78px;
    max-height: 78px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.fpk-md-crest-monogram {
    font-size: 1.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.05em;
}

.fpk-md-team-name {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin: 0;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fpk-md-team-name.is-winner {
    color: #ffffff;
}

.fpk-md-team-name.is-muted-loser {
    color: rgba(255, 255, 255, 0.68);
}

.fpk-md-score-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 118px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.fpk-md-score-digits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    line-height: 1;
}

.fpk-md-score-num {
    font-size: 2.85rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.fpk-md-score-sep {
    font-size: 2.2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.42);
}

.fpk-md-score-unplayed {
    font-size: 2.2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.1;
    letter-spacing: 0.1em;
}

.fpk-md-penalties-note {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

/* Sede y formato */
.fpk-md-venue-bar {
    background-color: #0e0e13;
    border-top: 1px solid #1c1c24;
    padding: 0.58rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.68);
}

.fpk-md-venue-label {
    color: rgba(255, 255, 255, 0.42);
    font-weight: 600;
}

/* Pestañas de navegación (Sentence case estricto y sin doble subrayado) */
.fpk-md-tabs {
    background-color: #0c0c10;
    border-top: 1px solid #1e1e26;
    border-bottom: none;
    display: flex;
    padding: 0 0.5rem;
    margin: 0;
}

.fpk-md-tabs .nav-item {
    flex: 1 1 0;
}

.fpk-md-tabs .nav-link {
    width: 100%;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.62) !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    padding: 0.84rem 0.65rem !important;
    text-align: center;
    text-transform: none !important;
    letter-spacing: normal !important;
    transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.fpk-md-tabs .nav-link::after {
    display: none !important;
}

.fpk-md-tabs .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.02) !important;
}

.fpk-md-tabs .nav-link.active {
    color: #ffffff !important;
    font-weight: 700 !important;
    border-bottom-color: #dc3545 !important;
}

.fpk-md-tab-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 0.25rem;
}

.fpk-md-tabs .nav-link.active .fpk-md-tab-count {
    color: rgba(255, 255, 255, 0.82);
}

/* Tarjetas de sección */
.fpk-md-section-card {
    background-color: #111116;
    border: 1px solid #22222b;
    border-radius: 12px;
    overflow: hidden;
}

.fpk-md-section-header {
    background-color: #0c0c10;
    border-bottom: 1px solid #1e1e26;
    padding: 0.7rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.fpk-md-section-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.fpk-md-meta-pill {
    background-color: #16161f;
    border: 1px solid #2b2b38;
    border-radius: 999px;
    padding: 0.18rem 0.65rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.78);
}

/* Línea de tiempo de eventos */
.fpk-md-period-bar {
    background-color: #0e0e13;
    border-top: 1px solid #1c1c24;
    border-bottom: 1px solid #1c1c24;
    padding: 0.48rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.72);
}

.fpk-md-section-header + .fpk-md-timeline .fpk-md-period-bar:first-child {
    border-top: none;
}

.fpk-md-event-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.72rem 1.1rem;
    border-bottom: 1px solid #1b1b22;
    transition: background-color 0.15s ease;
}

.fpk-md-event-row:last-child {
    border-bottom: none;
}

.fpk-md-event-row:hover {
    background-color: #171720;
}

.fpk-md-event-row.is-away {
    flex-direction: row-reverse;
    text-align: right;
}

.fpk-md-minute {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.52);
    font-variant-numeric: tabular-nums;
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.fpk-md-event-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background-color: #0d0d12;
    border: 1px solid #252530;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fpk-md-event-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.fpk-md-event-icon.is-miss {
    border-color: rgba(220, 53, 69, 0.45);
    background-color: rgba(220, 53, 69, 0.12);
    color: #ff4d5a;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

.fpk-md-event-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
}

.fpk-md-event-primary {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
}

.fpk-md-event-player-link {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.15s ease;
}

.fpk-md-event-player-link:hover {
    color: #ff4d5a;
}

.fpk-md-event-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    margin-left: 0.3rem;
}

.fpk-md-event-tag.is-red {
    color: #ff4d5a;
}

.fpk-md-event-sub {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.58);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    line-height: 1.25;
}

.fpk-md-event-row.is-away .fpk-md-event-sub {
    justify-content: flex-end;
}

.fpk-md-assist-icon {
    width: 13px;
    height: 13px;
    object-fit: contain;
}

/* Pizarra táctica corporativa oscura (sin verde) */
.fpk-md-pitch-wrap {
    padding: 1rem;
}

.fpk-md-pitch {
    position: relative;
    width: 100%;
    max-width: 440px;
    aspect-ratio: 10 / 15;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    background:
        repeating-linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.018) 0px,
            rgba(255, 255, 255, 0.018) 38px,
            transparent 38px,
            transparent 76px
        ),
        linear-gradient(180deg, #15151c 0%, #0d0d12 100%);
    border: 1.5px solid #2b2b37;
}

.fpk-md-pitch-border {
    position: absolute;
    inset: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    border-radius: 4px;
    pointer-events: none;
}

.fpk-md-pitch-midline {
    position: absolute;
    top: 50%;
    left: 12px;
    right: 12px;
    height: 1.5px;
    background-color: rgba(255, 255, 255, 0.16);
    pointer-events: none;
}

.fpk-md-pitch-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 26%;
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    pointer-events: none;
}

.fpk-md-pitch-spot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.25);
    pointer-events: none;
}

.fpk-md-pitch-box-top,
.fpk-md-pitch-box-bottom {
    position: absolute;
    left: 22%;
    width: 56%;
    height: 15%;
    border: 1.5px solid rgba(255, 255, 255, 0.16);
    pointer-events: none;
}

.fpk-md-pitch-box-top {
    top: 12px;
    border-top: none;
}

.fpk-md-pitch-box-bottom {
    bottom: 12px;
    border-bottom: none;
}

.fpk-md-pitch-goal-top,
.fpk-md-pitch-goal-bottom {
    position: absolute;
    left: 36%;
    width: 28%;
    height: 6.5%;
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    pointer-events: none;
}

.fpk-md-pitch-goal-top {
    top: 12px;
    border-top: none;
}

.fpk-md-pitch-goal-bottom {
    bottom: 12px;
    border-bottom: none;
}

.fpk-md-pitch-players {
    position: absolute;
    inset: 0;
    z-index: 5;
}

.fpk-md-pitch-node {
    position: absolute;
    transform: translate(-50%, -50%);
    text-align: center;
    text-decoration: none;
    z-index: 10;
    transition: transform 0.16s ease;
}

.fpk-md-pitch-node:hover {
    transform: translate(-50%, -53%);
    z-index: 20;
}

.fpk-md-pitch-avatar {
    height: 50px;
    width: auto;
    max-width: 56px;
    object-fit: contain;
    display: block;
    margin: 0 auto 3px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.75));
}

.fpk-md-pitch-label {
    display: inline-block;
    background-color: rgba(14, 14, 19, 0.94);
    border: 1px solid #2e2e3c;
    color: #ffffff;
    border-radius: 6px;
    padding: 0.16rem 0.42rem;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.12;
    min-width: 58px;
    max-width: 96px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fpk-md-pitch-node:hover .fpk-md-pitch-label {
    border-color: #dc3545;
}

/* Listas de jugadores */
.fpk-md-player-list {
    display: flex;
    flex-direction: column;
}

.fpk-md-player-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.1rem;
    text-decoration: none;
    color: #ffffff;
    border-bottom: 1px solid #1b1b22;
    transition: background-color 0.15s ease;
}

.fpk-md-player-row:last-child {
    border-bottom: none;
}

.fpk-md-player-row:hover {
    background-color: #171720;
    color: #ffffff;
}

.fpk-md-player-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #2d2d3a;
    background-color: #0c0c10;
    flex-shrink: 0;
}

.fpk-md-player-monogram {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #0c0c10;
    border: 1px solid #2d2d3a;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.76rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fpk-md-player-info {
    flex: 1;
    min-width: 0;
}

.fpk-md-player-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.25;
    margin: 0;
}

.fpk-md-player-row:hover .fpk-md-player-name {
    color: #ff4d5a;
}

.fpk-md-player-sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.54);
    line-height: 1.2;
    margin-top: 1px;
}

.fpk-md-player-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.fpk-md-role-pill {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.16rem 0.55rem;
    border-radius: 999px;
    background-color: #14141d;
    border: 1px solid #2a2a36;
    color: rgba(255, 255, 255, 0.72);
}

.fpk-md-role-pill.is-starter {
    background-color: rgba(220, 53, 69, 0.14);
    border-color: rgba(220, 53, 69, 0.45);
    color: #ffffff;
}

.fpk-md-dorsal {
    font-size: 0.84rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.54);
    font-variant-numeric: tabular-nums;
    min-width: 26px;
    text-align: right;
}

/* Estado vacío */
.fpk-md-empty {
    padding: 2.25rem 1.25rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.86rem;
}

/* Responsivo Mobile-First */
@media (max-width: 575.98px) {
    .fpk-md-comp-bar {
        padding: 0.58rem 0.85rem;
    }

    .fpk-md-scoreboard {
        padding: 1.1rem 0.65rem 1.25rem;
        gap: 0.65rem;
    }

    .fpk-md-crest-wrap {
        width: 62px;
        height: 62px;
        margin-bottom: 0.5rem;
    }

    .fpk-md-crest-img {
        max-width: 62px;
        max-height: 62px;
    }

    .fpk-md-team-name {
        font-size: 0.85rem;
    }

    .fpk-md-score-center {
        min-width: 88px;
    }

    .fpk-md-score-num {
        font-size: 2.15rem;
    }

    .fpk-md-score-sep {
        font-size: 1.65rem;
    }

    .fpk-md-score-unplayed {
        font-size: 1.75rem;
    }

    .fpk-md-tabs .nav-link {
        font-size: 0.82rem !important;
        padding: 0.74rem 0.35rem !important;
    }

    .fpk-md-event-row,
    .fpk-md-player-row {
        padding: 0.65rem 0.85rem;
    }

    .fpk-md-pitch-avatar {
        height: 42px;
    }
}
