/*
 * Arena : sable, sang, bronze et lueur des torches.
 * Feuille commune (AssetMapper, sans étape de construction) : jetons, socle, en-tête, boutons, formulaires, plaques,
 * raretés, portraits, traits d'objet. Ce qui n'appartient qu'à une page est dans sa feuille (home.css, account.css,
 * recruit.css, card.css, arena.css, combat.css, ludus.css…), chargée par son gabarit. Les gabarits n'ont ni style ni
 * script.
 */

:root {
    --ink: #0e0a08;
    --ink-2: #16100c;
    --stone: #1d1511;
    --stone-2: #261b15;
    --line: #4a3726;
    --line-strong: #6f5232;

    --sand: #eadcc2;
    --sand-dim: #c2b195;
    --sand-mute: #a8957a;

    --bronze: #c9973f;
    --bronze-light: #e3bc6c;
    --gold: #f3d38a;

    --blood: #a3241a;
    --blood-dark: #6b120c;
    --ember: #e0702c;

    --danger-text: #ff9c8c;
    --success-text: #a9dc9a;

    --font-display: 'Cinzel', 'Trajan Pro', 'Times New Roman', Georgia, serif;
    --font-body: 'Spectral', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;

    --radius: 6px;
    --shadow-deep: 0 30px 80px rgb(0 0 0 / 70%);
    --header-height: 4.25rem;

    color-scheme: dark;
}

/* ---------- Socle ---------- */

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

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--sand);
    background-color: var(--ink);
    background-image:
        url("../images/noise-5lpaXVc.svg"),
        radial-gradient(ellipse 80% 50% at 50% -10%, rgb(160 70 25 / 22%), transparent 70%),
        linear-gradient(180deg, var(--ink-2), var(--ink) 60%);
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.04em;
    color: var(--gold);
    margin: 0 0 0.75rem;
}

h1 {
    font-size: clamp(1.9rem, 5vw, 2.6rem);
}

h2 {
    font-size: clamp(1.4rem, 3.4vw, 1.9rem);
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--bronze-light);
    text-decoration-color: rgb(227 188 108 / 45%);
    text-underline-offset: 0.2em;
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
    color: var(--gold);
    text-decoration-color: currentColor;
}

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

code {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: 0.92em;
    color: var(--gold);
    background: rgb(0 0 0 / 35%);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.1em 0.4em;
    overflow-wrap: anywhere;
}

.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--gold);
    color: var(--ink);
    font-weight: 600;
    border-radius: var(--radius);
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
    color: var(--ink);
}

/* ---------- En-tête ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.25rem;
    min-height: var(--header-height);
    padding: 0.6rem clamp(1rem, 4vw, 2.5rem);
    background: linear-gradient(180deg, rgb(14 10 8 / 96%), rgb(14 10 8 / 86%));
    backdrop-filter: blur(8px);
    border-bottom: 1px solid transparent;
    border-image: linear-gradient(90deg, transparent, var(--line-strong) 20%, var(--bronze) 50%, var(--line-strong) 80%, transparent) 1;
}

.site-title {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--gold);
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.45rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
}

.site-title:hover {
    color: #fff0c4;
}

.site-title-emblem {
    width: 2.4rem;
    height: 2.4rem;
    filter: drop-shadow(0 0 10px rgb(224 112 44 / 35%));
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1.25rem;
    min-width: 0;
}

.site-nav a {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--sand-dim);
    padding: 0.4rem 0;
    border-bottom: 1px solid transparent;
}

.site-nav a:hover {
    color: var(--gold);
    border-bottom-color: var(--bronze);
}

.site-nav .site-nav-user {
    max-width: min(16rem, 52vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0.02em;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--bronze-light);
}

.site-nav .site-nav-cta {
    padding: 0.45rem 0.95rem;
    border: 1px solid var(--bronze);
    border-radius: var(--radius);
    color: var(--gold);
    background: rgb(201 151 63 / 8%);
}

.site-nav .site-nav-cta:hover {
    background: rgb(201 151 63 / 18%);
    border-bottom-color: var(--bronze);
}

/* ---------- Contenu ---------- */

.site-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.container {
    width: min(100% - 2rem, 52rem);
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 3.5rem) 0 3rem;
}

/* Page du tirage : cartes plus larges, proches d'une vraie carte (environ 3 × 4) */
.container-wide {
    width: min(100% - 2rem, 70rem);
}

.page-header {
    margin-bottom: 1.75rem;
}

.page-title {
    margin-bottom: 0;
}

.section-eyebrow,
.plaque-eyebrow {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--bronze-light);
    margin: 0 0 0.6rem;
}

.hint {
    font-size: 0.92rem;
    color: var(--sand-mute);
    margin: 0;
}

/* ---------- Messages ---------- */

.flash {
    position: relative;
    margin: 0 0 1.25rem;
    padding: 0.8rem 1rem 0.8rem 1.15rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--bronze);
    border-radius: var(--radius);
    background: rgb(29 21 17 / 92%);
    color: var(--sand);
    font-size: 0.98rem;
    box-shadow: 0 10px 30px rgb(0 0 0 / 35%);
}

.flash-error {
    border-color: rgb(163 36 26 / 55%);
    border-left-color: #d0402e;
    background: linear-gradient(90deg, rgb(107 18 12 / 45%), rgb(29 21 17 / 92%) 70%);
    color: #ffe1da;
}

.flash-success {
    border-color: rgb(90 140 80 / 50%);
    border-left-color: #6dab5b;
    background: linear-gradient(90deg, rgb(40 80 35 / 40%), rgb(29 21 17 / 92%) 70%);
    color: #e6f5df;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.9rem;
    padding: 0.7rem 1.4rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    line-height: 1.2;
    color: #fff3df;
    background: linear-gradient(180deg, #bd3a24 0%, #921d12 55%, #6b120c 100%);
    border: 1px solid #d98a4a;
    border-radius: var(--radius);
    box-shadow:
        inset 0 1px 0 rgb(255 214 170 / 35%),
        inset 0 -2px 0 rgb(0 0 0 / 25%),
        0 10px 26px rgb(107 18 12 / 45%);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, background-color 0.2s ease;
}

.button:hover {
    color: #fff;
    filter: brightness(1.12);
    box-shadow:
        inset 0 1px 0 rgb(255 214 170 / 45%),
        inset 0 -2px 0 rgb(0 0 0 / 25%),
        0 12px 34px rgb(224 112 44 / 40%);
}

.button:active {
    transform: translateY(1px);
}

.button-ghost {
    color: var(--gold);
    background: rgb(14 10 8 / 45%);
    border-color: var(--bronze);
    box-shadow: inset 0 0 0 1px rgb(243 211 138 / 8%);
}

.button-ghost:hover {
    color: #fff0c4;
    background: rgb(201 151 63 / 14%);
    box-shadow: 0 10px 28px rgb(201 151 63 / 18%);
}

.button-danger {
    background: linear-gradient(180deg, #7d1a12, #4f0d08);
    border-color: #b8432f;
}

.button-large {
    min-height: 3.4rem;
    padding: 0.9rem 1.9rem;
    font-size: 0.98rem;
}

.button-block {
    width: 100%;
}

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

.form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    width: 100%;
    max-width: 28rem;
    margin: 0 0 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.field-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bronze-light);
}

.field-label.required::after {
    content: none;
}

.form-aside-link {
    align-self: flex-end;
    margin-top: -0.6rem;
    font-size: 0.92rem;
}

.field-help {
    font-size: 0.92rem;
    color: var(--sand-mute);
}

.field-input {
    width: 100%;
    min-height: 3rem;
    padding: 0.7rem 0.9rem;
    font: inherit;
    font-size: 1.05rem;
    color: var(--sand);
    background: linear-gradient(180deg, rgb(5 3 2 / 75%), rgb(18 13 10 / 75%));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: inset 0 2px 6px rgb(0 0 0 / 55%);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field-input::placeholder {
    color: var(--sand-mute);
}

.field-input:hover {
    border-color: var(--bronze);
}

.field-input:focus,
.field-input:focus-visible {
    outline: none;
    border-color: var(--gold);
    box-shadow: inset 0 2px 6px rgb(0 0 0 / 55%), 0 0 0 3px rgb(243 211 138 / 22%), 0 0 22px rgb(224 112 44 / 22%);
}

.field-input:-webkit-autofill {
    -webkit-text-fill-color: var(--sand);
    box-shadow: inset 0 0 0 100px #1b130e;
    caret-color: var(--sand);
}

.field-invalid .field-input {
    border-color: #c4483a;
}

.field-input.input-code {
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    letter-spacing: 0.35em;
    font-size: 1.25rem;
}

/* Erreurs : form_errors du thème (templates/form/arena_theme.html.twig). */
.field-errors {
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--danger-text);
    font-size: 0.92rem;
}

.field-errors li::before {
    content: '✕ ';
    font-size: 0.8em;
}

.form > .button {
    margin-top: 0.4rem;
}

/* ---------- Sections ---------- */

.section {
    width: min(100% - 2rem, 72rem);
    margin: 0 auto;
    padding: clamp(3rem, 8vw, 5.5rem) 0;
    text-align: center;
}

.section-title {
    margin-bottom: clamp(2rem, 5vw, 3rem);
    font-size: clamp(1.7rem, 4.4vw, 2.5rem);
}

.section-title::after {
    content: '';
    display: block;
    width: 7rem;
    height: 10px;
    margin: 1rem auto 0;
    background:
        radial-gradient(circle, var(--bronze-light) 0 3px, transparent 3.5px) center / 10px 10px no-repeat,
        linear-gradient(90deg, transparent, var(--bronze) 30%, transparent 46%, transparent 54%, var(--bronze) 70%, transparent) center / 100% 1px no-repeat;
}

/* ---------- Plaque de bronze (formulaires, cartes) ---------- */

.gate {
    position: relative;
    isolation: isolate;
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(2.5rem, 7vw, 4.5rem) 1rem clamp(9rem, 20vw, 13rem);
    overflow: hidden;
}

/*
 * Les pages de la porte (connexion, inscription, mot de passe, double authentification) tiennent dans l'écran : la
 * plaque au milieu, sans défilement ni pied de page (demande de l'utilisateur : garder la simplicité, pas de scroll).
 * Sur un écran trop bas, c'est la porte qui défile, jamais la page entière.
 */
body.page-gate {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.page-gate .site-main {
    min-height: 0;
}

.page-gate .site-footer {
    display: none;
}

.page-gate .gate {
    align-items: center;
    min-height: 0;
    padding: 1.25rem 1rem;
    overflow-y: auto;
    scrollbar-width: none;
}

.page-gate .plaque-gate {
    margin: auto 0;
    padding: 2rem clamp(1.35rem, 6vw, 2.5rem) 1.6rem;
    border-radius: 50% 50% var(--radius) var(--radius) / 6.5rem 6.5rem var(--radius) var(--radius);
}

.page-gate .plaque-emblem {
    width: 3.6rem;
    margin-bottom: 0.4rem;
}

.page-gate .plaque-title {
    margin-bottom: 0.3rem;
}

.page-gate .plaque-gate .form {
    margin-top: 1.25rem;
}

.page-gate .plaque-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
}

/* Écran bas (portable, téléphone) : l'emblème et la phrase d'accueil cèdent la place au formulaire */
@media (max-height: 54rem) {
    .page-gate .plaque-emblem,
    .page-gate .plaque-lead {
        display: none;
    }

    .page-gate .plaque-gate {
        padding-top: 1.6rem;
    }

    .page-gate .form-row,
    .page-gate .form > div {
        margin-bottom: 0.7rem;
    }
}

/* Deux torches de part et d'autre de la porte. */
.gate::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 8% 22%, rgb(255 150 60 / 26%), transparent 32%),
        radial-gradient(circle at 92% 22%, rgb(255 150 60 / 26%), transparent 32%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgb(224 112 44 / 28%), transparent 70%);
}

.gate::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    height: max(22.5vw, 12.6rem);
    background:
        linear-gradient(180deg, rgb(14 10 8 / 0%) 55%, var(--ink) 100%),
        url("../images/colosseum-x9ZLY2O.svg") center top / max(100%, 56rem) auto no-repeat;
    opacity: 0.85;
}

.plaque {
    position: relative;
    width: 100%;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    background:
        url("../images/noise-5lpaXVc.svg"),
        linear-gradient(180deg, rgb(38 27 21 / 97%), rgb(20 14 11 / 97%));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow:
        inset 0 0 0 5px rgb(14 10 8 / 65%),
        inset 0 0 0 6px rgb(201 151 63 / 28%),
        var(--shadow-deep);
}

.plaque + .plaque {
    margin-top: 1.5rem;
}

.plaque-gate {
    max-width: 30rem;
    padding: clamp(2.5rem, 7vw, 3.25rem) clamp(1.35rem, 6vw, 2.75rem) clamp(2rem, 5vw, 2.5rem);
    text-align: center;
    /* Porte en arc, comme une arcade de l'amphithéâtre. */
    border-radius: 50% 50% var(--radius) var(--radius) / clamp(6rem, 22vw, 9rem) clamp(6rem, 22vw, 9rem) var(--radius) var(--radius);
    border-color: var(--bronze);
    box-shadow:
        inset 0 0 0 6px rgb(14 10 8 / 70%),
        inset 0 0 0 7px rgb(201 151 63 / 35%),
        inset 0 40px 80px rgb(224 112 44 / 8%),
        var(--shadow-deep),
        0 0 120px rgb(224 112 44 / 14%);
}

/* Rivets aux coins bas de la plaque. */
.plaque-gate::before,
.plaque-gate::after {
    content: '';
    position: absolute;
    bottom: 0.9rem;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fbe2a4, #b07c30 55%, #4a2c10);
    box-shadow: 0 1px 2px rgb(0 0 0 / 70%);
}

.plaque-gate::before {
    left: 0.9rem;
}

.plaque-gate::after {
    right: 0.9rem;
}

.plaque-gate .form {
    margin: 1.75rem auto 0;
    text-align: left;
}

.plaque-emblem {
    display: block;
    width: 5.25rem;
    height: auto;
    margin: 0 auto 0.75rem;
    filter: drop-shadow(0 0 18px rgb(224 112 44 / 40%));
}

.plaque-title {
    font-size: clamp(1.8rem, 6vw, 2.3rem);
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    color: var(--gold);
    text-shadow: 0 2px 0 #3a210c, 0 0 24px rgb(224 112 44 / 30%);
}

.plaque-lead {
    margin: 0 auto;
    max-width: 24rem;
    color: var(--sand-dim);
    font-style: italic;
}

.plaque-gate .flash {
    margin: 1.25rem 0 0;
    text-align: left;
}

.plaque-footer {
    margin: 1.75rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    color: var(--sand-mute);
    font-size: 0.98rem;
}

.plaque-heading {
    font-size: 1.35rem;
}

.plaque-wide {
    max-width: none;
}

.plaque-wide > :last-child {
    margin-bottom: 0;
}

/* ---------- Pastille d'état (allumée / éteinte : account.css) ---------- */

.status {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.status::before {
    content: '';
    flex: none;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    transform: translateY(-0.05em);
}

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

.site-footer {
    padding: 2rem 1rem 2.5rem;
    text-align: center;
}

.site-footer-rule {
    display: block;
    width: min(20rem, 60%);
    height: 1px;
    margin: 0 auto 1rem;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.site-footer-motto {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--sand-mute);
}

/* ---------- Petits écrans ---------- */

@media (max-width: 40rem) {
    .site-header {
        padding-inline: 0.9rem;
    }

    .site-title {
        gap: 0.45rem;
        font-size: 1.1rem;
        letter-spacing: 0.12em;
    }

    .site-title-emblem {
        width: 2rem;
        height: 2rem;
    }

    .site-nav {
        margin-left: auto;
        gap: 0.4rem 0.75rem;
    }

    .site-nav a {
        font-size: 0.7rem;
        letter-spacing: 0.08em;
    }

    .site-nav .site-nav-cta {
        padding: 0.35rem 0.6rem;
    }
}

/* ---------- Mouvement : torches et braises, seulement si le visiteur l'accepte ---------- */

@media (prefers-reduced-motion: no-preference) {
    .hero-sky::before,
    .hero-sky::after,
    .gate::before {
        animation: torch-flicker 3.2s ease-in-out infinite alternate;
    }

    .plaque-gate {
        animation: rise-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    }
}

@keyframes torch-flicker {
    0% {
        opacity: 0.78;
    }

    22% {
        opacity: 1;
    }

    41% {
        opacity: 0.86;
    }

    63% {
        opacity: 0.97;
    }

    100% {
        opacity: 0.82;
    }
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Écurie : liste, recrutement, fiche ---------- */

.roster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.roster-link {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    height: 100%;
    padding: 1.25rem 1.4rem;
    color: var(--sand);
    text-decoration: none;
    background: linear-gradient(180deg, var(--stone-2), var(--ink-2));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: inset 0 0 0 4px rgb(14 10 8 / 60%), inset 0 0 0 5px rgb(201 151 63 / 22%);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.roster-link:hover,
.roster-link:focus-visible {
    border-color: var(--bronze);
    transform: translateY(-2px);
}

.roster-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
    overflow-wrap: anywhere;
}

.roster-meta {
    color: var(--sand-dim);
    font-size: 0.95rem;
}

.roster-card-dead .roster-link {
    filter: grayscale(0.8);
    opacity: 0.7;
}

.roster-status {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--danger-text);
}

.roster-actions {
    margin-top: 1.75rem;
    text-align: center;
}

.recruit fieldset {
    min-width: 0;
    margin: 0 0 1.5rem;
    padding: 0;
    border: 0;
}

.recruit legend {
    margin-bottom: 0.75rem;
}

.recruit-identity {
    display: grid;
    gap: 0.75rem;
}

.recruit-identity input[type='radio'] {
    accent-color: var(--blood);
}

.recruit-identity input[type='radio'] + label {
    margin: 0 1.25rem 0 0.35rem;
    color: var(--sand);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    gap: 0.75rem 1rem;
}

.budget {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    letter-spacing: 0.08em;
    color: var(--sand-dim);
}

.budget-value {
    display: inline-block;
    min-width: 2.5ch;
    font-size: 1.6rem;
    color: var(--gold);
    text-align: center;
}

.budget-over .budget-value {
    color: var(--danger-text);
}

.budget-done .budget-value {
    color: var(--success-text);
}

.stat-sheet {
    display: grid;
    gap: 0.6rem;
    margin: 0 0 1rem;
}

.stat-line {
    display: grid;
    grid-template-columns: minmax(9rem, 13rem) 1fr;
    gap: 0.75rem;
    align-items: center;
}

.stat-line dt {
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bronze-light);
}

.stat-line dd {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 0;
}

.stat-meter {
    flex: 1;
    height: 0.7rem;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.stat-meter::-webkit-meter-bar {
    background: var(--ink);
    border: 0;
    border-radius: 999px;
}

.stat-meter::-webkit-meter-optimum-value {
    background: linear-gradient(90deg, var(--blood), var(--bronze-light));
    border-radius: 999px;
}

.stat-meter::-moz-meter-bar {
    background: linear-gradient(90deg, var(--blood), var(--bronze-light));
    border-radius: 999px;
}

.stat-value {
    min-width: 2ch;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--gold);
    text-align: right;
}

.tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.4rem;
    font-size: 0.72rem;
    color: var(--ember);
    border: 1px solid currentColor;
    border-radius: 999px;
}

@media (max-width: 40rem) {
    .stat-line {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
}

.form.recruit {
    max-width: none;
}

.recruit-identity {
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    align-items: start;
}

.recruit .field-stat .field-label {
    min-height: 2.4em;
    display: flex;
    align-items: flex-end;
}

.page-header .plaque-lead {
    max-width: 42rem;
    margin: 0.25rem 0 0;
    text-align: left;
}

.stat-delta {
    font-size: 0.8rem;
    white-space: nowrap;
}

.stat-delta-up {
    color: var(--success-text);
}

.stat-delta-down {
    color: var(--danger-text);
}

.armor-name {
    margin: 0 0 0.5rem;
    font-weight: 600;
    color: var(--sand);
}

.armor-name.rarity-rare {
    color: #8fc3ff;
}

.armor-name.rarity-epic {
    color: #d3a6ff;
}

.armor-name.rarity-legendary {
    color: var(--gold);
}

.effects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---------- Raretés ---------- */

.rarity-common {
    --rarity: #c2ad8a;
    --rarity-deep: #5c4a33;
    --spark: #e9d9b8;
    --impact-delay: 0.68s;
    --flip-end: 0.95s;
    --spark-distance: 0px;
}

.rarity-rare {
    --rarity: #6fa8ff;
    --rarity-deep: #1d3a66;
    --spark: #b9d6ff;
    --impact-delay: 0.68s;
    --flip-end: 0.95s;
    --spark-distance: 95px;
}

.rarity-epic {
    --rarity: #c084fc;
    --rarity-deep: #4a1f6e;
    --spark: #e6c8ff;
    --impact-delay: 0.83s;
    --flip-end: 1.1s;
    --spark-distance: 150px;
}

.rarity-legendary {
    --rarity: #f3c25a;
    --rarity-deep: #6b4a10;
    --spark: #fff0b8;
    --impact-delay: 1.78s;
    --flip-end: 2.1s;
    --spark-distance: 230px;
}

.candidate-rarity {
    display: inline-block;
    padding: 0.2rem 0.85rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--rarity, var(--sand));
    background: linear-gradient(180deg, color-mix(in srgb, var(--rarity-deep, #000) 70%, #000), rgb(0 0 0 / 60%));
    border: 1px solid color-mix(in srgb, var(--rarity, var(--line)) 70%, transparent);
    border-radius: 999px;
    box-shadow: 0 0 12px color-mix(in srgb, var(--rarity, transparent) 25%, transparent);
    vertical-align: middle;
}

.page-title .candidate-rarity {
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

/* ---------- Écurie, mémorial, plafonds ---------- */

.roster-card .roster-link {
    border-color: color-mix(in srgb, var(--rarity, var(--line-strong)) 55%, var(--line));
}

.memorial {
    margin-top: 3rem;
}

.stat-cap {
    min-width: 3ch;
    font-size: 0.85rem;
    color: var(--sand-mute);
}

.kit {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kit-item {
    padding: 0.15rem 0.6rem;
    font-size: 0.85rem;
    color: var(--rarity, var(--sand-dim));
    background: rgb(0 0 0 / 40%);
    border: 1px solid color-mix(in srgb, var(--rarity, var(--line)) 55%, transparent);
    border-radius: 999px;
}

.kit-armor {
    font-style: italic;
}

.kit-empty {
    color: var(--sand-mute);
}

@keyframes sheen {
    /* Fondu au début et à la fin : le reflet n'est jamais visible quand il revient à son point de départ */
    0% {
        background-position: 150% 0;
        opacity: 0;
    }

    20%,
    80% {
        opacity: 1;
    }

    100% {
        background-position: -50% 0;
        opacity: 0;
    }
}

/* Portraits SVG (A06d) : personnage en pied, dessiné au format 4:5 */
.candidate-portrait img,
.gcard-portrait img,
.roster-portrait img,
.pd-figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 100%;
}

/* Candidats : léger resserrement, les pieds restent dans le cadre (chaussures visibles, D9) */
.candidate-portrait img {
    transform: scale(1.06);
    transform-origin: 50% 92%;
}

/* Vignettes : cadrage resserré sur le haut du corps, le visage reste lisible en petit */
.roster-portrait img {
    transform: scale(1.55);
    transform-origin: 50% 12%;
}

/* Carte : de la tête aux cuisses ; le mannequin d'équipement, juste dessous, montre le personnage en pied */
.gcard-portrait img {
    transform: scale(1.3);
    transform-origin: 50% 8%;
}

/* Effets d'un objet : sur la carte et à la forge, d'où leur place ici et non dans card.css */
.pd-effects {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.55rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--sand-dim);
}

/*
 * Traits d'un objet en mots (D9b) : de courtes phrases d'un bloc, séparées d'un point discret qui reste en fin de
 * ligne (le retour à la ligne se fait à l'espace entre deux phrases, jamais au milieu d'une courte).
 */
.item-features {
    display: block;
}

.item-features > span {
    display: inline-block;
}

.item-features > span:not(:last-child)::after {
    content: '·';
    margin-left: 0.4rem;
    color: var(--sand-mute);
}

/* ---------- Texte pour les lecteurs d'écran seulement ---------- */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

