/*
 * Ateliers, habillage (refonte artistique, Forge d'abord) : un lieu, quel que soit le thème de l'interface.
 * Bois sombre, fer forgé et laiton, panneaux de parchemin, lueur de braise. Les matières de l'atelier sont des
 * variables (--ws-*), redéfinies en mode sombre ; la couleur de l'atelier vient de --metier (base.css).
 * Les thèmes stylent button/select avec :root[data-ui] (0,2,1) : on reprend la main sous :root:root:root:root.
 * Textures : dégradés et un grain SVG en data: (CSP img-src data:). Aucune animation lourde.
 */
:root {
  --ws-bois: #2b1d13; --ws-bois-2: #3b2818; --ws-bois-3: #4d3420;
  --ws-fer: #26272a; --ws-fer-2: #3a3b3f; --ws-fer-hi: #6d6a64;
  --ws-laiton: #b8893a; --ws-laiton-hi: #e8c574; --ws-laiton-lo: #6a4a1a;
  --ws-parch: #ead9b6; --ws-parch-2: #dcc597; --ws-parch-3: #c9ad78; --ws-encre: #2c2015; --ws-encre-2: #6a5338;
  --ws-braise: #e26a26; --ws-lueur: rgba(255, 128, 40, .32);
  --ws-ok: #4f7f2c; --ws-ko: #a8261b; --ws-bloque: #6d6a64;
  --ws-commune: #8f8676; --ws-rare: #3d72b8; --ws-legende: #d19a2a; --ws-speciale: #8a4fd0;
  --ws-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .13 0 0 0 0 .05 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --ws-veine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='120'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.008 .22' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .5 -.12'/%3E%3C/filter%3E%3Crect width='300' height='120' filter='url(%23w)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] {
  --ws-bois: #1a110b; --ws-bois-2: #26190f; --ws-bois-3: #342315;
  --ws-parch: #cdb88f; --ws-parch-2: #bea677; --ws-parch-3: #a88d5d; --ws-encre: #22180f; --ws-encre-2: #57432b;
}

:root:root:root:root .ws-scene {
  --m: var(--metier, var(--ws-braise));
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 14px; border-radius: 6px; color: var(--ws-parch);
  font-family: 'Alegreya', Georgia, serif; font-size: 16px; line-height: 1.4;
  background: var(--ws-veine), radial-gradient(120% 70% at 50% 0%, var(--ws-bois-3), transparent 70%),
    linear-gradient(180deg, var(--ws-bois-2), var(--ws-bois));
  box-shadow: inset 0 0 0 2px var(--ws-fer), inset 0 0 0 3px var(--ws-laiton-lo), inset 0 0 60px rgba(0, 0, 0, .55);

  h1, h2, h3 { font-family: 'Cinzel', Georgia, serif; letter-spacing: .04em; margin: 0; color: inherit; }
  b, strong { font-weight: 700; }
  a { color: var(--ws-laiton-hi); }
  ul { list-style: none; margin: 0; padding: 0; }
  button, select, input { font-family: 'Alegreya', Georgia, serif; text-transform: none; letter-spacing: normal; clip-path: none; translate: none; filter: none; margin: 0; }
  svg { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
  svg .f { fill: color-mix(in srgb, currentColor 28%, transparent); }
  svg .t { stroke-width: 4; }
  .flash { margin: 0; }
  /* Décor de l'atelier : la forge rougeoie par en bas (forge naine : pierre, bronze et braises). */
  &[data-metier="forge"] { background: var(--ws-veine), radial-gradient(90% 40% at 50% 104%, var(--ws-lueur), transparent 70%),
    radial-gradient(120% 70% at 50% 0%, var(--ws-bois-3), transparent 70%), linear-gradient(180deg, var(--ws-bois-2), var(--ws-bois)); }

  /* L'enseigne : une planche ferrée, l'emblème dans un médaillon de laiton, la bourse à droite. */
  .ws-enseigne {
    display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 18px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--m) 22%, var(--ws-fer-2)), var(--ws-fer));
    border: 2px solid #0b0b0c; border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 0 0 4px rgba(0, 0, 0, .25), 0 6px 14px rgba(0, 0, 0, .45);
    position: relative;
  }
  .ws-enseigne::before, .ws-enseigne::after {
    content: ""; position: absolute; top: 8px; width: 8px; height: 8px; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--ws-laiton-hi), var(--ws-laiton-lo)); box-shadow: 0 1px 1px #000;
  }
  .ws-enseigne::before { left: 8px; } .ws-enseigne::after { right: 8px; }
  .ws-emblem {
    width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; color: var(--ws-laiton-hi);
    background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--m) 55%, #000), #120c08 75%);
    box-shadow: 0 0 0 3px var(--ws-laiton), 0 0 0 5px #0b0b0c, 0 0 22px var(--ws-lueur);
  }
  .ws-emblem-svg { width: 48px; height: 48px; }
  .ws-titre h1 { font-size: clamp(24px, 4vw, 36px); font-weight: 700; color: var(--ws-laiton-hi); text-shadow: 0 2px 0 #000, 0 0 18px var(--ws-lueur); }
  .ws-sub { margin: 2px 0 0; color: var(--ws-parch-2); font-size: 15px; }
  .ws-bourse { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

  /* Pastilles : or (pièce) et sablier (cycles de 12 h). */
  .ws-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; white-space: nowrap;
    background: rgba(0, 0, 0, .38); border: 1px solid var(--ws-laiton-lo); color: var(--ws-parch); font-size: 14px;
  }
  .ws-chip i { width: 18px; height: 18px; border-radius: 50%; flex: none; }
  .ws-or i { background: radial-gradient(circle at 35% 30%, #fff1b8, var(--ws-laiton) 45%, var(--ws-laiton-lo)); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25); }
  .ws-sablier i { border-radius: 2px; background: linear-gradient(var(--ws-laiton-hi), var(--ws-laiton-hi)) top / 100% 2px no-repeat,
    linear-gradient(var(--ws-laiton-hi), var(--ws-laiton-hi)) bottom / 100% 2px no-repeat, conic-gradient(from 135deg at 50% 50%, var(--ws-parch-2) 0 25%, transparent 0 50%, var(--ws-parch-2) 0 75%, transparent 0); }
  .ws-chip.ws-court { border-color: var(--ws-ko); color: #ffb4a8; }

  /* Onglets : plaques de fer, l'atelier choisi éclairé à sa couleur. */
  .ws-onglets { display: flex; gap: 8px; flex-wrap: wrap; }
  .ws-onglet {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; cursor: pointer; border-radius: 3px;
    font: 600 15px 'Cinzel', Georgia, serif; color: var(--ws-parch-2);
    background: linear-gradient(180deg, var(--ws-fer-2), var(--ws-fer)); border: 1px solid #0b0b0c;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 2px 0 #0b0b0c;
  }
  .ws-onglet:hover { color: var(--ws-parch); background: linear-gradient(180deg, var(--ws-fer-hi), var(--ws-fer-2)); }
  .ws-onglet[aria-pressed="true"] {
    color: #fff4d8; background: linear-gradient(180deg, color-mix(in srgb, var(--metier) 70%, #000), color-mix(in srgb, var(--metier) 35%, #000));
    box-shadow: inset 0 0 0 1px var(--ws-laiton), 0 0 12px color-mix(in srgb, var(--metier) 50%, transparent);
  }
  .ws-onglet-emb svg { width: 22px; height: 22px; display: block; }
  .ws-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ws-braise); box-shadow: 0 0 6px var(--ws-braise); }
  .ws-verrou { font: 400 12px 'Alegreya', serif; opacity: .7; }

  /* Composition : plans | fiche | établi ; le coffre dessous. */
  .ws { display: flex; flex-direction: column; gap: 14px; }
  .ws-atelier { display: grid; grid-template-columns: minmax(230px, 300px) minmax(0, 1fr) minmax(210px, 260px); gap: 14px; align-items: start; }

  /* Plaques de titre (laiton gravé). */
  .ws-plaque {
    display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 5px 12px; margin: 0 0 10px;
    font-size: 15px; font-weight: 700; color: #2a1a07; border-radius: 2px;
    background: linear-gradient(180deg, var(--ws-laiton-hi), var(--ws-laiton) 55%, var(--ws-laiton-lo));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 2px 3px rgba(0, 0, 0, .5); text-shadow: 0 1px 0 rgba(255, 240, 200, .5);
  }
  .ws-plaque span { font: 600 13px 'Alegreya', serif; opacity: .8; }
  .ws-filet { font-size: 14px; color: var(--ws-encre-2); display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; }
  .ws-filet::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--ws-encre-2), transparent); }

  /* Cartes de plan : vignette dans une fente de fer, liseré de rareté, état. */
  .ws-plans, .ws-etabli { padding: 10px; border-radius: 4px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5), inset 0 2px 8px rgba(0, 0, 0, .4); }
  .ws-cartes { display: grid; gap: 8px; max-height: 70vh; overflow-y: auto; padding: 2px; }
  .ws-carte {
    --q: var(--ws-commune);
    width: 100%; display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; padding: 6px; cursor: pointer; text-align: left;
    color: var(--ws-encre); border-radius: 3px; border: 0;
    background: var(--ws-grain), linear-gradient(180deg, var(--ws-parch), var(--ws-parch-2));
    box-shadow: inset 4px 0 0 var(--q), inset 0 0 0 1px rgba(60, 35, 10, .45), 0 2px 4px rgba(0, 0, 0, .45);
    transition: transform .12s ease, box-shadow .12s ease;
  }
  .ws-carte:hover { transform: translateY(-1px); }
  .ws-carte[aria-pressed="true"] { box-shadow: inset 4px 0 0 var(--q), inset 0 0 0 2px var(--ws-laiton), 0 0 0 2px var(--m), 0 0 14px var(--ws-lueur); }
  .ws-carte[data-etat="bloque"] { filter: saturate(.55); }
  .ws-carte[data-etat="bloque"] .ws-carte-art { opacity: .6; }
  .ws-carte-art, .ws-niche { display: grid; place-items: center; color: var(--ws-laiton-hi); border-radius: 3px;
    background: radial-gradient(circle at 50% 65%, color-mix(in srgb, var(--m) 40%, #1a120c), #0f0a07 80%);
    box-shadow: inset 0 0 0 2px #0b0b0c, inset 0 0 0 3px var(--ws-fer-hi), inset 0 4px 10px rgba(0, 0, 0, .7); }
  .ws-carte-art { width: 64px; height: 64px; }
  .ws-art-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .7)); }
  .ws-art-svg { width: 70%; height: 70%; }
  .ws-art-vide { opacity: .5; }
  .ws-carte-corps { display: flex; flex-wrap: wrap; gap: 3px 6px; align-items: center; min-width: 0; }
  .ws-carte-nom { flex: 1 0 100%; font: 700 15px 'Alegreya', serif; line-height: 1.2; }

  /* Rareté : une gemme et le mot. */
  [data-q="rare"] { --q: var(--ws-rare); } [data-q="légendaire"] { --q: var(--ws-legende); } [data-q="spéciale"] { --q: var(--ws-speciale); }
  .ws-q { --q: var(--ws-commune); background: none; border: 0; border-radius: 0; padding: 0; display: inline-flex; align-items: center; gap: 4px; font: 600 12px 'Alegreya SC', 'Alegreya', serif; color: color-mix(in srgb, var(--q) 70%, var(--ws-encre)); }
  .ws-q i { width: 9px; height: 9px; transform: rotate(45deg); background: linear-gradient(135deg, color-mix(in srgb, var(--q) 40%, #fff), var(--q) 60%, color-mix(in srgb, var(--q) 60%, #000)); box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
  .ws-q[data-q="rare"] { --q: var(--ws-rare); } .ws-q[data-q="légendaire"] { --q: var(--ws-legende); } .ws-q[data-q="spéciale"] { --q: var(--ws-speciale); }

  .ws-etat { margin-left: auto; font: 700 11px 'Alegreya SC', 'Alegreya', serif; padding: 1px 7px; border-radius: 2px; color: #fff7e6; background: var(--ws-bloque); }
  .ws-etat[data-etat="pret"] { background: var(--ws-ok); }
  .ws-etat[data-etat="manque"] { background: var(--ws-ko); }

  /* La fiche : un grand parchemin cloué dans un cadre de fer. */
  .ws-fiche {
    --q: var(--ws-commune);
    position: relative; padding: 18px 20px 20px; color: var(--ws-encre); border-radius: 3px;
    background: var(--ws-grain), radial-gradient(130% 90% at 50% 20%, var(--ws-parch) 45%, var(--ws-parch-2) 80%, var(--ws-parch-3));
    box-shadow: 0 0 0 3px #0b0b0c, 0 0 0 5px var(--ws-fer-hi), 0 0 0 7px #0b0b0c, 0 10px 24px rgba(0, 0, 0, .6), inset 0 0 40px rgba(110, 70, 20, .35);
    margin: 7px;
  }
  .ws-fiche::before {   /* quatre clous de laiton aux coins */
    content: ""; position: absolute; inset: 6px; pointer-events: none;
    --clou: radial-gradient(circle at 40% 35%, var(--ws-laiton-hi), var(--ws-laiton-lo) 60%, transparent 66%);
    background: var(--clou) 0 0 / 10px 10px no-repeat, var(--clou) 100% 0 / 10px 10px no-repeat,
      var(--clou) 0 100% / 10px 10px no-repeat, var(--clou) 100% 100% / 10px 10px no-repeat;
  }
  .ws-fiche-haut { display: grid; grid-template-columns: 168px 1fr; gap: 18px; align-items: center; }
  .ws-niche { width: 168px; height: 168px; border-radius: 84px 84px 4px 4px; }
  .ws-niche .ws-art-img { width: 150px; height: 150px; }
  .ws-fiche-tete h2 { font-size: clamp(20px, 2.6vw, 28px); line-height: 1.15; margin: 4px 0 6px; color: var(--ws-encre); }
  .ws-fiche-tete .ws-q { font-size: 14px; }
  .ws-fiche-tete .ws-q i { width: 11px; height: 11px; }
  .ws-donne, .ws-requis { margin: 0 0 2px; }
  .ws-requis { color: var(--ws-encre-2); font-size: 15px; }
  .ws-fiche[data-q="légendaire"] .ws-niche, .ws-fiche[data-q="spéciale"] .ws-niche { box-shadow: inset 0 0 0 2px #0b0b0c, inset 0 0 0 3px var(--q), inset 0 4px 10px rgba(0, 0, 0, .7), 0 0 16px color-mix(in srgb, var(--q) 45%, transparent); }
  .ws-encarts { display: grid; gap: 6px; margin-top: 12px; }
  .ws-encarts:empty { display: none; }
  .ws-encart { margin: 0; padding: 6px 10px; border-radius: 2px; background: rgba(90, 60, 25, .12); border-left: 3px solid var(--ws-encre-2); }
  .ws-encart-or { border-left-color: var(--ws-laiton); background: rgba(200, 150, 50, .18); }
  .ws-encart-terne { color: var(--ws-encre-2); }

  /* Emplacements des matières : fente de fer, icône, compteur avoir / requis ; ce qui manque en rouge. */
  .ws-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
  .ws-slot { display: grid; justify-items: center; gap: 3px; text-align: center; }
  .ws-slot-cadre {
    position: relative; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 4px;
    background: radial-gradient(circle at 50% 40%, #3a3026, #141010 80%);
    box-shadow: inset 0 0 0 2px #0b0b0c, inset 0 0 0 3px var(--ws-laiton-lo), inset 0 3px 8px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 255, 255, .35);
  }
  .ws-slot-cadre img { width: 40px; height: 40px; image-rendering: pixelated; }
  .ws-compte { position: absolute; right: -6px; bottom: -6px; padding: 0 5px; border-radius: 3px; font: 700 13px 'Alegreya', serif; color: #fff3d6; background: var(--ws-ok); box-shadow: 0 0 0 1px #0b0b0c; }
  .ws-compte span { font-weight: 400; opacity: .85; }
  .ws-court .ws-compte { background: var(--ws-ko); }
  .ws-court .ws-slot-cadre { box-shadow: inset 0 0 0 2px #0b0b0c, inset 0 0 0 3px var(--ws-ko), inset 0 3px 8px rgba(0, 0, 0, .8); }
  .ws-slot-nom { font-size: 13px; line-height: 1.15; margin-top: 4px; }
  .ws-slot-manque { font: 700 12px 'Alegreya', serif; color: var(--ws-ko); }

  .ws-cout { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 12px; padding-top: 12px; border-top: 1px solid rgba(90, 60, 25, .35); }
  .ws-cout .ws-chip { background: var(--ws-fer); }
  .ws-livre { font-size: 14px; color: var(--ws-encre-2); margin: 0; }

  /* Le bouton d'action : une plaque de laiton chauffée à la braise. */
  .ws-action { display: grid; justify-items: center; gap: 6px; }
  .ws-frapper {
    min-width: min(100%, 280px); padding: 10px 28px; cursor: pointer; border-radius: 4px; border: 2px solid #0b0b0c;
    font: 700 20px 'Cinzel', Georgia, serif; letter-spacing: .08em; color: #2a1405;
    background: linear-gradient(180deg, #ffe0a0, var(--ws-laiton) 45%, var(--ws-laiton-lo));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -3px 0 rgba(0, 0, 0, .3), 0 4px 0 #0b0b0c, 0 0 22px var(--ws-lueur);
    text-shadow: 0 1px 0 rgba(255, 240, 200, .6); transition: box-shadow .15s ease, translate .08s ease;
  }
  .ws-frapper:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -3px 0 rgba(0, 0, 0, .3), 0 4px 0 #0b0b0c, 0 0 30px rgba(255, 130, 40, .6); }
  .ws-frapper:active:not(:disabled) { translate: 0 3px; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .4), 0 1px 0 #0b0b0c; }
  .ws-frapper:disabled { cursor: not-allowed; color: #4a443c; background: linear-gradient(180deg, #a19a8e, #6d6a64); box-shadow: 0 3px 0 #0b0b0c; text-shadow: none; }
  .ws-frapper:focus-visible, .ws-carte:focus-visible, .ws-onglet:focus-visible, .ws-petit:focus-visible { outline: 3px solid var(--ws-laiton-hi); outline-offset: 2px; }
  .ws-pourquoi { margin: 0; font-weight: 700; color: var(--ws-ko); text-align: center; }
  .ws-pourquoi[data-etat="bloque"] { color: var(--ws-encre-2); }

  /* L'établi : emplacements d'ouvrage, braises = cycles de 12 h restants. */
  .ws-ouvrages { display: grid; gap: 8px; }
  .ws-ouvrage { padding: 8px 10px; border-radius: 3px; color: var(--ws-parch); background: linear-gradient(180deg, var(--ws-fer-2), var(--ws-fer)); box-shadow: inset 0 0 0 1px #0b0b0c, inset 0 1px 0 rgba(255, 255, 255, .08); }
  .ws-ouvrage .ws-encart { color: var(--ws-parch); margin: 4px 0; font-size: 14px; }
  .ws-ouvrage .ws-livre { color: var(--ws-parch-2); }
  .ws-libre { text-align: center; color: var(--ws-parch-3); font-style: italic; background: transparent; box-shadow: inset 0 0 0 1px rgba(232, 197, 116, .35); }
  .ws-braises { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 6px 0 4px; min-height: 10px; }
  .ws-braises i { width: 14px; height: 8px; border-radius: 2px; background: linear-gradient(180deg, #ffcf7a, var(--ws-braise)); box-shadow: 0 0 5px var(--ws-braise); }
  .ws-braises span { font-size: 13px; color: var(--ws-parch-2); }

  /* Le coffre des plans : un coffre de bois cerclé, les plans en rouleaux. */
  .ws-coffre { padding: 12px; border-radius: 4px;
    background: var(--ws-veine), linear-gradient(180deg, var(--ws-bois-3), var(--ws-bois-2));
    box-shadow: inset 0 0 0 2px #0b0b0c, inset 0 14px 0 -10px var(--ws-fer-hi), inset 0 -14px 0 -10px var(--ws-fer-hi), 0 6px 14px rgba(0, 0, 0, .45); }
  .ws-coffre .ws-filet { color: var(--ws-parch-2); }
  .ws-coffre .ws-filet::after { background: linear-gradient(90deg, var(--ws-parch-3), transparent); }
  .ws-rouleaux { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
  .ws-rouleau {
    position: relative; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 16px; color: var(--ws-encre);
    background: var(--ws-grain), linear-gradient(180deg, var(--ws-parch-3), var(--ws-parch) 18%, var(--ws-parch) 82%, var(--ws-parch-3));
    border-radius: 2px; box-shadow: 0 2px 4px rgba(0, 0, 0, .5);
  }
  .ws-rouleau::before, .ws-rouleau::after { content: ""; position: absolute; top: -3px; bottom: -3px; width: 7px; border-radius: 4px; background: linear-gradient(90deg, var(--ws-parch-3), var(--ws-parch), var(--ws-parch-3)); box-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
  .ws-rouleau::before { left: -3px; } .ws-rouleau::after { right: -3px; }
  .ws-neuf { box-shadow: 0 0 0 2px var(--ws-laiton), 0 0 12px var(--ws-lueur); }
  .ws-rouleau-nom { flex: 1 0 100%; }
  .ws-note { font-size: 13px; color: var(--ws-encre-2); margin-right: auto; }

  .ws-petit {
    padding: 3px 10px; cursor: pointer; border-radius: 3px; font: 600 14px 'Alegreya', serif; color: var(--ws-parch); text-decoration: none; display: inline-block;
    background: linear-gradient(180deg, var(--ws-fer-2), var(--ws-fer)); border: 1px solid #0b0b0c; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  }
  .ws-petit:hover { background: linear-gradient(180deg, var(--ws-fer-hi), var(--ws-fer-2)); }
  .ws-lire { color: #2a1405; background: linear-gradient(180deg, var(--ws-laiton-hi), var(--ws-laiton)); }
  .ws-lire:hover { background: linear-gradient(180deg, #ffe0a0, var(--ws-laiton-hi)); }

  .ws-vide { margin: 0; padding: 10px; color: var(--ws-parch-2); font-style: italic; }
  .ws-fiche .ws-vide { color: var(--ws-encre-2); }
  .ws-ferme { max-width: 640px; }
  .ws-pied { margin: 0; font-size: 14px; color: var(--ws-parch-3); }

  /* Panneaux d'atelier (Graver, Bijoux) : une table de travail de bois, les objets dessus sur parchemin. */
  .ws-panneau { padding: 12px; border-radius: 4px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5), inset 0 2px 8px rgba(0, 0, 0, .4); }
  .ws-panneau .ws-filet { color: var(--ws-parch-2); }
  .ws-panneau .ws-filet::after { background: linear-gradient(90deg, var(--ws-parch-3), transparent); }
  .ws-plaque > span { text-align: right; }
  .ws-objets-cartes, .ws-ecrins { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
  .ws-objet-carte, .ws-bijou-carte {
    display: grid; gap: 8px; align-content: start; padding: 10px; color: var(--ws-encre); border-radius: 3px;
    background: var(--ws-grain), linear-gradient(180deg, var(--ws-parch), var(--ws-parch-2));
    box-shadow: inset 0 0 0 1px rgba(60, 35, 10, .45), 0 2px 5px rgba(0, 0, 0, .5);
  }
  .ws-objet-tete { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; }
  .ws-objet-tete .ws-carte-art { width: 56px; height: 56px; }
  .ws-objet-tete .ws-note, .ws-bijou-corps .ws-note { display: block; margin: 0; }
  .ws-select, .ws-pose select { flex: 1; min-width: 0; max-width: 100%; padding: 4px 6px; border-radius: 3px; font-size: 14px;
    color: var(--ws-encre); background: var(--ws-parch); border: 1px solid var(--ws-encre-2); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2); }
  .ws-pose { display: flex; gap: 6px; align-items: center; }

  /* Alvéoles : une gravure posée (pierre de rune, qualité, effet, « Retirer ») ou un emplacement libre. */
  .ws-alveoles { display: grid; gap: 6px; }
  .ws-alveole { --q: var(--ws-commune); display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 3px;
    background: rgba(90, 60, 25, .12); box-shadow: inset 3px 0 0 var(--q); }
  .ws-alveole-libre { grid-template-columns: 34px 1fr; background: transparent; box-shadow: inset 0 0 0 1px rgba(90, 60, 25, .4); }
  .ws-alveole-libre .ws-pierre { background: transparent; box-shadow: inset 0 0 0 1px rgba(90, 60, 25, .5); }
  .ws-alveole-corps { min-width: 0; }
  .ws-alveole-corps .ws-note { display: block; }
  .ws-alveole-corps .ws-q { margin-left: 6px; }
  .ws-pierre { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: color-mix(in srgb, var(--q, var(--ws-commune)) 60%, #fff);
    background: radial-gradient(circle at 50% 40%, #3a3026, #141010 80%); box-shadow: inset 0 0 0 2px #0b0b0c, inset 0 0 0 3px color-mix(in srgb, var(--q, var(--ws-commune)) 70%, #000); }
  .ws-pierre-svg { width: 24px; height: 24px; }

  /* Runes au coffre : des galets rangés en ligne. */
  .ws-galets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 8px; }
  .ws-galet { --q: var(--ws-commune); display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 3px; font-size: 14px; line-height: 1.2;
    color: var(--ws-parch); background: linear-gradient(180deg, var(--ws-fer-2), var(--ws-fer)); box-shadow: inset 0 0 0 1px #0b0b0c, inset 3px 0 0 var(--q); }
  .ws-galet .ws-q { color: color-mix(in srgb, var(--q) 60%, #fff); }

  /* L'écrin : un bijou par carte, le médaillon dans un coffret ; le chef-d'œuvre cerclé d'or. */
  .ws-bijou-carte { grid-template-columns: 56px 1fr; align-items: center; }
  .ws-ecrin { width: 56px; height: 56px; color: var(--ws-laiton-hi);
    background: radial-gradient(circle at 50% 55%, #4a1f22, #140808 80%); }
  .ws-chef { box-shadow: inset 0 0 0 2px var(--ws-legende), 0 0 12px color-mix(in srgb, var(--ws-legende) 40%, transparent), 0 2px 5px rgba(0, 0, 0, .5); }
  .ws-porte-carte .ws-ecrin { box-shadow: inset 0 0 0 2px #0b0b0c, inset 0 0 0 3px var(--ws-ok), inset 0 4px 10px rgba(0, 0, 0, .7); }
  .ws-bijou-corps { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; }
  .ws-bijou-corps .ws-carte-nom, .ws-bijou-corps .ws-note, .ws-bijou-corps .ws-pose { flex: 1 0 100%; }
  .ws-porte { font-size: 14px; }
  .ws-mercs { display: grid; gap: 6px; }
  .ws-merc { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--ws-parch); }
  .ws-bonus-pastille { padding: 1px 8px; border-radius: 999px; font-size: 13px; color: #2a1405; background: linear-gradient(180deg, var(--ws-laiton-hi), var(--ws-laiton)); }

  /* Tablette : la fiche prend la place, l'établi passe à droite des plans en dessous. */
  @media (max-width: 1180px) {
    .ws-atelier { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }
    .ws-etabli { grid-column: 1 / -1; }
    .ws-ouvrages { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  }
  /* Téléphone : une colonne ; les plans en bande qui défile, la fiche dessous. */
  @media (max-width: 760px) {
    padding: 8px; gap: 10px;
    .ws-enseigne { grid-template-columns: auto 1fr; padding: 10px 12px; gap: 10px; }
    .ws-emblem { width: 52px; height: 52px; } .ws-emblem-svg { width: 34px; height: 34px; }
    .ws-bourse { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .ws-atelier { grid-template-columns: minmax(0, 1fr); }
    .ws-onglets { gap: 6px; } .ws-onglet { padding: 5px 9px 5px 6px; font-size: 13px; gap: 5px; } .ws-onglet-emb svg { width: 18px; height: 18px; }
    .ws-cartes { max-height: 46vh; }
    .ws-fiche { padding: 14px 12px 16px; }
    .ws-fiche-haut { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 10px; }
    .ws-niche { width: 140px; height: 140px; } .ws-niche .ws-art-img { width: 124px; height: 124px; }
    .ws-slots { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
    .ws-frapper { width: 100%; }
  }
  @media (prefers-reduced-motion: reduce) { .ws-carte, .ws-frapper { transition: none; } }
}

/* Graver : les cartes ne s'élargissent pas avec la liste de runes ; choix de l'objet puis de la rune au clic. */
:root:root:root:root .ws-scene .ws-objet-carte { min-width: 0; }
:root:root:root:root .ws-scene .ws-pose select { width: 100%; text-overflow: ellipsis; }
:root:root:root:root .ws-scene .ws-choisissable, :root:root:root:root .ws-scene .ws-galet { cursor: pointer; }
:root:root:root:root .ws-scene .ws-objet-carte.ws-objet-choisi { box-shadow: inset 0 0 0 1px rgba(60, 35, 10, .45), 0 0 0 3px var(--ws-laiton-hi), 0 0 14px var(--ws-lueur); }
:root:root:root:root .ws-scene .ws-galet.ws-galet-choisi { box-shadow: inset 0 0 0 1px #0b0b0c, inset 3px 0 0 var(--q), 0 0 0 3px var(--ws-laiton-hi), 0 0 12px var(--ws-lueur); }
/* Infobulle d'une rune du coffre : ses effets au survol ou au focus. */
:root:root:root:root .ws-scene .ws-galet { position: relative; }
:root:root:root:root .ws-scene .ws-bulle { position: absolute; z-index: 20; left: 0; bottom: calc(100% + 6px); width: max-content; max-width: min(280px, 80vw); padding: 6px 9px; border-radius: 3px;
  font-size: 13px; line-height: 1.35; color: var(--ws-encre); background: var(--ws-grain), linear-gradient(180deg, var(--ws-parch), var(--ws-parch-2));
  box-shadow: inset 0 0 0 1px var(--ws-encre-2), 0 3px 8px rgba(0, 0, 0, .6); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s; }
:root:root:root:root .ws-scene .ws-bulle .ws-note { color: var(--ws-encre-2); }
:root:root:root:root .ws-scene .ws-galet:hover .ws-bulle, :root:root:root:root .ws-scene .ws-galet:focus-visible .ws-bulle { opacity: 1; visibility: visible; }
