*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0f1117; --bg2: #1a1d27; --bg3: #22263a;
    --card: #1e2236; --border: #2e3356;
    --accent: #4f7cff; --accent2: #7c5fff;
    --green: #2ecc71; --yellow: #f1c40f; --red: #e74c3c; --orange: #f97316;
    --text: #e8ecf4; --text2: #8892a4;
    --radius: 12px; --shadow: 0 4px 24px rgba(0,0,0,.35);
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }

/* HEADER */
.header { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 0 1rem; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 8px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-icon { font-size: 1.5rem; }
.logo-text { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.logo-badge { background: var(--accent); color: #fff; font-size: .6rem; padding: 2px 6px; border-radius: 99px; font-weight: 700; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav-link { color: var(--text2); text-decoration: none; font-size: .85rem; padding: 6px 10px; border-radius: 8px; transition: all .2s; white-space: nowrap; }
.nav-link:hover { background: var(--bg3); color: var(--text); }
.btn-sync { background: var(--accent); color: #fff; border: none; padding: 7px 12px; border-radius: 8px; font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn-sync:disabled { opacity: .6; cursor: not-allowed; }

/* MAIN */
.main { flex: 1; max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; width: 100%; }

/* PAGE HEADER */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; }
.page-sub { color: var(--text2); font-size: .9rem; margin-top: 4px; }
.back-link { color: var(--accent); text-decoration: none; font-size: .9rem; display: inline-block; margin-bottom: 10px; }
.course-info-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; color: var(--text2); font-size: .88rem; }
.vs-sep { color: var(--text2); margin: 0 6px; }

/* AI SELECTOR */
.ai-selector-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 1.5rem; display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.ai-selector-label { font-weight: 600; font-size: .9rem; color: var(--text2); }
.ai-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-option { display: none; }
.ai-label { display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 99px; border: 2px solid var(--border); cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--text2); transition: all .2s; }
.ai-label:hover { border-color: var(--accent); color: var(--text); }
.ai-option:checked + .ai-label { border-color: var(--accent); background: rgba(79,124,255,.12); color: var(--text); }
.ai-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; }
.ai-option:checked + .ai-label .ai-dot { background: currentColor; }
.ai-mistral { color: #f97316; }
.ai-claude  { color: #a78bfa; }
.ai-openai  { color: #10b981; }
.ai-option:checked + .ai-mistral { border-color: #f97316; background: rgba(249,115,22,.1); }
.ai-option:checked + .ai-claude  { border-color: #a78bfa; background: rgba(167,139,250,.1); }
.ai-option:checked + .ai-openai  { border-color: #10b981; background: rgba(16,185,129,.1); }
.stats-mini { font-size: .82rem; color: var(--text2); margin-left: auto; }

/* DAY SECTION */
.day-section { margin-bottom: 2rem; }
.day-header { font-size: 1rem; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; color: var(--text2); }
.day-count { background: var(--bg3); border: 1px solid var(--border); border-radius: 99px; font-size: .75rem; padding: 2px 10px; color: var(--text); }

/* MATCH CARD */
.matchs-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .matchs-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .matchs-grid { grid-template-columns: repeat(3, 1fr); } }

.match-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; transition: all .2s; display: flex; flex-direction: column; gap: 12px; }
.match-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.match-card.predicted { border-color: var(--accent2); }
.match-competition { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }

.match-teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.team { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.team-logo { width: 36px; height: 36px; object-fit: contain; }
.team-name { font-size: .82rem; font-weight: 600; }
.team-rank { font-size: .7rem; color: var(--text2); background: var(--bg3); padding: 1px 6px; border-radius: 99px; }

.match-center { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.match-vs { font-size: .7rem; font-weight: 700; color: var(--text2); }
.match-heure { font-size: .75rem; color: var(--text2); }
.match-pred { font-size: 1.1rem; font-weight: 900; padding: 4px 10px; border-radius: 8px; text-align: center; }
.match-pred small { font-size: .7rem; font-weight: 500; display: block; }
.pred-conf { font-size: .7rem; color: var(--text2); }

.pred-1 { background: rgba(46,204,113,.15); color: var(--green); border: 1px solid rgba(46,204,113,.3); }
.pred-N { background: rgba(241,196,15,.15); color: var(--yellow); border: 1px solid rgba(241,196,15,.3); }
.pred-2 { background: rgba(79,124,255,.15); color: var(--accent); border: 1px solid rgba(79,124,255,.3); }

.match-formes { font-size: .75rem; color: var(--text2); display: flex; align-items: center; gap: 8px; justify-content: center; }
.forme-sep { color: var(--border); }

.match-actions { display: flex; gap: 8px; margin-top: auto; }
.btn-detail { flex: 1; text-align: center; padding: 8px; border-radius: 8px; background: var(--bg3); color: var(--text); text-decoration: none; font-size: .82rem; font-weight: 600; border: 1px solid var(--border); transition: all .2s; }
.btn-detail:hover { border-color: var(--accent); color: var(--accent); }
.btn-predict { flex: 1; padding: 8px; border-radius: 8px; background: var(--accent); color: #fff; border: none; font-size: .82rem; font-weight: 600; cursor: pointer; transition: all .2s; }
.btn-predict:hover { background: #3a6be6; }
.btn-predict:disabled { opacity: .6; cursor: not-allowed; }
.full-btn { width: 100%; margin: 12px 0; padding: 12px; border-radius: 8px; background: var(--accent); color: #fff; border: none; font-size: .95rem; font-weight: 700; cursor: pointer; }

/* CARD */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.card-ia { border-color: var(--accent2); }

/* PREDICTION BIG */
.prediction-big { text-align: center; padding: 20px; margin: 12px 0; }
.pred-result { font-size: 1.5rem; font-weight: 900; padding: 14px 24px; border-radius: var(--radius); display: inline-block; }
.pred-score-big { margin-top: 10px; font-size: 1rem; color: var(--text2); }
.badge-confiance { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.conf-high { background: rgba(46,204,113,.15); color: var(--green); border: 1px solid rgba(46,204,113,.3); }
.conf-mid  { background: rgba(241,196,15,.15); color: var(--yellow); border: 1px solid rgba(241,196,15,.3); }
.conf-low  { background: rgba(231,76,60,.15); color: var(--red); border: 1px solid rgba(231,76,60,.3); }
.badge-provider { font-size: .72rem; padding: 2px 8px; border-radius: 99px; font-weight: 700; }
.badge-mistral { background: rgba(249,115,22,.15); color: #f97316; }
.badge-claude  { background: rgba(167,139,250,.15); color: #a78bfa; }
.badge-openai  { background: rgba(16,185,129,.15); color: #10b981; }

.ia-section { padding: 10px 0; border-top: 1px solid var(--border); font-size: .88rem; color: var(--text2); line-height: 1.6; }
.ia-section strong { color: var(--text); }
.ia-conseil { background: rgba(79,124,255,.08); padding: 10px 14px; border-radius: 8px; border: none !important; }

/* COMPARE */
.compare-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
.compare-col { display: flex; flex-direction: column; gap: 12px; }
.compare-team { font-weight: 700; font-size: .9rem; padding: 8px 0; }
.compare-stat-val { font-size: .9rem; padding: 8px 0; border-top: 1px solid var(--border); }
.compare-labels { display: flex; flex-direction: column; gap: 12px; align-items: center; color: var(--text2); }
.compare-label-title { font-size: .75rem; font-weight: 700; text-transform: uppercase; padding: 8px 0; }
.compare-label { font-size: .78rem; padding: 8px 6px; border-top: 1px solid var(--border); text-align: center; white-space: nowrap; }
.green { color: var(--green) !important; font-weight: 600; }
.red   { color: var(--red) !important; font-weight: 600; }

/* FORME BADGES */
.forme-badge { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 4px; font-size: .72rem; font-weight: 800; margin: 1px; }
.forme-W { background: rgba(46,204,113,.2); color: var(--green); }
.forme-D { background: rgba(241,196,15,.2); color: var(--yellow); }
.forme-L { background: rgba(231,76,60,.2); color: var(--red); }

/* COTES */
.cotes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cote-item { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-align: center; }
.cote-n { border-color: var(--yellow); }
.cote-label { font-size: .75rem; color: var(--text2); margin-bottom: 8px; }
.cote-val { font-size: 1.4rem; font-weight: 800; color: var(--accent); }

/* TOP PRONOSTICS */
.top-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .top-grid { grid-template-columns: repeat(2, 1fr); } }
.top-card { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.top-card.conf-high { border-color: rgba(46,204,113,.4); }
.top-card.conf-mid  { border-color: rgba(241,196,15,.3); }
.top-card-header { display: flex; justify-content: space-between; align-items: center; }
.top-competition { font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--accent); }
.top-teams { font-size: 1rem; font-weight: 700; }
.top-pred { font-size: 1.05rem; font-weight: 800; padding: 8px 12px; border-radius: 8px; }
.top-conseil { font-size: .82rem; color: var(--text2); font-style: italic; }
.top-meta { font-size: .78rem; color: var(--text2); margin-top: auto; }

/* BTN TOP */
.btn-top { display: inline-block; padding: 9px 20px; background: linear-gradient(135deg,var(--accent),var(--accent2)); color: #fff; border-radius: 99px; font-size: .88rem; font-weight: 700; text-decoration: none; white-space: nowrap; }

/* EMPTY */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text2); }
.empty-icon { font-size: 2.5rem; margin-bottom: 14px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 8px; }
.hint { font-size: .82rem; margin-top: 8px; }
.empty-msg { color: var(--text2); font-size: .9rem; margin-bottom: 12px; }

/* DISCLAIMER */
.disclaimer { background: rgba(231,76,60,.1); border: 1px solid rgba(231,76,60,.3); color: var(--text2); border-radius: 8px; padding: 12px 16px; font-size: .82rem; margin-top: 16px; }

/* FOOTER */
.footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 14px; text-align: center; color: var(--text2); font-size: .78rem; }

/* TOAST */
.toast { position: fixed; bottom: 20px; right: 16px; left: 16px; max-width: 340px; margin: 0 auto; padding: 12px 18px; border-radius: 10px; font-size: .88rem; font-weight: 600; z-index: 9999; animation: slidein .25s ease; }
.toast.hidden { display: none; }
.toast-success { background: var(--green); color: #fff; }
.toast-error   { background: var(--red); color: #fff; }
.toast-info    { background: var(--accent); color: #fff; }
@keyframes slidein { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
