/* ==========================================================================
   Boxe Simulator — theme.css
   Fondations : jetons de design, base, mise en page, navbar, formulaires.
   Thème « arène » : noir profond, rouge des gants, or des ceintures.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* — Fonds — */
    --ink-950: #05070b;
    --ink-900: #080b11;
    --ink-850: #0c1018;
    --ink-800: #121826;
    --ink-750: #1a2234;
    --ink-700: #232d43;

    /* — Accents — */
    --red-300: #ff8892;
    --red-400: #ff3d4e;
    --red-500: #e11d2e;
    --red-600: #bd1424;
    --red-700: #8b0f1b;
    --gold-400: #ffc94d;
    --gold-500: #f2b42c;
    --green-400: #34d17f;
    --green-500: #21a862;
    --blue-400: #4fa8f0;
    --blue-500: #2d8ada;
    --purple-400: #a78bfa;
    --purple-500: #8b5cf6;

    /* — Texte — */
    --text: #eef2f8;
    --text-soft: #c3ccdb;
    --text-dim: #8d99ad;
    --text-faint: #5d6879;

    /* — Traits & surfaces — */
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --surface: rgba(18, 24, 38, 0.82);
    --surface-2: rgba(26, 34, 52, 0.72);
    --glass-blur: 14px;

    /* — Ombres & lueurs — */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 28px 64px rgba(0, 0, 0, 0.55);
    --glow-red: 0 0 0 1px rgba(225, 29, 46, 0.35), 0 12px 40px rgba(225, 29, 46, 0.28);
    --glow-gold: 0 0 0 1px rgba(242, 180, 44, 0.35), 0 12px 40px rgba(242, 180, 44, 0.22);

    /* — Rayons — */
    --r-sm: 8px;
    --r: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-pill: 999px;

    /* — Typo — */
    --font-display: 'Barlow Condensed', 'Oswald', 'Haettenschweiler', Impact, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* — Transitions — */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --t-fast: 0.16s var(--ease);
    --t: 0.28s var(--ease);
    --t-slow: 0.5s var(--ease);

    /* — Gabarit — */
    --page-width: 1180px;
    --gutter: clamp(1rem, 4vw, 2.25rem);
    --nav-h: 68px;

    /* Alias conservés pour l'ancien CSS encore chargé */
    --primary-color: var(--red-500);
    --primary-dark: var(--red-700);
    --secondary-color: var(--ink-700);
    --success-color: var(--green-500);
    --danger-color: var(--red-500);
    --warning-color: var(--gold-500);
    --info-color: var(--blue-500);
    --text-dark: var(--text);
    --text-light: var(--text-dim);
    --border-color: var(--line);
    --radius: var(--r);
}

/* ---------- Reset ---------- */

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

* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--ink-950);
    background-image:
        radial-gradient(1100px 620px at 50% -8%, rgba(225, 29, 46, 0.20), transparent 62%),
        radial-gradient(760px 520px at 12% 8%, rgba(45, 138, 218, 0.10), transparent 60%),
        radial-gradient(900px 640px at 88% 96%, rgba(242, 180, 44, 0.07), transparent 62%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* voile « toile de ring » : fines diagonales très discrètes */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
    background-image: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.018) 0 1px,
        transparent 1px 7px
    );
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--red-300); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--red-400); }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
    outline: 2px solid var(--red-400);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection { background: rgba(225, 29, 46, 0.42); color: #fff; }

/* Barre de défilement */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--ink-900); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--red-600), var(--red-700));
    border-radius: var(--r-pill);
    border: 3px solid var(--ink-900);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(var(--red-400), var(--red-600)); }

/* ---------- Typographie ---------- */

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); }
h4 { font-size: 1.05rem; }

p { color: var(--text-soft); }

.eyebrow {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--red-400);
}

/* ---------- Icônes ---------- */

.bx-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
    /* inline-block : le reset met les <svg> en display:block, ce qui casserait
       les icônes posées au milieu d'une phrase. */
    display: inline-block;
    width: 1.15em;
    height: 1.15em;
    flex: none;
    vertical-align: -0.2em;
    color: inherit;
}
.icon-sm { width: 0.95em; height: 0.95em; }
.icon-lg { width: 1.6em; height: 1.6em; }
.icon-xl { width: 2.4em; height: 2.4em; }

/* ---------- Mise en page ---------- */

.container {
    width: 100%;
    max-width: var(--page-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.main-content {
    flex: 1;
    width: 100%;
    padding-block: clamp(1.75rem, 4vw, 3rem) 4rem;
}

.page-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.page-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(180deg, #fff 25%, #9aa6ba 130%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.page-head h2 .icon { color: var(--red-400); -webkit-text-fill-color: initial; }

.page-head .sub {
    max-width: 58ch;
    color: var(--text-dim);
    font-size: 0.98rem;
}

.page-head::after {
    content: '';
    width: 92px;
    height: 3px;
    border-radius: var(--r-pill);
    background: linear-gradient(90deg, transparent, var(--red-500), transparent);
}

.grid { display: grid; gap: clamp(1rem, 2.2vw, 1.5rem); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* exactement deux colonnes dès qu'il y a la place : évite qu'un quatrième
   élément se retrouve seul sur une ligne de trois */
.grid-pair { grid-template-columns: 1fr; }
@media (min-width: 860px) { .grid-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stack { display: grid; gap: clamp(1rem, 2.2vw, 1.5rem); }
.items-start { align-items: start; }

.center { display: grid; place-items: center; text-align: center; }
.row { display: flex; align-items: center; gap: 0.6rem; }
.row-center { display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Navbar ---------- */

.navbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(8, 11, 17, 0.78);
    backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    border-bottom: 1px solid var(--line);
}

.navbar::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(225, 29, 46, 0.65), transparent);
}

/* la barre de navigation peut être plus large que le contenu : neuf entrées
   plus la bourse ne tiennent pas dans les 1180 px du gabarit */
.navbar .container {
    max-width: 1400px;
    min-height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text);
}

.navbar-brand:hover { color: var(--text); }
.navbar-brand .brand-text strong { color: var(--red-400); }
.navbar-brand .brand-text span { color: var(--text-dim); font-weight: 500; }

.brand-logo { height: 44px; width: auto; object-fit: contain; }
.brand-logo-sm { height: 52px; }
.brand-logo-md { height: clamp(120px, 18vw, 160px); }
.brand-logo-lg { height: clamp(140px, 22vw, 220px); }
.brand-logo-glow { filter: drop-shadow(0 6px 18px rgba(225, 29, 46, 0.45)); }

.navbar-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    padding: 0.45rem 0.6rem;
    color: var(--text);
    cursor: pointer;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    list-style: none;
    min-width: 0;
}

.navbar-menu a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.7rem;
    border-radius: var(--r-sm);
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text-dim);
    transition: color var(--t-fast), background var(--t-fast);
}

.navbar-menu a .icon { color: var(--text-faint); transition: color var(--t-fast); }

.navbar-menu a:hover,
.navbar-menu a.is-active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.navbar-menu a:hover .icon,
.navbar-menu a.is-active .icon { color: var(--red-400); }

.navbar-menu a.is-active::after {
    content: '';
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0.15rem;
    height: 2px;
    border-radius: var(--r-pill);
    background: linear-gradient(90deg, var(--red-500), var(--gold-500));
}

.navbar-menu a.nav-danger:hover { color: var(--red-400); }

/* ---------- Pied de page ---------- */

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(5, 7, 11, 0.7);
    padding-block: 1.75rem;
    text-align: center;
}

.site-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.site-footer p { color: var(--text-faint); font-size: 0.85rem; }
.site-footer .footer-mark { display: flex; align-items: center; gap: 0.5rem; color: var(--text-dim); font-family: var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; }
.site-footer .footer-mark .icon { color: var(--red-500); }

/* ---------- Boutons ---------- */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.72rem 1.35rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    transition: transform var(--t-fast), box-shadow var(--t), border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}

/* balayage lumineux au survol */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    transform: translateX(-120%) skewX(-18deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transition: transform 0.65s var(--ease);
}

.btn:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.btn:hover::after { transform: translateX(120%) skewX(-18deg); }
.btn:active { transform: translateY(0) scale(0.985); }

.btn[disabled], .btn.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.btn-primary {
    border-color: transparent;
    background: linear-gradient(140deg, var(--red-400), var(--red-600) 55%, var(--red-700));
    color: #fff;
    box-shadow: 0 8px 24px rgba(225, 29, 46, 0.32);
}
.btn-primary:hover { box-shadow: 0 14px 38px rgba(225, 29, 46, 0.45); }

.btn-success { border-color: transparent; background: linear-gradient(140deg, var(--green-400), var(--green-500)); color: #04150c; box-shadow: 0 8px 24px rgba(33, 168, 98, 0.28); }
.btn-warning { border-color: transparent; background: linear-gradient(140deg, var(--gold-400), var(--gold-500)); color: #1d1403; box-shadow: 0 8px 24px rgba(242, 180, 44, 0.28); }
.btn-info    { border-color: transparent; background: linear-gradient(140deg, var(--blue-400), var(--blue-500)); color: #041423; box-shadow: 0 8px 24px rgba(45, 138, 218, 0.28); }
.btn-danger  { border-color: transparent; background: linear-gradient(140deg, #ff5a5a, #b91427); color: #fff; }

.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text-soft); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.btn-secondary { background: var(--surface-2); color: var(--text-soft); }

.btn-outline-red { background: transparent; border-color: rgba(225, 29, 46, 0.55); color: var(--red-300); }
.btn-outline-red:hover { background: rgba(225, 29, 46, 0.12); color: #fff; }

.btn-sm { padding: 0.42rem 0.9rem; font-size: 0.85rem; }
.btn-lg { padding: 0.95rem 1.9rem; font-size: 1.12rem; }
.btn-block { display: flex; width: 100%; }

.btn-icon { padding: 0.6rem; aspect-ratio: 1; border-radius: 50%; }

/* ---------- Formulaires ---------- */

.form-group { display: grid; gap: 0.45rem; margin-bottom: 1.05rem; text-align: left; }

.form-group label {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
select,
textarea {
    width: 100%;
    padding: 0.78rem 1rem;
    background: rgba(5, 7, 11, 0.62);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

input::placeholder, textarea::placeholder { color: var(--text-faint); }

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(225, 29, 46, 0.7);
    box-shadow: 0 0 0 3px rgba(225, 29, 46, 0.16);
    background: rgba(5, 7, 11, 0.85);
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
    background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.6rem;
}

select option { background: var(--ink-850); color: var(--text); }

.field-hint { font-size: 0.82rem; color: var(--text-faint); }

/* ---------- Alertes ---------- */

.alert {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.2rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--line-strong);
    border-left-width: 3px;
    border-radius: var(--r);
    background: var(--surface);
    font-weight: 500;
    text-align: center;
    animation: bx-slide-down 0.35s var(--ease) both;
}

.alert .icon { flex: none; }
.alert-danger  { border-left-color: var(--red-500);   background: rgba(225, 29, 46, 0.12);  color: #ffc3c8; }
.alert-success { border-left-color: var(--green-500); background: rgba(33, 168, 98, 0.12);  color: #b6f2d2; }
.alert-warning { border-left-color: var(--gold-500);  background: rgba(242, 180, 44, 0.12); color: #ffe4a8; }
.alert-info    { border-left-color: var(--blue-500);  background: rgba(45, 138, 218, 0.12); color: #bfe0ff; }

/* ---------- Tableaux ---------- */

.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--r); }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

thead th {
    padding: 0.85rem 0.9rem;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--line-strong);
}

tbody td {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--line);
    color: var(--text-soft);
    vertical-align: middle;
}

tbody tr { transition: background var(--t-fast); }
tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
tbody tr:last-child td { border-bottom: none; }

tbody tr.highlight,
tbody tr.is-you {
    background: linear-gradient(90deg, rgba(225, 29, 46, 0.18), rgba(225, 29, 46, 0.04));
    box-shadow: inset 3px 0 0 var(--red-500);
}

tbody tr.highlight td { color: var(--text); }

/* ---------- Utilitaires ---------- */

.text-center { text-align: center; }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-red { color: var(--red-400); }
.text-gold { color: var(--gold-400); }
.text-green { color: var(--green-400); }
.text-blue { color: var(--blue-400); }
.win-text { color: var(--green-400); font-weight: 700; }
.loss-text { color: var(--red-400); font-weight: 700; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* visible uniquement pour les lecteurs d'écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.divider {
    height: 1px;
    margin-block: 1.4rem;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
    border: none;
}

/* ---------- Animations partagées ---------- */

@keyframes bx-slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bx-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bx-spin { to { transform: rotate(360deg); } }

@keyframes bx-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

@keyframes bx-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

@keyframes bx-shine {
    0%   { transform: translateX(-130%) skewX(-18deg); }
    100% { transform: translateX(130%) skewX(-18deg); }
}

/* ---------- Responsive ---------- */

/* Entre 900 et 1300 px, le menu ne tient plus avec ses libellés : on ne garde
   que les icônes. Le texte reste dans le DOM pour les lecteurs d'écran. */
@media (min-width: 901px) and (max-width: 1599px) {
    .navbar-menu a span:not(.sr-only) {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .navbar-menu a { padding: 0.55rem 0.6rem; }
    .navbar-menu a .icon { width: 1.35em; height: 1.35em; }
    .navbar-menu a.is-active::after { left: 0.35rem; right: 0.35rem; }
}

@media (max-width: 1150px) {
    .navbar-purse .purse-chip span { display: none; }
}

@media (max-width: 900px) {
    .navbar-toggle { display: inline-flex; }

    .navbar .container { flex-wrap: wrap; row-gap: 0.5rem; }

    .navbar-menu {
        order: 3;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        padding-bottom: 0.75rem;
    }

    .navbar-menu:not(.is-open) { display: none; }
    .navbar-menu a { padding: 0.7rem 0.9rem; }
    .navbar-menu a.is-active::after { display: none; }
    .navbar-menu a.is-active { background: rgba(225, 29, 46, 0.14); }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
