/* Dice & Dominion — the Hero Forge: pixel-style step-by-step hero builder.
   Everything is scoped to the builder modal (.modal.forge, only created for D&D heroes) and its .fg-* parts. */
/* Jersey 15 — same pixel heading face as the D&D home screen (Pixelify's C reads as O, its 5 as S) */
@import url('https://fonts.googleapis.com/css2?family=Jersey+15&display=swap');

.modal.forge, .modal.px-shop { /* shared pixel tokens: the hero builder and the D&D shop */
  --fg-px: 'Jersey 15', 'Cinzel', sans-serif;
  --fg-bg: #16120e; --fg-panel: #1d1813; --fg-card: #231c15; --fg-card-h: #2b2219; --fg-card-on: #33281a;
  --fg-line: #3a3025; --fg-line2: #574735; --fg-gold: #f2c45c; --fg-gold-d: #a77b2b; --fg-text: #f1e8d5;
  --fg-muted: #bcae94; --fg-dim: #8c7e68; --fg-green: #9ad67e; --fg-warn: #ffb36b; --fg-new: #8fd0ff;
  /* the world-skin tokens (worlds.css) the shared components read */
  --title: var(--fg-px); --title-color: var(--fg-gold); --title-ls: .01em; --title-weight: 400;
  --modal-bg: linear-gradient(180deg, #1f1914, #17130f); --panel-shadow: none;
  --btn-r: 3px; --field-r: 3px; --card-r: 3px; --card: var(--fg-card); --card-on: var(--fg-card-on);
  --btn-shadow: 0 2px 0 rgba(0, 0, 0, .45);
  width: min(1320px, 100%); height: min(880px, 100%); position: relative; border-radius: 6px;
  border: 2px solid #4a3c2c; box-shadow: 0 0 0 2px #0b0907, 0 24px 60px rgba(0, 0, 0, .6);
  color: var(--fg-text);
}
.modal.forge .modal-head { padding: 12px 18px; border-bottom: 2px solid var(--fg-line); background: linear-gradient(#221b15, #1c1612); }
.modal.forge .modal-head h2 { font-family: var(--fg-px); font-size: 22px; font-weight: 400; letter-spacing: .02em; color: var(--fg-gold); text-shadow: 0 2px 0 #000; }
body .modal.forge .modal-head h2::before { content: none; }
.modal.forge h3, .modal.forge h4 { font-family: var(--fg-px); font-weight: 400; }
.modal.forge .section > h3 { font-size: 17px; color: var(--fg-gold); margin-bottom: 10px; }
.modal.forge .section > h3 .count { font-family: var(--font); font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: #2a2219; color: var(--fg-muted); }
.modal.forge .section > h3 .count.bad { background: #3b2512; color: var(--fg-warn); }
.modal.forge .section { margin-bottom: 26px; }
.modal.forge .muted { color: var(--fg-muted); }
.modal.forge .small { font-size: 13.5px; line-height: 1.5; }

/* ---------------------------------------------------------------- step rail */
.modal.forge #ed-tabs { padding: 8px 14px; background: #1a1511; border-bottom: 2px solid var(--fg-line); overflow-x: auto; scrollbar-width: none; }
.fg-rail { display: flex; align-items: center; gap: 2px; min-width: max-content; }
.fg-step { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 2px solid transparent; border-radius: 3px; background: transparent; color: var(--fg-muted); cursor: pointer; font: 600 13.5px var(--font); position: relative; }
.fg-step + .fg-step::before { content: ''; position: absolute; left: -6px; top: 50%; width: 8px; height: 2px; background: var(--fg-line2); }
.fg-step:hover { color: var(--fg-text); background: #241d16; }
.fg-n { width: 24px; height: 24px; display: inline-grid; place-items: center; font: 400 14px var(--fg-px); background: #2c241b; color: var(--fg-muted); border-radius: 2px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .35); }
.fg-step.on { color: var(--fg-gold); border-color: var(--fg-gold-d); background: #2a2116; }
.fg-step.on .fg-n { background: var(--fg-gold); color: #1d1405; }
.fg-step.done .fg-n { background: #2f4f2a; color: #d4f7c4; }
.fg-step.todo .fg-n { background: #6a3d14; color: #ffd9a8; }
.fg-step.opt { color: var(--fg-dim); }
.fg-step.opt .fg-n { background: transparent; border: 2px dashed var(--fg-line2); }
.fg-step.locked { opacity: .38; }
.fg-railm { display: none; }

/* ---------------------------------------------------------------- body: stage | content */
.modal.forge .editor.fg-body { grid-template-columns: 384px minmax(0, 1fr); min-height: 0; }
.modal.forge .editor.fg-body > .editor-side { order: -1; border-left: none; border-right: 2px solid var(--fg-line); background: #17130f; padding: 16px 18px; font-size: 13.5px; }
.modal.forge .editor.fg-body > .editor-main { padding: 20px 26px 32px; scroll-padding-top: 12px; }

.fg-stage { display: flex; flex-direction: column; gap: 12px; }
.fg-scene { position: relative; border-radius: 4px; overflow: hidden; line-height: 0;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff8 99%, transparent), radial-gradient(1px 1px at 28% 8%, #fff6 99%, transparent),
    radial-gradient(1px 1px at 46% 22%, #fff5 99%, transparent), radial-gradient(1px 1px at 71% 12%, #fff7 99%, transparent),
    radial-gradient(1px 1px at 86% 30%, #fff5 99%, transparent), radial-gradient(1px 1px at 63% 36%, #fff4 99%, transparent),
    radial-gradient(1px 1px at 8% 44%, #fff4 99%, transparent), radial-gradient(1px 1px at 92% 52%, #fff3 99%, transparent),
    linear-gradient(180deg, #1a1828 0 22%, #221d31 22% 44%, #2b2236 44% 62%, #352838 62% 78%, #2a211d 78% 100%);
  box-shadow: inset 0 0 0 2px #0c0a08, inset 0 0 0 4px #3b3024, 0 3px 0 rgba(0, 0, 0, .4); }
.fg-scene canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; cursor: pointer; }
.fg-prev { position: absolute; top: 10px; left: 10px; font: 400 12px var(--fg-px); line-height: 1; padding: 5px 8px; background: rgba(12, 10, 8, .8); color: var(--fg-new); border: 2px solid #2b4a60; border-radius: 2px; }
.fg-replay { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 3px; background: rgba(20, 16, 12, .75); border: 2px solid var(--fg-line2); color: var(--fg-gold); font-size: 16px; cursor: pointer; line-height: 1; }
.fg-replay:hover { border-color: var(--fg-gold); }
.fg-id { padding: 0 2px; }
.fg-name { font: 400 22px var(--fg-px); color: var(--fg-text); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-line { color: var(--fg-muted); font-size: 14px; margin-top: 2px; }
.fg-lv { color: var(--fg-gold); font-weight: 600; }
.fg-look { display: flex; flex-direction: column; gap: 8px; }
.fg-look-row { display: flex; align-items: center; gap: 10px; }
.fg-lbl { flex: 0 0 52px; font: 600 12px var(--font); color: var(--fg-dim); text-transform: uppercase; letter-spacing: .08em; }
.fg-sw { display: flex; flex-wrap: wrap; gap: 5px; }
.fg-swatch { width: 22px; height: 22px; padding: 0; border-radius: 2px; border: 2px solid #0d0b09; background: var(--sw); cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.fg-swatch.auto { background: conic-gradient(#c0392b, #3498db, #27ae60, #f1c40f, #c0392b); }
.fg-swatch:hover { transform: translateY(-1px); }
.fg-swatch.on { outline: 2px solid var(--fg-gold); outline-offset: 1px; }
.fg-look.big .fg-swatch { width: 30px; height: 30px; }
.fg-look.big .fg-lbl { flex-basis: 64px; }
.fg-build { border-top: 2px solid var(--fg-line); padding-top: 10px; display: flex; flex-direction: column; gap: 1px; }
.fg-build-h { font: 400 13px var(--fg-px); color: var(--fg-dim); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.fg-bl { display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 3px; border: 0; background: transparent; color: var(--fg-text); text-align: left; cursor: pointer; font: 13px var(--font); }
.fg-bl:hover { background: #221b15; }
.fg-bl.on { background: #2a2116; box-shadow: inset 2px 0 0 var(--fg-gold); }
.fg-bl-k { color: var(--fg-dim); font-weight: 600; }
.fg-bl-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-dot { font-style: normal; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 2px; background: #6a3d14; color: #ffd9a8; font-size: 11px; font-weight: 800; }

/* ---------------------------------------------------------------- step heads, filters, summary */
.fg-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.fg-h { font: 600 26px/1.15 var(--fg-px); color: var(--fg-gold); margin: 0; text-shadow: 0 2px 0 #000; }
.fg-sub { margin: 4px 0 0; color: var(--fg-muted); font-size: 14px; line-height: 1.45; max-width: 60ch; }
.fg-optional { font: 600 12px var(--font); color: var(--fg-dim); border: 1px dashed var(--fg-line2); border-radius: 2px; padding: 1px 6px; vertical-align: middle; text-shadow: none; }
.fg-filters { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: -4px 0 14px; }
.fg-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.fg-chip { font: 600 13px var(--font); padding: 6px 12px; border-radius: 3px; border: 2px solid var(--fg-line); background: #1f1913; color: var(--fg-muted); cursor: pointer; }
.fg-chip span { color: var(--fg-dim); font-weight: 500; margin-left: 2px; }
.fg-chip:hover { color: var(--fg-text); border-color: var(--fg-line2); }
.fg-chip.on { background: var(--fg-gold); border-color: var(--fg-gold); color: #1d1405; }
.fg-chip.on span { color: #5a4313; }
.fg-sum { display: flex; gap: 16px; align-items: flex-start; padding: 14px 16px; margin-bottom: 16px; min-height: 104px; border-radius: 4px; background: #211a14; border: 2px solid var(--fg-line); box-shadow: inset 4px 0 0 var(--fg-gold-d); }
.fg-sum.empty { align-items: center; box-shadow: inset 4px 0 0 var(--fg-line2); }
.fg-sum.empty p { margin: 2px 0 0; color: var(--fg-muted); font-size: 14px; }
.fg-sum-ico { flex: none; width: 44px; height: 44px; display: grid; place-items: center; font: 400 24px var(--fg-px); color: var(--fg-dim); background: #2a2219; border-radius: 3px; }
.fg-sum-main { flex: 1; min-width: 0; }
.fg-sum-t { display: flex; align-items: baseline; gap: 10px; }
.fg-sum-t b { font: 400 19px var(--fg-px); color: var(--fg-text); }
.fg-ok { color: var(--fg-green); font-weight: 700; font-size: 13px; }
.fg-sum p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--fg-text); }
.fg-sum-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.fg-sum-meta span { font-size: 12.5px; color: var(--fg-muted); background: #2a2219; border-radius: 2px; padding: 2px 8px; }
.fg-sum-now { color: var(--fg-muted) !important; font-size: 13px !important; }
.fg-more { flex: none; align-self: center; }
.fg-lock { margin-bottom: 12px; padding: 8px 12px; border-radius: 3px; background: #2b2216; border: 2px solid #5a4523; color: #f3d9a0; font-size: 13.5px; }
.fg-empty { color: var(--fg-muted); grid-column: 1 / -1; }

/* ---------------------------------------------------------------- the catalogue grid */
.fg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 8px; }
.fg-card { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 10px 8px 8px; border-radius: 4px; border: 2px solid var(--fg-line); background: var(--fg-card); cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); transition: border-color .1s, background .1s, transform .08s; outline: none; }
.fg-card:hover, .fg-card:focus-visible { border-color: var(--fg-line2); background: var(--fg-card-h); transform: translateY(-1px); }
.fg-card:focus-visible { outline: 2px solid var(--fg-new); outline-offset: 1px; }
.fg-card.on { border-color: var(--fg-gold); background: var(--fg-card-on); box-shadow: 0 0 0 1px var(--fg-gold-d), 0 0 18px rgba(242, 196, 92, .16); }
.fg-card.on::after { content: '✓'; position: absolute; left: 6px; top: 6px; width: 18px; height: 18px; display: grid; place-items: center; font: 700 12px var(--font); background: var(--fg-gold); color: #1d1405; border-radius: 2px; }
.fg-card.disabled { opacity: .35; cursor: not-allowed; transform: none; }
.fg-thumb { width: 72px; height: 72px; image-rendering: pixelated; border-radius: 3px; background: radial-gradient(circle at 50% 70%, #3a2e3e 0 30%, #2a2232 30% 55%, #1e1925 55%); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .35); }
.fg-thumb.sm { width: 56px; height: 56px; }
.fg-ct { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 16px; }
.fg-ct b { font: 400 16px var(--fg-px); color: var(--fg-text); line-height: 1.15; }
.fg-tl { font-size: 13px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fg-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.fg-tag { font: 600 11px var(--font); padding: 1px 6px; border-radius: 2px; background: #2e261d; color: var(--fg-muted); letter-spacing: .02em; }
.fg-tag.new { background: #1c2c3a; color: var(--fg-new); }
.fg-tag.k-martial { background: #3a2318; color: #ffb89a; }
.fg-tag.k-caster { background: #261f3e; color: #c8b6ff; }
.fg-tag.k-hybrid { background: #1f3326; color: #a8e6b0; }
.fg-cx { display: inline-flex; gap: 2px; margin-left: 2px; }
.fg-cx i { width: 6px; height: 6px; background: #3b3127; }
.fg-cx i.on { background: var(--fg-gold); }
.fg-info { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; padding: 0; border-radius: 2px; border: 2px solid var(--fg-line2); background: #1b1611; color: var(--fg-muted); font: 700 13px var(--fg-px); line-height: 1; cursor: pointer; opacity: .6; }
.fg-card:hover .fg-info, .fg-info:focus-visible { opacity: 1; }
.fg-info:hover { color: #1d1405; background: var(--fg-gold); border-color: var(--fg-gold); }

/* ---------------------------------------------------------------- "More details" drawer */
.fg-drawer-bg { position: absolute; inset: 0; background: rgba(8, 6, 4, .55); z-index: 40; opacity: 0; transition: opacity .18s; }
.fg-drawer-bg.open { opacity: 1; }
.fg-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(580px, 100%); z-index: 41; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; background: #1c1712; border-left: 2px solid var(--fg-gold-d); box-shadow: -18px 0 40px rgba(0, 0, 0, .5); transform: translateX(100%); transition: transform .2s ease-out; }
.fg-drawer.open { transform: none; }
.fg-dr-head { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px 12px; border-bottom: 2px solid var(--fg-line); }
.fg-dr-head > div:first-child:not(.grow), .fg-dr-head .grow { flex: 1; min-width: 0; }
.fg-dr-k { font: 600 12px var(--font); color: var(--fg-dim); text-transform: uppercase; letter-spacing: .08em; }
.fg-dr-tabs { display: flex; gap: 2px; padding: 8px 16px 0; border-bottom: 2px solid var(--fg-line); overflow-x: auto; scrollbar-width: none; }
.fg-dr-tab { flex: none; font: 600 13.5px var(--font); padding: 8px 12px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--fg-muted); cursor: pointer; }
.fg-dr-tab:hover { color: var(--fg-text); }
.fg-dr-tab.on { color: var(--fg-gold); border-bottom-color: var(--fg-gold); }
.fg-dr-body { overflow-y: auto; padding: 16px 20px 24px; font-size: 14px; line-height: 1.5; }
.fg-dr-body h4 { font-size: 15px; color: var(--fg-gold); margin: 18px 0 8px; }
.fg-dr-body h4:first-child { margin-top: 0; }
.fg-dr-foot { padding: 12px 20px; border-top: 2px solid var(--fg-line); display: flex; justify-content: flex-end; align-items: center; gap: 10px; background: #1a1511; }
.fg-lead { font-size: 15px; margin: 0 0 14px; color: var(--fg-text); }
.fg-note { color: var(--fg-muted); font-size: 13.5px; margin: 8px 0 12px; }
.fg-ul { margin: 0; padding-left: 18px; }
.fg-ul li { margin: 3px 0; }
.fg-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fg-facts > div { background: #241d16; border-radius: 3px; padding: 7px 10px; }
.fg-facts span { display: block; font-size: 11.5px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.fg-facts b { font-weight: 600; font-size: 13.5px; }
.fg-table { display: flex; flex-direction: column; }
.fg-tr { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--fg-line); }
.fg-tr:first-child { border-top: 0; }
.fg-lvl { width: 32px; height: 26px; display: grid; place-items: center; font: 400 14px var(--fg-px); background: #2a2219; color: var(--fg-muted); border-radius: 2px; }
.fg-tr.have .fg-lvl { background: #2f4f2a; color: #d4f7c4; }
.fg-tr.epic .fg-lvl, .fg-tr.evo .fg-lvl { background: #4a3812; color: var(--fg-gold); }
.fg-tr b { font-weight: 600; }
.fg-d { color: var(--fg-muted); font-size: 13.5px; }
.fg-acc { border: 2px solid var(--fg-line); border-radius: 3px; margin-bottom: 6px; background: #1f1913; }
.fg-acc > summary { cursor: pointer; padding: 9px 12px; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.fg-acc > summary::-webkit-details-marker { display: none; }
.fg-acc > summary::before { content: '▸'; color: var(--fg-gold); font-size: 12px; }
.fg-acc[open] > summary::before { content: '▾'; }
.fg-acc > summary .fg-d { flex-basis: 100%; padding-left: 16px; }
.fg-acc > :not(summary) { padding: 0 12px 10px; }
.fg-acc.fg-allfeats { margin-top: 10px; }
.fg-acc.fg-allfeats .feat { font-size: 13px; margin: 6px 0; }
.fg-chiplist { display: flex; flex-wrap: wrap; gap: 6px; }
.fg-spchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 4px; border-radius: 3px; background: #241f36; border: 1px solid #40365f; font-size: 13px; cursor: help; }
.fg-spchip.ab { background: #1d2a22; border-color: #3c5f45; }
.fg-spchip em { font-style: normal; color: var(--fg-dim); font-size: 11.5px; }
.fg-spchip .sp-ico { border-radius: 3px; }

/* ---------------------------------------------------------------- the other steps, restyled */
.fg-jumps { position: sticky; top: -20px; z-index: 6; display: flex; gap: 4px; flex-wrap: wrap; margin: 0 -26px 16px; padding: 8px 26px; background: #1c1712; border-bottom: 2px solid var(--fg-line); }
.fg-jump { font: 600 12.5px var(--font); padding: 4px 10px; border-radius: 3px; border: 2px solid var(--fg-line); background: transparent; color: var(--fg-muted); cursor: pointer; }
.fg-jump:hover { color: var(--fg-text); border-color: var(--fg-line2); }
.fg-jump.todo { border-color: #6a4416; color: #ffd9a8; }
.fg-jump i { font-style: normal; margin-right: 4px; color: var(--fg-warn); }
.modal.forge .sp-filter { top: 18px; border-radius: 3px; border: 2px solid var(--fg-line); background: #1c1712; }
.modal.forge .opt { border-width: 2px; border-radius: 3px; padding: 10px 12px; font-size: 13px; line-height: 1.45; box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.modal.forge .opt b { font-size: 14px; }
.modal.forge .opt-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.modal.forge .vchip { border-radius: 3px; }
.modal.forge .ability-grid { gap: 8px; }
.modal.forge .ability { border: 2px solid var(--fg-line); border-radius: 4px; background: var(--fg-card); padding: 12px 6px; }
.modal.forge .ability .ab { font: 400 15px var(--fg-px); color: var(--fg-gold); }
.modal.forge .ability .score { font: 600 34px/1.1 var(--fg-px); }
.fg-boost-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 6px 0; }
.fg-boost-n { width: 44px; text-align: center; font: 400 16px var(--fg-px); color: var(--fg-gold); }
.modal.forge .wz-chosen { display: flex; gap: 10px; align-items: flex-start; }
.modal.forge .pt-tab { border-radius: 3px 3px 0 0; }
.modal.forge .pt-body { border-radius: 0 4px 4px 4px; }
.modal.forge .sheet-summary { font-size: 13px; }
.modal.forge .doll .avatar { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.fg-doll { width: 100%; max-width: 348px; border-radius: 4px; overflow: hidden; line-height: 0; background: linear-gradient(180deg, #221d31 0 50%, #352838 50% 80%, #2a211d 80%); box-shadow: inset 0 0 0 2px #0c0a08, inset 0 0 0 4px #3b3024; }
.fg-doll canvas { width: 100%; height: auto; image-rendering: pixelated; }
.fg-note-card { margin-top: 4px; padding: 12px 14px; border-radius: 3px; background: #1f2a22; border: 2px solid #35503c; color: #cfeec9; font-size: 14px; }

/* finish */
.fg-namerow { display: flex; gap: 8px; }
.modal.forge .fg-namerow input { flex: 1; min-width: 0; font: 400 20px var(--fg-px); padding: 10px 12px; }
.fg-ready { display: flex; flex-direction: column; gap: 4px; }
.fg-rc { display: grid; grid-template-columns: 26px 96px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 3px; border: 2px solid var(--fg-line); background: var(--fg-card); color: var(--fg-text); text-align: left; cursor: pointer; font: 14px var(--font); }
.fg-rc:hover { border-color: var(--fg-line2); }
.fg-rc-i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 2px; font-weight: 800; font-size: 12px; background: #2f4f2a; color: #d4f7c4; }
.fg-rc.todo { border-color: #6a4416; }
.fg-rc.todo .fg-rc-i { background: #6a3d14; color: #ffd9a8; }
.fg-rc.auto .fg-rc-i { background: #1c2c3a; color: var(--fg-new); }
.fg-rc-n { font-weight: 700; }
.fg-rc-m { color: var(--fg-muted); font-size: 13px; }
.fg-rc.todo .fg-rc-m { color: #ffd9a8; }
.fg-rc-go { color: var(--fg-gold); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.fg-go { color: var(--fg-green); font-weight: 600; margin: 10px 0 0; }

/* footer */
.modal.forge .modal-foot { padding: 10px 18px; border-top: 2px solid var(--fg-line); background: #1a1511; }
.modal.forge #ed-next.gated { opacity: .55; }
.modal.forge #ed-status { color: var(--fg-warn); }

/* ---------------------------------------------------------------- tablet */
/* Race / Class: the heading, filters and current pick stay pinned; only the card grid scrolls */
.modal.forge .fg-pinned { position: sticky; top: -20px; z-index: 5; margin: -20px -26px 14px; padding: 20px 26px 12px;
  background: #1b1611; border-bottom: 2px solid var(--fg-line); box-shadow: 0 8px 12px -8px rgba(0, 0, 0, .6); }
.modal.forge .fg-pinned > :last-child { margin-bottom: 0; }
/* Spells step: Known | Spell List tabs, pinned under the step heading */
.modal.forge .fg-sptabs { position: sticky; top: -20px; z-index: 6; display: flex; gap: 0; margin: 0 -26px 16px; padding: 10px 26px 0; background: #1c1712; border-bottom: 2px solid var(--fg-line); }
.modal.forge .fg-sptab { font: 400 20px var(--fg-px); padding: 6px 18px 8px; margin-bottom: -2px; border: 2px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; background: transparent; color: var(--fg-dim); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.modal.forge .fg-sptab:hover { color: var(--fg-text); }
.modal.forge .fg-sptab.on { color: var(--fg-gold); background: var(--fg-card); border-color: var(--fg-line); border-bottom: 2px solid var(--fg-card); }
.modal.forge .fg-sptab em { font: 600 12px var(--font); font-style: normal; padding: 1px 7px; border-radius: 99px; background: #2a2219; color: var(--fg-muted); }
.modal.forge .fg-sptab i { font: 700 11px var(--font); font-style: normal; width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 2px; background: #6a4416; color: #ffd9a8; }
.modal.forge .fg-known-hint a, .modal.forge .fg-note a { color: var(--fg-gold); }
@media (max-width: 1100px) {
  .modal.forge .editor.fg-body { grid-template-columns: 300px minmax(0, 1fr); }
  .modal.forge .editor.fg-body > .editor-side { padding: 12px; }
  .fg-step { padding-right: 8px; }
}
/* ---------------------------------------------------------------- phone: one scrolling column, compact stage on top */
@media (max-width: 760px) {
  .modal-bg.fg-bg { padding: 0; }
  .modal.forge { width: 100%; height: 100%; border-radius: 0; border: 0; box-shadow: none; }
  .modal.forge .modal-head { padding: 8px 12px; }
  .modal.forge .modal-head h2 { font-size: 18px; }
  .modal.forge #ed-tabs { padding: 8px 12px; }
  .fg-rail { display: none; }
  .fg-railm { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; }
  .fg-railm-n { font: 600 12px var(--font); color: var(--fg-dim); text-transform: uppercase; letter-spacing: .06em; }
  .fg-railm b { font: 400 17px var(--fg-px); color: var(--fg-gold); }
  .fg-railm-h { display: none; }
  .fg-railm-bar { grid-column: 1 / -1; display: flex; gap: 3px; margin-top: 6px; }
  .fg-railm-bar i { flex: 1; height: 5px; background: #2c241b; border-radius: 1px; }
  .fg-railm-bar i.past { background: #4f7a43; }
  .fg-railm-bar i.now { background: var(--fg-gold); }
  .fg-railm-bar i.todo:not(.now) { background: #8a4f18; }
  .modal.forge .editor.fg-body { display: flex; flex-direction: column; overflow-y: auto; }
  .modal.forge .editor.fg-body > * { flex: none; }
  .modal.forge .editor.fg-body > .editor-side { border-right: 0; border-bottom: 2px solid var(--fg-line); padding: 10px 12px; }
  .modal.forge .editor.fg-body > .editor-main { overflow: visible; padding: 14px 12px 24px; }
  .fg-stage { display: grid; grid-template-columns: 144px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
  .fg-scene { grid-row: span 2; }
  .fg-name { font-size: 19px; }
  .fg-line { font-size: 13px; }
  .fg-look { gap: 6px; }
  .fg-lbl { flex-basis: 44px; font-size: 11px; }
  .fg-swatch { width: 20px; height: 20px; }
  .fg-build { display: none; }
  .fg-replay { width: 28px; height: 28px; font-size: 13px; right: 6px; bottom: 6px; }
  .fg-h { font-size: 22px; }
  .fg-sub { font-size: 13.5px; }
  .fg-sum { flex-direction: column; gap: 10px; min-height: 0; padding: 12px; }
  .fg-more { align-self: flex-start; }
  .fg-grid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .fg-card { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 6px 8px 6px 6px; }
  .fg-card .fg-thumb { width: 64px; height: 64px; }
  .fg-info { opacity: 1; width: 28px; height: 28px; }
  .fg-ct { padding-right: 30px; }
  .fg-jumps { top: -14px; margin: 0 -12px 12px; padding: 8px 12px; flex-wrap: nowrap; overflow-x: auto; }
  .fg-jump { flex: none; }
  .modal.forge .ability-grid { grid-template-columns: repeat(3, 1fr); }
  .fg-rc { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .fg-rc-m { grid-column: 2 / -1; }
  .fg-drawer { width: 100%; border-left: 0; }
  .fg-facts { grid-template-columns: minmax(0, 1fr); }
  .modal.forge .modal-foot { padding: 8px 10px; gap: 6px; flex-wrap: nowrap; }
  .modal.forge #ed-status, .modal.forge #ed-cancel { display: none !important; }
  .modal.forge #ed-auto { font-size: 0; padding: 8px 10px; }
  .modal.forge #ed-auto::before { content: '✨'; font-size: 15px; }
  .modal.forge .modal-foot .btn { padding: 9px 12px; white-space: nowrap; }
  .modal.forge #ed-next { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
  .modal.forge .opt-grid { grid-template-columns: minmax(0, 1fr); }
}
.fg-go.todo { color: var(--fg-warn); }
.modal.forge .fg-rc { padding: 6px 10px; }
@media (max-width: 760px) {
  .fg-stage .fg-look:not(.big) .fg-colrow { display: none; }
  .fg-rc.ok .fg-rc-m { display: none; }
  .fg-rc { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .modal.forge .modal-foot .btn { min-width: 0; }
  .fg-look.big .fg-look-row { align-items: flex-start; }
  .fg-look.big .fg-swatch { width: 28px; height: 28px; }
}
/* small numbered badges read best in the body font */
.fg-n, .fg-lvl { font-family: var(--font) !important; font-weight: 800; }
@media (max-width: 760px) { .modal.forge .fg-pinned { position: static; margin: 0 0 12px; padding: 0; background: none; border: 0; box-shadow: none; } }
@media (max-width: 760px) { .modal.forge .fg-sptabs { top: 0; margin: 0 -12px 12px; padding: 8px 12px 0; } }

/* ---------------------------------------------------------------- EDIT mode: plain tabs instead of the step wizard */
.modal.forge #ed-tabs.fg-etabs-bar { padding: 10px 16px 0; background: #1a1511; }
.fg-etabs { display: flex; gap: 2px; min-width: max-content; }
.fg-etab { position: relative; display: inline-flex; align-items: center; gap: 7px; font: 400 19px var(--fg-px); padding: 7px 16px 9px; margin-bottom: -2px; border: 2px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; background: transparent; color: var(--fg-dim); cursor: pointer; white-space: nowrap; }
.fg-etab:hover { color: var(--fg-text); background: #211a14; }
.fg-etab.on { color: var(--fg-gold); background: #1e1813; border-color: var(--fg-line); border-bottom: 2px solid #1e1813; text-shadow: 0 2px 0 #000; }
.fg-etab i { font: 700 11px var(--font); font-style: normal; width: 17px; height: 17px; display: inline-grid; place-items: center; border-radius: 2px; background: #6a3d14; color: #ffd9a8; text-shadow: none; }
/* the locked hero's own race / class, in full */
.fg-hero .fg-sptabs { margin-bottom: 10px; }
.fg-locknote { margin: 0 0 14px; font-size: 12.5px; color: var(--fg-dim); }
.fg-hd-top { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.fg-hd-top .fg-h { font-size: 28px; }
.fg-hd-sub { font: 600 15px var(--font); color: var(--fg-muted); text-shadow: none; margin-left: 6px; }
.fg-card-table { background: #1f1913; border: 2px solid var(--fg-line); border-radius: 4px; padding: 2px 12px; }
.fg-facts-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }
.fg-hero .section > h3 .count { margin-left: 4px; }
@media (max-width: 760px) {
  .modal.forge #ed-tabs.fg-etabs-bar { padding: 8px 10px 0; }
  .fg-etab { font-size: 16px; padding: 6px 11px 8px; }
  .fg-facts-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fg-hd-top .fg-h { font-size: 23px; }
}
@media (max-width: 760px) { .fg-jumps { top: 0; } }

/* ======================================================================================
   Dice & Dominion shop — the pixel bazaar (client/js/shop.js, D&D world only: .px-shop)
   ====================================================================================== */
.modal.px-shop .modal-head { padding: 10px 16px; gap: 12px; border-bottom: 2px solid var(--fg-line); background: linear-gradient(#221b15, #1c1612); }
.modal.px-shop .modal-head h2 { font: 400 26px/1.1 var(--fg-px); color: var(--fg-gold); text-shadow: 0 2px 0 #000; letter-spacing: .02em; }
body .modal.px-shop .modal-head h2::before { content: none; }
.modal.px-shop h3 { font-family: var(--fg-px); font-weight: 400; }
.px-shop-head .fg-thumb.sm { width: 52px; height: 52px; flex: none; }
.px-sub { color: var(--fg-muted); font-size: 13.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-sub b { color: var(--fg-text); }
.px-town { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 2px; background: #2a2219; color: var(--fg-dim); }
.px-town.on { background: #33281a; color: var(--fg-gold); }
.px-gold { flex: none; font: 400 24px var(--fg-px); color: var(--fg-gold); padding: 4px 12px; border: 2px solid var(--fg-gold-d); border-radius: 3px; background: #2a2116; text-shadow: 0 2px 0 #000; }
.modal.px-shop .tabs.fg-etabs-bar { padding: 10px 16px 0; background: #1a1511; border-bottom: 2px solid var(--fg-line); overflow-x: auto; scrollbar-width: none; }
.modal.px-shop .editor.px-shop-body { grid-template-columns: minmax(0, 1fr) 320px; min-height: 0; }
.modal.px-shop .editor-main { padding: 16px 20px 28px; background: #1e1813; }
.modal.px-shop .editor-side.px-side { border-left: 2px solid var(--fg-line); background: #17130f; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.modal.px-shop .px-side > * { flex: none; }
.px-blurb { margin: 0 0 12px; color: var(--fg-muted); font-size: 13.5px; line-height: 1.5; max-width: 80ch; }
.px-note { margin: 0 0 12px; padding: 8px 12px; border-radius: 3px; background: #2b2216; border: 2px solid #5a4523; color: #f3d9a0; font-size: 13px; }
.px-count { font-size: 12.5px; color: var(--fg-dim); margin: 0 0 8px; }
/* filters */
.modal.px-shop .shop-filters { background: #1a1511; border: 2px solid var(--fg-line); border-radius: 4px; padding: 10px; margin-bottom: 12px; }
.modal.px-shop .shop-filters input[type=search], .modal.px-shop .shop-filters select { background: #15110d; border: 2px solid var(--fg-line); border-radius: 3px; padding: 6px 10px; color: var(--fg-text); font: 13.5px var(--font); }
.modal.px-shop .shop-filters label { color: var(--fg-muted); }
.modal.px-shop .chip { border-radius: 3px; border-width: 2px; padding: 4px 10px; font: 600 12.5px var(--font); background: #1f1913; }
.modal.px-shop .chip:not([style]) { --chip: var(--fg-muted); }
.modal.px-shop .chip.on { background: color-mix(in srgb, var(--chip) 22%, #1f1913); border-color: var(--chip); color: var(--fg-text); }
/* item cards */
.px-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; }
.modal.px-shop .px-item { --rar: var(--fg-line2); display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px 12px; align-items: start; min-height: 0; padding: 10px 12px 10px 10px; border: 2px solid var(--fg-line); border-left: 4px solid var(--rar); border-radius: 4px; background: var(--fg-card); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.modal.px-shop .px-item:hover { background: var(--fg-card-h); border-color: var(--fg-line2); border-left-color: var(--rar); }
.modal.px-shop .px-item.owned { border-color: #35503c; border-left-color: var(--rar); }
.px-ic { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 3px; background: radial-gradient(circle at 50% 60%, #3a2e3e 0 35%, #241d2c 70%); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .35); }
.px-ic svg { border-radius: 3px; image-rendering: pixelated; }
.px-ico-g { font-size: 24px; filter: saturate(.8); }
.px-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.px-nm { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.px-nm b { font: 400 19px/1.1 var(--fg-px); color: var(--rar, var(--fg-text)); letter-spacing: .01em; }
.px-item:not([style]) .px-nm b { color: var(--fg-text); }
.px-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.px-tag, .modal.px-shop .px-tags .tag { font: 600 11px var(--font); padding: 1px 6px; border-radius: 2px; background: #2e261d; color: var(--fg-muted); border: 0; }
.px-tag.green, .modal.px-shop .px-tags .tag.green { background: #1f3326; color: #a8e6b0; }
.px-tag.red, .modal.px-shop .px-tags .tag.red { background: #3b1d18; color: #ffb4a0; }
.px-tag.gold { background: #3a2c12; color: var(--fg-gold); }
.px-tag.blue { background: #1c2c3a; color: var(--fg-new); }
.px-desc { font-size: 13px; line-height: 1.45; color: var(--fg-muted); }
.px-cmp { font-size: 12.5px; font-weight: 600; color: var(--fg-dim); }
.px-cmp.up { color: var(--fg-green); }
.px-cmp.down { color: #ff9f8a; }
.px-act { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 2px; }
.modal.px-shop .px-buy-main { font-weight: 700; padding: 7px 12px; white-space: nowrap; }
.px-cost { font-weight: 800; margin-left: 4px; }
.px-cost::before { content: '🪙'; font-size: 11px; margin-right: 3px; }
.px-need { font-size: 12px; color: var(--fg-warn); }
.px-ups { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin-left: auto; }
.px-ups-l { margin-right: 3px; font-size: 10.5px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.px-up { font: 700 11.5px var(--font); padding: 3px 6px; border-radius: 2px; border: 1px solid var(--fg-line2); background: #1d1813; color: var(--fg-text); cursor: pointer; white-space: nowrap; }
.px-up:hover:not(:disabled) { border-color: var(--fg-gold); color: var(--fg-gold); }
.px-up:disabled { opacity: .4; cursor: not-allowed; }
.px-up .px-cost { font-weight: 600; color: var(--fg-muted); }
.px-up .px-cost::before { content: none; }
.modal.px-shop .px-item.poor .px-buy-main, .modal.px-shop .px-item.locked .px-buy-main { background: #2a231c; border-color: var(--fg-line2); color: var(--fg-dim); box-shadow: none; }
.modal.px-shop .px-item.poor .px-ic, .modal.px-shop .px-item.locked .px-ic { opacity: .55; }
.modal.px-shop .px-item.locked .px-nm b { opacity: .7; }
/* side: pixel hero, stats, slots */
.px-scene { position: relative; }
.px-prev { position: absolute; left: 8px; right: 8px; bottom: 8px; font: 600 12px var(--font); line-height: 1.3; color: var(--fg-new); text-align: center; text-shadow: 0 1px 0 #000; }
.px-prev:empty { display: none; }
.modal.px-shop .px-stats { margin: 0; gap: 6px; }
.modal.px-shop .px-stats .stat { background: #221b15; border: 2px solid var(--fg-line); border-radius: 3px; }
.modal.px-shop .px-stats .v { font: 400 26px/1 var(--fg-px); color: var(--fg-text); }
.modal.px-shop .px-stats .k { font-weight: 700; color: var(--fg-dim); }
.px-slots-box > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; font: 400 18px var(--fg-px); color: var(--fg-gold); margin-bottom: 6px; }
.px-slots-box > summary::-webkit-details-marker { display: none; }
.px-slots-box > summary::before { content: '▸'; font-size: 12px; }
.px-slots-box[open] > summary::before { content: '▾'; }
.px-hint { font: 12px var(--font); color: var(--fg-dim); }
.px-slots { display: flex; flex-direction: column; gap: 2px; }
.px-slot { display: grid; grid-template-columns: 22px 78px minmax(0, 1fr); align-items: center; gap: 6px; padding: 5px 8px; border: 0; border-radius: 3px; background: transparent; color: var(--fg-text); text-align: left; cursor: pointer; font: 13px var(--font); }
.px-slot:hover { background: #221b15; }
.px-slot.sel { background: #2a2116; box-shadow: inset 2px 0 0 var(--fg-gold); }
.px-slot-n { color: var(--fg-dim); font-weight: 600; }
.px-slot-v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-slot.open .px-slot-v { color: var(--fg-dim); font-style: italic; }
.px-slot-v.magic { color: #c8b6ff; }
.px-attune { margin-top: 8px; font-size: 12.5px; color: var(--fg-muted); }
.px-attune.full { color: var(--fg-warn); }
.px-pack { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12.5px; }
.px-pack-h { font-weight: 700; color: var(--fg-dim); margin-right: 2px; }
.px-pack-i { padding: 1px 7px; border-radius: 2px; background: #2a2219; color: var(--fg-text); }
.modal.px-shop .modal-foot { padding: 10px 16px; border-top: 2px solid var(--fg-line); background: #1a1511; }
/* masterwork forge keeps its layout, in the new frame */
.modal.px-shop .mw-card { border: 2px solid var(--fg-line); border-radius: 4px; background: var(--fg-card); }
.modal.px-shop .mw-title { font: 400 22px var(--fg-px); color: var(--fg-gold); }
@media (max-width: 1100px) { .modal.px-shop .editor.px-shop-body { grid-template-columns: minmax(0, 1fr) 260px; } }
@media (max-width: 760px) {
  .modal.px-shop { width: 100%; height: 100%; border-radius: 0; border: 0; box-shadow: none; }
  .modal.px-shop .modal-head { padding: 8px 10px; gap: 8px; }
  .modal.px-shop .modal-head h2 { font-size: 21px; }
  .px-shop-head .fg-thumb.sm { width: 40px; height: 40px; }
  .px-sub { font-size: 12px; }
  .px-town { display: none; }
  .px-gold { font-size: 19px; padding: 2px 8px; }
  .modal.px-shop .tabs.fg-etabs-bar { padding: 8px 10px 0; }
  .modal.px-shop .editor.px-shop-body { display: flex; flex-direction: column; overflow-y: auto; }
  .modal.px-shop .editor-side.px-side { order: -1; }
  .modal.px-shop .editor.px-shop-body > * { flex: none; }
  .modal.px-shop .editor-main { overflow: visible; padding: 12px 10px 20px; }
  .modal.px-shop .editor-side.px-side { border-left: 0; border-bottom: 2px solid var(--fg-line); padding: 10px; display: grid; grid-template-columns: 144px minmax(0, 1fr); gap: 8px 10px; align-items: start; }
  .px-scene { grid-row: span 2; }
  .modal.px-shop .px-stats { grid-template-columns: repeat(3, 1fr); }
  .modal.px-shop .px-stats .v { font-size: 21px; }
  .px-slots-box { grid-column: 1 / -1; }
  .modal.px-shop #sh-equip { align-self: end; }
  .px-grid { grid-template-columns: minmax(0, 1fr); }
  .modal.px-shop .px-item { grid-template-columns: 40px minmax(0, 1fr); }
  .px-ic { width: 40px; height: 40px; }
  .px-act { grid-column: 1 / -1; }
  .modal.px-shop .modal-foot .muted { display: none; }
}
/* the tab strip scrolls sideways instead of widening the modal */
.modal.px-shop, .modal.forge { grid-template-columns: minmax(0, 1fr); }
.modal.px-shop > *, .modal.forge > * { min-width: 0; }
/* Spell cards (Known / Spell List): bigger spell icons */
.modal.forge .opt > b > .sp-ico { width: 52px; height: 52px; margin-right: 12px; border-radius: 6px; box-shadow: 0 0 0 2px #0c0a08, 0 0 0 3px var(--fg-line2); }
.modal.forge .opt > b:has(> .sp-ico) { display: flex; align-items: center; min-height: 56px; }
@media (max-width: 760px) { .modal.forge .opt > b > .sp-ico { width: 40px; height: 40px; margin-right: 10px; } .modal.forge .opt > b:has(> .sp-ico) { min-height: 44px; } }

/* ---- Portrait step (client/js/portrait_ui.js): the hero's headshot ---------------------------------------- */
.pt-img { image-rendering: pixelated; display: block; }
.fg-id { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; }
.fg-id > :not(.fg-headshot) { grid-column: 2; }
.fg-headshot { grid-row: 1 / span 2; padding: 0; border: 0; background: none; cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.fg-headshot:hover { transform: translateY(-1px); filter: brightness(1.08); }
.pte-top { display: flex; gap: 18px; align-items: flex-start; position: sticky; top: -20px; z-index: 4; margin: 0 -26px 16px; padding: 20px 26px 12px; background: #1b1611; border-bottom: 2px solid var(--fg-line); box-shadow: 0 8px 12px -8px rgba(0, 0, 0, .6); }
.pte > .fg-head { margin-bottom: 4px; }
.pte-prev { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pte-frame { flex: none; padding: 4px; background: #0d0b09; border-radius: 2px; box-shadow: 0 3px 0 rgba(0, 0, 0, .5); }
.pte-frame canvas, .pte-smalls canvas { display: block; image-rendering: pixelated; }
.pte-smalls { display: flex; gap: 12px; align-items: flex-end; }
.pte-smalls figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pte-smalls canvas { box-shadow: 0 0 0 2px #0d0b09, 0 0 0 3px var(--fg-line2); }
.pte-smalls figcaption { font: 400 12px var(--fg-px); color: var(--fg-dim); line-height: 1; }
.pte-ctl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pte-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pte-actions .btn small { font-size: 11px; opacity: .8; margin-left: 2px; }
.pte-hist { display: inline-flex; gap: 4px; }
.pte-hist .btn { min-width: 38px; padding-left: 9px; padding-right: 9px; font: 600 13px var(--font); }
.pte-grps { display: flex; flex-wrap: wrap; gap: 6px; }
.pte-grp { font: 400 18px var(--fg-px); padding: 4px 10px 6px; border-radius: 3px; border: 2px solid var(--fg-line); background: #1f1913; color: var(--fg-muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; flex: none; }
.pte-grp:hover { border-color: var(--fg-line2); color: var(--fg-text); }
.pte-grp.on { border-color: var(--fg-gold); color: var(--fg-gold); background: var(--fg-card-on); }
.pte-grp i { font: 700 10px var(--font); font-style: normal; background: var(--fg-gold-d); color: #160f08; border-radius: 99px; padding: 1px 5px; }
.pte-hint { margin: 0; font-size: 13px; color: var(--fg-dim); }
.pte-cat { margin-bottom: 18px; }
.pte-cat.locked > .pte-cat-h b::after { content: ' 🔒'; font-size: 12px; }
.pte-cat-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pte-cat-h b { font: 400 18px var(--fg-px); color: var(--fg-gold); }
.pte-cur { font-size: 13px; color: var(--fg-muted); min-width: 0; }
.pte-cur em { font-style: normal; font-size: 11px; color: var(--fg-dim); border: 1px solid var(--fg-line); border-radius: 99px; padding: 0 6px; margin-left: 4px; }
.pte-cat-h .spacer { flex: 1; }
.pte-mini { width: 30px; height: 28px; padding: 0; border-radius: 3px; border: 2px solid var(--fg-line); background: #1f1913; color: var(--fg-text); cursor: pointer; font-size: 14px; align-self: center; }
.pte-mini:hover:not(:disabled) { border-color: var(--fg-gold-d); }
.pte-mini.on { border-color: var(--fg-gold); background: var(--fg-card-on); }
.pte-mini:disabled { opacity: .35; cursor: default; }
.pte-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.pte-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 5px; border-radius: 3px; border: 2px solid var(--fg-line); background: var(--fg-card); color: var(--fg-muted); cursor: pointer; font-size: 11.5px; line-height: 1.15; text-align: center; box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.pte-opt canvas { image-rendering: pixelated; background: #0d0b09; box-shadow: 0 0 0 1px #0d0b09; }
.pte-opt:hover { border-color: var(--fg-line2); background: var(--fg-card-h); color: var(--fg-text); }
.pte-opt.on { border-color: var(--fg-gold); background: var(--fg-card-on); color: var(--fg-gold); }
.pte-presets { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
/* named swatches (+ a custom colour picker) */
.pte-sws { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 6px; }
.pte-sw { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 3px 3px 4px; border-radius: 3px; border: 2px solid var(--fg-line); background: var(--fg-card); color: var(--fg-muted); cursor: pointer; position: relative; font: 500 10.5px var(--font); line-height: 1.1; text-align: center; min-width: 0; text-transform: none; letter-spacing: 0; }
.pte-sw i { display: block; height: 22px; border-radius: 2px; background: var(--sw); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(0, 0, 0, .35); position: relative; }
.pte-sw span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pte-sw.auto i::after { content: 'A'; position: absolute; inset: 0; display: grid; place-items: center; font: 400 15px var(--fg-px); color: #fff; text-shadow: 0 1px 0 #000, 0 0 2px #000; }
.pte-sw:hover { border-color: var(--fg-line2); color: var(--fg-text); }
.pte-sw.on { border-color: var(--fg-gold); color: var(--fg-gold); background: var(--fg-card-on); }
.pte-custom i { background: conic-gradient(from 90deg, #e04040, #e0c040, #40c060, #40a0e0, #8050d0, #e04080, #e04040); }
.pte-custom.on i { background: var(--sw); }
.pte-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
@media (max-width: 760px) {
  .modal.forge .pte-top { gap: 10px; top: -14px; margin: 0 -12px 12px; padding: 10px 12px; }
  .pte-smalls { display: none; }
  .pte-grp { font-size: 16px; padding: 3px 8px 4px; }
  .pte-grps { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -12px; padding-right: 12px; }
  .pte-actions { gap: 6px; }
  .pte-actions .btn { padding: 6px 9px; font-size: 13px; }
  .pte-actions .btn small { display: none; }
  .pte-hist .btn { min-width: 34px; }
  .pte-hint { display: none; }
  .pte-opts { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px; }
  .pte-sws { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 5px; }
  .fg-headshot .pt-img { width: 40px; height: 40px; }
}
