/* ───────────────────────── Thème « stade de nuit » ───────────────────────── */
:root {
    --bg: #0b1220;
    --bg-soft: #111a2c;
    --card: #16213a;
    --card-border: #243250;
    --ink: #e8edf6;
    --ink-muted: #93a1ba;
    --green: #22c55e;
    --green-deep: #15803d;
    --pitch-a: #1c7a3d;
    --pitch-b: #186a35;
    --gold: #fbbf24;
    --danger: #f87171;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html.modal-open { overflow: hidden; }

body {
    margin: 0;
    font-family: "Inter", system-ui, sans-serif;
    background:
        radial-gradient(1200px 500px at 50% -10%, rgba(34, 197, 94, 0.14), transparent 60%),
        var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* la scène stade et le ticker débordent volontairement en 100vw */
}

/* ─────────── Univers par jeu : le thème bascule sur la page entière ─────── */
body.theme-team {
    background:
        radial-gradient(1000px 480px at 20% -10%, rgba(34, 197, 94, 0.22), transparent 60%),
        radial-gradient(1000px 480px at 85% -10%, rgba(34, 197, 94, 0.1), transparent 55%),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px) 0 0 / 100% 56px,
        var(--bg);
}
body.theme-player {
    --green: #eab308;
    --green-deep: #a16207;
    background:
        radial-gradient(900px 460px at 50% -10%, rgba(234, 179, 8, 0.16), transparent 60%),
        radial-gradient(500px 320px at 90% 25%, rgba(234, 179, 8, 0.05), transparent 65%),
        var(--bg);
}
body.theme-player .btn:hover { background: #facc15; }
body.theme-player .site-header a:hover, body.theme-player a { color: var(--green); }
body.theme-player .site-header a { color: var(--ink); }

h1, h2, h3, .brand { font-family: "Sora", "Inter", sans-serif; }

a { color: var(--green); }

/* ───────────────────────────────── Header ────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1.4rem;
    background: rgba(11, 18, 32, 0.82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
}
.site-nav { display: flex; align-items: center; gap: 1.1rem; }
.site-header a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.site-header a:hover { color: var(--green); }
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.45rem;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--ink);
    cursor: pointer;
}
.nav-toggle:hover { color: var(--green); }
.nav-toggle .icon { width: 1.45rem; height: 1.45rem; }
.nav-toggle .nav-icon-close { display: none; }
.nav-open .nav-toggle .nav-icon-open { display: none; }
.nav-open .nav-toggle .nav-icon-close { display: block; }
.brand { font-size: 1.12rem; letter-spacing: 0.2px; display: flex; align-items: center; gap: 0.55rem; font-weight: 700; }
.brand strong { color: var(--green); font-weight: 800; }
.brand .icon { width: 1.35rem; height: 1.35rem; color: var(--green); vertical-align: middle; }
.user-chip { color: var(--ink-muted); font-size: 0.9rem; }
.premium-star { color: var(--gold); margin-left: 0.2rem; }
.nav-muted { color: var(--ink-muted) !important; font-size: 0.88rem !important; }
.nav-muted:hover { color: var(--danger) !important; }

.container { width: 100%; max-width: 920px; margin: 0 auto; padding: 1.6rem 1.1rem 4rem; flex: 1; }

.site-footer {
    text-align: center;
    padding: 1.2rem;
    color: var(--ink-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--card-border);
}

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

/* ─────────────────────────────── Flash & boutons ─────────────────────────── */
.flash {
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.1rem;
    border: 1px solid;
    font-weight: 500;
}
.flash-warning { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.4); color: var(--gold); }
.flash-info { background: rgba(96, 165, 250, 0.1); border-color: rgba(96, 165, 250, 0.4); color: #93c5fd; }
.flash-danger { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.4); color: var(--danger); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--green);
    color: #04130a;
    border: none;
    padding: 0.65rem 1.4rem;
    border-radius: 10px;
    font-size: 0.98rem;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease;
}
.btn:hover { background: #2dd368; }
.btn:active { background: var(--green-deep); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.btn-big { font-size: 1.08rem; padding: 0.85rem 2.1rem; border-radius: 12px; }
.btn-small { padding: 0.4rem 0.95rem; font-size: 0.88rem; }
.btn-secondary { background: var(--card); color: var(--ink); border: 1px solid var(--card-border); }
.btn-secondary:hover { background: var(--card); border-color: var(--green); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.45); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.08); }

/* Icônes inline (UX Icons) */
.icon { width: 1.05em; height: 1.05em; vertical-align: -0.18em; flex-shrink: 0; }
.icon-lg { width: 1.5rem; height: 1.5rem; }

/* ──────────────────────────────── Accueil ────────────────────────────────── */
/* Scène « stade de nuit » pleine largeur : tribunes + flashs, projecteurs qui
   balayent, sol en perspective et compo fantôme qui flotte sur la pelouse. */
.stadium {
    position: relative;
    width: 100vw;
    margin: -1.6rem 0 0 calc(50% - 50vw);
    padding: 4.6rem 1rem 11.5rem;
    overflow: hidden;
    text-align: center;
}
/* Vignette : la nuit se referme sur les bords de la scène */
.stadium::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(120% 95% at 50% 32%, transparent 52%, rgba(4, 8, 16, 0.6) 100%);
}

/* Tribunes : grain de foule en pointillés + flashs de photographes */
.stadium-stands {
    position: absolute;
    inset: 0 0 auto;
    height: 46%;
    background:
        radial-gradient(circle 1.5px at 50% 50%, rgba(148, 163, 184, 0.26) 99%, transparent) 0 0 / 13px 10px,
        radial-gradient(circle 1.5px at 50% 50%, rgba(148, 163, 184, 0.15) 99%, transparent) 6px 5px / 13px 10px,
        linear-gradient(180deg, #0a101d, #0d1526);
    -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent);
    mask-image: linear-gradient(to bottom, #000 45%, transparent);
}
.stadium-stands .flash {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.75);
    opacity: 0;
    animation: camera-flash 6s linear infinite;
}
@keyframes camera-flash {
    0%, 4%, 100% { opacity: 0; }
    1.5% { opacity: 1; }
    2.5% { opacity: 0.25; }
}

/* Projecteurs : deux cônes de lumière qui balayent lentement le terrain */
.floodlight {
    position: absolute;
    top: 0;
    width: 60vw;
    height: 100%;
    pointer-events: none;
    filter: blur(12px);
}
.floodlight-l {
    left: 0;
    background: conic-gradient(from 0deg at 0% 0%,
        transparent 116deg, rgba(167, 243, 196, 0.14) 128deg 142deg, transparent 154deg);
    transform-origin: top left;
    animation: sweep-l 13s ease-in-out infinite alternate;
}
.floodlight-r {
    right: 0;
    background: conic-gradient(from 0deg at 100% 0%,
        transparent 206deg, rgba(167, 243, 196, 0.14) 218deg 232deg, transparent 244deg);
    transform-origin: top right;
    animation: sweep-r 13s ease-in-out infinite alternate;
}
@keyframes sweep-l { from { transform: rotate(-5deg); } to { transform: rotate(6deg); } }
@keyframes sweep-r { from { transform: rotate(6deg); } to { transform: rotate(-5deg); } }

/* Compo fantôme : onze « ? » qui flottent sur la pelouse, taille = profondeur */
.stadium-lineup {
    --scale: 1;
    position: absolute;
    left: 50%;
    bottom: 2.4rem;
    transform: translateX(-50%);
    width: min(660px, 94%);
    height: 165px;
    pointer-events: none;
}
.stadium-lineup span {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--s) * var(--scale));
    height: calc(var(--s) * var(--scale));
    border-radius: 50%;
    background: rgba(9, 15, 28, 0.85);
    border: 1.5px solid rgba(134, 239, 172, 0.5);
    color: #b9f6cf;
    font-family: "Sora", sans-serif;
    font-weight: 800;
    font-size: calc(var(--s) * var(--scale) * 0.46);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), 0 0 16px rgba(34, 197, 94, 0.2);
    animation: token-bob 3.8s ease-in-out infinite;
}
@keyframes token-bob {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -7px; }
}

.stadium-floor {
    position: absolute;
    left: 50%;
    bottom: -12%;
    width: 170%;
    height: 62%;
    transform: translateX(-50%) perspective(650px) rotateX(57deg);
    background:
        radial-gradient(circle at 50% 12%, transparent 88px, rgba(34, 197, 94, 0.5) 89px 91px, transparent 92px),
        linear-gradient(rgba(34, 197, 94, 0.32) 2px, transparent 2px) 0 0 / 100% 88px,
        linear-gradient(90deg, rgba(34, 197, 94, 0.22) 2px, transparent 2px) 0 0 / 128px 100%;
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9) 30%, transparent 95%);
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9) 30%, transparent 95%);
    pointer-events: none;
}
.stadium-content { position: relative; z-index: 1; }

/* Variante « page » : le décor du stade derrière un contenu (inscription, connexion…) */
.stadium-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.2rem 1rem 4.6rem;
    text-align: left;
    min-height: calc(100vh - 220px);
}
.stadium-page .stadium-content { width: 100%; }
.stadium-page .auth-card {
    margin: 0 auto;
    background: rgba(13, 20, 38, 0.88);
    border-color: rgba(134, 239, 172, 0.22);
    backdrop-filter: blur(6px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 44px rgba(34, 197, 94, 0.08);
}
.stadium-page .auth-card h1 {
    font-size: 1.8rem;
    text-shadow: 0 0 32px rgba(34, 197, 94, 0.35);
}
.stadium-page .card-kicker { color: rgba(134, 239, 172, 0.85); margin-bottom: 0.45rem; }

/* Tableau d'affichage : les chiffres clés façon panneau LED du stade */
.scoreboard {
    display: inline-flex;
    margin-top: 1.7rem;
    background: rgba(5, 9, 18, 0.82);
    border: 1px solid rgba(134, 239, 172, 0.25);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(4px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), inset 0 0 26px rgba(34, 197, 94, 0.07);
}
.scoreboard > div {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.8rem 1.6rem;
}
.scoreboard > div + div { border-left: 1px solid rgba(134, 239, 172, 0.16); }
.scoreboard strong {
    font-family: "Sora", sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
    color: var(--green);
    text-shadow: 0 0 14px rgba(34, 197, 94, 0.75);
}
.scoreboard span {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.hero-cta { margin-top: 1.8rem; display: flex; flex-direction: column; gap: 0.7rem; align-items: center; }
.hero-cta .muted { font-size: 0.92rem; margin: 0; }

/* Coup d'envoi : le contenu du hero entre en scène en cascade */
.stadium-content > * { animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.stadium-content > :nth-child(2) { animation-delay: 0.1s; }
.stadium-content > :nth-child(3) { animation-delay: 0.2s; }
.stadium-content > :nth-child(4) { animation-delay: 0.32s; }
.stadium-content > :nth-child(5) { animation-delay: 0.44s; }
@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bandeau défilant des équipes de légende, façon panneau publicitaire LED */
.legend-ticker {
    width: 100vw;
    margin: 0 0 1.9rem calc(50% - 50vw);
    padding: 0.65rem 0;
    overflow: hidden;
    border-top: 1px solid rgba(134, 239, 172, 0.18);
    border-bottom: 1px solid rgba(134, 239, 172, 0.18);
    background: rgba(5, 9, 18, 0.75);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7% 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 7% 93%, transparent);
}
.ticker-track {
    display: inline-flex;
    white-space: nowrap;
    animation: ticker 48s linear infinite;
    will-change: transform;
}
.ticker-track span {
    color: rgba(134, 239, 172, 0.75);
    font-weight: 600;
    font-size: 0.84rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}
.ticker-track span::after { content: "·"; margin: 0 1.3rem; color: rgba(134, 239, 172, 0.3); text-shadow: none; }
@keyframes ticker { to { transform: translateX(-50%); } }

.hero { text-align: center; margin: 2.2rem 0 2.6rem; }
.stadium .hero { margin: 0; }
.hero h1 {
    font-size: clamp(2.6rem, 8vw, 4.6rem);
    font-weight: 800;
    margin: 0 0 0.6rem;
    line-height: 1.06;
    text-shadow: 0 0 60px rgba(34, 197, 94, 0.5), 0 4px 30px rgba(0, 0, 0, 0.6);
}
.hero h1 .accent { color: var(--green); }
.hero-overline {
    display: block;
    color: var(--ink-muted);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    margin-bottom: 0.9rem;
}
.hero p { color: var(--ink-muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto; }

.quota {
    text-align: center;
    margin: 0 0 1.6rem;
    font-size: 1rem;
    color: var(--ink-muted);
}
.quota strong { color: var(--green); font-size: 1.1rem; }
.quota .upsell { color: var(--gold); font-weight: 600; }

.start-form { display: flex; flex-direction: column; gap: 1.4rem; }
.start-form fieldset { border: none; margin: 0; padding: 0; }
.start-form legend {
    font-family: "Sora", sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.7rem;
    padding: 0;
}
.start-form legend small { color: var(--ink-muted); font-weight: 400; font-family: "Inter", sans-serif; }

/* Niveaux de jeu : un écusson par mode, sa couleur, sa jauge de difficulté */
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.mode-card {
    --mode-accent: var(--green);
    position: relative;
    display: grid;
    justify-items: center;
    gap: 0.4rem;
    text-align: center;
    background: var(--card);
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.25rem 0.9rem 1.15rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease,
        transform 0.15s ease, box-shadow 0.15s ease;
}
.mode-beginner { --mode-accent: #4ade80; }
.mode-senior { --mode-accent: #fb923c; }
.mode-veteran { --mode-accent: #fbbf24; }
.mode-card:hover {
    border-color: color-mix(in srgb, var(--mode-accent) 55%, transparent);
    transform: translateY(-2px);
}
.mode-card input { position: absolute; opacity: 0; }
.mode-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--mode-accent) 12%, transparent);
    border: 1.5px solid color-mix(in srgb, var(--mode-accent) 40%, transparent);
    color: var(--mode-accent);
    margin-bottom: 0.15rem;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.mode-badge .icon { width: 1.45rem; height: 1.45rem; }
.mode-card strong { font-family: "Sora", sans-serif; font-size: 1.02rem; }
.mode-pips { display: flex; gap: 4px; align-items: flex-end; height: 12px; }
.mode-pips i { width: 5px; border-radius: 2px; background: rgba(255, 255, 255, 0.13); }
.mode-pips i:nth-child(1) { height: 6px; }
.mode-pips i:nth-child(2) { height: 9px; }
.mode-pips i:nth-child(3) { height: 12px; }
.mode-pips .pip-on {
    background: var(--mode-accent);
    box-shadow: 0 0 6px color-mix(in srgb, var(--mode-accent) 60%, transparent);
}
.mode-card small { color: var(--ink-muted); line-height: 1.4; }
/* Coche de sélection en haut à droite */
.mode-card::after {
    content: "";
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: 1.5px solid var(--card-border);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.mode-card:has(input:checked) {
    border-color: var(--mode-accent);
    background: color-mix(in srgb, var(--mode-accent) 8%, var(--card));
    box-shadow: 0 0 26px color-mix(in srgb, var(--mode-accent) 16%, transparent);
}
.mode-card:has(input:checked) .mode-badge {
    background: color-mix(in srgb, var(--mode-accent) 22%, transparent);
    box-shadow: 0 0 18px color-mix(in srgb, var(--mode-accent) 35%, transparent);
}
.mode-card:has(input:checked)::after {
    border-color: var(--mode-accent);
    background: var(--mode-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23081018' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4 10-10'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
}
.mode-card:has(input:focus-visible) { outline: 2px solid var(--mode-accent); outline-offset: 2px; }

.decades { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.decade-chip {
    position: relative;
    padding: 0.45rem 1.05rem;
    border-radius: 999px;
    border: 1.5px solid var(--card-border);
    background: var(--card);
    color: var(--ink-muted);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.decade-chip:hover { border-color: rgba(34, 197, 94, 0.5); color: var(--ink); }
.decade-chip input { position: absolute; opacity: 0; }
.decade-chip:has(input:checked) {
    background: rgba(34, 197, 94, 0.16);
    border-color: var(--green);
    color: #86efac;
}

.start-cta { text-align: center; margin-top: 0.6rem; }

/* ─────────────────────────────── Plateau de jeu ──────────────────────────── */
.game-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.game-header h1 { margin: 0 0 0.2rem; font-size: 1.7rem; }
.game-header .muted { font-size: 0.92rem; }
.game-score { text-align: right; }
.game-score .score-big { font-family: "Sora", sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--green); }
.game-score .score-sub { color: var(--ink-muted); font-size: 0.85rem; }

.progress-track {
    height: 7px;
    border-radius: 99px;
    background: var(--card);
    overflow: hidden;
    margin-bottom: 1.2rem;
}
.progress-fill {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--green-deep), var(--green));
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.pitch {
    position: relative;
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    grid-template-columns: repeat(5, 1fr);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.06), transparent 55%),
        repeating-linear-gradient(to bottom, var(--pitch-a) 0 16.66%, var(--pitch-b) 16.66% 33.33%);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 1.6rem 0.4rem;
    min-height: 580px;
    margin: 0 0 1.2rem;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.3), var(--shadow);
    overflow: hidden;
}

/* Marquages du terrain */
.pitch-markings { position: absolute; inset: 0; pointer-events: none; }
.pitch-markings span { position: absolute; --line: rgba(255, 255, 255, 0.45); }
.pm-halfway { top: 50%; left: 0; right: 0; border-top: 2px solid var(--line); }
.pm-circle {
    top: 50%; left: 50%;
    width: 21%; aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 2px solid var(--line);
    border-radius: 50%;
}
.pm-box { left: 50%; transform: translateX(-50%); width: 58%; height: 13%; border: 2px solid var(--line); }
.pm-box-top { top: -2px; border-top: none; }
.pm-box-bottom { bottom: -2px; border-bottom: none; }
.pm-six { left: 50%; transform: translateX(-50%); width: 28%; height: 5.5%; border: 2px solid var(--line); }
.pm-six-top { top: -2px; border-top: none; }
.pm-six-bottom { bottom: -2px; border-bottom: none; }
.pm-spot { width: 5px; height: 5px; background: var(--line); border-radius: 50%; left: 50%; transform: translateX(-50%); }
.pm-spot-center { top: 50%; transform: translate(-50%, -50%); }
.pm-spot-top { top: 9.5%; }
.pm-spot-bottom { bottom: 9.5%; }

/* Pastilles joueurs, façon graphique de compo TV */
.player-token {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    background: none;
    border: none;
    padding: 0.2rem;
    cursor: pointer;
    min-width: 0;
    font-family: "Inter", sans-serif;
}
.token-disc {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #0d1626;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    font-family: "Sora", sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.player-token:hover:not(:disabled) .token-disc,
.bench-token:hover:not(:disabled) .token-disc {
    border-color: var(--gold);
    transform: scale(1.08);
}
.is-selected .token-disc {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.35), 0 3px 8px rgba(0, 0, 0, 0.4);
}
.is-found .token-disc {
    background: var(--green);
    border-color: #fff;
    color: #04130a;
    animation: reveal 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.is-missed .token-disc { background: #4c1d1d; border-color: rgba(255, 255, 255, 0.25); color: #fecaca; }
@keyframes reveal {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.token-name {
    max-width: 100%;
    padding: 0.12rem 0.5rem;
    border-radius: 5px;
    background: rgba(7, 12, 22, 0.6);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.is-found .token-name,
.is-missed .token-name {
    background: rgba(255, 255, 255, 0.92);
    color: #0b1220;
    font-size: 0.72rem;
    letter-spacing: 0;
    font-weight: 600;
}
.is-missed .token-name { text-decoration: line-through; color: #9b2c2c; }

.bench-title { display: flex; align-items: center; gap: 0.45rem; margin: 1.3rem 0 0.6rem; font-size: 1.05rem; }
.bench-title .icon { color: var(--ink-muted); }
.trophy-icon { color: var(--gold); }
.bench { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.bench-token {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.45rem 0.85rem 0.45rem 0.5rem;
    cursor: pointer;
    font-family: "Inter", sans-serif;
    transition: border-color 0.15s ease;
}
.bench-token:hover:not(:disabled) { border-color: var(--gold); }
.bench-token .token-disc { width: 38px; height: 38px; font-size: 0.9rem; }
.bench-token .token-name { background: none; padding: 0; font-size: 0.85rem; color: var(--ink); text-align: left; }
.bench-token.is-found .token-name { background: none; color: var(--ink); }
.bench-token.is-missed .token-name { background: none; color: #fca5a5; }
.bench-info { display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; min-width: 0; }
.bench-minute { font-size: 0.72rem; color: var(--ink-muted); }

/* ─────────────────────── Modal de saisie ─────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(4, 8, 16, 0.7);
    backdrop-filter: blur(3px);
    animation: fade-in 0.15s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
    position: relative;
    width: 100%;
    max-width: 460px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem 1.3rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    animation: modal-in 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modal-in {
    from { transform: translateY(14px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes slide-up {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
}
.modal-close:hover { background: var(--bg-soft); color: var(--ink); }
.modal-close .icon { width: 1.15rem; height: 1.15rem; }
.modal-title {
    margin: 0 0 0.2rem;
    font-size: 1.15rem;
    padding-right: 2.2rem;
}
.modal-number { color: var(--ink-muted); font-weight: 600; font-size: 0.95rem; margin-left: 0.3rem; }
.modal-context { margin: 0 0 0.3rem; color: var(--ink-muted); font-size: 0.92rem; }
.modal-context .icon { color: var(--ink-muted); }
.modal-tip { margin: 0.7rem 0 0; color: var(--ink-muted); font-size: 0.82rem; }
.modal .guess-form { margin-top: 0.9rem; }
.modal .guess-feedback { margin: 0.7rem 0 0; }
.hint { display: block; margin: 0.4rem 0 0; color: var(--gold); font-size: 0.95rem; }
.guess-form { display: flex; gap: 0.6rem; }
.guess-form input[type="text"] {
    flex: 1;
    padding: 0.7rem 0.95rem;
    font-size: 1.05rem;
    border: 1.5px solid var(--card-border);
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--ink);
    font-family: "Inter", sans-serif;
}
.guess-form input[type="text"]::placeholder { color: var(--ink-muted); }
.guess-form input[type="text"]:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }

.guess-feedback { font-weight: 700; margin: 0.7rem 0 0; }
.guess-correct { color: var(--green); animation: slide-up 0.25s ease; }
.guess-wrong { color: var(--danger); animation: shake 0.35s ease; }
.guess-ambiguous { color: var(--gold); }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.guess-help { text-align: center; color: var(--ink-muted); margin-top: 1rem; }

.game-actions { margin-top: 1.5rem; text-align: right; }

.game-over {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.6rem;
    margin: 0 0 1.4rem;
    text-align: center;
    box-shadow: var(--shadow);
    animation: slide-up 0.3s ease;
}
.game-over h2 { margin: 0 0 0.4rem; font-size: 1.5rem; }
.game-over p { color: var(--ink-muted); margin: 0 0 1rem; }
.game-over .btn { margin: 0.2rem 0.3rem; }
.game-over-perfect {
    border-color: rgba(251, 191, 36, 0.5);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.1), var(--card));
}
.game-over-perfect h2 { color: var(--gold); }

/* ─────────────────── Cartes de jeu immersives (accueil) ──────────────────── */
.game-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; margin-top: 1.8rem; }
.game-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 1.7rem 1.6rem;
    min-height: 330px;
    display: flex;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-team {
    background:
        radial-gradient(420px 300px at 105% 110%, rgba(34, 197, 94, 0.25), transparent 70%),
        linear-gradient(155deg, #11331f 0%, #0d2014 45%, var(--card) 100%);
}
.card-team:hover { border-color: rgba(34, 197, 94, 0.6); }
.card-player {
    --green: #eab308;
    --green-deep: #a16207;
    background:
        radial-gradient(420px 300px at 105% 110%, rgba(234, 179, 8, 0.2), transparent 70%),
        linear-gradient(155deg, #38290c 0%, #211807 45%, var(--card) 100%);
}
.card-player:hover { border-color: rgba(234, 179, 8, 0.55); }
.card-art {
    position: absolute;
    right: -1.5rem;
    top: 50%;
    transform: translateY(-50%) rotate(6deg);
    width: 46%;
    max-width: 230px;
    pointer-events: none;
    opacity: 0.32;
    transition: opacity 0.2s ease, transform 0.25s ease;
}
.card-team .card-art { color: #5fd98a; }
.card-player .card-art { color: #f3cc4a; }
.game-card:hover .card-art { opacity: 0.5; transform: translateY(-52%) rotate(3deg) scale(1.03); }
.card-body { position: relative; display: flex; flex-direction: column; gap: 0.65rem; max-width: 66%; }
.card-kicker {
    display: block;
    color: var(--ink-muted);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}
.game-card h2 { margin: 0; font-size: 1.45rem; }
.game-card p { margin: 0; color: var(--ink-muted); line-height: 1.5; }
.card-stats { display: flex; gap: 0.5rem; list-style: none; padding: 0; margin: 0.2rem 0 0; flex-wrap: wrap; }
.card-stats li {
    padding: 0.22rem 0.7rem;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    font-weight: 600;
}
.game-card .start-form { margin-top: auto; gap: 0.8rem; padding-top: 0.9rem; }
.game-card .btn-big { align-self: flex-start; }

.decade-filter summary {
    cursor: pointer;
    color: var(--ink-muted);
    font-size: 0.88rem;
    font-weight: 600;
    list-style: none;
}
.decade-filter summary::before { content: "▸ "; }
.decade-filter[open] summary::before { content: "▾ "; }
.decade-filter .decades { margin-top: 0.6rem; }

/* ─────────────────────── Devine le joueur ────────────────────────────────── */
.mystery-id { display: flex; align-items: center; gap: 1rem; }
.mystery-avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px dashed rgba(234, 179, 8, 0.6);
    background: rgba(234, 179, 8, 0.08);
    color: var(--green);
    font-family: "Sora", sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
}
.player-board .game-header h1 { font-size: 1.5rem; }

.clue-list { list-style: none; margin: 1.2rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.clue-card {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 0.85rem 1.1rem;
    font-size: 1.02rem;
}
.clue-latest { border-color: rgba(34, 197, 94, 0.55); animation: slide-up 0.25s ease; }
.clue-index {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--ink-muted);
    font-size: 0.8rem;
    font-weight: 700;
    align-self: center;
}
.clue-latest .clue-index { background: rgba(34, 197, 94, 0.16); color: var(--green); }
body.theme-player .clue-latest { border-color: rgba(234, 179, 8, 0.55); }
body.theme-player .clue-latest .clue-index { background: rgba(234, 179, 8, 0.16); color: var(--green); }
body.theme-player .guess-form input[type="text"]:focus { box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.18); }
body.theme-player .score-pill { background: rgba(234, 179, 8, 0.15); color: var(--green); }
.letter-board { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin: 1.2rem 0; }
.letter-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.5rem;
    border-radius: 8px;
    background: var(--card);
    border: 1px solid var(--card-border);
    font-family: "Sora", sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
}
.letter-hidden { background: var(--bg-soft); border-style: dashed; }
.letter-shown { border-color: rgba(234, 179, 8, 0.55); color: var(--green); animation: slide-up 0.25s ease; }
.letter-gap { width: 1.1rem; }
@media (max-width: 680px) {
    .letter-board { gap: 0.22rem; }
    .letter-tile { width: 1.7rem; height: 2.1rem; font-size: 0.95rem; }
    .letter-gap { width: 0.8rem; }
}
.player-guess-form { margin-top: 0.4rem; }
.player-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.2rem;
}
.score-pill-missed { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.results-section { display: flex; align-items: center; gap: 0.5rem; font-size: 1.15rem; margin: 1.6rem 0 0.7rem; }
.results-section .icon { color: var(--green); }

/* ─────────────────────── Auth, résultats, tableaux ───────────────────────── */
.auth-card {
    max-width: 420px;
    margin: 2.5rem auto;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 0.4rem; font-size: 1.6rem; }
.auth-card > .muted { margin-top: 0; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.2rem; }
.auth-form > label, .auth-form .form-label,
.auth-form > div { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.92rem; }
.auth-form input[type="email"], .auth-form input[type="password"], .auth-form input[type="text"] {
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    border: 1.5px solid var(--card-border);
    border-radius: 10px;
    background: var(--bg-soft);
    color: var(--ink);
}
.auth-form input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
.auth-form .btn { margin-top: 0.4rem; }
.auth-form ul { margin: 0.3rem 0 0; padding-left: 1.1rem; color: var(--danger); font-size: 0.85rem; font-weight: 400; }
.auth-form .help-text { color: var(--ink-muted); font-size: 0.8rem; font-weight: 400; margin: 0.1rem 0 0; }
.auth-alt { text-align: center; margin-top: 1.1rem; font-size: 0.92rem; }
.resend-form { margin-top: 1.3rem; text-align: center; }
.auth-card-wide { max-width: 640px; }
.form-mode { display: flex; flex-direction: column; gap: 0.6rem; }
.form-label-text { font-weight: 600; font-size: 0.92rem; }
.form-mode .mode-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 680px) { .form-mode .mode-grid { grid-template-columns: 1fr; } }
.current-mode { margin-top: 0.8rem; }

/* Mon compte */
.account-card { max-width: 640px; }
.account-facts { display: flex; gap: 2.2rem; margin: 1.2rem 0 1.6rem; }
.account-facts dt { color: var(--ink-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 0.25rem; }
.account-facts dd { margin: 0; font-weight: 600; }
.account-form h2 { font-size: 1.05rem; margin: 0 0 0.7rem; }
.account-save { margin-top: 1.1rem; }

.results-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.results-table th, .results-table td { padding: 0.75rem 0.95rem; text-align: left; border-bottom: 1px solid var(--card-border); }
.results-table tbody tr:last-child td { border-bottom: none; }
.results-table thead { background: var(--bg-soft); }
.results-table thead th { color: var(--ink-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.6px; }
.results-table tbody tr:hover { background: rgba(34, 197, 94, 0.05); }
.score-pill {
    display: inline-block;
    padding: 0.15rem 0.65rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.88rem;
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
}
.score-pill-perfect { background: rgba(251, 191, 36, 0.15); color: var(--gold); }

/* ──────────────────────────────── Responsive ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 680px) {
    .stadium { padding-bottom: 8.5rem; }
    .stadium-page { padding: 2rem 0.7rem 3.4rem; }
    .stadium-lineup { --scale: 0.72; height: 120px; bottom: 1.8rem; }
    .scoreboard > div { padding: 0.65rem 0.95rem; }
    .scoreboard strong { font-size: 1.2rem; }
    .mode-grid { grid-template-columns: 1fr; }
    .mode-card {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto auto;
        justify-items: start;
        column-gap: 0.85rem;
        row-gap: 0.2rem;
        text-align: left;
        padding: 0.85rem 2.6rem 0.85rem 0.85rem;
    }
    .mode-card .mode-badge {
        grid-area: 1 / 1 / 4 / 2;
        width: 42px;
        height: 42px;
        margin: 0;
        align-self: center;
    }
    .mode-card strong { grid-area: 1 / 2 / 2 / 3; }
    .mode-card .mode-pips { grid-area: 2 / 2 / 3 / 3; }
    .mode-card small { grid-area: 3 / 2 / 4 / 3; }
    .game-cards { grid-template-columns: 1fr; }
    .game-card { min-height: 0; }
    .card-body { max-width: 78%; }
    .card-art { opacity: 0.18; right: -3rem; }
    .mystery-id { align-items: flex-start; }
    .mystery-avatar { width: 50px; height: 50px; font-size: 1.3rem; }
    /* Modal en bottom-sheet sur mobile */
    .modal-backdrop { align-items: flex-end; padding: 0; }
    .modal {
        max-width: none;
        border-radius: var(--radius) var(--radius) 0 0;
        border-bottom: none;
        padding-bottom: max(1.3rem, env(safe-area-inset-bottom));
        animation: sheet-in 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    }
    @keyframes sheet-in {
        from { transform: translateY(40%); }
        to { transform: translateY(0); }
    }
    .pitch { min-height: 480px; padding: 1.2rem 0.15rem; }
    .token-disc { width: 38px; height: 38px; font-size: 0.9rem; }
    .token-name { font-size: 0.58rem; padding: 0.1rem 0.35rem; }
    .is-found .token-name, .is-missed .token-name { font-size: 0.62rem; }
    .game-header { align-items: flex-start; }
    .game-score { text-align: left; }
    .site-header { padding: 0.6rem 0.9rem; }
    .nav-toggle { display: flex; }
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.3rem 0.9rem 0.8rem;
        background: rgba(11, 18, 32, 0.96);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--card-border);
        box-shadow: var(--shadow);
    }
    .nav-open .site-nav { display: flex; animation: slide-up 0.18s ease; }
    .site-nav a, .site-nav .user-chip { padding: 0.75rem 0.2rem; }
    .site-nav a:not(.btn) { border-bottom: 1px solid var(--card-border); }
    .site-nav a:last-child { border-bottom: none; }
    .site-nav .user-chip { order: -1; border-bottom: 1px solid var(--card-border); }
    .site-nav .btn { margin-top: 0.6rem; text-align: center; }
}

/* ───────────────────────── Bannière d'installation PWA ───────────────────────── */
.pwa-install {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1rem;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: min(560px, calc(100vw - 2rem));
    padding: 0.8rem 1rem;
    background: var(--bg-soft);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: slide-up 0.18s ease;
}
.pwa-install[hidden] { display: none; }
.pwa-install-text {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    margin: 0;
    font-size: 0.92rem;
}
.pwa-install-text .icon { width: 1.4rem; height: 1.4rem; color: var(--green); }
.pwa-install .btn { white-space: nowrap; }
.pwa-install-close {
    background: none;
    border: 0;
    padding: 0.3rem;
    display: grid;
    color: var(--ink-muted);
    cursor: pointer;
}
.pwa-install-close:hover { color: var(--ink); }
