/* ==========================================================================
   XFOOT TOKENS — Design System V1
   Source unique de vérité pour couleurs/espacements/rayons/ombres/typo.
   Les variables historiques ci-dessous (--bg-main, --accent-gold, etc.)
   restent définies et redeviennent de simples alias vers ces tokens — les
   7 pages existantes (jamais réécrites dans cette phase, voir DESIGN
   SYSTEM V1 §22/23) continuent de fonctionner à l'identique, pixel pour
   pixel, tout en étant maintenant réellement adossées au même système de
   tokens plutôt qu'à des valeurs figées.
   ========================================================================== */
:root {
    /* --- Surfaces --- */
    --x-bg: #0B0E16;
    --x-surface: #151925;
    --x-surface-2: #1C2130;
    --x-border: rgba(255, 255, 255, 0.08);

    /* --- Texte --- */
    --x-text: #FFFFFF;
    --x-text-muted: #7C8493;

    /* --- Marque (identité Xfoot : le "vert Xfoot", pas un "or" malgré le
       nom historique --accent-gold — clarifié ici sans renommer l'ancien
       nom pour ne rien casser) --- */
    --x-primary: #2CD9A5;
    --x-primary-hover: #22B589;
    --x-primary-border: rgba(44, 217, 165, 0.3);

    /* --- Sémantique (4 usages distincts, jamais réutilisés l'un pour
       l'autre dans le nouveau système — voir §5 du prompt) --- */
    --x-success: #2CD9A5;
    --x-warning: #E0A82E;
    --x-danger: #FF4D4D;
    --x-info: #6E8AFF; /* pas #3E63DD (ancienne valeur --accent-blue, jamais utilisée sur les 7 pages
       existantes — vérifié par grep) : contraste insuffisant en texte sur badge (3.27:1, sous le seuil
       AA 4.5:1) ; #6E8AFF mesuré à 5.11:1, vérifié via Playwright sur .x-badge-ai */

    /* --- Rayons --- */
    --x-radius-sm: 8px;
    --x-radius-md: 12px;
    --x-radius-lg: 20px;
    --x-radius-pill: 999px;

    /* --- Ombres : hiérarchie neutre et discrète (jamais colorée/glossy —
       voir §9 du prompt, "premium et data-oriented, pas glossy") --- */
    --x-shadow-none: none;
    --x-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --x-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --x-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);

    /* --- Espacements (échelle 4/8/12/16/20/24/32/40/48, voir §7) --- */
    --x-space-1: 4px;
    --x-space-2: 8px;
    --x-space-3: 12px;
    --x-space-4: 16px;
    --x-space-5: 20px;
    --x-space-6: 24px;
    --x-space-8: 32px;
    --x-space-10: 40px;
    --x-space-12: 48px;

    /* --- Typographie --- */
    --x-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* --- Compatibilité — anciennes variables, désormais de simples alias --- */
    --bg-main: var(--x-bg);
    --bg-card: var(--x-surface);
    --bg-card-hover: var(--x-surface-2);
    --text-primary: var(--x-text);
    --text-secondary: var(--x-text-muted);
    --accent-gold: var(--x-primary);
    --accent-gold-hover: var(--x-primary-hover);
    --accent-green: var(--x-primary);
    --accent-red: var(--x-danger);
    --accent-blue: var(--x-info);
    --border-color: var(--x-border);
    --border-gold: var(--x-primary-border);
    /* --accent-warning sert en réalité de couleur d'ERREUR sur
       login/billing/index/vip (messages de formulaire), jamais de
       "warning" au sens propre — conservé sur --x-danger pour ne changer
       aucune page existante. --x-warning (ambre) est le vrai token
       "warning", disponible séparément pour les nouveaux composants. */
    --accent-warning: var(--x-danger);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* App Shell (Mobile First) */
.app-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--bg-main);
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
}

/* Top Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.25rem 1rem 1.25rem;
    position: sticky;
    top: 0;
    background: rgba(19, 21, 29, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.header-title .pro-badge {
    background-color: var(--accent-gold);
    color: #000;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Main Content Area */
.app-content {
    flex: 1;
    padding: 0 1.25rem 6rem 1.25rem; /* bottom padding for nav */
    overflow-y: auto;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    margin-top: 1rem;
}

/* Forms & Inputs */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.custom-select {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%238E93A6%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
}

.custom-select:focus {
    border-color: var(--accent-gold);
}

.btn-predict {
    width: 100%;
    background-color: var(--accent-gold);
    color: #000;
    border: none;
    padding: 1.1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(44, 217, 165, 0.2);
}

.btn-predict:active {
    transform: scale(0.98);
}

.btn-predict:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: var(--text-secondary);
    box-shadow: none;
    color: #fff;
}

/* Match Prediction Card */
.match-card {
    background: linear-gradient(145deg, var(--bg-card) 0%, #151824 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.match-card.gold-border {
    border: 1px solid var(--border-gold);
}

.match-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
}

.league-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-ai {
    background: rgba(35, 193, 107, 0.15);
    color: var(--accent-green);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.teams-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
}

.team-logo {
    width: 44px;
    height: 44px;
    background-color: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.team-logo img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.league-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-name {
    font-weight: 700;
    font-size: 0.85rem;
    line-height: 1.2;
    text-align: center;
    max-width: 130px;
}

.vs-badge {
    background-color: var(--bg-main);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
}

/* Probabilities Section */
.prob-section-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.probabilities {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.prob-box {
    background-color: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 1rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.prob-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.prob-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

.prob-box.highlight {
    background: rgba(35, 193, 107, 0.1);
    border-color: rgba(35, 193, 107, 0.3);
}

.prob-box.highlight .prob-value {
    color: var(--accent-green);
}

/* Extra stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    background: rgba(0,0,0,0.15);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.stat-label {
    color: var(--text-secondary);
}
.stat-val {
    font-weight: 700;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background-color: rgba(28, 31, 46, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 0.8rem 0;
    z-index: 100;
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom));
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    transition: color 0.2s ease;
    cursor: pointer;
}

.nav-item.active {
    color: var(--accent-gold);
}

.nav-icon {
    font-size: 1.4rem;
}

/* Utilities */
.hidden { display: none !important; }
.error-msg {
    color: var(--accent-red);
    background: rgba(255, 77, 77, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 77, 77, 0.2);
}

/* Premium Banner */
.premium-banner {
    background: linear-gradient(135deg, rgba(44, 217, 165, 0.15) 0%, rgba(44, 217, 165, 0.05) 100%);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    margin-top: 1.5rem;
}
.premium-banner h3 { color: var(--accent-gold); margin-bottom: 0.8rem; font-size: 1.2rem; }
.premium-banner p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.5rem; line-height: 1.5; }
.btn-outline-gold {
    background: transparent;
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}
.btn-outline-gold:hover {
    background: var(--accent-gold);
    color: #000;
}

/* Historique & Performance */
.accuracy-hero {
    background: linear-gradient(145deg, var(--bg-card) 0%, #151824 100%);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 1.5rem 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.accuracy-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.25rem;
}

.accuracy-value {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--accent-gold);
    line-height: 1.1;
}

.accuracy-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.3rem;
}

.accuracy-sub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.accuracy-sub {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.accuracy-sub .stat-val {
    font-size: 1.1rem;
    color: var(--accent-gold);
}

.accuracy-sample {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.day-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 1.5rem 0 0.8rem 0;
}

.day-group:first-of-type .day-header {
    margin-top: 0;
}

.result-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
}

.result-badge.correct {
    background: rgba(35, 193, 107, 0.15);
    color: var(--accent-green);
}

.result-badge.incorrect {
    background: rgba(255, 77, 77, 0.15);
    color: var(--accent-red);
}

.result-badge.pending {
    background: rgba(142, 147, 166, 0.15);
    color: var(--text-secondary);
}

/* Scores en direct (live.html) */
.badge-live {
    background: rgba(255, 77, 77, 0.15);
    color: var(--accent-red);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-red);
    animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

@media (prefers-reduced-motion: reduce) {
    .live-dot { animation: none; }
}

.live-minute {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.vs-badge.score {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--text-secondary);
}

.empty-state .empty-icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 0.75rem;
}

/* Pages "carte centrée" (login.html, billing.html) — coquille alternative
   à .app-container : mêmes tokens de couleur, mais pas de bottom-nav ni de
   contenu défilant plein écran, juste un panneau centré verticalement. */

.background-container {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.football {
    position: absolute;
    font-size: 2rem;
    opacity: 0.08;
    animation: floatFootball 12s ease-in-out infinite;
}

.foot-1 { top: 8%; left: 12%; animation-delay: 0s; }
.foot-2 { top: 20%; left: 78%; animation-delay: 1.5s; }
.foot-3 { top: 45%; left: 6%; animation-delay: 3s; }
.foot-4 { top: 65%; left: 85%; animation-delay: 4.5s; }
.foot-5 { top: 82%; left: 18%; animation-delay: 6s; }
.foot-6 { top: 12%; left: 48%; animation-delay: 7.5s; }

@keyframes floatFootball {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(15deg); }
}

.header {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 0 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.logo .icon {
    font-size: 1.3rem;
}

.email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

.main-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem 1.25rem;
    min-height: calc(100vh - 76px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

/* Pages avec bottom-nav fixe (billing.html) : marge basse supplémentaire
   pour que le contenu ne passe jamais dessous. */
.main-content.with-nav {
    padding-bottom: 6rem;
    min-height: calc(100vh - 76px - 4rem);
}

.glass-panel {
    width: 100%;
    background: rgba(28, 31, 46, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.info-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.prediction-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.form-group.full-width,
.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.9rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-gold);
}

.form-actions {
    margin-top: 0.5rem;
}

.btn-primary {
    background-color: var(--accent-gold);
    color: #000;
    border: none;
    padding: 0.9rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--accent-gold-hover);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

.btn-outline {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.btn-warning {
    background-color: var(--accent-red);
    color: #fff;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-warning:hover {
    opacity: 0.9;
}

.password-toggle {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--text-primary) !important;
}

/* Sélecteur de plan (billing.html) */
.plan-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.plan-option {
    cursor: pointer;
}

.plan-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.plan-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease;
}

.plan-card h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.plan-card .price {
    font-size: 1.1rem;
    font-weight: 800;
}

.plan-card .price span {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.plan-option input:checked + .plan-card {
    border-color: var(--accent-gold);
    background: rgba(44, 217, 165, 0.08);
}

.plan-card .badge {
    display: inline-block;
    margin-top: 0.5rem;
    background: var(--accent-green);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
}

/* ==========================================================================
   AI Analysis Redesign : League Pills, Weekly Match Cards & Dynamic Expansion
   ========================================================================== */

.league-nav-container {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.league-nav-container::-webkit-scrollbar {
    display: none;
}

.league-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.league-pill:hover {
    border-color: rgba(44, 217, 165, 0.4);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.league-pill.active {
    background: linear-gradient(135deg, rgba(44, 217, 165, 0.18) 0%, rgba(21, 25, 37, 0.9) 100%);
    border-color: var(--accent-gold);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(44, 217, 165, 0.15);
}

.league-pill .league-flag {
    font-size: 1rem;
    line-height: 1;
}

/* Match Section Header */
.league-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.league-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.match-count-badge {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
}

/* Weekly Fixture Cards List */
.fixtures-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.fixture-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    transition: all 0.2s ease;
    position: relative;
}

.fixture-card:hover {
    border-color: rgba(44, 217, 165, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.fixture-card.expanded {
    border-color: var(--border-gold);
    background: linear-gradient(180deg, var(--bg-card) 0%, #111520 100%);
}

.fixture-top, .fixture-matchup, .btn-fixture-predict, .fixture-prediction-detail {
    position: relative;
    z-index: 1;
}

.fixture-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.fixture-date-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 500;
}

.fixture-status-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.fixture-status-tag.live {
    background: rgba(44, 217, 165, 0.15);
    color: #2cd9a5;
}

.fixture-matchup {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.fixture-team-block {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
}

.fixture-team-block.away {
    flex-direction: row-reverse;
    text-align: right;
}

.fixture-team-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-primary);
    flex-shrink: 0;
}

.fixture-team-avatar img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.fixture-team-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.fixture-vs-divider {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.btn-fixture-predict {
    width: 100%;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, rgba(44, 217, 165, 0.12) 0%, rgba(44, 217, 165, 0.04) 100%);
    border: 1px solid rgba(44, 217, 165, 0.35);
    border-radius: 10px;
    color: var(--accent-gold);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-fixture-predict:hover {
    background: var(--accent-gold);
    color: #000000;
    box-shadow: 0 4px 12px rgba(44, 217, 165, 0.25);
}

.btn-fixture-predict:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Fixture Inline Result Expansion */
.fixture-prediction-detail {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-match-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

/* ==========================================================================
   Animations & Micro-interactions
   ========================================================================== */

/* 1. Staggered Fade-In Up for lists and cards */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

/* 2. Skeleton Loading Shimmer */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
.skeleton-loader {
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 8px;
    color: transparent !important;
    pointer-events: none;
}

/* 3. Hover Lift for Interactive Cards */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.hover-lift:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 10px 24px rgba(44, 217, 165, 0.15);
}

/* 4. Pulse Glow for Live badges or primary buttons */
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(44, 217, 165, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(44, 217, 165, 0); }
    100% { box-shadow: 0 0 0 0 rgba(44, 217, 165, 0); }
}
.pulse-glow {
    animation: pulseGlow 2s infinite;
}

/* 5. Ripple Effect (to be added dynamically via JS or on active state) */
.btn-ripple {
    position: relative;
    overflow: hidden;
}
.btn-ripple:after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform .5s, opacity 1s;
}
.btn-ripple:active:after {
    transform: scale(0, 0);
    opacity: .3;
    transition: 0s;
}

/* ==========================================================================
   Desktop Navigation & Responsive Modern Layout
   ========================================================================== */

.desktop-nav {
    display: none;
}

.desktop-nav-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.desktop-nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.desktop-nav-link.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, rgba(44, 217, 165, 0.18) 0%, rgba(21, 25, 37, 0.95) 100%);
    border-color: var(--accent-gold);
    box-shadow: 0 4px 14px rgba(44, 217, 165, 0.15);
}

.desktop-nav-link .nav-icon {
    font-size: 1.05rem;
    line-height: 1;
}

/* ─── Tablet & Desktop (>= 768px) ─── */
@media (min-width: 768px) {
    body {
        background: radial-gradient(circle at 50% 0%, rgba(44, 217, 165, 0.05) 0%, var(--bg-main) 60%);
        min-height: 100vh;
    }

    /* Expand the App Shell */
    .app-container {
        max-width: 1280px;
        min-height: 100vh;
        margin: 0 auto;
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
        border-left: 1px solid rgba(255, 255, 255, 0.04);
        border-right: 1px solid rgba(255, 255, 255, 0.04);
    }

    /* Header with desktop navigation */
    .app-header {
        padding: 1.25rem 2.5rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border-color);
    }

    .desktop-nav {
        display: flex;
        align-items: center;
        gap: 0.35rem;
    }

    /* Hide mobile bottom navigation on desktop */
    .bottom-nav {
        display: none !important;
    }

    /* Content spacing */
    .app-content {
        padding: 2rem 2.5rem 4rem 2.5rem;
    }

    .header {
        max-width: 1280px;
        padding: 1.5rem 2.5rem 0 2.5rem;
    }

    .main-content {
        max-width: 1280px;
        padding: 2rem 2.5rem 3rem 2.5rem;
    }

    .main-content.with-nav {
        padding-bottom: 3rem;
        min-height: calc(100vh - 76px);
    }

    /* League Pills: wrap smoothly */
    .league-nav-container {
        flex-wrap: wrap;
        overflow-x: visible;
        gap: 0.6rem;
        padding-bottom: 0.5rem;
    }

    .league-pill {
        padding: 0.6rem 1.1rem;
        font-size: 0.85rem;
    }

    /* Fixtures List: Multi-column responsive grid */
    .fixtures-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 1.25rem;
        align-items: start;
    }

    /* Prediction Custom Form */
    #custom-match-section .filter-group {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr auto;
        gap: 1rem;
        align-items: center;
    }

    #custom-match-section .btn-predict {
        margin-bottom: 0;
        height: 100%;
        padding: 0 1.5rem;
    }

    /* History Accuracy Hero */
    .accuracy-hero {
        display: grid;
        grid-template-columns: 240px 1fr;
        gap: 2rem;
        align-items: center;
        text-align: left;
        padding: 2rem 2.5rem;
    }

    .accuracy-main {
        align-items: flex-start;
        margin-bottom: 0;
        border-right: 1px solid var(--border-color);
        padding-right: 1.5rem;
    }

    .accuracy-sub-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 0;
    }

    /* Live Matches Grid */
    #live-matches {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 1.25rem;
        align-items: start;
    }

    /* VIP & Feature Grids */
    .feature-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 1.25rem;
    }

    .vip-hero {
        padding: 2.5rem 2rem;
    }

    .vip-hero h1 {
        font-size: 1.7rem;
    }

    /* Ensemble Form in Arena */
    #ensemble-form {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr auto;
        gap: 1rem;
        align-items: center;
    }

    #ensemble-form .btn-predict {
        margin-bottom: 0;
        height: 100%;
        padding: 0 1.5rem;
    }

    /* Billing & Login Panels */
    .billing-form {
        max-width: 650px;
        margin: 0 auto;
    }

    /* .prediction-form repasse à 2 colonnes à partir de 768px — login.html
       (form#auth-form) garde 1 colonne partout via son style inline
       grid-template-columns:1fr, plus spécifique, donc non affecté ici. */
    .prediction-form {
        grid-template-columns: 1fr 1fr;
    }
}

/* ─── Tablette portrait (768–899px) : nav desktop compacte ───
   Entre 768px (bascule desktop) et ~900px, logo + 5 liens nav + email/
   badge/déconnexion ne tiennent plus sur une seule ligne (mesuré : jusqu'à
   107px de débordement sur arena.html à 768×1024, .header-actions poussé
   hors du viewport et invisible car body a overflow-x:hidden). Palier
   intermédiaire : nav en icônes seules (mêmes émojis, déjà auto-porteurs,
   cohérent avec le principe "icônes compréhensibles" plutôt que texte
   tronqué) + espacements resserrés. Revient à la nav complète à partir de
   900px, où elle tient déjà confortablement (vérifié à 1024×768). */
@media (min-width: 768px) and (max-width: 899px) {
    .app-header {
        padding: 1.25rem 1rem;
        gap: 0.75rem;
    }

    .desktop-nav {
        gap: 0.15rem;
    }

    .desktop-nav-link {
        padding: 0.5rem 0.55rem;
    }

    .desktop-nav-link span:not(.nav-icon) {
        display: none;
    }

    .header-actions {
        gap: 0.5rem;
    }
}

/* ─── Large Desktop Screens (>= 1200px) ─── */
@media (min-width: 1200px) {
    .fixtures-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .accuracy-sub-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================================
   ============================================================================
   XFOOT DESIGN SYSTEM V1
   Fondations visuelles réutilisables (classes .x-*, toutes additives).
   Rien ci-dessous ne modifie ou ne supprime une règle existante au-dessus —
   les 7 pages actuelles (index/history/live/arena/vip/billing/login)
   continuent d'utiliser exclusivement leurs classes historiques et ne sont
   pas affectées par cette section. Catalogue visuel : design-system.html.
   ============================================================================
   ============================================================================ */

/* ==========================================================================
   XFOOT TYPOGRAPHY
   Mobile-first : Display/H1/H2/KPI grossissent légèrement à partir de
   768px, Body/Caption/Label restent stables (priorité lisibilité mobile).
   ========================================================================== */
.x-display {
    font-family: var(--x-font);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--x-text);
}
.x-h1 {
    font-family: var(--x-font);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--x-text);
}
.x-h2 {
    font-family: var(--x-font);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--x-text);
}
.x-h3 {
    font-family: var(--x-font);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--x-text);
}
.x-body {
    font-family: var(--x-font);
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.55;
    color: var(--x-text);
}
.x-body-sm {
    font-family: var(--x-font);
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--x-text-muted);
}
.x-caption {
    font-family: var(--x-font);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--x-text-muted);
}
.x-label {
    font-family: var(--x-font);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--x-text-muted);
}
.x-kpi {
    font-family: var(--x-font);
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--x-primary);
}
@media (min-width: 768px) {
    .x-display { font-size: 2.75rem; }
    .x-h1 { font-size: 1.9rem; }
    .x-h2 { font-size: 1.4rem; }
    .x-kpi { font-size: 3rem; }
}

/* ==========================================================================
   XFOOT BUTTONS
   .btn-predict/.btn-primary/.btn-outline (pages existantes) restent
   inchangés — pas migrés dans cette phase (voir prompt §23).
   ========================================================================== */
.x-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--x-font);
    font-weight: 700;
    border-radius: var(--x-radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.x-btn:focus-visible {
    outline: 2px solid var(--x-primary);
    outline-offset: 2px;
}
.x-btn:disabled,
.x-btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tailles — sm/md respectent ≈44px de zone tactile ; sm (36px) est réservé
   aux contextes desktop denses (tables, toolbars), jamais l'action
   principale d'un écran mobile. */
.x-btn-sm { min-height: 36px; padding: 0 0.85rem; font-size: 0.8rem; }
.x-btn-md { min-height: 44px; padding: 0 1.25rem; font-size: 0.9rem; }
.x-btn-lg { min-height: 52px; padding: 0 1.75rem; font-size: 1rem; }

.x-btn-primary {
    background: var(--x-primary);
    color: #04140F;
    box-shadow: var(--x-shadow-sm);
}
.x-btn-primary:hover { background: var(--x-primary-hover); }
.x-btn-primary:active { transform: scale(0.98); }

.x-btn-secondary {
    background: var(--x-surface-2);
    color: var(--x-text);
    border-color: var(--x-border);
}
.x-btn-secondary:hover { border-color: var(--x-primary-border); }
.x-btn-secondary:active { transform: scale(0.98); }

.x-btn-ghost {
    background: transparent;
    color: var(--x-text-muted);
    border-color: transparent;
}
.x-btn-ghost:hover { color: var(--x-text); background: rgba(255, 255, 255, 0.05); }

.x-btn-danger {
    background: rgba(255, 77, 77, 0.12);
    color: var(--x-danger);
    border-color: rgba(255, 77, 77, 0.3);
}
.x-btn-danger:hover { background: var(--x-danger); color: #1A0505; }

.x-btn-success {
    background: rgba(44, 217, 165, 0.12);
    color: var(--x-success);
    border-color: rgba(44, 217, 165, 0.3);
}
.x-btn-success:hover { background: var(--x-success); color: #04140F; }

/* ==========================================================================
   XFOOT INPUTS
   ========================================================================== */
.x-field { display: flex; flex-direction: column; gap: 0.4rem; }

.x-input,
.x-select,
.x-textarea {
    width: 100%;
    min-height: 44px;
    background: var(--x-surface);
    border: 1px solid var(--x-border);
    color: var(--x-text);
    border-radius: var(--x-radius-md);
    padding: 0.7rem 1rem;
    font-family: var(--x-font);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}
.x-textarea { min-height: 100px; resize: vertical; }

.x-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%238E93A6%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.x-input:focus, .x-select:focus, .x-textarea:focus { border-color: var(--x-primary); }
.x-input.x-input-error, .x-select.x-input-error, .x-textarea.x-input-error { border-color: var(--x-danger); }
.x-input:disabled, .x-select:disabled, .x-textarea:disabled { opacity: 0.5; cursor: not-allowed; }
.x-input::placeholder, .x-textarea::placeholder { color: var(--x-text-muted); }

.x-field-error { font-size: 0.78rem; color: var(--x-danger); }

.x-search { position: relative; }
.x-search .x-input { padding-left: 2.6rem; }
.x-search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--x-text-muted);
    pointer-events: none;
}

/* ==========================================================================
   XFOOT CARDS
   ========================================================================== */
.x-card {
    background: var(--x-surface);
    border: 1px solid var(--x-border);
    border-radius: var(--x-radius-lg);
    padding: var(--x-space-5);
    box-shadow: var(--x-shadow-sm);
}

.x-card-kpi {
    background: var(--x-surface);
    border: 1px solid var(--x-border);
    border-radius: var(--x-radius-lg);
    padding: var(--x-space-5);
    display: flex;
    flex-direction: column;
    gap: var(--x-space-2);
}
.x-card-kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 700;
}
.x-card-kpi-trend.up { color: var(--x-success); }
.x-card-kpi-trend.down { color: var(--x-danger); }

.x-card-match {
    background: var(--x-surface);
    border: 1px solid var(--x-border);
    border-radius: var(--x-radius-lg);
    padding: var(--x-space-4) var(--x-space-5);
}

.x-card-prediction {
    background: var(--x-surface);
    border: 1px solid var(--x-primary-border);
    border-radius: var(--x-radius-lg);
    padding: var(--x-space-5);
}

.x-card-ai {
    background: linear-gradient(145deg, var(--x-surface) 0%, #10141F 100%);
    border: 1px solid var(--x-primary-border);
    border-radius: var(--x-radius-lg);
    padding: var(--x-space-5);
    position: relative;
}

.x-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--x-space-4);
}

/* ==========================================================================
   XFOOT BADGES
   Un statut = une couleur, jamais réattribuée différemment ailleurs.
   ========================================================================== */
.x-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.65rem;
    border-radius: var(--x-radius-pill);
    border: 1px solid transparent;
    white-space: nowrap;
}
.x-badge-active   { background: rgba(44, 217, 165, 0.15); color: var(--x-success); border-color: rgba(44, 217, 165, 0.3); }
.x-badge-inactive { background: rgba(142, 147, 166, 0.12); color: var(--x-text-muted); border-color: var(--x-border); }
.x-badge-live     { background: rgba(255, 77, 77, 0.15); color: var(--x-danger); border-color: rgba(255, 77, 77, 0.3); }
.x-badge-pending  { background: rgba(142, 147, 166, 0.15); color: var(--x-text-muted); border-color: var(--x-border); }
.x-badge-success  { background: rgba(44, 217, 165, 0.15); color: var(--x-success); border-color: rgba(44, 217, 165, 0.3); }
.x-badge-warning  { background: rgba(224, 168, 46, 0.15); color: var(--x-warning); border-color: rgba(224, 168, 46, 0.3); }
.x-badge-error    { background: rgba(255, 77, 77, 0.15); color: var(--x-danger); border-color: rgba(255, 77, 77, 0.3); }
.x-badge-premium  { background: rgba(224, 168, 46, 0.15); color: var(--x-warning); border-color: rgba(224, 168, 46, 0.3); }
.x-badge-ai       { background: rgba(110, 138, 255, 0.15); color: var(--x-info); border-color: rgba(110, 138, 255, 0.3); }

.x-badge-live .x-live-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--x-danger);
    animation: xLivePulse 1.6s ease-in-out infinite;
}
@keyframes xLivePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) { .x-badge-live .x-live-dot { animation: none; } }

/* ==========================================================================
   XFOOT TABLES
   ========================================================================== */
.x-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--x-border);
    border-radius: var(--x-radius-md);
}
.x-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.x-table th, .x-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    white-space: nowrap;
}
.x-table thead th {
    background: rgba(0, 0, 0, 0.25);
    color: var(--x-text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
}
.x-table tbody tr { border-top: 1px solid var(--x-border); transition: background 0.15s ease; }
.x-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.x-table tbody tr.x-row-selected { background: rgba(44, 217, 165, 0.06); }
.x-table-empty, .x-table-loading {
    padding: var(--x-space-8) var(--x-space-4);
    text-align: center;
    color: var(--x-text-muted);
    font-size: 0.85rem;
}

/* Bascule optionnelle en cards sous 640px, pour les futures tables qui
   l'utiliseront (.arena-table existant, inchangé, garde son propre scroll
   horizontal déjà correct — voir Responsive Audit §6). */
.x-table-stack thead { display: none; }
@media (max-width: 639px) {
    .x-table-stack, .x-table-stack tbody, .x-table-stack tr, .x-table-stack td { display: block; width: 100%; }
    .x-table-stack tr { border: 1px solid var(--x-border); border-radius: var(--x-radius-md); margin-bottom: var(--x-space-3); padding: var(--x-space-3); }
    .x-table-stack td { display: flex; justify-content: space-between; gap: var(--x-space-3); padding: 0.35rem 0; border: none; white-space: normal; }
    .x-table-stack td::before { content: attr(data-label); color: var(--x-text-muted); font-weight: 600; font-size: 0.75rem; }
}

/* ==========================================================================
   XFOOT NAVIGATION (préparation)
   Prépare le futur système Sidebar (desktop) + Drawer (mobile), PAS
   branché sur les 7 pages actuelles (qui gardent leur bottom-nav + pills
   de header, corrigés en Responsive Fix V1) — visible uniquement en
   aperçu dans design-system.html.
   ========================================================================== */
.x-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--x-space-1);
    width: 240px;
    background: var(--x-surface);
    border-right: 1px solid var(--x-border);
    padding: var(--x-space-4);
}
.x-sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--x-space-3);
    padding: 0.65rem var(--x-space-3);
    border-radius: var(--x-radius-md);
    color: var(--x-text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    min-height: 44px;
}
.x-sidebar-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--x-text); }
.x-sidebar-link.active { background: rgba(44, 217, 165, 0.12); color: var(--x-text); border: 1px solid var(--x-primary-border); }

.x-drawer-trigger { display: none; }
@media (max-width: 767px) {
    .x-sidebar { display: none; }
    .x-drawer-trigger {
        display: inline-flex;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
        background: var(--x-surface-2);
        border: 1px solid var(--x-border);
        border-radius: var(--x-radius-md);
        color: var(--x-text);
    }
}

/* ==========================================================================
   XFOOT DATA VISUALIZATION
   CSS pur, aucune librairie ajoutée (le site n'en a jamais eu besoin).
   ========================================================================== */
.x-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--x-radius-pill);
    overflow: hidden;
}
.x-progress-bar {
    height: 100%;
    border-radius: var(--x-radius-pill);
    background: var(--x-primary);
    transition: width 0.4s ease;
}
.x-progress-bar.warning { background: var(--x-warning); }
.x-progress-bar.danger { background: var(--x-danger); }

.x-confidence { display: flex; align-items: center; gap: var(--x-space-3); }
.x-confidence-track { flex: 1; }
.x-confidence-value {
    font-size: 0.85rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 42px;
    text-align: right;
}

.x-probability-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--x-space-3);
    font-size: 0.85rem;
    padding: 0.4rem 0;
}
.x-probability-row .x-probability-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--x-radius-pill);
    overflow: hidden;
}
.x-probability-row .x-probability-fill {
    height: 100%;
    background: var(--x-primary);
    border-radius: var(--x-radius-pill);
}

.x-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: var(--x-space-2);
    height: 120px;
    padding-top: var(--x-space-3);
}
.x-bar-chart .x-bar {
    flex: 1;
    background: var(--x-primary);
    border-radius: var(--x-radius-sm) var(--x-radius-sm) 0 0;
    min-height: 4px;
}
.x-bar-chart .x-bar.muted { background: var(--x-surface-2); }

.x-sparkline { display: flex; align-items: flex-end; gap: 2px; height: 32px; }
.x-sparkline .x-bar { width: 4px; background: var(--x-primary-border); border-radius: 2px; }
.x-sparkline .x-bar.current { background: var(--x-primary); }

/* ==========================================================================
   XFOOT FOOTBALL COMPONENTS
   ========================================================================== */
.x-team { display: flex; align-items: center; gap: var(--x-space-3); }
.x-team-logo {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--x-border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 800;
    flex-shrink: 0;
}
.x-team-logo img { width: 20px; height: 20px; object-fit: contain; }
.x-team-name { font-weight: 700; font-size: 0.88rem; }
.x-team-rating { font-size: 0.72rem; color: var(--x-text-muted); }

.x-match { display: flex; align-items: center; justify-content: space-between; gap: var(--x-space-3); }
.x-match-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--x-text-muted);
    margin-bottom: var(--x-space-2);
}
.x-match-score {
    font-size: 1rem; font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--x-border);
    border-radius: var(--x-radius-sm);
    padding: 0.25rem 0.6rem;
}

.x-prediction-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    border-top: 1px solid var(--x-border);
    font-size: 0.85rem;
}
.x-prediction-row:first-child { border-top: none; }
.x-prediction-market { color: var(--x-text-muted); }
.x-prediction-value { font-weight: 800; }

.x-league { display: flex; align-items: center; gap: var(--x-space-3); }
.x-league-logo { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
.x-league-name { font-weight: 700; font-size: 0.85rem; }
.x-league-country { font-size: 0.72rem; color: var(--x-text-muted); }

/* ==========================================================================
   XFOOT AI VISUAL LANGUAGE
   Un seul langage visuel pour tout ce qui vient de l'IA Xfoot (Score,
   Confidence, Value, Model, Arena, Signal). Pas d'effet excessif : pas de
   glow massif, pas de gradient partout — un marqueur "XFOOT AI" + la
   couleur --x-primary utilisée avec parcimonie (prompt §18).
   ========================================================================== */
.x-ai-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--x-primary);
    background: rgba(44, 217, 165, 0.1);
    border: 1px solid var(--x-primary-border);
    border-radius: var(--x-radius-pill);
    padding: 0.2rem 0.6rem;
}

.x-ai-score { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; text-align: center; }
.x-ai-score-value { font-size: 1.6rem; font-weight: 800; color: var(--x-primary); font-variant-numeric: tabular-nums; }
.x-ai-score-label { font-size: 0.68rem; color: var(--x-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.x-ai-value-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--x-radius-sm);
}
.x-ai-value-tag.positive { color: var(--x-success); background: rgba(44, 217, 165, 0.1); }
.x-ai-value-tag.neutral { color: var(--x-text-muted); background: rgba(142, 147, 166, 0.1); }
.x-ai-value-tag.negative { color: var(--x-danger); background: rgba(255, 77, 77, 0.1); }

.x-ai-signal { display: flex; align-items: center; gap: var(--x-space-2); font-size: 0.8rem; }
.x-ai-signal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--x-primary); flex-shrink: 0; }

/* ==========================================================================
   XFOOT DESIGN SYSTEM — Responsive utilities (mobile-first, mêmes
   breakpoints que le reste du site : 768px / 1200px)
   ========================================================================== */
.x-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--x-space-4);
}
@media (min-width: 768px) {
    .x-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
@media (min-width: 1200px) {
    .x-grid-3 { grid-template-columns: repeat(3, 1fr); }
}


