.dep-match-card {
    margin: 12px 0 22px;
    padding: 22px 16px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(210, 31, 33, 0.28);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
    color: #1a1412;
}

.dep-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
}

.dep-team {
    text-align: center;
}

.dep-logo-wrap {
    width: 96px;
    height: 96px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #f4eeeb;
    border: 2px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dep-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.dep-logo-fallback {
    font-size: 2rem;
    font-weight: 800;
    color: #8b0000;
}

.dep-team-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a0a0c;
    line-height: 1.25;
}

.dep-vs {
    font-size: 1.4rem;
    font-weight: 900;
    font-style: italic;
    color: #8b0000;
    letter-spacing: 0.04em;
}

.dep-final-score {
    margin-top: 18px;
    text-align: center;
    padding-top: 14px;
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.dep-final-score__label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #7a716a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.dep-final-score__nums {
    font-size: clamp(2.4rem, 8vw, 3.6rem);
    font-weight: 900;
    color: #8b0000;
    line-height: 1.1;
    letter-spacing: 0.04em;
}

.dep-final-score__sep {
    margin: 0 0.2em;
    opacity: 0.7;
}

.dep-predictions__title {
    margin: 0 0 12px;
    text-align: center;
    color: #fff;
    font-size: 1.2rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

/* PC: podio arriba; móvil: podio debajo de la tabla */
.dep-public-layout {
    display: flex;
    flex-direction: column;
}

.dep-layout-header {
    order: 0;
}

.dep-layout-podium {
    order: 1;
}

.dep-layout-match {
    order: 2;
}

.dep-layout-preds {
    order: 3;
}

.dep-layout-footer {
    order: 4;
}

.dep-pred-score {
    font-weight: 800;
    font-size: 1.05rem;
}

.dep-exact-hit td,
.dep-winner-row td {
    background: rgba(241, 196, 15, 0.16) !important;
}

.dep-winner-score {
    position: relative;
    background: linear-gradient(135deg, #8b0000, #c41828) !important;
    color: #fff;
    min-width: 4.5rem;
}

.dep-winner-score__value {
    display: block;
    position: relative;
    z-index: 1;
    padding-top: 10px;
    font-weight: 800;
}

.dep-winner-score .podium-badge {
    top: 3px;
    right: 3px;
}

.dep-exact-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    background: #2e7d32;
    color: #fff;
    vertical-align: middle;
}

/* Admin */
.dep-admin-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: start;
    margin-top: 14px;
}

.dep-admin-team-box {
    background: #faf7f5;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 14px;
}

.dep-admin-team-box h3 {
    margin: 0 0 10px;
    color: #8b0000;
}

.dep-admin-team-box label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin: 8px 0 4px;
}

.dep-match-heading {
    text-align: center;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.12);
}

.dep-competition-title {
    font-size: clamp(1.15rem, 3.5vw, 1.55rem);
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8b0000;
    line-height: 1.2;
}

.dep-match-date {
    margin-top: 4px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #5c534c;
}

.dep-event-meta {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 12px;
    align-items: start;
}

.dep-date-hint {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: #6b635c;
    line-height: 1.35;
}

.dep-teams-hint {
    margin: 8px 0 0;
    font-size: 0.9rem;
    color: #5c534c;
    line-height: 1.4;
}

/* Tabla pública: en móvil no forzar 950px; marcador siempre a la vista */
#dep-predictions-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
}

#dep-predictions-table th.sticky-left-rank,
#dep-predictions-table td.sticky-left-rank {
    width: 2.4rem;
}

#dep-predictions-table th.sticky-left-name,
#dep-predictions-table td.sticky-left-name {
    width: auto;
}

#dep-predictions-table th.sticky-right-marcador,
#dep-predictions-table td.sticky-right-marcador {
    width: 6.5rem;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 768px) {
    /* En móvil el podio semanal va debajo de la tabla de marcadores */
    .dep-layout-podium {
        order: 4;
        margin-top: 14px;
    }

    .dep-layout-footer {
        order: 5;
    }

    .dep-predictions .score-table-container {
        overflow-x: visible;
    }

    #dep-predictions-table {
        min-width: 100% !important;
        width: 100% !important;
    }

    #dep-predictions-table th.sticky-left-rank,
    #dep-predictions-table td.sticky-left-rank,
    #dep-predictions-table th.sticky-left-name,
    #dep-predictions-table td.sticky-left-name {
        position: static;
        left: auto;
        box-shadow: none;
        max-width: none;
    }

    #dep-predictions-table td.sticky-left-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #dep-predictions-table th.sticky-right-marcador,
    #dep-predictions-table td.sticky-right-marcador {
        position: sticky;
        right: 0;
        z-index: 4;
        background: #fff8f6;
        box-shadow: -2px 0 6px rgba(0, 0, 0, 0.12);
        width: 5.8rem;
        min-width: 5.8rem;
        padding-left: 6px;
        padding-right: 6px;
        font-size: 0.95rem;
    }

    #dep-predictions-table th.sticky-right-marcador {
        z-index: 5;
        background: linear-gradient(180deg, #c41828 0%, #8b0000 100%);
        color: #fff;
    }

    #dep-predictions-table tr.dep-exact-hit td.sticky-right-marcador,
    #dep-predictions-table tr.dep-winner-row td.sticky-right-marcador {
        background: linear-gradient(135deg, #8b0000, #c41828) !important;
        color: #fff;
    }

    .dep-event-meta {
        grid-template-columns: 1fr;
    }
}

.dep-admin-team-box input[type="text"],
.dep-admin-team-box input[type="file"],
.dep-admin-team-box select.dep-team-pick {
    width: 100%;
    box-sizing: border-box;
}

.dep-admin-team-box select.dep-team-pick {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 0.95rem;
}

.dep-admin-vs {
    align-self: center;
    font-weight: 900;
    color: #8b0000;
    font-size: 1.2rem;
}

.dep-admin-logo-preview {
    margin-top: 10px;
    min-height: 64px;
}

.dep-admin-logo-preview img {
    max-width: 88px;
    max-height: 88px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #ddd;
    padding: 4px;
}

.dep-admin-final {
    margin-top: 16px;
    padding: 14px;
    border-radius: 10px;
    background: #fff8e8;
    border: 1px solid #e6c36a;
}

.dep-admin-final h3 {
    margin: 0 0 10px;
    color: #7a4e00;
}

.dep-admin-final-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.dep-admin-final-row input {
    width: 5rem;
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    padding: 10px;
}

#dep-players-table input {
    width: 100%;
    min-width: 3rem;
    padding: 8px;
    box-sizing: border-box;
}

.dep-marcador-cell {
    font-weight: 800;
    white-space: nowrap;
}

@media (max-width: 700px) {
    /* Vista pública: equipos siempre lado a lado (A izq · B der) */
    .dep-teams {
        grid-template-columns: 1fr auto 1fr;
        gap: 6px;
        align-items: start;
        text-align: center;
    }

    .dep-logo-wrap {
        width: 64px;
        height: 64px;
        margin-bottom: 6px;
    }

    .dep-logo-fallback {
        font-size: 1.45rem;
    }

    .dep-team-name {
        font-size: 0.92rem;
        line-height: 1.2;
        word-break: break-word;
        hyphens: auto;
    }

    .dep-vs {
        margin: 18px 0 0;
        font-size: 1.05rem;
        align-self: center;
    }

    .dep-match-card {
        padding: 16px 10px 14px;
    }

    .dep-competition-title {
        font-size: 1.05rem;
        letter-spacing: 0.04em;
    }

    /* Admin: formularios sí pueden apilarse */
    .dep-admin-teams {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .dep-admin-vs {
        margin: 4px 0;
    }
}
