/* Vies sauvages — styles */
:root {
  --fond: #f6f2ea;
  --fond2: #efe8db;
  --carte: #fffdf8;
  --texte: #2a251f;
  --doux: #6d655a;
  --bord: #e2d9c8;
  --accent: #8a6a3d;
  --accent-fort: #6a4e28;
  --accent-doux: #efe3cd;
  --danger: #b4412f;
  --ok: #4f7a3a;
  --ombre: 0 1px 2px rgba(60, 40, 10, .06), 0 6px 24px rgba(60, 40, 10, .07);
  --rayon: 14px;
  --titre: 'Fraunces', Georgia, 'Times New Roman', serif;
  --corps: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
body[data-espece="savane"] { --fond: #f7efe1; --fond2: #f0e3cb; --accent: #b86b1f; --accent-fort: #8a4c12; --accent-doux: #f6e1c2; --bord: #e8d6b8; }
body[data-espece="ocean"] { --fond: #edf5f4; --fond2: #dcebea; --accent: #17808d; --accent-fort: #0e5c66; --accent-doux: #d3ecec; --bord: #c9dfdd; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #16140f; --fond2: #1f1c16; --carte: #23201a; --texte: #ece6da; --doux: #a89f90; --bord: #38322a;
    --accent: #d2a46a; --accent-fort: #e8bf86; --accent-doux: #3a3022; --danger: #e07a66; --ok: #8fbf72;
    --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .3); color-scheme: dark;
  }
  :root:not([data-theme="light"]) body[data-espece="savane"] { --fond: #1a150e; --fond2: #251d12; --accent: #e39a4e; --accent-fort: #f2b877; --accent-doux: #3d2b16; --bord: #3d3122; }
  :root:not([data-theme="light"]) body[data-espece="ocean"] { --fond: #0d1719; --fond2: #132225; --carte: #172629; --accent: #4cc0c9; --accent-fort: #7fd8de; --accent-doux: #173a3e; --bord: #24393c; }
}
:root[data-theme="dark"] {
  --fond: #16140f; --fond2: #1f1c16; --carte: #23201a; --texte: #ece6da; --doux: #a89f90; --bord: #38322a;
  --accent: #d2a46a; --accent-fort: #e8bf86; --accent-doux: #3a3022; --danger: #e07a66; --ok: #8fbf72;
  --ombre: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .3); color-scheme: dark;
}
:root[data-theme="dark"] body[data-espece="savane"] { --fond: #1a150e; --fond2: #251d12; --accent: #e39a4e; --accent-fort: #f2b877; --accent-doux: #3d2b16; --bord: #3d3122; }
:root[data-theme="dark"] body[data-espece="ocean"] { --fond: #0d1719; --fond2: #132225; --carte: #172629; --accent: #4cc0c9; --accent-fort: #7fd8de; --accent-doux: #173a3e; --bord: #24393c; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.55 var(--corps); transition: background .6s ease;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--titre); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: .8rem; font-family: var(--corps); text-transform: uppercase; letter-spacing: .08em; color: var(--doux); font-weight: 600; }
a { color: var(--accent-fort); }
button { font: inherit; color: inherit; cursor: pointer; }
small { display: block; font-size: .78rem; color: var(--doux); font-weight: 400; }

/* Barre du haut */
.barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--bord); background: color-mix(in srgb, var(--fond) 88%, transparent); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.logo { background: none; border: 0; font-family: var(--titre); font-size: 1.25rem; font-weight: 700; padding: 4px 0; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.lien-nav { background: none; border: 1px solid transparent; border-radius: 999px; padding: 6px 12px; font-size: .9rem; color: var(--doux); }
.lien-nav:hover, .lien-nav:focus-visible { border-color: var(--bord); color: var(--texte); }
.bandeau-classe { background: var(--accent-doux); color: var(--accent-fort); text-align: center; font-size: .88rem; padding: 6px 16px; }

main { max-width: 1180px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 64px; }
.ecran { display: none; animation: apparait .45s ease; }
.ecran.actif { display: block; }
@keyframes apparait { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chapo { font-size: 1.08rem; color: var(--doux); max-width: 62ch; }
.surtitre { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--accent); font-weight: 600; margin: 0 0 6px; }
.aide { font-size: .85rem; color: var(--doux); margin: .5em 0 0; }

/* Boutons */
.btn { border: 1px solid var(--bord); background: var(--carte); border-radius: 999px; padding: 10px 20px; font-weight: 500; transition: transform .15s ease, background .2s, border-color .2s; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.98); }
.btn.principal { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; padding: 12px 28px; font-size: 1.05rem; }
.btn.principal:hover { background: var(--accent-fort); }
:root[data-theme="dark"] .btn.principal { color: #15120d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.principal { color: #15120d; } }
.btn.petit { padding: 6px 12px; font-size: .9rem; }
.btn.discret { background: transparent; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Accueil */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 48px); align-items: center; margin: 12px 0 28px; }
.illu-hero { width: 100%; height: auto; border-radius: 20px; box-shadow: var(--ombre); display: block; }
.reglages { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: clamp(16px, 3vw, 28px); box-shadow: var(--ombre); }
fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 600; margin-bottom: 8px; font-size: .95rem; }
.segment { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.segment label { position: relative; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span { display: block; border: 1px solid var(--bord); border-radius: 12px; padding: 10px 12px; height: 100%; cursor: pointer; transition: border-color .2s, background .2s; font-weight: 500; }
.segment input:checked + span { border-color: var(--accent); background: var(--accent-doux); box-shadow: inset 0 0 0 1px var(--accent); }
.segment input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.case { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.case input { accent-color: var(--accent); width: 18px; height: 18px; }
.comment { margin-top: 36px; max-width: 760px; }
.comment ul { padding-left: 1.1em; }
.comment li { margin: .45em 0; }

/* Tirage */
.tirage { max-width: 620px; margin: 4vh auto 0; text-align: center; }
.roulette { font-family: var(--titre); font-size: clamp(1.6rem, 5vw, 2.4rem); min-height: 3.2em; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.roulette .pays { font-family: var(--corps); font-size: .95rem; color: var(--doux); }
.roulette.fin { animation: pulse .6s ease; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.acte { text-align: left; background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 24px; box-shadow: var(--ombre); margin-top: 8px; animation: apparait .5s ease; position: relative; }
.acte::before { content: ''; position: absolute; inset: 8px; border: 1px dashed var(--bord); border-radius: 10px; pointer-events: none; }
.acte-tete { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; }
.acte-emoji { font-size: 3rem; }
.acte-liste { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: .95rem; }
.acte-liste dt { color: var(--doux); }
.acte-liste dd { margin: 0; font-weight: 500; }
.acte-desc { color: var(--doux); font-size: .95rem; }
.acte-nom { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.acte-nom input, textarea, select { font: inherit; color: var(--texte); background: var(--fond); border: 1px solid var(--bord); border-radius: 10px; padding: 8px 10px; }
.acte-nom input { flex: 1; min-width: 0; }

/* Jeu */
.jeu-tete { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.identite { display: flex; gap: 12px; align-items: center; }
.id-emoji { font-size: 2.4rem; }
.identite h2 { margin: 0; }
.id-sous { margin: 0; color: var(--doux); font-size: .92rem; }
.age-bloc { text-align: right; display: flex; flex-direction: column; }
.age-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--doux); }
.age { font-family: var(--titre); font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stade { font-size: .88rem; color: var(--accent-fort); font-weight: 500; }
.commandes { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0 8px; }
.vitesses { display: inline-flex; border: 1px solid var(--bord); border-radius: 999px; overflow: hidden; background: var(--carte); }
.vitesses button { border: 0; background: none; padding: 6px 11px; font-size: .88rem; font-variant-numeric: tabular-nums; }
.vitesses button.actif { background: var(--accent); color: #fff; }
.priorite { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; color: var(--doux); }
.priorite select { padding: 5px 8px; }
.commandes .auto { margin: 0; font-size: .9rem; }
#btn-quitter { margin-left: auto; }
.progression { height: 3px; background: var(--bord); border-radius: 3px; overflow: hidden; margin-bottom: 18px; }
#barre-temps { height: 100%; width: 0; background: var(--accent); }

.jeu-grille { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.scene { border-radius: var(--rayon); overflow: hidden; aspect-ratio: 5 / 2; box-shadow: var(--ombre); background: var(--fond2); }
.scene svg { width: 100%; height: 100%; display: block; }
.carte-evt { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: clamp(18px, 3vw, 28px); margin-top: 16px; box-shadow: var(--ombre); min-height: 180px; }
.carte-evt .evt-tete { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.carte-evt .evt-icone { font-size: 1.6rem; }
.carte-evt h2 { margin: 0; font-size: 1.35rem; }
.carte-evt .evt-texte { font-size: 1.05rem; margin: 0 0 14px; }
.carte-evt.jalon { border-color: var(--accent); }
.carte-evt.ambiance .evt-texte { color: var(--doux); font-style: italic; }
.carte-evt.entre { animation: apparait .4s ease; }
.choix { display: grid; gap: 8px; }
.choix button { text-align: left; border: 1px solid var(--bord); background: var(--fond); border-radius: 12px; padding: 12px 14px; transition: border-color .15s, background .15s, transform .1s; display: flex; gap: 10px; align-items: baseline; }
.choix button:hover, .choix button:focus-visible { border-color: var(--accent); background: var(--accent-doux); }
.choix button .touche { font-size: .75rem; color: var(--doux); border: 1px solid var(--bord); border-radius: 6px; padding: 0 6px; flex: none; font-variant-numeric: tabular-nums; }
.choix button.choisi { border-color: var(--accent); background: var(--accent-doux); }
.choix button:disabled { cursor: default; opacity: .55; }
.choix button.choisi:disabled { opacity: 1; }
.resultats p { margin: 10px 0 0; padding-left: 12px; border-left: 3px solid var(--accent); animation: apparait .4s ease; }
.resultats p.mort { border-color: var(--danger); }
.carte-evt.fin { text-align: center; border-color: var(--bord); }
.carte-evt.fin .bougie { font-size: 2.4rem; display: block; margin-bottom: 6px; animation: flamme 2.4s ease-in-out infinite; }
@keyframes flamme { 50% { transform: scale(1.06) rotate(-2deg); opacity: .85; } }
.carte-evt.fin .evt-texte { max-width: 52ch; margin-left: auto; margin-right: auto; }

.col-laterale { display: grid; gap: 14px; }
.panneau { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px; }
.jauges { display: grid; gap: 10px; }
.jauge { display: grid; grid-template-columns: 1.6em 1fr auto; gap: 4px 8px; align-items: center; position: relative; }
.jauge .nom { font-size: .9rem; font-weight: 500; }
.jauge .val { font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--doux); min-width: 2.2em; text-align: right; }
.jauge .piste { grid-column: 2 / 4; height: 8px; background: var(--fond2); border-radius: 8px; overflow: hidden; }
.jauge .rempli { height: 100%; background: var(--accent); border-radius: 8px; transition: width .7s cubic-bezier(.2, .8, .2, 1), background .3s; }
.jauge.bas .rempli { background: var(--danger); }
.jauge.bas .val { color: var(--danger); font-weight: 600; }
.jauge .delta { position: absolute; right: 0; top: -14px; font-size: .78rem; font-weight: 600; animation: delta 1.8s ease forwards; }
.jauge .delta.plus { color: var(--ok); }
.jauge .delta.moins { color: var(--danger); }
@keyframes delta { 0% { opacity: 0; transform: translateY(4px); } 20% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-4px); } }

.famille { font-size: .92rem; }
.famille ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.famille li { display: flex; justify-content: space-between; gap: 8px; }
.famille .mort-txt { color: var(--doux); text-decoration: line-through; }
.famille .chiffre { font-family: var(--titre); font-size: 1.6rem; font-weight: 700; line-height: 1; }
.famille .ligne-chiffres { display: flex; gap: 16px; margin-bottom: 8px; }
.famille .ligne-chiffres div span { display: block; font-size: .78rem; color: var(--doux); }
.courbe { width: 100%; height: 56px; display: block; }
.courbe path.aire { fill: var(--accent-doux); }
.courbe path.ligne { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }

.grille-vie { display: grid; grid-template-columns: repeat(auto-fill, minmax(12px, 1fr)); gap: 3px; }
.grille-vie i { aspect-ratio: 1; border-radius: 3px; background: transparent; border: 1px solid var(--bord); display: block; }
.grille-vie i.passe { border-color: transparent; }
.grille-vie i.passe { background: var(--accent); opacity: .55; }
.grille-vie i.passe.s1 { opacity: .3; } .grille-vie i.passe.s2 { opacity: .45; } .grille-vie i.passe.s3 { opacity: .6; } .grille-vie i.passe.s4 { opacity: .75; } .grille-vie i.passe.s5 { opacity: .9; }
.grille-vie i.ici { background: var(--accent-fort); opacity: 1; animation: pulse 1.6s ease infinite; }
.grille-vie i.fin { background: var(--danger); opacity: 1; }

.recit .journal { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; display: grid; gap: 8px; font-size: .9rem; }
.journal li { padding-left: 10px; border-left: 2px solid var(--bord); }
.journal li .a { display: block; font-size: .72rem; color: var(--doux); text-transform: uppercase; letter-spacing: .06em; }
.journal li.jalon { border-color: var(--accent); }
.journal li.mort { border-color: var(--danger); }
.journal li.choix { color: var(--accent-fort); }
.journal li.ambiance, .journal li.fratrie { color: var(--doux); font-style: italic; }

/* Modal */
.voile { position: fixed; inset: 0; background: rgba(10, 8, 5, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: apparait .3s ease; }
.voile[hidden] { display: none; }
.modal { background: var(--carte); border-radius: 18px; padding: clamp(20px, 4vw, 32px); max-width: 520px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.refl-question { font-family: var(--titre); font-size: 1.25rem; }
.refl-classe { background: var(--accent-doux); border-radius: 10px; padding: 10px 12px; font-size: .95rem; }
.modal textarea { width: 100%; resize: vertical; }

/* Toasts */
.toasts { position: fixed; bottom: 16px; right: 16px; left: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; z-index: 60; }
.toast { background: var(--texte); color: var(--fond); padding: 10px 14px; border-radius: 12px; font-size: .9rem; max-width: 360px; box-shadow: var(--ombre); animation: toast 4.5s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* Mémorial */
.fiche { max-width: 780px; margin: 0 auto; }
.plaque { background: var(--carte); border: 1px solid var(--bord); border-radius: 20px; padding: clamp(20px, 5vw, 44px); box-shadow: var(--ombre); text-align: center; position: relative; }
.plaque::before { content: ''; position: absolute; inset: 10px; border: 1px solid var(--bord); border-radius: 14px; pointer-events: none; }
.plaque .grand-emoji { font-size: 3.4rem; display: block; }
.plaque h1 { margin: 6px 0 2px; }
.plaque .sous { color: var(--doux); margin: 0; }
.plaque .age-fin { font-family: var(--titre); font-size: 1.5rem; margin: 18px 0 4px; }
.plaque .cause { display: inline-block; background: var(--accent-doux); color: var(--accent-fort); border-radius: 999px; padding: 4px 14px; font-weight: 600; font-size: .9rem; }
.plaque .texte-mort { max-width: 52ch; margin: 14px auto 0; color: var(--doux); font-style: italic; }
.plaque .bougies { margin-top: 12px; font-size: 1.2rem; letter-spacing: 4px; }
.blocs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.bloc { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 18px; }
.bloc ul { margin: 0; padding-left: 1.1em; }
.bloc li { margin: .3em 0; }
.bilan { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: .95rem; }
.bilan dt { color: var(--doux); }
.bilan dd { margin: 0; font-weight: 600; text-align: right; }
.reflexions blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--accent); }
.reflexions blockquote p { margin: 0; }
.reflexions blockquote .q { color: var(--doux); font-size: .88rem; }
.vraie-vie { margin-top: 18px; background: var(--accent-doux); border-radius: var(--rayon); padding: clamp(18px, 3vw, 28px); }
.vraie-vie h2 { margin-bottom: .3em; }
.statut { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 10px; }
.statut .code { display: inline-grid; place-items: center; width: 2.4em; height: 2.4em; border-radius: 50%; color: #fff; font-size: .85rem; }
.statut .code.VU { background: #d39a1c; } .statut .code.EN { background: #d36a1c; } .statut .code.LC { background: #4f8a3a; } .statut .code.CR { background: #b4412f; }
.assos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 12px; }
.assos a { display: block; background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--texte); }
.assos a strong { color: var(--accent-fort); }
.assos a span { display: block; font-size: .85rem; color: var(--doux); }
.grille-vie.memo { margin-top: 14px; }
.note-memo { width: 100%; margin-top: 10px; font: inherit; color: var(--texte); background: var(--fond); border: 1px solid var(--bord); border-radius: 10px; padding: 10px 12px; }
.note-memo:focus, .acte-nom input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* Encyclopédie et listes */
.onglets { display: flex; gap: 8px; margin: 12px 0 18px; flex-wrap: wrap; }
.onglets button { border: 1px solid var(--bord); background: var(--carte); border-radius: 999px; padding: 8px 16px; }
.onglets button.actif { background: var(--accent); color: #fff; border-color: var(--accent); }
.progres-encyclo { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 16px; }
.progres-encyclo div { font-size: .9rem; color: var(--doux); }
.progres-encyclo strong { display: block; font-family: var(--titre); font-size: 1.6rem; color: var(--texte); }
.cartes-faits { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.fait { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 14px; font-size: .92rem; }
.fait h4 { margin: 0 0 6px; font-family: var(--titre); font-size: 1.02rem; font-weight: 600; }
.fait p { margin: 0; color: var(--doux); }
.fait.verrou { opacity: .55; border-style: dashed; }
.causes-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; list-style: none; padding: 0; }
.causes-liste li { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 8px 12px; display: flex; justify-content: space-between; gap: 8px; font-size: .92rem; }
.causes-liste li.verrou { color: var(--doux); border-style: dashed; }
.vie-ligne { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.vie-ligne .em { font-size: 1.8rem; }
.vie-ligne .t { font-weight: 600; }
.vie-ligne .d { font-size: .88rem; color: var(--doux); }
.vie-ligne .boutons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.vide { color: var(--doux); font-style: italic; }
.noscript { text-align: center; padding: 40px; }

/* Animations des scènes */
.astre { animation: flotter 9s ease-in-out infinite; }
.vague { animation: houle 7s linear infinite; }
.herbier path, .herbes path { transform-box: fill-box; transform-origin: bottom; animation: onduler 4s ease-in-out infinite alternate; }
.nage { animation: nager 6s ease-in-out infinite; }
.sargasses { animation: flotter 10s ease-in-out infinite; }
.soleil { animation: flotter 9s ease-in-out infinite; }
@keyframes flotter { 50% { transform: translateY(4px); } }
@keyframes houle { from { transform: translateX(0); } to { transform: translateX(-100px); } }
@keyframes onduler { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes nager { 50% { transform: translate(6px, -4px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Responsive */
@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .jeu-grille { grid-template-columns: minmax(0, 1fr); }
  .recit .journal { max-height: 260px; }
}
@media (max-width: 520px) {
  .barre { flex-wrap: wrap; }
  .nav { width: 100%; justify-content: space-between; }
  .lien-nav { padding: 6px 8px; font-size: .85rem; }
  .age-bloc { text-align: left; }
  #btn-quitter { margin-left: 0; }
  .vie-ligne { grid-template-columns: auto 1fr; }
  .vie-ligne .boutons { grid-column: 1 / -1; justify-content: flex-start; }
  .segment { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
html, body { max-width: 100%; overflow-x: clip; }

/* Impression : seulement la fiche mémorial */
@media print {
  .barre, .bandeau-classe, .toasts, .actions, .note-memo { display: none !important; }
  body { background: #fff; color: #000; }
  .ecran { display: none !important; }
  #ecran-memorial.actif { display: block !important; }
  .plaque, .bloc, .vraie-vie { box-shadow: none; break-inside: avoid; }
}
