:root {
    --bg: #090014;
    --bg-soft: #130225;
    --panel: rgba(255, 255, 255, 0.96);
    --panel-dark: rgba(20, 5, 45, 0.92);
    --purple: #27005d;
    --purple-2: #401083;
    --green: #087a08;
    --red: #b40013;
    --gold: #e2be48;
    --blue: #0936ff;
    --text: #111827;
    --muted: #6b7280;
    --border: rgba(17, 24, 39, 0.12);
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    direction: rtl;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(99, 34, 184, 0.32), transparent 32rem),
        linear-gradient(180deg, #170032 0%, #07000f 45%, #030006 100%);
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 0 48%, rgba(255, 255, 255, 0.05) 49%, transparent 50%),
        linear-gradient(0deg, rgba(0, 128, 0, 0.14) 0 14%, transparent 14% 28%, rgba(180, 0, 19, 0.16) 28% 42%, transparent 42% 56%, rgba(0, 128, 0, 0.12) 56% 70%, transparent 70% 100%);
    opacity: 0.72;
}

.page {
    position: relative;
    width: min(1280px, calc(100% - 24px));
    margin: 0 auto;
    padding: 18px 0 42px;
}

.hero {
    background: linear-gradient(135deg, rgba(39, 0, 93, 0.98), rgba(7, 0, 20, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    border-radius: 0 0 28px 28px;
    padding: 22px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 22px;
    align-items: center;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(27px, 5vw, 46px);
    line-height: 1.05;
}

.hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 16px;
    line-height: 1.7;
}

.brand-box {
    justify-self: end;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 20px;
    padding: 18px;
    min-width: 240px;
}

.brand-title {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
}

.brand-subtitle {
    margin-top: 6px;
    color: var(--gold);
    font-weight: 700;
}

.toolbar {
    margin-top: 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}

.grid-form {
    display: grid;
    grid-template-columns: 170px minmax(170px, 1fr) minmax(220px, 1.5fr) auto;
    gap: 12px;
    align-items: end;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #374151;
    margin-bottom: 7px;
}

input,
select,
button {
    font: inherit;
}

input[type="date"],
select {
    width: 100%;
    height: 46px;
    border: 1px solid rgba(17, 24, 39, 0.16);
    border-radius: 14px;
    background: #fff;
    color: #111827;
    padding: 0 12px;
    outline: none;
}

input[type="date"]:focus,
select:focus {
    border-color: var(--purple-2);
    box-shadow: 0 0 0 4px rgba(64, 16, 131, 0.14);
}

.btn {
    border: 0;
    border-radius: 14px;
    min-height: 46px;
    padding: 0 18px;
    cursor: pointer;
    font-weight: 900;
    transition: transform 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green), #05a405);
    color: #fff;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--purple), var(--purple-2));
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--red), #e0001c);
    color: #fff;
}

.small-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    align-items: center;
}

.checkbox-line {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #374151;
    font-size: 14px;
    font-weight: 700;
}

.status-line {
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(310px, 0.9fr) minmax(0, 1.3fr);
    gap: 18px;
    margin-top: 18px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-header {
    padding: 16px 18px;
    background: linear-gradient(135deg, #ffffff, #f4f0ff);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.panel-header h2,
.panel-header h3 {
    margin: 0;
    font-size: 20px;
}

.panel-body {
    padding: 16px;
}

.matches-list {
    display: grid;
    gap: 12px;
    max-height: 72vh;
    overflow: auto;
    padding-left: 4px;
}

.match-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    padding: 13px;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.match-card:hover,
.match-card.active {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(39, 0, 93, 0.18);
    border-color: rgba(39, 0, 93, 0.38);
}

.match-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.live-pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 900;
    background: rgba(39, 0, 93, 0.1);
    color: var(--purple);
}

.live-pill {
    background: rgba(180, 0, 19, 0.11);
    color: var(--red);
}

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

.team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.team.away {
    justify-content: flex-start;
}

.team-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 50%;
    background: #f3f4f6;
    border: 1px solid rgba(17, 24, 39, 0.08);
    flex: 0 0 auto;
}

.team-name {
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-box {
    min-width: 72px;
    text-align: center;
    color: var(--blue);
    font-size: 24px;
    font-weight: 900;
}

.empty-state,
.error-state {
    padding: 28px;
    text-align: center;
    color: var(--muted);
    line-height: 1.7;
}

.error-state {
    color: var(--red);
    font-weight: 800;
}

.analysis-hero {
    background: linear-gradient(135deg, rgba(39, 0, 93, 0.96), rgba(6, 0, 14, 0.94));
    color: #fff;
    padding: 18px;
    border-radius: 20px;
    display: grid;
    gap: 14px;
}

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

.analysis-team {
    display: grid;
    place-items: center;
    gap: 8px;
    text-align: center;
    min-width: 0;
}

.analysis-team img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    padding: 5px;
}

.analysis-score {
    color: #fff;
    font-size: 34px;
    font-weight: 950;
    min-width: 88px;
    text-align: center;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.metric-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    min-height: 96px;
}

.metric-card strong {
    display: block;
    font-size: 25px;
    color: var(--purple);
    margin-bottom: 5px;
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 18px 0 10px;
}

.section-title h3 {
    margin: 0;
    font-size: 19px;
}

.stats-table,
.history-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.stats-table th,
.stats-table td,
.history-table th,
.history-table td {
    padding: 10px 11px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    vertical-align: middle;
}

.stats-table th,
.history-table th {
    text-align: right;
    color: #374151;
    background: #f8fafc;
    font-size: 13px;
}

.stats-table tr:last-child td,
.history-table tr:last-child td {
    border-bottom: 0;
}

.stat-name {
    font-weight: 900;
    width: 34%;
}

.stat-values {
    display: grid;
    grid-template-columns: 60px 1fr 60px;
    gap: 10px;
    align-items: center;
    direction: ltr;
}

.stat-bar {
    height: 11px;
    background: #e5e7eb;
    border-radius: 999px;
    display: grid;
    grid-template-columns: var(--home, 50%) var(--away, 50%);
    overflow: hidden;
}

.stat-bar span:first-child {
    background: var(--green);
}

.stat-bar span:last-child {
    background: var(--red);
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
}

.tab-btn {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 9px 13px;
    font-weight: 900;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--purple);
    border-color: var(--purple);
    color: #fff;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.result-badge {
    display: inline-flex;
    justify-content: center;
    min-width: 34px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #fff;
    font-weight: 900;
    font-size: 12px;
}

.result-win { background: var(--green); }
.result-draw { background: #6b7280; }
.result-loss { background: var(--red); }

.loader {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 4px solid rgba(39, 0, 93, 0.16);
    border-top-color: var(--purple);
    animation: spin 0.85s linear infinite;
    margin: 14px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.footer-note {
    margin-top: 16px;
    color: rgba(255,255,255,0.74);
    text-align: center;
    font-size: 13px;
}

@media (max-width: 960px) {
    .hero,
    .layout,
    .two-cols,
    .grid-form {
        grid-template-columns: 1fr;
    }

    .brand-box {
        justify-self: stretch;
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .matches-list {
        max-height: none;
    }
}

@media (max-width: 560px) {
    .page {
        width: min(100% - 14px, 1280px);
        padding-top: 8px;
    }

    .hero,
    .toolbar,
    .panel-body {
        padding: 14px;
    }

    .panel-header {
        padding: 13px 14px;
    }

    .teams-row,
    .analysis-teams {
        grid-template-columns: 1fr;
    }

    .score-box,
    .analysis-score {
        order: 2;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .stat-values {
        grid-template-columns: 44px 1fr 44px;
        gap: 6px;
    }

    .stats-table th,
    .stats-table td,
    .history-table th,
    .history-table td {
        padding: 8px 7px;
        font-size: 13px;
    }
}

/* v1.1 - League table + statistical rating model */
.rating-panel {
    margin-top: 16px;
    border-radius: 22px;
    padding: 16px;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    border: 1px solid rgba(17, 24, 39, 0.12);
    background: linear-gradient(135deg, #ffffff, #f7f2ff);
    box-shadow: 0 14px 32px rgba(39, 0, 93, 0.14);
}

.rating-score-box {
    border-radius: 20px;
    background: linear-gradient(135deg, #27005d, #401083);
    color: #fff;
    display: flex;
    min-height: 142px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 14px;
}

.rating-score-box span,
.rating-score-box small {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 800;
}

.rating-score-box strong {
    margin: 5px 0;
    font-size: 54px;
    line-height: 1;
}

.rating-high .rating-score-box {
    background: linear-gradient(135deg, #087a08, #08a708);
}

.rating-mid .rating-score-box {
    background: linear-gradient(135deg, #e2be48, #b98500);
}

.rating-low .rating-score-box {
    background: linear-gradient(135deg, #b40013, #65000b);
}

.rating-main h3 {
    margin: 0 0 6px;
    font-size: 24px;
}

.rating-main p {
    margin: 0 0 12px;
    color: #4b5563;
    line-height: 1.6;
    font-weight: 700;
}

.prob-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mini-prob {
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 16px;
    background: #fff;
    padding: 12px;
}

.mini-prob span {
    display: block;
    color: #6b7280;
    font-weight: 800;
    font-size: 13px;
}

.mini-prob strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
    color: #27005d;
}

.soft-warning {
    margin-top: 12px;
    padding: 11px 13px;
    border-radius: 14px;
    background: #fff8e1;
    border: 1px solid rgba(185, 133, 0, 0.28);
    color: #6b4b00;
    font-weight: 800;
    line-height: 1.55;
}

.league-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.compare-box {
    border-radius: 16px;
    padding: 12px;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.1);
}

.compare-box span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
}

.compare-box strong {
    display: block;
    margin-top: 5px;
    font-size: 19px;
    color: #111827;
}

.compare-box em {
    font-style: normal;
    color: #6b7280;
    font-size: 13px;
}

.compare-box.home-better {
    border-color: rgba(8, 122, 8, 0.26);
    background: linear-gradient(135deg, #ffffff, #f0fff0);
}

.compare-box.away-better {
    border-color: rgba(180, 0, 19, 0.22);
    background: linear-gradient(135deg, #ffffff, #fff3f5);
}

.team-standing-box {
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 20px;
    background: #fff;
    padding: 14px;
    overflow: hidden;
}

.team-standing-box h4 {
    margin: 0 0 12px;
    color: #111827;
    font-size: 19px;
}

.team-standing-box h4 small {
    display: block;
    margin-top: 3px;
    color: #6b7280;
    font-size: 12px;
}

.standing-splits {
    display: grid;
    gap: 10px;
}

.split-card {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(17, 24, 39, 0.1);
    background: #fafafa;
}

.split-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #27005d, #401083);
    color: #fff;
    font-weight: 900;
}

.split-head span {
    color: rgba(255, 255, 255, 0.82);
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: rgba(17, 24, 39, 0.08);
}

.mini-data {
    background: #fff;
    padding: 9px 10px;
    min-width: 0;
}

.mini-data span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
}

.mini-data strong {
    display: block;
    color: #111827;
    margin-top: 3px;
    font-size: 17px;
}

.compact-table {
    margin-top: 14px;
}

.rating-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.rating-box {
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 20px;
    background: #fff;
    padding: 14px;
}

.rating-box h4 {
    margin: 0 0 10px;
    color: #27005d;
    font-size: 18px;
}

.kv {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.kv:last-child {
    border-bottom: 0;
}

.kv span {
    color: #6b7280;
    font-weight: 800;
}

.kv strong {
    color: #111827;
    text-align: left;
    direction: ltr;
}

.odds-line {
    padding: 10px 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.odds-line:last-child {
    border-bottom: 0;
}

.odds-line span {
    color: #6b7280;
    font-weight: 800;
}

.odds-line strong {
    display: inline-block;
    margin: 0 8px;
    color: #0936ff;
    font-size: 18px;
}

.odds-line small {
    display: block;
    margin-top: 4px;
    color: #4b5563;
    direction: ltr;
    text-align: right;
}

.tip-item {
    border-radius: 14px;
    padding: 11px;
    margin-bottom: 9px;
    border: 1px solid rgba(17, 24, 39, 0.1);
}

.tip-item strong,
.tip-item span {
    display: block;
}

.tip-item span {
    margin-top: 5px;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
}

.tip-good {
    background: #f0fff0;
    border-color: rgba(8, 122, 8, 0.22);
}

.tip-neutral {
    background: #f7f2ff;
    border-color: rgba(64, 16, 131, 0.18);
}

.tip-bad {
    background: #fff3f5;
    border-color: rgba(180, 0, 19, 0.18);
}

@media (max-width: 980px) {
    .rating-panel,
    .rating-grid,
    .league-summary-strip {
        grid-template-columns: 1fr;
    }

    .prob-row {
        grid-template-columns: 1fr;
    }
}

.backtest-line,
.backtest-card {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    font-weight: 800;
    border: 1px solid rgba(255,255,255,.22);
}

.backtest-line.hit,
.backtest-card.hit {
    background: rgba(0, 140, 0, .12);
    color: #087a20;
}

.backtest-line.miss,
.backtest-card.miss {
    background: rgba(190, 0, 25, .10);
    color: #a00018;
}

.backtest-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
    background: #fff;
}

.backtest-card span {
    color: #4b5563;
    font-weight: 700;
}

/* V4 - clearer match list and preview rating */
.league-group-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 10px 0 8px;
    background: linear-gradient(90deg, #12001f, #2b0052);
    color: #f4ff38;
    border: 1px solid rgba(244,255,56,.35);
    border-radius: 14px;
    box-shadow: 0 10px 20px rgba(0,0,0,.18);
}
.league-group-header strong { font-size: 15px; }
.league-group-header span { font-size: 13px; color: #fff; opacity: .92; text-align: left; }
.score-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 132px;
}
.quick-rating {
    font-size: 12px;
    line-height: 1.25;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #26005a;
    white-space: nowrap;
}
.quick-rating.good { background: #dcfce7; color: #08701f; }
.quick-rating.mid { background: #fef9c3; color: #854d0e; }
.quick-rating.weak { background: #fee2e2; color: #991b1b; }
.quick-rating.none { background: #e5e7eb; color: #374151; }
.quick-odds {
    font-size: 11px;
    color: #6b7280;
    font-weight: 700;
    white-space: nowrap;
}
.team-subline {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #6b7280;
    font-weight: 700;
}
.analysis-team small,
.analysis-score small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255,255,255,.75);
    font-weight: 700;
}
.decision-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border-radius: 18px;
    background: linear-gradient(90deg, rgba(48,0,92,.1), rgba(0,142,28,.08));
    border: 1px solid rgba(48,0,92,.14);
}
.decision-summary strong { color: #17002d; font-size: 16px; }
.decision-summary span { color: #6b7280; font-weight: 700; }
.squad-box h5 {
    margin: 14px 0 8px;
    color: #17002d;
    font-size: 14px;
}
.player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.player-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    font-size: 12px;
    box-shadow: 0 6px 14px rgba(0,0,0,.06);
}
.player-chip img {
    width: 26px;
    height: 26px;
    object-fit: cover;
    border-radius: 50%;
}
.player-chip small { color: #6b7280; font-weight: 700; }
@media (max-width: 720px) {
    .teams-row { grid-template-columns: 1fr; gap: 10px; }
    .score-area { min-width: 0; width: 100%; }
    .league-group-header { align-items: flex-start; flex-direction: column; }
}

/* V5 - halftime + lineup insight */
.lineup-box h5 {
    margin: 14px 0 8px;
    color: #17002d;
    font-size: 14px;
}
.lineup-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.compact-lineup .player-chip {
    opacity: .92;
}
.player-chip.injured {
    border-color: rgba(190,0,25,.35);
    background: #fff1f2;
    color: #9f1239;
}
@media (max-width: 720px) {
    .quick-rating,
    .quick-odds,
    .team-subline {
        white-space: normal;
        text-align: center;
    }
}


.analysis-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-copy {
    background: linear-gradient(135deg, #009b2f, #00bf47);
    color: #fff;
    border: 0;
    box-shadow: 0 10px 22px rgba(0, 155, 47, .22);
}

.btn-copy:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 155, 47, .28);
}

.btn-copy:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.copy-status {
    min-width: 120px;
    font-size: 12px;
    font-weight: 800;
    color: #087a2b;
}

.copy-status.error {
    color: #b00020;
}

@media (max-width: 760px) {
    .analysis-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* V6 clean match page extension */
.match-card-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.btn-match-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(39, 0, 93, 0.08);
    color: var(--purple);
    border: 1px solid rgba(39, 0, 93, 0.18);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.btn-match-page:hover {
    background: rgba(39, 0, 93, 0.14);
    transform: translateY(-1px);
}

.match-page .match-analysis-page-panel {
    max-width: 1180px;
    margin: 18px auto 0;
}

.match-page-hero {
    max-width: 1180px;
    margin-inline: auto;
}

@media (max-width: 720px) {
    .match-card-actions {
        margin-top: 12px;
    }

    .btn-match-page {
        width: 100%;
    }
}

.decision-summary small {
    color: #374151;
    font-size: 12px;
    line-height: 1.7;
    font-weight: 600;
}

.simple-explain-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 12px 0 10px;
    padding: 12px 14px;
    border: 1px solid rgba(48, 0, 92, .14);
    border-radius: 16px;
    background: #faf7ff;
}

.simple-explain-box strong {
    color: #17002d;
    font-size: 15px;
    font-weight: 900;
}

.simple-explain-box span {
    color: #4b5563;
    font-size: 13px;
    line-height: 1.7;
    font-weight: 700;
}

/* V6 torpa statistical highlights */
.torpa-panel {
    margin: 14px 0 16px;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff7ed, #f8f5ff);
    border: 1px solid rgba(132, 70, 0, .18);
}
.torpa-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}
.torpa-head strong {
    color: #17002d;
    font-size: 16px;
    font-weight: 900;
}
.torpa-head span {
    color: #4b5563;
    font-size: 13px;
    font-weight: 700;
}
.torpa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}
.torpa-card {
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 20px rgba(0,0,0,.05);
}
.torpa-card strong {
    display: block;
    margin-bottom: 4px;
    color: #111827;
    font-size: 14px;
    font-weight: 900;
}
.torpa-card span {
    display: block;
    color: #374151;
    font-size: 13px;
    line-height: 1.65;
    font-weight: 700;
}
.torpa-home { border-right: 5px solid #16a34a; }
.torpa-away { border-right: 5px solid #2563eb; }
.torpa-draw { border-right: 5px solid #f59e0b; }
.torpa-neutral { border-right: 5px solid #6b7280; }

.mini-data.signal-good {
    background: #ecfdf5;
    border-color: rgba(22, 163, 74, .25);
}
.mini-data.signal-strong {
    background: #dcfce7;
    border-color: rgba(22, 163, 74, .38);
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, .16);
}
.mini-data.signal-draw,
.mini-data.signal-draw-strong {
    background: #fffbeb;
    border-color: rgba(245, 158, 11, .3);
}
.mini-data.signal-draw-strong {
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, .22);
}
.mini-data.signal-danger,
.mini-data.signal-danger-strong {
    background: #fff1f2;
    border-color: rgba(225, 29, 72, .28);
}
.mini-data.signal-danger-strong {
    box-shadow: inset 0 0 0 1px rgba(225, 29, 72, .18);
}

.history-table tr.row-home-edge td:last-child {
    color: #166534;
    font-weight: 900;
}
.history-table tr.row-away-edge td:last-child {
    color: #1d4ed8;
    font-weight: 900;
}
.history-table tr.row-draw-alert td {
    background: #fffbeb;
}
.history-table tr.row-loss-alert td {
    background: #fff1f2;
}

/* V6 stats prediction by recent match statistics */
.stats-prediction-panel {
    margin-bottom: 18px;
}

.stats-prediction-table td,
.stats-prediction-table th {
    vertical-align: middle;
}

.stats-prediction-table tr.row-strong-signal td {
    background: #f7fff7;
}

.stats-prediction-table tr.row-home-edge td:nth-child(2),
.stats-prediction-table tr.row-home-edge td:nth-child(4) {
    color: #166534;
    font-weight: 900;
}

.stats-prediction-table tr.row-away-edge td:nth-child(3),
.stats-prediction-table tr.row-away-edge td:nth-child(4) {
    color: #1d4ed8;
    font-weight: 900;
}

.stats-prediction-table tr.row-neutral-edge td:nth-child(4) {
    color: #92400e;
    font-weight: 900;
}

.stats-prediction-insights {
    background: linear-gradient(135deg, #f0fff4, #f8f5ff);
}

/* V6 summary tab and compact metrics */
.metric-card-compact {
    padding: 11px;
    min-height: 86px;
}

.metric-card-compact strong {
    font-size: 16px;
    line-height: 1.35;
    word-break: break-word;
}

.metric-card-compact span {
    font-size: 12px;
}

.overview-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.overview-summary {
    background: linear-gradient(135deg, #ffffff, #f8f5ff);
    border-right: 5px solid var(--purple);
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 960px) {
    .overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

/* V6 list sorting/filter upgrade */
.layout {
    grid-template-columns: minmax(420px, 1fr) minmax(0, 1.22fr);
}

.matches-panel-header {
    align-items: flex-start;
    flex-direction: column;
}

.match-list-tools {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(130px, .9fr) minmax(110px, .75fr) minmax(110px, .75fr) minmax(100px, .7fr) auto;
    gap: 8px;
    align-items: end;
    margin-top: 10px;
}

.match-list-tools label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.match-list-tools label span {
    font-size: 11px;
    color: #4b5563;
    font-weight: 900;
}

.match-list-tools input,
.match-list-tools select {
    height: 36px;
    min-width: 0;
    border: 1px solid rgba(17, 24, 39, 0.14);
    border-radius: 11px;
    background: #fff;
    color: #111827;
    padding: 0 9px;
    font-size: 12px;
    font-weight: 800;
}

.btn-mini {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 11px;
    background: #ede9fe;
    color: var(--purple);
    border: 1px solid rgba(39,0,93,.16);
    font-size: 12px;
}

.match-card-expanded {
    padding: 14px;
}

.match-card-expanded .teams-row {
    grid-template-columns: minmax(118px, 1fr) minmax(138px, auto) minmax(118px, 1fr);
    gap: 12px;
}

.match-card-expanded .team {
    align-items: center;
}

.match-card-expanded .team-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.match-card-expanded .team-name {
    font-size: 15px;
    line-height: 1.25;
}

.match-card-expanded .team-logo {
    width: 42px;
    height: 42px;
}

.match-card-expanded .score-box {
    font-size: 27px;
    min-width: 82px;
}

.match-signal-line {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(17,24,39,.08);
    color: #374151;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 900;
    text-align: center;
}

.match-signal-line.good {
    background: #ecfdf5;
    color: #08701f;
    border-color: rgba(8,112,31,.18);
}

.match-signal-line.mid {
    background: #fffbeb;
    color: #854d0e;
    border-color: rgba(133,77,14,.18);
}

.match-signal-line.weak {
    background: #fff1f2;
    color: #991b1b;
    border-color: rgba(153,27,27,.16);
}

@media (max-width: 1180px) {
    .layout {
        grid-template-columns: minmax(380px, .95fr) minmax(0, 1.15fr);
    }
    .match-list-tools {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .layout,
    .match-list-tools {
        grid-template-columns: 1fr;
    }
    .match-card-expanded .teams-row {
        grid-template-columns: 1fr;
    }
}

/* League standing cards: keep relevant splits open, hide secondary splits behind clean toggles */
.split-card {
    display: block;
}

.split-card > summary {
    list-style: none;
    cursor: pointer;
    align-items: center;
}

.split-card > summary::-webkit-details-marker {
    display: none;
}

.split-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.split-title-wrap strong {
    line-height: 1.1;
}

.split-title-wrap small {
    color: rgba(255, 255, 255, 0.74);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
}

.split-place {
    white-space: nowrap;
    align-self: flex-start;
}

.split-toggle {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 3px 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.split-toggle::before {
    content: "פתח";
}

.split-card[open] .split-toggle::before {
    content: "סגור";
}

.split-card:not([open]) {
    background: #f3f0f8;
    border-color: rgba(64, 16, 131, 0.18);
}

.split-card:not([open]) .split-head {
    background: linear-gradient(135deg, #401083, #27005d);
}

.split-card:not([open]) .split-head::after {
    content: "";
}

@media (max-width: 720px) {
    .split-head {
        gap: 6px;
        padding: 9px 10px;
    }

    .split-title-wrap small {
        font-size: 10px;
    }

    .split-place,
    .split-toggle {
        font-size: 10px;
    }
}

/* V6 composite final rating explanation */
.rating-composition-box {
    margin: 14px 0 18px;
    border: 1px solid rgba(64, 16, 131, 0.14);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(23, 0, 45, 0.08);
    overflow: hidden;
}

.rating-composition-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #25004e, #42118c);
    color: #fff;
}

.rating-composition-head strong {
    font-size: 17px;
    font-weight: 950;
}

.rating-composition-head span {
    font-size: 14px;
    font-weight: 850;
    color: rgba(255, 255, 255, 0.86);
}

.rating-composition-head b {
    color: #ffe66d;
    font-size: 18px;
}

.compact-explain {
    margin: 12px 14px;
}

.rating-composition-table {
    margin: 0;
    border-radius: 0;
}

.rating-composition-table td:nth-child(2),
.rating-composition-table td:nth-child(4) {
    text-align: center;
    white-space: nowrap;
    font-weight: 900;
}

.rating-composition-table td:nth-child(3) {
    line-height: 1.55;
    color: #374151;
}

.rating-composition-table .comp-positive td:last-child {
    color: #047857;
    background: #ecfdf5;
}

.rating-composition-table .comp-negative td:last-child {
    color: #b91c1c;
    background: #fef2f2;
}

.rating-composition-table .comp-draw td:last-child {
    color: #b45309;
    background: #fffbeb;
}

.rating-composition-table .comp-neutral td:last-child {
    color: #4b5563;
    background: #f9fafb;
}

@media (max-width: 720px) {
    .rating-composition-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .rating-composition-table td:nth-child(3) {
        min-width: 220px;
    }
}

/* V6 upgraded statistical memory/rating model */
.stats-dominance-box,
.comeback-panel {
    margin: 14px 0 16px;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff, #f8f5ff);
    border: 1px solid rgba(64, 16, 131, .14);
    box-shadow: 0 10px 26px rgba(23, 0, 45, .06);
}

.stats-dominance-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.stats-dominance-box strong {
    display: block;
    color: #17002d;
    font-size: 16px;
    font-weight: 950;
    margin-bottom: 4px;
}

.stats-dominance-box span,
.stats-dominance-box small {
    color: #4b5563;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.55;
}

.stats-dominance-score {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

.stats-dominance-score b {
    font-size: 24px;
    font-weight: 950;
    color: #25004e;
}

.stats-dominance-score em {
    font-style: normal;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
}

.stats-dominance-home { border-right: 5px solid #16a34a; }
.stats-dominance-away { border-right: 5px solid #2563eb; }
.stats-dominance-neutral { border-right: 5px solid #f59e0b; }

.comeback-panel {
    background: linear-gradient(135deg, #f8f5ff, #ffffff);
    border-right: 5px solid #42118c;
}

.comeback-grid .metric-card strong {
    font-size: 18px;
}

@media (max-width: 760px) {
    .stats-dominance-box {
        grid-template-columns: 1fr;
    }
    .stats-dominance-score {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* V6 match event log / past match facts */
.match-event-actions {
    display: flex;
    justify-content: center;
    margin-top: 14px;
}

.btn-event-log {
    background: linear-gradient(135deg, #ffffff, #f8f5ff);
    color: var(--purple);
    border: 1px solid rgba(39, 0, 93, .25);
    box-shadow: 0 8px 18px rgba(39, 0, 93, .13);
    font-weight: 900;
}

.btn-event-log:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(39, 0, 93, .18);
}

.match-events-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.event-explain-box {
    border-right: 5px solid var(--purple);
}

.event-facts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.event-fact-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    min-height: 74px;
}

.event-fact-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 4px;
}

.event-fact-card strong {
    display: block;
    color: var(--purple);
    font-size: 16px;
    line-height: 1.35;
    word-break: break-word;
}

.event-timeline-table .event-minute {
    font-weight: 1000;
    color: var(--purple);
    white-space: nowrap;
}

.event-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 900;
    background: #f3eefb;
    color: var(--purple);
    white-space: nowrap;
}

.event-row.event-goal td {
    background: #ecfdf5;
}

.event-row.event-yellow-card td {
    background: #fffbeb;
}

.event-row.event-red-card td {
    background: #fff1f2;
}

.event-row.event-substitution td {
    background: #f8fafc;
}

.event-row.event-home td:first-child {
    border-right: 4px solid #16a34a;
}

.event-row.event-away td:first-child {
    border-right: 4px solid #2563eb;
}

.match-events-modal.hidden {
    display: none;
}

.match-events-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.match-events-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 0, 20, .74);
    backdrop-filter: blur(4px);
}

.match-events-modal-card {
    position: relative;
    z-index: 1;
    width: min(1040px, 96vw);
    max-height: 88vh;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 26px 80px rgba(0,0,0,.35);
    overflow: hidden;
    direction: rtl;
}

.match-events-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--purple), #17002d);
    color: #fff;
}

.match-events-modal-head strong {
    display: block;
    font-size: 20px;
    margin-bottom: 4px;
}

.match-events-modal-head span {
    display: block;
    color: rgba(255,255,255,.78);
    font-size: 13px;
    font-weight: 800;
}

.match-events-modal-body {
    padding: 16px;
    overflow: auto;
    max-height: calc(88vh - 82px);
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 780px) {
    .event-facts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .match-events-modal {
        padding: 10px;
    }
    .event-timeline-table th,
    .event-timeline-table td {
        font-size: 12px;
        padding: 8px;
    }
}

/* V6 event board + player statistics upgrade */
.event-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.event-board-center {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 20px;
    background: linear-gradient(180deg, #260057, #10001f);
    color: #fff;
    padding: 14px 8px;
    min-height: 160px;
}

.event-board-center strong {
    font-size: 28px;
    line-height: 1;
}

.event-board-center span,
.event-board-center small {
    font-size: 12px;
    color: rgba(255,255,255,.75);
    font-weight: 900;
    margin-top: 6px;
}

.event-side-column,
.player-side-box {
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
}

.event-side-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f5ff;
    border-bottom: 1px solid var(--border);
}

.event-side-head img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex: 0 0 auto;
}

.event-side-head strong {
    display: block;
    color: var(--dark);
    font-size: 15px;
    font-weight: 1000;
}

.event-side-head span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    margin-top: 2px;
}

.event-side-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.event-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px;
    background: #f8fafc;
}

.event-card-goal {
    background: #ecfdf5;
    border-color: #bbf7d0;
}

.event-card-yellow-card {
    background: #fffbeb;
    border-color: #fde68a;
}

.event-card-red-card {
    background: #fff1f2;
    border-color: #fecdd3;
}

.event-card-substitution {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.event-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.event-minute-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--purple);
    color: #fff;
    font-weight: 1000;
    direction: ltr;
}

.event-card strong {
    display: block;
    color: var(--dark);
    font-size: 14px;
    font-weight: 1000;
}

.event-card small {
    display: block;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
    margin-top: 4px;
}

.event-empty-side {
    border: 1px dashed var(--border);
    border-radius: 14px;
    color: var(--muted);
    font-weight: 900;
    padding: 18px 10px;
    text-align: center;
}

.player-stats-panel {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-stats-highlight-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.player-highlight-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
}

.player-highlight-card span,
.player-highlight-card small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.player-highlight-card strong {
    display: block;
    margin: 5px 0;
    color: var(--purple);
    font-size: 15px;
    font-weight: 1000;
}

.event-player-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.player-side-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    background: #fcfbff;
}

.player-side-summary .event-fact-card {
    min-height: auto;
    padding: 9px;
}

.player-side-summary .event-fact-card strong {
    font-size: 14px;
}

.player-stats-table-wrap {
    overflow: auto;
    max-height: 460px;
    border-top: 1px solid var(--border);
}

.player-stats-table {
    min-width: 780px;
    margin: 0;
}

.player-stats-table td small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    margin-top: 2px;
}

.player-stats-table td,
.player-stats-table th {
    white-space: nowrap;
    font-size: 12px;
}

.match-events-modal-card {
    width: min(1240px, 96vw);
}

@media (max-width: 900px) {
    .event-board,
    .event-player-columns {
        grid-template-columns: 1fr;
    }
    .event-board-center {
        min-height: auto;
        padding: 12px;
        order: -1;
    }
    .player-stats-highlight-grid,
    .player-side-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Country accordion for the match list: keeps long match days readable */
.country-group {
    margin: 10px 0 14px;
}

.country-group-header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(244,255,56,.35);
    border-radius: 14px;
    background: linear-gradient(90deg, #12001f, #2b0052);
    color: #f4ff38;
    box-shadow: 0 10px 20px rgba(0,0,0,.18);
    cursor: pointer;
    text-align: start;
    font-family: inherit;
}

.country-group-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.country-group-main strong {
    font-size: 16px;
    line-height: 1.2;
    color: #f4ff38;
}

.country-group-main small {
    font-size: 12px;
    color: rgba(255,255,255,.86);
    font-weight: 800;
}

.country-group-action {
    flex: 0 0 auto;
    min-width: 58px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    border: 1px solid rgba(255,255,255,.18);
}

.country-group.is-open .country-group-action {
    background: rgba(0,180,60,.18);
    color: #dcfce7;
}

.country-group-body {
    padding-top: 8px;
}

.league-subheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 10px 0 8px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid rgba(39,0,93,.12);
    color: var(--purple);
    font-weight: 900;
}

.league-subheader strong {
    font-size: 13px;
}

.league-subheader span {
    font-size: 11px;
    color: #6b7280;
    font-weight: 800;
}

@media (max-width: 640px) {
    .country-group-header,
    .league-subheader {
        align-items: flex-start;
        flex-direction: column;
    }
    .country-group-action {
        width: 100%;
    }
}

/* League accordion inside each country group: all leagues are closed by default */
.league-group {
    margin: 8px 0 10px;
}

.league-group-header {
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    text-align: start;
    border: 1px solid rgba(39,0,93,.16);
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.league-group-header:hover {
    background: #f3ecff;
    border-color: rgba(39,0,93,.28);
    box-shadow: 0 8px 18px rgba(39,0,93,.08);
}

.league-group-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.league-group-main strong {
    color: var(--purple);
    font-size: 13px;
    line-height: 1.2;
}

.league-group-main small {
    color: #6b7280;
    font-size: 11px;
    font-weight: 800;
}

.league-group-action {
    flex: 0 0 auto;
    min-width: 56px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eee7f8;
    color: var(--purple);
    border: 1px solid rgba(39,0,93,.15);
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.league-group.is-open .league-group-action {
    background: rgba(0,150,60,.12);
    color: #047236;
    border-color: rgba(0,150,60,.22);
}

.league-group-body {
    padding-top: 8px;
}

.league-group.is-collapsed .league-group-body {
    display: none;
}

@media (max-width: 640px) {
    .league-group-main,
    .league-group-action {
        width: 100%;
    }
    .league-group-action {
        text-align: center;
    }
}

.league-lazy-placeholder {
    margin: 6px 0 10px;
    padding: 12px 14px;
    border: 1px dashed rgba(39,0,93,.20);
    border-radius: 14px;
    background: #faf7ff;
    color: #5f4b7a;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.draw-guard-inline {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(39,0,93,.14);
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    line-height: 1.45;
}
.draw-guard-inline strong {
    font-size: 13px;
    font-weight: 900;
}
.draw-guard-inline span {
    color: #334155;
    font-weight: 750;
}
.draw-guard-soft {
    background: #fffaf0;
    border-color: #f4d38a;
    color: #7a4d00;
}
.draw-guard-warning {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239;
}
.draw-guard-danger {
    background: #ffe4e6;
    border-color: #fb7185;
    color: #7f1d1d;
}
.rating-composition-table tr.comp-negative td,
.rating-composition-table tr.comp-draw td {
    vertical-align: top;
}

/* V6 draw guard visibility on the right-side match list */
.matches-list {
    max-height: 78vh;
}

.match-card-expanded {
    min-height: 178px;
}

.match-guard-line {
    margin-top: 7px;
    padding: 7px 10px;
    border-radius: 14px;
    border: 1px solid rgba(17,24,39,.08);
    background: #f8fafc;
    color: #374151;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 900;
    text-align: center;
}


.match-guard-line.pending {
    background: #f1f5f9;
    color: #64748b;
    border-color: rgba(100,116,139,.18);
}

.match-guard-line.ok {
    background: #f8fafc;
    color: #334155;
    border-color: rgba(51,65,85,.14);
}

.match-guard-line.soft {
    background: #fff7ed;
    color: #9a3412;
    border-color: rgba(154,52,18,.18);
}

.match-guard-line.warning {
    background: #fffbeb;
    color: #854d0e;
    border-color: rgba(133,77,14,.24);
}

.match-guard-line.danger {
    background: #fff1f2;
    color: #991b1b;
    border-color: rgba(153,27,27,.22);
}

@media (max-width: 1180px) {
    .matches-list {
        max-height: 74vh;
    }
    .match-card-expanded {
        min-height: 166px;
    }
}

/* Backtest Lab */
.backtest-page .hero { margin-bottom: 18px; }
.backtest-toolbar { margin-bottom: 16px; }
.backtest-grid-form { grid-template-columns: repeat(5, minmax(130px, 1fr)); align-items: end; }
.backtest-grid-form .compact-field input { text-align: center; font-weight: 800; }
.bt-heavy-checkbox { align-self: center; min-height: 42px; display: flex; align-items: center; justify-content: center; }
.btn-linklike { text-decoration: none; display: inline-flex; align-items: center; }
.backtest-progress-wrap { background: rgba(255,255,255,.96); border: 1px solid rgba(58, 21, 112, .14); border-radius: 18px; padding: 14px 18px; margin: 16px 0; box-shadow: 0 14px 40px rgba(0,0,0,.09); }
.backtest-progress-head { display: flex; justify-content: space-between; gap: 12px; color: #25004a; font-weight: 800; margin-bottom: 9px; }
.backtest-progress { height: 11px; background: #eee8f7; border-radius: 999px; overflow: hidden; }
.backtest-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #16a34a, #4c0b83); transition: width .25s ease; }
.backtest-results { display: grid; gap: 18px; }
.bt-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 12px; }
.bt-summary-card { background: #fff; border: 1px solid rgba(58, 21, 112, .12); border-radius: 18px; padding: 16px; box-shadow: 0 12px 30px rgba(0,0,0,.06); }
.bt-summary-card span { display: block; color: #667085; font-size: .88rem; margin-bottom: 6px; }
.bt-summary-card strong { display: block; color: #2a0054; font-size: 1.45rem; }
.bt-summary-card.good { background: #ecfdf3; border-color: #86efac; }
.bt-summary-card.warn { background: #fffbeb; border-color: #fcd34d; }
.bt-summary-card.bad { background: #fff1f2; border-color: #fda4af; }
.bt-two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bt-card { background: rgba(255,255,255,.97); border: 1px solid rgba(58, 21, 112, .13); border-radius: 22px; padding: 18px; box-shadow: 0 16px 44px rgba(0,0,0,.08); overflow: hidden; }
.bt-card h3 { margin: 0 0 12px; color: #25004a; font-size: 1.15rem; }
.bt-mini-table { display: grid; gap: 8px; }
.bt-kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #f8f7fb; border: 1px solid #e8e1f2; border-radius: 14px; }
.bt-kv span { color: #667085; }
.bt-kv strong { color: #25004a; }
.bt-recommendations { display: grid; gap: 10px; }
.bt-rec { background: #f5f0ff; border: 1px solid #d8c8ef; color: #25004a; border-radius: 14px; padding: 12px; line-height: 1.65; }
.bt-muted { color: #667085; margin: 0 0 12px; }
.bt-table-scroll { overflow: auto; max-height: 520px; border-radius: 14px; border: 1px solid #eee; }
.bt-table-scroll table { margin: 0; }
.bt-row-good td { background: #ecfdf3 !important; }
.bt-row-bad td { background: #fff1f2 !important; }
.bt-actions-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }

@media (max-width: 1100px) {
    .backtest-grid-form { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .bt-summary-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
    .bt-two-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .backtest-grid-form, .bt-summary-grid { grid-template-columns: 1fr; }
    .bt-card { padding: 14px; }
}
