/* =====================================================
   Design du site : patinoire sombre et cinématique
   Couleurs, texte, fond d'arène, cartes en verre, formulaires, tableaux
   ===================================================== */

:root {
    color-scheme: dark;

    /* Couleurs */
    --bg: #050b14;
    --card: rgba(12, 24, 42, .62);
    --card-solide: #0c1a2c;
    --tx: #eaf1fb;
    --mu: #93a4bb;
    --bd: rgba(143, 183, 245, .18);
    --ac: #6fb0ff;
    --ac2: #3d7be0;
    --tint: rgba(111, 176, 255, .14);
    --red: #ff5a5f;
    --rouge-ligne: #e0263c;

    /* Les anciennes couleurs multiples sont toutes ramenées au bleu */
    --gold: var(--ac);
    --green: var(--ac);
    --teal: var(--ac);
    --cA: var(--ac);
    --cB: var(--ac);
    --cC: var(--ac);
    --cD: var(--ac);

    /* Polices */
    --titre: 'BarlowTournoi', 'Barlow Condensed', 'Arial Narrow', sans-serif;
    --texte: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Verre dépoli */
    --verre: rgba(10, 21, 38, .58);
    --verre-bord: rgba(150, 190, 250, .2);
    --ombre: 0 18px 50px rgba(0, 0, 0, .45);
}

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

html {
    scroll-padding-top: 84px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--tx);
    font: 15px/1.55 var(--texte);
    background: var(--bg);
}

/* Fond d'arène fixe : la patinoire reste derrière tout le site */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -2;
    background:
        linear-gradient(180deg, rgba(5, 11, 20, .78) 0%, rgba(5, 11, 20, .55) 35%, rgba(5, 11, 20, .92) 100%),
        url("../assets/images/fond-glace.jpg") center top / cover no-repeat;
}

/* Vignette : assombrit les bords comme une salle de spectacle */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(120% 90% at 50% 40%, rgba(5, 11, 20, 0) 40%, rgba(2, 6, 12, .75) 100%);
}

main {
    max-width: 1040px;
    margin: 0 auto;
    padding: 28px 18px 72px;
}

::selection {
    background: var(--ac2);
    color: #fff;
}

/* =====================================================
   Titres : italique condensé, comme la bannière
   ===================================================== */

h1,
h2,
h3 {
    font-family: var(--titre);
    font-style: italic;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: .01em;
}

h1 {
    font-size: clamp(40px, 6vw, 68px);
    line-height: .95;
}

/* Titre de section : métal brossé + trait lumineux qui s'allonge */
h2 {
    position: relative;
    font-size: clamp(30px, 4.2vw, 44px);
    line-height: 1;
    margin: 56px 0 22px;
    padding: 0 .2em 14px 0;
    background: var(--metal) 0 0 / 512px 256px, linear-gradient(180deg, #ffffff 0%, #ffffff 40%, #d9e1ec 65%, #98a9bf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 3px 14px rgba(0, 0, 0, .55));
}

h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: min(100%, 420px);
    height: 3px;
    background: linear-gradient(90deg, var(--rouge-ligne) 0, var(--rouge-ligne) 56px, var(--ac) 56px, rgba(111, 176, 255, 0) 100%);
    box-shadow: 0 0 14px rgba(111, 176, 255, .55);
    -webkit-text-fill-color: initial;
}

h3 {
    font-size: 22px;
    margin: 18px 0 8px;
    color: var(--ac);
}

h1.cat {
    margin: 6px 0 0;
    background: var(--metal) 0 0 / 512px 256px, linear-gradient(180deg, #ffffff 0%, #ffffff 40%, #d9e1ec 65%, #98a9bf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-right: .2em;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .6));
}

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

.nav a {
    margin-right: 16px;
}

.mu,
small {
    color: var(--mu);
}

.err {
    color: var(--red);
}

.ok {
    color: var(--ac);
    font-weight: 600;
}

.sc {
    color: var(--ac);
}

.u {
    color: var(--mu);
    font-style: italic;
}

.scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* =====================================================
   Cartes en verre dépoli
   ===================================================== */

.g4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.c {
    position: relative;
    background: var(--verre);
    border: 1px solid var(--verre-bord);
    border-radius: 16px;
    padding: 16px;
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
    box-shadow: var(--ombre);
}

/* Fine ligne de lumière sur le bord du haut */
.c::before {
    content: "";
    position: absolute;
    top: 0;
    left: 14%;
    right: 14%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(190, 220, 255, .7), transparent);
}

.c h3 {
    margin: 0 0 10px;
}

/* =====================================================
   Formulaires et boutons
   ===================================================== */

input,
select,
textarea {
    font: inherit;
    color: var(--tx);
    background: rgba(5, 11, 20, .6);
    border: 1px solid var(--bd);
    border-radius: 10px;
    padding: 8px 10px;
    width: 100%;
    transition: border-color .2s, box-shadow .2s;
}

textarea {
    min-height: 120px;
    padding: 10px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--ac);
    box-shadow: 0 0 0 3px rgba(111, 176, 255, .22);
}

.c input {
    margin-bottom: 6px;
}

input.auto {
    width: auto;
    margin-left: 8px;
}

button {
    font: 700 14px/1 var(--texte);
    padding: 10px 16px;
    border: 1px solid var(--bd);
    border-radius: 10px;
    background: var(--verre);
    color: var(--tx);
    cursor: pointer;
    transition: transform .15s, border-color .2s, background .2s;
}

button:hover {
    border-color: var(--ac);
    transform: translateY(-1px);
}

button:focus-visible {
    outline: 2px solid var(--ac);
    outline-offset: 2px;
}

button.pri {
    margin-top: 16px;
    color: #04101f;
    border-color: transparent;
    background: linear-gradient(180deg, #9ccaff, #5a9cf0);
    box-shadow: 0 8px 24px rgba(61, 123, 224, .45);
}

/* Boutons-pastilles (catégories, « Retour ») */
.pills {
    display: flex;
    gap: 8px;
    margin: 0 0 12px;
    flex-wrap: wrap;
}

/* de l'espace entre le titre de la page et les boutons */
h1.cat + .pills {
    margin-top: 20px;
}

.pills a {
    padding: 8px 18px;
    border: 1px solid var(--verre-bord);
    border-radius: 999px;
    background: var(--verre);
    color: var(--tx);
    text-decoration: none;
    font-weight: 600;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: border-color .2s, transform .2s;
}

.pills a:hover {
    border-color: var(--ac);
    transform: translateY(-1px);
}

.pills a.on {
    border-color: transparent;
    color: #04101f;
    background: linear-gradient(180deg, #9ccaff, #5a9cf0);
}

/* =====================================================
   Tableaux de données
   ===================================================== */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

td,
th {
    padding: 6px 6px;
    text-align: center;
}

th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--mu);
}

td:nth-child(2),
th:nth-child(2) {
    text-align: left;
}

tr + tr td {
    border-top: 1px solid rgba(143, 183, 245, .1);
}

/* =====================================================
   Pied de page
   ===================================================== */

.pied {
    position: relative;
    margin-top: 40px;
    padding: 34px 18px 40px;
    background: linear-gradient(180deg, rgba(4, 9, 17, 0), rgba(4, 9, 17, .92) 40%);
}

.pied::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(111, 176, 255, .6), transparent);
}

.pied-int {
    max-width: 1040px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px 40px;
}

.pied-marque {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pied-marque img {
    width: auto;
    filter: drop-shadow(0 0 12px rgba(111, 176, 255, .4));
}

.pied-marque b {
    display: block;
    font: italic 800 22px/1.1 var(--titre);
    text-transform: uppercase;
    color: #fff;
}

.pied-marque span {
    color: var(--mu);
    font-size: 13px;
}

.pied-liens {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    color: var(--mu);
    font-size: 14px;
}

.pied-liens a {
    color: var(--ac);
    text-decoration: none;
}

.pied-liens a:hover {
    text-decoration: underline;
}

/* =====================================================
   Apparition au défilement (script : js/site.js)
   ===================================================== */

.reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
    transition-delay: var(--delai, 0s);
}

.reveal.vu {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}