/*
 * Thème « Herbier du chirurgien » : le recueil où le chirurgien range plantes, remèdes et poisons.
 * Dessin au trait seulement : nervures pour séparer, feuille à nervure centrale pour la sélection, jauges en
 * feuilles successives, numéros de spécimen, notes en marge en italique. Pas de textile, pas d'ombre.
 * Polices : Cormorant Garamond (titres, noms), Lora (texte), Josefin Sans (libellés, chiffres).
 */
:root[data-ui="herbier"] {
  --paper: #e9e8d9; --paper-2: #f3f2e7; --paper-3: #d9dfc9;
  --ink: #303b2d; --ink-soft: #5d6950; --line: #aab49a; --line-strong: #6f805e;
  --btn-top: #f3f2e7; --btn-bot: #f3f2e7; --icon: #303b2d;
  --sang: #a34f45;
  --grid: #a7b39a; --tile: #cbd3b8; --blocked: #59634c; --rough: #a58d66;
  --player: #527b49; --bot: #a34f45; --front: rgba(82, 123, 73, .18); --back: rgba(163, 79, 69, .14);
  --hp: #a9433e; --ap: #567d49; --ep: #b18a45; --accent: #527b49;
  --title: "Cormorant Garamond", Georgia, serif; --body: "Lora", Georgia, serif;
  --sc: "Josefin Sans", system-ui, sans-serif;
}
:root[data-ui="herbier"][data-theme="dark"] {
    --paper: #252d25; --paper-2: #303b30; --paper-3: #1d241d;
    --ink: #e1e5d3; --ink-soft: #b0baa0; --line: #596650; --line-strong: #8fa17b; --icon: #e1e5d3;
    --btn-top: #303b30; --btn-bot: #303b30;
    --sang: #df8977;
    --grid: #53664c; --tile: #3b4b38; --blocked: #1b241e; --rough: #75664a;
    --player: #9ac47f; --bot: #df8977; --front: rgba(154, 196, 127, .16); --back: rgba(223, 137, 119, .14);
    --hp: #e4776d; --ap: #a2c97e; --ep: #e1bd70; --accent: #9ac47f;
    color-scheme: dark;
}

:root[data-ui="herbier"] {
  --act: var(--choix, var(--player)); --on-act: var(--sur-choix, #f4f3ea);
  --feuille: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M3 21C3 9 10 3 21 3c0 11-6 18-18 18zm1-1.4L17.6 6 16.9 5.4 3.3 18.9z'/%3E%3C/svg%3E");
  --feuilles: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 12'%3E%3Cpath d='M1 6C4 1 12 1 17 6 12 11 4 11 1 6z'/%3E%3C/svg%3E") left center / 18px 100% repeat-x;
  --nervure: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 10'%3E%3Cpath d='M0 5h40M8 5l6-4M8 5l6 4M28 5l6-4M28 5l6 4' stroke='%238a9a78' stroke-width='.9' fill='none'/%3E%3C/svg%3E") left center / 40px 10px repeat-x;

  body { background: var(--paper); font-size: 14.5px; }
  h1, h2, .title { font-family: var(--title); font-weight: 600; }
  h1 { font-size: 32px; font-style: italic; font-weight: 500; }
  h2 { font-size: 22px; }
  h3 { font: 600 11.5px var(--sc); letter-spacing: .16em; text-transform: uppercase; color: var(--line-strong); }
  h3::after { border-top: 0; height: 10px; background: var(--nervure); }
  a { color: var(--ink); text-decoration-color: var(--act); text-underline-offset: 3px; }
  .muted { color: var(--muted); }
  .small { font-size: 12.5px; color: var(--muted); font-style: italic; }
  :focus-visible { outline: 1px solid var(--act); outline-offset: 3px; }

  /* Boutons : étiquettes de spécimen, filet fin et coin d'épingle. */
  button, select, input { background: var(--paper-2); border: 1px solid var(--line-strong); border-radius: 0; }
  button { color: var(--ink); font: 600 12px var(--sc); letter-spacing: .1em; text-transform: uppercase; }
  button:hover:not(:disabled) { background: var(--paper-3); }
  button:active:not(:disabled) { translate: 0 1px; }
  button:disabled { opacity: .45; }
  button.primary, a.btn.primary { background: var(--act); border-color: var(--act); color: var(--on-act); }
  button.danger { color: var(--sang); border-color: var(--sang); }
  select, input[type="text"], input[type="email"], input[type="number"] { color: var(--ink); font-family: var(--body); }
  input[type="range"], input[type="checkbox"], input[type="radio"] { accent-color: var(--act); border: 0; }
  a.btn { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line-strong); font: 600 12px var(--sc); letter-spacing: .1em; text-transform: uppercase; }
  button.link { background: none; border: 0; color: var(--ink); text-decoration: underline 1px var(--act); font: italic 400 1em var(--body); text-transform: none; letter-spacing: 0; }
  button.mini, .small-btn { font-size: 11px; }

  .ibtn { background: none; color: var(--icon); border: 1px solid transparent; }
  .ibtn:hover:not(:disabled) { border-color: var(--line); }
  .ibtn[aria-current="page"] { border-color: var(--act); color: var(--act); }

  .pills { gap: 0; }
  .pill { border-left: 1px solid var(--line); font: 600 13px var(--sc); padding: 2px 9px; }
  .pill:first-child { border-left: 0; }
  .pill small { font: 400 11px var(--sc); letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
  .pill.warm, .pill.alert { color: var(--act); }

  /* Planches : papier épais, filet fin. */
  .paper, .panel, .log, .card-pane { background: var(--paper-2); border: 1px solid var(--line); }
  .notice.quiet { border: 0; }

  .topbar { background: var(--paper-2); border-bottom: 1px solid var(--line-strong); }
  .topbar .muted, .topbar .small { color: var(--muted); }
  .avatar { background: var(--paper-3); color: var(--ink); border: 1px solid var(--line-strong); font: italic 500 26px var(--title); }
  .hero-name { font: 600 22px/1 var(--title); }
  .hero-sub { font: 400 11px var(--sc); letter-spacing: .14em; text-transform: uppercase; }
  .where .title { font-size: 19px; }
  .live { color: var(--act); }
  .settings-body { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line-strong); }
  .settings-body label { font: 600 11px var(--sc); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .settings-body select { color: var(--text); }
  .rail { border-right: 1px solid var(--line); }
  .rail hr { border: 0; height: 10px; background: var(--nervure); }
  @media (max-width: 760px) { .rail { border-right: 0; border-bottom: 1px solid var(--line); } }

  .board { background: var(--paper-2); border: 1px solid var(--line-strong); padding: 16px; }
  @media (max-width: 760px) { .board { padding: 8px; } }
  .hint { color: var(--muted); font-size: 12.5px; font-style: italic; }
  .flash { color: var(--sang); font-style: italic; }
  .flash.ok { color: var(--ap); }

  .minimap { border: 1px solid var(--line-strong); }
  .mm-pulse { border: 2px solid var(--act); border-radius: 50%; }
  .portrait canvas, canvas.skin { background: var(--paper-2); border: 1px solid var(--line); }
  .portrait-name .title { font-size: 34px; font-style: italic; }
  .quote { font-style: italic; border-left: 1px solid var(--line-strong); font-size: 13.5px; color: var(--muted); }
  .message .block + .block { border-top: 1px dotted var(--line-strong); }
  .message .block div:first-child { font-weight: 600; }

  /* Onglets : libellés de planche ; l'actif est souligné d'une nervure. */
  .side-tabs, .tabs { gap: 4px; }
  .side-tabs button, .tabs button, .look { background: none; border: 0; color: var(--muted); }
  .side-tabs button:active, .tabs button:active, .look:active { translate: none; }
  .side-tabs button[aria-pressed="true"], .tabs button[aria-pressed="true"], .look[aria-pressed="true"] {
    color: var(--act); background: var(--nervure); background-position: center bottom; background-size: 40px 8px; }
  .side-tabs { margin-bottom: 8px; }

  .who strong { font: 600 26px var(--title); }
  .tag { font: 600 11px var(--sc); letter-spacing: .06em; color: #fff; }

  /* Jauges : rang de feuilles ; les vides restent au trait pâle. */
  .bar .label { font: 600 11.5px var(--sc); letter-spacing: .08em; text-transform: uppercase; }
  .bar .track { background: none; height: 12px; position: relative; }
  .bar .track::before { content: ""; position: absolute; inset: 0; background: var(--line); opacity: .5; -webkit-mask: var(--feuilles); mask: var(--feuilles); }
  .bar .fill { position: relative; -webkit-mask: var(--feuilles); mask: var(--feuilles); }
  .gauge, .wear { background: var(--paper-3); height: 6px; border-radius: 0 6px; }
  .gauge i, .wear i { border-radius: 0 6px; }
  .gauge i { background: var(--line-strong); }
  .wear i { background: var(--line-strong); }
  .wear i.low { background: var(--sang); }

  .stats { gap: 0; }
  .stats div, .derived div { border-bottom: 1px dotted var(--line-strong); font: 600 10.5px var(--sc); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .stats b, .derived b { font: 600 28px/1.05 var(--title); color: var(--ink); }
  .derived b { font-size: 21px; }
  .derived b.over { color: var(--sang); }

  .log li, .reports li { border-left: 1px solid var(--line); }
  .log li.system { border-color: var(--act); color: var(--muted); font-style: italic; }
  .log li.attack, .reports li.attack { border-color: var(--ink); }
  .log li.defense, .reports li.defense { border-color: var(--sang); }
  .log li.move, .log li.energy, .log li.info, .reports li.move, .reports li.energy, .reports li.info { color: var(--muted); }
  .log details { font-size: 12.5px; color: var(--muted); }
  .log summary { color: var(--text); font-size: 13.5px; }
  .log .t { font: 400 11px var(--sc); letter-spacing: .06em; color: var(--muted); }
  .reports { font-size: 13.5px; }

  .roster.faded { opacity: .75; }
  .chip { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); font: 600 16px var(--title); letter-spacing: 0; text-transform: none; }
  .chip:active { translate: none; }
  .chip small { font: 400 10.5px var(--sc); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .chip.on { border-color: var(--act); box-shadow: inset 3px 0 0 var(--act); }
  .chip.healing small { color: var(--sang); }
  .chip.map small { color: var(--ap); }
  table.train { font-size: 13.5px; }
  table.train td { border-bottom: 1px dotted var(--line); }
  table.train td:nth-child(2), table.train tr.muted td { color: var(--muted); }

  .arena-head strong { font: 600 24px var(--title); }
  .companies li { border: 1px solid var(--line); }
  .companies li.mine { border-color: var(--act); box-shadow: inset 3px 0 0 var(--act); }
  .companies small { color: var(--muted); }
  .dot { background: var(--act); border-radius: 0 50%; }

  .banner { background: var(--paper-2); border-bottom: 1px solid var(--line-strong); }
  .banner .small, .banner .muted { color: var(--muted); }
  .banner-name { font: italic 500 38px/1 var(--title); }
  .gold-pill { font: 600 22px var(--sc); color: var(--ink); }

  /* Mercenaires : fiches de spécimen ; la choisie porte la feuille. */
  .tile { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); font: inherit; letter-spacing: 0; text-transform: none; text-align: left; }
  .tile:hover:not(:disabled) { border-color: var(--line-strong); }
  .tile:active:not(:disabled) { translate: none; }
  .tile.on { border-color: var(--act); box-shadow: inset 3px 0 0 var(--act); }
  .tile.on .tile-portrait::after { content: ""; position: absolute; left: 4px; top: 4px; width: 20px; height: 20px;
    background: var(--act); -webkit-mask: var(--feuille) center/contain no-repeat; mask: var(--feuille) center/contain no-repeat; }
  .tile-portrait { background: var(--paper); border: 1px solid var(--line); }
  .tile canvas.skin { border: 0; background: none; }
  .xp-badge { background: var(--act); color: var(--on-act); font: 600 11px var(--sc); }
  .tile-name { font: 600 22px/1.05 var(--title); }
  .tile-row { font-size: 12.5px; color: var(--muted); }
  .tile-row b { color: var(--text); font: 600 12.5px var(--sc); }
  .tile-empty { background: none; border-style: dashed; color: var(--muted); }
  .tile-plus { font: 500 38px var(--title); }

  .sheet-name { font: italic 500 44px/1 var(--title); }
  .train-line { border-bottom: 1px dotted var(--line); }
  .stat-line { font-size: 13.5px; }
  .stat-line > span:nth-child(3) { font: 600 15px var(--sc); }
  .trait { font-size: 13.5px; }
  .trait.plus b { color: var(--ap); }
  .trait.minus b { color: var(--sang); }
  .trait.zero { color: var(--muted); }
  .slot { background: var(--paper-2); border: 1px solid var(--line); }
  .slot-empty, .slot-taken { border-style: dashed; background: none; }

  .status { font: 600 10.5px var(--sc); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .status.map { color: var(--player); }
  .status.ready { color: var(--ap); }
  .status.resting { color: var(--ep); }
  .status.healing { color: var(--sang); }
  .warn { color: var(--sang); font-size: 12.5px; font-style: italic; }
  .gold { font-weight: 600; }
  .worn { font-size: 13.5px; }
  .worn th, .worn td { border-bottom: 1px dotted var(--line); }
  .worn thead th { font: 600 10.5px var(--sc); letter-spacing: .1em; text-transform: uppercase; color: var(--line-strong); border-bottom: 1px solid var(--line-strong); }
  .item { border-bottom: 1px dotted var(--line); }
  .item:last-child { border-bottom: 0; }

  .brand .title { font: italic 500 54px/1 var(--title); color: var(--ink); }
  .brand .small { font-size: 14px; }
  .page .card { background: var(--paper-2); border: 1px solid var(--line-strong); outline: 1px solid var(--line); outline-offset: 4px; }
  .page .error { color: var(--sang); font-style: italic; }
  .page .ok { color: var(--ap); }
  .page dt { color: var(--muted); font: 600 11px var(--sc); letter-spacing: .1em; text-transform: uppercase; }
  .page footer { font-size: 12.5px; color: var(--muted); }
  .skip { border-top: 1px dotted var(--line); }
  .nav { font: 600 12px var(--sc); letter-spacing: .1em; text-transform: uppercase; }
  .nav a { color: var(--muted); text-decoration: none; }
  .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline 1px var(--act); text-underline-offset: 5px; }
}
