/* YakkaTools — identité « cozy pixel art » originale (ticket #39) : parchemin, nature, panneaux de bois
   lisibles, logo et décor pixel art dessinés pour le projet (public/brand/, docs/BRAND_ASSETS.md).
   Mobile d'abord (360 px), contraste AA (texte ≥ 4.5:1), cibles ≥ 44 px, focus visible, mouvement réduit.
   Aucune ressource tierce (polices système), aucun style en ligne (CSP). */
:root {
  --bg: #f5efdc; --panel: #fffaf0; --fg: #23301c; --muted: #4b5340;
  --brand: #2e6a2a; --brand-fg: #ffffff; --accent: #8a4a12; --soil: #6b4423; --crop: #e3b23c;
  --border: #23301c; --focus: #b34700; --shadow: #23301c; --grass: #4f8a3c; --wood: #c98f52;
  --radius: 6px; --gap: 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141a10; --panel: #1f2818; --fg: #eef3e4; --muted: #c9d3ba;
    --brand: #93d36b; --brand-fg: #10180b; --accent: #f0b46a; --soil: #a0703f; --crop: #e3b23c;
    --border: #93d36b; --focus: #ffb366; --shadow: #000000; --grass: #2e6a2a; --wood: #a0703f;
  }
  .scene { filter: brightness(.8) saturate(.9); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: var(--gap); top: var(--gap); background: var(--panel); color: var(--fg); padding: .5rem; z-index: 10; }

/* En-tête : marque, navigation, langues ; s'enroule sur mobile */
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem var(--gap);
  padding: .5rem var(--gap) calc(.5rem + 6px); border-bottom: 4px solid var(--soil);
  /* Lisière d'herbe pixel (6 px) posée sur la bande de terre, sous le contenu de l'en-tête */
  background: linear-gradient(var(--panel), var(--panel)) top / 100% calc(100% - 6px) no-repeat,
    repeating-linear-gradient(90deg, var(--brand) 0 8px, var(--grass) 8px 16px); }
/* Pixel art : agrandi sans flou (logo, décor) */
.pixel { image-rendering: crisp-edges; image-rendering: pixelated; }
.brand img { display: block; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--fg); text-decoration: none; font-weight: 800;
  font-size: 1.2rem; letter-spacing: .02em; min-height: 44px; }
.menu { display: flex; flex-wrap: wrap; gap: .25rem; order: 3; width: 100%; }
.menu a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem; border-radius: var(--radius);
  color: var(--fg); text-decoration: none; font-weight: 600; border: 2px solid transparent; }
.menu a:hover { border-color: var(--brand); }
.menu a[aria-current="page"] { background: var(--brand); color: var(--brand-fg); }
.langs { display: flex; gap: .25rem; }
@media (min-width: 720px) { .menu { order: 0; width: auto; } }

button, .button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  padding: 0 .75rem; border-radius: var(--radius); border: 2px solid var(--brand); background: transparent; color: var(--fg);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
button[aria-pressed="true"] { background: var(--brand); color: var(--brand-fg); }
.button { background: var(--brand); color: var(--brand-fg); box-shadow: 0 4px 0 var(--shadow); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

main { flex: 1; width: 100%; max-width: 64rem; margin: 0 auto; padding: var(--gap); }
h1 { font-size: clamp(1.6rem, 7vw, 2.75rem); line-height: 1.15; margin: .5rem 0; }
h2 { font-size: 1.25rem; margin: .25rem 0; }
p { color: var(--muted); }
.lead { font-size: 1.1rem; max-width: 40rem; }

/* Bandeau d'accueil : décor pixel art (ciel, collines, clôture, cultures) puis panneau de bois lisible */
.hero { background: var(--panel); border: 3px solid var(--border); border-radius: var(--radius); padding: 0;
  overflow: hidden; box-shadow: 0 6px 0 var(--shadow); margin: .5rem 0 1.5rem; }
.scene { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; object-position: bottom; }
.sign { padding: 1.25rem; border-top: 6px solid var(--wood); }
.badge, .tag { display: inline-block; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--accent); border: 2px solid currentColor; border-radius: 999px; padding: .1rem .6rem; margin: 0; }

/* Cartes des rubriques : une colonne sur mobile, deux au-delà */
.cards { display: grid; gap: var(--gap); grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { display: block; min-height: 44px; padding: 1rem 1.25rem; border: 3px solid var(--border); border-radius: var(--radius);
  background: var(--panel); color: var(--fg); text-decoration: none; box-shadow: 0 6px 0 var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--shadow); }
.card:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--shadow); }
.card-icon { font-size: 2rem; line-height: 1; }

/* États vides (catalogue, espace, 404) : parcelle labourée sans culture, message, actions */
.empty { text-align: center; background: var(--panel); border: 3px dashed var(--soil); border-radius: var(--radius);
  padding: 1.5rem 1rem; margin: .5rem 0 1.5rem; }
.empty p { max-width: 36rem; margin-left: auto; margin-right: auto; }
.plot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 6rem; margin: 0 auto 1rem; }
.plot span { aspect-ratio: 1; border-radius: 4px; background: var(--soil);
  background-image: repeating-linear-gradient(180deg, transparent 0 5px, var(--shadow) 5px 7px); opacity: .85; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.25rem; }
.button.secondary { background: var(--panel); color: var(--fg); }
.button:active { transform: translateY(4px); box-shadow: none; }

/* Espace privé : panneaux, formulaires, messages, notes */
.panel { background: var(--panel); border: 3px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem;
  box-shadow: 0 6px 0 var(--shadow); margin: .5rem 0 1.5rem; }
.panel h3 { font-size: 1.05rem; margin: 1.25rem 0 .25rem; }
.form { display: flex; flex-direction: column; gap: .35rem; max-width: 32rem; }
.form label { font-weight: 600; color: var(--fg); margin-top: .5rem; }
.form .actions { justify-content: flex-start; margin-top: .75rem; }
input, textarea, select { width: 100%; min-height: 44px; padding: .5rem .75rem; border: 2px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--fg); font: inherit; }
textarea { resize: vertical; }
.notice { border: 3px solid var(--accent); border-radius: var(--radius); background: var(--panel); color: var(--fg);
  padding: .75rem 1rem; font-weight: 600; }
.notice.ok { border-color: var(--brand); }
.notes { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .75rem; }
.note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
  border: 2px solid var(--soil); border-radius: var(--radius); padding: .5rem .75rem; }
.note p { margin: 0; color: var(--fg); white-space: pre-wrap; overflow-wrap: anywhere; flex: 1 1 12rem; }
.who { color: var(--fg); overflow-wrap: anywhere; }
button.danger { border-color: var(--accent); color: var(--fg); }
button.danger:hover { background: var(--accent); color: var(--panel); }

/* Administration des données : fil d'Ariane, listes de fiches, états, erreurs par champ, historique */
.crumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .75rem; list-style: none; padding: 0; margin: .25rem 0; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.crumbs li + li::before { content: "›"; margin-right: .75rem; color: var(--muted); }
.plain { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.card h2 { margin: 0; }
.card p { margin: .25rem 0 0; }
.actions.start { justify-content: flex-start; }
.rows { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .5rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; background: var(--panel);
  border: 2px solid var(--soil); border-radius: var(--radius); padding: .25rem .75rem; }
.row a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; overflow-wrap: anywhere; flex: 1 1 10rem; }
code { overflow-wrap: anywhere; }
.badge.live { color: var(--brand); }
.field-error { color: var(--fg); font-weight: 600; margin: 0; padding-left: .5rem; border-left: 4px solid var(--accent); }
.warning { color: var(--fg); padding-left: .5rem; border-left: 4px solid var(--soil); }
[aria-invalid="true"] { border-color: var(--accent); border-width: 3px; }
.history { padding-left: 1.25rem; margin: .5rem 0; }
.history > li { margin-bottom: .75rem; }
.history p { margin: 0; color: var(--fg); overflow-wrap: anywhere; }
.changes { margin: .25rem 0 0; padding-left: 1rem; color: var(--muted); overflow-wrap: anywhere; }
.change-field { font-weight: 600; color: var(--fg); }

/* Catalogue public : filtres, cartes d'espèces, faits (dl), étiquettes, sources, inconnues visibles */
.filters { display: grid; gap: .5rem var(--gap); grid-template-columns: 1fr; }
@media (min-width: 640px) { .filters { grid-template-columns: 1fr 1fr; } .filters .actions { grid-column: 1 / -1; } }
.filter { display: flex; flex-direction: column; gap: .25rem; }
.filter label { font-weight: 600; color: var(--fg); }
.filters .actions { justify-content: flex-start; margin-top: .5rem; }
.count { color: var(--fg); }
.hint { font-size: .95rem; }
.species h3 { margin: 0 0 .5rem; font-size: 1.2rem; }
.species h3 a { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.facts { display: grid; gap: .35rem; margin: 0; }
.facts > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
.facts dt { font-weight: 700; color: var(--fg); min-width: 6rem; }
.facts dd { margin: 0; color: var(--fg); overflow-wrap: anywhere; }
.facts.wide { margin-top: 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: 0; }
a.tag { display: inline-flex; align-items: center; min-height: 44px; text-transform: none; letter-spacing: 0; text-decoration: none; }
a.tag:hover { background: var(--accent); color: var(--panel); }
.unknown { color: var(--muted); }
.text { color: var(--fg); white-space: pre-line; overflow-wrap: anywhere; }
.sources, .glossary { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .75rem; }
.sources > li, .glossary > li { border-left: 4px solid var(--soil); padding-left: .75rem; }
.sources p, .glossary p { margin: 0; overflow-wrap: anywhere; }
.glossary a { display: inline-flex; align-items: center; min-height: 44px; }
details.panel summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--fg); }
/* Administration : cases à cocher d'une liaison multiple (éléments d'une espèce) */
.checks { border: 2px solid var(--border); border-radius: var(--radius); padding: .5rem .75rem; margin: .5rem 0 0; }
.checks legend { font-weight: 600; color: var(--fg); padding: 0 .25rem; }
.checks p { margin: .25rem 0; }
.check { display: flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 400; color: var(--fg); }
.check input { width: 1.5rem; min-height: 1.5rem; height: 1.5rem; margin: 0; }

.foot { border-top: 4px solid var(--soil); padding: .5rem var(--gap); text-align: center; font-size: .9rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .card:hover, .card:active, .button:active { transform: none; }
}
/* Catalogue : onglets Yakkamons / Compétences (ticket #14), sans JavaScript */
.tabs { display: flex; gap: .5rem; margin: .25rem 0 0; }
/* Mobile d'abord (ticket #76) : une seule ligne défilante horizontalement, au lieu de plusieurs lignes de
   boutons avant le contenu ; l'onglet courant est amené en vue par app.js. Retour à la ligne dès 720 px. */
.tabs { position: relative; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; padding-bottom: .35rem; scrollbar-width: thin; }
.tabs .tab { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; padding: 0 .75rem; }
@media (min-width: 720px) { .tabs { flex-wrap: wrap; overflow-x: visible; padding-bottom: 0; } .tabs .tab { padding: 0 1rem; } }
.tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; font-weight: 700;
  border: 2px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--fg); background: var(--panel); }
.tab:hover { border-color: var(--brand); }
.tab[aria-current="page"] { background: var(--brand); color: var(--brand-fg); border-color: var(--brand); }
.msg-text { margin: .25rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Référentiel du monde (ticket #76) : statuts de confiance, combats et adversaires */
.badge.status-to_verify, .badge.status-user_report, .badge.status-hypothesis { text-transform: none; letter-spacing: 0;
  color: var(--fg); border: 1px dashed var(--border); }
.battles, .opponents { display: grid; gap: var(--gap); padding: 0; }
.opponents > li { border-top: 1px solid var(--border); padding-top: .5rem; }

/* Guides (ticket #38) : texte bilingue, illustrations annotées (marqueurs positionnés par classes, pas de 5 %,
   car la CSP interdit les styles en ligne), bandeau d'obsolescence. */
.guide-text h3 { margin-top: 1.5rem; }
.guide-text ul, .unknowns ul { padding-left: 1.25rem; }
.guide-figure { margin: 1rem 0; }
.annotated { position: relative; display: inline-block; max-width: 100%; }
.annotated img { display: block; max-width: 100%; height: auto; border-radius: var(--radius); border: 2px solid var(--border); }
.marks { list-style: none; margin: 0; padding: 0; }
.mark { position: absolute; transform: translate(-50%, -50%); min-width: 1.75rem; height: 1.75rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem;
  background: var(--brand); color: var(--brand-fg); border: 2px solid var(--brand-fg); }
.guide-figure figcaption { margin-top: .5rem; }
.legend { padding-left: 1.75rem; }
.notice.warning { border-color: var(--accent); }
.badge.warning { border-color: var(--accent); }
.checks-list { padding-left: 1.25rem; }
.ax-0 { left: 0%; } .ax-5 { left: 5%; } .ax-10 { left: 10%; } .ax-15 { left: 15%; } .ax-20 { left: 20%; } 
.ax-25 { left: 25%; } .ax-30 { left: 30%; } .ax-35 { left: 35%; } .ax-40 { left: 40%; } .ax-45 { left: 45%; } 
.ax-50 { left: 50%; } .ax-55 { left: 55%; } .ax-60 { left: 60%; } .ax-65 { left: 65%; } .ax-70 { left: 70%; } 
.ax-75 { left: 75%; } .ax-80 { left: 80%; } .ax-85 { left: 85%; } .ax-90 { left: 90%; } .ax-95 { left: 95%; } 
.ax-100 { left: 100%; } 
.ay-0 { top: 0%; } .ay-5 { top: 5%; } .ay-10 { top: 10%; } .ay-15 { top: 15%; } .ay-20 { top: 20%; } 
.ay-25 { top: 25%; } .ay-30 { top: 30%; } .ay-35 { top: 35%; } .ay-40 { top: 40%; } .ay-45 { top: 45%; } 
.ay-50 { top: 50%; } .ay-55 { top: 55%; } .ay-60 { top: 60%; } .ay-65 { top: 65%; } .ay-70 { top: 70%; } 
.ay-75 { top: 75%; } .ay-80 { top: 80%; } .ay-85 { top: 85%; } .ay-90 { top: 90%; } .ay-95 { top: 95%; } 
.ay-100 { top: 100%; } 
