/* ── Acta del partit (modal) — rendered by public/js/acta.js ───────────────
   Standalone (linked from shared/acta-modal.php) because iClub's layout
   doesn't load app.css; the palette mirrors app.css's --global-palette*. */

.acta-modal-body {
    --acta-navy: #082f47;
    --acta-blue: #105e8d;
    --acta-yellow: #fdc300;
    --acta-sky: #e4eef4;
    --acta-ground: #f0f2f4;
    --acta-line: #eef1f4;
    --acta-muted: #5b6670;
    --acta-text: #101010;
    --acta-card-blue: #1e73be;
    --acta-card-red: #c62828;
    --acta-visitor-bar: #f9b900;

    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--acta-ground);
    color: var(--acta-text);
}

/* The scoreboard already names both teams — keep the header to one line. */
#modal-acta-title { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.acta-loading {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .5rem;
}

.acta-report {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.acta-iframe {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    background: #fff;
}

/* "Acta oficial": only the tab bar stays, SIDGAD's page fills the rest. */
.acta-modal-body.is-official .acta-report { flex: 0 0 auto; overflow: visible; }
.acta-modal-body.is-official .acta-hero,
.acta-modal-body.is-official .acta-panes { display: none; }

.acta-muted { color: var(--acta-muted); }

/* ── Scoreboard ─────────────────────────────────────────────────────────── */

.acta-hero {
    background: var(--acta-navy);
    color: #fff;
    padding: 14px 16px 22px;
}
.acta-hero-inner { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.acta-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.acta-chip {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .12);
}
.acta-chip-season { background: var(--acta-yellow); color: var(--acta-navy); font-weight: 800; }

.acta-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 8px;
}
.acta-hero-team { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; min-width: 0; }
.acta-hero-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}
.acta-hero-logo-img { width: 44px; height: 44px; object-fit: contain; }
.acta-hero-logo .acta-logo-empty { color: var(--acta-muted); font-size: 24px; display: flex; }
.acta-hero-name { font-size: 13px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.acta-hero-scorers { font-size: 12px; line-height: 1.45; opacity: .85; }
.acta-hero-scorers:empty { display: none; }
.acta-hero-team.is-loser .acta-hero-name { opacity: .8; }

.acta-hero-score { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 6px; }
.acta-score { display: flex; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; font-size: 44px; font-weight: 800; line-height: 1; }
.acta-score .is-winner { color: var(--acta-yellow); }
.acta-score .is-loser { opacity: .7; }
.acta-score-sep { font-size: 26px; font-weight: 300; opacity: .5; }
.acta-status {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .14);
    padding: 3px 8px;
    border-radius: 999px;
}
.acta-status.is-live { background: var(--acta-yellow); color: var(--acta-navy); }

/* ── Tabs ───────────────────────────────────────────────────────────────── */

.acta-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    border-bottom: 1px solid #dde3e8;
}
.acta-tabs-inner { max-width: 1100px; margin: 0 auto; display: flex; gap: 4px; padding: 10px 16px; }
.acta-tab {
    flex: 1 1 0;
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    background: var(--acta-sky);
    color: var(--acta-navy);
    font-size: 14px;
    font-weight: 600;
}
.acta-tab.active { background: var(--acta-navy); color: #fff; font-weight: 700; }
.acta-tab-desktop { display: none; }

/* ── Panes & cards ──────────────────────────────────────────────────────── */

.acta-panes { max-width: 1100px; margin: 0 auto; padding: 16px 16px 32px; }
.acta-pane { display: none; }
.acta-pane.active { display: block; }

.acta-summary-grid { display: flex; flex-direction: column; gap: 14px; }

.acta-card-box {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(8, 47, 71, .08);
}
.acta-box-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--acta-navy);
    margin: 0 0 12px;
}
.acta-box-foot { font-size: 13px; color: var(--acta-muted); border-top: 1px solid var(--acta-line); padding-top: 10px; margin-top: 12px; }

.acta-info { padding: 4px 16px; }
.acta-info-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; font-size: 14px; line-height: 1.45; }
.acta-info-row + .acta-info-row { border-top: 1px solid var(--acta-line); }
.acta-info-icon { color: var(--acta-blue); font-size: 18px; line-height: 1.2; }
.acta-info-main { min-width: 0; }
.acta-venue-name { font-weight: 600; }
.acta-info-row .acta-muted { font-size: 13px; }
.acta-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
.acta-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    font-size: 13px;
    font-weight: 700;
    color: var(--acta-blue);
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
}
.acta-link:hover { color: var(--acta-navy); text-decoration: underline; }

.acta-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.acta-list-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.acta-list-name { flex: 1 1 auto; min-width: 0; }
.acta-mini-logo { width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; }
.acta-mini-logo.acta-logo-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--acta-muted); }

.acta-goals { display: inline-flex; align-items: center; gap: 3px; }
.acta-ball { width: 10px; height: 10px; border-radius: 50%; background: var(--acta-navy); }

.acta-card { display: inline-block; width: 12px; height: 16px; border-radius: 2px; vertical-align: middle; flex: 0 0 auto; box-sizing: border-box; }
.acta-card-blue { background: var(--acta-card-blue); }
.acta-card-red { background: var(--acta-card-red); }
.acta-card-yellow { background: var(--acta-yellow); border: 1px solid #c9a800; }

.acta-badge-c {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--acta-blue);
    border: 1px solid var(--acta-blue);
    border-radius: 4px;
    padding: 0 4px;
    vertical-align: 1px;
}
.acta-badge-licence {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #3d4a55;
    background: var(--acta-line);
    border-radius: 4px;
    padding: 1px 5px;
    vertical-align: 1px;
}

.acta-compare-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.acta-compare-line + .acta-compare-line { margin-top: 14px; }
.acta-compare-values { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.acta-compare-values .acta-muted { font-size: 13px; }
.acta-compare-bar { display: flex; gap: 4px; height: 6px; }
.acta-compare-bar span { flex-basis: 0; border-radius: 3px; }
.acta-compare-local { background: var(--acta-blue); }
.acta-compare-visitor { background: var(--acta-visitor-bar); }

/* ── Plantilles ─────────────────────────────────────────────────────────── */

.acta-team-switch { display: flex; background: #dde5ec; border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.acta-team-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #3d4a55;
}
.acta-team-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acta-team-btn.active { background: #fff; color: var(--acta-navy); font-weight: 700; box-shadow: 0 1px 2px rgba(8, 47, 71, .15); }

.acta-rosters[data-acta-show="local"] [data-acta-team="visitor"],
.acta-rosters[data-acta-show="visitor"] [data-acta-team="local"] { display: none; }

.acta-roster { padding: 0; overflow: hidden; }
.acta-roster-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--acta-sky); }
.acta-roster-name { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 800; color: var(--acta-navy); }
.acta-roster-fouls { font-size: 12px; color: #3d4a55; white-space: nowrap; }

.acta-roster-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.acta-roster-table th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--acta-muted);
    padding: 8px 0;
    text-align: left;
}
.acta-roster-table abbr { text-decoration: none; cursor: help; }
.acta-roster-table td { padding: 8px 0; border-top: 1px solid var(--acta-line); vertical-align: middle; }
.acta-roster-table tr.has-goals td { background: #f7fafc; }
.acta-roster-table .acta-col-num { width: 52px; text-align: center; }
.acta-roster-table .acta-col-stat { width: 36px; text-align: center; font-weight: 800; }
.acta-roster-table .acta-col-cards { width: 64px; text-align: center; padding-right: 8px; white-space: nowrap; }
.acta-roster-table .acta-col-cards .acta-card + .acta-card { margin-left: 3px; }
.acta-dorsal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--acta-sky);
    color: var(--acta-navy);
    font-size: 12px;
    font-weight: 800;
}
.acta-dorsal.is-gk { background: var(--acta-navy); color: var(--acta-yellow); }
.acta-player { line-height: 1.35; }
.acta-player-name { font-weight: 600; margin-right: 4px; }
.acta-player-tag { font-size: 12px; margin-right: 4px; }

.acta-staff { border-top: 1px solid #dde3e8; padding: 12px 16px; font-size: 13px; color: #3d4a55; line-height: 1.6; }
.acta-staff-title { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--acta-muted); }
.acta-empty { padding: 16px; margin: 0; font-size: 14px; }

.acta-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: #3d4a55; margin-top: 14px; padding: 0 4px; }
.acta-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.acta-legend .acta-card { width: 10px; height: 13px; }

.acta-error { text-align: center; padding: 40px 16px; color: var(--acta-muted); }
.acta-error .bi { font-size: 28px; }
.acta-error p { margin: 8px 0; }

/* ── Tablet ─────────────────────────────────────────────────────────────── */

@media (min-width: 768px) {
    .acta-summary-grid { display: block; columns: 2; column-gap: 20px; }
    .acta-summary-grid > * { break-inside: avoid; margin-bottom: 20px; }
    .acta-hero-grid { align-items: center; gap: 32px; }
    .acta-hero-team {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 16px;
        row-gap: 4px;
        align-items: center;
        text-align: left;
    }
    .acta-hero-team .acta-hero-logo { grid-row: 1 / span 2; }
    .acta-hero-local { grid-template-columns: minmax(0, 1fr) auto; text-align: right; }
    .acta-hero-local .acta-hero-logo { grid-column: 2; }
    .acta-hero-local .acta-hero-name,
    .acta-hero-local .acta-hero-scorers { grid-column: 1; grid-row: auto; }
    .acta-hero-local .acta-hero-name { grid-row: 1; }
    .acta-hero-local .acta-hero-scorers { grid-row: 2; }
    .acta-hero-name { font-size: 20px; font-weight: 800; align-self: end; }
    .acta-hero-scorers { font-size: 13px; align-self: start; }
    .acta-hero-logo { width: 76px; height: 76px; }
    .acta-hero-logo-img { width: 56px; height: 56px; }
    .acta-score { font-size: 56px; gap: 14px; }
    .acta-score-sep { font-size: 32px; }
}

/* ── Desktop: Resum and Plantilles on one tab ───────────────────────────── */

@media (min-width: 992px) {
    .acta-tabs-inner { padding: 0 16px; gap: 8px; }
    .acta-tab {
        flex: 0 0 auto;
        min-height: 48px;
        padding: 0 18px;
        border-radius: 0;
        background: none;
        color: #3d4a55;
        border-bottom: 3px solid transparent;
    }
    .acta-tab.active { background: none; color: var(--acta-navy); border-bottom-color: var(--acta-navy); }
    .acta-tab-mobile-only,
    .acta-tab-mobile { display: none; }
    .acta-tab-desktop { display: inline; }

    .acta-panes { padding: 24px 16px 40px; }
    .acta-pane { display: block; }
    .acta-pane + .acta-pane { margin-top: 20px; }

    .acta-summary-grid { columns: 3; }
    .acta-team-switch { display: none; }
    .acta-rosters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
    .acta-rosters[data-acta-show] [data-acta-team] { display: block; }
}

/* Player name → profile (player.js). Looks like the name, reads as a link. */
.acta-player-link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: rgba(16, 94, 141, .35);
    text-underline-offset: 3px;
    cursor: pointer;
}
.acta-player-link:hover { color: #105e8d; text-decoration-color: currentColor; }
