/* DEEPMINE UI v4 — shared components.
   Page stylesheets (ui/pages/*.css) compose these; they should not restyle them globally.

   Buttons ........ .btn + --primary | --secondary | --ghost | --danger | --sm | --lg | --block | --icon
                    legacy aliases: .primary (= primary), .wide-button (= secondary, full width)
   Surfaces ....... .card + --raised | --feature | --inset | --locked     (.game-card = .card)
   Segmented tabs . .seg (+ --scroll | --pills); selected = [aria-pressed=true] | [aria-selected=true] | .active | .chosen
   Chips .......... .chip + --gold | --jade | --warn | --danger | --info | --muted | --rarity ;  .badge ; .status-pill
   Data ........... .stat-grid > .stat (.stat-label .stat-value .stat-sub) ; .kv-list > .kv ; .price ; .currency-amount
   Progress ....... .meter > span  (+ --jade | --lg)
   Lists .......... .list > .list-row (.list-icon .list-copy .list-title .list-sub .list-trail)
   Items .......... .item-tile (uses --rarity from .rarity-*) + .item-count
   Materials ...... .materials-block > .material-legend + .material-list > .material-chip(.is-met|.is-missing) (.material-name .material-count .material-owned .material-need)
   Notes .......... .note + --warn | --danger | --info | --success   (.panel-note, .is-warm aliases)
   Empty .......... .empty-state (.empty-icon, h3/strong, p, .btn)
   Hero ........... .panel-hero (.panel-hero-copy .panel-eyebrow h3 p .panel-chip-row .panel-chip .panel-hero-art), --hero-art
   Headings ....... .section-head (h3 + small)
   Forms .......... inputs / select / textarea (element styles), .field, .switch, input[type=range]
   Disclosure ..... details.disclosure > summary */

@layer components {
  /* ───────────── Buttons ───────────── */
  :where(.btn, .primary, .wide-button) {
    --btn-h: 44px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: var(--btn-h);
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid var(--line-2);
    background: var(--grad-btn);
    color: var(--text-1);
    font-size: var(--fs-14);
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .09), 0 2px 0 rgb(3 12 8 / .75), 0 6px 14px -8px rgb(0 0 0 / .7);
    transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out), filter var(--dur-2), background var(--dur-2);
  }
  :where(.btn, .primary, .wide-button) .icon { width: 17px; height: 17px; }
  :where(.btn, .primary, .wide-button) .gi { width: 22px; height: 22px; margin: -4px 0; }
  :where(.btn, .primary, .wide-button):active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .06), 0 0 0 rgb(3 12 8 / .75), 0 3px 8px -6px rgb(0 0 0 / .7);
  }
  @media (hover: hover) and (pointer: fine) {
    :where(.btn, .primary, .wide-button):hover:not(:disabled) { filter: brightness(1.08); }
  }

  /* Primary — the gold, three-dimensional call to action. */
  :where(.btn--primary, .primary) {
    color: var(--text-on-gold);
    background: var(--grad-gold);
    border-color: #ffe9ad #e7ad48 #b7751e;
    text-shadow: 0 1px 0 rgb(255 246 215 / .6);
    box-shadow: var(--sh-plate-gold);
  }
  :where(.btn--primary, .primary):active:not(:disabled) {
    background: var(--grad-gold-pressed);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), inset 0 -1px 0 rgb(160 95 20 / .3), 0 1px 0 var(--gold-edge), 0 3px 10px -6px rgb(240 170 60 / .5);
  }
  :where(.btn--primary, .primary) .icon { color: currentColor; }
  :where(.btn--primary, .primary) .gi { --gi-line: #4f320d; }

  /* Secondary — raised jade. */
  :where(.btn--secondary, .wide-button) {
    background: var(--grad-jade-plate);
    border-color: rgb(150 225 185 / .26) rgb(150 225 185 / .14) rgb(0 0 0 / .3);
  }
  :where(.wide-button, .btn--block) { display: flex; width: 100%; }

  /* Ghost — quiet tertiary. */
  :where(.btn--ghost) {
    background: rgb(255 255 255 / .03);
    border-color: var(--line-2);
    color: var(--text-2);
    box-shadow: none;
  }
  :where(.btn--ghost):active:not(:disabled) { box-shadow: none; background: rgb(255 255 255 / .06); }

  :where(.btn--danger) {
    color: #fff4ef;
    background: linear-gradient(180deg, #d24a31, #b9351f 60%, #9e2a16);
    border-color: #f08a70 #c0391f #7e2210;
    text-shadow: 0 1px 0 rgb(120 30 10 / .4);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .45), 0 3px 0 #7e2a13, 0 8px 18px -8px rgb(240 100 70 / .55);
  }

  :where(.btn--sm) { --btn-h: 40px; padding: 0 12px; border-radius: 11px; font-size: var(--fs-13); }
  /* Compact buttons keep a 44px hit area without growing visually. */
  :where(.btn--sm)::before { content: ''; position: absolute; inset: -3px -2px; }
  :where(.btn--lg) { --btn-h: 52px; padding: 0 22px; border-radius: 14px; font-size: var(--fs-16); }
  :where(.btn--icon) { width: var(--btn-h); padding: 0; flex: none; }

  /* Disabled: flat, quiet, still legible; the reason text stays readable. */
  :where(.btn, .primary, .wide-button):disabled {
    color: var(--text-3);
    background: var(--surface-disabled);
    border-color: var(--line-1);
    text-shadow: none;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .03);
    filter: none;
  }
  :where(.btn, .primary, .wide-button):disabled .gi { filter: saturate(.2) brightness(.8); }

  /* Optional sweep of light across a featured CTA. */
  :where(.btn--shine) { overflow: hidden; }
  :where(.btn--shine):not(:disabled)::after {
    content: '';
    position: absolute;
    inset: -2px auto -2px 0;
    width: 36%;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / .55), transparent);
    animation: dm-shine 2.8s var(--ease-in-out) 1s 3;
    pointer-events: none;
  }

  /* ───────────── Surfaces ───────────── */
  :where(.card, .game-card) {
    position: relative;
    padding: 14px;
    border-radius: var(--r-lg);
    background: var(--grad-panel), var(--surface-1);
    border: 1px solid var(--line-1);
    box-shadow: var(--hl-top), var(--sh-1);
  }
  :where(.card--raised) { background: var(--grad-panel), var(--surface-2); border-color: var(--line-2); }
  :where(.card--feature) {
    border-color: var(--line-gold);
    background:
      radial-gradient(120% 90% at 100% 0%, rgb(245 200 105 / .13), transparent 55%),
      var(--grad-panel), var(--surface-2);
    box-shadow: var(--hl-top), var(--sh-2);
  }
  :where(.card--inset) {
    background: var(--surface-inset);
    border-color: var(--line-1);
    box-shadow: inset 0 2px 8px rgb(0 0 0 / .4);
  }
  :where(.card--locked) { filter: saturate(.45); }
  :where(.card--locked) > * { opacity: .85; }
  :where(.stack) { display: grid; gap: 10px; }
  :where(.stack--lg) { gap: 14px; }
  :where(.row) { display: flex; align-items: center; gap: 8px; }
  :where(.spacer) { flex: 1; }
  :where(.divider) { height: 1px; background: var(--line-1); border: 0; margin: 12px 0; }

  /* ───────────── Segmented tabs ───────────── */
  :where(.seg) {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 14px;
    background: var(--surface-inset);
    border: 1px solid var(--line-1);
    box-shadow: inset 0 2px 6px rgb(0 0 0 / .35);
  }
  :where(.seg) > :where(button) {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-3);
    font-size: var(--fs-13);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--dur-2), background var(--dur-2), box-shadow var(--dur-2);
  }
  :where(.seg) > :where(button) .icon { width: 16px; height: 16px; }
  :where(.seg) > :where(button:is([aria-pressed="true"], [aria-selected="true"], .active, .chosen)) {
    color: var(--gold-100);
    background: var(--grad-jade-plate);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .1), 0 1px 0 rgb(0 0 0 / .45), 0 0 0 1px rgb(242 205 128 / .3);
  }
  :where(.seg--scroll) { overflow-x: auto; scrollbar-width: none; }
  :where(.seg--scroll)::-webkit-scrollbar { display: none; }
  :where(.seg--scroll) > :where(button) { flex: 0 0 auto; }
  /* Tabs: panel-level sub-navigation (glyph over label, gold underline when selected). */
  :where(.seg--tabs) > :where(button) {
    position: relative;
    flex-direction: column;
    gap: 2px;
    min-height: 56px;
    padding: 6px 4px 7px;
    font-size: var(--fs-12);
    line-height: 1.15;
    white-space: normal;
    text-align: center;
  }
  :where(.seg--tabs) > :where(button) :is(.gi, .icon) { width: 24px; height: 24px; flex: none; }
  :where(.seg--tabs) > :where(button) > :is(span, b, small) { max-width: 100%; overflow: hidden; overflow-wrap: break-word; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  /* Latin/Cyrillic labels on narrow phones: one size down with slimmer padding, so a single long word ("Сокровища",
     "Abzeichen") fits a quarter-width tab instead of breaking mid-word; platform hyphenation handles the rest. */
  :root:not(:lang(zh)) :where(.seg--tabs) > :where(button) { hyphens: auto; -webkit-hyphens: auto; }
  @media (max-width: 359px) {
    :root:not(:lang(zh)) :where(.seg--tabs) > :where(button) { padding-inline: 1px; font-size: var(--fs-11); }
  }
  :where(.seg--tabs) > :where(button) .badge { position: absolute; top: 3px; left: calc(50% + 5px); }
  :where(.seg--tabs) > :where(button):not(:is([aria-pressed="true"], [aria-selected="true"], .active, .chosen)) :is(.gi, img) { filter: saturate(.35) brightness(.85); }
  :where(.seg--tabs) > :where(button:is([aria-pressed="true"], [aria-selected="true"], .active, .chosen))::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 22px;
    height: 3px;
    border-radius: 3px;
    background: var(--gold-200);
    box-shadow: 0 0 8px rgb(245 200 105 / .6);
    transform: translateX(-50%);
  }
  /* Pills: detached chips for filters. */
  :where(.seg--pills) > :where(button)::before { content: ''; position: absolute; inset: -3px -2px; }
  :where(.seg--pills.seg--scroll) { flex-wrap: nowrap; padding-block: 3px; }
  :where(.seg--pills) { padding: 0; background: none; border: 0; box-shadow: none; gap: 6px; flex-wrap: wrap; }
  :where(.seg--pills) > :where(button) {
    position: relative;
    flex: 0 0 auto;
    min-height: 38px;
    overflow: visible;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--surface-1);
    border: 1px solid var(--line-2);
  }
  :where(.seg--pills) > :where(button:is([aria-pressed="true"], .active, .chosen)) {
    color: var(--text-on-gold);
    background: var(--grad-gold);
    border-color: #ffe9ad;
    box-shadow: 0 2px 0 var(--gold-edge);
  }

  /* ───────────── Chips & badges ───────────── */
  :where(.chip, .status-pill, .panel-chip) {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: var(--fs-11);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-2);
    background: rgb(255 255 255 / .06);
    border: 1px solid var(--line-1);
    white-space: nowrap;
  }
  :where(.chip, .status-pill, .panel-chip) .icon { width: 13px; height: 13px; }
  :where(.chip--gold) { color: var(--gold-100); background: rgb(245 200 105 / .13); border-color: rgb(245 200 105 / .32); }
  :where(.chip--jade) { color: var(--jade-200); background: rgb(80 200 140 / .13); border-color: rgb(80 200 140 / .32); }
  :where(.chip--warn) { color: var(--warn); background: var(--warn-bg); border-color: rgb(255 196 92 / .3); }
  :where(.chip--danger) { color: var(--danger); background: var(--danger-bg); border-color: rgb(255 120 90 / .32); }
  :where(.chip--info) { color: var(--info); background: var(--info-bg); border-color: rgb(120 196 255 / .3); }
  :where(.chip--muted) { color: var(--text-3); background: transparent; }
  :where(.chip--rarity) {
    color: color-mix(in srgb, var(--rarity, var(--rarity-common)) 85%, white);
    background: color-mix(in srgb, var(--rarity, var(--rarity-common)) 15%, transparent);
    border-color: color-mix(in srgb, var(--rarity, var(--rarity-common)) 42%, transparent);
  }
  :where(.badge) {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, #d0402a, #b3301b);
    color: #fff;
    font: 700 11px/1 var(--font-display);
    box-shadow: 0 0 0 2px var(--bg-1);
  }
  :where(.badge--gold) { background: var(--grad-gold); color: var(--text-on-gold); }

  /* ───────────── Numbers, prices, stats ───────────── */
  :where(.num, .stat-value, .price) { font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: .2px; }
  :where(.price) {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-size: var(--fs-16);
    line-height: 1;
    color: var(--gold-100);
    white-space: nowrap;
  }
  :where(.price) .currency-icon { width: 18px; height: 18px; }
  :where(.currency-amount) { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
  :where(.currency-amount) > span { font-family: var(--font-display); font-weight: 700; }
  :where(.currency-amount) small { margin-left: 1px; font-family: var(--font-ui); font-size: max(11px, .72em); font-weight: 600; color: var(--text-3); }

  :where(.stat-grid) { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px; }
  :where(.stat) {
    position: relative;
    min-width: 0;
    padding: 11px 12px 12px;
    border-radius: 14px;
    background: var(--grad-panel), var(--surface-1);
    border: 1px solid var(--line-1);
    box-shadow: var(--hl-top);
  }
  :where(.stat-label) { display: flex; align-items: center; gap: 6px; font-size: var(--fs-12); font-weight: 600; color: var(--text-3); line-height: 1.3; }
  :where(.stat-label) .icon { width: 14px; height: 14px; }
  :where(.stat-value) { display: block; margin-top: 4px; font-size: var(--fs-22); font-weight: 700; line-height: 1.1; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  :where(.stat-value) small { margin-left: 3px; font-family: var(--font-ui); font-size: var(--fs-12); font-weight: 600; color: var(--text-3); }
  :where(.stat-sub) { display: block; margin-top: 3px; font-size: var(--fs-11); color: var(--text-3); line-height: 1.35; }
  :where(.stat--gold) { border-color: var(--line-gold); background: radial-gradient(120% 100% at 100% 0%, rgb(245 200 105 / .12), transparent 60%), var(--grad-panel), var(--surface-2); }
  :where(.stat--gold) :where(.stat-value) { color: var(--gold-100); }

  :where(.kv-list) { display: grid; }
  :where(.kv) { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 8px 0; font-size: var(--fs-13); }
  :where(.kv) + :where(.kv) { border-top: 1px dashed var(--line-1); }
  :where(.kv) > :first-child { color: var(--text-3); }
  :where(.kv) > :last-child { margin-left: auto; color: var(--text-1); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

  /* ───────────── Progress ───────────── */
  :where(.meter) {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: var(--surface-inset);
    box-shadow: inset 0 1px 3px rgb(0 0 0 / .65), 0 1px 0 rgb(255 255 255 / .05);
    overflow: hidden;
  }
  :where(.meter) > span {
    position: relative;
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-200));
    box-shadow: 0 0 10px rgb(245 200 105 / .45);
    transition: width var(--dur-4) var(--ease-out);
  }
  :where(.meter) > span::after {
    content: '';
    position: absolute;
    inset: 0 0 50% 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgb(255 255 255 / .45), transparent);
  }
  :where(.meter--jade) > span { background: linear-gradient(90deg, var(--jade-500), var(--jade-300)); box-shadow: 0 0 10px rgb(80 200 140 / .4); }
  :where(.meter--lg) { height: 12px; }

  /* ───────────── Lists ───────────── */
  :where(.list) {
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--grad-panel), var(--surface-1);
    border: 1px solid var(--line-1);
    box-shadow: var(--hl-top), var(--sh-1);
  }
  :where(.list-row) {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 54px;
    padding: 10px 14px;
    text-align: left;
    color: var(--text-1);
  }
  :where(.list-row) + :where(.list-row) { border-top: 1px solid var(--line-1); }
  :where(.list) :focus-visible { outline-offset: -3px; }
  :where(button.list-row):active { background: rgb(255 255 255 / .04); }
  :where(.list-icon) {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: linear-gradient(180deg, #2a5a46, #1d4535);
    border: 1px solid var(--line-2);
    color: var(--gold-200);
    box-shadow: var(--hl-top);
  }
  :where(.list-icon) .gi { width: 26px; height: 26px; }
  :where(.list-copy) { flex: 1; min-width: 0; display: grid; gap: 1px; }
  :where(.list-title) { font-size: var(--fs-14); font-weight: 700; line-height: 1.3; }
  :where(.list-sub) { font-size: var(--fs-12); color: var(--text-3); line-height: 1.35; }
  :where(.list-trail) { flex: none; display: flex; align-items: center; gap: 6px; color: var(--text-3); }

  /* ───────────── Item tile (rarity-framed specimen) ───────────── */
  :where(.item-tile) {
    --rarity-c: var(--rarity, var(--rarity-common));
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 14px;
    background:
      radial-gradient(34% 9% at 50% 84%, rgb(0 0 0 / .55), transparent),
      radial-gradient(75% 65% at 50% 42%, color-mix(in srgb, var(--rarity-c) 30%, transparent), transparent 72%),
      linear-gradient(180deg, #1c4636, #10291f);
    border: 1px solid color-mix(in srgb, var(--rarity-c) 48%, transparent);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / .08),
      inset 0 -14px 18px -14px color-mix(in srgb, var(--rarity-c) 70%, transparent),
      var(--sh-1);
    overflow: hidden;
  }
  :where(.item-tile)::after {
    content: '';
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--rarity-c);
    box-shadow: 0 0 10px var(--rarity-c);
  }
  :where(.item-tile) img { position: relative; width: 74%; height: 74%; object-fit: contain; }
  :where(.item-count) {
    position: absolute;
    right: 5px;
    bottom: 6px;
    min-width: 22px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgb(5 16 11 / .82);
    border: 1px solid var(--line-2);
    color: var(--text-1);
    font: 700 11px/1.4 var(--font-display);
    text-align: center;
  }

  /* ───────────── Notes ───────────── */
  :where(.note, .panel-note) {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: var(--fs-12);
    line-height: 1.55;
    color: var(--text-2);
    background: rgb(255 255 255 / .035);
    border: 1px solid var(--line-1);
  }
  :where(.note, .panel-note) .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--text-3); }
  :where(.note--warn, .panel-note.is-warm, .note.is-warm) { color: #f2ddb1; background: var(--warn-bg); border-color: rgb(255 196 92 / .26); }
  :where(.note--warn, .panel-note.is-warm, .note.is-warm) .icon { color: var(--warn); }
  :where(.note--danger) { color: #ffd2c4; background: var(--danger-bg); border-color: rgb(255 120 90 / .3); }
  :where(.note--danger) .icon { color: var(--danger); }
  :where(.note--info) { color: #cfe8ff; background: var(--info-bg); border-color: rgb(120 196 255 / .26); }
  :where(.note--info) .icon { color: var(--info); }
  :where(.note--success) { color: var(--jade-200); background: var(--success-bg); border-color: rgb(80 200 140 / .28); }
  :where(.note--success) .icon { color: var(--jade-300); }

  /* ───────────── Empty state ───────────── */
  :where(.empty-state) {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 26px 18px 22px;
    border-radius: var(--r-lg);
    text-align: center;
    color: var(--text-3);
    background:
      radial-gradient(70% 60% at 50% 0%, rgb(245 200 105 / .07), transparent 70%),
      var(--grad-panel), var(--surface-1);
    border: 1px solid var(--line-1);
  }
  :where(.empty-icon) {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #2f604a, #173a2c);
    border: 1px solid var(--line-gold);
    color: var(--gold-200);
    box-shadow: 0 0 0 6px rgb(245 200 105 / .05), var(--sh-1);
  }
  :where(.empty-icon) .icon { width: 24px; height: 24px; }
  :where(.empty-icon) .gi { width: 34px; height: 34px; }
  :where(.empty-icon) .painted-art { width: 112%; height: 112%; max-width: none; object-fit: contain; }
  :where(.empty-state) :is(h3, h4, strong) { font-size: var(--fs-15); font-weight: 800; line-height: 1.35; color: var(--text-1); }
  :where(.empty-state) p { max-width: 30ch; font-size: var(--fs-13); line-height: 1.55; }
  :where(.empty-state) :is(.btn, .primary, .wide-button) { margin-top: 8px; }

  /* ───────────── Panel hero ───────────── */
  :where(.panel-hero) {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    padding: 14px 16px;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--line-gold);
    background:
      linear-gradient(90deg, rgb(11 32 24 / .97) 0%, rgb(11 32 24 / .86) 46%, rgb(11 32 24 / .3) 100%),
      var(--hero-art, url(/art/premium/forest.jpg)) center / cover no-repeat;
    box-shadow: var(--hl-top), var(--sh-2);
  }
  :where(.panel-hero-copy) { position: relative; z-index: 1; flex: 1; min-width: 0; max-width: 72%; display: grid; gap: 4px; }
  :where(.panel-eyebrow) {
    font: 700 11px/1.2 var(--font-display);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold-300);
  }
  :where(.panel-hero) h3 { font-size: var(--fs-18); font-weight: 800; color: var(--text-1); text-shadow: 0 2px 8px rgb(0 0 0 / .6); }
  :where(.panel-hero) p { font-size: var(--fs-12); line-height: 1.5; color: var(--text-2); }
  :where(.panel-chip-row) { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
  :where(.panel-hero-art) {
    position: absolute;
    z-index: 0;
    right: 10px;
    bottom: 50%;
    transform: translateY(50%);
    width: auto;
    height: 82%;
    max-width: 36%;
    object-fit: contain;
    filter: drop-shadow(0 8px 10px rgb(0 0 0 / .55));
  }

  /* ───────────── Section heading ───────────── */
  :where(.section-head) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 20px 2px 10px;
  }
  :where(.section-head):first-child { margin-top: 4px; }
  :where(.section-head) h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-15);
    font-weight: 800;
    color: var(--text-1);
  }
  :where(.section-head) h3::before {
    content: '';
    flex: none;
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: var(--grad-gold);
    box-shadow: 0 0 8px rgb(245 200 105 / .5);
  }
  :where(.section-head) h3 :is(.gi, .icon) { width: 22px; height: 22px; margin: -4px 0; }
  :where(.section-head) > :is(small, span, p) { margin-left: auto; font-size: var(--fs-12); color: var(--text-3); text-align: right; }

  /* ───────────── Forms ───────────── */
  :where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="hidden"]), select, textarea) {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface-inset);
    border: 1px solid var(--line-2);
    color: var(--text-1);
    font-size: 16px;
    line-height: 1.3;
    box-shadow: inset 0 2px 4px rgb(0 0 0 / .35);
    transition: border-color var(--dur-2), box-shadow var(--dur-2);
    -webkit-appearance: none;
    appearance: none;
  }
  :where(input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea):focus {
    outline: none;
    border-color: var(--gold-300);
    box-shadow: inset 0 2px 4px rgb(0 0 0 / .35), 0 0 0 3px rgb(245 200 105 / .18);
  }
  :where(input, textarea)::placeholder { color: var(--text-4); }
  :where(input[readonly], textarea[readonly]) { color: var(--text-2); }
  :where(input:disabled, select:disabled, textarea:disabled) { opacity: .55; }
  :where(select) {
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%23f5c869' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
  }
  :where(select) option { background: #0d271d; color: var(--text-1); }
  :where(textarea) { resize: none; line-height: 1.45; }
  :where(.field) { display: grid; gap: 6px; }
  :where(.field) > :is(label, span, small):first-child { font-size: var(--fs-12); font-weight: 700; color: var(--text-3); }

  /* Toggle switch */
  :where(input[type="checkbox"].switch, .switch input[type="checkbox"]) {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: none;
    width: 50px;
    height: 30px;
    margin: 0;
    border-radius: 999px;
    background: #0a1d15;
    border: 1px solid var(--line-2);
    box-shadow: inset 0 2px 5px rgb(0 0 0 / .55);
    cursor: pointer;
    transition: background var(--dur-2), border-color var(--dur-2);
  }
  :where(input[type="checkbox"].switch, .switch input[type="checkbox"])::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(180deg, #e6ece7, #aebbb3);
    box-shadow: 0 2px 4px rgb(0 0 0 / .5), inset 0 1px 0 #fff;
    transition: transform var(--dur-2) var(--ease-spring), background var(--dur-2);
  }
  :where(input[type="checkbox"].switch, .switch input[type="checkbox"]):checked {
    background: linear-gradient(180deg, var(--jade-400), var(--jade-500));
    border-color: rgb(150 240 195 / .5);
  }
  :where(input[type="checkbox"].switch, .switch input[type="checkbox"]):checked::before {
    transform: translateX(20px);
    background: linear-gradient(180deg, #ffffff, #e6f6ec);
  }
  :where(input[type="checkbox"].switch, .switch input[type="checkbox"]):disabled { opacity: .45; cursor: not-allowed; }
  :where(input[type="checkbox"].switch, .switch input[type="checkbox"]):focus-visible { outline: 2px solid var(--gold-200); outline-offset: 2px; }

  /* Range slider */
  :where(input[type="range"]) {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 28px;
    margin: 0;
    background: transparent;
    cursor: pointer;
  }
  :where(input[type="range"])::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgb(245 200 105 / .55), rgb(245 200 105 / .15));
    box-shadow: inset 0 1px 3px rgb(0 0 0 / .6);
  }
  :where(input[type="range"])::-moz-range-track { height: 8px; border-radius: 999px; background: rgb(245 200 105 / .3); }
  :where(input[type="range"])::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    margin-top: -8px;
    border-radius: 50%;
    background: var(--grad-gold);
    border: 1px solid #ffe9ad;
    box-shadow: 0 2px 0 var(--gold-edge), 0 4px 10px rgb(0 0 0 / .5);
  }
  :where(input[type="range"])::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--gold-300); border: 1px solid #ffe9ad; }
  :where(input[type="range"]):disabled { opacity: .45; cursor: not-allowed; }

  /* ───────────── Disclosure ───────────── */
  :where(details.disclosure) > summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    cursor: pointer;
    font-weight: 700;
  }
  :where(details.disclosure) > summary::-webkit-details-marker { display: none; }
  :where(details.disclosure) > summary::after {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    margin-right: 4px;
    border-right: 2px solid var(--gold-300);
    border-bottom: 2px solid var(--gold-300);
    transform: rotate(45deg) translateY(-2px);
    transition: transform var(--dur-2) var(--ease-out);
  }
  :where(details.disclosure[open]) > summary::after { transform: rotate(-135deg) translate(-2px, -1px); }

  /* ───────────── Material chips (shop cards, talent drawer) ───────────── */
  .materials-block {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    min-width: 0;
  }
  .material-legend {
    flex: none;
    font-size: var(--fs-11);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-3);
    white-space: nowrap;
  }
  .material-list { flex: 1 1 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
  .material-chip {
    --mc: var(--jade-300);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    max-width: 100%;
    height: 30px;
    padding: 0 10px 0 3px;
    border-radius: var(--r-pill);
    background: linear-gradient(180deg, color-mix(in srgb, var(--mc) 13%, #0b2119), color-mix(in srgb, var(--mc) 5%, #081a13));
    border: 1px solid color-mix(in srgb, var(--mc) 40%, transparent);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), 0 1px 0 rgb(0 0 0 / .3);
  }
  .material-chip.is-missing { --mc: var(--warn); }
  .material-chip img {
    flex: none;
    width: 24px;
    height: 24px;
    object-fit: contain;
  }
  .material-chip.is-met::after {
    /* tiny "complete" tick on the specimen */
    content: '';
    position: absolute;
    left: 18px;
    top: 15px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2 5.1 8.2 9 4' fill='none' stroke='%2306130e' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat,
      var(--jade-300);
    box-shadow: 0 0 0 1.5px #0b2119;
  }
  .material-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--fs-12);
    font-weight: 700;
    color: var(--text-2);
  }
  .material-count {
    flex: none;
    display: inline-flex;
    align-items: baseline;
    padding-top: 2px;
    font: 700 14px/1 var(--font-display);
    letter-spacing: .2px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .material-owned { color: color-mix(in srgb, var(--mc) 88%, white); }
  .material-need { margin-left: 1px; font-size: 11px; color: var(--text-3); }
  html:is(.reduce-motion, .low-quality) :where(.btn--shine)::after { animation: none; display: none; }
}
