/* Wiki : pages générées par tools/gen-wiki.mjs. Complète style.css (.wiki, .search, tables). */

/* Icônes du jeu : le pixel art (16 px) est agrandi sans flou ; les blocs en 3D (64 px) sont réduits en douceur */
img.px { image-rendering: pixelated; }
.noimg { display: inline-block; width: 24px; height: 24px; border-radius: 6px; background: #eee3da; vertical-align: middle; }

/* ─── En-tête et fil d'Ariane ─── */
.wiki-head { padding: 140px 0 100px; }
.crumb { margin: 0 0 10px !important; font-size: .92rem !important; font-weight: 500; }
.crumb a { color: #fff; opacity: .85; }
.crumb span { opacity: .6; margin: 0 4px; }

/* ─── Menu latéral ─── */
.wiki aside { max-height: calc(100vh - 120px); overflow-y: auto; }
.wiki aside .wl { display: flex; align-items: center; gap: 10px; }
.wiki aside .wl img { width: 20px; height: 20px; flex: none; }
.wiki aside .wl.on { background: var(--orange-soft); color: var(--orange); font-weight: 600; }
.wiki aside .wl.home { color: var(--muted); font-size: .85rem; }
.wiki aside .toc { display: grid; gap: 1px; margin: 2px 0 6px 22px; padding-left: 10px; border-left: 2px solid var(--line); }
.wiki aside .toc a { padding: 4px 10px; font-size: .84rem; font-weight: 500; color: var(--muted); }
@media (max-width: 860px) {
    .wiki aside { max-height: none; }
    .wiki aside .toc, .wiki aside .wl.home { display: none; }
}

/* ─── Contenu ─── */
.wiki article > section { min-width: 0; } /* un tableau large défile dans son cadre au lieu d'élargir la page */
.wiki article section h3 { margin: 26px 0 10px; }
.wiki article section > p:last-child, .wiki article section > ul:last-child { margin-bottom: 0; }
.list { padding-left: 20px; margin: 12px 0; }
.list li { margin: 7px 0; }
p.small { font-size: .86rem; color: var(--muted); }
.wiki .steps { margin-top: 18px; }
.rules { padding-left: 22px; } .rules li { margin: 8px 0; }
.wiki table td small { color: var(--muted); }
table.compact td, table.compact th { padding: 7px 12px; }
table.tstats td { white-space: nowrap; }
table.tstats td img, table.ranks td img, table.gear td img { width: 24px; height: 24px; vertical-align: middle; margin-right: 4px; }
table.ranks td:first-child { font-weight: 600; color: var(--text); white-space: nowrap; }
table.ranks td:not(:first-child), table.ranks th { text-align: center; }

/* Objet en ligne : icône + nom */
.it { display: inline-flex; align-items: center; gap: 5px; padding: 0 7px 0 2px; border-radius: 8px; background: #f8f2ed; color: var(--text); font-weight: 500; line-height: 1.6; vertical-align: middle; white-space: nowrap; }
a.it:hover { background: var(--orange-soft); color: var(--orange); text-decoration: none; }
.it img, .it .noimg { width: 24px; height: 24px; }
td .it { white-space: normal; }

/* Quantités (récompenses) */
.qs { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; vertical-align: middle; }
.q { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: var(--text); font-size: .88rem; }
.q img { width: 24px; height: 24px; }
.qs .day { display: inline-flex; flex-direction: column; align-items: center; padding: 3px 8px; border-radius: 8px; background: #f8f2ed; font-weight: 600; color: var(--text); font-size: .85rem; line-height: 1.3; }
.qs .day small { color: var(--muted); font-weight: 500; }

/* Échelle des minerais */
.ladder { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 6px; margin: 14px 0; }
.ladder .sep { color: var(--muted); font-weight: 700; }

/* Fiches d'objets */
.icards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); margin: 14px 0; }
.icard { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fffdfb; scroll-margin-top: 110px; }
.icard > .ic, .icard > .noimg { width: 40px; height: 40px; flex: none; }
.icard h4 { margin: 0 0 4px; font-size: .98rem; }
.icard h4 a { color: var(--text); }
.icard h4 a:hover { color: var(--orange); }
.icard p { margin: 0; font-size: .86rem; line-height: 1.5; }
.icard p + p { margin-top: 6px; }
.icard .price { font-weight: 600; color: var(--orange-d); }
.icard:target { border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }

/* ─── Factions : technos ─── */
.tech { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 700px) { .tech { grid-template-columns: 1fr; } }
.branch { border: 1px solid var(--line); border-top: 5px solid; border-radius: 14px; padding: 14px 16px; background: #fffdfb; }
.b-red { border-top-color: #e5484d; } .b-blue { border-top-color: #3b82f6; } .b-yellow { border-top-color: #eab308; } .b-green { border-top-color: #22c55e; }
.branch h3 { margin: 0 0 10px !important; display: flex; align-items: baseline; gap: 10px; }
.branch h3 small { font-size: .82rem; font-weight: 500; color: var(--muted); }
.branch ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.branch ol > li { padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.branch .tl { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; color: var(--text); }
.branch .price { font-weight: 700; color: var(--orange-d); }
.branch .cond { font-size: .8rem; color: var(--muted); }
.branch ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: .86rem; }
.branch ul li { display: flex; align-items: center; gap: 8px; line-height: 1.35; }
.branch ul img { width: 22px; height: 22px; flex: none; }

/* ─── Crafts ─── */
.stations { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; margin-bottom: 16px; }
.stations > div { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 16px 12px; border: 1px solid var(--line); border-radius: 14px; background: #fffdfb; }
.stations img { width: 44px; height: 44px; }
.stations b { color: var(--text); }
.stations span { font-size: .84rem; line-height: 1.45; }

.craft-tools { position: sticky; top: 86px; z-index: 5; margin: 0 -8px 16px; padding: 10px 8px 6px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.craft-tools .search { margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: 500 .84rem var(--font); color: var(--body); background: #f8f2ed; border: 1px solid transparent; padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.chips button small { color: var(--muted); font-weight: 500; }
.chips button:hover { color: var(--text); border-color: var(--line); }
.chips button.active { background: var(--orange-soft); border-color: #ffd4b8; color: var(--orange); font-weight: 600; }
.craft-count { margin: 8px 0 0; font-size: .8rem; color: var(--muted); }
.empty { text-align: center; padding: 30px 0; color: var(--muted); }

.crafts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); align-items: start; }
.craft { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fffdfb; scroll-margin-top: 230px; min-width: 0; }
.wiki .craft { display: block; } /* style.css met les <article> du wiki en grille */
.craft[hidden], .wiki .craft[hidden] { display: none; }
.craft:target, .craft.flash { border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.craft header { display: flex; align-items: center; gap: 12px; }
.craft header .ic { width: 40px; height: 40px; flex: none; }
.craft h3 { margin: 0 !important; font-size: 1rem; }
.sts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.st { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 3px; border-radius: 999px; background: #f3ece6; color: var(--body); font-size: .72rem; font-weight: 600; }
.st img { width: 16px; height: 16px; }
.rs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }

/* Grille façon interface de Minecraft */
.recipe, .cook { display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 8px 10px; width: max-content; max-width: 100%; margin-top: 12px; padding: 8px; background: #c6c6c6; border-radius: 4px; box-shadow: inset 2px 2px #fff, inset -2px -2px #555; }
.grid3 { display: grid; grid-template-columns: repeat(3, 36px); }
.ms { position: relative; display: grid; place-items: center; width: 36px; height: 36px; background: #8b8b8b; box-shadow: inset 2px 2px #373737, inset -2px -2px #fff; }
.ms img, .ms .noimg { width: 32px; height: 32px; }
a.ms:hover { background: #a9a9a9; text-decoration: none; }
.result .ms { width: 52px; height: 52px; }
.cnt { position: absolute; right: 2px; bottom: 1px; color: #fff; font: 700 13px/1 var(--mono); text-shadow: 2px 2px #3f3f3f; pointer-events: none; }
.arrow { width: 26px; height: 20px; background: #8b8b8b; clip-path: polygon(0 32%, 55% 32%, 55% 0, 100% 50%, 55% 100%, 55% 68%, 0 68%); }
.cooks { display: flex; flex-wrap: wrap; gap: 0 8px; }
.cook small { grid-column: 1 / -1; margin-top: -4px; font-size: .7rem; color: #3f3f3f; font-weight: 600; }
/* Palamachine : disposition de l'UI du jeu (case du haut = objet clé, 4 autour, résultat au centre) */
.pmr { grid-template-columns: auto; justify-items: center; }
.pm { position: relative; width: 140px; height: 132px; }
.pm > div { position: absolute; }
.pm .p0 { left: 52px; top: 0; } .pm .p1 { left: 0; top: 34px; } .pm .p2 { left: 104px; top: 34px; }
.pm .p3 { left: 20px; top: 96px; } .pm .p4 { left: 84px; top: 96px; } .pm .pr { left: 44px; top: 40px; }
.pm .p0 .ms { box-shadow: inset 2px 2px #373737, inset -2px -2px #fff, 0 0 0 2px #e0a030; }
.pmr small { max-width: 230px; margin-top: -2px; font-size: .7rem; line-height: 1.4; color: #3f3f3f; font-weight: 600; text-align: center; }
.fire { width: 16px; height: 20px; background: linear-gradient(180deg, #ffd23f, #ff6a00 60%, #c62a00); clip-path: polygon(50% 0, 75% 30%, 100% 55%, 85% 100%, 15% 100%, 0 55%, 25% 30%, 40% 45%); }
.craft .tip { margin: 12px 0 0; font-size: .84rem; line-height: 1.5; }
.uses { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 10px 0 0; font-size: .78rem; color: var(--muted); }
.uses span { margin-right: 2px; font-weight: 600; }
.uses a { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #f3ece6; }
.uses a:hover { background: var(--orange-soft); }
.uses img { width: 24px; height: 24px; }
.uses em { font-style: normal; margin-left: 4px; }
.icards.res { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }

/* ─── Page précédente / suivante ─── */
.pn { display: flex; justify-content: space-between; gap: 12px; }
.pn a { display: grid; padding: 14px 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.pn a:hover { border-color: #ffc9a3; text-decoration: none; }
.pn a.next { text-align: right; margin-left: auto; }
.pn small { font-weight: 500; color: var(--muted); font-size: .8rem; }

/* ─── Accueil du wiki ─── */
.hub-search { display: flex; gap: 10px; max-width: 620px; margin-top: 26px; }
.hub-search .search { margin: 0; background: #fff; border-color: transparent; }
.hub { padding: 10px 0 96px; }
.start { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 32px; margin-bottom: 28px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.start > div:first-child { flex: 1 1 380px; }
.start h2 { font-size: 1.7rem; margin-bottom: .3em; }
.start p { margin: 0; }
.start-nums { display: flex; flex-wrap: wrap; gap: 10px; }
.start-nums span { display: grid; justify-items: center; min-width: 84px; padding: 10px 12px; border-radius: 14px; background: var(--orange-soft); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--body); }
.start-nums b { font-size: 1.6rem; color: var(--orange); line-height: 1.2; letter-spacing: 0; }
.themes { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.theme { display: flex; flex-direction: column; padding: 24px; border-width: 1px; border-style: solid; border-radius: 22px; color: var(--body); transition: transform .2s, box-shadow .2s; }
.theme:hover { transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none; }
.theme .ic, .theme .noimg { width: 48px; height: 48px; margin-bottom: 16px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .12)); }
.theme h3 { margin-bottom: 6px; }
.theme p { margin: 0 0 14px; font-size: .94rem; flex: 1; }
.theme .go { font-weight: 600; color: var(--orange); font-size: .92rem; }
@media (max-width: 600px) { .hub-search { flex-direction: column; } .start { padding: 22px 20px; } }

/* ─── Animations de construction (public/ponder.js, façon « Ponder » de Create) ─── */
.ponder { margin: 18px 0; border: 1px solid var(--line); border-radius: 18px; background: #fffdfb; overflow: hidden; }
.pd-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pd-head > b { color: var(--text); font-size: 1rem; }
.pd-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.pd-tabs button { font: 500 .8rem var(--font); color: var(--body); background: #f3ece6; border: 0; padding: 4px 11px; border-radius: 999px; cursor: pointer; }
.pd-tabs button.active { background: var(--orange-soft); color: var(--orange); font-weight: 600; }
.pd-stage { position: relative; height: 360px; background: radial-gradient(ellipse at 50% 40%, #ffffff, #f3ece6 75%); }
.pd-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.pd-stage canvas:active { cursor: grabbing; }
.pd-cap { position: absolute; left: 14px; top: 14px; max-width: min(380px, calc(100% - 28px)); display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: rgba(42, 34, 48, .88); color: #fff; font-size: .88rem; line-height: 1.45; box-shadow: 0 6px 18px rgba(0, 0, 0, .15); pointer-events: none; }
.pd-cap p { margin: 0; }
.pd-cap:empty, .ponder:not(.live) .pd-cap { display: none; }
.pd-cap.in { animation: pd-in .35s ease; }
@keyframes pd-in { from { opacity: 0; transform: translateY(-6px); } }
.pd-n { flex: none; padding: 1px 7px; border-radius: 6px; background: var(--orange); font: 700 .74rem var(--mono); line-height: 1.6; }
.pd-hint { position: absolute; right: 12px; bottom: 10px; font-size: .74rem; color: var(--muted); pointer-events: none; transition: opacity .3s; }
.ponder.dragged .pd-hint { opacity: 0; }
.pd-ctrl { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--line); }
.pd-ctrl > button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: #f3ece6; color: var(--text); cursor: pointer; }
.pd-ctrl > button:hover { background: var(--orange-soft); color: var(--orange); }
.pd-ctrl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pd-ctrl .i-play path { fill: currentColor; }
.pd-ctrl .i-play, .pd-ctrl .i-replay { display: none; }
.ponder[data-state="paused"] .i-pause, .ponder[data-state="done"] .i-pause { display: none; }
.ponder[data-state="paused"] .i-play, .ponder[data-state="done"] .i-replay { display: block; }
.pd-dots { display: flex; gap: 6px; margin-left: 8px; flex-wrap: wrap; }
.pd-dots button { width: 22px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: #e6ddd5; cursor: pointer; }
.pd-dots button.past { background: #ffc9a3; }
.pd-dots button.on { background: var(--orange); }
.pd-text { margin: 12px 16px 0; padding-left: 20px; font-size: .9rem; }
.pd-text li { margin: 4px 0; }
.js .ponder.live .pd-text { display: none; }
.ponder:not(.live) .pd-stage, .ponder:not(.live) .pd-ctrl { display: none; }
.pd-mats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 16px 14px; font-size: .86rem; }
.pd-mats .lbl { font-weight: 600; color: var(--text); }
.pd-mats .q { padding: 2px 8px 2px 3px; border-radius: 8px; background: #f8f2ed; }
.pd-mats .nm { font-weight: 500; color: var(--body); margin-left: 4px; }
@media (max-width: 600px) { .pd-stage { height: 300px; } .pd-cap { font-size: .82rem; } .pd-mats .nm { display: none; } }

/* Technos : titre et effet des déblocages */
.branch ul li { align-items: flex-start; }
.branch ul li > div { display: grid; gap: 1px; }
.branch ul li b { color: var(--text); font-weight: 600; }
.branch ul li .eff { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.craft .build { margin: 10px 0 0; font-size: .82rem; font-weight: 600; }
/* Animations : blocs à poser + ressources à farmer (recettes déroulées) */
.pd-mats { display: grid; gap: 8px; }
.pd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.pd-row .lbl { min-width: 128px; }
.pd-raw .q { background: var(--orange-soft); }
.pd-raw .q b { color: var(--orange-d); }
.pd-note { margin: 0; font-size: .78rem; color: var(--muted); }
@media (max-width: 600px) { .pd-row .lbl { min-width: 0; width: 100%; } }
