:root {
    --olive: #263316;
    --olive2: #445522;
    --olive3: #68743b;
    --paper: #f3eddc;
    --paper2: #fffaf0;
    --ink: #18210e;
    --line: #b8ad91;
    --muted: #6c6a58;
    --shadow: 0 12px 35px rgba(0, 0, 0, .12);

    --lfm-header-green: #26351f;
    --lfm-paper: #f3ead5;
    --lfm-ink: #151b12;
    --lfm-border: #465632;
    --lfm-a4-screen-w: 794px;
    --lfm-a4-screen-h: 1123px;
    --lfm-title-font: "Roboto Condensed", "Oswald", "Bebas Neue", "Arial Narrow", Impact, sans-serif;
    --lfm-body-font: Arial, Helvetica, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: #f6f3eb;
    color: var(--ink);
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================
   Site / admin
   ========================================================== */

.topbar {
    height: 72px;
    background: linear-gradient(90deg, #19230d, #33421c);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0 28px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.brand .logo {
    width: 42px;
    height: 42px;
    border: 2px solid #d7c88f;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #d7c88f;
}

.topbar nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.topbar nav a {
    opacity: .92;
}

.topbar nav a.active {
    border-bottom: 2px solid #d7c88f;
    padding-bottom: 6px;
}

.top-actions,
.header-actions,
.nav-actions,
.auth-links,
.user-menu {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-actions a,
.nav-actions a,
.auth-links a,
.user-menu a,
.top-actions a,
.user-badge,
.user-name {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 999px;
    color: #f5efd9;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .02em;
    white-space: nowrap;
    background: rgba(255, 255, 255, .08);
}

.user-badge,
.user-name {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-badge::before,
.user-name::before {
    content: "👤";
    margin-right: 8px;
    font-size: 13px;
}

.btn {
    border: 1px solid var(--line);
    background: var(--olive2);
    border-radius: 8px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.btn.primary {
    background: var(--olive2);
    color: #fff;
}

.btn.ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, .35);
}

.layout {
    display: grid;
    grid-template-columns: 210px 1fr;
    min-height: calc(100vh - 72px);
}

.sidebar {
    background: linear-gradient(#1d2b12, #263316);
    color: #fff;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar a {
    padding: 12px 14px;
    border-radius: 8px;
    opacity: .92;
}

.sidebar a.active,
.sidebar a:hover {
    background: rgba(255, 255, 255, .11);
}

.content {
    padding: 22px;
    overflow: auto;
}

.card {
    background: #fff;
    border: 1px solid #ddd6c5;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .05);
    padding: 18px;
    margin-bottom: 16px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.two {
    grid-template-columns: 1fr 1fr;
}

.grid.three {
    grid-template-columns: repeat(3, 1fr);
}

label {
    font-weight: 800;
    font-size: 13px;
    display: block;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cec6b4;
    border-radius: 7px;
    padding: 10px;
    background: #fffdf8;
    font: inherit;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.small {
    font-size: 12px;
    color: var(--muted);
}

.message {
    padding: 12px 14px;
    border-radius: 8px;
    background: #ecf6df;
    border: 1px solid #bdce95;
    margin-bottom: 16px;
}

.error {
    background: #f8e8e1;
    border-color: #e2aa93;
}

/* ==========================================================
   Badges
   ========================================================== */

.badge,
.status-badge,
.role-badge,
.account-badge,
.user-role,
.user-status,
.scenario-status,
.objective-status,
.pill,
.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(37, 53, 31, .28);
    background: #f5f0df;
    color: #25351f;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .02em;
    white-space: nowrap;
}

.badge-published,
.status-published,
.scenario-status.published,
.objective-status.published,
.tag-published,
.pill-published {
    background: #e9f0df;
    color: #25351f;
}

.badge-pending,
.status-pending,
.scenario-status.pending,
.objective-status.pending,
.tag-pending,
.pill-pending {
    background: #fbf0d4;
    color: #5a4318;
}

.badge-rejected,
.status-rejected,
.scenario-status.rejected,
.objective-status.rejected,
.tag-rejected,
.pill-rejected {
    background: #f3dddd;
    color: #6f2020;
}

/* ==========================================================
   Public
   ========================================================== */

.public-hero {
    background: var(--paper);
    padding: 45px 28px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.public-hero h1 {
    font-family: Impact, 'Arial Narrow', sans-serif;
    font-size: 48px;
    color: var(--olive);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.filters {
    max-width: 1260px;
    margin: -24px auto 24px;
    background: #fffaf0;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 18px;
}

.scenario-filters {
    display: grid;
    grid-template-columns: 2fr .85fr .85fr 1fr 1fr 1fr 1fr;
    gap: 14px;
}

.scenario-list,
.objectives-list {
    max-width: 1260px;
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.scenario-card,
.objective-card {
    background: #fff;
    border: 1px solid #ddd4c2;
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .08);
    overflow: hidden;
}

.scenario-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.scenario-card .body,
.objective-card-body {
    padding: 16px;
}

.tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.random-box {
    max-width: 1260px;
    margin: 20px auto;
    background: #263316;
    color: #fff;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.random-actions,
.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hidden-form {
    max-width: 760px;
    margin: 24px auto;
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.contributor-line {
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px dashed #d0c7b4;
    color: var(--muted);
    font-size: 13px;
}

.objectives-filters {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.objective-card-header {
    background: linear-gradient(90deg, var(--olive), var(--olive2));
    color: #f8efd3;
    padding: 14px 16px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.objective-card-header h2 {
    margin: 0;
    font-size: 20px;
}

.objective-icon {
    width: 34px;
    height: 34px;
    border: 2px solid #d7c88f;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    color: #d7c88f;
}

.objective-card-footer {
    padding: 12px 16px;
    border-top: 1px dashed #d0c7b4;
    color: var(--muted);
    font-size: 13px;
    background: rgba(38, 51, 22, .035);
}

.empty-state {
    grid-column: 1 / -1;
    background: #fffaf0;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow);
}

/* ==========================================================
   Footer site
   ========================================================== */

.site-footer {
    margin-top: 48px;
    padding: 24px 16px;
    background: linear-gradient(90deg, #19230d, #33421c);
    color: #f3ead5;
    border-top: 4px solid #8b7a4a;
    font-size: .95rem;
    text-align: center;
}

.site-footer__inner {
    max-width: 1180px;
    margin: 0 auto;
}

.site-footer p {
    margin: 0;
    line-height: 1.6;
}

.site-footer a {
    color: #f3ead5;
    text-decoration: none;
    border-bottom: 1px solid rgba(243, 234, 213, .55);
}

/* ==========================================================
   RGPD
   ========================================================== */

.rgpd-consent-line {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid rgba(77, 93, 54, .28);
    border-radius: 12px;
    background: rgba(255, 248, 232, .7);
    color: var(--lfm-ink);
    text-transform: none;
}

.rgpd-consent-line input {
    width: auto !important;
    margin-top: 3px;
}

.rgpd-banner {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    display: none;
    max-width: 980px;
    margin: 0 auto;
    padding: 16px;
    border: 1px solid rgba(255, 248, 232, .25);
    border-radius: 16px;
    background: var(--lfm-header-green);
    color: #fff7de;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .28);
}

.rgpd-banner.is-visible {
    display: block;
}

.rgpd-page {
    max-width: 920px;
    margin: 34px auto;
    padding: 26px;
    background: rgba(255, 248, 232, .92);
    border: 1px solid rgba(77, 93, 54, .28);
    border-radius: 18px;
    line-height: 1.6;
}

/* ==========================================================
   Aperçu A4
   ========================================================== */

.scenario-view-page {
    max-width: 100%;
    padding: 24px 18px 42px;
    overflow-x: hidden;
}

.scenario-view-header {
    max-width: 1220px;
    margin: 0 auto 22px;
    padding: 20px 22px;
    background: rgba(255, 248, 232, .92);
    border: 1px solid rgba(77, 93, 54, .28);
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
}

.scenario-view-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.preview-wrap,
.scenario-preview-a4,
.sheet-preview-a4,
.sheet-preview,
.pdf-preview,
.print-preview {
    width: 100%;
    max-width: 100%;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 24px !important;
    padding: 24px 12px 38px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    box-sizing: border-box !important;
}

/* ==========================================================
   Fiche A4
   ========================================================== */

.sheet,
.sheet-recto,
.sheet-verso {
    width: var(--lfm-a4-screen-w) !important;
    height: var(--lfm-a4-screen-h) !important;
    min-width: var(--lfm-a4-screen-w) !important;
    max-width: var(--lfm-a4-screen-w) !important;
    min-height: var(--lfm-a4-screen-h) !important;
    max-height: var(--lfm-a4-screen-h) !important;
    position: relative !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    flex: 0 0 var(--lfm-a4-screen-w) !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--lfm-ink) !important;
    border: 2px solid var(--lfm-border) !important;
    border-radius: 0 !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, .24) !important;
    background:
        radial-gradient(circle at 16% 5%, rgba(255, 255, 255, .42), transparent 25%),
        radial-gradient(circle at 85% 20%, rgba(74, 58, 34, .10), transparent 28%),
        linear-gradient(180deg, #fbf3df 0%, var(--lfm-paper) 100%) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;

    --sheet-accent: #31451f;
    --sheet-accent-dark: #25351b;
    --sheet-accent-mid: #425d2a;
    --sheet-title-color: #26351f;
}

.sheet::before {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 8px;
    border: 1px solid rgba(75, 91, 53, .58);
    pointer-events: none;
}

.sheet-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 30px 24px 42px;
}

.sheet-recto .sheet-inner,
.sheet-verso .sheet-inner {
    display: flex !important;
    flex-direction: column !important;
}

/* Designs */
.sheet-design-allied-green { --sheet-accent: #31451f; --sheet-accent-dark: #25351b; --sheet-accent-mid: #425d2a; --sheet-title-color: #26351f; }
.sheet-design-german-gray { --sheet-accent: #55595a; --sheet-accent-dark: #303335; --sheet-accent-mid: #6a6e70; --sheet-title-color: #303436; }
.sheet-design-soviet-red { --sheet-accent: #a82922; --sheet-accent-dark: #741714; --sheet-accent-mid: #bf3a30; --sheet-title-color: #6e1b17; }
.sheet-design-japanese-white { --sheet-accent: #b72424; --sheet-accent-dark: #8c1919; --sheet-accent-mid: #d34d45; --sheet-title-color: #3b3024; }
.sheet-design-british-tan { --sheet-accent: #7d6035; --sheet-accent-dark: #5c4628; --sheet-accent-mid: #927344; --sheet-title-color: #4b3b25; }
.sheet-design-italian-blue { --sheet-accent: #405767; --sheet-accent-dark: #2f414d; --sheet-accent-mid: #597487; --sheet-title-color: #2d3e49; }
.sheet-design-french-blue { --sheet-accent: #465f80; --sheet-accent-dark: #2e4058; --sheet-accent-mid: #5d789d; --sheet-title-color: #2f4059; }
.sheet-design-polish-red { --sheet-accent: #a82922; --sheet-accent-dark: #741714; --sheet-accent-mid: #bf3a30; --sheet-title-color: #6e1b17; }
.sheet-design-hungarian-olive { --sheet-accent: #4b5c2e; --sheet-accent-dark: #303b1f; --sheet-accent-mid: #68773f; --sheet-title-color: #303b1f; }
.sheet-design-finnish-blue { --sheet-accent: #355f8d; --sheet-accent-dark: #213d5f; --sheet-accent-mid: #4e7caf; --sheet-title-color: #213d5f; }

/* En-tête */
.sheet-header h1,
.sheet h1 {
    margin: 0 0 12px !important;
    color: var(--sheet-title-color) !important;
    text-align: center !important;
    font-family: var(--lfm-title-font) !important;
    font-size: 45px !important;
    line-height: .92 !important;
    font-weight: 900 !important;
    letter-spacing: .035em !important;
    text-transform: uppercase !important;
}


/* Bannière A4 2048x124 : le fichier PNG est déjà au bon ratio.
   Un seul système est conservé : .sheet-banner-a4 avec une vraie image <img>. */
body .sheet .sheet-banner,
body .sheet .sheet-banner-asset,
body .sheet .sheet-banner-art,
body .sheet .banner,
body .sheet .sheet-banner-wrap,
body .sheet .sheet-banner-img,
body .sheet .sheet-banner-text {
    display: none !important;
}

body .sheet .sheet-banner-a4 {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 2048 / 124 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 8px auto 12px !important;
    padding: 0 !important;
    line-height: 0 !important;
    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

body .sheet .sheet-banner-a4-img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: transparent !important;
}

body .sheet .sheet-banner-a4-text {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 18% !important;
    box-sizing: border-box !important;
    background: transparent !important;
    color: #fff7dc !important;
    font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Narrow", sans-serif !important;
    font-size: 21px !important;
    line-height: 1 !important;
    letter-spacing: .045em !important;
    text-align: center !important;
    text-transform: uppercase !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .8) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body .sheet.sheet-design-japanese-white .sheet-banner-a4-text {
    color: #5b201b !important;
    text-shadow: none !important;
}

.sheet-points,
.sheet .points {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    gap: 16px !important;
    margin: 0 0 12px !important;
    color: var(--sheet-title-color) !important;
    font-family: var(--lfm-title-font) !important;
    font-size: 18px !important;
    line-height: 1 !important;
    letter-spacing: .045em !important;
    text-align: center !important;
    text-transform: uppercase !important;
}

.sheet-points span,
.sheet .points span {
    display: block;
    height: 2px;
    background: var(--sheet-accent) !important;
}

.sheet-points strong {
    color: var(--sheet-title-color) !important;
    font-weight: 900;
    white-space: nowrap;
}

.sheet-war-period {
    margin: -3px auto 10px;
    color: var(--sheet-title-color);
    font-family: var(--lfm-title-font);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
}

.sheet-war-period::before,
.sheet-war-period::after {
    content: "★";
    display: inline-block;
    margin: 0 .55em;
}

/* Image et grilles */
.sheet-battlefield-frame {
    flex: 0 0 auto !important;
    width: 100% !important;
    height: 420px !important;
    margin: 0 0 18px !important;
    overflow: hidden !important;
    border: 2px solid rgba(38, 53, 31, .82) !important;
    border-radius: 10px !important;
    background: #d5c9a8 !important;
}

.sheet-battlefield-frame img,
.sheet .battle-img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: cover !important;
    object-position: center center !important;
    border: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    filter: sepia(.15) saturate(.85);
}

.sheet-recto-grid,
.sheet-grid {
    flex: 1 1 auto !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-auto-rows: minmax(132px, 1fr) !important;
    gap: 11px !important;
    min-height: 0 !important;
    padding-bottom: 54px !important;
}

.sheet-verso-grid {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    align-content: stretch !important;
    gap: 12px !important;
    padding-bottom: 58px !important;
}

.sheet-box-wide,
.box.full {
    grid-column: 1 / -1 !important;
}

.sheet-recto .sheet-box,
.sheet-recto .box {
    height: auto !important;
    min-height: 132px !important;
}

.sheet-verso .sheet-box:not(.sheet-box-wide),
.sheet-verso .box:not(.full) {
    min-height: 150px !important;
}

/* Boîtes */
.sheet-box,
.sheet .box {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border: 2px solid rgba(75, 91, 53, .75) !important;
    border-radius: 7px !important;
    background: rgba(255, 248, 232, .74) !important;
}

.sheet-box h2,
.sheet .box h2,
.sheet-special-rules-box h2,
.sheet-victory-box h2 {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 0 0 auto !important;
    min-height: 31px !important;
    margin: 0 !important;
    padding: 0 9px !important;
    color: #fff7dc !important;
    background: linear-gradient(180deg, var(--sheet-accent-mid), var(--sheet-accent-dark)) !important;
    font-family: var(--lfm-title-font) !important;
    font-size: 21px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    letter-spacing: .052em !important;
    text-transform: uppercase !important;
}

.sheet-box h2 *,
.sheet .box h2 * {
    color: #fff7dc !important;
}

.sheet-box-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    color: #fff7dc !important;
    background: transparent !important;
    border: 1px solid rgba(255, 247, 220, .55) !important;
    border-radius: 3px;
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.sheet-box-content,
.sheet .box > :not(h2) {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    overflow: hidden !important;
    padding: 10px 13px 9px !important;
}

.sheet-density-md .sheet-box-content,
.sheet-density-sm .sheet-box-content,
.sheet-density-xs .sheet-box-content,
.sheet-victory-box .sheet-box-content,
.sheet-special-rules-box .sheet-special-rules-content {
    justify-content: flex-start !important;
}

.sheet p,
.sheet .sheet-paragraph,
.sheet .sheet-bullet-line,
.sheet .sheet-numbered-line {
    color: #111 !important;
    font-family: var(--lfm-body-font) !important;
    font-size: 14px !important;
    line-height: 1.18 !important;
    overflow-wrap: anywhere !important;
}

.sheet p,
.sheet .sheet-paragraph {
    margin: 0 0 7px !important;
}

.sheet-spacer {
    height: 7px !important;
}

.sheet-bullet-line {
    display: grid !important;
    grid-template-columns: 13px 1fr !important;
    gap: 5px !important;
    margin: 0 0 5px !important;
}

.sheet-numbered-line {
    display: grid !important;
    grid-template-columns: 28px 1fr !important;
    gap: 8px !important;
    align-items: start !important;
    margin: 0 0 8px !important;
}

.sheet-number-badge,
.sheet-list-number,
.sheet-special-number,
.sheet-special-rule-number {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    border-radius: 50% !important;
    color: #fff7dc !important;
    background: var(--sheet-accent) !important;
    border: 1px solid var(--sheet-accent-dark) !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 15px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
}

.sheet-density-loose p,
.sheet-density-loose .sheet-paragraph,
.sheet-density-loose .sheet-bullet-line,
.sheet-density-loose .sheet-numbered-line {
    font-size: 14.8px !important;
    line-height: 1.24 !important;
}

.sheet-density-md p,
.sheet-density-md .sheet-paragraph,
.sheet-density-md .sheet-bullet-line,
.sheet-density-md .sheet-numbered-line {
    font-size: 13.2px !important;
    line-height: 1.16 !important;
}

.sheet-density-sm p,
.sheet-density-sm .sheet-paragraph,
.sheet-density-sm .sheet-bullet-line,
.sheet-density-sm .sheet-numbered-line {
    font-size: 12.2px !important;
    line-height: 1.12 !important;
}

.sheet-density-xs p,
.sheet-density-xs .sheet-paragraph,
.sheet-density-xs .sheet-bullet-line,
.sheet-density-xs .sheet-numbered-line {
    font-size: 11.4px !important;
    line-height: 1.08 !important;
}

/* Conditions / rappel */
.sheet-victory-layout {
    flex: 1 1 auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 250px !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 13px !important;
    box-sizing: border-box !important;
}

.sheet-victory-layout.sheet-no-reminder {
    grid-template-columns: 1fr !important;
}

.sheet-victory-layout .sheet-box-content {
    padding: 0 !important;
}

.sheet-reminder {
    align-self: center !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    border: 2px solid rgba(75, 91, 53, .7) !important;
    border-radius: 6px !important;
    background: rgba(255, 248, 232, .78) !important;
}

.sheet-reminder strong {
    display: block !important;
    margin: 0 0 8px !important;
    color: var(--sheet-accent-dark) !important;
    text-align: center !important;
    font-family: var(--lfm-title-font) !important;
    font-size: 18px !important;
    letter-spacing: .05em !important;
}

/* Règles spéciales */
.sheet-special-rules-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 10px 14px !important;
}

.sheet-special-rules-grid {
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    column-gap: 34px !important;
    row-gap: 12px !important;
    align-content: start !important;
}

.sheet-special-rules-grid::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 2px dashed rgba(38, 53, 31, .35) !important;
}

.sheet-special-rule {
    position: relative !important;
    z-index: 1 !important;
    min-width: 0 !important;
    overflow: visible !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

.sheet-special-rule-title {
    display: grid !important;
    grid-template-columns: 28px 1fr !important;
    gap: 9px !important;
    align-items: center !important;
    margin: 0 0 5px !important;
    color: #111 !important;
    font-family: var(--lfm-body-font) !important;
    font-size: 14.7px !important;
    line-height: 1.1 !important;
    font-weight: 800 !important;
}

.sheet-special-rule-body,
.sheet-special-rule-body p,
.sheet-special-rule-body .sheet-paragraph,
.sheet-special-rule-body .sheet-bullet-line,
.sheet-special-rule-body .sheet-numbered-line {
    font-size: 12.2px !important;
    line-height: 1.15 !important;
}

/* BG pied de page en vraie image.
   Le filigrane est derrière les blocs et le footer texte reste au-dessus. */
body .sheet .sheet-inner {
    position: relative !important;
    z-index: 2 !important;
}

body .sheet .sheet-footer-vignette {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 16px !important;
    width: 100% !important;
    height: 135px !important;
    z-index: 1 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    background: none !important;
    opacity: 1 !important;
}

body .sheet .sheet-footer-vignette img.sheet-footer-vignette-img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center bottom !important;
    opacity: .55 !important;
    mix-blend-mode: multiply !important;
    visibility: visible !important;
}

body .sheet .sheet-header,
body .sheet .sheet-battlefield-frame,
body .sheet .sheet-recto-grid,
body .sheet .sheet-verso-grid,
body .sheet .sheet-box,
body .sheet .box {
    position: relative !important;
    z-index: 5 !important;
}

body .sheet .sheet-footer {
    position: absolute !important;
    z-index: 35 !important;
    left: 24px !important;
    right: 24px !important;
    bottom: 8px !important;
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: end !important;
    gap: 12px !important;
    color: var(--sheet-title-color) !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 11px !important;
    line-height: 1 !important;
    text-shadow: 0 1px 0 rgba(255, 248, 232, .75) !important;
}

.sheet-footer-left {
    text-align: left !important;
    font-weight: 700 !important;
}

.sheet-footer-center {
    min-width: 88px !important;
    padding: 6px 15px 5px !important;
    border: 2px solid rgba(75, 91, 53, .7) !important;
    border-radius: 999px !important;
    background: rgba(255, 248, 232, .92) !important;
    color: var(--sheet-title-color) !important;
    text-align: center !important;
    font-family: var(--lfm-title-font) !important;
    font-size: 17px !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    box-shadow: 0 0 0 2px rgba(255, 248, 232, .45) !important;
}

.sheet-footer-right {
    text-align: right !important;
    font-weight: 700 !important;
}

/* Formulaires design */
.sheet-design-selector,
.sheet-design-choice,
.sheet-design-choice img {
    display: none !important;
}

select[name="sheet_design"] {
    width: 100%;
    min-height: 42px;
}

.form-help {
    margin: .4rem 0 0;
    color: #6a634e;
    font-size: .88rem;
    line-height: 1.35;
}

/* Admin édition : aperçu empilé */
.scenario-admin-form.grid.two {
    grid-template-columns: minmax(620px, 1fr) minmax(340px, 430px) !important;
    align-items: start !important;
    gap: 1.25rem !important;
}

.scenario-admin-form > section:last-child {
    min-width: 0;
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

.scenario-admin-form .scenario-preview-a4,
.scenario-admin-form .preview-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    overflow-x: hidden !important;
}

.scenario-admin-form .scenario-preview-a4 .sheet,
.scenario-admin-form .preview-wrap .sheet {
    transform: scale(.47) !important;
    transform-origin: top center !important;
    margin-bottom: -570px !important;
}

.scenario-admin-form .scenario-preview-a4 .sheet:last-child,
.scenario-admin-form .preview-wrap .sheet:last-child {
    margin-bottom: 0 !important;
}

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 1180px) {
    .scenario-admin-form.grid.two {
        grid-template-columns: 1fr !important;
    }

    .scenario-admin-form > section:last-child {
        position: static;
        max-height: none;
    }

    .scenario-admin-form .scenario-preview-a4,
    .scenario-admin-form .preview-wrap {
        flex-direction: row !important;
        align-items: flex-start !important;
        overflow-x: auto !important;
    }

    .scenario-admin-form .scenario-preview-a4 .sheet,
    .scenario-admin-form .preview-wrap .sheet {
        transform: none !important;
        margin-bottom: 0 !important;
    }
}

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .grid.two,
    .grid.three,
    .scenario-list,
    .scenario-filters,
    .objectives-filters,
    .objectives-list {
        grid-template-columns: 1fr;
    }

    .random-box {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media screen and (max-width: 1700px) {
    .scenario-preview-a4,
    .sheet-preview-a4,
    .preview-wrap,
    .sheet-preview,
    .pdf-preview,
    .print-preview {
        justify-content: flex-start !important;
    }
}

@media (max-width: 760px) {
    .topbar {
        height: auto;
        min-height: 72px;
        flex-wrap: wrap;
        padding: 14px;
    }

    .topbar nav,
    .top-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .sheet-banner-a4-text {
        padding: 0 18% !important;
        font-size: 16px !important;
    }
}

/* ==========================================================
   Impression
   ========================================================== */

@page {
    size: A4 portrait;
    margin: 0;
}

@media print {
    html,
    body {
        width: 210mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body * {
        visibility: hidden !important;
    }

    .scenario-preview-a4,
    .sheet-preview-a4,
    .preview-wrap,
    .sheet-preview,
    .pdf-preview,
    .print-preview,
    .scenario-preview-a4 *,
    .sheet-preview-a4 *,
    .preview-wrap *,
    .sheet-preview *,
    .pdf-preview *,
    .print-preview * {
        visibility: visible !important;
    }

    .scenario-preview-a4,
    .sheet-preview-a4,
    .preview-wrap,
    .sheet-preview,
    .pdf-preview,
    .print-preview {
        display: block !important;
        width: 210mm !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
    }

    .sheet,
    .sheet-recto,
    .sheet-verso {
        width: 210mm !important;
        height: 297mm !important;
        min-width: 210mm !important;
        max-width: 210mm !important;
        min-height: 297mm !important;
        max-height: 297mm !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        page-break-after: always !important;
        break-after: page !important;
        overflow: hidden !important;
    }

    .sheet-inner {
        padding: 7.9mm 6.35mm 11.1mm !important;
    }

    .sheet:last-child {
        page-break-after: auto !important;
        break-after: auto !important;
    }

    .sheet-banner-a4 {
        width: 100% !important;
        margin: 2.5mm auto 3.5mm auto !important;
    }

    .sheet-footer-vignette {
        bottom: 5mm !important;
        height: 25mm !important;
    }

    .sheet-footer-vignette img.sheet-footer-vignette-img {
        opacity: .55 !important;
    }

    .sheet-footer {
        bottom: 2.8mm !important;
    }

    .site-header,
    .site-footer,
    .scenario-view-header,
    .no-print,
    .topbar,
    .admin-header,
    .admin-sidebar,
    .sidebar,
    nav,
    header:not(.sheet-header),
    footer:not(.sheet-footer) {
        display: none !important;
    }
}

/* ==========================================================
   Correctif final stable : garde-fous bannière + filigrane
   ========================================================== */
body .sheet .sheet-banner-a4 {
    aspect-ratio: 2048 / 124 !important;
}

body .sheet .sheet-banner-a4-img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
}

body .sheet .sheet-footer-vignette {
    z-index: 1 !important;
}

body .sheet .sheet-footer {
    z-index: 35 !important;
}

@media print {
    body .sheet .sheet-banner-a4 {
        width: 100% !important;
        max-width: 100% !important;
        aspect-ratio: 2048 / 124 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 2.5mm auto 3.5mm auto !important;
        padding: 0 !important;
        line-height: 0 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body .sheet .sheet-banner-a4-img {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center center !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body .sheet .sheet-banner-a4-text {
        font-size: 16pt !important;
        line-height: 1 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body .sheet .sheet-footer-vignette {
        left: 0 !important;
        right: 0 !important;
        bottom: 4mm !important;
        width: 210mm !important;
        height: 28mm !important;
        z-index: 1 !important;
    }

    body .sheet .sheet-footer-vignette img.sheet-footer-vignette-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center bottom !important;
        opacity: .55 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ==========================================================
   Correctif fiche v3 : blocs plus transparents et footer groupé
   ========================================================== */

/* Les blocs restent lisibles, mais laissent mieux apparaître le filigrane du bas. */
body .sheet .sheet-box,
body .sheet .box {
    background: rgba(255, 248, 232, .56) !important;
}

body .sheet .sheet-reminder {
    background: rgba(255, 248, 232, .62) !important;
}

/* La ligne de période ne contient plus l'auteur. */
body .sheet .sheet-meta-line {
    gap: 0 !important;
}

body .sheet .sheet-author-inline,
body .sheet .sheet-author-inline::before {
    display: none !important;
    content: "" !important;
}

/* Footer : site à gauche de RECTO/VERSO, auteur à droite, sur la même ligne. */
body .sheet .sheet-footer {
    left: 24px !important;
    right: 24px !important;
    bottom: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 13px !important;
    font-family: var(--lfm-title-font) !important;
    font-size: 13px !important;
    line-height: 1 !important;
    color: var(--sheet-title-color) !important;
}

body .sheet .sheet-footer-left,
body .sheet .sheet-footer-right {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    color: var(--sheet-title-color) !important;
    font-family: var(--lfm-title-font) !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    text-align: center !important;
}

body .sheet .sheet-footer-center {
    flex: 0 0 auto !important;
    min-width: 88px !important;
    font-size: 17px !important;
}

body .sheet .sheet-footer-right:empty::before {
    content: "" !important;
}

@media print {
    body .sheet .sheet-box,
    body .sheet .box {
        background: rgba(255, 248, 232, .56) !important;
    }

    body .sheet .sheet-reminder {
        background: rgba(255, 248, 232, .62) !important;
    }

    body .sheet .sheet-footer {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3.4mm !important;
        font-size: 10pt !important;
    }

    body .sheet .sheet-footer-left,
    body .sheet .sheet-footer-right {
        font-size: 10pt !important;
    }

    body .sheet .sheet-footer-center {
        font-size: 13pt !important;
    }
}


/* ==========================================================
   Correctif v4 : titres sans doublon + index centré + boutons lisibles
   ========================================================== */

/* Les titres de sections gardent "1. CONTEXTE", "2. TABLE", etc.
   On supprime le petit carré numéroté qui doublonnait avec le titre. */
.sheet-box h2,
.sheet .box h2,
.sheet-special-rules-box h2,
.sheet-victory-box h2 {
    justify-content: center !important;
    text-align: center !important;
}

.sheet-box h2 .sheet-box-icon,
.sheet .box h2 .sheet-box-icon,
.sheet-special-rules-box h2 .sheet-box-icon,
.sheet-victory-box h2 .sheet-box-icon {
    display: none !important;
}

/* Blocs de fiche un peu plus transparents pour mieux laisser vivre le filigrane,
   sans toucher à l'opacité du texte. */
.sheet-box,
.sheet .box {
    background: rgba(255, 248, 232, .48) !important;
}

.sheet-box-content,
.sheet .box > :not(h2),
.sheet-victory-layout,
.sheet-special-rules-content {
    color: #111 !important;
    opacity: 1 !important;
}

.sheet-box-content *,
.sheet-victory-layout *,
.sheet-special-rules-content * {
    opacity: 1 !important;
}

/* Index : cartes scénarios/objectifs centrées. */
.scenario-card,
.objective-card {
    text-align: center;
}

.scenario-card .body,
.objective-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.scenario-card h2,
.scenario-card h3,
.objective-card h2,
.objective-card h3 {
    width: 100%;
    text-align: center;
}

.contributor-line,
.objective-card-footer {
    width: 100%;
    text-align: center;
}

.scenario-card .tags,
.objective-card .tags {
    justify-content: center;
}

.scenario-card .card-actions,
.objective-card .card-actions {
    width: 100%;
    justify-content: center;
    align-items: center;
}

/* Boutons importants : texte blanc, notamment "Voir le scénario",
   "Télécharger le PDF" et "Obtenir des objectifs cachés". */
.scenario-card .card-actions a,
.scenario-card .card-actions button,
.objective-card .card-actions a,
.objective-card .card-actions button,
.scenario-view-actions a,
.scenario-view-actions button,
a[href*="pdf"],
a[href*="PDF"],
a[href*="objectifs"],
a[href*="objectives"] {
    color: #fff !important;
}

.scenario-card .card-actions a *,
.scenario-card .card-actions button *,
.objective-card .card-actions a *,
.objective-card .card-actions button *,
.scenario-view-actions a *,
.scenario-view-actions button * {
    color: #fff !important;
}

/* Si un bouton d'action n'a pas la classe primary, on lui donne quand même
   un fond lisible cohérent avec le site. */
.scenario-card .card-actions a,
.scenario-card .card-actions button,
.objective-card .card-actions a,
.objective-card .card-actions button,
.scenario-view-actions a,
.scenario-view-actions button {
    background: var(--olive2) !important;
    border-color: rgba(38, 51, 22, .75) !important;
}

/* ==========================================================
   Correctif v5 : cartes scénarios plus compactes + PDF blanc
   ========================================================== */

/* Resserre l'espace entre l'image, le titre et les pastilles dans l'index. */
.scenario-card .body {
    padding-top: 10px !important;
    gap: 6px !important;
}

.scenario-card h2,
.scenario-card h3 {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    line-height: 1.12 !important;
}

.scenario-card .tags {
    margin-top: 2px !important;
    margin-bottom: 8px !important;
    gap: 5px !important;
}

.scenario-card .contributor-line {
    margin-top: 6px !important;
    padding-top: 7px !important;
}

.scenario-card .card-actions {
    margin-top: 6px !important;
}

/* Force vraiment le bouton/lien "Télécharger le PDF" en blanc, même si une règle plus spécifique le surcharge. */
a[href$=".pdf"],
a[href*=".pdf"],
a[href*="pdf"],
a[href*="PDF"],
.btn[href*="pdf"],
.btn[href*="PDF"],
.scenario-card a[href*="pdf"],
.scenario-card a[href*="PDF"],
.scenario-view-actions a[href*="pdf"],
.scenario-view-actions a[href*="PDF"] {
    color: #fff !important;
    background: var(--olive2) !important;
    border-color: rgba(38, 51, 22, .75) !important;
}

a[href$=".pdf"] *,
a[href*=".pdf"] *,
a[href*="pdf"] *,
a[href*="PDF"] *,
.btn[href*="pdf"] *,
.btn[href*="PDF"] *,
.scenario-card a[href*="pdf"] *,
.scenario-card a[href*="PDF"] *,
.scenario-view-actions a[href*="pdf"] *,
.scenario-view-actions a[href*="PDF"] * {
    color: #fff !important;
}

/* ==========================================================
   Corrections finales intégrées
   - cartes scénario compactes ;
   - boutons d'action en blanc ;
   - formulaire de contribution centré ;
   - fiche scénario longue sur le site ;
   - export PDF stable sans patch fixed/columns cassé.
   ========================================================== */

/* Cartes scénario/objectifs */
.scenario-card,
.objective-card {
    text-align: center;
}

.scenario-card .body,
.objective-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 10px !important;
    gap: 6px !important;
}

.scenario-card h2,
.scenario-card h3,
.objective-card h2,
.objective-card h3 {
    width: 100%;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    line-height: 1.12 !important;
    text-align: center;
}

.scenario-card .tags,
.objective-card .tags {
    justify-content: center;
    margin-top: 2px !important;
    margin-bottom: 8px !important;
    gap: 5px !important;
}

.contributor-line,
.objective-card-footer {
    width: 100%;
    text-align: center;
}

.scenario-card .contributor-line {
    margin-top: 6px !important;
    padding-top: 7px !important;
}

.scenario-card .card-actions,
.objective-card .card-actions {
    width: 100%;
    justify-content: center;
    align-items: center;
    margin-top: 6px !important;
}

/* Boutons : texte blanc même pour Télécharger le PDF */
.btn,
.btn:visited,
.btn.primary,
.btn.primary:visited,
.scenario-card .card-actions a,
.scenario-card .card-actions a:visited,
.scenario-card .card-actions button,
.objective-card .card-actions a,
.objective-card .card-actions a:visited,
.objective-card .card-actions button,
.scenario-view-actions a,
.scenario-view-actions a:visited,
.scenario-view-actions button,
.random-actions a,
.random-actions a:visited,
.random-actions button,
a[href$=".pdf"],
a[href*=".pdf"],
a[href*="pdf"],
a[href*="PDF"],
.btn[href*="pdf"],
.btn[href*="PDF"],
.download-pdf,
.pdf-download,
.btn-download,
.pdf-button {
    color: #fff !important;
}

.scenario-card .card-actions a *,
.scenario-card .card-actions button *,
.objective-card .card-actions a *,
.objective-card .card-actions button *,
.scenario-view-actions a *,
.scenario-view-actions button *,
.random-actions a *,
.random-actions button *,
a[href*="pdf"] *,
a[href*="PDF"] * {
    color: #fff !important;
}

.scenario-card .card-actions a,
.scenario-card .card-actions button,
.objective-card .card-actions a,
.objective-card .card-actions button,
.scenario-view-actions a,
.scenario-view-actions button,
.random-actions a,
.random-actions button,
a[href*="pdf"],
a[href*="PDF"],
.download-pdf,
.pdf-download,
.btn-download,
.pdf-button {
    background: var(--olive2) !important;
    border-color: rgba(38, 51, 22, .75) !important;
}

/* Formulaire public de proposition de scénario */
.scenario-contribution-form,
.scenario-contribution-form-centered {
    width: min(1120px, calc(100% - 32px));
    margin: 28px auto 46px !important;
    display: block !important;
}

.scenario-contribution-main {
    width: 100%;
    margin: 0 auto;
}

.scenario-submit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 18px 0 0;
}

.scenario-submit-note {
    color: var(--muted);
    font-size: .94rem;
    font-weight: 700;
}

/* Fiche : titres sans carré numéroté doublon */
.sheet-box h2,
.sheet .box h2,
.sheet-special-rules-box h2,
.sheet-victory-box h2 {
    justify-content: center !important;
    text-align: center !important;
}

.sheet-box h2 .sheet-box-icon,
.sheet .box h2 .sheet-box-icon,
.sheet-special-rules-box h2 .sheet-box-icon,
.sheet-victory-box h2 .sheet-box-icon {
    display: none !important;
}

/* Fiche : blocs plus transparents, texte inchangé */
body .sheet .sheet-box,
body .sheet .box,
.sheet-box,
.sheet .box {
    background: rgba(255, 248, 232, .48) !important;
}

body .sheet .sheet-reminder,
.sheet-reminder {
    background: rgba(255, 248, 232, .62) !important;
}

.sheet-box-content,
.sheet .box > :not(h2),
.sheet-victory-layout,
.sheet-special-rules-content,
.sheet-box-content *,
.sheet-victory-layout *,
.sheet-special-rules-content * {
    color: #111 !important;
    opacity: 1 !important;
}

/* Fiche : texte courant uniforme */
body .sheet p,
body .sheet .sheet-paragraph,
body .sheet .sheet-bullet-line,
body .sheet .sheet-numbered-line,
body .sheet .sheet-box-content,
body .sheet .sheet-special-rule-body,
body .sheet .sheet-special-rule-body p,
body .sheet .sheet-special-rule-body .sheet-paragraph,
body .sheet .sheet-special-rule-body .sheet-bullet-line,
body .sheet .sheet-special-rule-body .sheet-numbered-line,
body .sheet .sheet-reminder,
body .sheet .sheet-reminder p,
body .sheet .sheet-reminder .sheet-paragraph,
body .sheet .sheet-reminder .sheet-bullet-line,
body .sheet .sheet-reminder .sheet-numbered-line,
body .sheet .sheet-density-loose p,
body .sheet .sheet-density-loose .sheet-paragraph,
body .sheet .sheet-density-loose .sheet-bullet-line,
body .sheet .sheet-density-loose .sheet-numbered-line,
body .sheet .sheet-density-md p,
body .sheet .sheet-density-md .sheet-paragraph,
body .sheet .sheet-density-md .sheet-bullet-line,
body .sheet .sheet-density-md .sheet-numbered-line,
body .sheet .sheet-density-sm p,
body .sheet .sheet-density-sm .sheet-paragraph,
body .sheet .sheet-density-sm .sheet-bullet-line,
body .sheet .sheet-density-sm .sheet-numbered-line,
body .sheet .sheet-density-xs p,
body .sheet .sheet-density-xs .sheet-paragraph,
body .sheet .sheet-density-xs .sheet-bullet-line,
body .sheet .sheet-density-xs .sheet-numbered-line {
    font-size: 13.2px !important;
    line-height: 1.16 !important;
}

body .sheet .sheet-special-rule-title {
    font-size: 14.7px !important;
    line-height: 1.1 !important;
    font-weight: 800 !important;
}

body .sheet .sheet-number-badge,
body .sheet .sheet-list-number,
body .sheet .sheet-special-number,
body .sheet .sheet-special-rule-number {
    font-weight: 900 !important;
}

/* Fiche : footer groupé site / page / auteur */
body .sheet .sheet-footer {
    left: 24px !important;
    right: 24px !important;
    bottom: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 13px !important;
    font-family: var(--lfm-title-font) !important;
    font-size: 13px !important;
    line-height: 1 !important;
    color: var(--sheet-title-color) !important;
}

body .sheet .sheet-footer-left,
body .sheet .sheet-footer-right {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    color: var(--sheet-title-color) !important;
    font-family: var(--lfm-title-font) !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    text-align: center !important;
}

body .sheet .sheet-footer-center {
    flex: 0 0 auto !important;
    min-width: 88px !important;
    font-size: 17px !important;
}

/* Fiche longue sur le site : le scénario peut dépasser deux pages sans couper le texte */
.sheet-flow,
.sheet.sheet-flow {
    width: var(--lfm-a4-screen-w) !important;
    min-width: var(--lfm-a4-screen-w) !important;
    max-width: var(--lfm-a4-screen-w) !important;
    min-height: var(--lfm-a4-screen-h) !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    flex: 0 0 var(--lfm-a4-screen-w) !important;
}

.sheet-flow::before {
    position: absolute !important;
    inset: 8px !important;
    height: auto !important;
    min-height: calc(100% - 16px) !important;
}

.sheet-flow .sheet-inner,
.sheet-flow-inner {
    height: auto !important;
    min-height: var(--lfm-a4-screen-h) !important;
    overflow: visible !important;
    padding-bottom: 54px !important;
}

.sheet-flow-header,
.sheet-flow-battlefield-frame,
.sheet-flow-grid,
.sheet-flow-section,
.sheet-flow-footer {
    position: relative !important;
    z-index: 5 !important;
}

.sheet-flow-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 11px !important;
    padding-bottom: 18px !important;
}

.sheet-flow-section {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
}

.sheet-flow-section .sheet-box-content,
.sheet-flow-section .sheet-special-rules-content {
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
}

.sheet-flow .sheet-box-wide {
    grid-column: 1 / -1 !important;
}

.sheet-flow .sheet-battlefield-frame {
    height: 360px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
}

.sheet-flow .sheet-footer-vignette,
.sheet-flow-vignette {
    z-index: 1 !important;
}

.sheet-flow .sheet-footer {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin-top: 18px !important;
    z-index: 35 !important;
}

.print-return-button,
a.print-return-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--olive2);
    color: #fff !important;
    font-weight: 800;
}

/* Export PDF stable : pas de header/footer fixed, pas de column-count */
@media print {
    .sheet-flow,
    .sheet.sheet-flow {
        position: relative !important;
        width: 210mm !important;
        min-width: 210mm !important;
        max-width: 210mm !important;
        min-height: 297mm !important;
        height: auto !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        border: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        page-break-after: auto !important;
        break-after: auto !important;
        background:
            radial-gradient(circle at 16% 5%, rgba(255, 255, 255, .42), transparent 25%),
            radial-gradient(circle at 85% 20%, rgba(74, 58, 34, .10), transparent 28%),
            linear-gradient(180deg, #fbf3df 0%, var(--lfm-paper) 100%) !important;
    }

    .sheet-flow::before,
    .sheet.sheet-flow::before {
        content: '' !important;
        position: absolute !important;
        z-index: 1 !important;
        inset: 2.5mm !important;
        border: 1px solid rgba(75, 91, 53, .58) !important;
        pointer-events: none !important;
    }

    .sheet-flow .sheet-inner,
    .sheet-flow-inner {
        position: relative !important;
        z-index: 2 !important;
        width: 210mm !important;
        min-height: 297mm !important;
        height: auto !important;
        overflow: visible !important;
        padding: 7.9mm 6.35mm 11.1mm !important;
        box-sizing: border-box !important;
    }

    .sheet-flow .sheet-header,
    .sheet-flow .sheet-page-header {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: auto !important;
        z-index: 5 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    .sheet-flow .sheet-header h1 {
        font-size: 31pt !important;
        line-height: .92 !important;
        margin: 0 0 2.5mm !important;
    }

    .sheet-flow .sheet-banner-a4 {
        position: relative !important;
        width: 100% !important;
        aspect-ratio: 2048 / 124 !important;
        height: auto !important;
        margin: 0 auto 2.5mm !important;
    }

    .sheet-flow .sheet-points {
        margin: 0 0 2mm !important;
        font-size: 13pt !important;
    }

    .sheet-flow .sheet-war-period {
        margin: 0 auto 3mm !important;
        font-size: 10pt !important;
    }

    .sheet-flow-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 3mm !important;
        column-count: auto !important;
        column-gap: normal !important;
        padding-bottom: 6mm !important;
        margin: 0 !important;
    }

    .sheet-flow .sheet-battlefield-frame {
        height: 82mm !important;
        margin: 0 0 4mm !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .sheet-flow .sheet-flow-section,
    .sheet-flow .sheet-box,
    .sheet-flow .sheet-box-wide,
    .sheet-flow .sheet-victory-box,
    .sheet-flow .sheet-special-rules-box {
        position: relative !important;
        z-index: 5 !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        background: rgba(255, 248, 232, .48) !important;
    }

    .sheet-flow .sheet-box-wide {
        grid-column: 1 / -1 !important;
    }

    .sheet-flow .sheet-box-content,
    .sheet-flow .sheet-special-rules-content,
    .sheet-flow .sheet-victory-layout {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 10px 13px 9px !important;
    }

    .sheet-flow .sheet-footer-vignette,
    .sheet-flow-vignette {
        display: block !important;
        position: absolute !important;
        z-index: 1 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 4mm !important;
        width: 210mm !important;
        height: 28mm !important;
        pointer-events: none !important;
        overflow: hidden !important;
        background: none !important;
    }

    .sheet-flow .sheet-footer-vignette img.sheet-footer-vignette-img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center bottom !important;
        opacity: .55 !important;
        mix-blend-mode: multiply !important;
    }

    .sheet-flow .sheet-footer,
    .sheet-flow-footer {
        position: relative !important;
        z-index: 35 !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin-top: 5mm !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3.4mm !important;
        color: var(--sheet-title-color) !important;
        background: transparent !important;
    }

    .sheet-flow .sheet-footer-left,
    .sheet-flow .sheet-footer-right {
        font-size: 10pt !important;
    }

    .sheet-flow .sheet-footer-center {
        font-size: 13pt !important;
    }

    .sheet-flow .sheet-footer-center::before {
        content: none !important;
    }
}

@media (max-width: 900px) {
    .sheet-flow-grid {
        grid-template-columns: 1fr !important;
    }

    .scenario-contribution-form,
    .scenario-contribution-form-centered {
        width: min(100% - 20px, 1120px);
    }

    .scenario-submit-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ==========================================================
   EXPORT PDF TABLE : en-tête et pied répétés à chaque page
   - aperçu écran inchangé ;
   - export PDF avec titre, sous-titre, période, footer et bg sur chaque page.
   ========================================================== */

.sheet-print-export {
    display: none;
}

@media print {
    body * {
        visibility: hidden !important;
    }

    .sheet-flow,
    .sheet.sheet-flow {
        display: none !important;
        visibility: hidden !important;
    }

    .sheet-print-export,
    .sheet-print-export * {
        visibility: visible !important;
    }

    .sheet-print-export {
        display: table !important;
        width: 210mm !important;
        min-width: 210mm !important;
        max-width: 210mm !important;
        margin: 0 !important;
        padding: 0 !important;
        border-collapse: collapse !important;
        border-spacing: 0 !important;
        color: var(--lfm-ink) !important;
        background:
            radial-gradient(circle at 16% 5%, rgba(255, 255, 255, .42), transparent 25%),
            radial-gradient(circle at 85% 20%, rgba(74, 58, 34, .10), transparent 28%),
            linear-gradient(180deg, #fbf3df 0%, var(--lfm-paper) 100%) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .sheet-print-export thead {
        display: table-header-group !important;
    }

    .sheet-print-export tfoot {
        display: table-footer-group !important;
    }

    .sheet-print-export tbody {
        display: table-row-group !important;
    }

    .sheet-print-export tr,
    .sheet-print-export td {
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        vertical-align: top !important;
    }

    .sheet-print-header {
        padding: 7.9mm 6.35mm 3mm !important;
        box-sizing: border-box !important;
        background:
            radial-gradient(circle at 16% 5%, rgba(255, 255, 255, .42), transparent 25%),
            linear-gradient(180deg, #fbf3df 0%, rgba(243, 234, 213, .96) 100%) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .sheet-print-header h1 {
        margin: 0 0 2.5mm !important;
        color: var(--sheet-title-color) !important;
        text-align: center !important;
        font-family: var(--lfm-title-font) !important;
        font-size: 31pt !important;
        line-height: .92 !important;
        font-weight: 900 !important;
        letter-spacing: .035em !important;
        text-transform: uppercase !important;
    }

    .sheet-print-banner-a4 {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        aspect-ratio: 2048 / 124 !important;
        height: auto !important;
        margin: 0 auto 2.5mm !important;
        padding: 0 !important;
        overflow: hidden !important;
        line-height: 0 !important;
    }

    .sheet-print-banner-a4-img {
        display: block !important;
        width: 100% !important;
        height: auto !important;
    }

    .sheet-print-banner-a4-text {
        position: absolute !important;
        inset: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 18% !important;
        box-sizing: border-box !important;
        color: #fff7dc !important;
        font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Arial Narrow", sans-serif !important;
        font-size: 16pt !important;
        line-height: 1 !important;
        letter-spacing: .045em !important;
        text-align: center !important;
        text-transform: uppercase !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, .8) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .sheet-design-japanese-white .sheet-print-banner-a4-text {
        color: #5b201b !important;
        text-shadow: none !important;
    }

    .sheet-print-points {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        align-items: center !important;
        gap: 16px !important;
        margin: 0 0 2mm !important;
        color: var(--sheet-title-color) !important;
        font-family: var(--lfm-title-font) !important;
        font-size: 13pt !important;
        line-height: 1 !important;
        letter-spacing: .045em !important;
        text-align: center !important;
        text-transform: uppercase !important;
    }

    .sheet-print-points span {
        display: block !important;
        height: 2px !important;
        background: var(--sheet-accent) !important;
    }

    .sheet-print-points strong {
        color: var(--sheet-title-color) !important;
        font-weight: 900 !important;
        white-space: nowrap !important;
    }

    .sheet-print-war-period {
        margin: 0 auto !important;
        color: var(--sheet-title-color) !important;
        font-family: var(--lfm-title-font) !important;
        font-size: 10pt !important;
        font-weight: 800 !important;
        letter-spacing: .08em !important;
        text-align: center !important;
        text-transform: uppercase !important;
    }

    .sheet-print-war-period::before,
    .sheet-print-war-period::after {
        content: "★";
        display: inline-block;
        margin: 0 .55em;
    }

    .sheet-print-content {
        padding: 0 6.35mm 4mm !important;
        box-sizing: border-box !important;
        display: block !important;
        column-count: 2 !important;
        column-gap: 3mm !important;
        column-fill: auto !important;
    }

    .sheet-print-battlefield-frame {
        height: 82mm !important;
        margin: 0 0 4mm !important;
        column-span: all !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .sheet-print-box,
    .sheet-print-content .sheet-box {
        display: block !important;
        width: 100% !important;
        margin: 0 0 3mm !important;
        overflow: visible !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        background: rgba(255, 248, 232, .48) !important;
        border: 2px solid rgba(75, 91, 53, .75) !important;
        border-radius: 7px !important;
        box-sizing: border-box !important;
    }

    .sheet-print-box-wide {
        column-span: all !important;
    }

    .sheet-print-box h2 {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 31px !important;
        margin: 0 !important;
        padding: 0 9px !important;
        color: #fff7dc !important;
        background: linear-gradient(180deg, var(--sheet-accent-mid), var(--sheet-accent-dark)) !important;
        font-family: var(--lfm-title-font) !important;
        font-size: 21px !important;
        line-height: 1 !important;
        font-weight: 900 !important;
        letter-spacing: .052em !important;
        text-align: center !important;
        text-transform: uppercase !important;
        break-after: avoid !important;
        page-break-after: avoid !important;
    }

    .sheet-print-box h2 * {
        color: #fff7dc !important;
    }

    .sheet-print-content .sheet-box-content,
    .sheet-print-content .sheet-special-rules-content,
    .sheet-print-content .sheet-victory-layout {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 10px 13px 9px !important;
        box-sizing: border-box !important;
    }

    .sheet-print-content p,
    .sheet-print-content .sheet-paragraph,
    .sheet-print-content .sheet-bullet-line,
    .sheet-print-content .sheet-numbered-line,
    .sheet-print-content .sheet-special-rule-body,
    .sheet-print-content .sheet-special-rule-body p {
        color: #111 !important;
        font-family: var(--lfm-body-font) !important;
        font-size: 13.2px !important;
        line-height: 1.16 !important;
        overflow-wrap: anywhere !important;
    }

    .sheet-print-content .sheet-victory-layout {
        grid-template-columns: none !important;
    }

    .sheet-print-content .sheet-reminder {
        margin-top: 3mm !important;
        background: rgba(255, 248, 232, .62) !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    .sheet-print-content .sheet-special-rules-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        column-gap: 8mm !important;
    }

    .sheet-print-footer-area {
        position: relative !important;
        height: 31mm !important;
        padding: 0 6.35mm 2.8mm !important;
        box-sizing: border-box !important;
        background:
            linear-gradient(180deg, rgba(243, 234, 213, 0) 0%, rgba(243, 234, 213, .96) 100%) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .sheet-print-footer-vignette {
        position: absolute !important;
        z-index: 1 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 4mm !important;
        width: 210mm !important;
        height: 28mm !important;
        pointer-events: none !important;
        overflow: hidden !important;
    }

    .sheet-print-footer-vignette img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center bottom !important;
        opacity: .55 !important;
        mix-blend-mode: multiply !important;
    }

    .sheet-print-footer {
        position: absolute !important;
        z-index: 35 !important;
        left: 6.35mm !important;
        right: 6.35mm !important;
        bottom: 2.8mm !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3.4mm !important;
        color: var(--sheet-title-color) !important;
        font-family: var(--lfm-title-font) !important;
        line-height: 1 !important;
        text-shadow: 0 1px 0 rgba(255, 248, 232, .75) !important;
    }

    .sheet-print-footer-left,
    .sheet-print-footer-right {
        flex: 0 0 auto !important;
        color: var(--sheet-title-color) !important;
        font-size: 10pt !important;
        font-weight: 800 !important;
        letter-spacing: .08em !important;
        text-align: center !important;
        text-transform: uppercase !important;
        white-space: nowrap !important;
    }

    .sheet-print-footer-center {
        flex: 0 0 auto !important;
        min-width: 88px !important;
        padding: 6px 15px 5px !important;
        border: 2px solid rgba(75, 91, 53, .7) !important;
        border-radius: 999px !important;
        background: rgba(255, 248, 232, .92) !important;
        color: var(--sheet-title-color) !important;
        text-align: center !important;
        font-family: var(--lfm-title-font) !important;
        font-size: 13pt !important;
        letter-spacing: .08em !important;
        text-transform: uppercase !important;
        box-shadow: 0 0 0 2px rgba(255, 248, 232, .45) !important;
    }

    .sheet-print-page-number::before {
        content: counter(page);
    }

    .site-header,
    .site-footer,
    .scenario-view-header,
    .no-print,
    .topbar,
    .admin-header,
    .admin-sidebar,
    .sidebar,
    nav,
    header:not(.sheet-header),
    footer:not(.sheet-footer):not(.sheet-print-footer) {
        display: none !important;
    }
}

/* ==========================================================
   CORRECTIF EXPORT PDF V2
   - ordre visuel identique à l'écran : 1 gauche, 2 droite, 3 gauche, 4 droite ;
   - puces / pastilles en blanc ;
   - pied de page et filigrane mieux calés en bas.
   ========================================================== */

@media print {
    /*
       On remplace les colonnes CSS par une vraie grille.
       Les colonnes CSS remplissaient verticalement, ce qui mélangeait l'ordre :
       1 gauche, 3 droite, 2 dessous...
       La grille conserve l'ordre attendu : 1 gauche, 2 droite, 3 gauche, 4 droite.
    */
    .sheet-print-content {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-auto-flow: row !important;
        grid-auto-rows: auto !important;
        align-content: start !important;
        gap: 3mm !important;
        column-count: initial !important;
        column-gap: initial !important;
        column-fill: initial !important;
        padding: 0 6.35mm 4mm !important;
        box-sizing: border-box !important;
    }

    .sheet-print-battlefield-frame,
    .sheet-print-box-wide,
    .sheet-print-content .sheet-box-wide,
    .sheet-print-content .sheet-victory-box,
    .sheet-print-content .sheet-special-rules-box {
        grid-column: 1 / -1 !important;
        column-span: none !important;
    }

    .sheet-print-box,
    .sheet-print-content .sheet-box {
        width: 100% !important;
        margin: 0 !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    /*
       Les petites pastilles / numéros / puces doivent rester blanches.
       Certaines règles globales remettaient ces éléments dans la couleur du design.
    */
    .sheet-print-content .sheet-number-badge,
    .sheet-print-content .sheet-list-number,
    .sheet-print-content .sheet-special-number,
    .sheet-print-content .sheet-special-rule-number,
    .sheet-print-content .sheet-box-icon {
        color: #fff7dc !important;
        background: var(--sheet-accent) !important;
        border-color: var(--sheet-accent-dark) !important;
    }

    .sheet-print-content .sheet-bullet-line > :first-child,
    .sheet-print-content .sheet-numbered-line > :first-child {
        color: #fff7dc !important;
        font-weight: 900 !important;
    }

    .sheet-print-content .sheet-special-rule-title .sheet-special-rule-number,
    .sheet-print-content .sheet-special-rule-title .sheet-number-badge,
    .sheet-print-content .sheet-special-rule-title .sheet-list-number {
        color: #fff7dc !important;
    }

    /*
       Force le footer de table à prendre une vraie zone basse.
       Cela aide le navigateur à replacer le BG et le pied de page en bas,
       y compris sur la dernière page.
    */
    .sheet-print-export {
        table-layout: fixed !important;
        min-height: 297mm !important;
    }

    .sheet-print-export tfoot,
    .sheet-print-export tfoot tr,
    .sheet-print-export tfoot td {
        height: 31mm !important;
        min-height: 31mm !important;
        vertical-align: bottom !important;
    }

    .sheet-print-footer-area {
        height: 31mm !important;
        min-height: 31mm !important;
        padding: 0 6.35mm 2.8mm !important;
        box-sizing: border-box !important;
    }

    .sheet-print-footer-vignette {
        bottom: 4mm !important;
        height: 28mm !important;
    }

    .sheet-print-footer {
        bottom: 2.8mm !important;
    }

    /*
       Sécurité : les numéros dans les règles spéciales et les titres de blocs
       restent toujours lisibles en blanc.
    */
    .sheet-print-box h2,
    .sheet-print-box h2 *,
    .sheet-print-content .sheet-box h2,
    .sheet-print-content .sheet-box h2 * {
        color: #fff7dc !important;
    }
}

/* ==========================================================
   CORRECTIF PRIORITAIRE : bulles blanches + rappel export
   ========================================================== */

/*
   1) Aperçu + export :
   Les chiffres / lettres dans les bulles, pastilles et petits badges
   restent blancs, sans modifier la forme ni la couleur de fond.
*/
body .sheet .sheet-number-badge,
body .sheet .sheet-list-number,
body .sheet .sheet-special-number,
body .sheet .sheet-special-rule-number,
body .sheet .sheet-box-icon,
body .sheet .sheet-numbered-line > :first-child,
body .sheet .sheet-bullet-line > :first-child,
body .sheet .sheet-special-rule-title > :first-child {
    color: #fff7dc !important;
    -webkit-text-fill-color: #fff7dc !important;
    text-shadow: none !important;
}

body .sheet .sheet-number-badge *,
body .sheet .sheet-list-number *,
body .sheet .sheet-special-number *,
body .sheet .sheet-special-rule-number *,
body .sheet .sheet-box-icon *,
body .sheet .sheet-numbered-line > :first-child *,
body .sheet .sheet-bullet-line > :first-child *,
body .sheet .sheet-special-rule-title > :first-child * {
    color: #fff7dc !important;
    -webkit-text-fill-color: #fff7dc !important;
    text-shadow: none !important;
}

/*
   2) Les bulles trop longues prennent moins de place.
   On ne change pas l'identité visuelle, seulement l'encombrement.
*/
body .sheet .sheet-number-badge,
body .sheet .sheet-list-number,
body .sheet .sheet-special-number,
body .sheet .sheet-special-rule-number {
    width: 21px !important;
    height: 21px !important;
    min-width: 21px !important;
    padding: 0 !important;
    font-size: 12px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

body .sheet .sheet-numbered-line {
    grid-template-columns: 23px 1fr !important;
    gap: 6px !important;
    margin-bottom: 4px !important;
}

body .sheet .sheet-bullet-line {
    margin-bottom: 4px !important;
}

/*
   3) Export :
   Le rappel reprend sa mise en bulle latérale comme dans l'aperçu.
*/
@media print {
    body.export-pdf-page .sheet-victory-layout,
    .export-pdf-page .sheet-victory-layout {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 250px !important;
        align-items: center !important;
        gap: 12px !important;
    }

    body.export-pdf-page .sheet-victory-layout.sheet-no-reminder,
    .export-pdf-page .sheet-victory-layout.sheet-no-reminder {
        grid-template-columns: 1fr !important;
    }

    body.export-pdf-page .sheet-victory-layout .sheet-box-content,
    .export-pdf-page .sheet-victory-layout .sheet-box-content {
        padding: 0 !important;
    }

    body.export-pdf-page .sheet-reminder,
    .export-pdf-page .sheet-reminder {
        align-self: center !important;
        margin: 0 !important;
        padding: 12px 14px !important;
        border: 2px solid rgba(75, 91, 53, .7) !important;
        border-radius: 6px !important;
        background: rgba(255, 248, 232, .58) !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

    body.export-pdf-page .sheet-reminder strong,
    .export-pdf-page .sheet-reminder strong {
        display: block !important;
        margin: 0 0 8px !important;
        color: var(--sheet-accent-dark) !important;
        text-align: center !important;
        font-family: var(--lfm-title-font) !important;
        font-size: 18px !important;
        letter-spacing: .05em !important;
    }

    /*
       Même règle de bulles blanches en impression, répétée dans @media print
       pour passer au-dessus des règles d'export.
    */
    body.export-pdf-page .sheet .sheet-number-badge,
    body.export-pdf-page .sheet .sheet-list-number,
    body.export-pdf-page .sheet .sheet-special-number,
    body.export-pdf-page .sheet .sheet-special-rule-number,
    body.export-pdf-page .sheet .sheet-box-icon,
    body.export-pdf-page .sheet .sheet-numbered-line > :first-child,
    body.export-pdf-page .sheet .sheet-bullet-line > :first-child,
    body.export-pdf-page .sheet .sheet-special-rule-title > :first-child,
    .export-pdf-page .sheet-number-badge,
    .export-pdf-page .sheet-list-number,
    .export-pdf-page .sheet-special-number,
    .export-pdf-page .sheet-special-rule-number,
    .export-pdf-page .sheet-box-icon,
    .export-pdf-page .sheet-numbered-line > :first-child,
    .export-pdf-page .sheet-bullet-line > :first-child,
    .export-pdf-page .sheet-special-rule-title > :first-child {
        color: #fff7dc !important;
        -webkit-text-fill-color: #fff7dc !important;
        text-shadow: none !important;
    }

    body.export-pdf-page .sheet .sheet-number-badge *,
    body.export-pdf-page .sheet .sheet-list-number *,
    body.export-pdf-page .sheet .sheet-special-number *,
    body.export-pdf-page .sheet .sheet-special-rule-number *,
    body.export-pdf-page .sheet .sheet-box-icon *,
    body.export-pdf-page .sheet .sheet-numbered-line > :first-child *,
    body.export-pdf-page .sheet .sheet-bullet-line > :first-child *,
    body.export-pdf-page .sheet .sheet-special-rule-title > :first-child *,
    .export-pdf-page .sheet-number-badge *,
    .export-pdf-page .sheet-list-number *,
    .export-pdf-page .sheet-special-number *,
    .export-pdf-page .sheet-special-rule-number *,
    .export-pdf-page .sheet-box-icon *,
    .export-pdf-page .sheet-numbered-line > :first-child *,
    .export-pdf-page .sheet-bullet-line > :first-child *,
    .export-pdf-page .sheet-special-rule-title > :first-child * {
        color: #fff7dc !important;
        -webkit-text-fill-color: #fff7dc !important;
        text-shadow: none !important;
    }
}


/* ==========================================================
   PATCH FOOTER NATIF EXPORT
   - garde le BG natif actuel ;
   - affiche dessus :
     gauche = www.lafabriqueminature.fr
     centre = pagination
     droite = auteur
   - sans réintroduire une surcouche en div.
   ========================================================== */

@media print {
    /* Le footer natif doit rester pleinement visible. */
    body.export-pdf-page .sheet-print-footer-area,
    body.export-pdf-page .sheet-print-footer-area *,
    body.export-pdf-page .sheet-print-footer-vignette,
    body.export-pdf-page .sheet-print-footer-vignette *,
    body.export-pdf-page .sheet-print-footer,
    body.export-pdf-page .sheet-print-footer * {
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Le BG natif reste le seul BG. */
    body.export-pdf-page .sheet-print-footer-area {
        position: relative !important;
        height: 31mm !important;
        min-height: 31mm !important;
        padding: 0 6.35mm 2.8mm !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        background: linear-gradient(
            180deg,
            rgba(243, 234, 213, 0) 0%,
            rgba(243, 234, 213, .78) 58%,
            rgba(243, 234, 213, .94) 100%
        ) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.export-pdf-page .sheet-print-footer-vignette {
        position: absolute !important;
        z-index: 1 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 3.2mm !important;
        width: 210mm !important;
        height: 28mm !important;
        overflow: hidden !important;
        pointer-events: none !important;
        display: block !important;
    }

    body.export-pdf-page .sheet-print-footer-vignette img,
    body.export-pdf-page .sheet-print-footer-vignette-img {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: fill !important;
        object-position: center bottom !important;
        opacity: .42 !important;
        mix-blend-mode: multiply !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Texte sur le BG natif : bien horizontal, lisible, et centré proprement. */
    body.export-pdf-page .sheet-print-footer {
        position: absolute !important;
        z-index: 35 !important;
        left: 6.35mm !important;
        right: 6.35mm !important;
        bottom: 2.8mm !important;
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        align-items: center !important;
        column-gap: 3.4mm !important;
        width: auto !important;
        color: var(--sheet-title-color) !important;
        font-family: var(--lfm-title-font) !important;
        line-height: 1 !important;
        background: transparent !important;
        text-shadow:
            0 1px 0 rgba(255, 248, 232, 1),
            0 0 6px rgba(255, 248, 232, .95) !important;
    }

    body.export-pdf-page .sheet-print-footer-left,
    body.export-pdf-page .sheet-print-footer-right {
        display: inline-flex !important;
        align-items: center !important;
        white-space: nowrap !important;
        color: var(--sheet-title-color) !important;
        font-size: 10pt !important;
        font-weight: 800 !important;
        letter-spacing: .08em !important;
        text-transform: uppercase !important;
    }

    body.export-pdf-page .sheet-print-footer-left {
        justify-self: start !important;
        text-align: left !important;
    }

    body.export-pdf-page .sheet-print-footer-right {
        justify-self: end !important;
        text-align: right !important;
    }

    body.export-pdf-page .sheet-print-footer-center {
        display: inline-flex !important;
        justify-self: center !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 88px !important;
        padding: 6px 15px 5px !important;
        border: 2px solid rgba(75, 91, 53, .7) !important;
        border-radius: 999px !important;
        background: rgba(255, 248, 232, .92) !important;
        color: var(--sheet-title-color) !important;
        font-family: var(--lfm-title-font) !important;
        font-size: 13pt !important;
        letter-spacing: .08em !important;
        text-align: center !important;
        text-transform: uppercase !important;
        box-shadow: 0 0 0 2px rgba(255, 248, 232, .45) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Pagination native imprimée au centre. */
    body.export-pdf-page .sheet-print-page-number::before {
        content: counter(page) !important;
    }
}

/* ==========================================================
   PATCH FOOTER NATIF V2
   - empêche PAGE 0 ;
   - rapproche www / pagination / auteur ;
   - ne touche pas au BG validé.
   ========================================================== */

@media print {
    /*
       Le counter(page) affiche 0 dans ce contexte navigateur.
       On le désactive pour garder la valeur PHP "1".
    */
    body.export-pdf-page .sheet-print-page-number::before {
        content: none !important;
    }

    /*
       Rapproche les trois éléments du pied de page.
    */
    body.export-pdf-page .sheet-print-footer {
        column-gap: 1.8mm !important;
        gap: 1.8mm !important;
        grid-template-columns: auto auto auto !important;
        justify-content: center !important;
    }

    body.export-pdf-page .sheet-print-footer-left {
        justify-self: end !important;
        margin-right: 0 !important;
    }

    body.export-pdf-page .sheet-print-footer-center {
        justify-self: center !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.export-pdf-page .sheet-print-footer-right {
        justify-self: start !important;
        margin-left: 0 !important;
    }
}

/* ==========================================================
   PATCH FOOTER NATIF V3
   - BG non déformé ;
   - compteur réactivé ;
   - footer rapproché conservé.
   ========================================================== */

@page {
    counter-increment: page;
}

@media print {
    /*
       Le BG ne doit plus être aplati/déformé.
       cover conserve les proportions, contrairement à fill.
    */
    body.export-pdf-page .sheet-print-footer-vignette img,
    body.export-pdf-page .sheet-print-footer-vignette-img {
        object-fit: cover !important;
        object-position: center bottom !important;
    }

    /*
       Réactive le compteur au lieu du PAGE 1 figé.
       Si le navigateur continue à renvoyer 0, c'est une limite du compteur CSS
       dans ce rendu d'impression, mais au moins le fichier n'est plus figé.
    */
    body.export-pdf-page .sheet-print-page-number::before {
        content: counter(page) !important;
    }

    /*
       On conserve le rapprochement demandé.
    */
    body.export-pdf-page .sheet-print-footer {
        column-gap: 1.8mm !important;
        gap: 1.8mm !important;
        grid-template-columns: auto auto auto !important;
        justify-content: center !important;
    }

    body.export-pdf-page .sheet-print-footer-left {
        justify-self: end !important;
        margin-right: 0 !important;
    }

    body.export-pdf-page .sheet-print-footer-center {
        justify-self: center !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.export-pdf-page .sheet-print-footer-right {
        justify-self: start !important;
        margin-left: 0 !important;
    }
}

/* ==========================================================
   CORRECTION DEFINITIVE PUCES / PASTILLES
   - 1*, 2*, 3* : rond vert avec écriture blanche ;
   - lignes avec point/tiret : petite puce verte simple ;
   - aucune pastille carrée.
   ========================================================== */

/* Les lignes numérotées type 1*, 2*, 3* gardent une vraie pastille ronde. */
.sheet-numbered-line {
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: start !important;
    margin: 0 0 8px !important;
}

/* Les règles spéciales numérotées gardent aussi une pastille ronde. */
.sheet-special-rule-title {
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: start !important;
}

/* Pastilles rondes uniquement pour les vrais numéros / astérisques. */
.sheet-number-badge,
.sheet-list-number,
.sheet-special-number,
.sheet-special-rule-number,
.sheet-numbered-line > :first-child,
.sheet-special-rule-title > :first-child {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid var(--sheet-accent-dark, #25351b) !important;
    border-radius: 50% !important;
    background: var(--sheet-accent, #31451f) !important;
    color: #fff7dc !important;
    -webkit-text-fill-color: #fff7dc !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 15px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    text-align: center !important;
    text-shadow: none !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

/* Tout ce qui est dans une pastille reste blanc. */
.sheet-number-badge *,
.sheet-list-number *,
.sheet-special-number *,
.sheet-special-rule-number *,
.sheet-numbered-line > :first-child *,
.sheet-special-rule-title > :first-child * {
    color: #fff7dc !important;
    -webkit-text-fill-color: #fff7dc !important;
    text-shadow: none !important;
}

/* Les lignes à puce simple ne doivent PAS avoir de grosse pastille autour. */
.sheet-bullet-line {
    display: grid !important;
    grid-template-columns: 13px minmax(0, 1fr) !important;
    gap: 5px !important;
    align-items: start !important;
    margin: 0 0 5px !important;
}

/* Point ou tiret = petite puce verte simple. */
.sheet-bullet-line > :first-child {
    display: inline-block !important;
    width: 6px !important;
    height: 6px !important;
    min-width: 6px !important;
    max-width: 6px !important;
    margin-top: .48em !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: var(--sheet-accent, #31451f) !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

/* Listes HTML classiques : petite puce verte, pas de carré, pas de gros rond. */
.export-box ul,
.sheet ul,
.export-box ol,
.sheet ol {
    margin: 0 0 7px 0 !important;
    padding-left: 0 !important;
    list-style: none !important;
}

.export-box li,
.sheet li {
    position: relative !important;
    margin: 0 0 5px !important;
    padding-left: 18px !important;
    min-height: 0 !important;
}

.export-box li::before,
.sheet li::before {
    content: "" !important;
    position: absolute !important;
    left: 2px !important;
    top: .55em !important;
    width: 6px !important;
    height: 6px !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: var(--sheet-accent, #31451f) !important;
}

/* Sécurité : aucune pastille carrée ne doit revenir. */
.sheet-number-badge,
.sheet-list-number,
.sheet-special-number,
.sheet-special-rule-number,
.sheet-numbered-line > :first-child,
.sheet-special-rule-title > :first-child {
    border-radius: 50% !important;
}


/* Aperçu classique : couleurs liées au design choisi. */
body .sheet .sheet-number-badge,
body .sheet .sheet-list-number,
body .sheet .sheet-special-number,
body .sheet .sheet-special-rule-number,
body .sheet .sheet-numbered-line > :first-child,
body .sheet .sheet-special-rule-title > :first-child {
    background: var(--sheet-accent, #31451f) !important;
    border-color: var(--sheet-accent-dark, #25351b) !important;
}

/* ==========================================================
   PATCH FINAL PUCES APERCU
   - 1*, 2*, 3* : rond vert, texte blanc ;
   - point / tiret : petite puce verte simple ;
   - aucun carré.
   ========================================================== */

/* RONDS VERTS : uniquement les vrais numéros/pastilles */
body .sheet .sheet-number-badge,
body .sheet .sheet-list-number,
body .sheet .sheet-special-number,
body .sheet .sheet-special-rule-number,
body .sheet .sheet-numbered-line > :first-child,
body .sheet .sheet-special-rule-title > :first-child {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid var(--sheet-accent-dark, #25351b) !important;
    border-radius: 9999px !important;
    background: var(--sheet-accent, #31451f) !important;
    color: #fff7dc !important;
    -webkit-text-fill-color: #fff7dc !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-shadow: none !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}

body .sheet .sheet-number-badge *,
body .sheet .sheet-list-number *,
body .sheet .sheet-special-number *,
body .sheet .sheet-special-rule-number *,
body .sheet .sheet-numbered-line > :first-child *,
body .sheet .sheet-special-rule-title > :first-child * {
    color: #fff7dc !important;
    -webkit-text-fill-color: #fff7dc !important;
    text-shadow: none !important;
}

/* Mise en ligne des numéros */
body .sheet .sheet-numbered-line,
body .sheet .sheet-special-rule-title {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: start !important;
    margin: 0 0 7px !important;
}

/* PETITES PUCES : point / tiret, sans rond autour */
body .sheet .sheet-bullet-line {
    display: grid !important;
    grid-template-columns: 12px minmax(0, 1fr) !important;
    gap: 6px !important;
    align-items: center !important;
    margin: 0 0 5px !important;
}

body .sheet .sheet-bullet-line > :first-child {
    display: block !important;
    align-self: center !important;
    justify-self: center !important;
    width: 6px !important;
    height: 6px !important;
    min-width: 6px !important;
    max-width: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 9999px !important;
    background: var(--sheet-accent, #31451f) !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

body .sheet .sheet-bullet-line > :nth-child(2) {
    align-self: center !important;
}

/* Listes HTML classiques */
body .sheet ul,
body .sheet ol {
    margin: 0 0 7px 0 !important;
    padding-left: 0 !important;
    list-style: none !important;
}

body .sheet li {
    position: relative !important;
    margin: 0 0 5px !important;
    padding-left: 18px !important;
    min-height: 1.16em !important;
}

body .sheet li::before {
    content: "" !important;
    position: absolute !important;
    left: 3px !important;
    top: .58em !important;
    transform: translateY(-50%) !important;
    display: block !important;
    width: 6px !important;
    height: 6px !important;
    border: 0 !important;
    border-radius: 9999px !important;
    background: var(--sheet-accent, #31451f) !important;
}

/* ==========================================================
   PATCH FINAL CARTES SCENARIO - DESCRIPTION CALEE
   ----------------------------------------------------------
   Objectif :
   - garder l'apparence actuelle des cartes scénario ;
   - afficher entièrement la description de référence
     "La ferme de la crête verrière" ;
   - utiliser cette hauteur comme limite pour les autres descriptions ;
   - couper les descriptions plus longues sans pousser le bas de carte ;
   - aligner "proposé par", les pointillés et les boutons.
   ========================================================== */

:root {
    /*
       Hauteur de référence de la description courte.
       C'est cette zone qui sert de gabarit commun aux cartes.
    */
    --scenario-card-description-height: 8.4em;
}

/* Carte en colonne, sans modifier son apparence visuelle. */
.scenario-card {
    display: flex !important;
    flex-direction: column !important;
}

/* Le corps devient une colonne contrôlée. */
.scenario-card .body {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-height: 0 !important;
}

/* Titre et tags gardent leur hauteur naturelle. */
.scenario-card .body > h2,
.scenario-card .body > h3,
.scenario-card .body > .tags {
    flex: 0 0 auto !important;
}

/*
   Description courte :
   - hauteur calée sur la description de référence ;
   - si le texte est plus court, il n'est pas étiré ;
   - si le texte est plus long, il est coupé visuellement ;
   - il ne pousse jamais "proposé par" ni les boutons.
*/
.scenario-card .body > p:not(.contributor-line),
.scenario-card .body > .summary,
.scenario-card .body > .scenario-summary,
.scenario-card .body > .description,
.scenario-card .body > .excerpt {
    flex: 0 0 var(--scenario-card-description-height) !important;
    height: var(--scenario-card-description-height) !important;
    max-height: var(--scenario-card-description-height) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: block !important;
    margin-bottom: 0 !important;
}

/*
   Zone basse :
   elle est alignée entre les cartes et ne remonte pas au gré
   de la longueur de description.
*/
.scenario-card .body > .contributor-line {
    flex: 0 0 auto !important;
    margin-top: 8px !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
}

/* Boutons toujours visibles et alignés sous le pointillé. */
.scenario-card .body > .card-actions,
.scenario-card .body > .scenario-actions,
.scenario-card .body > .actions {
    flex: 0 0 auto !important;
    margin-top: 6px !important;
    overflow: visible !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.scenario-card .body > .card-actions .btn,
.scenario-card .body > .scenario-actions .btn,
.scenario-card .body > .actions .btn {
    flex: 0 0 auto !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

/* ==========================================================
   PATCH FINAL ALIGNEMENT BAS CARTES SCENARIO
   ----------------------------------------------------------
   Base conservée :
   - description calée sur la référence ;
   - texte trop long coupé dans cette zone ;
   - apparence actuelle des cartes conservée.

   Objectif :
   - aligner la zone pointillée "proposé par" ;
   - aligner les boutons Voir / Télécharger ;
   - uniformiser la hauteur utile des cartes sans toucher aux images.
   ========================================================== */

/*
   La grille étire les cartes d'une même ligne à la même hauteur.
*/
.scenario-list {
    align-items: stretch !important;
}

/*
   La carte occupe toute la hauteur disponible dans sa cellule.
*/
.scenario-card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

/*
   Le corps de carte devient la zone verticale pilotée.
*/
.scenario-card .body {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-height: 0 !important;
}

/*
   Image, titre et tags gardent leur comportement naturel.
*/
.scenario-card > img,
.scenario-card .body > h2,
.scenario-card .body > h3,
.scenario-card .body > .tags {
    flex: 0 0 auto !important;
}

/*
   Description :
   elle garde la hauteur de référence définie précédemment.
   Elle ne pousse jamais le bas de carte.
*/
.scenario-card .body > p:not(.contributor-line),
.scenario-card .body > .summary,
.scenario-card .body > .scenario-summary,
.scenario-card .body > .description,
.scenario-card .body > .excerpt {
    flex: 0 0 var(--scenario-card-description-height, 8.4em) !important;
    height: var(--scenario-card-description-height, 8.4em) !important;
    max-height: var(--scenario-card-description-height, 8.4em) !important;
    overflow: hidden !important;
}

/*
   Pointillés / proposé par :
   poussés en bas de la carte, donc alignés entre scénarios.
*/
.scenario-card .body > .contributor-line {
    margin-top: auto !important;
    flex: 0 0 auto !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
}

/*
   Boutons :
   toujours sous les pointillés, alignés en bas, jamais coupés.
*/
.scenario-card .body > .card-actions,
.scenario-card .body > .scenario-actions,
.scenario-card .body > .actions {
    flex: 0 0 auto !important;
    margin-top: 6px !important;
    overflow: visible !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.scenario-card .body > .card-actions .btn,
.scenario-card .body > .scenario-actions .btn,
.scenario-card .body > .actions .btn {
    flex: 0 0 auto !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

/* ==========================================================
   PATCH ESPACEMENT DESCRIPTION CARTES SCENARIO
   ----------------------------------------------------------
   Base conservée :
   - description calée sur la référence ;
   - pointillés / proposé par alignés ;
   - boutons alignés en bas.

   Objectif :
   - ajouter un peu d'espace entre les mots-clés et le texte ;
   - ajouter un peu d'espace entre le texte et le trait pointillé ;
   - ne pas modifier le reste de la carte.
   ========================================================== */

/* Un peu d'air après les mots-clés avant la description. */
.scenario-card .body > .tags {
    margin-bottom: 10px !important;
}

/* Description : léger espace bas avant "proposé par". */
.scenario-card .body > p:not(.contributor-line),
.scenario-card .body > .summary,
.scenario-card .body > .scenario-summary,
.scenario-card .body > .description,
.scenario-card .body > .excerpt {
    margin-bottom: 10px !important;
}

/* Le trait pointillé / proposé par garde son alignement bas, avec un peu d'air. */
.scenario-card .body > .contributor-line {
    margin-top: auto !important;
    padding-top: 10px !important;
}

/* ==========================================================
   PATCH ESPACEMENT DESCRIPTION CARTES SCENARIO V3
   ----------------------------------------------------------
   Base conservée :
   - description calée sur la référence ;
   - pointillés / proposé par alignés ;
   - boutons alignés en bas.

   Objectif :
   - réduire l'espace entre les mots-clés et la description ;
   - réduire l'espace entre la description et le trait pointillé ;
   - regagner un peu de hauteur utile pour le texte.
   ========================================================== */

/* Moins d'espace après les mots-clés. */
.scenario-card .body > .tags {
    margin-bottom: 4px !important;
}

/* Moins d'espace après la description. */
.scenario-card .body > p:not(.contributor-line),
.scenario-card .body > .summary,
.scenario-card .body > .scenario-summary,
.scenario-card .body > .description,
.scenario-card .body > .excerpt {
    margin-bottom: 4px !important;
}

/* Le trait pointillé / proposé par garde son alignement, avec moins d'espace au-dessus. */
.scenario-card .body > .contributor-line {
    margin-top: auto !important;
    padding-top: 6px !important;
}

/* ==========================================================
   PATCH POINTILLES PLUS PROCHES DU TEXTE
   ----------------------------------------------------------
   Base conservée :
   - description calée sur la référence ;
   - texte trop long coupé ;
   - boutons alignés en bas.

   Objectif :
   - rapprocher le trait pointillé / proposé par du texte ;
   - conserver l'alignement bas ;
   - ne rien modifier d'autre.
   ========================================================== */

/* Moins d'air après la description. */
.scenario-card .body > p:not(.contributor-line),
.scenario-card .body > .summary,
.scenario-card .body > .scenario-summary,
.scenario-card .body > .description,
.scenario-card .body > .excerpt {
    margin-bottom: 2px !important;
}

/* Pointillés encore plus proches du texte. */
.scenario-card .body > .contributor-line {
    margin-top: auto !important;
    padding-top: 3px !important;
}

/* Les boutons restent alignés sous les pointillés. */
.scenario-card .body > .card-actions,
.scenario-card .body > .scenario-actions,
.scenario-card .body > .actions {
    margin-top: 5px !important;
}

/* ==========================================================
   PATCH OBJECTIFS CACHES CARTES + POPUP
   Page concernée : objectifs.php
   ========================================================== */

:root {
    --objective-card-text-height: 10.2em;
}

.objectives-list {
    align-items: stretch !important;
}

.objective-card {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    cursor: pointer;
}

.objective-card-header {
    flex: 0 0 auto !important;
}

.objective-card-header h2 {
    max-height: 2.4em !important;
    overflow: hidden !important;
    line-height: 1.18 !important;
}

.objective-card-body {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-height: 0 !important;
}

.objective-card-body > p,
.objective-card-body > .summary,
.objective-card-body > .description,
.objective-card-body > .objective-summary,
.objective-card-body > .objective-description,
.objective-card-body > .objective-text,
.objective-card-body > .objective-content {
    flex: 0 0 var(--objective-card-text-height) !important;
    height: var(--objective-card-text-height) !important;
    max-height: var(--objective-card-text-height) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: block !important;
}

.objective-card-body > .tags,
.objective-card-body > .objective-tags {
    flex: 0 0 auto !important;
}

.objective-card-footer {
    margin-top: auto !important;
    flex: 0 0 auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.objective-card-body > .card-actions,
.objective-card-body > .objective-actions,
.objective-card-body > .actions,
.objective-card-footer .card-actions,
.objective-card-footer .objective-actions,
.objective-card-footer .actions {
    flex: 0 0 auto !important;
    overflow: visible !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.objective-card .btn,
.objective-card-footer .btn,
.objective-card-body .btn {
    flex: 0 0 auto !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

.objective-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .10);
}

/* Popup objectif caché */

.objective-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(16, 20, 10, .68);
}

.objective-modal-backdrop.is-visible {
    display: flex;
}

.objective-modal {
    position: relative;
    width: min(760px, calc(100vw - 36px));
    max-height: min(82vh, 820px);
    overflow: auto;
    padding: 22px 24px 24px;
    border: 1px solid rgba(77, 93, 54, .42);
    border-radius: 16px;
    background: #fffaf0;
    color: var(--ink);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .42);
}

.objective-modal-close {
    position: sticky;
    top: 0;
    float: right;
    z-index: 2;
    width: 34px;
    height: 34px;
    margin: -10px -12px 10px 12px;
    border: 1px solid rgba(38, 51, 22, .25);
    border-radius: 999px;
    background: var(--olive2);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
}

.objective-modal-content {
    clear: both;
}

.objective-modal-content .objective-card {
    height: auto !important;
    cursor: default !important;
    transform: none !important;
    box-shadow: none !important;
}

.objective-modal-content .objective-card-body,
.objective-modal-content .objective-card-body > p,
.objective-modal-content .objective-card-body > .summary,
.objective-modal-content .objective-card-body > .description,
.objective-modal-content .objective-card-body > .objective-summary,
.objective-modal-content .objective-card-body > .objective-description,
.objective-modal-content .objective-card-body > .objective-text,
.objective-modal-content .objective-card-body > .objective-content {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

body.objective-modal-open {
    overflow: hidden;
}

/* ==========================================================
   PATCH OBJECTIFS CACHES V2 - HAUTEUR FIGEE
   ----------------------------------------------------------
   Page concernée : objectifs.php

   Objectif :
   - se caler sur le gabarit de "Couper les communications" ;
   - titre bloqué en haut, possible sur 2 lignes ;
   - zone centrale figée ;
   - texte trop long masqué ;
   - pointillés / proposé par toujours en bas ;
   - popup conserve le texte complet.
   ========================================================== */

:root {
    /*
       Hauteur totale de référence d'une carte objectif.
       Ajustable si besoin, mais toutes les cartes utilisent ce même gabarit.
    */
    --objective-card-fixed-height: 330px;

    /*
       Hauteur maximum du titre : environ 2 lignes.
    */
    --objective-card-title-height: 2.45em;
}

/* La grille garde des cartes de même hauteur. */
.objectives-list {
    align-items: stretch !important;
}

/* Carte objectif : hauteur totalement figée. */
.objective-card {
    height: var(--objective-card-fixed-height) !important;
    min-height: var(--objective-card-fixed-height) !important;
    max-height: var(--objective-card-fixed-height) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    cursor: pointer;
}

/* Titre bloqué en haut, 2 lignes maximum. */
.objective-card-header {
    flex: 0 0 auto !important;
}

.objective-card-header h2 {
    max-height: var(--objective-card-title-height) !important;
    overflow: hidden !important;
    line-height: 1.18 !important;
}

/* Corps central : ne peut pas agrandir la carte. */
.objective-card-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/*
   Tous les contenus texte du corps sont contenus dans la zone centrale.
   Si ça dépasse, ça disparaît.
*/
.objective-card-body > p,
.objective-card-body > div:not(.tags):not(.objective-tags):not(.card-actions):not(.objective-actions):not(.actions),
.objective-card-body > .summary,
.objective-card-body > .description,
.objective-card-body > .objective-summary,
.objective-card-body > .objective-description,
.objective-card-body > .objective-text,
.objective-card-body > .objective-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    display: block !important;
}

/* Les tags ou infos courtes restent naturels, mais ne doivent pas forcer la carte. */
.objective-card-body > .tags,
.objective-card-body > .objective-tags {
    flex: 0 0 auto !important;
    overflow: hidden !important;
}

/* Le footer reste tout en bas. */
.objective-card-footer {
    margin-top: auto !important;
    flex: 0 0 auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Boutons éventuels visibles. */
.objective-card .btn,
.objective-card-footer .btn,
.objective-card-body .btn {
    flex: 0 0 auto !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

/* Dans la popup, on désactive totalement la hauteur figée. */
.objective-modal-content .objective-card {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    cursor: default !important;
}

.objective-modal-content .objective-card-body,
.objective-modal-content .objective-card-body > p,
.objective-modal-content .objective-card-body > div,
.objective-modal-content .objective-card-body > .summary,
.objective-modal-content .objective-card-body > .description,
.objective-modal-content .objective-card-body > .objective-summary,
.objective-modal-content .objective-card-body > .objective-description,
.objective-modal-content .objective-card-body > .objective-text,
.objective-modal-content .objective-card-body > .objective-content {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

/* ==========================================================
   PATCH OBJECTIFS CACHES V3 - TEXTE 4 LIGNES
   ----------------------------------------------------------
   Page concernée : objectifs.php

   Objectif :
   - carte objectif figée, mais moins haute ;
   - titre en haut, possible sur deux lignes ;
   - zone texte limitée à environ 4 lignes ;
   - texte trop long masqué dans la carte ;
   - pointillés / proposé par calés en bas ;
   - popup garde le contenu complet.
   ========================================================== */

:root {
    /*
       Gabarit objectif plus compact.
       La zone texte visible correspond à environ 4 lignes.
    */
    --objective-card-fixed-height: 245px;
    --objective-card-title-height: 2.45em;
    --objective-card-text-height: 4.8em;
}

/* Cartes de même hauteur dans la grille. */
.objectives-list {
    align-items: stretch !important;
}

/* Carte objectif : hauteur fixe compacte. */
.objective-card {
    height: var(--objective-card-fixed-height) !important;
    min-height: var(--objective-card-fixed-height) !important;
    max-height: var(--objective-card-fixed-height) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    cursor: pointer;
}

/* Titre en haut, deux lignes maximum. */
.objective-card-header {
    flex: 0 0 auto !important;
}

.objective-card-header h2 {
    max-height: var(--objective-card-title-height) !important;
    overflow: hidden !important;
    line-height: 1.18 !important;
}

/* Corps central compact. */
.objective-card-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/*
   Zone texte : 4 lignes visibles environ.
   Si le texte dépasse, il disparaît dans la carte.
*/
.objective-card-body > p,
.objective-card-body > div:not(.tags):not(.objective-tags):not(.card-actions):not(.objective-actions):not(.actions),
.objective-card-body > .summary,
.objective-card-body > .description,
.objective-card-body > .objective-summary,
.objective-card-body > .objective-description,
.objective-card-body > .objective-text,
.objective-card-body > .objective-content {
    flex: 0 0 var(--objective-card-text-height) !important;
    height: var(--objective-card-text-height) !important;
    max-height: var(--objective-card-text-height) !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: block !important;
}

/* Tags ou infos courtes : hauteur naturelle, mais ne forcent pas la carte. */
.objective-card-body > .tags,
.objective-card-body > .objective-tags {
    flex: 0 0 auto !important;
    overflow: hidden !important;
}

/* Footer toujours en bas. */
.objective-card-footer {
    margin-top: auto !important;
    flex: 0 0 auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Boutons éventuels visibles. */
.objective-card .btn,
.objective-card-footer .btn,
.objective-card-body .btn {
    flex: 0 0 auto !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

/* Dans la popup, on désactive la hauteur figée pour lire tout le contenu. */
.objective-modal-content .objective-card {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    cursor: default !important;
}

.objective-modal-content .objective-card-body,
.objective-modal-content .objective-card-body > p,
.objective-modal-content .objective-card-body > div,
.objective-modal-content .objective-card-body > .summary,
.objective-modal-content .objective-card-body > .description,
.objective-modal-content .objective-card-body > .objective-summary,
.objective-modal-content .objective-card-body > .objective-description,
.objective-modal-content .objective-card-body > .objective-text,
.objective-modal-content .objective-card-body > .objective-content {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

/* ==========================================================
   PATCH OBJECTIFS TITRES SANS ICONE
   ----------------------------------------------------------
   Page concernée : objectifs.php

   Objectif :
   - supprimer le cercle avec étoile dans les titres d'objectifs ;
   - centrer proprement le texte du titre ;
   - ne pas modifier le reste des cartes.
   ========================================================== */

/* On masque l'icône ronde / étoile dans l'en-tête des objectifs. */
.objective-card-header .objective-icon,
.objective-card-header .icon,
.objective-card-header .badge,
.objective-card-header > span:first-child {
    display: none !important;
}

/* L'en-tête reste propre, mais le titre est centré. */
.objective-card-header {
    justify-content: center !important;
    text-align: center !important;
}

/* Le titre prend toute la largeur disponible. */
.objective-card-header h2 {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: center !important;
}

/* ==========================================================
   PATCH SCENARIOS IMAGE ENTIERE
   ----------------------------------------------------------
   Page concernée : liste / aperçu des scénarios.

   Objectif :
   - afficher l'image du scénario en entier ;
   - ne plus rogner l'image avec object-fit: cover ;
   - définir une base propre par défaut ;
   - afficher la taille recommandée en pixels sous l'image.
   ========================================================== */

:root {
    --scenario-image-recommended-width: 1200px;
    --scenario-image-recommended-height: 765px;
    --scenario-card-image-height: 210px;
}

.scenario-card {
    overflow: hidden !important;
}

.scenario-card > img,
.scenario-card img.scenario-image,
.scenario-card .scenario-image img,
.scenario-card .scenario-card-image img {
    width: 100% !important;
    height: var(--scenario-card-image-height) !important;
    object-fit: contain !important;
    object-position: center center !important;
    background:
        radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .38), transparent 34%),
        linear-gradient(180deg, #f4eddc 0%, #dfd4bb 100%) !important;
}



/* ==========================================================
   PATCH SCENARIOS IMAGE PLUS HAUTE
   ----------------------------------------------------------
   Objectif :
   - ne pas toucher à la largeur ;
   - augmenter uniquement la hauteur visible de l'image scénario ;
   - éviter que des éléments importants comme le carrefour soient coupés.
   ========================================================== */

:root {
    --scenario-card-image-height: 260px;
}

/*
   Sélecteur volontairement plus fort que la règle source :
   .scenario-card img { height: 190px; object-fit: cover; }
*/
.scenario-list .scenario-card > img,
.scenario-list .scenario-card img,
.scenario-card > img,
.scenario-card img {
    width: 100% !important;
    height: var(--scenario-card-image-height) !important;
    object-fit: cover !important;
    object-position: center center !important;
}

/* ==========================================================
   PATCH SCENARIOS IMAGE RATIO COMMUN
   ----------------------------------------------------------
   Objectif :
   - même logique d'image sur l'index et l'aperçu scénario ;
   - largeur inchangée ;
   - hauteur augmentée pour éviter les coupes importantes ;
   - ratio recommandé : 1200 × 765 px.
   ========================================================== */

:root {
    --scenario-image-recommended-width: 1200px;
    --scenario-image-recommended-height: 765px;
    --scenario-image-recommended-ratio: 1.5686;

    /* Index public */
    --scenario-card-image-height: 260px;

    /* Aperçu scénario A4 écran */
    --scenario-preview-battlefield-height: 475px;
}

/* Index / liste des scénarios : hauteur validée, largeur inchangée. */
.scenario-list .scenario-card > img,
.scenario-list .scenario-card img,
.scenario-card > img,
.scenario-card img {
    width: 100% !important;
    height: var(--scenario-card-image-height) !important;
    object-fit: cover !important;
    object-position: center center !important;
}

/*
   Aperçu scénario :
   même proportion que l'index, mais adaptée à la largeur de la fiche A4.
*/
body .sheet .sheet-battlefield-frame {
    height: var(--scenario-preview-battlefield-height) !important;
}

body .sheet .sheet-battlefield-frame img,
body .sheet .battle-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
}

/* Petit texte d'aide réutilisable côté formulaire. */
.scenario-image-help,
.image-ratio-help {
    margin: .45rem 0 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.35;
}

.scenario-image-help strong,
.image-ratio-help strong {
    color: var(--olive);
}

/* Message de contrôle JS image. */
.scenario-image-check-message {
    margin-top: .45rem;
    font-size: .88rem;
    line-height: 1.35;
    font-weight: 700;
}

.scenario-image-check-message.is-ok {
    color: #2f5b1e;
}

.scenario-image-check-message.is-warning {
    color: #8a5a00;
}

@media print {
    body .sheet .sheet-battlefield-frame {
        /*
           Ratio proche de 1200 × 765 sur la largeur utile A4.
           Plus haut que l'ancien 82mm pour éviter de couper le terrain.
        */
        height: 125mm !important;
    }
}

/* ==========================================================
   PATCH INDEX CARTE ACCES COMPLET CENTREE
   ----------------------------------------------------------
   Page concernée : index.php

   Objectif :
   - centrer la carte "Accès complet à la bibliothèque" ;
   - l'aligner sur l'axe général du site ;
   - centrer le texte et le bouton ;
   - ne pas toucher aux cartes scénario.
   ========================================================== */

.public-register-card {
    width: min(100%, 760px);
    margin: 28px auto 0 !important;
    text-align: center;
}

.public-register-card h2 {
    text-align: center;
}

.public-register-card p {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.public-register-card .btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
}

/* ==========================================================
   ADMIN TAXONOMIES - GRILLE 3 COLONNES COMPACTE
   ----------------------------------------------------------
   Page concernée : /admin/taxonomies.php

   Objectif :
   - garder les taxonomies dans style.css ;
   - 3 colonnes sur grand écran ;
   - la 4e taxonomie repasse sous la première ;
   - lignes compactes comme au départ ;
   - Nom / Icône / Ordre / OK / × sur la même ligne.
   ========================================================== */

.taxonomy-admin-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 18px;
    align-items: start;
    width: 100%;
}

.taxonomy-admin-card {
    min-width: 0;
    width: 100%;
}

.taxonomy-admin-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    text-align: center;
}

.taxonomy-admin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.taxonomy-admin-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px 58px auto;
    gap: 6px;
    align-items: end;
    margin-bottom: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.taxonomy-admin-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px 58px;
    gap: 6px;
    align-items: end;
    margin-top: 14px;
    padding: 10px;
    border: 1px dashed rgba(77, 93, 54, .28);
    border-radius: 12px;
    background: rgba(255, 248, 232, .42);
}

.taxonomy-admin-add .btn {
    grid-column: 1 / -1;
    justify-content: center;
}

.taxonomy-field {
    min-width: 0;
}

.taxonomy-field label {
    display: block;
    margin-bottom: 3px;
    font-size: .78rem;
    line-height: 1.1;
}

.taxonomy-field input {
    width: 100%;
    min-height: 34px;
    box-sizing: border-box;
}

.taxonomy-field-icon input,
.taxonomy-field-order input {
    text-align: center;
}

.taxonomy-actions {
    display: flex;
    gap: 4px;
    align-items: end;
    justify-content: flex-end;
    white-space: nowrap;
}

.taxonomy-actions .btn {
    min-width: 34px;
    min-height: 34px;
    padding: 0 9px;
    line-height: 1;
}

.btn.danger {
    background: #8f2d22;
    color: #fff;
}

/* Tablette : 2 colonnes */
@media (max-width: 1180px) {
    .taxonomy-admin-grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }
}

/* Mobile : 1 colonne, là seulement on empile. */
@media (max-width: 760px) {
    .taxonomy-admin-grid {
        grid-template-columns: 1fr;
    }

    .taxonomy-admin-row,
    .taxonomy-admin-add {
        grid-template-columns: 1fr;
    }

    .taxonomy-actions {
        justify-content: stretch;
    }

    .taxonomy-actions .btn,
    .taxonomy-admin-add .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================
   INDEX - SUPPRESSION TEXTE IMAGE CONSEILLEE
   ----------------------------------------------------------
   Page concernée : index.php

   Objectif :
   - supprimer le texte ""
     affiché sous les images des cartes scénario ;
   - ne rien afficher à cet endroit ;
   - permettre au titre de remonter.
   ========================================================== */

.scenario-card .body::before {
    content: none !important;
    display: none !important;
}

.scenario-image-size-hint {
    display: none !important;
}

/* ==========================================================
   FOOTER SITE COMPLET
   ----------------------------------------------------------
   Objectif :
   - remettre un footer complet et propre ;
   - lien Xavier Lucas / site officiel ;
   - copyright ;
   - liens mentions légales / RGPD / contact ;
   - aucun style en dur dans le PHP.
   ========================================================== */

.site-footer {
    margin: 38px auto 0;
    padding: 22px 16px 26px;
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
}

.site-footer-inner {
    width: min(100%, 980px);
    margin: 0 auto;
    padding-top: 16px;
    border-top: 1px solid rgba(77, 93, 54, .22);
}

.site-footer p {
    margin: 0;
}

.site-footer-owner {
    font-weight: 800;
    color: var(--ink);
}

.site-footer-owner a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}

.site-footer-owner a:hover {
    border-bottom-style: solid;
}

.site-footer-rights {
    margin-top: 6px !important;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-top: 8px;
    font-size: .86rem;
}

.site-footer-links a {
    color: inherit;
    text-decoration: none;
}

.site-footer-links a:hover {
    text-decoration: underline;
}

/* ==========================================================
   FOOTER SITE - TEXTE BLANC
   ----------------------------------------------------------
   Objectif :
   - passer tout le footer en écriture blanche ;
   - liens compris ;
   - ne pas toucher au PHP.
   ========================================================== */

.site-footer,
.site-footer p,
.site-footer a,
.site-footer-owner,
.site-footer-rights,
.site-footer-links,
.site-footer-links a {
    color: #fff !important;
}

.site-footer-owner a,
.site-footer-links a {
    border-color: rgba(255, 255, 255, .85) !important;
}

.site-footer-inner {
    border-top-color: rgba(255, 255, 255, .35) !important;
}

/* ==========================================================
   FOOTER SITE - BLANC PLUS FIN
   ----------------------------------------------------------
   Objectif :
   - garder le footer en blanc ;
   - éviter l'effet trop lumineux / baveux ;
   - rendre les écritures plus fines, plus aérées et plus lisibles.
   ========================================================== */

.site-footer,
.site-footer p,
.site-footer a,
.site-footer-owner,
.site-footer-rights,
.site-footer-links,
.site-footer-links a {
    color: rgba(255, 255, 255, .82) !important;
    text-shadow: none !important;
}

.site-footer {
    font-size: .86rem;
    line-height: 1.45;
    letter-spacing: .015em;
}

.site-footer-owner {
    font-weight: 600 !important;
    letter-spacing: .025em;
}

.site-footer-rights,
.site-footer-links {
    font-weight: 400 !important;
}

.site-footer-owner a,
.site-footer-links a {
    color: rgba(255, 255, 255, .88) !important;
    border-bottom: 1px dotted rgba(255, 255, 255, .42) !important;
    text-decoration: none !important;
}

.site-footer-owner a:hover,
.site-footer-links a:hover {
    color: #fff !important;
    border-bottom-color: rgba(255, 255, 255, .8) !important;
}

.site-footer-inner {
    border-top-color: rgba(255, 255, 255, .22) !important;
}

/* ==========================================================
   PAGES LEGALES ET CONTACT
   ----------------------------------------------------------
   Pages concernées :
   - mentions-legales.php
   - rgpd.php
   - contact.php
   ========================================================== */

.legal-page {
    width: min(100%, 980px);
    margin: 0 auto;
}

.legal-card {
    line-height: 1.65;
}

.legal-card h1 {
    text-align: center;
    margin-top: 0;
}

.legal-card h2 {
    margin-top: 24px;
    margin-bottom: 8px;
}

.legal-card p {
    margin-top: 0;
}

.legal-card a {
    font-weight: 800;
}

.contact-card {
    width: min(100%, 860px);
    margin-left: auto;
    margin-right: auto;
}

.contact-form {
    margin-top: 18px;
}

.contact-form > div {
    margin-bottom: 14px;
}

.contact-form textarea {
    min-height: 180px;
}

/* ==========================================================
   THEME ANCIEN - JOURNAL ANNEES 40
   ----------------------------------------------------------
   Activation :
   body.theme-vintage

   Objectif :
   - uniquement l'aspect de la version ancienne ;
   - ne pas toucher à la structure ;
   - supprimer visuellement les verts ;
   - ambiance vieux document / journal années 40 ;
   - police type machine à écrire ;
   - scénarios eux-mêmes : seulement la police, pas la mise en page.
   ========================================================== */

body.theme-vintage {
    --ink: #2b2117;
    --muted: #6e5a3d;
    --paper: #ead8aa;
    --paper2: #d8bf83;
    --line: rgba(62, 43, 24, .32);
    --olive: #6f5735;
    --olive2: #4d3a22;
    --accent: #7c4f25;

    color: var(--ink);
    font-family: "Courier New", Courier, monospace;
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 255, 255, .30), transparent 24%),
        radial-gradient(circle at 84% 18%, rgba(70, 43, 20, .16), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(42, 27, 13, .20), transparent 36%),
        linear-gradient(180deg, #bfa875 0%, #927047 48%, #5f4128 100%);
}

/* Grain discret de vieux papier. */
body.theme-vintage::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .18;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, .08) 0,
            rgba(255, 255, 255, .08) 1px,
            transparent 1px,
            transparent 4px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(53, 34, 18, .07) 0,
            rgba(53, 34, 18, .07) 1px,
            transparent 1px,
            transparent 5px
        );
}

/* Barre supérieure : papier ancien, plus de vert. */
body.theme-vintage .topbar {
    background:
        linear-gradient(180deg, rgba(80, 55, 30, .96), rgba(50, 34, 20, .96));
    border-bottom: 1px solid rgba(255, 230, 178, .25);
    box-shadow: 0 5px 18px rgba(38, 22, 10, .30);
}

body.theme-vintage .brand,
body.theme-vintage .main-nav a,
body.theme-vintage .auth-links a,
body.theme-vintage .user-badge {
    color: #f5e6bd;
    font-family: "Courier New", Courier, monospace;
    letter-spacing: .03em;
}

body.theme-vintage .brand .logo {
    color: #f5e6bd;
    filter: sepia(1);
}

body.theme-vintage .main-nav a.active,
body.theme-vintage .main-nav a:hover {
    background: rgba(245, 230, 189, .15);
    color: #fff1c8;
}

/* Boutons : anciens tampons / dossiers. */
body.theme-vintage .btn,
body.theme-vintage button.btn,
body.theme-vintage input[type="submit"] {
    border: 1px solid rgba(45, 31, 18, .55);
    background:
        linear-gradient(180deg, #8e7048 0%, #5d4227 100%);
    color: #fff0c9;
    font-family: "Courier New", Courier, monospace;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
    box-shadow: 0 2px 0 rgba(43, 30, 17, .45);
}

body.theme-vintage .btn:hover,
body.theme-vintage button.btn:hover {
    background:
        linear-gradient(180deg, #9d7c50 0%, #6a4a2b 100%);
    color: #fff7dc;
}

body.theme-vintage .btn.primary {
    background:
        linear-gradient(180deg, #6b5638 0%, #3f2d1d 100%);
    color: #fff1c8;
}

body.theme-vintage .btn.ghost {
    background: rgba(255, 240, 201, .10);
    color: #fff1c8;
    border-color: rgba(255, 240, 201, .28);
}

/* Cartes et blocs : vieux documents. */
body.theme-vintage .card,
body.theme-vintage .scenario-card,
body.theme-vintage .random-box,
body.theme-vintage .public-hero,
body.theme-vintage .filters,
body.theme-vintage .hidden-form,
body.theme-vintage .message,
body.theme-vintage .legal-card {
    color: var(--ink);
    border: 1px solid rgba(70, 47, 25, .35);
    background:
        radial-gradient(circle at 14% 8%, rgba(255, 255, 255, .22), transparent 18%),
        linear-gradient(180deg, rgba(242, 222, 174, .94), rgba(208, 179, 119, .94));
    box-shadow:
        0 10px 24px rgba(43, 28, 14, .20),
        inset 0 0 28px rgba(86, 55, 25, .08);
}

body.theme-vintage .card::before,
body.theme-vintage .scenario-card::before {
    opacity: .08;
}

/* Titres : journal / rapport militaire. */
body.theme-vintage h1,
body.theme-vintage h2,
body.theme-vintage h3,
body.theme-vintage .public-hero h1,
body.theme-vintage .scenario-card h2 {
    color: #2f2114;
    font-family: "Courier New", Courier, monospace;
    font-weight: 900;
    letter-spacing: .045em;
    text-transform: uppercase;
    text-shadow: none;
}

body.theme-vintage .public-hero h1 {
    border-bottom: 2px solid rgba(54, 35, 18, .30);
    display: inline-block;
    padding-bottom: .18em;
}

/* Textes et formulaires. */
body.theme-vintage p,
body.theme-vintage label,
body.theme-vintage input,
body.theme-vintage textarea,
body.theme-vintage select {
    font-family: "Courier New", Courier, monospace;
}

body.theme-vintage input,
body.theme-vintage textarea,
body.theme-vintage select {
    color: #2b2117;
    border: 1px solid rgba(58, 39, 21, .42);
    background: rgba(255, 245, 215, .72);
    box-shadow: inset 0 1px 3px rgba(43, 28, 14, .12);
}

body.theme-vintage input:focus,
body.theme-vintage textarea:focus,
body.theme-vintage select:focus {
    outline: 2px solid rgba(93, 66, 39, .35);
    border-color: rgba(58, 39, 21, .70);
}

/* Tags : plus de vert, style étiquette ancienne. */
body.theme-vintage .tag {
    color: #2f2114;
    border: 1px solid rgba(58, 39, 21, .28);
    background:
        linear-gradient(180deg, rgba(239, 216, 164, .92), rgba(190, 153, 91, .84));
    font-family: "Courier New", Courier, monospace;
    font-weight: 700;
    letter-spacing: .025em;
}

/* Cartes scénario sur index : aspect vieux dossier. */
body.theme-vintage .scenario-card {
    overflow: hidden;
}

body.theme-vintage .scenario-card > img,
body.theme-vintage .scenario-card img {
    filter: sepia(.35) contrast(.95) saturate(.78);
}

body.theme-vintage .scenario-card .body {
    background:
        linear-gradient(180deg, rgba(241, 221, 174, .92), rgba(210, 178, 113, .92));
}

/* Pastilles objectifs / numérotation : brun, pas vert. */
body.theme-vintage .step,
body.theme-vintage .number-badge,
body.theme-vintage .objective-number,
body.theme-vintage .sheet-bullet-number,
body.theme-vintage .round-number,
body.theme-vintage .circle-number {
    background: #5b3b1f !important;
    color: #fff0c9 !important;
    border-color: rgba(40, 25, 12, .45) !important;
    font-family: "Courier New", Courier, monospace !important;
}

/* Petites puces : brun/sépia. */
body.theme-vintage li::marker {
    color: #5b3b1f;
}

/* Footer : blanc cassé, cohérent vieux document. */
body.theme-vintage .site-footer,
body.theme-vintage .site-footer p,
body.theme-vintage .site-footer a,
body.theme-vintage .site-footer-owner,
body.theme-vintage .site-footer-rights,
body.theme-vintage .site-footer-links,
body.theme-vintage .site-footer-links a {
    color: rgba(255, 238, 197, .86) !important;
    font-family: "Courier New", Courier, monospace;
}

body.theme-vintage .site-footer-inner {
    border-top-color: rgba(255, 238, 197, .22) !important;
}

/* Switchers : thème ancien visible sans vert. */
body.theme-vintage .lfm-switch-pill {
    border-color: rgba(255, 238, 197, .45);
    background: rgba(68, 44, 23, .45);
    color: #fff0c9;
}

body.theme-vintage .lfm-switch-pill.is-active {
    outline-color: rgba(255, 238, 197, .78);
}

/* Pages légales et contact. */
body.theme-vintage .legal-card a,
body.theme-vintage .contact-card a {
    color: #4e3219;
}

/* Admin aussi : compact et lisible, sans vert. */
body.theme-vintage .taxonomy-admin-row,
body.theme-vintage .taxonomy-admin-add,
body.theme-vintage .lfm-captcha {
    border-color: rgba(58, 39, 21, .30);
    background: rgba(242, 222, 174, .54);
}

/* Fiches scénario affichées dans le site :
   uniquement la police / teinte globale, pas la structure. */
body.theme-vintage .sheet,
body.theme-vintage .scenario-preview-a4,
body.theme-vintage .scenario-view-page {
    font-family: "Courier New", Courier, monospace;
}

body.theme-vintage .sheet h1,
body.theme-vintage .sheet h2,
body.theme-vintage .sheet h3,
body.theme-vintage .sheet p,
body.theme-vintage .sheet li,
body.theme-vintage .sheet td,
body.theme-vintage .sheet th {
    font-family: "Courier New", Courier, monospace;
}

/* Sécurité : neutraliser les restes de vert les plus visibles en thème ancien. */
body.theme-vintage .primary,
body.theme-vintage .active,
body.theme-vintage .message,
body.theme-vintage .message.error {
    border-color: rgba(58, 39, 21, .36);
}

/* ==========================================================
   THEME ANCIEN - FOND DE SITE FILIGRANE
   ----------------------------------------------------------
   Activation : body.theme-vintage

   Image attendue :
   /assets/img/theme-vintage-bg.png

   Objectif :
   - utiliser le fond de bataille sépia en très grand arrière-plan ;
   - le garder très discret, comme un filigrane ;
   - conserver la lisibilité du site complet ;
   - ne rien changer à la structure.
   ========================================================== */

body.theme-vintage {
    background:
        linear-gradient(180deg, rgba(191, 168, 117, .92) 0%, rgba(146, 112, 71, .94) 48%, rgba(95, 65, 40, .96) 100%);
    background-attachment: fixed;
}

body.theme-vintage::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(rgba(234, 216, 170, .82), rgba(234, 216, 170, .82)),
        url('../img/theme-vintage-bg.png') center top / cover no-repeat;
    opacity: .42;
    filter: sepia(.15) contrast(.92) saturate(.80);
}

body.theme-vintage::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .12;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, .06) 0,
            rgba(255, 255, 255, .06) 1px,
            transparent 1px,
            transparent 4px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(53, 34, 18, .05) 0,
            rgba(53, 34, 18, .05) 1px,
            transparent 1px,
            transparent 5px
        );
}

body.theme-vintage .card,
body.theme-vintage .scenario-card,
body.theme-vintage .random-box,
body.theme-vintage .public-hero,
body.theme-vintage .filters,
body.theme-vintage .hidden-form,
body.theme-vintage .message,
body.theme-vintage .legal-card {
    background:
        radial-gradient(circle at 14% 8%, rgba(255, 255, 255, .18), transparent 18%),
        linear-gradient(180deg, rgba(242, 222, 174, .88), rgba(208, 179, 119, .88));
    backdrop-filter: blur(1px);
}

body.theme-vintage .scenario-card .body {
    background:
        linear-gradient(180deg, rgba(241, 221, 174, .86), rgba(210, 178, 113, .86));
}

/* ==========================================================
   THEME ANCIEN - FOND FILIGRANE DIRECT
   ----------------------------------------------------------
   Image attendue :
   /assets/img/theme-vintage-bg.png

   Correction :
   - l'image est appliquée directement sur body.theme-vintage ;
   - plus de z-index négatif ;
   - le fond doit donc apparaître correctement.
   ========================================================== */

body.theme-vintage {
    background-color: #b89b68 !important;
    background-image:
        linear-gradient(
            180deg,
            rgba(238, 219, 174, .78) 0%,
            rgba(184, 148, 91, .82) 52%,
            rgba(92, 61, 34, .88) 100%
        ),
        url('../img/theme-vintage-bg.png') !important;
    background-size: cover !important;
    background-position: center top !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* On neutralise l'ancien pseudo-fond qui pouvait passer derrière la page. */
body.theme-vintage::before {
    content: none !important;
    display: none !important;
}

/* On garde seulement un très léger grain par-dessus. */
body.theme-vintage::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .08;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, .08) 0,
            rgba(255, 255, 255, .08) 1px,
            transparent 1px,
            transparent 4px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(53, 34, 18, .06) 0,
            rgba(53, 34, 18, .06) 1px,
            transparent 1px,
            transparent 5px
        );
}

/* Sécurité : le contenu du site reste au-dessus du grain. */
body.theme-vintage .topbar,
body.theme-vintage main,
body.theme-vintage .site-footer,
body.theme-vintage .public-hero,
body.theme-vintage .random-box,
body.theme-vintage .scenario-list,
body.theme-vintage .card,
body.theme-vintage .filters {
    position: relative;
    z-index: 1;
}

/* ==========================================================
   THEME ANCIEN - FOND PLUS VISIBLE
   ----------------------------------------------------------
   Objectif :
   - garder le fond sépia de bataille bien visible ;
   - réduire le voile qui le masque trop ;
   - conserver une bonne lisibilité.
   ========================================================== */

body.theme-vintage {
    background-color: #b08f5d !important;
    background-image:
        linear-gradient(
            180deg,
            rgba(239, 221, 181, .48) 0%,
            rgba(191, 155, 99, .54) 52%,
            rgba(95, 65, 40, .62) 100%
        ),
        url('../img/theme-vintage-bg.png') !important;
    background-size: cover !important;
    background-position: center top !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* On garde seulement un grain très léger. */
body.theme-vintage::before {
    content: none !important;
    display: none !important;
}

body.theme-vintage::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .045;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, .08) 0,
            rgba(255, 255, 255, .08) 1px,
            transparent 1px,
            transparent 5px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(53, 34, 18, .05) 0,
            rgba(53, 34, 18, .05) 1px,
            transparent 1px,
            transparent 6px
        );
}

/* Les blocs restent lisibles mais un peu plus transparents
   pour laisser davantage apparaître le fond. */
body.theme-vintage .card,
body.theme-vintage .scenario-card,
body.theme-vintage .random-box,
body.theme-vintage .public-hero,
body.theme-vintage .filters,
body.theme-vintage .hidden-form,
body.theme-vintage .message,
body.theme-vintage .legal-card {
    background:
        radial-gradient(circle at 14% 8%, rgba(255, 255, 255, .14), transparent 18%),
        linear-gradient(180deg, rgba(242, 222, 174, .80), rgba(208, 179, 119, .80));
    backdrop-filter: blur(.5px);
}

body.theme-vintage .scenario-card .body {
    background:
        linear-gradient(180deg, rgba(241, 221, 174, .76), rgba(210, 178, 113, .76));
}

/* Sécurité : le contenu reste bien au-dessus. */
body.theme-vintage .topbar,
body.theme-vintage main,
body.theme-vintage .site-footer,
body.theme-vintage .public-hero,
body.theme-vintage .random-box,
body.theme-vintage .scenario-list,
body.theme-vintage .card,
body.theme-vintage .filters {
    position: relative;
    z-index: 1;
}

/* ==========================================================
   THEME ANCIEN - FOOTER SANS FOND
   ----------------------------------------------------------
   Objectif :
   - uniquement pour la version ancienne ;
   - supprimer le fond vert / bloc de fond du footer ;
   - garder les écritures lisibles sur le fond de bataille ;
   - ajouter un léger contour/ombrage propre.
   ========================================================== */

body.theme-vintage .site-footer {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}

body.theme-vintage .site-footer-inner {
    background: transparent !important;
    border-top: 1px solid rgba(255, 238, 197, .28) !important;
    box-shadow: none !important;
}

body.theme-vintage .site-footer,
body.theme-vintage .site-footer p,
body.theme-vintage .site-footer a,
body.theme-vintage .site-footer-owner,
body.theme-vintage .site-footer-rights,
body.theme-vintage .site-footer-links,
body.theme-vintage .site-footer-links a {
    color: rgba(255, 244, 214, .94) !important;
    text-shadow:
        0 1px 1px rgba(42, 25, 11, .95),
        0 0 3px rgba(42, 25, 11, .70) !important;
}

body.theme-vintage .site-footer-owner a,
body.theme-vintage .site-footer-links a {
    border-bottom-color: rgba(255, 244, 214, .50) !important;
}

body.theme-vintage .site-footer-owner a:hover,
body.theme-vintage .site-footer-links a:hover {
    color: #fff8df !important;
    border-bottom-color: rgba(255, 248, 223, .88) !important;
}

/* ==========================================================
   THEME ANCIEN - RECADRAGE FOND BATAILLE
   ----------------------------------------------------------
   Objectif :
   - remonter visuellement la partie intéressante du fond ;
   - faire disparaître davantage le ciel ;
   - conserver le même fonctionnement global.
   ========================================================== */

body.theme-vintage {
    background-position: center 72% !important;
}

/* Sécurité si d'autres règles plus anciennes ciblent le même fond. */
body.theme-vintage {
    background-image:
        linear-gradient(
            180deg,
            rgba(239, 221, 181, .48) 0%,
            rgba(191, 155, 99, .54) 52%,
            rgba(95, 65, 40, .62) 100%
        ),
        url('../img/theme-vintage-bg.png') !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* ==========================================================
   THEME ANCIEN - RECADRAGE FOND BATAILLE V2
   ----------------------------------------------------------
   Objectif :
   - remonter encore le cadrage visuel ;
   - montrer davantage tout le dessin du bas ;
   - couper encore plus le ciel.
   ========================================================== */

body.theme-vintage {
    background-position: center 88% !important;
}

/* ==========================================================
   THEME ANCIEN - CALAGE SUR LE BAS
   ----------------------------------------------------------
   Objectif :
   - caler l'image de fond sur le bas ;
   - garder visible toute la partie basse intéressante ;
   - faire disparaître le haut de l'image en priorité.
   ========================================================== */

body.theme-vintage {
    background-position: center bottom !important;
}

/* ==========================================================
   THEME ANCIEN - FOND ENCORE PLUS VISIBLE
   ----------------------------------------------------------
   Objectif :
   - conserver le calage sur le bas ;
   - rendre l'image de fond plus visible ;
   - alléger encore le voile sépia.
   ========================================================== */

body.theme-vintage {
    background-image:
        linear-gradient(
            180deg,
            rgba(239, 221, 181, .28) 0%,
            rgba(191, 155, 99, .34) 52%,
            rgba(95, 65, 40, .42) 100%
        ),
        url('../img/theme-vintage-bg.png') !important;
    background-position: center bottom !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* On laisse aussi respirer un tout petit peu plus les blocs du site. */
body.theme-vintage .card,
body.theme-vintage .scenario-card,
body.theme-vintage .random-box,
body.theme-vintage .public-hero,
body.theme-vintage .filters,
body.theme-vintage .hidden-form,
body.theme-vintage .message,
body.theme-vintage .legal-card {
    background:
        radial-gradient(circle at 14% 8%, rgba(255, 255, 255, .12), transparent 18%),
        linear-gradient(180deg, rgba(242, 222, 174, .76), rgba(208, 179, 119, .76));
}

body.theme-vintage .scenario-card .body {
    background:
        linear-gradient(180deg, rgba(241, 221, 174, .72), rgba(210, 178, 113, .72));
}

/* ==========================================================
   INDEX - FILTRES COMPACTS
   ----------------------------------------------------------
   Page concernée : index.php

   Objectif :
   - retirer le filtre "Proposé par" ;
   - retirer l'effet grande barre du bouton Filtrer ;
   - placer le bouton comme un petit élément à côté des filtres.
   ========================================================== */

.scenario-filters .filter-submit {
    display: flex;
    align-items: end;
}

.scenario-filters .filter-submit .btn {
    width: auto;
    min-width: 92px;
    min-height: 38px;
    padding-left: 16px;
    padding-right: 16px;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .scenario-filters .filter-submit .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================
   INDEX - ALIGNEMENT BOUTON FILTRER
   ----------------------------------------------------------
   Page concernée : index.php

   Objectif :
   - aligner le bouton Filtrer sur la hauteur des champs ;
   - ne pas l'aligner sur le label "Système de jeu" ;
   - le placer visuellement au niveau de la sélection "Tous".
   ========================================================== */

.scenario-filters .filter-submit {
    display: flex;
    align-items: flex-end;
    padding-top: 1.45rem;
}

.scenario-filters .filter-submit .btn {
    height: 38px;
    min-height: 38px;
    margin: 0;
    align-self: flex-end;
}

/* ==========================================================
   THEME MODERNE - FOND DE SITE FILIGRANE
   ----------------------------------------------------------
   Activation : body.theme-modern
   Image attendue : /assets/img/theme-modern-bg.png

   Objectif :
   - ajouter un fond de site discret dans la version moderne ;
   - rester dans des tons crème/beige cohérents avec le site ;
   - garder la lisibilité générale ;
   - rendre le footer transparent dans la version moderne.
   ========================================================== */

body.theme-modern {
    background-color: #efe7d8 !important;
    background-image:
        linear-gradient(
            180deg,
            rgba(245, 239, 229, .62) 0%,
            rgba(239, 231, 216, .58) 50%,
            rgba(228, 216, 197, .62) 100%
        ) !important;
    background-size: cover !important;
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

body.theme-modern::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .035;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, .10) 0,
            rgba(255, 255, 255, .10) 1px,
            transparent 1px,
            transparent 5px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(110, 93, 67, .05) 0,
            rgba(110, 93, 67, .05) 1px,
            transparent 1px,
            transparent 6px
        );
}

body.theme-modern .topbar,
body.theme-modern main,
body.theme-modern .site-footer,
body.theme-modern .public-hero,
body.theme-modern .random-box,
body.theme-modern .scenario-list,
body.theme-modern .card,
body.theme-modern .filters {
    position: relative;
    z-index: 1;
}

/* Laisser vivre le fond sans nuire à la lisibilité. */
body.theme-modern .card,
body.theme-modern .scenario-card,
body.theme-modern .random-box,
body.theme-modern .public-hero,
body.theme-modern .filters,
body.theme-modern .hidden-form,
body.theme-modern .message,
body.theme-modern .legal-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(249, 245, 238, .88));
    backdrop-filter: blur(.5px);
}

body.theme-modern .scenario-card .body {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .84), rgba(249, 245, 238, .84));
}

/* Footer transparent, sans bande de fond. */
body.theme-modern .site-footer {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}

body.theme-modern .site-footer-inner {
    background: transparent !important;
    border-top: 1px solid rgba(255, 255, 255, .35) !important;
    box-shadow: none !important;
}

body.theme-modern .site-footer,
body.theme-modern .site-footer p,
body.theme-modern .site-footer a,
body.theme-modern .site-footer-owner,
body.theme-modern .site-footer-rights,
body.theme-modern .site-footer-links,
body.theme-modern .site-footer-links a {
    color: rgba(255, 255, 255, .90) !important;
    text-shadow:
        0 1px 2px rgba(77, 62, 44, .55),
        0 0 2px rgba(77, 62, 44, .35) !important;
}

body.theme-modern .site-footer-owner a,
body.theme-modern .site-footer-links a {
    border-bottom-color: rgba(255, 255, 255, .45) !important;
}

body.theme-modern .site-footer-owner a:hover,
body.theme-modern .site-footer-links a:hover {
    color: #ffffff !important;
    border-bottom-color: rgba(255, 255, 255, .88) !important;
}

/* ==========================================================
   FONDS MODERNE PLUS VISIBLE ET FOOTERS FUMEE
   ----------------------------------------------------------
   Objectif :
   - rendre le background moderne vraiment visible ;
   - garder le fond moderne en couleur crème/beige ;
   - ajouter une zone de fumée transparente derrière le footer
     en moderne ET en ancien ;
   - conserver la lisibilité des écritures sans masquer le décor.
   ========================================================== */

/* Fond moderne : image quasi complète, voile très léger. */
body.theme-modern {
    background-color: #efe7d8 !important;
    background-image:
        linear-gradient(
            180deg,
            rgba(245, 239, 229, .18) 0%,
            rgba(239, 231, 216, .16) 50%,
            rgba(228, 216, 197, .20) 100%
        ) !important;
    background-size: cover !important;
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* Grain moderne très léger, pour éviter un rendu trop plat. */
body.theme-modern::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .025;
    background-image:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, .10) 0,
            rgba(255, 255, 255, .10) 1px,
            transparent 1px,
            transparent 5px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(110, 93, 67, .05) 0,
            rgba(110, 93, 67, .05) 1px,
            transparent 1px,
            transparent 6px
        );
}

/* Les blocs modernes restent lisibles, mais laissent davantage vivre le fond. */
body.theme-modern .card,
body.theme-modern .scenario-card,
body.theme-modern .random-box,
body.theme-modern .public-hero,
body.theme-modern .filters,
body.theme-modern .hidden-form,
body.theme-modern .message,
body.theme-modern .legal-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .80), rgba(249, 245, 238, .80));
    backdrop-filter: blur(.35px);
}

body.theme-modern .scenario-card .body {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .76), rgba(249, 245, 238, .76));
}

/* Sécurité d'empilement. */
body.theme-modern .topbar,
body.theme-modern main,
body.theme-modern .site-footer,
body.theme-modern .public-hero,
body.theme-modern .random-box,
body.theme-modern .scenario-list,
body.theme-modern .card,
body.theme-modern .filters,
body.theme-vintage .topbar,
body.theme-vintage main,
body.theme-vintage .site-footer,
body.theme-vintage .public-hero,
body.theme-vintage .random-box,
body.theme-vintage .scenario-list,
body.theme-vintage .card,
body.theme-vintage .filters {
    position: relative;
    z-index: 1;
}

/* Footer moderne et ancien : pas de fond plein, mais une fumée discrète. */
body.theme-modern .site-footer,
body.theme-vintage .site-footer {
    position: relative;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    overflow: hidden;
}

body.theme-modern .site-footer::before,
body.theme-vintage .site-footer::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: min(980px, calc(100% - 28px));
    height: 92px;
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;
    border-radius: 999px;
    background:
        radial-gradient(
            ellipse at center,
            rgba(52, 39, 25, .34) 0%,
            rgba(52, 39, 25, .22) 34%,
            rgba(52, 39, 25, .10) 62%,
            rgba(52, 39, 25, 0) 100%
        );
    filter: blur(10px);
}

body.theme-modern .site-footer-inner,
body.theme-vintage .site-footer-inner {
    position: relative;
    background: transparent !important;
    box-shadow: none !important;
}

/* Footer moderne : texte clair avec ombre propre. */
body.theme-modern .site-footer,
body.theme-modern .site-footer p,
body.theme-modern .site-footer a,
body.theme-modern .site-footer-owner,
body.theme-modern .site-footer-rights,
body.theme-modern .site-footer-links,
body.theme-modern .site-footer-links a {
    color: rgba(255, 255, 255, .94) !important;
    text-shadow:
        0 1px 2px rgba(48, 37, 24, .78),
        0 0 4px rgba(48, 37, 24, .45) !important;
}

body.theme-modern .site-footer-inner {
    border-top-color: rgba(255, 255, 255, .28) !important;
}

/* Footer ancien : même principe, un peu plus chaud. */
body.theme-vintage .site-footer,
body.theme-vintage .site-footer p,
body.theme-vintage .site-footer a,
body.theme-vintage .site-footer-owner,
body.theme-vintage .site-footer-rights,
body.theme-vintage .site-footer-links,
body.theme-vintage .site-footer-links a {
    color: rgba(255, 244, 214, .96) !important;
    text-shadow:
        0 1px 2px rgba(42, 25, 11, .90),
        0 0 5px rgba(42, 25, 11, .55) !important;
}

body.theme-vintage .site-footer-inner {
    border-top-color: rgba(255, 238, 197, .24) !important;
}

/* ==========================================================
   FOOTER FUMEE PLUS OPAQUE ET TOPBAR FIXE
   ----------------------------------------------------------
   Objectif :
   - rendre les textes du footer plus lisibles ;
   - renforcer légèrement le fumet derrière le footer ;
   - figer uniquement la barre de menu du haut pendant le scroll.
   ========================================================== */

/* Barre supérieure figée. */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Fumée de footer renforcée, moderne et ancien. */
body.theme-modern .site-footer::before,
body.theme-vintage .site-footer::before {
    height: 108px;
    bottom: 4px;
    background:
        radial-gradient(
            ellipse at center,
            rgba(45, 32, 20, .46) 0%,
            rgba(45, 32, 20, .34) 34%,
            rgba(45, 32, 20, .17) 64%,
            rgba(45, 32, 20, 0) 100%
        );
    filter: blur(11px);
}

/* Texte footer un peu plus lisible sans faire un bloc plein. */
body.theme-modern .site-footer,
body.theme-modern .site-footer p,
body.theme-modern .site-footer a,
body.theme-modern .site-footer-owner,
body.theme-modern .site-footer-rights,
body.theme-modern .site-footer-links,
body.theme-modern .site-footer-links a {
    color: rgba(255, 255, 255, .98) !important;
    text-shadow:
        0 1px 2px rgba(35, 26, 16, .92),
        0 0 6px rgba(35, 26, 16, .62) !important;
}

body.theme-vintage .site-footer,
body.theme-vintage .site-footer p,
body.theme-vintage .site-footer a,
body.theme-vintage .site-footer-owner,
body.theme-vintage .site-footer-rights,
body.theme-vintage .site-footer-links,
body.theme-vintage .site-footer-links a {
    color: rgba(255, 244, 214, .99) !important;
    text-shadow:
        0 1px 2px rgba(35, 20, 9, .96),
        0 0 7px rgba(35, 20, 9, .68) !important;
}

/* ==========================================================
   TOPBAR FIXE ET BANDEAU MODERNE LISIBLE
   ----------------------------------------------------------
   Objectif :
   - rendre la barre de menu réellement fixe au scroll ;
   - éviter qu'elle disparaisse ;
   - conserver l'espace en haut de page ;
   - corriger le texte blanc sur fond clair du bandeau visiteur.
   ========================================================== */

/* Barre de menu réellement fixe. */
.topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 5000 !important;
}

/* Compensation pour éviter que le contenu passe sous la barre fixe. */
body {
    padding-top: 82px;
}

@media (max-width: 760px) {
    body {
        padding-top: 118px;
    }
}

/* Bandeau visiteur moderne : texte sombre sur fond clair. */
body.theme-modern .public-access-box,
body.theme-modern .public-access-box p,
body.theme-modern .public-access-box strong,
body.theme-modern .public-access-content,
body.theme-modern .public-access-content p,
body.theme-modern .public-access-content strong {
    color: var(--ink, #1f2a1f) !important;
    text-shadow: none !important;
}

/* On garde le bouton lisible et séparé. */
body.theme-modern .public-access-box .btn,
body.theme-modern .public-access-actions .btn {
    text-shadow: none !important;
}

/* ==========================================================
   TOPBAR BOUTONS PLUS CARRES ET HERO REDUIT
   ----------------------------------------------------------
   Objectif :
   - boutons compte / connexion / inscription moins ovales ;
   - coins arrondis cohérents avec les autres boutons ;
   - suppression du petit bonhomme devant le pseudo ;
   - bandeau "Bibliothèque de scénarios" un peu moins haut.
   ========================================================== */

/* Boutons de la zone compte/connexion : moins pilule, plus bouton. */
.top-actions .btn,
.auth-links .btn,
.auth-links .user-badge,
.top-actions .user-badge {
    border-radius: 10px !important;
    min-height: 36px;
    padding: 8px 12px !important;
    line-height: 1.1;
}

/* Suppression des éventuelles icônes/pictos ajoutés devant le pseudo. */
.user-badge::before,
.auth-links .user-badge::before,
.top-actions .user-badge::before {
    content: none !important;
    display: none !important;
}

/* Aspect du badge compte plus proche d'un bouton classique. */
.user-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    border-radius: 10px !important;
    text-decoration: none;
}

/* Bandeau de titre un peu moins massif. */
.public-hero {
    padding-top: 22px !important;
    padding-bottom: 22px !important;
}

.public-hero h1 {
    margin-bottom: 8px;
}

.public-hero p {
    margin-top: 6px;
    margin-bottom: 0;
}

/* En mobile, on garde un peu d'air mais sans exagérer. */
@media (max-width: 760px) {
    .public-hero {
        padding-top: 18px !important;
        padding-bottom: 18px !important;
    }
}

/* ==========================================================
   INDEX - HERO EQUILIBRE ET ACTIONS DANS FILTRES
   ----------------------------------------------------------
   Objectif :
   - bandeau "Bibliothèque de scénarios" au juste milieu ;
   - supprimer le bloc surprise séparé ;
   - placer les actions surprise dans le bloc des filtres ;
   - garder le bouton Filtrer compact.
   ========================================================== */

.public-hero {
    padding-top: 28px !important;
    padding-bottom: 28px !important;
}

.public-hero h1 {
    margin-bottom: 10px;
}

.public-hero p {
    margin-top: 8px;
    margin-bottom: 0;
}

.scenario-filters .filter-submit {
    display: flex;
    align-items: flex-end;
    padding-top: 1.45rem;
}

.scenario-filters .filter-submit .btn {
    height: 38px;
    min-height: 38px;
    width: auto;
    min-width: 92px;
    padding-left: 16px;
    padding-right: 16px;
    margin: 0;
    white-space: nowrap;
}

.scenario-filters-surprise {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(77, 93, 54, .16);
}

.scenario-filters-surprise strong {
    margin-right: auto;
    font-size: .95rem;
}

.scenario-filters-surprise .random-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.scenario-filters-surprise .btn {
    white-space: nowrap;
}

body.theme-vintage .scenario-filters-surprise {
    border-top-color: rgba(58, 39, 21, .22);
}

@media (max-width: 900px) {
    .scenario-filters-surprise {
        align-items: stretch;
        flex-direction: column;
    }

    .scenario-filters-surprise strong {
        margin-right: 0;
    }

    .scenario-filters-surprise .random-actions {
        justify-content: stretch;
    }

    .scenario-filters-surprise .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 760px) {
    .public-hero {
        padding-top: 22px !important;
        padding-bottom: 22px !important;
    }

    .scenario-filters .filter-submit .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================
   INDEX - ACTIONS FILTRES MEME LIGNE
   ----------------------------------------------------------
   Objectif :
   - supprimer visuellement "Envie de surprise ?" ;
   - placer les boutons d'action sur la même ligne que Filtrer ;
   - caler les trois boutons à droite ;
   - corriger le chevauchement avec le bandeau Bibliothèque.
   ========================================================== */

/* Espace propre sous le bandeau titre avant les filtres. */
.public-hero {
    margin-bottom: 18px !important;
}

/* Le formulaire filtre ne doit pas remonter sur le bandeau. */
.scenario-filters {
    margin-top: 0 !important;
}

/* Nouvelle ligne d'actions : Filtrer à gauche, boutons à droite. */
.scenario-filters-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid rgba(77, 93, 54, .14);
}

.scenario-filters-actions > .btn {
    flex: 0 0 auto;
    min-width: 92px;
    height: 38px;
    min-height: 38px;
    padding-left: 16px;
    padding-right: 16px;
    white-space: nowrap;
}

.scenario-filters-actions .random-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

.scenario-filters-actions .random-actions .btn {
    white-space: nowrap;
}

/* Ancien bloc surprise : sécurité si une ancienne version reste en cache. */
.scenario-filters-surprise strong {
    display: none !important;
}

/* Thème ancien : même séparation, mais sépia. */
body.theme-vintage .scenario-filters-actions {
    border-top-color: rgba(58, 39, 21, .22);
}

/* Mobile : on empile proprement. */
@media (max-width: 900px) {
    .scenario-filters-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .scenario-filters-actions > .btn,
    .scenario-filters-actions .random-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .scenario-filters-actions .random-actions {
        width: 100%;
        margin-left: 0;
        justify-content: stretch;
    }
}

/* ==========================================================
   INDEX - FILTRES RAPPROCHES ET ACTIONS ALIGNEES
   ----------------------------------------------------------
   Objectif :
   - rapprocher le bloc filtres du bandeau Bibliothèque ;
   - supprimer le trait de séparation ;
   - mettre Filtrer + les trois boutons sur la même ligne ;
   - garder les trois boutons calés à droite.
   ========================================================== */

.public-hero {
    margin-bottom: 30px !important;
}

.scenario-filters {
    margin-top: 0 !important;
}

.scenario-filters-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0 !important;
}

.scenario-filters-actions > .btn {
    flex: 0 0 auto;
    min-width: 92px;
    height: 38px;
    min-height: 38px;
    padding-left: 16px;
    padding-right: 16px;
    margin: 0;
    white-space: nowrap;
}

.scenario-filters-actions .random-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

.scenario-filters-actions .random-actions .btn {
    white-space: nowrap;
}

/* Sécurité : ancien bloc et ancien titre surprise neutralisés. */
.scenario-filters-surprise {
    border-top: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.scenario-filters-surprise strong {
    display: none !important;
}

/* Thème ancien : pas de trait non plus. */
body.theme-vintage .scenario-filters-actions {
    border-top: 0 !important;
}

@media (max-width: 900px) {
    .scenario-filters-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .scenario-filters-actions > .btn,
    .scenario-filters-actions .random-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .scenario-filters-actions .random-actions {
        width: 100%;
        margin-left: 0;
        justify-content: stretch;
    }
}

/* ==========================================================
   INDEX - ACTION SURPRISE UNIQUE
   ----------------------------------------------------------
   Objectif :
   - garder Se connecter / s’inscrire sur une seule ligne ;
   - supprimer les actions inutiles dans les filtres ;
   - placer "Envie de surprise ?" + "Donne-moi un scénario"
     à droite de Filtrer, sur la même ligne.
   ========================================================== */

/* Bouton visiteur : une seule ligne. */
.public-access-actions .btn,
.public-register-card .btn,
a.btn[href="login.php"] {
    white-space: nowrap;
}

/* Ligne d'actions des filtres. */
.scenario-filters-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0 !important;
}

.scenario-filters-actions > .btn {
    flex: 0 0 auto;
    min-width: 92px;
    height: 38px;
    min-height: 38px;
    padding-left: 16px;
    padding-right: 16px;
    margin: 0;
    white-space: nowrap;
}

.scenario-random-inline {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
    white-space: nowrap;
}

.scenario-random-inline span {
    font-weight: 800;
    font-size: .92rem;
    opacity: .9;
}

.scenario-random-inline .btn {
    white-space: nowrap;
}

/* Nettoyage sécurité des anciennes actions. */
.scenario-filters-actions .random-actions {
    display: none !important;
}

@media (max-width: 900px) {
    .scenario-filters-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .scenario-filters-actions > .btn,
    .scenario-random-inline,
    .scenario-random-inline .btn {
        width: 100%;
        justify-content: center;
    }

    .scenario-random-inline {
        flex-direction: column;
        margin-left: 0;
        white-space: normal;
    }
}

/* ==========================================================
   INDEX - ACTIONS SUR LA MEME LIGNE SANS TOUCHER AUX FILTRES
   ----------------------------------------------------------
   Objectif :
   - revenir à la grille précédente des filtres ;
   - ne pas redimensionner/dessouder tous les champs ;
   - mettre seulement Filtrer + Envie de surprise ? +
     Donne-moi un scénario sur une même ligne ;
   - éviter la troisième ligne inutile.
   ========================================================== */

/*
   IMPORTANT :
   On ne force plus scenario-filters-actions à prendre toute la largeur.
   Il redevient un simple élément de la grille, comme les autres champs.
*/
.scenario-filters-actions {
    grid-column: auto !important;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 8px;
    margin: 0 !important;
    padding-top: 1.45rem !important;
    border: 0 !important;
    min-width: 0;
}

/* Bouton Filtrer compact. */
.scenario-filters-actions > .btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 76px;
    height: 38px;
    min-height: 38px;
    padding: 0 12px;
    margin: 0;
    white-space: nowrap;
}

/* Texte + bouton surprise sur la même ligne que Filtrer. */
.scenario-random-inline {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0;
    min-width: 0;
    white-space: nowrap;
}

.scenario-random-inline span {
    display: inline-block;
    font-size: .86rem;
    font-weight: 800;
    line-height: 38px;
    opacity: .9;
    white-space: nowrap;
}

.scenario-random-inline .btn {
    flex: 0 0 auto;
    height: 38px;
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
}

/*
   Si la place manque, on tasse seulement ce petit bloc,
   pas toute la grille des filtres.
*/
@media (max-width: 1180px) {
    .scenario-filters-actions {
        grid-column: 1 / -1 !important;
        justify-content: flex-end;
        padding-top: 0 !important;
    }
}

@media (max-width: 760px) {
    .scenario-filters-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .scenario-filters-actions > .btn,
    .scenario-random-inline,
    .scenario-random-inline .btn {
        width: 100%;
        justify-content: center;
    }

    .scenario-random-inline {
        flex-direction: column;
        white-space: normal;
    }

    .scenario-random-inline span {
        line-height: 1.2;
    }
}

/* ==========================================================
   INDEX - FILTRER ET SURPRISE DANS UN SEUL BLOC
   ----------------------------------------------------------
   Page concernée : index.php

   Objectif :
   - ne plus créer une ligne séparée pour "Envie de surprise" ;
   - mettre Filtrer + Envie de surprise + Donne-moi un scénario
     dans le même bloc de grille ;
   - ne pas modifier la grille générale des filtres.
   ========================================================== */

.scenario-filters .filter-submit-with-random {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding-top: 1.45rem;
    min-width: 0;
    white-space: nowrap;
}

.scenario-filters .filter-submit-with-random > .btn {
    flex: 0 0 auto;
    height: 38px;
    min-height: 38px;
    min-width: 76px;
    padding: 0 12px;
    margin: 0;
}

.scenario-filters .filter-submit-with-random .scenario-random-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
}

.scenario-filters .filter-submit-with-random .scenario-random-inline span {
    font-size: .84rem;
    font-weight: 800;
    line-height: 38px;
    white-space: nowrap;
}

.scenario-filters .filter-submit-with-random .scenario-random-inline .btn {
    height: 38px;
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
}

/* Sécurité : l'ancien bloc ne doit plus occuper de place si du cache le garde. */
.scenario-filters-surprise {
    display: none !important;
}

@media (max-width: 1180px) {
    .scenario-filters .filter-submit-with-random {
        grid-column: 1 / -1;
        justify-content: flex-end;
        padding-top: 0;
    }
}

@media (max-width: 760px) {
    .scenario-filters .filter-submit-with-random {
        align-items: stretch;
        flex-direction: column;
    }

    .scenario-filters .filter-submit-with-random > .btn,
    .scenario-filters .filter-submit-with-random .scenario-random-inline,
    .scenario-filters .filter-submit-with-random .scenario-random-inline .btn {
        width: 100%;
        justify-content: center;
    }

    .scenario-filters .filter-submit-with-random .scenario-random-inline {
        flex-direction: column;
        white-space: normal;
    }

    .scenario-filters .filter-submit-with-random .scenario-random-inline span {
        line-height: 1.2;
    }
}

/* ==========================================================
   INDEX - SURPRISE VRAIMENT A DROITE
   ----------------------------------------------------------
   Page concernée : index.php

   Structure attendue :
   <div class="filter-submit filter-submit-with-random">
       <button>Filtrer</button>
       <div class="scenario-random-inline">...</div>
   </div>

   Objectif :
   - garder Filtrer sur la même ligne ;
   - pousser Envie de surprise + Donne-moi un scénario
     le plus à droite possible ;
   - ne pas recréer de bloc séparé en dessous.
   ========================================================== */

.scenario-filters .filter-submit-with-random {
    grid-column: span 2;
    display: flex !important;
    align-items: flex-end;
    justify-content: space-between !important;
    gap: 18px;
    width: 100%;
    min-width: 0;
    padding-top: 1.45rem;
    border: 0 !important;
}

.scenario-filters .filter-submit-with-random > .btn {
    flex: 0 0 auto;
    height: 38px;
    min-height: 38px;
    min-width: 82px;
    padding: 0 14px;
    margin: 0;
    white-space: nowrap;
}

.scenario-filters .filter-submit-with-random .scenario-random-inline {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-end !important;
    gap: 8px;
    margin-left: auto !important;
    min-width: 0;
    white-space: nowrap;
}

.scenario-filters .filter-submit-with-random .scenario-random-inline span {
    flex: 0 0 auto;
    font-size: .86rem;
    font-weight: 800;
    line-height: 38px;
    white-space: nowrap;
}

.scenario-filters .filter-submit-with-random .scenario-random-inline .btn {
    flex: 0 0 auto;
    height: 38px;
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
}

/* L'ancien bloc séparé ne doit jamais reprendre de place. */
.scenario-filters-surprise {
    display: none !important;
}

/*
   Si la ligne manque de place, on laisse le bloc prendre toute la ligne,
   mais toujours avec Filtrer à gauche et Surprise à droite.
*/
@media (max-width: 1180px) {
    .scenario-filters .filter-submit-with-random {
        grid-column: 1 / -1;
        padding-top: 0;
    }
}

@media (max-width: 760px) {
    .scenario-filters .filter-submit-with-random {
        align-items: stretch;
        flex-direction: column;
    }

    .scenario-filters .filter-submit-with-random > .btn,
    .scenario-filters .filter-submit-with-random .scenario-random-inline,
    .scenario-filters .filter-submit-with-random .scenario-random-inline .btn {
        width: 100%;
        justify-content: center !important;
    }

    .scenario-filters .filter-submit-with-random .scenario-random-inline {
        flex-direction: column;
        margin-left: 0 !important;
        white-space: normal;
    }

    .scenario-filters .filter-submit-with-random .scenario-random-inline span {
        line-height: 1.2;
    }
}

/* ==========================================================
   INDEX - FILTRES DEUX LIGNES SANS CHEVAUCHEMENT
   ----------------------------------------------------------
   Page concernée : index.php

   Structure réelle :
   1 Recherche
   2 Points min
   3 Points max
   4 Théâtre
   5 Période
   6 Mission
   7 Format
   8 Système de jeu
   9 Filtrer + Envie de surprise + Donne-moi un scénario

   Objectif :
   - 2 lignes seulement ;
   - pas de chevauchement ;
   - Filtrer à gauche du bloc d'action ;
   - Envie de surprise + Donne-moi un scénario calés à droite.
   ========================================================== */

.scenario-filters {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) repeat(5, minmax(112px, 1fr));
    gap: 10px 12px;
    align-items: end;
}

/* Recherche plus large sur la première ligne. */
.scenario-filters > div:nth-of-type(1) {
    grid-column: span 2;
}

/*
   Le bloc d'action prend les 3 dernières colonnes de la deuxième ligne.
   Ça lui donne la largeur nécessaire pour éviter le chevauchement.
*/
.scenario-filters .filter-submit-with-random {
    grid-column: span 3 !important;
    display: flex !important;
    align-items: flex-end;
    justify-content: space-between !important;
    gap: 14px;
    width: 100%;
    min-width: 0;
    padding-top: 1.45rem;
    margin: 0 !important;
    border: 0 !important;
    white-space: nowrap;
}

.scenario-filters .filter-submit-with-random > .btn {
    flex: 0 0 auto;
    height: 38px;
    min-height: 38px;
    min-width: 82px;
    padding: 0 14px;
    margin: 0;
    white-space: nowrap;
}

/* Surprise vraiment à droite, mais dans une zone assez large. */
.scenario-filters .filter-submit-with-random .scenario-random-inline {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-end !important;
    gap: 8px;
    margin-left: auto !important;
    min-width: 0;
    white-space: nowrap;
}

.scenario-filters .filter-submit-with-random .scenario-random-inline span {
    flex: 0 0 auto;
    font-size: .86rem;
    font-weight: 800;
    line-height: 38px;
    white-space: nowrap;
}

.scenario-filters .filter-submit-with-random .scenario-random-inline .btn {
    flex: 0 0 auto;
    height: 38px;
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
}

/* L'ancien bloc séparé ne doit jamais reprendre de place. */
.scenario-filters-surprise {
    display: none !important;
}

/* Écrans moyens : on évite de forcer et on met les actions en pleine largeur. */
@media (max-width: 1180px) {
    .scenario-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .scenario-filters > div:nth-of-type(1) {
        grid-column: span 1;
    }

    .scenario-filters .filter-submit-with-random {
        grid-column: 1 / -1 !important;
        padding-top: 0;
    }
}

@media (max-width: 760px) {
    .scenario-filters {
        grid-template-columns: 1fr;
    }

    .scenario-filters .filter-submit-with-random {
        align-items: stretch;
        flex-direction: column;
    }

    .scenario-filters .filter-submit-with-random > .btn,
    .scenario-filters .filter-submit-with-random .scenario-random-inline,
    .scenario-filters .filter-submit-with-random .scenario-random-inline .btn {
        width: 100%;
        justify-content: center !important;
    }

    .scenario-filters .filter-submit-with-random .scenario-random-inline {
        flex-direction: column;
        margin-left: 0 !important;
        white-space: normal;
    }

    .scenario-filters .filter-submit-with-random .scenario-random-inline span {
        line-height: 1.2;
    }
}

/* ==========================================================
   RESPONSIVE LIGHT - TABLETTE ET MOBILE
   ----------------------------------------------------------
   Objectif :
   - alléger le site sur tablette/mobile ;
   - supprimer les fonds d'écran lourds sur petits écrans ;
   - garder les pages lisibles au bord d'une table de jeu ;
   - ne pas toucher aux fiches A4 ni à l'export PDF ;
   - ne pas modifier le desktop.
   ========================================================== */

/* Tablette : lisible, moins tassé, sans forcer tout en 1 colonne trop tôt. */
@media screen and (min-width: 761px) and (max-width: 1100px) {
    .scenario-list,
    .objectives-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        width: min(100% - 28px, 980px);
    }

    .scenario-filters,
    .objectives-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .filters {
        width: min(100% - 28px, 980px);
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .public-hero {
        padding: 34px 22px !important;
    }

    .public-hero h1 {
        font-size: clamp(34px, 5vw, 44px) !important;
    }

    .scenario-card img {
        height: 210px !important;
    }
}

/* Mobile et petite tablette : version light, plus rapide et plus lisible. */
@media screen and (max-width: 760px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    /*
       Fonds d'écran désactivés sur mobile :
       - moins lourd ;
       - moins de bugs avec background-attachment: fixed ;
       - meilleur confort au bord d'une table.
    */
    body.theme-modern,
    body.theme-vintage {
        background-attachment: scroll !important;
        background-image: linear-gradient(180deg, #f6f3eb 0%, #e8ddc7 100%) !important;
        background-size: auto !important;
        background-position: center top !important;
    }

    body.theme-modern::before,
    body.theme-modern::after,
    body.theme-vintage::before,
    body.theme-vintage::after {
        content: none !important;
        display: none !important;
    }

    /* Topbar compacte, avec navigation qui peut défiler horizontalement. */
    .topbar {
        height: auto !important;
        min-height: 64px !important;
        padding: 10px 12px !important;
        gap: 10px !important;
        align-items: center !important;
    }

    .brand {
        gap: 8px !important;
    }

    .brand-text {
        font-size: .82rem;
        line-height: 1.05;
    }

    .topbar nav,
    .main-nav {
        width: 100%;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        overflow-x: auto !important;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .topbar nav a,
    .main-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: .86rem;
    }

    .top-actions,
    .auth-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px !important;
        margin-left: 0 !important;
    }

    .top-actions .btn,
    .auth-links .btn,
    .user-badge,
    .user-name {
        min-height: 36px;
        padding: 0 10px !important;
        font-size: .84rem;
        border-radius: 8px !important;
    }

    /* Bandeau et filtres moins hauts. */
    .public-hero {
        padding: 24px 14px !important;
    }

    .public-hero h1 {
        font-size: clamp(28px, 10vw, 38px) !important;
        line-height: .95;
    }

    .public-hero p {
        font-size: .95rem;
        line-height: 1.35;
    }

    .filters {
        width: calc(100% - 20px);
        margin: 10px auto 18px !important;
        padding: 14px !important;
        border-radius: 10px;
    }

    .scenario-filters,
    .objectives-filters {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .scenario-filters .filter-submit,
    .scenario-filters .filter-submit-with-random {
        padding-top: 0 !important;
        width: 100% !important;
    }

    .scenario-filters .filter-submit .btn,
    .scenario-filters .filter-submit-with-random > .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Cartes scénario / objectifs en 1 colonne propre. */
    .scenario-list,
    .objectives-list {
        width: calc(100% - 20px);
        margin-left: auto !important;
        margin-right: auto !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .scenario-card,
    .objective-card {
        border-radius: 10px;
    }

    .scenario-card img {
        height: 175px !important;
    }

    .scenario-card .body,
    .objective-card-body {
        padding: 13px !important;
    }

    .tags {
        gap: 5px !important;
    }

    .tag,
    .badge,
    .pill {
        max-width: 100%;
        white-space: normal;
        text-align: center;
        line-height: 1.15;
    }

    .scenario-card-actions,
    .card-actions,
    .random-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .scenario-card-actions .btn,
    .card-actions .btn,
    .random-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Cartes d'accès / messages. */
    .random-box,
    .public-access-box,
    .public-register-card,
    .hidden-form,
    .legal-card,
    .card {
        width: calc(100% - 20px);
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .random-box {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 12px;
    }

    /* Formulaires : une colonne, champs confortables. */
    .grid.two,
    .grid.three {
        grid-template-columns: 1fr !important;
    }

    input,
    select,
    textarea {
        min-height: 42px;
        font-size: 16px; /* évite le zoom automatique iOS */
    }

    textarea {
        min-height: 140px;
    }

    /* Aperçu fiche : pas de casse, juste scroll horizontal propre. */
    .scenario-view-page,
    .preview-wrap,
    .scenario-preview-a4,
    .sheet-preview-a4,
    .sheet-preview,
    .pdf-preview,
    .print-preview {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
    }

    /* Footer mobile plus compact. */
    .site-footer {
        margin-top: 28px !important;
        padding: 18px 12px !important;
        font-size: .82rem;
    }

    .site-footer-links {
        gap: 5px !important;
    }
}

/* ==========================================================
   OBJECTIFS CACHES - TITRES VINTAGE BLANCS
   ----------------------------------------------------------
   Objectif :
   - uniquement en thème ancien ;
   - titres des cartes objectifs cachés en blanc ;
   - ne pas toucher aux backgrounds modernes ;
   - conserver la séparation déjà validée.
   ========================================================== */

body.theme-vintage .objective-card-header,
body.theme-vintage .objective-card-header h2,
body.theme-vintage .objective-card-header .objective-icon {
    color: #fff7dc !important;
}

body.theme-vintage .objective-card-header h2 {
    text-shadow:
        0 1px 2px rgba(42, 25, 11, .90),
        0 0 4px rgba(42, 25, 11, .62) !important;
}

/* ==========================================================
   THEME MODERNE - BACKGROUND RANDOM PILOTE PAR LE HEADER
   ----------------------------------------------------------
   Le CSS ne force plus d'image moderne fixe.
   Le header validé injecte directement theme-modern-bg-XX.png.
   ========================================================== */

/* ==========================================================
   OBJECTIFS CACHES - ESPACEMENT COMME INDEX
   ----------------------------------------------------------
   Objectif :
   - caler la page Objectifs cachés sur la respiration de l'index ;
   - créer le même espace entre le bandeau titre et le bloc suivant ;
   - éviter que "Objectifs cachés" soit collé à "Besoin d'un tirage équitable" ;
   - fonctionner en moderne et en ancien ;
   - ne toucher qu'aux espacements de cette page.
   ========================================================== */

.public-hero + .objectives-filters-merged-actions,
.public-hero + .objectives-access-box {
    margin-top: 28px !important;
}

.objectives-filters-merged-actions {
    max-width: 1260px !important;
    margin-right: auto !important;
    margin-bottom: 28px !important;
    margin-left: auto !important;
    align-items: end !important;
    clear: both !important;
}

.public-hero + .objectives-filters-merged-actions {
    margin-top: 28px !important;
}

.objectives-filter-actions-line {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding-bottom: 12px !important;
    margin-bottom: 6px !important;
    border-bottom: 1px dashed rgba(38, 51, 22, .22) !important;
}

.objectives-filter-actions-line strong {
    font-size: .95rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--olive);
}

.objectives-filter-actions-line .random-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

.objectives-filter-actions-line .btn {
    white-space: nowrap;
}

.objectives-access-box {
    max-width: 1260px !important;
    margin-right: auto !important;
    margin-bottom: 28px !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
    clear: both !important;
}

.public-hero + .objectives-access-box {
    margin-top: 28px !important;
}

.objectives-access-box .public-access-content {
    min-width: 0;
}

.objectives-access-box .public-access-content strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.objectives-access-box .public-access-content p {
    margin: 0;
    line-height: 1.45;
}

.objectives-access-box .public-access-actions {
    flex: 0 0 auto;
}

.objectives-page-list,
.objectives-access-box + .objectives-page-list,
.objectives-filters-merged-actions + .objectives-page-list {
    margin-top: 28px !important;
    clear: both !important;
}

body.theme-vintage .objectives-filter-actions-line {
    border-bottom-color: rgba(58, 39, 21, .26) !important;
}

body.theme-vintage .objectives-filter-actions-line strong {
    color: #3e2916;
}

body.theme-modern .objectives-access-box,
body.theme-modern .objectives-filters-merged-actions,
body.theme-vintage .objectives-access-box,
body.theme-vintage .objectives-filters-merged-actions {
    position: relative;
    z-index: 1;
}

@media (max-width: 760px) {
    .public-hero + .objectives-filters-merged-actions,
    .public-hero + .objectives-access-box {
        margin-top: 20px !important;
    }

    .objectives-access-box,
    .objectives-filters-merged-actions {
        width: calc(100% - 20px) !important;
        margin-right: auto !important;
        margin-bottom: 20px !important;
        margin-left: auto !important;
    }

    .objectives-access-box,
    .objectives-filter-actions-line {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .objectives-access-box .public-access-actions,
    .objectives-access-box .public-access-actions .btn,
    .objectives-filter-actions-line .random-actions,
    .objectives-filter-actions-line .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .objectives-filter-actions-line .random-actions {
        margin-left: 0 !important;
        flex-direction: column !important;
    }

    .objectives-page-list,
    .objectives-access-box + .objectives-page-list,
    .objectives-filters-merged-actions + .objectives-page-list {
        margin-top: 20px !important;
    }
}

/* ==========================================================
   OBJECTIFS CACHES - BLOC TIRAGE PLUS FIN
   ----------------------------------------------------------
   Objectif :
   - conserver l'espacement validé sous le bandeau Objectifs cachés ;
   - rendre la ligne "Besoin d'un tirage équitable ?" plus fine ;
   - se rapprocher du rendu compact de l'index/scénarios ;
   - ne toucher qu'à la page Objectifs cachés.
   ========================================================== */

.objectives-filters-merged-actions {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.objectives-filter-actions-line {
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 8px !important;
    margin-bottom: 8px !important;
    gap: 8px !important;
}

.objectives-filter-actions-line strong {
    font-size: .88rem !important;
    line-height: 1.15 !important;
    margin: 0 !important;
}

.objectives-filter-actions-line .random-actions {
    gap: 6px !important;
}

.objectives-filter-actions-line .btn {
    min-height: 34px !important;
    padding: 7px 12px !important;
    font-size: .88rem !important;
    line-height: 1.1 !important;
}

/* Les champs de filtre restent alignés et ne gonflent pas le bloc. */
.objectives-filters-merged-actions label {
    margin-bottom: 5px !important;
}

.objectives-filters-merged-actions input,
.objectives-filters-merged-actions select {
    min-height: 38px !important;
}

.objectives-filters-merged-actions > .btn {
    min-height: 38px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

/* Thème ancien : même finesse, sans modifier les couleurs générales. */
body.theme-vintage .objectives-filter-actions-line .btn {
    min-height: 34px !important;
}

/* Mobile : compact mais encore confortable au doigt. */
@media (max-width: 760px) {
    .objectives-filters-merged-actions {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    .objectives-filter-actions-line {
        padding-bottom: 10px !important;
        margin-bottom: 10px !important;
    }

    .objectives-filter-actions-line .btn {
        min-height: 40px !important;
        padding: 9px 12px !important;
    }
}

/* ==========================================================
   MODE MOBILE JOUEUR
   ----------------------------------------------------------
   Objectif :
   - conserver le desktop actuel intact ;
   - rendre le site utilisable autour d'une table ;
   - privilégier lecture, recherche, connexion, scénarios,
     objectifs cachés et tirage caché ;
   - masquer le superflu sur téléphone ;
   - désactiver les fonds lourds sur mobile.
   ========================================================== */

@media (max-width: 860px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden !important;
    }

    body {
        font-size: 16px;
        line-height: 1.45;
    }

    body.theme-modern,
    body.theme-vintage {
        background-attachment: scroll !important;
        background-size: auto !important;
    }

    body.theme-modern {
        background-image: linear-gradient(180deg, #f6f3eb 0%, #e8ddc7 100%) !important;
    }

    body.theme-vintage {
        background-image: linear-gradient(180deg, #d8c39a 0%, #aa8755 100%) !important;
    }

    body.theme-modern::before,
    body.theme-modern::after,
    body.theme-vintage::before,
    body.theme-vintage::after {
        display: none !important;
        content: none !important;
    }

    .topbar {
        position: relative !important;
        top: auto !important;
        z-index: 50 !important;
        min-height: 0 !important;
        padding: 8px 10px !important;
        gap: 8px !important;
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        align-items: center !important;
    }

    .brand {
        min-width: 0 !important;
        gap: 8px !important;
    }

    .brand-logo,
    .brand-logo img,
    .logo.brand-logo,
    .logo.brand-logo img {
        width: 34px !important;
        height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
    }

    .brand-text {
        font-size: .78rem !important;
        line-height: 1.05 !important;
        white-space: normal !important;
    }

    .mobile-menu-toggle {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        justify-self: end !important;
        width: 42px !important;
        height: 38px !important;
        border-radius: 10px !important;
        border: 1px solid rgba(255,255,255,.38) !important;
        background: rgba(0,0,0,.18) !important;
        color: #fff !important;
        font-size: 1.35rem !important;
        font-weight: 900 !important;
        cursor: pointer !important;
    }

    .topbar .main-nav,
    .topbar .top-actions {
        grid-column: 1 / -1 !important;
        display: none !important;
        width: 100% !important;
    }

    body.mobile-menu-open .topbar .main-nav,
    body.mobile-menu-open .topbar .top-actions {
        display: flex !important;
    }

    .main-nav {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
        margin-top: 8px !important;
    }

    .main-nav a {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 10px 12px !important;
        font-size: .92rem !important;
        min-height: 40px !important;
    }

    .main-nav a[href*="contribute_scenario"],
    .main-nav a[href*="contribute_objective"] {
        display: none !important;
    }

    .top-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        margin-top: 8px !important;
    }

    .top-actions .btn,
    .top-actions .user-badge {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        min-height: 40px !important;
    }

    .lfm-top-switchers {
        justify-content: center !important;
        width: 100% !important;
    }

    main,
    .public-hero,
    .filters,
    .random-box,
    .public-access-box,
    .hidden-form,
    .legal-page,
    .legal-card,
    .card,
    .scenario-contribution-form,
    .scenario-contribution-main,
    .objectives-access-box,
    .objectives-filters-merged-actions {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }

    .public-hero {
        margin-top: 14px !important;
        margin-bottom: 14px !important;
        padding: 16px 14px !important;
    }

    .public-hero h1 {
        font-size: 1.55rem !important;
        line-height: 1.1 !important;
    }

    .public-hero p {
        font-size: .98rem !important;
    }

    .mobile-filter-toggle {
        display: inline-flex !important;
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        margin: 10px auto 8px !important;
        justify-content: center !important;
        align-items: center !important;
        min-height: 42px !important;
    }

    .filters {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        padding: 12px !important;
        margin-top: 8px !important;
        margin-bottom: 16px !important;
    }

    .filters:not(.is-mobile-open) > *:not(:first-child):not(.mobile-filter-keep) {
        display: none !important;
    }

    .filters > div,
    .filters > button,
    .filters > .btn,
    .filters input,
    .filters select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .filters label {
        font-size: .86rem !important;
        margin-bottom: 4px !important;
    }

    .filters input,
    .filters select {
        min-height: 42px !important;
        font-size: 1rem !important;
    }

    a[href*="export"],
    a[href*="pdf"],
    a[href*="print"],
    button[onclick*="print"],
    .btn[href*="export"],
    .btn[href*="pdf"],
    .btn[href*="print"] {
        display: none !important;
    }

    .scenario-actions,
    .random-actions,
    .hidden-objectives-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    .scenario-actions .btn,
    .random-actions .btn,
    .hidden-objectives-actions .btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 42px !important;
    }

    .scenarios-list,
    .objectives-list,
    .grid,
    .grid.two {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .scenario-card,
    .objective-card,
    article,
    .card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .scenario-card h2,
    .objective-card h2,
    .card h2 {
        font-size: 1.12rem !important;
        line-height: 1.2 !important;
    }

    .scenario-card p,
    .objective-card p,
    .objective-card-body,
    .scenario-card .body {
        font-size: .96rem !important;
        line-height: 1.45 !important;
    }

    img,
    .scenario-card img,
    .scenario-image,
    .battlefield-image,
    .scenario-sheet img {
        max-width: 100% !important;
        height: auto !important;
        box-sizing: border-box !important;
    }

    .scenario-card img,
    .scenario-image img,
    .battlefield-image img,
    .scenario-sheet img {
        cursor: zoom-in !important;
        border-radius: 12px !important;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    textarea {
        min-height: 140px !important;
    }

    .hidden-form {
        margin-top: 18px !important;
        padding: 16px 14px !important;
    }

    .player-email-input-line {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .legal-page {
        padding: 0 !important;
    }

    .legal-card {
        padding: 16px 14px !important;
    }

    .contact-form .grid.two {
        grid-template-columns: 1fr !important;
    }

    .site-footer {
        margin-top: 24px !important;
        padding: 18px 12px !important;
    }

    .site-footer-inner,
    .site-footer-links {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 6px !important;
        text-align: center !important;
    }

    .site-footer-links span {
        display: none !important;
    }

    .rgpd-banner {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        width: auto !important;
        max-width: none !important;
    }

    .rgpd-banner-inner {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .rgpd-banner-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .rgpd-banner-actions .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

.mobile-menu-toggle,
.mobile-filter-toggle {
    display: none;
}

.mobile-image-zoom {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(0, 0, 0, .88);
}

.mobile-image-zoom.is-open {
    display: flex;
}

.mobile-image-zoom img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    touch-action: pinch-zoom;
    cursor: zoom-out;
}

.mobile-image-zoom-close {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 10000;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    color: #111;
    font-size: 1.4rem;
    font-weight: 900;
}

/* ==========================================================
   MODE MOBILE JOUEUR - CORRECTION INTERFACE TABLE
   ----------------------------------------------------------
   Objectif :
   - remettre le header mobile vraiment en haut ;
   - rendre la connexion/inscription centrale sur mobile déconnecté ;
   - supprimer toute notion de PDF, impression, téléchargement ;
   - garder uniquement la consultation scénario et les objectifs/tirages utiles ;
   - ne pas toucher au desktop.
   ========================================================== */

@media (max-width: 860px) {
    body {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Header mobile compact, en haut de page, non figé. */
    .topbar {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
        padding: 6px 10px !important;
        min-height: 48px !important;
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .brand {
        margin: 0 !important;
        padding: 0 !important;
        min-width: 0 !important;
    }

    .brand-logo,
    .brand-logo img,
    .logo.brand-logo,
    .logo.brand-logo img {
        width: 32px !important;
        height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
    }

    .brand-text {
        font-size: .74rem !important;
        line-height: 1.02 !important;
    }

    .mobile-menu-toggle {
        width: 40px !important;
        height: 36px !important;
        min-height: 36px !important;
        margin: 0 !important;
    }

    /* On remonte les premiers blocs après le header. */
    .public-hero,
    .hidden-form,
    .legal-page {
        margin-top: 10px !important;
    }

    .public-hero {
        padding-top: 14px !important;
        padding-bottom: 14px !important;
    }

    /* Mobile déconnecté : l'accueil sert de porte d'entrée, pas de bibliothèque complète. */
    body.mobile-logged-out .scenarios-list,
    body.mobile-logged-out .objectives-list,
    body.mobile-logged-out .scenario-card,
    body.mobile-logged-out .objective-card {
        display: none !important;
    }

    body.mobile-logged-out .public-access-box,
    body.mobile-logged-out .random-box.public-access-box {
        display: flex !important;
        margin-top: 12px !important;
        margin-bottom: 14px !important;
    }

    body.mobile-logged-out .public-access-box .random-actions,
    body.mobile-logged-out .public-access-box .public-access-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    body.mobile-logged-out .public-access-box .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Menu mobile joueur : on supprime le superflu. */
    .main-nav a[href*="contribute"],
    .main-nav a[href*="admin"],
    .main-nav a[href*="export"],
    .main-nav a[href*="pdf"],
    .main-nav a[href*="print"] {
        display: none !important;
    }

    /* Suppression très large de toutes les notions export / PDF / impression / téléchargement. */
    a[href*="export"],
    a[href*="pdf"],
    a[href*="print"],
    a[href*="download"],
    a[href*="telecharg"],
    a[href*="télécharg"],
    button[onclick*="print"],
    button[onclick*="pdf"],
    button[onclick*="export"],
    .btn[href*="export"],
    .btn[href*="pdf"],
    .btn[href*="print"],
    .btn[href*="download"],
    .export-button,
    .pdf-button,
    .print-button,
    .download-button {
        display: none !important;
    }

    .mobile-hidden-by-text {
        display: none !important;
    }

    /* Les cartes scénario ne doivent jamais dépasser le téléphone. */
    .scenario-card,
    .objective-card,
    .scenario-sheet,
    .scenario-content,
    .scenario-body,
    .scenario-detail,
    .scenario-page,
    .scenario-main,
    .scenario-section {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    .scenario-card *,
    .objective-card *,
    .scenario-sheet *,
    .scenario-content *,
    .scenario-body * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Image de scénario : décor conservé, mais jamais envahissant. */
    .scenario-card img,
    .scenario-image img,
    .battlefield-image img,
    .scenario-sheet img {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 42vh !important;
        object-fit: contain !important;
        cursor: zoom-in !important;
    }

    /* Filtres : recherche d'abord, reste derrière bouton. */
    .filters {
        margin-top: 8px !important;
    }

    .filters:not(.is-mobile-open) > *:not(.mobile-filter-keep) {
        display: none !important;
    }

    .mobile-filter-toggle {
        margin-top: 6px !important;
        margin-bottom: 6px !important;
    }

    /* Boutons utiles en mobile : voir seulement. */
    .scenario-actions .btn:not([href*="scenario"]):not([href*="view"]):not([href*="voir"]) {
        display: none !important;
    }

    /* Si les boutons d'actions n'ont pas de href distinctif, le JS nettoiera par texte. */
}

/* ==========================================================
   MODE MOBILE JOUEUR - ACCES COMPLET UNIQUEMENT
   ----------------------------------------------------------
   Objectif :
   - mobile déconnecté : supprimer le bloc "Envie d'en voir plus"
     et le texte "trois scénarios..." ;
   - garder uniquement le bloc "Accès complet à la bibliothèque"
     avec connexion / inscription ;
   - ne pas toucher au desktop.
   ========================================================== */

@media (max-width: 860px) {
    /*
       Sur l'index mobile déconnecté, le bloc intermédiaire
       "Envie d'en voir plus ?" n'a plus d'intérêt.
    */
    body.mobile-logged-out .random-box.public-access-box,
    body.mobile-logged-out .public-access-box:not(.public-register-card) {
        display: none !important;
    }

    /*
       On garde le vrai bloc final d'accès complet.
       Il devient le seul appel à connexion / inscription.
    */
    body.mobile-logged-out .public-register-card,
    body.mobile-logged-out .public-access-card,
    body.mobile-logged-out .full-access-card {
        display: block !important;
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        margin: 12px auto 18px !important;
        padding: 16px 14px !important;
        box-sizing: border-box !important;
    }

    body.mobile-logged-out .public-register-card h2,
    body.mobile-logged-out .public-access-card h2,
    body.mobile-logged-out .full-access-card h2 {
        margin-top: 0 !important;
        font-size: 1.25rem !important;
        line-height: 1.15 !important;
    }

    body.mobile-logged-out .public-register-card p,
    body.mobile-logged-out .public-access-card p,
    body.mobile-logged-out .full-access-card p {
        font-size: .96rem !important;
        line-height: 1.4 !important;
    }

    body.mobile-logged-out .public-register-card .btn,
    body.mobile-logged-out .public-access-card .btn,
    body.mobile-logged-out .full-access-card .btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 42px !important;
    }
}

/* ==========================================================
   MODE MOBILE JOUEUR - PAGE SCENARIO DETAIL
   ----------------------------------------------------------
   Objectif :
   - quand on clique sur "Voir le scénario", la page détail
     ne doit jamais dépasser la largeur du téléphone ;
   - réduire l'image du scénario mais la garder zoomable ;
   - empiler toutes les cellules/colonnes ;
   - masquer les actions PDF / impression / export ;
   - ne pas toucher au desktop.
   ========================================================== */

@media (max-width: 860px) {
    /* Conteneurs probables de la page scénario. */
    .scenario-page,
    .scenario-detail,
    .scenario-content,
    .scenario-main,
    .scenario-wrapper,
    .scenario-sheet,
    .scenario-view,
    .scenario-layout,
    .scenario-print,
    .scenario-document,
    .scenario-public,
    .scenario-container,
    .scenario-inner,
    main.scenario-page,
    main.scenario-detail,
    main.scenario-sheet {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        min-width: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Tout bloc interne doit rentrer dans l'écran. */
    .scenario-page *,
    .scenario-detail *,
    .scenario-content *,
    .scenario-main *,
    .scenario-wrapper *,
    .scenario-sheet *,
    .scenario-view *,
    .scenario-layout *,
    .scenario-print *,
    .scenario-document *,
    .scenario-public *,
    .scenario-container *,
    .scenario-inner * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Toutes les grilles/colonnes de la fiche passent en une seule colonne. */
    .scenario-page .grid,
    .scenario-detail .grid,
    .scenario-content .grid,
    .scenario-main .grid,
    .scenario-sheet .grid,
    .scenario-page .two,
    .scenario-detail .two,
    .scenario-content .two,
    .scenario-main .two,
    .scenario-sheet .two,
    .scenario-page [class*="grid"],
    .scenario-detail [class*="grid"],
    .scenario-sheet [class*="grid"],
    .scenario-page [class*="column"],
    .scenario-detail [class*="column"],
    .scenario-sheet [class*="column"],
    .scenario-page [class*="cols"],
    .scenario-detail [class*="cols"],
    .scenario-sheet [class*="cols"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 12px !important;
    }

    /* Sections lisibles en pile verticale. */
    .scenario-page section,
    .scenario-detail section,
    .scenario-content section,
    .scenario-main section,
    .scenario-sheet section,
    .scenario-page .card,
    .scenario-detail .card,
    .scenario-content .card,
    .scenario-main .card,
    .scenario-sheet .card,
    .scenario-page article,
    .scenario-detail article,
    .scenario-sheet article {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 14px 12px !important;
        overflow: hidden !important;
    }

    /* Titres de fiche plus compacts. */
    .scenario-page h1,
    .scenario-detail h1,
    .scenario-content h1,
    .scenario-main h1,
    .scenario-sheet h1 {
        font-size: 1.45rem !important;
        line-height: 1.12 !important;
        overflow-wrap: anywhere !important;
    }

    .scenario-page h2,
    .scenario-detail h2,
    .scenario-content h2,
    .scenario-main h2,
    .scenario-sheet h2 {
        font-size: 1.12rem !important;
        line-height: 1.18 !important;
        overflow-wrap: anywhere !important;
    }

    .scenario-page h3,
    .scenario-detail h3,
    .scenario-content h3,
    .scenario-main h3,
    .scenario-sheet h3 {
        font-size: 1rem !important;
        line-height: 1.18 !important;
    }

    /* Texte : aucune ligne ne doit forcer la largeur. */
    .scenario-page p,
    .scenario-detail p,
    .scenario-content p,
    .scenario-main p,
    .scenario-sheet p,
    .scenario-page li,
    .scenario-detail li,
    .scenario-sheet li,
    .scenario-page div,
    .scenario-detail div,
    .scenario-sheet div {
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    /* Images du scénario : importantes, mais pas envahissantes. */
    .scenario-page img,
    .scenario-detail img,
    .scenario-content img,
    .scenario-main img,
    .scenario-sheet img,
    .battlefield-image img,
    .scenario-image img {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 44vh !important;
        object-fit: contain !important;
        margin-left: auto !important;
        margin-right: auto !important;
        cursor: zoom-in !important;
    }

    /* Tables éventuelles : plutôt scroll interne que page éclatée. */
    .scenario-page table,
    .scenario-detail table,
    .scenario-content table,
    .scenario-main table,
    .scenario-sheet table {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        overflow-x: auto !important;
        white-space: normal !important;
    }

    .scenario-page th,
    .scenario-page td,
    .scenario-detail th,
    .scenario-detail td,
    .scenario-sheet th,
    .scenario-sheet td {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    /* Les blocs flex desktop deviennent verticaux. */
    .scenario-page [class*="row"],
    .scenario-detail [class*="row"],
    .scenario-sheet [class*="row"],
    .scenario-page [class*="meta"],
    .scenario-detail [class*="meta"],
    .scenario-sheet [class*="meta"],
    .scenario-page [class*="actions"],
    .scenario-detail [class*="actions"],
    .scenario-sheet [class*="actions"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    /* Actions : on garde seulement la consultation. */
    .scenario-page a[href*="export"],
    .scenario-page a[href*="pdf"],
    .scenario-page a[href*="print"],
    .scenario-page a[href*="download"],
    .scenario-detail a[href*="export"],
    .scenario-detail a[href*="pdf"],
    .scenario-detail a[href*="print"],
    .scenario-detail a[href*="download"],
    .scenario-sheet a[href*="export"],
    .scenario-sheet a[href*="pdf"],
    .scenario-sheet a[href*="print"],
    .scenario-sheet a[href*="download"],
    .scenario-page button[onclick*="print"],
    .scenario-detail button[onclick*="print"],
    .scenario-sheet button[onclick*="print"] {
        display: none !important;
    }

    /* Boutons restants utilisables au doigt. */
    .scenario-page .btn,
    .scenario-detail .btn,
    .scenario-sheet .btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 42px !important;
    }
}

/* ==========================================================
   MODE MOBILE JOUEUR - SCENARIO DETAIL FORCE
   ----------------------------------------------------------
   Objectif :
   - correction forte de la page scenario.php ;
   - aucune fiche scénario ne doit dépasser la largeur du téléphone ;
   - écrase les largeurs fixes desktop uniquement sur mobile ;
   - garde l'image visible, réduite et zoomable ;
   - ne touche pas au desktop.
   ========================================================== */

@media (max-width: 860px) {
    body.mobile-scenario-detail {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /*
       Correction forte : sur la page détail scénario uniquement,
       on neutralise les largeurs fixes et min-width héritées du desktop.
    */
    body.mobile-scenario-detail main,
    body.mobile-scenario-detail main *,
    body.mobile-scenario-detail .scenario,
    body.mobile-scenario-detail .scenario *,
    body.mobile-scenario-detail [class*="scenario"],
    body.mobile-scenario-detail [class*="scenario"] *,
    body.mobile-scenario-detail [class*="sheet"],
    body.mobile-scenario-detail [class*="sheet"] *,
    body.mobile-scenario-detail [class*="mission"],
    body.mobile-scenario-detail [class*="mission"] *,
    body.mobile-scenario-detail [class*="battle"],
    body.mobile-scenario-detail [class*="battle"] *,
    body.mobile-scenario-detail [class*="print"],
    body.mobile-scenario-detail [class*="print"] * {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.mobile-scenario-detail main,
    body.mobile-scenario-detail .scenario,
    body.mobile-scenario-detail [class*="scenario"],
    body.mobile-scenario-detail [class*="sheet"],
    body.mobile-scenario-detail [class*="print"] {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        overflow-x: hidden !important;
    }

    /*
       Les éléments qui ont un width inline ou une largeur A4 fixe
       doivent être ramenés à la largeur mobile.
    */
    body.mobile-scenario-detail [style*="width"],
    body.mobile-scenario-detail [style*="min-width"],
    body.mobile-scenario-detail [style*="max-width"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /*
       Les grandes mises en page desktop deviennent verticales.
    */
    body.mobile-scenario-detail .grid,
    body.mobile-scenario-detail .grid.two,
    body.mobile-scenario-detail [class*="grid"],
    body.mobile-scenario-detail [class*="cols"],
    body.mobile-scenario-detail [class*="columns"],
    body.mobile-scenario-detail [class*="layout"],
    body.mobile-scenario-detail [class*="row"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 12px !important;
    }

    /*
       Cartes/sections : pleine largeur, padding mobile.
    */
    body.mobile-scenario-detail section,
    body.mobile-scenario-detail article,
    body.mobile-scenario-detail .card,
    body.mobile-scenario-detail [class*="block"],
    body.mobile-scenario-detail [class*="section"],
    body.mobile-scenario-detail [class*="panel"] {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        overflow-x: hidden !important;
    }

    /*
       Image de scénario : on la conserve, elle installe le décor.
       Elle est réduite dans la page, puis zoomable au toucher via JS.
    */
    body.mobile-scenario-detail img {
        display: block !important;
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 42vh !important;
        object-fit: contain !important;
        margin-left: auto !important;
        margin-right: auto !important;
        cursor: zoom-in !important;
    }

    body.mobile-scenario-detail picture,
    body.mobile-scenario-detail figure {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow: hidden !important;
    }

    /*
       Titres et textes : aucune ligne ne doit forcer le débordement.
    */
    body.mobile-scenario-detail h1 {
        font-size: 1.45rem !important;
        line-height: 1.12 !important;
        overflow-wrap: anywhere !important;
    }

    body.mobile-scenario-detail h2 {
        font-size: 1.12rem !important;
        line-height: 1.18 !important;
        overflow-wrap: anywhere !important;
    }

    body.mobile-scenario-detail h3,
    body.mobile-scenario-detail h4 {
        font-size: 1rem !important;
        line-height: 1.18 !important;
        overflow-wrap: anywhere !important;
    }

    body.mobile-scenario-detail p,
    body.mobile-scenario-detail li,
    body.mobile-scenario-detail div,
    body.mobile-scenario-detail span,
    body.mobile-scenario-detail td,
    body.mobile-scenario-detail th {
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    /*
       Tables et blocs préformatés : scroll interne,
       jamais élargissement de toute la page.
    */
    body.mobile-scenario-detail table,
    body.mobile-scenario-detail pre,
    body.mobile-scenario-detail code {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        white-space: normal !important;
    }

    /*
       Si une fiche complète est conçue comme une page imprimée,
       on la transforme en document mobile au lieu de la réduire par zoom global.
    */
    body.mobile-scenario-detail [class*="a4"],
    body.mobile-scenario-detail [class*="A4"],
    body.mobile-scenario-detail [class*="page"],
    body.mobile-scenario-detail [class*="document"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        transform: none !important;
        zoom: 1 !important;
        overflow-x: hidden !important;
    }

    /*
       Actions inutiles sur mobile scénario.
    */
    body.mobile-scenario-detail a[href*="export"],
    body.mobile-scenario-detail a[href*="pdf"],
    body.mobile-scenario-detail a[href*="print"],
    body.mobile-scenario-detail a[href*="download"],
    body.mobile-scenario-detail button[onclick*="print"],
    body.mobile-scenario-detail button[onclick*="pdf"],
    body.mobile-scenario-detail button[onclick*="export"],
    body.mobile-scenario-detail .export-button,
    body.mobile-scenario-detail .pdf-button,
    body.mobile-scenario-detail .print-button,
    body.mobile-scenario-detail .download-button {
        display: none !important;
    }
}

/* ==========================================================
   MODE MOBILE JOUEUR - LECTURE SCENARIO SIMPLIFIEE
   ----------------------------------------------------------
   Objectif :
   - ne plus tenter d'afficher la fiche desktop sur téléphone ;
   - créer une lecture mobile simple, sans cadres inutiles ;
   - garder uniquement titre, infos utiles, image, sections texte ;
   - image pleine largeur proportionnée et zoomable ;
   - desktop inchangé.
   ========================================================== */

@media (max-width: 860px) {
    body.mobile-scenario-detail.mobile-reader-ready main > *:not(.mobile-scenario-reader),
    body.mobile-scenario-detail.mobile-reader-ready .scenario-sheet,
    body.mobile-scenario-detail.mobile-reader-ready .scenario-page,
    body.mobile-scenario-detail.mobile-reader-ready .scenario-detail,
    body.mobile-scenario-detail.mobile-reader-ready .scenario-document,
    body.mobile-scenario-detail.mobile-reader-ready .scenario-print,
    body.mobile-scenario-detail.mobile-reader-ready .scenario-public,
    body.mobile-scenario-detail.mobile-reader-ready .scenario-container,
    body.mobile-scenario-detail.mobile-reader-ready .scenario-wrapper {
        display: none !important;
    }

    body.mobile-scenario-detail .mobile-scenario-reader {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 10px auto 22px !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        overflow-x: hidden !important;
    }

    body.mobile-scenario-detail .mobile-scenario-title {
        width: calc(100% - 20px) !important;
        margin: 12px auto 8px !important;
        padding: 0 !important;
        font-size: 1.55rem !important;
        line-height: 1.08 !important;
        text-align: center !important;
        color: var(--ink, #18210e) !important;
        overflow-wrap: anywhere !important;
    }

    body.theme-vintage.mobile-scenario-detail .mobile-scenario-title {
        color: #2b1b0d !important;
    }

    body.mobile-scenario-detail .mobile-scenario-meta {
        width: calc(100% - 20px) !important;
        margin: 0 auto 12px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px !important;
        padding: 0 !important;
    }

    body.mobile-scenario-detail .mobile-scenario-pill {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 28px !important;
        padding: 5px 9px !important;
        border-radius: 999px !important;
        background: rgba(38, 51, 22, .12) !important;
        color: var(--ink, #18210e) !important;
        font-size: .86rem !important;
        font-weight: 800 !important;
        line-height: 1.1 !important;
    }

    body.theme-vintage.mobile-scenario-detail .mobile-scenario-pill {
        background: rgba(58, 39, 21, .18) !important;
        color: #2b1b0d !important;
    }

    body.mobile-scenario-detail .mobile-scenario-image-wrap {
        width: 100% !important;
        max-width: 100% !important;
        margin: 10px 0 14px !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }

    body.mobile-scenario-detail .mobile-scenario-image-wrap img {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        margin: 0 auto !important;
        border-radius: 0 !important;
        cursor: zoom-in !important;
    }

    body.mobile-scenario-detail .mobile-scenario-section {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 14px !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        box-sizing: border-box !important;
    }

    body.mobile-scenario-detail .mobile-scenario-section-title {
        display: block !important;
        width: 100% !important;
        margin: 0 0 8px !important;
        padding: 9px 12px !important;
        box-sizing: border-box !important;
        background: var(--olive, #263316) !important;
        color: #fff !important;
        text-align: center !important;
        font-size: .98rem !important;
        font-weight: 900 !important;
        text-transform: uppercase !important;
        letter-spacing: .04em !important;
        line-height: 1.15 !important;
    }

    body.theme-vintage.mobile-scenario-detail .mobile-scenario-section-title {
        background: #4a2f18 !important;
        color: #fff7dc !important;
    }

    body.mobile-scenario-detail .mobile-scenario-section-content {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        margin: 0 auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        font-size: 1rem !important;
        line-height: 1.5 !important;
        color: var(--ink, #18210e) !important;
        overflow-wrap: anywhere !important;
    }

    body.theme-vintage.mobile-scenario-detail .mobile-scenario-section-content {
        color: #2b1b0d !important;
    }

    body.mobile-scenario-detail .mobile-scenario-section-content p {
        margin: 0 0 10px !important;
    }

    body.mobile-scenario-detail .mobile-scenario-section-content ul,
    body.mobile-scenario-detail .mobile-scenario-section-content ol {
        padding-left: 20px !important;
    }

    body.mobile-scenario-detail .mobile-scenario-section-content * {
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-wrap: anywhere !important;
    }

    body.mobile-scenario-detail .mobile-scenario-empty {
        width: calc(100% - 20px) !important;
        margin: 18px auto !important;
        text-align: center !important;
        font-weight: 700 !important;
    }
}

/* ==========================================================
   MODE MOBILE JOUEUR - CORRECTION V7 READER ET BACKGROUND
   ----------------------------------------------------------
   Objectif :
   - corriger le flash puis disparition du scénario mobile ;
   - ne plus masquer les enfants du lecteur mobile ;
   - masquer seulement la fiche desktop originale ;
   - remettre les backgrounds visibles sur mobile ;
   - remonter les backgrounds vers le haut de l'écran ;
   - ne pas toucher au desktop.
   ========================================================== */

@media (max-width: 860px) {
    /*
       Correction critique :
       l'ancienne règle cachait tous les enfants de tous les <main>,
       y compris ceux du lecteur mobile. On force ici le lecteur
       et son contenu à rester visibles.
    */
    body.mobile-scenario-detail .mobile-scenario-reader,
    body.mobile-scenario-detail .mobile-scenario-reader *,
    body.mobile-scenario-detail.mobile-reader-ready .mobile-scenario-reader,
    body.mobile-scenario-detail.mobile-reader-ready .mobile-scenario-reader * {
        display: revert !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    body.mobile-scenario-detail .mobile-scenario-reader {
        display: block !important;
    }

    body.mobile-scenario-detail .mobile-scenario-meta {
        display: flex !important;
    }

    body.mobile-scenario-detail .mobile-scenario-pill {
        display: inline-flex !important;
    }

    body.mobile-scenario-detail .mobile-scenario-section,
    body.mobile-scenario-detail .mobile-scenario-section-title,
    body.mobile-scenario-detail .mobile-scenario-section-content,
    body.mobile-scenario-detail .mobile-scenario-image-wrap {
        display: block !important;
    }

    /*
       On masque uniquement le contenu de la fiche desktop originale,
       pas le lecteur mobile reconstruit.
    */
    body.mobile-scenario-detail.mobile-reader-ready main:not(.mobile-scenario-reader) > * {
        display: none !important;
    }

    body.mobile-scenario-detail.mobile-reader-ready main.mobile-scenario-reader > * {
        display: block !important;
    }

    body.mobile-scenario-detail.mobile-reader-ready main.mobile-scenario-reader .mobile-scenario-meta {
        display: flex !important;
    }

    body.mobile-scenario-detail.mobile-reader-ready main.mobile-scenario-reader .mobile-scenario-pill {
        display: inline-flex !important;
    }

    /*
       Backgrounds sur mobile :
       on ne les remplace plus par un simple dégradé.
       Le background injecté par le header reste visible.
       On le remonte pour qu'il soit mieux vu sous les barres du navigateur mobile.
    */
    body.theme-modern,
    body.theme-vintage {
        background-position: center top !important;
        background-size: cover !important;
        background-repeat: no-repeat !important;
        background-attachment: scroll !important;
    }

    /*
       Si un ancien bloc mobile avait remplacé le fond par un dégradé,
       on laisse le header reprendre la main visuellement autant que possible
       en évitant tout pseudo-calque opaque.
    */
    body.theme-modern::before,
    body.theme-modern::after,
    body.theme-vintage::before,
    body.theme-vintage::after {
        display: none !important;
        content: none !important;
    }

    /*
       Lecteur scénario : image pleine largeur proportionnée.
    */
    body.mobile-scenario-detail .mobile-scenario-image-wrap img,
    body.mobile-scenario-detail.mobile-reader-ready .mobile-scenario-image-wrap img {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        margin: 0 auto !important;
        cursor: zoom-in !important;
    }
}

/* ==========================================================
   SCENARIO PHP - VERSION MOBILE SEPAREE
   ----------------------------------------------------------
   Objectif :
   - desktop strictement inchangé ;
   - sur mobile seulement, masquer la fiche desktop A4 ;
   - afficher la version mobile générée par scenario.php ;
   - conserver image haute, backgrounds et rendu V7.
   ========================================================== */

.scenario-mobile-version {
    display: none;
}

@media (max-width: 860px) {
    body.mobile-scenario-detail .scenario-view-header,
    body.mobile-scenario-detail .scenario-preview-a4 {
        display: none !important;
    }

    body.mobile-scenario-detail .scenario-mobile-version {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 10px auto 22px !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        overflow-x: hidden !important;
    }

    body.mobile-scenario-detail .scenario-mobile-version *,
    body.mobile-scenario-detail .scenario-mobile-version {
        box-sizing: border-box !important;
        max-width: 100% !important;
    }

    body.mobile-scenario-detail .mobile-scenario-section-title {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 9px !important;
    }

    body.mobile-scenario-detail .mobile-scenario-step {
        flex: 0 0 28px !important;
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
        padding: 0 !important;
        aspect-ratio: 1 / 1 !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #5a7d2b !important;
        color: #fff !important;
        font-size: .92rem !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        box-shadow: inset 0 -1px 0 rgba(0,0,0,.18) !important;
    }

    body.theme-vintage.mobile-scenario-detail .mobile-scenario-step {
        background: #6f5a33 !important;
        color: #fff8e7 !important;
    }

    body.mobile-scenario-detail .mobile-scenario-section-title-text {
        display: inline-block !important;
    }

    body.mobile-scenario-detail .mobile-scenario-section-content hr,
    body.mobile-scenario-detail .mobile-scenario-section-content .separator,
    body.mobile-scenario-detail .mobile-scenario-section-content .divider,
    body.mobile-scenario-detail .mobile-scenario-section-content .dotted,
    body.mobile-scenario-detail .mobile-scenario-section-content .dotted-separator,
    body.mobile-scenario-detail .mobile-scenario-section-content .vertical-separator,
    body.mobile-scenario-detail .mobile-scenario-section-content .section-separator {
        display: none !important;
    }

    body.mobile-scenario-detail .mobile-scenario-section-content [style*="border-left"],
    body.mobile-scenario-detail .mobile-scenario-section-content [style*="border-right"] {
        border-left: 0 !important;
        border-right: 0 !important;
    }

    body.mobile-scenario-detail .mobile-scenario-map-thumb {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        margin: 4px auto 16px !important;
        display: block !important;
    }

    body.mobile-scenario-detail .mobile-scenario-map-thumb button {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        cursor: zoom-in !important;
        text-align: center !important;
    }

    body.mobile-scenario-detail .mobile-scenario-map-thumb img {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        border-radius: 10px !important;
        box-shadow: 0 3px 12px rgba(0,0,0,.20) !important;
        margin: 0 auto !important;
    }

    body.mobile-scenario-detail .mobile-scenario-map-thumb span {
        display: block !important;
        margin-top: 5px !important;
        font-size: .82rem !important;
        font-weight: 800 !important;
        opacity: .82 !important;
    }
}

/* ==========================================================
   DESKTOP UNIQUEMENT - STRUCTURE OBJECTIFS HERO / FILTRES
   ----------------------------------------------------------
   Objectif :
   - isoler la structure de la page objectifs cachés ;
   - empêcher public-hero et filters de se chevaucher ;
   - reproduire un espacement propre comme sur l'index ;
   - desktop uniquement ;
   - aucun mobile ;
   - aucun scénario ;
   - aucun header ;
   - aucun background.
   ========================================================== */

@media (min-width: 861px) {
    .public-hero + .objectives-filters-layout-match {
        max-width: 1260px !important;
        margin: 30px auto 0 !important;
        padding: 0 !important;
        clear: both !important;
        position: relative !important;
        z-index: 1 !important;
    }

    .objectives-filters-layout-match > .filters.objectives-filters-merged-actions {
        margin-top: 0 !important;
        margin-right: auto !important;
        margin-bottom: 28px !important;
        margin-left: auto !important;
    }
}

/* ==========================================================
   MOBILE UNIQUEMENT - FOND MODERNE ET BURGER COMPTE
   ----------------------------------------------------------
   Objectif :
   - mobile uniquement ;
   - remettre le fond moderne mobile en petit background fixe bas ;
   - conserver le comportement vintage mobile ;
   - aligner le nom du compte dans le burger comme Admin / Déconnexion ;
   - aucun desktop ;
   - aucun scénario ;
   - aucun objectifs desktop.
   ========================================================== */

@media (max-width: 860px) {
    body.theme-modern {
        background-color: #efe7d8 !important;
        background-image:
            linear-gradient(
                180deg,
                rgba(245, 239, 229, .58) 0%,
                rgba(239, 231, 216, .52) 46%,
                rgba(228, 216, 197, .58) 100%
            ),
            url('../img/theme-modern-bg.png') !important;
        background-size: cover, min(100vw, 760px) auto !important;
        background-position: center top, center bottom !important;
        background-repeat: no-repeat, no-repeat !important;
        background-attachment: scroll, fixed !important;
    }

    body.theme-modern::before,
    body.theme-modern::after {
        display: none !important;
        content: none !important;
    }

    body.mobile-menu-open .topbar .top-actions,
    body.mobile-menu-open .topbar .auth-links,
    body.mobile-menu-open .topbar .user-actions {
        align-items: stretch !important;
    }

    body.mobile-menu-open .topbar .top-actions > *,
    body.mobile-menu-open .topbar .auth-links > *,
    body.mobile-menu-open .topbar .user-actions > * {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        text-align: center !important;
        justify-content: center !important;
    }

    body.mobile-menu-open .topbar .user-chip,
    body.mobile-menu-open .topbar .account-chip,
    body.mobile-menu-open .topbar .user-name,
    body.mobile-menu-open .topbar .account-name,
    body.mobile-menu-open .topbar .topbar-user,
    body.mobile-menu-open .topbar .current-user,
    body.mobile-menu-open .topbar .auth-user,
    body.mobile-menu-open .topbar .top-actions span,
    body.mobile-menu-open .topbar .auth-links span,
    body.mobile-menu-open .topbar .user-actions span {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 9px 12px !important;
        box-sizing: border-box !important;
        text-align: center !important;
        white-space: normal !important;
        line-height: 1.15 !important;
    }
}

/* ==========================================================
   MOBILE UNIQUEMENT - FOND MODERNE CALE SUR VINTAGE
   ----------------------------------------------------------
   Objectif :
   - mobile uniquement ;
   - caler le fond moderne sur le comportement du fond ancien ;
   - image moderne fixée en bas, moins zoomée ;
   - le scroll passe au-dessus ;
   - aucun desktop ;
   - aucun scénario ;
   - aucun objectif caché.
   ========================================================== */

@media (max-width: 860px) {
    body.theme-modern {
        background-color: #efe7d8 !important;
        background-image:
            linear-gradient(
                180deg,
                rgba(245, 239, 229, .48) 0%,
                rgba(239, 231, 216, .54) 52%,
                rgba(228, 216, 197, .62) 100%
            ),
            url('../img/theme-modern-bg.png') !important;
        background-size: cover, auto min(46vh, 360px) !important;
        background-position: center top, center bottom !important;
        background-repeat: no-repeat, no-repeat !important;
        background-attachment: scroll, fixed !important;
    }

    body.theme-modern::before,
    body.theme-modern::after {
        display: none !important;
        content: none !important;
    }
}

/* ==========================================================
   MOBILE UNIQUEMENT - BOUTONS FILTRE CENTRES
   ----------------------------------------------------------
   Objectif :
   - mobile uniquement ;
   - centrer le bouton Filtrer sur la page scénarios ;
   - centrer le bouton Filtrer sur la page objectifs ;
   - aucun desktop ;
   - aucun scénario détail ;
   - aucun header ;
   - aucun background.
   ========================================================== */

@media (max-width: 860px) {
    .scenario-filters .filter-submit {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding-top: 0 !important;
        margin: 4px 0 0 !important;
        text-align: center !important;
    }

    .scenario-filters .filter-submit .btn,
    .objectives-filters-merged-actions > button.btn.primary {
        width: auto !important;
        min-width: 150px !important;
        max-width: 100% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        justify-self: center !important;
        margin-right: auto !important;
        margin-left: auto !important;
        text-align: center !important;
    }

    .objectives-filters-merged-actions > button.btn.primary {
        grid-column: 1 / -1 !important;
        margin-top: 4px !important;
    }
}

/* ==========================================================
   MOBILE UNIQUEMENT - BOUTON OUVERTURE FILTRES CENTRE
   ----------------------------------------------------------
   Objectif :
   - mobile uniquement ;
   - centrer le bouton "Filtres" qui ouvre les filtres ;
   - l'aligner sur la largeur de la recherche et des listes ;
   - pages scénarios et objectifs ;
   - aucun desktop ;
   - aucun PHP ;
   - aucun JS ;
   - aucun header ;
   - aucun background.
   ========================================================== */

@media (max-width: 860px) {
    .mobile-filter-toggle {
        width: calc(100% - 20px) !important;
        max-width: 1260px !important;
        min-height: 42px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 10px auto 12px !important;
        padding: 9px 14px !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }

    .scenario-filters,
    .objectives-filters,
    .objectives-filters-merged-actions {
        width: calc(100% - 20px) !important;
        margin-right: auto !important;
        margin-left: auto !important;
        box-sizing: border-box !important;
    }

    .scenario-filters .filter-submit,
    .objectives-filters-merged-actions > button.btn.primary {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .scenario-filters .filter-submit .btn,
    .objectives-filters-merged-actions > button.btn.primary {
        margin-right: auto !important;
        margin-left: auto !important;
    }
}

/* ==========================================================
   MOBILE UNIQUEMENT - LARGEUR LISTE OBJECTIFS
   ----------------------------------------------------------
   Objectif :
   - page objectifs uniquement ;
   - aligner la largeur des objectifs sur les filtres/recherche ;
   - mobile uniquement ;
   - aucun desktop ;
   - aucun scénario ;
   - aucun header ;
   - aucun background.
   ========================================================== */

@media (max-width: 860px) {
    .objectives-page-list,
    .objectives-list.objectives-page-list {
        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        margin-right: auto !important;
        margin-left: auto !important;
        box-sizing: border-box !important;
        grid-template-columns: 1fr !important;
    }

    .objectives-page-list .objective-card {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        box-sizing: border-box !important;
    }
}

/* ==========================================================
   DESKTOP UNIQUEMENT - REGLES SPECIALES EN COLONNES FLUIDES
   ----------------------------------------------------------
   Objectif :
   - fiche scénario desktop uniquement ;
   - règles spéciales en deux colonnes fluides ;
   - éviter le placement 1 en face de 2, 3 en face de 4 ;
   - remplir naturellement les colonnes sans grands blancs ;
   - aucun mobile ;
   - aucun PHP ;
   - aucun JS ;
   - aucun autre bloc de scénario.
   ========================================================== */

@media (min-width: 861px) {
    .sheet-special-rules-content .sheet-special-rules-grid,
    .sheet-print-content .sheet-special-rules-content .sheet-special-rules-grid {
        display: block !important;
        column-count: 2 !important;
        column-gap: 18px !important;
        column-fill: balance !important;
    }

    .sheet-special-rules-content .sheet-special-rule,
    .sheet-print-content .sheet-special-rules-content .sheet-special-rule {
        display: inline-block !important;
        width: 100% !important;
        max-width: 100% !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        -webkit-column-break-inside: avoid !important;
        margin: 0 0 10px !important;
        vertical-align: top !important;
    }

    .sheet-special-rules-content .sheet-special-rule-title,
    .sheet-print-content .sheet-special-rules-content .sheet-special-rule-title {
        break-after: avoid !important;
        page-break-after: avoid !important;
    }
}

/* ==========================================================
   EXPORT DESKTOP - CARTE ET REGLES SPECIALES
   ----------------------------------------------------------
   Objectif :
   - export / impression uniquement ;
   - redescendre légèrement l'image/carte pour laisser visible la période ;
   - réduire un peu la hauteur de l'image pour éviter qu'elle mange l'en-tête ;
   - règles spéciales en colonnes fluides aussi dans l'export ;
   - aucun mobile ;
   - aucun PHP ;
   - aucun JS ;
   - aucun header du site ;
   - aucun background.
   ========================================================== */

.sheet-print-export .sheet-print-battlefield-frame {
    height: 76mm !important;
    margin: 4mm 0 4mm !important;
    column-span: all !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
}

.sheet-print-export .sheet-print-content .sheet-special-rules-grid {
    display: block !important;
    column-count: 2 !important;
    column-gap: 8mm !important;
    column-fill: balance !important;
}

.sheet-print-export .sheet-print-content .sheet-special-rule {
    display: inline-block !important;
    width: 100% !important;
    max-width: 100% !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    -webkit-column-break-inside: avoid !important;
    margin: 0 0 3mm !important;
    vertical-align: top !important;
}

.sheet-print-export .sheet-print-content .sheet-special-rule-title {
    break-after: avoid !important;
    page-break-after: avoid !important;
}

@media print {
    .sheet-print-export .sheet-print-battlefield-frame {
        height: 76mm !important;
        margin: 4mm 0 4mm !important;
    }

    .sheet-print-export .sheet-print-content .sheet-special-rules-grid {
        display: block !important;
        column-count: 2 !important;
        column-gap: 8mm !important;
        column-fill: balance !important;
    }

    .sheet-print-export .sheet-print-content .sheet-special-rule {
        display: inline-block !important;
        width: 100% !important;
        max-width: 100% !important;
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        -webkit-column-break-inside: avoid !important;
        margin: 0 0 3mm !important;
        vertical-align: top !important;
    }
}

/* ==========================================================
   DESKTOP VUE SCENARIO - REGLES SPECIALES ALTERNEES
   ----------------------------------------------------------
   Objectif :
   - vue desktop "Voir le scénario" uniquement ;
   - règles spéciales en deux colonnes classiques ;
   - ordre gauche/droite : 1-2, puis 3-4, puis 5-6 ;
   - annule le comportement colonnes fluides pour la vue écran ;
   - aucun mobile ;
   - aucun export / print ;
   - aucun PHP ;
   - aucun JS.
   ========================================================== */

@media screen and (min-width: 861px) {
    .scenario-view-page .scenario-preview-a4 .sheet-flow .sheet-special-rules-content .sheet-special-rules-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px 18px !important;
        column-count: auto !important;
        column-gap: normal !important;
        column-fill: auto !important;
    }

    .scenario-view-page .scenario-preview-a4 .sheet-flow .sheet-special-rules-content .sheet-special-rule {
        display: block !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        break-inside: auto !important;
        page-break-inside: auto !important;
        -webkit-column-break-inside: auto !important;
    }
}

/* ==========================================================
   DESKTOP VUE SCENARIO - COLONNES REGLES VRAIMENT LIBRES
   ----------------------------------------------------------
   Objectif :
   - vue desktop "Voir le scénario" uniquement ;
   - utiliser les deux colonnes PHP générées par formatting.php ;
   - colonne gauche : 1, 3, 5...
   - colonne droite : 2, 4, 6...
   - chaque colonne s'empile librement ;
   - aucun mobile ;
   - aucun PHP ;
   - aucun JS ;
   - aucun header ;
   - aucun background.
   ========================================================== */

@media screen and (min-width: 861px) {
    .scenario-view-page .scenario-preview-a4 .sheet-flow .sheet-special-rules-content .sheet-special-rules-grid.sheet-special-rules-columns {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 0 18px !important;
        column-count: auto !important;
        column-gap: normal !important;
        column-fill: auto !important;
        align-items: start !important;
    }

    .scenario-view-page .scenario-preview-a4 .sheet-flow .sheet-special-rules-content .sheet-special-rules-column {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        min-width: 0 !important;
    }

    .scenario-view-page .scenario-preview-a4 .sheet-flow .sheet-special-rules-content .sheet-special-rules-column .sheet-special-rule {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        break-inside: auto !important;
        page-break-inside: auto !important;
        -webkit-column-break-inside: auto !important;
    }
}

/* ==========================================================
   DESKTOP VUE SCENARIO - ALIGNEMENT BULLES NUMEROTEES
   ----------------------------------------------------------
   Objectif :
   - vue desktop "Voir le scénario" uniquement ;
   - corriger l'alignement vertical des bulles numérotées ;
   - concerne les lignes issues de 1*, 2*, 3*, 4* ;
   - concerne les titres de règles spéciales ;
   - ne touche pas aux petites puces simples ;
   - aucun mobile ;
   - aucun PHP ;
   - aucun JS.
   ========================================================== */

@media screen and (min-width: 861px) {
    .scenario-view-page .scenario-preview-a4 .sheet-flow .sheet-numbered-line {
        align-items: center !important;
    }

    .scenario-view-page .scenario-preview-a4 .sheet-flow .sheet-special-rule-title {
        display: grid !important;
        grid-template-columns: 28px minmax(0, 1fr) !important;
        gap: 8px !important;
        align-items: center !important;
    }

    .scenario-view-page .scenario-preview-a4 .sheet-flow .sheet-number-badge {
        align-self: center !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    .scenario-view-page .scenario-preview-a4 .sheet-flow .sheet-number-text,
    .scenario-view-page .scenario-preview-a4 .sheet-flow .sheet-special-rule-title > span:not(.sheet-number-badge) {
        align-self: center !important;
        display: inline-block !important;
        transform: translateY(1px) !important;
    }
}

/* ==========================================================
   VERROU FINAL LOGO HEADER
   ----------------------------------------------------------
   NE PAS SUPPRIMER.
   NE PAS DÉPLACER.
   CE BLOC DOIT RESTER TOUT EN BAS DU STYLE.CSS.

   Objectif :
   - supprimer définitivement le cercle de l'ancienne étoile ;
   - empêcher toute bordure autour du logo ;
   - empêcher le logo de grossir ;
   - empêcher le logo de sortir de la topbar ;
   - écraser toutes les anciennes règles .brand .logo.
   ========================================================== */

.topbar .brand .logo,
.topbar .brand .brand-logo,
.brand .logo,
.brand .brand-logo {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 46px !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    max-width: 46px !important;
    max-height: 46px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
    color: inherit !important;
}

.topbar .brand .logo::before,
.topbar .brand .logo::after,
.topbar .brand .brand-logo::before,
.topbar .brand .brand-logo::after,
.brand .logo::before,
.brand .logo::after,
.brand .brand-logo::before,
.brand .brand-logo::after {
    content: none !important;
    display: none !important;
}

.topbar .brand .logo img,
.topbar .brand .brand-logo img,
.brand .logo img,
.brand .brand-logo img {
    display: block !important;
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    object-fit: contain !important;
    object-position: center center !important;
}

/* Même verrou en thème ancien. */
body.theme-vintage .topbar .brand .logo,
body.theme-vintage .topbar .brand .brand-logo,
body.theme-vintage .brand .logo,
body.theme-vintage .brand .brand-logo {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.theme-vintage .topbar .brand .logo img,
body.theme-vintage .topbar .brand .brand-logo img,
body.theme-vintage .brand .logo img,
body.theme-vintage .brand .brand-logo img {
    filter: none !important;
}

@media (max-width: 760px) {
    .topbar .brand .logo,
    .topbar .brand .brand-logo,
    .brand .logo,
    .brand .brand-logo {
        flex-basis: 40px !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
    }

    .topbar .brand .logo img,
    .topbar .brand .brand-logo img,
    .brand .logo img,
    .brand .brand-logo img {
        flex-basis: 38px !important;
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        max-width: 38px !important;
        max-height: 38px !important;
    }
}
