/* Pages hors partie : connexion, administration, statistiques */
body.page { height: auto; min-height: 100vh; display: block; }
body.page header a:not(.btn) { color: #f3ead8; }
.page-main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 40px; }
.page-main h2 { font: 600 20px Georgia, serif; margin: 22px 0 8px; }
.page-main h3 { font: 600 16px Georgia, serif; margin: 16px 0 6px; }
.page-main .card { margin-bottom: 14px; }
.small { font-size: 12.5px; color: var(--muted); }
.muted { color: var(--muted); }
table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.list th { text-align: left; font-weight: 600; border-bottom: 2px solid var(--line); padding: 5px 6px; white-space: nowrap; }
table.list td { border-bottom: 1px solid #eee5d4; padding: 5px 6px; vertical-align: top; }
table.list tr.hl td { background: #fff3c4; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 9px; font-size: 12px; font-weight: 600; background: #e6dfd0; color: var(--ink); }
.pill.pending { background: #f6e0a6; color: #7a5410; }
.pill.open { background: #d8ecd9; color: var(--good); }
.pill.refused, .pill.suspended { background: #f3c9c4; color: var(--bad); }
.pill.admin { background: #3a3128; color: #f3ead8; }
.row-acts { display: flex; gap: 4px; flex-wrap: wrap; }
.row-acts button { padding: 2px 8px; font-size: 12.5px; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin: 6px 0; }
.form-row label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
input[type=text], input[type=email], input[type=number], select, textarea { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); }
input[type=number] { width: 90px; }
.msg { padding: 8px 10px; border-radius: 4px; margin: 8px 0; }
.msg.ok { background: #d8ecd9; color: #1f5a33; }
.msg.err { background: #f6d5d0; color: #7a2018; }
.msg.info { background: #f1ead8; color: var(--ink); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat-tile { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.stat-tile b { display: block; font: 600 24px Georgia, serif; }
.bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; background: #e6dfd0; min-width: 120px; }
.bar span { display: block; height: 100%; }
.bar .u { background: var(--union); } .bar .c { background: var(--csa); } .bar .d { background: #b8ad95; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 6px 0 12px; }

/* page de connexion */
.login-wrap { max-width: 440px; margin: 7vh auto 30px; padding: 0 16px; }
.login-wrap .card { padding: 18px 20px; }
.login-wrap h1 { font: 600 26px Georgia, serif; margin: 0 0 4px; text-align: center; }
.login-wrap .sub { text-align: center; color: var(--muted); margin-bottom: 14px; }
.login-wrap label { display: block; margin: 10px 0 3px; font-weight: 600; }
.login-wrap input[type=text], .login-wrap input[type=email], .login-wrap textarea { width: 100%; }
.login-wrap .code { font-size: 26px; letter-spacing: 8px; text-align: center; }
.login-wrap .btns { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.login-wrap .btns button.primary { flex: 1; padding: 8px; }
.login-tabs { display: flex; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.login-tabs button { flex: 1; border: 0; background: none; border-bottom: 2px solid transparent; border-radius: 0; font-weight: 600; color: var(--muted); }
.login-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
@media (max-width: 640px) {
  table.list { font-size: 12.5px; }
  .hide-sm { display: none; }
}

/* ---------- page d'accueil : voir « Thème » en fin de fichier ---------- */
.home h2 { font: 600 20px Georgia, serif; margin: 0 0 8px; }
.home h3 { font: 600 16px Georgia, serif; margin: 14px 0 2px; }
.r-txt { flex: 1; min-width: 0; }
.mini-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.mini-tiles div { background: #f1ead8; border-radius: 4px; padding: 6px 8px; }
.mini-tiles b { display: block; font: 600 20px Georgia, serif; }
.b-row { padding: 5px 0; border-top: 1px solid #eee5d4; font-size: 13.5px; }
.b-row:first-child { border-top: 0; }

/* ---------- page Bataille ---------- */
.battle-page { max-width: 1280px; margin: 0 auto; padding: 12px 16px 40px; }
.battle-page .back { display: inline-block; margin: 2px 0 8px; color: var(--accent); text-decoration: none; font-size: 13.5px; }
.hero h1 { font: 600 28px Georgia, serif; margin: 0; }
.hero .sub { color: var(--muted); margin: 2px 0 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.battle-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 16px; align-items: start; }
.battle-main .card { margin-bottom: 14px; }
.battle-main h2, .play h2 { font: 600 19px Georgia, serif; margin: 0 0 8px; }
.battle-main p { margin: 4px 0 8px; line-height: 1.5; }
#bMap { width: 100%; height: auto; max-height: 70vh; display: block; background: #e8e4d2; border-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.forces { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.forces h3 { margin: 0 0 4px; }
.forces h3 .small { font: 400 12.5px "Segoe UI", system-ui, sans-serif; }
.play { position: sticky; top: 12px; }
.play fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.est-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }
.est-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.est-bar { display: flex; gap: 2px; height: 26px; margin-bottom: 10px; }
.est-seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 600; min-width: 4px; }
.est-seg:first-child { border-radius: 4px 0 0 4px; }
.est-seg:last-child { border-radius: 0 4px 4px 0; }
.est-seg:only-child { border-radius: 4px; }
.est-hist { display: flex; gap: 2px; align-items: stretch; height: 80px; margin-top: 4px; }
.est-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; text-align: center; }
.est-colbar { background: #c4b89d; border-radius: 4px 4px 0 0; }
.est-col.avg .est-colbar { background: #7a6a4f; }
.est-col span { font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 2px; }
.play legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tiles.three { grid-template-columns: 1fr 1fr 1fr; }
.tile { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.tile:hover { border-color: #b9a98a; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile b { font-size: 14px; }
.tile span { font-size: 12px; color: var(--muted); }
.tile .swatch { display: inline-block; width: 22px; height: 6px; border-radius: 2px; margin-bottom: 3px; }
.tile:has(input:checked) { border: 2px solid var(--accent); padding: 7px 9px; background: #fff6ee; }
.tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.seg label { flex: 1; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 6px 4px; font-size: 13.5px; border-left: 1px solid var(--line); }
.seg label:first-child span { border-left: 0; }
.seg label:has(input:checked) span { background: var(--accent); color: #fff; font-weight: 600; }
.seg label:has(input:focus-visible) span { outline: 2px solid var(--ink); outline-offset: -3px; }
.hint { margin: 6px 0 0; }
.players { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; max-height: 210px; overflow-y: auto; }
.player { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.player input { margin: 0; }
.player .small { margin-left: auto; }
.player:has(input:checked) { border-color: var(--accent); background: #fff6ee; }
.play input[type=text] { width: 100%; }
.check { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: start; cursor: pointer; font-weight: 600; }
.check input { grid-row: span 2; margin: 3px 0 0; }
.check .small { grid-column: 2; font-weight: 400; }
.summary { background: #f1ead8; border-radius: 6px; padding: 8px 10px; font-size: 13.5px; margin-bottom: 10px; }
.go { width: 100%; padding: 10px; font-size: 15px; }
@media (max-width: 960px) {
  .battle-grid { grid-template-columns: minmax(0, 1fr); }
  .play { position: static; order: -1; }
}

/* ---------- composants communs à toutes les pages (y compris les fenêtres du jeu) ---------- */
.page-wrap { max-width: 1280px; margin: 0 auto; padding: 12px 16px 40px; }
.page-head .back, .hero .back { display: inline-block; margin: 2px 0 8px; color: var(--accent); text-decoration: none; font-size: 13.5px; }
.page-head h1 { font: 600 28px Georgia, serif; margin: 0; }
.page-head .sub { color: var(--muted); margin: 2px 0 10px; }
.page-head { margin-bottom: 6px; }
body.page .card > h2, body.page section.card h2 { font: 600 19px Georgia, serif; margin: 0 0 8px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-row .with-icon .ico, button.with-icon .ico { width: 16px; height: 16px; }
button.icon, a.btn.icon { display: inline-grid; place-items: center; min-width: 30px; height: 28px; padding: 0 6px; }
button.icon .ico, a.btn.icon .ico { width: 16px; height: 16px; }
.dlg-head { padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.dlg-head b { font: 600 19px Georgia, serif; }
.dlg-head button.icon { border-color: transparent; background: none; }
.dlg-head button.icon:hover { background: #efe6d2; }
/* interrupteur (cases à cocher oui / non) */
input.switch, .field input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: 10px; background: #cfc6b2; position: relative; cursor: pointer; transition: background .15s; vertical-align: middle; flex-shrink: 0; margin: 0; border: 0; padding: 0; }
input.switch::before, .field input[type=checkbox]::before { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
input.switch:checked, .field input[type=checkbox]:checked { background: var(--accent); }
input.switch:checked::before, .field input[type=checkbox]:checked::before { left: 18px; }
input.switch:focus-visible, .field input[type=checkbox]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.filters-card .filters { margin: 0; gap: 10px 18px; }
.filters-card .seg { min-width: 300px; }
.stat-grid { margin-bottom: 14px; }
.card-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-title-row h2 { margin: 0 !important; }
body.page section.card { margin-bottom: 14px; }
table.list tr:hover td { background: #fbf6ea; }
table.list th { color: var(--muted); font-size: 12.5px; text-transform: none; }
@media (max-width: 640px) { .filters-card .seg { min-width: 0; width: 100%; } }
.ret-row { display: grid; grid-template-columns: minmax(0, 1fr) 190px 110px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #eee5d4; font-size: 13.5px; }
.ret-row input { width: 80px; }
.row-acts { align-items: center; }
.row-acts button { height: 26px; }
#fCreate { align-items: end; }
#fCreate .switch-row { padding-bottom: 6px; }
@media (max-width: 640px) { .ret-row { grid-template-columns: 1fr; gap: 2px; } }
.r-ico .ico { width: 18px; height: 18px; margin: 0 auto; }
.form-row label.switch-row { flex-direction: row; align-items: center; }

.seg span { white-space: nowrap; }
.filters-card .seg { min-width: 0; }
.filters-card .seg span { padding: 6px 16px; }

/* ---------- didacticiel : panneau du sergent instructeur (jeu.html?lecon=N) ---------- */
#tutoBox { position: fixed; left: 12px; bottom: 12px; width: min(380px, calc(100vw - 24px)); max-height: calc(100vh - var(--head-h, 56px) - 24px); overflow: auto;
  background: var(--paper); border: 2px solid #3a3128; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.28); z-index: 30; padding: 0 12px 10px; font-size: 14px; line-height: 1.45; }
#tutoBox.folded { padding-bottom: 0; }
#tutoBox .tuto-head { display: flex; align-items: center; gap: 8px; margin: 0 -12px; padding: 6px 8px 6px 12px; background: #3a3128; color: #f3ead8; position: sticky; top: 0; }
#tutoBox .tuto-who { font: 600 14px Georgia, serif; }
#tutoBox .tuto-step { font-size: 12px; opacity: .8; margin-left: auto; }
#tutoBox .tuto-fold { background: transparent; border: 0; color: #f3ead8; font-size: 14px; padding: 0 4px; cursor: pointer; }
#tutoBox .tuto-bar { height: 4px; background: #e2d9c6; margin: 0 -12px 8px; }
#tutoBox.folded .tuto-bar { margin-bottom: 0; }
#tutoBox .tuto-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
#tutoBox h4 { margin: 4px 0 6px; font: 600 16px Georgia, serif; }
#tutoBox p { margin: 0 0 7px; }
#tutoBox .tuto-do { background: #fff4d6; border-left: 3px solid var(--warn); padding: 5px 8px; border-radius: 3px; }
#tutoBox .tuto-bravo { background: #e1f0e2; color: var(--good); border-radius: 4px; padding: 4px 8px; margin-bottom: 7px; font-weight: 600; }
#tutoBox .tuto-medal { font: 600 18px Georgia, serif; color: var(--accent); text-align: center; padding: 6px; border: 1px dashed var(--accent); border-radius: 6px; }
#tutoBox .tuto-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
#tutoBox .tuto-links { margin-left: auto; font-size: 12px; color: var(--muted); }
#tutoBox .tuto-wait { color: var(--warn); font-weight: 600; }
#tutoBox .linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 12px; }
#tutoBox table.tuto-terrain { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#tutoBox table.tuto-terrain th, #tutoBox table.tuto-terrain td { border-bottom: 1px solid var(--line); padding: 3px 4px; text-align: left; vertical-align: top; }
#tutoSpots { position: fixed; inset: 0; pointer-events: none; z-index: 25; }
.tuto-spot { position: fixed; border: 3px solid #f0b400; border-radius: 8px; box-shadow: 0 0 0 2px rgba(255,255,255,.7), 0 0 14px 4px rgba(240,180,0,.6); animation: tutoPulse 1.4s ease-in-out infinite; }
.tuto-spot.round { border-radius: 50%; }
.tuto-spot.dim { box-shadow: 0 0 0 2px rgba(255,255,255,.7), 0 0 0 9999px rgba(20,16,10,.35); }
@keyframes tutoPulse { 50% { border-color: #ffe27a; } }

#tutoBox .tuto-log { background: #f3eee2; border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; margin-bottom: 8px; font-size: 12.5px; line-height: 1.4; }
#tutoBox .tuto-log b { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }

/* =====================================================================
   THÈME des pages hors partie (accueil, Bataille, statistiques, admin, réglages, connexion) :
   parchemin, bleu marine, cuivre ; titres à empattements. Le jeu (jeu.html) garde son style.
   ===================================================================== */
:root {
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, "Iowan Old Style", Georgia, serif;
  --parch: #efe6d3; --parch-2: #f6f0e3; --navy: #1e3350; --navy-2: #2a4466; --copper: #a5532a; --copper-2: #8c4220;
  --brown: #2e1d14; --edge: #cdbd9c;
}
body.page { background: radial-gradient(ellipse at 20% 0%, #f7f0e1 0%, rgba(247,240,225,0) 55%) no-repeat fixed, var(--parch); }
body.page h1, body.page h2, body.page h3 { font-family: var(--serif); }

/* en-tête : bandeau brun, logo, liens en texte ; la page en cours est soulignée */
:is(body.page, body.editeur) header { background: linear-gradient(#3b2619, var(--brown)); padding: 0 28px; min-height: 60px; gap: 18px; box-shadow: 0 2px 0 #6b4a2e, 0 3px 10px rgba(0,0,0,.25); position: relative; z-index: 5; }
:is(body.page, body.editeur) header .title { display: inline-flex; align-items: center; gap: 12px; font: 600 25px var(--serif); letter-spacing: .3px; color: #f6ecd8; text-decoration: none; padding-right: 22px; border-right: 1px solid rgba(243,234,216,.25); }
:is(body.page, body.editeur) header .title::before { content: ''; width: 34px; height: 38px; flex-shrink: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 34 38'%3E%3Cpath d='M17 1 32 9.5v19L17 37 2 28.5v-19z' fill='%23e9dcc0'/%3E%3Cpath d='M17 3.3 30 10.7v16.6L17 34.7z' fill='%2366676a'/%3E%3Cpath d='M17 3.3 4 10.7v16.6L17 34.7z' fill='%232f4f8f'/%3E%3Cpath d='M7 23.5h20' stroke='%23a8322a' stroke-width='1.6'/%3E%3Ctext x='17' y='21.5' font-family='Georgia,serif' font-size='10' font-weight='700' fill='%23fff' text-anchor='middle'%3EACW%3C/text%3E%3C/svg%3E") no-repeat center / contain; }
:is(body.page, body.editeur) header #nav, :is(body.page, body.editeur) header .actions { gap: 4px; align-self: stretch; }
:is(body.page, body.editeur) header #nav a.btn, :is(body.page, body.editeur) header #nav button { background: none; border: 0; border-radius: 0; color: #eadfca; font: 500 16px var(--serif); padding: 0 14px; min-height: 60px; display: inline-flex; align-items: center; gap: 7px; position: relative; filter: none; }
:is(body.page, body.editeur) header #nav .ico { display: none; }
:is(body.page, body.editeur) header #nav a.btn:hover, :is(body.page, body.editeur) header #nav button:hover { color: #fff; background: rgba(255,255,255,.05); }
:is(body.page, body.editeur) header #nav a.btn.on { color: #fff; }
:is(body.page, body.editeur) header #nav a.btn.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 9px; height: 3px; border-radius: 2px; background: #c8703f; }
:is(body.page, body.editeur) header .who { color: #f6ecd8; font: 600 16px var(--serif); margin-left: 10px; padding-left: 18px; border-left: 1px solid rgba(243,234,216,.25); align-self: center; }
:is(body.page, body.editeur) header #btnLogout { font-size: 14px; color: #cdbfa5; }
@media (max-width: 900px) {
  :is(body.page, body.editeur) header { padding: 0 12px; }
  :is(body.page, body.editeur) header .title { font-size: 20px; padding-right: 12px; }
  :is(body.page, body.editeur) header #nav .ico { display: block; width: 20px; height: 20px; }
  :is(body.page, body.editeur) header #nav a.btn, :is(body.page, body.editeur) header #nav button { padding: 0 9px; }
}
/* éditeur : en-tête du thème ; le menu des cartes et « Enregistrer » restent des commandes */
body.editeur header .actions { align-items: center; }
body.editeur header #nav { align-items: stretch; }
body.editeur header { flex-wrap: nowrap; padding-right: 14px; }
body.editeur header .status { font: 500 16px var(--serif); color: #eadfca; flex: 1; min-width: 0; flex-wrap: nowrap; }
body.editeur header #edTitre { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
body.editeur header .actions { flex-wrap: nowrap; flex-shrink: 0; }
body.editeur header #edOuvrir { max-width: 220px; }
body.editeur header #edOuvrir { font: 14px var(--serif); padding: 5px 8px; border-radius: 5px; background: #f6f0e3; border: 1px solid #6b4a2e; }
body.editeur header #edSave { background: linear-gradient(#b4602f, #8c4220); border: 1px solid #6e3518; border-radius: 5px; font: 600 15px var(--serif); padding: 6px 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }

/* boutons */
body.page a.btn, body.page button { border-radius: 5px; transition: background .15s, box-shadow .15s, border-color .15s; }
body.page a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
body.page button.primary, body.page a.btn.primary { background: linear-gradient(#b4602f, var(--copper-2)); border: 1px solid #6e3518; color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 1px 2px rgba(0,0,0,.25); }
body.page button.primary:hover, body.page a.btn.primary:hover { filter: brightness(1.07); }
body.page a.btn.navy { background: linear-gradient(var(--navy-2), var(--navy)); border: 1px solid #0f1f33; color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 3px rgba(0,0,0,.3); }
body.page a.btn.navy:hover { filter: brightness(1.12); }
body.page a.btn.big { font: 600 16.5px var(--serif); padding: 10px 26px; }
body.page button.ghost { background: transparent; border-color: rgba(127,110,85,.5); }

/* cadres : papier clair, double filet */
body.page .card, .panel { background: var(--parch-2); border: 1px solid var(--edge); border-radius: 8px; box-shadow: inset 0 0 0 3px var(--parch-2), inset 0 0 0 4px rgba(205,189,156,.55), 0 1px 3px rgba(60,40,20,.08); }
.panel { padding: 18px 22px; }
body.page main a:not(.btn), .home-wrap a:not(.btn):not(.map-card):not(.step) { color: var(--copper-2); }
h2.rule { display: flex; align-items: center; gap: 14px; font: 600 21px var(--serif); margin: 0 0 10px; color: var(--ink); }
h2.rule::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: .35; }
h2.rule.light { color: #f2e8d4; font-size: 19px; font-weight: 500; }
h2.big-rule { display: flex; align-items: center; gap: 18px; font: 700 34px var(--serif); margin: 30px 0 14px; color: #2a1d14; }
h2.big-rule::after { content: ''; flex: 1; height: 1px; background: #5a4634; opacity: .6; margin-top: 8px; }

/* ---------- accueil ---------- */
.home-wrap { max-width: 1320px; margin: 0 auto; padding: 22px 28px 50px; }
.home-hello { display: grid; grid-template-columns: auto 1fr; column-gap: 24px; align-items: end; margin-bottom: 20px; }
.home-hello h1 { font: 700 40px/1.1 var(--serif); margin: 0; color: #2a1d14; }
.home-hello::after { content: ''; grid-column: 2; grid-row: 1; height: 1px; background: #5a4634; opacity: .6; align-self: center; margin-top: 10px; }
.home-hello .sub { grid-column: 1 / -1; font: italic 18px var(--serif); color: #6a5843; margin-top: 4px; }
.home-top { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); gap: 22px; align-items: stretch; }

/* bandeau « Reprendre » : bleu marine, carte à droite fondue dans le bleu */
.hero { position: relative; min-height: 270px; border-radius: 8px; overflow: hidden; color: #f3ead8;
  background: linear-gradient(100deg, #1a2d47 0%, var(--navy) 45%, #22395a 100%);
  border: 1px solid #0f1e31; box-shadow: inset 0 0 0 3px #1e3350, inset 0 0 0 4px rgba(200,180,140,.45), 0 4px 14px rgba(20,25,40,.25); }
.hero-map { position: absolute; inset: 4px 4px 4px 34%; border-radius: 0 5px 5px 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%); mask-image: linear-gradient(90deg, transparent 0%, #000 38%); }
.hero-map .cover { width: 100%; height: 100%; display: block; object-fit: cover; }
.hero-txt { position: relative; padding: 24px 30px; max-width: 58%; display: flex; flex-direction: column; gap: 4px; }
.hero-title { font: 700 46px/1.1 var(--serif); color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.35); margin-top: 6px; }
.hero-line { font: 500 19px var(--serif); color: #f0e6d2; }
.hero-note { font: italic 16px var(--serif); color: #c9bfae; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hero-note .ico { width: 18px; height: 18px; }
.hero-acts { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.hero-acts .btn, .hero-acts button { font: 600 17px var(--serif) !important; padding: 9px 26px; }
.hero-acts button.ghost { color: #f3ead8; border-color: rgba(243,234,216,.4); }
.hero .dot { vertical-align: 2px; }

/* page Bataille : même bandeau, avec la couverture de la carte */
.battle-hero { min-height: 200px; margin: 4px 0 18px; }
.battle-hero .hero-txt { padding: 26px 30px; }
.battle-hero h1 { font: 700 42px/1.1 var(--serif); color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.35); margin: 0; }
.battle-hero .sub { font: italic 18px var(--serif); color: #d8cdb8; margin: 6px 0 14px; }
.battle-hero .pill { background: rgba(243,234,216,.14); color: #f3ead8; border: 1px solid rgba(243,234,216,.3); font-weight: 500; padding: 2px 10px; }
.battle-page .back { color: var(--copper-2); font: 15px var(--serif); }

/* camp d'instruction */
.camp { display: flex; flex-direction: column; }
#tutoList { display: flex; flex-direction: column; flex: 1; }
.camp-steps { display: flex; align-items: center; gap: 18px; margin: 2px 0 8px; }
.camp-steps .small { font: 15px var(--serif); color: var(--ink); white-space: nowrap; }
.steps { display: flex; align-items: center; flex: 1; max-width: 220px; }
.steps i { flex: 1; height: 1.5px; background: #8a7a62; }
.step { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid #8a7a62; background: var(--parch-2); flex-shrink: 0; }
.step.done { background: #8a7a62; }
.step.cur { background: var(--copper); border-color: var(--copper-2); box-shadow: 0 0 0 3px rgba(165,83,42,.18); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.home .camp-title { font: 700 32px/1.15 var(--serif); margin: 6px 0 4px; color: #2a1d14; }
.camp p.small { margin: 0 0 14px; font-size: 13.5px; }
.camp .btn.big { align-self: flex-start; margin-top: auto; }
.camp-redo { display: flex; flex-wrap: wrap; gap: 6px; }

/* autres parties */
.more { margin-top: 18px; padding: 12px 18px; }
.r-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-top: 1px solid #e6dcc7; }
.r-row:first-child { border-top: 0; }
.r-row.hl { background: #fbefd2; border-radius: 6px; }
.r-ico { width: 24px; color: #7a6a52; display: grid; place-items: center; }
.r-ico .ico { width: 19px; height: 19px; }
.r-row .btn, .r-row button { padding: 5px 14px; }
#flash .msg { margin-top: 14px; }

/* dernière décoration */
.medal-strip { display: flex; align-items: center; gap: 22px; margin-top: 26px; padding: 10px 26px 10px 64px; background: var(--parch-2); border: 1px solid var(--edge); border-radius: 8px; position: relative;
  box-shadow: inset 0 0 0 3px var(--parch-2), inset 0 0 0 4px rgba(205,189,156,.55); }
.medal-strip[hidden] { display: none; }
.medal-strip .medal { object-fit: contain; position: absolute; left: 14px; top: -12px; width: 40px; height: 58px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.ms-txt { display: flex; flex-direction: column; padding-left: 22px; border-left: 1px solid var(--edge); margin-left: 6px; }
.ms-txt .small { font: 14px var(--serif); color: #7a5a30; }
.ms-txt b { font: 700 22px var(--serif); color: #2a1d14; }
.ms-count { margin-left: auto; font: 14px var(--serif); }

/* image absente (ni couverture ni capture) : fond neutre à motif d'hexagones */
.cover-ph { width: 100%; height: 100%; background: #d9cfb5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34.64' height='60' viewBox='0 0 34.64 60'%3E%3Cpath d='M17.32 0v10M0 20l17.32-10 17.32 10v20L17.32 50 0 40zM17.32 50v10' fill='none' stroke='%23b8aa88' stroke-width='1'/%3E%3C/svg%3E"); }

/* galerie */
.cat-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--navy); flex-wrap: wrap; }
.cat-tabs button { background: none; border: 0; border-radius: 7px 7px 0 0; padding: 9px 26px; font: 500 18px var(--serif); color: #2a1d14; filter: none; }
.cat-tabs button:hover { background: rgba(30,51,80,.07); }
.cat-tabs button.on { background: linear-gradient(var(--navy-2), var(--navy)); color: #fff; }
.cat-sub { margin: 10px 0 14px; font: italic 14.5px var(--serif); }
.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.map-card { display: flex; flex-direction: column; background: var(--parch-2); border: 1px solid var(--edge); border-radius: 8px; overflow: hidden; color: var(--ink); text-decoration: none;
  box-shadow: 0 1px 3px rgba(60,40,20,.1); transition: transform .18s, box-shadow .18s; }
.map-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(60,40,20,.2); }
.mc-img { position: relative; aspect-ratio: 16 / 7.5; background: #8a9a5a; overflow: hidden; border-bottom: 1px solid var(--edge); }
.mc-img .cover { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .4s; }
.map-card:hover .mc-img .cover { transform: scale(1.04); }
.ribbon { position: absolute; left: 10px; top: 12px; background: linear-gradient(#b4602f, var(--copper-2)); color: #fff; font: 600 14.5px var(--serif); padding: 3px 20px 3px 12px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 50%, 100% 100%, 0 100%); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.mc-body { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 4px; }
.mc-body b { font: 700 22px/1.2 var(--serif); color: #2a1d14; }
.mc-date { font: italic 14px var(--serif); color: #6a5843; }
.mc-meta { display: flex; align-items: center; gap: 7px; font: 15.5px var(--serif); color: #3a2c20; }
.mc-meta .ico { width: 18px; height: 18px; }

/* bas de page : sauvegardes, bilan, dernières batailles, apprendre */
.home-bottom { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 22px; margin-top: 34px; align-items: start; }
.home-bottom h2.rule { font-size: 19px; }
.home-bottom .panel[hidden] { display: none; }
.s-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid #e6dcc7; }
.s-row:first-child { border-top: 0; }
.s-row .btn, .s-row button { padding: 4px 12px; font-size: 13px; }

@media (max-width: 1000px) {
  .home-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .home-wrap { padding: 14px 12px 40px; }
  .home-hello h1 { font-size: 30px; }
  .hero-txt { max-width: none; padding: 18px; background: linear-gradient(90deg, rgba(30,51,80,.92), rgba(30,51,80,.6)); }
  .hero-map { inset: 0; -webkit-mask-image: none; mask-image: none; }
  .hero-title { font-size: 34px; }
  h2.big-rule { font-size: 26px; }
  .cat-tabs button { padding: 7px 12px; font-size: 15px; }
  .maps { grid-template-columns: minmax(0, 1fr); }
  .medal-strip { padding-left: 60px; }
  .ms-count { display: none; }
}
