/* ============================================================
   WoodenBet — CSS commun (landing + web app)
   Identité « Pari tenu » (09/2026) : bleu du logo pour les actions,
   érable pour les enjeux, nuit de stade pour les scènes.
   Chargé après Bootstrap dans base_landing.html.twig et web/base.html.twig.
   Polices (Google Fonts, chargées par les bases) :
   Big Shoulders Display (titres, scores) · Onest (texte) · Martian Mono (échéances)
   ============================================================ */

:root {
    /* Couleurs de marque */
    --wb-blue: #1A8CE6;          /* Bleu poignée — actions */
    --wb-blue-action: #1577CC;   /* fond des boutons à texte blanc : contraste 4,6:1 (AA) */
    --wb-blue-hover: #1269B5;
    --wb-blue-ink: #0B64B3;      /* bleu lisible en texte sur fond clair */
    --wb-blue-soft: #DDEEFC;
    --wb-maple: #D99A52;         /* Érable — enjeux, jetons */
    --wb-maple-deep: #9C6224;    /* érable lisible en texte */
    --wb-maple-soft: #F6E7D3;
    --wb-night: #0B1626;         /* Nuit de stade — surfaces sombres */
    --wb-night-2: #14243A;
    --wb-night-line: #24364F;
    --wb-chalk: #EEF3F9;         /* texte sur nuit */
    --wb-chalk-muted: #9AAAC0;

    /* Neutres (fond clair) */
    --wb-ground: #F3F5F8;        /* Craie */
    --wb-surface: #FFFFFF;
    --wb-surface-2: #E9EEF4;
    --wb-ink: #0D1B2E;
    --wb-muted: #56657A;
    --wb-line: #DAE1EA;

    /* États */
    --wb-win: #12A06A;   --wb-win-soft: #DDF4EA;
    --wb-loss: #D63F45;  --wb-loss-soft: #FBE3E4;
    --wb-wait: #5F6D80;  --wb-wait-soft: #E8ECF1;

    /* Typo */
    --wb-display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
    --wb-body: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --wb-mono: 'Martian Mono', ui-monospace, Consolas, monospace;

    /* Formes */
    --wb-radius: 18px;
    --wb-radius-sm: 12px;
    --wb-shadow: 0 1px 2px rgba(13, 27, 46, .06), 0 12px 32px -12px rgba(13, 27, 46, .22);
    --wb-shadow-lg: 0 2px 4px rgba(13, 27, 46, .06), 0 24px 48px -18px rgba(13, 27, 46, .35);

    /* Alias hérités — les anciens templates lisent ces noms */
    --primary-color: var(--wb-blue);
    --secondary-color: var(--wb-blue-ink);
    --accent-color: var(--wb-maple);
    --primary-gradient: linear-gradient(135deg, var(--wb-blue) 0%, var(--wb-blue-ink) 100%);
    --secondary-gradient: linear-gradient(135deg, var(--wb-maple) 0%, var(--wb-maple-deep) 100%);
    --success-color: var(--wb-win);
    --warning-color: #D98A1C;
    --danger-color: var(--wb-loss);
    --dark-color: var(--wb-night);
    --glass-bg: var(--wb-surface);
    --glass-border: var(--wb-line);
    --font-family: var(--wb-body);

    /* Bootstrap */
    --bs-primary: #1577CC;
    --bs-primary-rgb: 21, 119, 204;
    --bs-success: #12A06A;
    --bs-success-rgb: 18, 160, 106;
    --bs-danger: #D63F45;
    --bs-danger-rgb: 214, 63, 69;
    --bs-link-color: #0B64B3;
    --bs-link-color-rgb: 11, 100, 179;
    --bs-link-hover-color: #084F8F;
    --bs-body-font-family: var(--wb-body);
    --bs-body-color: #0D1B2E;
    --bs-body-bg: #F3F5F8;
    --bs-border-color: #DAE1EA;
    --bs-secondary-color: #56657A;
}

/* ---------- Base ---------- */
body {
    font-family: var(--wb-body);
    color: var(--wb-ink);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { text-wrap: balance; }
.text-muted { color: var(--wb-muted) !important; }

/* Titre « tableau de scores » : à réserver aux gros titres et chiffres */
.wb-display {
    font-family: var(--wb-display);
    font-weight: 800;
    text-transform: uppercase;
    line-height: .95;
    letter-spacing: .005em;
}
.wb-mono { font-family: var(--wb-mono); font-variant-numeric: tabular-nums; }
.wb-eyebrow {
    font-family: var(--wb-mono);
    font-size: .72rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--wb-muted);
}
.wb-accent { color: var(--wb-maple); }

/* ---------- Boutons ---------- */
.wb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: 600 15px/1.1 var(--wb-body);
    border-radius: var(--wb-radius-sm);
    padding: 13px 22px;
    min-height: 44px;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.wb-btn:hover { transform: translateY(-1px); }
.wb-btn:active { transform: scale(.98); }
.wb-btn-primary { background: var(--wb-blue-action); color: #fff; box-shadow: 0 8px 20px -8px rgba(26, 140, 230, .7); }
.wb-btn-primary:hover { background: var(--wb-blue-hover); color: #fff; }
.wb-btn-dark { background: var(--wb-ink); color: #fff; }
.wb-btn-dark:hover { background: #1B2D45; color: #fff; }
.wb-btn-line { background: transparent; color: var(--wb-ink); box-shadow: inset 0 0 0 1.5px var(--wb-line); }
.wb-btn-line:hover { color: var(--wb-ink); box-shadow: inset 0 0 0 1.5px #B9C4D3; }
.wb-btn-ghost { background: transparent; color: var(--wb-chalk); box-shadow: inset 0 0 0 1.5px var(--wb-night-line); }
.wb-btn-ghost:hover { color: #fff; box-shadow: inset 0 0 0 1.5px #3A5070; }
.wb-btn-danger { background: var(--wb-loss); color: #fff; }
.wb-btn-danger:hover { background: #BD3339; color: #fff; }
.wb-btn-sm { padding: 9px 15px; font-size: 14px; min-height: 38px; border-radius: 10px; }
.wb-btn-lg { padding: 16px 26px; font-size: 16px; }

/* Anciennes classes de bouton, réalignées sur l'identité */
.btn-primary-fun {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--wb-blue-action) !important;
    color: #fff !important;
    font-weight: 600;
    border: 0;
    border-radius: var(--wb-radius-sm);
    padding: 13px 24px;
    text-decoration: none;
    box-shadow: 0 8px 20px -8px rgba(26, 140, 230, .7);
    transition: transform .15s ease, background-color .15s ease;
}
.btn-primary-fun:hover { background: var(--wb-blue-hover) !important; transform: translateY(-1px); }
.btn-secondary-fun {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: transparent;
    color: var(--wb-ink);
    font-weight: 600;
    border: 0;
    border-radius: var(--wb-radius-sm);
    padding: 13px 24px;
    text-decoration: none;
    box-shadow: inset 0 0 0 1.5px var(--wb-line);
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn-secondary-fun:hover { color: var(--wb-ink); box-shadow: inset 0 0 0 1.5px #B9C4D3; transform: translateY(-1px); }
.btn-primary { --bs-btn-bg: #1577CC; --bs-btn-border-color: #1577CC; --bs-btn-hover-bg: #1269B5; --bs-btn-hover-border-color: #1269B5; --bs-btn-active-bg: #0B64B3; --bs-btn-active-border-color: #0B64B3; }

/* ---------- Pastilles d'état ---------- */
.wb-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: 600 12px/1 var(--wb-body);
    letter-spacing: .02em;
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.wb-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.wb-chip-wait { background: var(--wb-wait-soft); color: var(--wb-wait); }
.wb-chip-live { background: var(--wb-blue-soft); color: var(--wb-blue-ink); }
.wb-chip-won, .wb-chip-done { background: var(--wb-win-soft); color: #0B8457; }
.wb-chip-lost, .wb-chip-cancelled { background: var(--wb-loss-soft); color: #B8323A; }
.wb-chip-type { background: var(--wb-maple-soft); color: var(--wb-maple-deep); }
.wb-chip-type::before { display: none; }

/* ---------- Jeton en bois ---------- */
.wb-token {
    --size: 46px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    flex: none;
    display: inline-grid;
    place-items: center;
    background:
        radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .45), transparent 42%),
        repeating-radial-gradient(circle at 62% 70%, #E2A964 0 2.5px, #D1904C 2.5px 4px, #DB9F5A 4px 6.5px);
    box-shadow: inset 0 0 0 3px rgba(120, 70, 20, .28), inset 0 -5px 10px rgba(90, 50, 10, .35), 0 6px 14px -4px rgba(0, 0, 0, .35);
}
.wb-token::after { content: ""; width: 58%; height: 58%; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(110, 62, 18, .35); }
.wb-token-sm { --size: 30px; }
.wb-token-lg { --size: 78px; }

/* ---------- Ticket de pari ----------
   <article class="wb-ticket" data-state="wait|live|won|lost|done|cancelled">
     .wb-ticket-main  (défi)  |  .wb-ticket-stub (enjeu)  + .wb-stamp
   --behind : couleur du fond derrière le ticket (encoches de perforation) */
.wb-ticket {
    --behind: var(--wb-ground);
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    background: var(--wb-surface);
    color: var(--wb-ink);
    border-radius: var(--wb-radius);
    box-shadow: var(--wb-shadow);
    text-align: left;
    transition: transform .15s ease, box-shadow .15s ease;
}
a.wb-ticket { text-decoration: none; }
a.wb-ticket:hover { transform: translateY(-2px); box-shadow: var(--wb-shadow-lg); color: var(--wb-ink); }
.wb-ticket-main { padding: 18px 20px; display: grid; gap: 10px; min-width: 0; align-content: start; }
.wb-ticket-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.wb-ticket-title { font-weight: 700; font-size: 1.1rem; line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.wb-ticket-desc { color: var(--wb-muted); font-size: .9rem; margin: 0; }
.wb-ticket-meta { font-family: var(--wb-mono); font-size: .75rem; color: var(--wb-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wb-ticket-meta.is-late { color: var(--wb-loss); }
.wb-ticket-people { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--wb-muted); flex-wrap: wrap; }
.wb-ticket-people .wb-vs { font-family: var(--wb-display); font-weight: 800; font-size: .95rem; color: var(--wb-ink); letter-spacing: .04em; }
.wb-ticket-stub {
    position: relative;
    width: 136px;
    padding: 16px 14px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 8px;
    text-align: center;
    border-left: 2px dashed var(--wb-line);
}
.wb-ticket-stub::before, .wb-ticket-stub::after {
    content: ""; position: absolute; left: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--behind);
}
.wb-ticket-stub::before { top: -11px; }
.wb-ticket-stub::after { bottom: -11px; }
.wb-ticket-stub-label { font-family: var(--wb-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--wb-muted); }
.wb-ticket-stake { font-weight: 600; font-size: .85rem; line-height: 1.3; overflow-wrap: anywhere; }
.wb-ticket-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wb-progress { height: 6px; border-radius: 6px; background: var(--wb-surface-2); overflow: hidden; }
.wb-progress > span { display: block; height: 100%; background: var(--wb-blue); border-radius: 6px; }

.wb-stamp {
    position: absolute;
    right: 150px;
    top: 10px;
    rotate: -6deg;
    font-family: var(--wb-display);
    font-weight: 900;
    font-size: 1.3rem;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--wb-win);
    border: 3px solid currentColor;
    border-radius: 10px;
    padding: 2px 12px;
    opacity: .88;
    pointer-events: none;
    mix-blend-mode: multiply;
    white-space: nowrap;
}
.wb-ticket[data-state="lost"] .wb-stamp,
.wb-ticket[data-state="cancelled"] .wb-stamp { color: var(--wb-loss); }
.wb-ticket[data-state="cancelled"] { opacity: .8; }
@keyframes wb-stamp-in { from { scale: 1.6; opacity: 0; } to { scale: 1; opacity: .88; } }
.wb-stamp.is-new { animation: wb-stamp-in .35s cubic-bezier(.2, 1.6, .4, 1) both; }

/* Ticket compact (listes denses) */
.wb-ticket-compact .wb-ticket-main { padding: 14px 16px; gap: 7px; }
.wb-ticket-compact .wb-ticket-title { font-size: .98rem; }
.wb-ticket-compact .wb-ticket-stub { width: 104px; padding: 12px 10px; }
.wb-ticket-compact .wb-token { --size: 34px; }
.wb-ticket-compact .wb-stamp { right: 112px; top: 8px; font-size: 1.1rem; }
/* Pari réglé : le tampon prend la place de l'échéance dans la ligne du haut */
.wb-ticket:has(.wb-stamp) .wb-ticket-meta { visibility: hidden; }

@media (max-width: 575.98px) {
    .wb-ticket { grid-template-columns: 1fr; }
    .wb-ticket-stub, .wb-ticket-compact .wb-ticket-stub {
        width: auto; border-left: 0; border-top: 2px dashed var(--wb-line);
        grid-auto-flow: column; grid-template-columns: auto 1fr; justify-content: start; justify-items: start; text-align: left;
        padding: 12px 18px; column-gap: 12px; row-gap: 2px;
    }
    .wb-ticket-stub .wb-token { grid-row: span 2; }
    .wb-ticket-stub::before, .wb-ticket-stub::after { top: -12px; }
    .wb-ticket-stub::before { left: -11px; }
    .wb-ticket-stub::after { left: auto; right: -11px; bottom: auto; }
    .wb-stamp, .wb-ticket-compact .wb-stamp { right: 16px; top: 14px; font-size: 1.05rem; }
}

/* ---------- Carte neutre ---------- */
.wb-card {
    background: var(--wb-surface);
    border: 1px solid var(--wb-line);
    border-radius: var(--wb-radius);
    padding: 24px;
}
/* Bandeau sombre « tableau de scores » */
.wb-scoreboard {
    background: var(--wb-night);
    color: var(--wb-chalk);
    border-radius: var(--wb-radius);
    padding: 18px 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
    text-align: center;
}
.wb-scoreboard b { display: block; font-family: var(--wb-display); font-weight: 900; font-size: 2.4rem; line-height: 1; color: #fff; }
.wb-scoreboard span { font-size: .7rem; color: var(--wb-chalk-muted); text-transform: uppercase; letter-spacing: .08em; }
.wb-scoreboard .is-win b { color: #3DD598; }
.wb-scoreboard .is-maple b { color: #E2A866; }

/* Avatars à initiales */
.wb-av {
    width: 30px; height: 30px; border-radius: 50%;
    display: inline-grid; place-items: center; flex: none;
    font: 700 .72rem var(--wb-body); color: #fff; background: var(--wb-blue-action);
    object-fit: cover;
}
.wb-av-2 { background: #7A5AF0; } .wb-av-3 { background: #E0773C; } .wb-av-4 { background: #12A06A; }

/* ---------- Utilitaires manquants (référencés dans les templates) ---------- */
.fw-600, .font-weight-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }

.letter-spacing-1 { letter-spacing: 1px; }

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shadow-2xl { box-shadow: var(--wb-shadow-lg) !important; }

/* ---------- Accessibilité : focus visible ---------- */
.form-control:focus,
.form-select:focus {
    border-color: var(--wb-blue);
    box-shadow: 0 0 0 4px var(--wb-blue-soft) !important;
}

.wb-btn:focus-visible,
.wb-ticket:focus-visible,
.btn-primary-fun:focus-visible,
.btn-secondary-fun:focus-visible,
.btn-google:focus-visible,
.btn-google-auth:focus-visible,
.suggestion-chip:focus-visible,
.invite-tab:focus-visible,
.offcanvas-menu-link:focus-visible,
#mobileTabBar .tab-item:focus-visible,
#mobileTabBar .tab-fab:focus-visible,
.navbar-toggler:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible {
    outline: 3px solid var(--wb-blue);
    outline-offset: 2px;
}

/* Sur fond sombre (navbar, footer, offcanvas), anneau clair */
.navbar .nav-link:focus-visible,
.navbar-toggler:focus-visible,
.offcanvas-menu-link:focus-visible,
.footer a:focus-visible,
.wb-on-night :focus-visible {
    outline-color: #ffffff;
}

/* ---------- Onglets d'invitation (Membre / Email) — factorisé ---------- */
.invite-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1.5px solid var(--wb-line);
    border-radius: var(--wb-radius-sm);
    background: var(--wb-surface);
    color: var(--wb-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}
.invite-tab i { font-size: 1.1rem; }
.invite-tab:hover {
    border-color: var(--wb-blue);
    color: var(--wb-blue-ink);
}
.invite-tab.active {
    border-color: var(--wb-ink);
    background: var(--wb-ink);
    color: #fff;
}

/* ---------- Cibles tactiles : boutons d'action ronds ---------- */
.btn-icon-round {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

@media (prefers-reduced-motion: reduce) {
    .wb-btn, .wb-ticket, .btn-primary-fun, .btn-secondary-fun { transition: none; }
    .wb-stamp.is-new { animation: none; }
}

/* ---------- Web app ---------- */
/* Avatars : 1re teinte explicite (la macro _ticket numérote à partir de 1) */
.wb-av-1 { background: var(--wb-blue-action); }
/* Pastille « échéance dépassée » (web app, détail d'un pari) */
.wb-chip-late { background: var(--wb-loss-soft); color: #B8323A; }

/* ---------- Bandeau de consentement (mesure d'audience) ---------- */
.wb-consent {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 9998;
    max-width: 560px;
    margin-inline: auto;
    padding: 16px 18px;
    display: grid;
    gap: 12px;
    background: var(--wb-night);
    color: var(--wb-chalk);
    border: 1px solid var(--wb-night-line);
    border-radius: var(--wb-radius-sm);
    box-shadow: var(--wb-shadow-lg);
    font-size: .9rem;
    line-height: 1.45;
}
.wb-consent[hidden] { display: none; }
.wb-consent p { margin: 0; }
.wb-consent-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.wb-consent .wb-btn { min-height: 44px; }
.wb-consent .wb-btn-line { color: var(--wb-chalk); box-shadow: inset 0 0 0 1.5px var(--wb-chalk-muted); background: transparent; }
.wb-consent .wb-btn-line:hover { color: #fff; box-shadow: inset 0 0 0 1.5px #fff; }
