/* =========================================================
   FREE SURE BETS — PREDICTION PAGE
========================================================= */

:root {
    --green: #087a45;
    --green-dark: #004d2b;
    --green-deep: #003b22;
    --green-light: #e9f5ee;
    --yellow: #f7b817;
    --yellow-dark: #d99d00;
    --yellow-light: #fff4cf;
    --gray-bg: #f4f4f4;
    --gray-card: #ffffff;
    --gray-border: #e3e6e4;
    --text-dark: #111815;
    --text-medium: #637069;
    --text-light: #8b9590;
    --danger: #a32929;
    --shadow: 0 2px 8px rgba(0, 45, 28, 0.09);
    --radius: 9px;
}

:root[data-theme="dark"] {
    --green-light: #173d2b;
    --yellow-light: #4e4014;
    --gray-bg: #111814;
    --gray-card: #1b2620;
    --gray-border: #34443a;
    --text-dark: #edf5ef;
    --text-medium: #b5c2b9;
    --text-light: #8e9c93;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: Arial, Helvetica, sans-serif;
    background: var(--gray-bg);
    color: var(--text-dark);
    transition: background 0.2s ease, color 0.2s ease;
}

.hidden { display: none !important; }

.page-container {
    max-width: 1550px;
    margin: 0 auto;
    padding: 24px;
}

.page-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 345px;
    gap: 20px;
    align-items: start;
}

/* The prediction page keeps the same country rail as the match browser. */
.prediction-page-layout { grid-template-columns: 220px minmax(0, 1fr) 345px; }

.prediction-content { min-width: 0; }

.prediction-sidebar { position: sticky; top: 18px; }

.prediction-sidebar-card {
    overflow: hidden;
    border: 1px solid var(--gray-border);
    border-radius: 9px;
    background: white;
    box-shadow: var(--shadow);
}

.prediction-sidebar .accumulator-day { margin-top: 18px; }
.accumulator-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--gray-border);
}
.selection-info { min-width: 0; }
.selection-info strong { display: block; font-size: 12px; line-height: 1.2; }
.selection-info small { display: block; margin-top: 3px; color: var(--text-medium); font-size: 11px; }
.accumulator-see-prediction {
    flex-shrink: 0;
    border: 0;
    padding: 6px 8px;
    border-radius: 4px;
    background: var(--green);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    font-family: inherit;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.accumulator-see-prediction:hover { background: var(--green-dark); }
.accumulator-empty { padding: 14px 16px; color: var(--text-medium); font-size: 12px; }

.prediction-sidebar-title {
    padding: 12px 16px;
    background: var(--green-deep);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.prediction-market-list { display: flex; flex-direction: column; }

.prediction-market {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    padding: 10px 16px;
    border: 0;
    border-bottom: 1px solid var(--gray-border);
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
}

.prediction-market:last-child { border-bottom: 0; }
.prediction-market:hover, .prediction-market.active { background: var(--green-light); color: var(--green-dark); }
.prediction-market span { color: var(--green); font-size: inherit; line-height: inherit; font-weight: 800; }

.fixture-card,
.page-section,
.loading,
.error {
    background: white;
    border: 1px solid var(--gray-border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.fixture-card { position: relative; overflow: hidden; margin-bottom: 18px; }

.fixture-league {
    padding: 14px 22px;
    background: var(--green-light);
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 800;
    border-bottom: 1px solid var(--gray-border);
}

.fixture-league a {
    color: inherit;
    text-decoration: none;
}

.fixture-team h1 a {
    color: inherit;
    text-decoration: none;
}

.fixture-main {
    display: grid;
    grid-template-columns: 1fr 190px 1fr;
    align-items: center;
    min-height: 260px;
    padding: 26px 30px;
}

.fixture-team {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fixture-logo-control {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
}

.favorite-toggle {
    border: 1px solid #d6a300;
    background: white;
    color: #b18a00;
    cursor: pointer;
    font: inherit;
    font-size: 21px;
    font-weight: 900;
    line-height: 1;
}

.favorite-toggle:hover,
.favorite-toggle:focus-visible,
.favorite-toggle.is-favorite {
    background: var(--yellow);
    color: #191300;
}

.fixture-favorite-toggle {
    position: absolute;
    top: 50%;
    left: calc(100% + 7px);
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
}

.team-logo {
    width: 78px;
    height: 78px;
    object-fit: contain;
    margin-bottom: 12px;
}

.fixture-team h1 {
    margin: 0;
    max-width: 280px;
    font-size: 20px;
    text-transform: uppercase;
}

.team-label {
    margin-top: 6px;
    color: var(--text-light);
    font-size: 10px;
    font-weight: 800;
}

.fixture-center {
    min-height: 190px;
    border-left: 1px solid var(--gray-border);
    border-right: 1px solid var(--gray-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
}

.fixture-date {
    color: var(--text-medium);
    font-size: 12px;
    font-weight: 700;
}

.fixture-time {
    margin-top: 5px;
    font-size: 29px;
    font-weight: 900;
}

.fixture-timezone {
    font-size: 10px;
    color: var(--text-light);
    font-weight: 700;
}

.vs-text {
    margin: 12px 0;
    color: var(--green-dark);
    font-size: 15px;
    font-weight: 900;
}

.fixture-score {
    color: var(--green-dark);
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.fixture-venue {
    max-width: 170px;
    font-size: 11px;
    color: var(--text-medium);
}

.status-badge {
    margin-top: 8px;
    padding: 4px 9px;
    border-radius: 20px;
    background: var(--green-light);
    color: var(--green-dark);
    font-size: 9px;
    font-weight: 900;
}

.page-section {
    padding: 22px;
    margin-bottom: 18px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.section-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 13px;
    flex-shrink: 0;
}

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

.section-title p {
    margin: 4px 0 0;
    color: var(--text-medium);
    font-size: 12px;
}

.prediction-card {
    border-top: 4px solid var(--yellow);
}

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

.winner-box,
.probability-box,
.prediction-meta {
    border: 1px solid var(--gray-border);
    border-radius: 9px;
    padding: 15px;
    background: #fafcfb;
}

.winner-box {
    grid-row: span 2;
    background: var(--green-light);
    border: 2px solid var(--green);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.eyebrow,
.probability-box span,
.prediction-meta span {
    display: block;
    color: var(--text-medium);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .4px;
}

.winner-box .eyebrow {
    color: var(--green-dark);
    font-size: 12px;
    letter-spacing: 1px;
}

.prediction-label {
    display: block;
    margin-top: 16px;
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .7px;
}

.winner-box strong {
    display: block;
    margin-top: 10px;
    color: var(--green-deep);
    font-size: clamp(24px, 2.4vw, 32px);
    font-weight: 900;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.prediction-advice {
    display: block;
    margin-top: 14px;
    padding: 10px 12px;
    border-left: 4px solid var(--yellow-dark);
    border-radius: 6px;
    background: var(--yellow);
    color: #111815;
    font-size: clamp(13px, 1.4vw, 17px);
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.probability-box strong {
    display: block;
    margin-top: 7px;
    font-size: 20px;
}

.probability-box.probability-high { background: #087a45; border-color: #087a45; color: #fff; }
.probability-box.probability-medium { background: #f7b817; border-color: #d99d00; color: #111815; }
.probability-box.probability-low { background: #777; border-color: #666; color: #fff; }
.probability-box.probability-high span,
.probability-box.probability-low span { color: rgba(255,255,255,.9); }
.probability-box.probability-medium span { color: #4c3900; }

.prediction-meta strong {
    display: block;
    margin-top: 5px;
    font-size: 14px;
}

.ai-summary {
    min-height: 130px;
    padding: 18px;
    border-left: 4px solid var(--yellow);
    background: #fffdf3;
    border-radius: 8px;
    color: #38423d;
    line-height: 1.65;
    font-size: 14px;
}

.comparison-list { width: 100%; }

.comparison-row {
    display: grid;
    grid-template-columns: 80px 55px minmax(120px, 1fr) 55px;
    gap: 10px;
    align-items: center;
    margin: 12px 0;
}

.comparison-label {
    font-size: 11px;
    font-weight: 900;
}

.comparison-row strong {
    font-size: 11px;
}

.comparison-row strong:first-of-type { text-align: right; }

.comparison-bar {
    height: 11px;
    display: flex;
    overflow: hidden;
    border-radius: 20px;
    background: #ecefed;
}

.comparison-bar span { height: 100%; }

.comparison-row strong.comparison-green { color: #087a45; }
.comparison-row strong.comparison-red { color: #c9111b; }
.comparison-row strong.comparison-neutral { color: #777; }

.comparison-bar .comparison-green { background: #087a45; }
.comparison-bar .comparison-red { background: #c9111b; }
.comparison-bar .comparison-neutral { background: #777; }

.form-row {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 5px;
    flex-wrap: nowrap;
    width: max-content;
    max-width: 100%;
}

.form-badge {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    line-height: 1;
    font-size: 9px;
    font-weight: 800;
    flex: 0 0 18px;
    box-sizing: border-box;
}

.stat .form-badge {
    display: flex;
}

.form-win { background: #087a45; }
.form-loss { background: #ef3434; }
.form-draw { background: #aeb4b0; }

.team-analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.team-data-card {
    border: 1px solid var(--gray-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.team-data-header {
    padding: 13px 15px;
    background: var(--green-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.team-data-header h3 {
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
}

.team-data-header span {
    font-size: 9px;
    font-weight: 900;
    color: var(--green-dark);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--gray-border);
}

.stat {
    background: white;
    padding: 11px 13px;
}

.stat span {
    display: block;
    color: var(--text-medium);
    font-size: 10px;
}

.stat strong {
    display: block;
    margin-top: 4px;
    font-size: 14px;
}

.json-stat {
    padding: 12px 14px;
    border-top: 1px solid var(--gray-border);
}

.json-stat strong { font-size: 11px; }

.json-stat pre {
    margin: 8px 0 0;
    white-space: pre-wrap;
    font: 10px/1.5 Consolas, monospace;
    color: var(--text-medium);
}

.goal-breakdown {
    padding: 14px;
    border-top: 1px solid var(--gray-border);
}

.goal-breakdown > strong {
    display: block;
    margin-bottom: 10px;
    font-size: 11px;
}

.goal-breakdown-grid {
    display: grid;
    gap: 6px;
}

.goal-breakdown-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--yellow-light);
    color: var(--text-medium);
    font-size: 10px;
}

.goal-breakdown-row strong {
    color: var(--text-dark);
}

.goal-line {
    color: var(--green-dark);
    font-weight: 800;
}

.goal-breakdown-empty {
    color: var(--text-medium);
    font-size: 11px;
}

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

th, td {
    padding: 11px 12px;
    border-bottom: 1px solid #edf0ee;
    text-align: left;
    font-size: 11px;
}

th {
    background: #f6f8f7;
    color: var(--text-medium);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.result {
    display: inline-block;
    min-width: 22px;
    padding: 4px 6px;
    text-align: center;
    border-radius: 4px;
    color: white;
    font-size: 9px;
    font-weight: 900;
}

.result.win { background: var(--green); }
.result.draw { background: #9aa39e; }
.result.loss { background: var(--yellow-dark); }

.loading {
    padding: 50px;
    text-align: center;
    color: var(--text-medium);
    font-weight: 700;
}

.error {
    padding: 30px;
    color: var(--danger);
}

.error strong { display: block; margin-bottom: 8px; }
.error p { margin: 0; }

.empty-state {
    padding: 30px;
    text-align: center;
    color: var(--text-medium);
    background: #fafcfb;
    border: 1px dashed var(--gray-border);
    border-radius: 8px;
    font-size: 12px;
}

.site-footer {
    max-width: 1670px;
    margin: 20px auto 0;
    padding: 20px 28px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 20px;
    color: var(--text-medium);
    font-size: 12px;
}

.site-footer .footer-link-group { grid-row: 2; }
.footer-links, .footer-social-links { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.footer-links a, .footer-social-links a { color: var(--text-medium); font-weight: 800; text-decoration: none; }
.footer-links a:hover, .footer-social-links a:hover { color: var(--green); }
.footer-link-group { display: flex; flex-direction: column; gap: 7px; }
.footer-link-label { color: var(--text-dark); font-size: 11px; font-weight: 900; }

:root[data-theme="dark"] .fixture-card,
:root[data-theme="dark"] .page-section,
:root[data-theme="dark"] .loading,
:root[data-theme="dark"] .error,
:root[data-theme="dark"] .team-data-card,
:root[data-theme="dark"] .stat,
:root[data-theme="dark"] .winner-box,
:root[data-theme="dark"] .probability-box,
:root[data-theme="dark"] .prediction-meta,
:root[data-theme="dark"] .empty-state {
    background: var(--gray-card);
}

:root[data-theme="dark"] .fixture-league,
:root[data-theme="dark"] .team-data-header,
:root[data-theme="dark"] .winner-box {
    color: var(--text-dark);
}

:root[data-theme="dark"] .section-title h2,
:root[data-theme="dark"] .section-title p,
:root[data-theme="dark"] .fixture-team h1,
:root[data-theme="dark"] .team-label,
:root[data-theme="dark"] .fixture-date,
:root[data-theme="dark"] .fixture-time,
:root[data-theme="dark"] .fixture-timezone,
:root[data-theme="dark"] .fixture-venue,
:root[data-theme="dark"] .prediction-meta strong,
:root[data-theme="dark"] .prediction-meta span,
:root[data-theme="dark"] .winner-box .eyebrow,
:root[data-theme="dark"] .prediction-label {
    color: var(--text-dark);
}

:root[data-theme="dark"] .fixture-score,
:root[data-theme="dark"] .fixture-center .vs-text {
    color: #ffffff;
}

:root[data-theme="dark"] .prediction-market:hover,
:root[data-theme="dark"] .prediction-market.active {
    color: var(--text-dark);
}

:root[data-theme="dark"] .winner-box strong {
    color: #8af0b5;
}

:root[data-theme="dark"] .prediction-advice {
    color: #111815;
}

:root[data-theme="dark"] .probability-box.probability-high { background: #087a45; color: #fff; }
:root[data-theme="dark"] .probability-box.probability-medium { background: #f7b817; color: #111815; }
:root[data-theme="dark"] .probability-box.probability-low { background: #666; color: #fff; }

:root[data-theme="dark"] .ai-summary,
:root[data-theme="dark"] th {
    background: #202c25;
    color: var(--text-dark);
}

:root[data-theme="dark"] th,
:root[data-theme="dark"] td {
    border-color: var(--gray-border);
}

@media (max-width: 800px) {
    .page-layout { grid-template-columns: 1fr; }
    .prediction-sidebar { position: static; order: 2; }
    .prediction-market-list { display: flex; flex-direction: column; }
    /* Keep the desktop fixture composition on mobile: home | details | away. */
    .fixture-main { grid-template-columns: minmax(0, 1fr) 130px minmax(0, 1fr); gap: 0; padding: 22px 12px; min-height: 220px; }
    .fixture-center { min-height: 175px; }
    /* Keep all three outcome percentages together, followed by the two
       supplementary prediction values on the next row. */
    .prediction-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .winner-box { grid-column: 1 / -1; grid-row: auto; }
    .probability-box,
    .prediction-meta { padding: 10px 8px; }
    .probability-box strong { font-size: 18px; }
    .team-analysis-grid { grid-template-columns: 1fr; }
    .site-footer { display: flex; flex-direction: column; }
    .site-footer .footer-link-group { grid-row: auto; }
}

@media (max-width: 500px) {
    .page-container { padding: 12px; }
    .fixture-main { grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); padding: 20px 8px; min-height: 190px; }
    .fixture-center { min-height: 150px; padding: 6px; }
    .fixture-team h1 { max-width: 100%; font-size: 12px; line-height: 1.2; }
    .fixture-team .team-logo { width: 56px; height: 56px; margin-bottom: 8px; }
    .fixture-favorite-toggle { left: calc(100% + 5px); width: 27px; height: 27px; font-size: 19px; }
    .fixture-time { font-size: 21px; }
    .fixture-date { font-size: 10px; }
    .fixture-score { font-size: 19px; }
    .fixture-center .vs-text { margin: 8px 0; }
    .prediction-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .probability-box,
    .prediction-meta { padding: 9px 5px; }
    .probability-box span,
    .prediction-meta span { font-size: 8px; }
    .probability-box strong { font-size: 16px; }
    .comparison-row { grid-template-columns: 55px 40px minmax(70px,1fr) 40px; gap: 5px; }
}
