:root {
  color-scheme: dark;
  --ink: #f1e7d8;
  --muted: rgba(241, 231, 216, .62);
  --dim: rgba(241, 231, 216, .42);
  --gold: #b9a77f;
  --blue: #86a9d5;
  --line: rgba(185, 167, 127, .2);
  --panel: rgba(9, 16, 26, .7);
  --panel-solid: rgba(8, 14, 22, .92);
  --gold-hover: #d3be91;
  color: var(--ink);
  background: #060c15;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #060c15; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background-color: #080e16;
  background-image: radial-gradient(circle at 8% 18%, rgba(134, 169, 213, .14) 0 1px, transparent 2px), radial-gradient(circle at 81% 12%, rgba(241, 231, 216, .16) 0 1px, transparent 2px), radial-gradient(circle at 67% 72%, rgba(185, 167, 127, .15) 0 1px, transparent 2px), radial-gradient(ellipse at 50% 0%, rgba(46, 70, 99, .28), transparent 52%), linear-gradient(145deg, #0d1827 0%, #070d16 45%, #0b111c 100%);
  background-size: 220px 220px, 310px 310px, 410px 410px, 100% 100%, 100% 100%;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, select { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 2px solid var(--gold-hover); outline-offset: 3px; }

.topbar, .page-shell { position: relative; z-index: 1; }
.topbar {
  min-height: 70px;
  padding: 10px clamp(12px, 3vw, 38px);
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 14, 22, .92);
}
.brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; color: var(--ink); text-decoration: none; }
.brand-mark { color: var(--gold-hover); font: 24px/1 "Cormorant Garamond", serif; text-shadow: 0 0 14px rgba(185, 167, 127, .48); }
.brand-wordmark { font: 600 13px/1 "Cinzel", "Cormorant Garamond", serif; letter-spacing: .15em; }
.identity { display: flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.portrait, .portrait-empty { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border: 1px solid rgba(185, 167, 127, .72); border-radius: 0; background: #0a1422; object-fit: cover; }
.portrait-empty { color: var(--gold-hover); font: 24px/1 "Cormorant Garamond", serif; box-shadow: inset 0 0 20px rgba(185, 167, 127, .06); }
.character-name { max-width: 260px; margin: 0; overflow: hidden; color: var(--ink); font: 500 21px/1.05 "Cormorant Garamond", serif; text-overflow: ellipsis; white-space: nowrap; }
.character-mastery { margin: 4px 0 0; color: var(--muted); font: 500 9px/1.3 "Cinzel", serif; letter-spacing: .13em; text-transform: uppercase; }
.topbar-tools { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }
.wallet { display: flex; align-items: center; gap: 7px; }
.wallet-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 33px; padding: 0 9px; border: 1px solid var(--line); border-radius: 1px; background: rgba(8, 14, 22, .75); color: var(--muted); white-space: nowrap; }
.wallet-label { color: var(--gold); font: 600 8px/1 "Cinzel", serif; letter-spacing: .07em; }
.wallet-chip strong { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.version-chip { min-height: 27px; padding: 6px 8px; border: 1px solid rgba(185, 167, 127, .52); color: var(--gold-hover); font: 600 8px/1.2 "Cinzel", serif; letter-spacing: .12em; white-space: nowrap; }
.button { min-height: 34px; padding: 0 11px; border: 1px solid rgba(185, 167, 127, .54); border-radius: 1px; background: rgba(8, 14, 22, .92); color: var(--ink); cursor: pointer; font-size: 10px; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease; }
.button:hover:not(:disabled) { border-color: var(--gold-hover); background: rgba(185, 167, 127, .1); box-shadow: 0 0 18px rgba(185, 167, 127, .1); }
.button-primary { border-color: var(--gold); color: var(--ink); background: rgba(8, 14, 22, .92); font-weight: 600; }
.button-primary:hover:not(:disabled) { border-color: var(--gold-hover); background: rgba(185, 167, 127, .13); box-shadow: 0 0 20px rgba(185, 167, 127, .14); }
.button-quiet { color: var(--muted); }
.button-disabled, .button:disabled { border-color: rgba(134, 169, 213, .2); color: var(--dim); cursor: not-allowed; opacity: .68; }
.reskin-label-short { display: none; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 68px; }
.view-as-banner { display: flex; width: min(1180px, calc(100% - 40px)); min-height: 52px; align-items: center; justify-content: space-between; gap: 14px; margin: 12px auto 0; padding: 8px 14px; border: 1px solid rgba(185,167,127,.58); color: var(--ink); background: rgba(46,35,19,.72); font-size: 12px; }
.view-as-banner[hidden] { display: none; }
.view-as-banner a { display: inline-flex; min-height: 44px; align-items: center; color: var(--gold-hover); text-underline-offset: 3px; }
.view-as-banner a:focus-visible { outline: 2px solid var(--gold-hover); outline-offset: 3px; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs[hidden], .page-toolbar[hidden] { display: none; }
.tab { position: relative; min-height: 43px; padding: 0 14px; border: 0; border-radius: 0; background: transparent; color: var(--muted); cursor: pointer; font: 600 10px/1 "Cinzel", serif; letter-spacing: .12em; text-transform: uppercase; }
.tab::after { position: absolute; right: 14px; bottom: -1px; left: 14px; height: 1px; background: transparent; content: ""; }
.tab:hover, .tab.is-active { color: var(--ink); }
.tab.is-active::after { background: var(--gold-hover); box-shadow: 0 0 9px rgba(185, 167, 127, .4); }
.notice { min-height: 18px; margin: 11px 2px 0; color: var(--muted); font-size: 11px; }
.notice:empty { display: none; }
.notice.is-error { color: #e5a5a5; }
.panel-content { min-width: 0; padding-top: 20px; outline: none; }
.section-heading { margin: 0 0 22px; }
.section-heading h1, .card-panel h1 { margin: 0; color: var(--ink); font: 500 clamp(29px, 4vw, 40px)/1.05 "Cormorant Garamond", serif; }
.section-heading p { max-width: 660px; margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font: 600 9px/1.3 "Cinzel", serif; letter-spacing: .17em; text-transform: uppercase; }
.stat-panel { margin: 0 0 17px; padding: 12px 14px; border: 1px solid var(--line); background: var(--panel-solid); }
.stat-panel h2 { margin: 0 0 8px; color: var(--gold-hover); font: 600 10px/1.3 "Cinzel", serif; letter-spacing: .1em; text-transform: uppercase; }
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; min-width: 0; margin: 0; }
.stat-card { display: grid; min-width: 0; justify-items: center; align-content: start; gap: 2px; padding: 8px 4px; border: 1px solid rgba(185, 167, 127, .16); background: rgba(241, 231, 216, .025); font-variant-numeric: tabular-nums; text-align: center; }
.stat-card dt { color: var(--gold); font: 600 8px/1.25 "Cinzel", serif; letter-spacing: .1em; text-transform: uppercase; }
.stat-card dd { min-width: 0; margin: 0; white-space: nowrap; }
.stat-total { color: var(--ink); font-size: 27px; font-weight: 600; line-height: 1.05; }
.stat-modifier { color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.2; }
.stat-breakdown { margin-top: 2px !important; color: var(--muted); font-size: 9px; line-height: 1.3; }
@media (max-width: 640px) {
  .view-as-banner { width: calc(100% - 24px); align-items: flex-start; flex-direction: column; gap: 4px; margin-top: 8px; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.mastery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 13px; }
.mastery-card, .unlock-card, .skill-board, .skill-details, .card-panel { min-width: 0; border: 1px solid var(--line); background: var(--panel-solid); box-shadow: inset 0 1px rgba(241, 231, 216, .025); }
.mastery-card { --mastery-card-pad-block: 20px; --mastery-card-pad-inline: 20px; --mastery-card-radius: 0; overflow: hidden; padding: var(--mastery-card-pad-block) var(--mastery-card-pad-inline); border-radius: var(--mastery-card-radius); }
.mastery-art { display: block; width: 56px; height: 56px; flex: 0 0 auto; object-fit: cover; object-position: center 30%; border: 1px solid var(--line); border-radius: 2px; }
.mastery-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mastery-head > div { min-width: 0; }
.mastery-head h2 { margin: 0; overflow-wrap: anywhere; color: var(--ink); font: 500 27px/1.05 "Cormorant Garamond", serif; }
.mastery-tier-tag { color: var(--gold); font: 500 13px/1 "Cinzel", serif; letter-spacing: .08em; white-space: nowrap; vertical-align: middle; }
.mastery-head p { margin: 6px 0 0; color: var(--muted); font: 500 9px/1.35 "Cinzel", serif; letter-spacing: .1em; text-transform: uppercase; }
.mastery-head .slot-tag { margin-left: auto; }
.slot-tag { flex: 0 0 auto; padding: 5px 7px; border: 1px solid var(--line); border-radius: 1px; color: var(--gold); font: 600 8px/1.2 "Cinzel", serif; letter-spacing: .1em; white-space: nowrap; }
.tier-track { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; margin: 25px 0 21px; padding: 0; list-style: none; }
.tier-track::before { position: absolute; top: 8px; right: 6.25%; left: 6.25%; height: 1px; background: linear-gradient(90deg, rgba(185, 167, 127, .5), rgba(185, 167, 127, .16)); content: ""; }
.tier-step { position: relative; z-index: 1; display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 4px; color: var(--dim); font: 500 8px/1.2 "Cinzel", serif; }
.tier-star { color: rgba(241, 231, 216, .28); font: 15px/1 "Cormorant Garamond", serif; transition: color .2s ease, text-shadow .2s ease; }
.tier-step.is-owned { color: var(--gold); }
.tier-step.is-owned .tier-star { color: var(--gold); text-shadow: 0 0 9px rgba(185, 167, 127, .68); }
.tier-step.is-current .tier-star { color: var(--gold-hover); font-size: 18px; text-shadow: 0 0 13px rgba(211, 190, 145, .8); animation: mastery-star-pulse 2.8s ease-in-out infinite; }
.tier-step.is-next { color: var(--ink); }
.tier-step.is-next .tier-star { color: var(--ink); }
html.is-hidden .tier-step.is-current .tier-star { animation-play-state: paused !important; }
.tier-step.is-locked { opacity: .48; }
@keyframes mastery-star-pulse { 0%, 100% { opacity: .55; text-shadow: 0 0 2px rgba(185, 167, 127, .2); } 50% { opacity: 1; text-shadow: 0 0 12px rgba(211, 190, 145, .72); } }
.next-tier { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0; color: var(--muted); font-size: 11px; }
.next-tier strong { color: var(--gold-hover); font: 600 12px/1.2 "Cinzel", serif; }
.perk-copy { display: grid; gap: 5px; margin: 10px 0 15px; padding-left: 17px; color: var(--ink); font-size: 11px; line-height: 1.55; }
.mastery-gains { margin: 0 0 15px; padding-top: 11px; border-top: 1px solid var(--line); }
.mastery-gains summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
.mastery-gains summary::-webkit-details-marker { display: none; }
.mastery-gains summary::before { content: "▸"; color: var(--gold); font-size: 10px; transition: transform .15s ease; }
.mastery-gains[open] summary::before { transform: rotate(90deg); }
.mastery-gains[open] summary { margin-bottom: 6px; }
.mastery-gains h3 { margin: 0; color: var(--gold-hover); font: 600 9px/1.4 "Cinzel", serif; letter-spacing: .08em; }
.mastery-gain-tier { margin-top: 6px; }
.mastery-gain-tier.has-tier { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 6px; }
.mastery-gain-tier h4 { margin: 1px 0 0; color: var(--gold); font: 600 8px/1.5 "Cinzel", serif; }
.mastery-gain-tier ul { display: grid; gap: 3px; min-width: 0; margin: 0; padding-left: 14px; color: var(--ink); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.mastery-card > .button { width: 100%; }
.unlock-section { margin-top: 28px; }
.subheading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.subheading h2 { margin: 0; color: var(--ink); font: 500 23px/1.1 "Cormorant Garamond", serif; }
.subheading p { margin: 0; color: var(--muted); font: 500 9px/1.3 "Cinzel", serif; }
.unlock-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.unlock-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 16px; }
.unlock-card strong { display: block; color: var(--ink); font-size: 12px; font-weight: 500; }
.unlock-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.unlock-card .button { flex: 0 0 auto; }
.life-skill-wallet { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; padding: 12px 15px; border: 1px solid var(--line); background: var(--panel-solid); color: var(--muted); font: 600 9px/1.3 "Cinzel", serif; letter-spacing: .1em; text-transform: uppercase; }
.life-skill-wallet strong { color: var(--gold-hover); font: 600 14px/1.2 "Cinzel", serif; white-space: nowrap; }
.life-skill-wallet__item { display: flex; flex: 1 1 0; align-items: center; justify-content: space-between; gap: 10px; }
.life-skill-next { margin: 0 0 12px; color: var(--gold-hover); font: 600 12px/1.4 "Cinzel", serif; }
.life-skill-group + .life-skill-group { margin-top: 28px; }
.life-skill-mastery-image { display: block; width: min(100%, 360px); max-height: 200px; margin-top: 12px; border: 1px solid var(--line); object-fit: cover; }
.life-skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.life-skill-card { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 16px; border: 1px solid var(--line); background: var(--panel-solid); box-shadow: inset 0 1px rgba(241, 231, 216, .025); }
.life-skill-card.is-owned { border-color: rgba(185, 167, 127, .42); background: linear-gradient(120deg, rgba(185, 167, 127, .07), var(--panel-solid) 60%); }
.life-skill-card__body { min-width: 0; }
.life-skill-card__body .eyebrow { margin-bottom: 5px; }
.life-skill-card h3 { margin: 0; color: var(--ink); font: 500 23px/1.08 "Cormorant Garamond", serif; overflow-wrap: anywhere; }
.life-skill-description { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; white-space: pre-wrap; }
.life-skill-card__action { display: grid; flex: 0 0 auto; justify-items: end; gap: 7px; }
.life-skill-cost { color: var(--gold); font: 600 8px/1.3 "Cinzel", serif; letter-spacing: .08em; white-space: nowrap; }
.life-skill-owned { color: var(--gold-hover); font: 600 9px/1.3 "Cinzel", serif; text-align: right; }
@media (max-width: 520px) { .life-skill-card { align-items: flex-start; flex-direction: column; gap: 12px; } .life-skill-card__action { width: 100%; grid-template-columns: 1fr auto; align-items: center; } }

.skill-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 15px; }
.field-label { display: flex; min-width: 0; align-items: center; gap: 8px; color: var(--muted); font: 500 9px/1.3 "Cinzel", serif; letter-spacing: .06em; }
.select { min-width: 0; min-height: 34px; max-width: 100%; padding: 0 28px 0 9px; border: 1px solid rgba(185, 167, 127, .38); border-radius: 1px; background: #080e16; color: var(--ink); font: 500 11px Inter, sans-serif; }
#mastery-select { width: min(240px, calc(100vw - 110px)); }
.archetype-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); gap: 8px; margin-bottom: 14px; }
.archetype-tab { position: relative; display: flex; min-width: 0; height: 64px; align-items: flex-end; overflow: hidden; padding: 8px; border: 1px solid rgba(185, 167, 127, .42); border-radius: 0; background: #080e16; color: var(--muted); text-align: left; cursor: pointer; font: 500 9px/1.2 "Cinzel", serif; letter-spacing: .04em; }
.archetype-tab::before { position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, rgba(8, 14, 22, .98) 0%, rgba(8, 14, 22, .78) 42%, rgba(8, 14, 22, .15) 100%); content: ""; }
.archetype-tab.is-active { border-color: var(--gold-hover); color: var(--ink); box-shadow: 0 0 16px rgba(185, 167, 127, .14); }
.archetype-tab .skill-icon img { display: block; }
.archetype-tab.is-active .skill-icon img { opacity: 1; }
.archetype-tab .skill-node-copy { width: 100%; }
.archetype-tab .skill-node-copy strong { white-space: nowrap; }
.skill-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 300px); gap: 14px; align-items: start; }
.skill-board { padding: 14px; }
.skill-tier { min-width: 0; margin: 0; padding: 14px 0; border-bottom: 1px solid rgba(185, 167, 127, .15); }
.skill-tier:first-child { padding-top: 2px; }
.skill-tier:last-child { padding-bottom: 2px; border-bottom: 0; }
.skill-tier.is-locked { opacity: .48; }
.skill-tier h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 11px; color: var(--gold); font: 600 9px/1.3 "Cinzel", serif; letter-spacing: .14em; }
.skill-tier h3::after { height: 1px; flex: 1; background: linear-gradient(90deg, rgba(185, 167, 127, .36), transparent); content: ""; }
.skill-tier-empty { margin: 0; color: var(--dim); font-size: 10px; }
.skill-nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 92px), 1fr)); gap: 8px; }
.skill-node { position: relative; display: flex; min-width: 0; min-height: 92px; aspect-ratio: 1; flex-direction: column; justify-content: flex-end; overflow: hidden; padding: 8px; border: 1px solid rgba(185, 167, 127, .42); border-radius: 0; background: #080e16; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.skill-node::before { position: absolute; inset: 0; z-index: 1; background: linear-gradient(0deg, rgba(8, 14, 22, .98) 0%, rgba(8, 14, 22, .78) 42%, rgba(8, 14, 22, .15) 100%); content: ""; }
.skill-node:hover, .skill-node.is-selected { border-color: var(--gold-hover); box-shadow: 0 0 16px rgba(185, 167, 127, .14); }
.skill-node.is-available { border-color: rgba(185, 167, 127, .64); }
.skill-node.is-learned { border-color: var(--gold-hover); box-shadow: inset 0 0 0 1px rgba(185, 167, 127, .32), 0 0 13px rgba(185, 167, 127, .18); }
.skill-node.is-locked { border-color: rgba(241, 231, 216, .18); color: var(--muted); }
.skill-icon { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; color: var(--gold); font: 34px/1 "Cormorant Garamond", serif; }
.skill-icon img { width: 100%; height: 100%; object-fit: cover; opacity: .62; filter: saturate(.72) contrast(1.05); }
.skill-node-copy { position: relative; z-index: 2; display: block; min-width: 0; }
.skill-node-copy strong, .skill-node-copy small { display: block; overflow: hidden; text-overflow: ellipsis; }
.skill-node-copy strong { color: inherit; font: 600 9px/1.3 "Cinzel", serif; }
.skill-node-copy small { display: -webkit-box; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.empty-state { padding: 24px 12px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.6; }
.skill-details { position: sticky; top: 14px; min-height: 190px; padding: 17px; overflow-wrap: anywhere; }
.skill-details h2 { margin: 0; color: var(--ink); font: 500 25px/1.08 "Cormorant Garamond", serif; }
.skill-details .eyebrow { margin-bottom: 8px; }
.skill-details p { color: var(--muted); font-size: 11px; line-height: 1.6; white-space: pre-line; }
.skill-tier-list { display: grid; gap: 7px; margin: 13px 0; padding: 0; list-style: none; }
.skill-tier-list li { padding: 8px 10px; border: 1px solid rgba(185, 167, 127, .18); background: rgba(8, 14, 22, .48); }
.skill-tier-list li.is-owned { border-color: rgba(185, 167, 127, .62); background: rgba(185, 167, 127, .055); }
.skill-tier-list li.is-locked { opacity: .58; }
.skill-tier-list li > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; font-size: 10px; }
.skill-tier-list li strong { color: var(--gold-hover); }
.skill-tier-status { color: var(--muted); }
.skill-tier-list li p { margin: 5px 0 0; }
.skill-details .skill-detail-action { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; margin: 7px 0 3px; font-size: 9px; }
.skill-action-badge { display: inline-flex; max-width: 100%; align-items: center; padding: 1px 6px; border: 1px solid rgba(185, 167, 127, .48); border-radius: 99px; background: rgba(185, 167, 127, .08); color: var(--gold); font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.skill-detail-meta-copy { color: var(--muted); }
.skill-detail-meta { display: grid; gap: 8px; margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.skill-detail-meta span { color: var(--muted); font-size: 10px; line-height: 1.45; }
.skill-detail-meta strong { color: var(--ink); font-weight: 600; }
.skill-details .button { width: 100%; margin-top: 7px; }
.skill-detail-close { display: none; }

.card-panel { padding: clamp(18px, 4vw, 32px); }
.card-panel > p { max-width: 620px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.character-card-flip { width: min(100%, 760px); aspect-ratio: 1200 / 630; margin: 20px auto 0; perspective: 1600px; touch-action: pan-y; user-select: none; }
.character-card-flip:focus-visible { outline: 2px solid var(--gold-hover); outline-offset: 4px; }
.character-card-flip__track { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.character-card-flip__face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.character-card-flip__face--front { transform: rotateY(0deg); }
.character-card-preview { display: block; width: 100%; height: 100%; border: 1px solid var(--line); object-fit: contain; }
.character-card-flip__face--back { display: grid; place-items: center; padding: clamp(6px, 3vw, 70px); transform: rotateY(180deg); border: 1px solid rgba(185, 167, 127, .42); background-color: #080d15; background-image: linear-gradient(rgba(4, 8, 14, .16), rgba(4, 8, 14, .22)), url("/assets/naros-card-clue-background.webp"); background-size: 100% 100%; background-position: center; background-repeat: no-repeat; box-shadow: inset 0 0 90px rgba(0, 0, 0, .42); }
.character-card-flip__face--back::before { position: absolute; inset: clamp(10px, 3vw, 24px); border: 1px solid rgba(185, 167, 127, .16); content: ""; pointer-events: none; }
.character-card-flip__clue { position: relative; display: flex; max-width: 780px; flex-direction: column; align-items: center; gap: clamp(5px, 1.2vw, 14px); text-align: center; }
.character-card-flip__clue-kicker { color: rgba(185, 167, 127, .7); font-size: clamp(5px, 1.5vw, 11px); letter-spacing: .24em; text-transform: uppercase; }
.character-card-flip__clue-sigil { color: #d3be91; font: clamp(20px, 7vw, 48px)/.8 "Cormorant Garamond", serif; text-shadow: 0 0 20px rgba(211, 190, 145, .38); }
.character-card-flip__clue-copy { color: #e7dccb; font: clamp(12px, 3.5vw, 30px)/1.2 "Cormorant Garamond", serif; letter-spacing: .025em; }
.character-card-flip__clue-copy--translation { color: rgba(231, 220, 203, .86); font-size: clamp(10px, 2.8vw, 24px); letter-spacing: .01em; line-height: 1.42; }
.character-card-flip__clue-divider { width: 46px; height: 1px; flex: 0 0 auto; background: rgba(185, 167, 127, .42); }
@media (prefers-reduced-motion: reduce) { .character-card-flip__track { transition: none !important; } }
.card-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 9px; margin-top: 23px; }
.card-link { display: flex; min-width: 0; min-height: 68px; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 1px; color: var(--ink); background: rgba(8, 14, 22, .82); text-decoration: none; }
.card-link:hover { border-color: var(--gold-hover); box-shadow: 0 0 18px rgba(185, 167, 127, .1); }
.card-link strong { display: block; color: var(--gold-hover); font: 600 10px/1.3 "Cinzel", serif; letter-spacing: .06em; }
.card-link small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.card-link span[aria-hidden] { color: var(--gold); font-size: 16px; }

.satchel-sections { display: grid; gap: 25px; }
.satchel-section { min-width: 0; }
.satchel-section-heading { display: flex; align-items: baseline; gap: 10px; margin: 0 0 11px; }
.satchel-section-heading .eyebrow { margin: 0; }
.satchel-section-heading h2 { margin: 0; color: var(--ink); font: 500 23px/1.1 "Cormorant Garamond", serif; }
.satchel-currency-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.satchel-currency { min-width: 0; padding: 12px; border: 1px solid var(--line); background: var(--panel-solid); box-shadow: inset 0 1px rgba(241, 231, 216, .025); }
.satchel-currency-tickets { grid-column: 1 / -1; }
.satchel-currency-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.satchel-currency-icon { color: var(--gold-hover); font: 16px/1 "Cormorant Garamond", serif; }
.satchel-currency-label { min-width: 0; color: var(--muted); font: 600 9px/1.3 "Cinzel", serif; letter-spacing: .04em; overflow-wrap: anywhere; }
.satchel-currency-main strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.satchel-ticket-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 6px; margin: 10px 0 0; padding: 9px 0 0; border-top: 1px solid rgba(185, 167, 127, .16); list-style: none; }
.satchel-ticket-lines li { display: flex; min-width: 0; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.satchel-ticket-lines strong { flex: 0 0 auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.satchel-ticket-empty { grid-column: 1 / -1; color: var(--dim) !important; }
.satchel-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 84px), 1fr)); gap: 6px; }
.satchel-item-tile { position: relative; display: flex; min-width: 0; min-height: 0; aspect-ratio: 1; overflow: hidden; flex-direction: column; align-items: flex-start; padding: 7px; border: 1px solid rgba(185, 167, 127, .38); background: linear-gradient(145deg, rgba(17, 29, 44, .94), rgba(8, 14, 22, .96)); box-shadow: inset 0 0 0 3px rgba(185, 167, 127, .035), inset 0 1px rgba(241, 231, 216, .05); }
.satchel-item-image { flex: 0 0 auto; width: 28px; height: 28px; margin-bottom: 2px; object-fit: contain; }
.satchel-item-name { display: -webkit-box; max-width: 100%; overflow: hidden; color: var(--ink); font: 500 12px/1.25 "Cormorant Garamond", serif; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.satchel-item-type { max-width: calc(100% - 22px); overflow: hidden; color: var(--muted, rgba(241, 231, 216, .55)); font-size: 10px; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
.satchel-item-tile strong { position: absolute; right: 6px; bottom: 5px; color: var(--gold-hover); font-size: 10px; font-variant-numeric: tabular-nums; }
.satchel-empty { border: 1px solid rgba(185, 167, 127, .16); background: rgba(8, 14, 22, .45); }
.satchel-retainer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 155px), 1fr)); gap: 9px; }
.satchel-retainer { display: flex; width: 100%; min-width: 0; min-height: 82px; align-items: center; gap: 10px; padding: 9px; border: 1px solid rgba(185, 167, 127, .42); background: var(--panel-solid); box-shadow: inset 0 0 0 3px rgba(185, 167, 127, .035), inset 0 1px rgba(241, 231, 216, .05); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.satchel-retainer:hover, .satchel-retainer:focus-visible { border-color: var(--gold-hover); background: var(--panel); }
.satchel-retainer-dialog { width: min(620px, calc(100vw - 28px)); max-width: none; max-height: min(90vh, 760px); padding: 0; overflow: auto; border: 1px solid rgba(185, 167, 127, .6); border-radius: 8px; background: var(--panel-solid); color: var(--ink); box-shadow: 0 24px 72px rgba(0, 0, 0, .72); }
.satchel-retainer-dialog::backdrop { background: rgba(4, 8, 14, .78); backdrop-filter: blur(3px); }
.satchel-retainer-detail { position: relative; display: grid; gap: 18px; padding: 24px; }
.satchel-retainer-detail-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 1px solid rgba(185, 167, 127, .48); border-radius: 50%; background: var(--panel); color: inherit; font-size: 22px; cursor: pointer; }
.satchel-retainer-detail-heading { display: flex; align-items: center; gap: 16px; padding-right: 28px; }
.satchel-retainer-detail-heading > img, .satchel-retainer-detail-heading > .satchel-retainer-placeholder { display: grid; flex: 0 0 88px; width: 88px; height: 116px; place-items: center; object-fit: cover; border: 1px solid rgba(185, 167, 127, .55); background: radial-gradient(ellipse, rgba(134, 169, 213, .18), rgba(8, 14, 22, .9)); }
.satchel-retainer-detail-heading h2 { margin: 0 0 8px; font: 500 28px/1.1 "Cormorant Garamond", serif; overflow-wrap: anywhere; }
.satchel-retainer-detail-heading p { margin: 4px 0; color: var(--ink-muted); }
.satchel-retainer-lore { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.satchel-retainer-detail-section { padding-top: 14px; border-top: 1px solid rgba(185, 167, 127, .32); }
.satchel-retainer-detail-section h3 { margin: 0 0 8px; color: var(--gold-hover); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.satchel-retainer-detail-section p, .satchel-retainer-detail-section ul { margin: 0; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.satchel-retainer-detail-section ul { padding-left: 20px; }
.satchel-retainer-effect-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.satchel-retainer-effect-group { min-width: 0; padding: 11px; border: 1px solid rgba(134, 169, 213, .22); background: rgba(8, 14, 22, .35); }
.satchel-retainer-effect-group h4 { margin: 0 0 7px; color: var(--blue); font-size: 11px; }
.satchel-retainer-effect-group li::marker { color: var(--gold-hover); }
.satchel-retainer-frame { display: grid; flex: 0 0 42px; width: 42px; height: 56px; place-items: center; overflow: hidden; border: 1px solid rgba(185, 167, 127, .45); background: radial-gradient(ellipse, rgba(134, 169, 213, .18), rgba(8, 14, 22, .9)); }
.satchel-retainer-frame img { width: 100%; height: 100%; object-fit: cover; }
.satchel-retainer-placeholder { color: var(--gold-hover); font: 22px/1 "Cormorant Garamond", serif; text-shadow: 0 0 12px rgba(185, 167, 127, .35); }
.satchel-retainer-copy { display: grid; min-width: 0; justify-items: start; gap: 7px; }
.satchel-retainer-copy strong { color: var(--ink); font: 500 16px/1.15 "Cormorant Garamond", serif; overflow-wrap: anywhere; }
.satchel-rarity { padding: 3px 6px; border: 1px solid rgba(134, 169, 213, .34); color: var(--blue); font: 600 8px/1.2 "Cinzel", serif; letter-spacing: .08em; }

.confirm-dialog { box-sizing: border-box; width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; padding: 0; border: 1px solid rgba(185, 167, 127, .62); border-radius: 1px; background: #080e16; color: var(--ink); box-shadow: 0 28px 100px rgba(0, 0, 0, .72); }
.confirm-dialog::backdrop { background: rgba(5, 9, 15, .78); backdrop-filter: blur(4px); }
.confirm-dialog form { padding: clamp(14px, 4vw, 20px); }
.confirm-dialog h2 { margin: 0; color: var(--ink); font: 500 clamp(22px, 5.6vw, 26px)/1.15 "Cormorant Garamond", serif; }
.confirm-copy { margin: 8px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.55; white-space: pre-line; }
.confirm-choice { margin: 0 0 14px; }
.appearance-controls { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 10px; margin-bottom: 8px; }
.appearance-field { display: grid; min-width: 0; align-content: start; gap: 6px; color: var(--muted); font: 500 9px/1.3 "Cinzel", serif; letter-spacing: .06em; }
.appearance-field .select { width: 100%; min-height: 38px; }
.appearance-file-control { position: relative; width: max-content; max-width: 100%; min-width: 0; }
.appearance-file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.appearance-file-picker { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid rgba(185, 167, 127, .38); background: #0b121c; color: var(--ink); cursor: pointer; font: 500 11px/1 Inter, sans-serif; white-space: nowrap; }
.appearance-file-picker:hover { border-color: var(--gold-hover); background: rgba(185, 167, 127, .1); }
.appearance-file-input:focus-visible + .appearance-file-picker { outline: 2px solid var(--gold-hover); outline-offset: 2px; }
.appearance-file-input:disabled + .appearance-file-picker { opacity: .55; cursor: not-allowed; }
.appearance-file-types { display: block; margin-top: 5px; color: var(--muted); font: 400 9px/1.4 Inter, sans-serif; }
.upload-file-name { display: block; min-width: 0; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.appearance-crop-frame { position: relative; width: min(100%, 210px); margin: 10px auto 8px; overflow: hidden; border: 1px solid rgba(185, 167, 127, .42); background: #050a10; }
.appearance-crop-frame canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.appearance-crop-frame canvas.is-dragging { cursor: grabbing; }
.appearance-crop-frame canvas[hidden] { display: none; }
.appearance-crop-frame p { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 11px; text-align: center; }
.appearance-crop-frame p[hidden] { display: none; }
.appearance-crop-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.5; text-align: center; }
.appearance-crop-frame canvas:focus-visible { outline: 2px solid var(--gold-hover); outline-offset: -2px; }
.confirm-error { min-height: 17px; margin: 0 0 9px; color: #e5a5a5; font-size: 11px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 7px; }
.confirm-actions .button-primary { min-width: 100px; }

@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; gap: 10px 14px; }
  .identity { margin-right: auto; }
  .topbar-tools { width: 100%; justify-content: space-between; }
}
@media (max-width: 760px) {
  .page-shell { width: calc(100% - 24px); padding-top: 17px; }
  .skill-layout { display: block; }
  .skill-details.is-open { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; top: auto; max-height: min(54vh, 440px); overflow-y: auto; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: 0; background: rgba(8, 14, 22, .98); box-shadow: 0 -20px 70px rgba(0, 0, 0, .5); }
  .skill-detail-close { display: inline-flex; float: right; width: 32px; min-height: 32px; align-items: center; justify-content: center; padding: 0; }
}
@media (max-width: 520px) {
  .topbar { padding: 10px 12px; }
  .brand { gap: 6px; }
  .brand-mark { font-size: 21px; }
  .brand-wordmark { font-size: 11px; letter-spacing: .1em; }
  .identity { min-width: 0; gap: 8px; }
  .portrait, .portrait-empty { flex-basis: 42px; width: 42px; height: 42px; }
  .character-name { max-width: min(38vw, 155px); font-size: 18px; }
  .topbar-tools { align-items: center; gap: 7px; }
  .wallet { gap: 5px; flex-wrap: wrap; }
  .wallet-chip { min-height: 30px; gap: 6px; padding: 0 7px; }
  .wallet-label { font-size: 7px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .button { min-height: 30px; padding: 0 7px; font-size: 9px; }
  .version-chip { min-height: 24px; padding: 5px 6px; font-size: 7px; }
  .tab { min-height: 39px; padding: 0 10px; font-size: 9px; letter-spacing: .08em; }
  .tab::after { right: 10px; left: 10px; }
  .archetype-tab { height: 56px; }
  .mastery-card { --mastery-card-pad-block: 15px; --mastery-card-pad-inline: 12px; }
  .mastery-art { width: 44px; height: 44px; }
  .tier-track { margin: 22px 0 18px; }
  .tier-star { font-size: 13px; }
  .tier-step.is-current .tier-star { font-size: 16px; }
  .unlock-card { align-items: flex-start; padding: 12px; }
  .unlock-card .button { padding: 0 9px; }
  .skill-board { padding: 10px; }
  .skill-nodes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 86px), 1fr)); gap: 6px; }
  .skill-node { min-height: 86px; padding: 7px; }
  .skill-node-copy strong { font-size: 8px; }
  .skill-node-copy small { font-size: 7px; }
  .confirm-dialog form { padding: 18px; }
}
@media (max-width: 480px) {
  .topbar-tools { flex-wrap: nowrap; gap: 6px; }
  .wallet, .topbar-actions { flex-wrap: nowrap; }
  .topbar-actions > .button { white-space: nowrap; }
  .reskin-label-full, .version-chip { display: none; }
  .reskin-label-short { display: inline; }
  .panel-content, .panel-content > *, .mastery-card, .unlock-card, .skill-board, .skill-details, .card-panel {
    width: 100%;
    min-width: 0;
  }
  .panel-content { overflow-wrap: anywhere; }
  .tier-track { width: 100%; min-width: 0; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; }
  .tier-step { overflow-wrap: anywhere; text-align: center; }
}
@media (max-width: 380px) {
  .appearance-controls { grid-template-columns: 1fr; gap: 9px; }
  .confirm-dialog form { padding: 14px; }
  .satchel-currency { padding: 10px; }
  .satchel-currency-grid, .satchel-retainer-grid { gap: 7px; }
  .satchel-retainer { gap: 7px; padding: 7px; }
  .satchel-retainer-frame { flex-basis: 38px; width: 38px; height: 52px; }
}
@media (max-width: 480px) {
  .satchel-retainer-effect-groups { grid-template-columns: 1fr; }
}

.gear-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 18px; align-items: start; }
.gear-armors, .gear-store { display: grid; min-width: 0; gap: 12px; }
.gear-armor-card, .gear-balance, .gear-shop { min-width: 0; border: 1px solid var(--line); background: var(--panel-solid); }
.gear-armor-card { display: grid; gap: 13px; padding: 15px; }
.gear-armor-heading { display: flex; min-width: 0; align-items: center; gap: 13px; }
.gear-armor-heading > div { min-width: 0; }
.gear-armor-heading h2 { margin: 0; overflow-wrap: anywhere; color: var(--ink); font: 600 22px/1.1 "Cormorant Garamond", serif; }
.gear-armor-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.gear-armor-image { display: grid; width: 84px; height: 84px; flex: 0 0 84px; place-items: center; border: 1px solid var(--line); background: rgba(241, 231, 216, .035); object-fit: cover; }
.gear-armor-placeholder { color: var(--gold-hover); font: 30px/1 "Cormorant Garamond", serif; }
.gear-power-copy { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.gear-power-copy strong { color: var(--ink); }
.gear-power-track { display: flex; height: 9px; gap: 3px; overflow: hidden; background: rgba(241, 231, 216, .05); }
.gear-power-track > span { min-width: 0; background: var(--gold); }
.gear-gem-list, .gear-shop-list { display: grid; min-width: 0; gap: 6px; }
.gear-gem-row, .gear-shop-row { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 8px; border: 1px solid rgba(185, 167, 127, .16); }
.gear-gem-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }
.gear-gem-copy strong { overflow-wrap: anywhere; color: var(--ink); font-size: 12px; font-weight: 600; }
.gear-gem-copy small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.gear-power-chip { flex: 0 0 auto; padding: 3px 7px; border: 1px solid rgba(185, 167, 127, .4); color: var(--gold-hover); font: 600 10px/1.3 "Cinzel", serif; }
.gear-equip-list { display: grid; gap: 7px; min-width: 0; padding: 11px; border: 1px dashed rgba(185, 167, 127, .42); }
.gear-equip-list h3 { margin: 0; color: var(--ink); font-size: 13px; }
.gear-rule, .gear-empty { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.gear-balance { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; color: var(--muted); font-size: 12px; }
.gear-balance strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.gear-shop { display: grid; gap: 10px; padding: 12px; }
.gear-shop-tabs { display: flex; gap: 8px; }
.gear-shop-tabs .button { flex: 1; }
.gear-category-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.gear-category { min-height: 40px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.gear-category.is-active { border-color: var(--gold); color: var(--gold-hover); }
.gear-layout .button { min-height: 44px; font-size: 11px; }
.gear-short { color: #e5a5a5; font-size: 11px; }
.gear-shop-row.is-limited { opacity: .7; }
@media (max-width: 780px) {
  .gear-layout { grid-template-columns: minmax(0, 1fr); }
  .gear-shop-row { flex-wrap: wrap; }
  .gear-shop-row .gear-gem-copy { flex-basis: calc(100% - 45px); }
  .gear-shop-row .button { margin-left: auto; }
}
@media (max-width: 480px) {
  .gear-armor-card { padding: 12px; }
  .gear-armor-heading h2 { font-size: 20px; }
  .gear-gem-row { flex-wrap: wrap; }
  .gear-gem-row .gear-gem-copy { flex-basis: calc(100% - 45px); }
  .gear-gem-row .button { width: 100%; }
  .gear-power-copy { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.page-heading { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.page-heading__top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-heading__top h1 { margin: 0; color: var(--paper); font: 500 clamp(24px, 3vw, 34px)/1.1 "Cormorant Garamond", Georgia, serif; }
.identity { margin-right: 0; }
.page-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-toolbar > .button { box-sizing: border-box; display: inline-flex; width: 120px; min-width: 120px; flex: 0 0 120px; align-items: center; justify-content: center; font: 500 10px/1 Inter, sans-serif; text-align: center; text-decoration: none; white-space: nowrap; }
@media (max-width: 760px) {
  .page-heading__top { align-items: flex-start; flex-direction: column; gap: 10px; }
  .page-toolbar { width: 100%; }
}

.world-areas { display: grid; gap: 20px; }
.world-area { min-width: 0; padding: clamp(14px, 2.5vw, 22px); border: 1px solid rgba(185, 167, 127, .28); background: linear-gradient(145deg, rgba(17, 29, 44, .84), rgba(8, 14, 22, .92)); }
.world-area-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.world-area-heading h2 { margin: 0; color: var(--ink); font: 500 27px/1.1 "Cormorant Garamond", serif; }
.world-area-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.world-progress-value { flex: 0 0 auto; color: var(--gold-hover); font-size: 12px; font-variant-numeric: tabular-nums; }
.world-progress { display: block; width: 100%; height: 6px; margin: 14px 0 19px; border: 0; border-radius: 0; background: rgba(241, 231, 216, .1); accent-color: var(--gold-hover); }
.world-progress::-webkit-progress-bar { background: rgba(241, 231, 216, .1); }
.world-progress::-webkit-progress-value { background: var(--gold-hover); }
.world-progress::-moz-progress-bar { background: var(--gold-hover); }
.world-area-detail { margin-top: 17px; }
.world-area-detail h3, .world-donate h3 { margin: 0 0 9px; color: var(--gold-hover); font: 600 10px/1.4 "Cinzel", serif; letter-spacing: .04em; }
.world-milestones { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.world-milestone { display: flex; gap: 8px; color: var(--muted); font-size: 11px; }
.world-milestone span:first-child { color: var(--dim); }
.world-milestone.is-unlocked { color: var(--ink); }
.world-milestone.is-unlocked span:first-child { color: var(--gold-hover); }
.world-muted, .world-contribution p { margin: 0; color: var(--ink); font-size: 12px; }
.world-contribution small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.world-recipe-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.world-recipe { min-width: 0; padding: 13px; border: 1px solid rgba(185, 167, 127, .18); background: rgba(8, 14, 22, .58); }
.world-recipe h4 { margin: 0 0 5px; color: var(--ink); font: 500 19px/1.15 "Cormorant Garamond", serif; overflow-wrap: anywhere; }
.world-recipe > p { margin: 8px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.world-recipe > p strong { color: var(--ink); }
.world-recipe-inputs { display: grid; gap: 4px; margin: 10px 0; padding: 0; list-style: none; }
.world-recipe-inputs li { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); font-size: 11px; }
.world-recipe-inputs li span { color: var(--muted); font-variant-numeric: tabular-nums; }
.world-recipe .world-recipe-cost { color: var(--gold-hover); font-weight: 700; font-variant-numeric: tabular-nums; }
.world-recipe form { margin-top: 10px; }
.world-recipe [data-craft-notice]:not(:empty) { margin: 6px 0; color: var(--gold-hover); font-size: 10px; }
.world-recipe button:disabled { cursor: not-allowed; opacity: .45; }
.world-donate { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.world-donate-items { display: grid; gap: 6px; }
.world-donate-item { display: grid; grid-template-columns: minmax(0, 1fr) 90px; align-items: center; gap: 12px; padding: 9px 10px; border: 1px solid rgba(185, 167, 127, .16); background: rgba(8, 14, 22, .58); }
.world-donate-copy { display: grid; gap: 3px; min-width: 0; }
.world-donate-copy strong { color: var(--ink); font: 500 15px/1.2 "Cormorant Garamond", serif; overflow-wrap: anywhere; }
.world-donate-copy small { color: var(--muted); font-size: 9px; }
.world-donate-item input { width: 100%; min-height: 36px; padding: 0 8px; border: 1px solid rgba(185, 167, 127, .3); border-radius: 0; background: var(--panel-solid); color: var(--ink); font: 600 12px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; }
.world-donate-item input:focus-visible { outline: 2px solid var(--gold-hover); outline-offset: 2px; }
.world-donate-summary { display: flex; justify-content: space-between; gap: 12px; margin: 12px 0 5px; color: var(--muted); font-size: 10px; }
.world-donate-summary output { color: var(--gold-hover); font-weight: 700; font-variant-numeric: tabular-nums; }
.world-donate-empty, .world-donate-notice { min-height: 15px; margin: 8px 0; color: var(--muted); font-size: 10px; }
.world-donate-notice:not(:empty) { color: var(--gold-hover); }
.world-donate button:disabled { cursor: not-allowed; opacity: .45; }
.world-load-error { padding: 10px 12px; border-left: 2px solid var(--gold); background: rgba(8, 14, 22, .6); color: var(--muted); font-size: 11px; }

@media (max-width: 520px) {
  .world-area-heading { align-items: flex-start; }
  .world-area-heading h2 { font-size: 24px; }
  .world-progress-value { padding-top: 5px; font-size: 10px; }
  .world-donate-item { grid-template-columns: minmax(0, 1fr) 72px; gap: 8px; padding: 8px; }
}

.world-tab-view { min-width: 0; }
.world-tab-view .section-heading { margin-bottom: 22px; }
.world-tab-view .section-heading h1 { color: var(--gold-hover); }
.world-ui-label { margin: 18px 0 8px; color: var(--muted); font: 600 10px/1.4 "Cinzel", serif; letter-spacing: .12em; text-transform: uppercase; }
.world-region-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.world-region-chip { min-height: 34px; padding: 5px 13px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.world-region-chip[aria-pressed="true"] { border-color: var(--gold); background: rgba(185, 167, 127, .15); color: var(--gold-hover); }
.world-area-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.world-area-group { display: contents; }
.world-area-group h2 { grid-column: 1 / -1; }
.world-area-card { min-width: 0; overflow: hidden; padding: 0; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-align: left; transition: border-color .15s, transform .15s; }
.world-area-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.world-area-card[aria-selected="true"] { border-color: var(--gold-hover); box-shadow: 0 0 0 1px var(--gold-hover); }
.world-area-card-art { position: relative; display: block; height: 96px; overflow: hidden; background: linear-gradient(135deg, var(--panel-solid), var(--panel)); }
.world-area-card-art::after { position: absolute; inset: 25% 0 0; background: linear-gradient(transparent, var(--panel-solid)); content: ""; }
.world-area-card-art img { width: 100%; height: 100%; object-fit: cover; }
.world-area-card-badge { position: absolute; z-index: 1; top: 8px; right: 8px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-solid); color: var(--gold-hover); font-size: 10px; }
.world-area-card-badge.is-complete { color: var(--ink); }
.world-area-card-body { position: relative; z-index: 1; display: grid; gap: 5px; margin-top: -12px; padding: 0 12px 12px; }
.world-area-card-body > strong { overflow-wrap: anywhere; font: 600 18px/1.1 "Cormorant Garamond", serif; }
.world-area-card-body > small, .world-area-card-numbers { color: var(--muted); font-size: 10px; }
.world-area-card-bar { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(185, 167, 127, .12); }
.world-area-card-bar i { display: block; height: 100%; background: var(--gold-hover); }
.world-area-card-milestones { position: relative; height: 12px; margin-top: 1px; color: var(--muted); font-size: 9px; line-height: 1; white-space: nowrap; }
.world-area-card-milestones > span { position: absolute; left: var(--milestone-position); transform: translateX(-50%); }
.world-area-card-milestones > span:last-child { transform: translateX(-100%); }
.world-contribution-tiers { padding: 8px 12px; color: var(--muted); font-size: 10px; }
.world-contribution-tiers p { margin: 0 0 5px; font-size: inherit; }
.world-contribution-tiers ul { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; }
.world-contribution-tier { display: flex; align-items: center; gap: 5px; font-size: inherit; }
.world-contribution-tier.is-reached { color: var(--gold-hover); }
.world-area-card-numbers { display: flex; justify-content: space-between; gap: 6px; }
.world-area-card-numbers span:last-child { color: var(--gold-hover); text-align: right; }
.world-selected-panels { margin-top: 18px; border: 1px solid var(--line); background: var(--panel); }
.world-selected-area { min-width: 0; }
.world-selected-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.world-selected-heading h2 { margin: 0; color: var(--gold-hover); font: 500 24px/1.1 "Cormorant Garamond", serif; }
.world-selected-heading > span { color: var(--muted); font-size: 10px; text-align: right; }
.world-detail-tabs { display: flex; gap: 3px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); }
.world-detail-tabs button { min-height: 40px; padding: 7px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.world-detail-tabs button[aria-selected="true"] { border-bottom-color: var(--gold-hover); color: var(--gold-hover); }
.world-detail-tabs button span { margin-left: 5px; color: var(--dim); font-size: 10px; }
.world-donate-panel { min-width: 0; margin: 0; padding: 6px 8px 0; border: 0; }
.world-donate-rows { min-width: 0; }
.world-donate-head, .world-donate-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 62px 62px 46px 108px 92px; align-items: center; gap: 8px; padding: 7px 8px; }
.world-donate-panel:not(.has-influence) .world-donate-head, .world-donate-panel:not(.has-influence) .world-donate-row { grid-template-columns: 32px minmax(0, 1fr) 70px 50px 108px 92px; }
.world-donate-head { min-height: 28px; color: var(--dim); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.world-donate-row { min-height: 44px; border-radius: 4px; }
.world-donate-row:hover { background: var(--panel-solid); }
.world-donate-row.is-empty { opacity: .48; }
.world-donate-icon, .world-recipe-heading > span, .world-recipe-heading > img { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 5px; background: var(--panel-solid); object-fit: cover; font-size: 14px; }
.world-donate-name { display: grid; min-width: 0; gap: 2px; }
.world-donate-name strong { overflow-wrap: anywhere; font-size: 11px; font-weight: 600; }
.world-donate-name small { min-height: 12px; overflow-wrap: anywhere; color: var(--muted); font-size: 9px; }
.world-donate-values { display: contents; }
.world-donate-values > span, .world-donate-row-total { font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.donate-research { color: var(--gold-hover); }
.donate-influence { color: var(--blue); }
.donate-have { color: var(--muted); }
.world-donate-step { display: inline-flex; justify-self: end; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; }
.world-donate-step button { width: 24px; height: 28px; padding: 0; border: 0; background: transparent; color: var(--gold-hover); cursor: pointer; font-size: 14px; }
.world-donate-step input { width: 42px; min-width: 0; height: 28px; padding: 0 2px; border: 0; border-right: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--panel-solid); color: var(--ink); font-size: 11px; text-align: center; }
.world-donate-step button:disabled { color: var(--dim); cursor: not-allowed; }
.world-donate-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 4px; padding: 11px 10px; border-top: 1px solid var(--line); background: var(--panel-solid); }
.world-donate-footer > span:not(.world-summary-hidden) { color: var(--muted); font-size: 11px; }
.world-donate-footer > span strong { color: var(--gold-hover); font-variant-numeric: tabular-nums; }
.world-donate-footer .world-milestone-hint { margin-right: auto; color: var(--gold-hover); font-size: 10px; }
.world-donate-footer [data-world-notice] { margin: 0; color: var(--muted); font-size: 10px; }
.world-donate-footer [data-world-notice]:not(:empty) { color: var(--gold-hover); }
.world-donate-footer .button { min-height: 34px; padding: 5px 16px; font-size: 11px; }
.world-summary-hidden { display: none !important; }
.world-detail-tabs + [data-world-detail-pane] { min-width: 0; }
.world-recipe-list, .world-monster-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 10px; padding: 12px; }
.world-recipe, .world-monster-card { display: grid; align-content: start; min-width: 0; gap: 9px; padding: 12px; border: 1px solid var(--line); background: var(--panel-solid); }
.world-recipe-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.world-recipe-heading > img, .world-recipe-heading > span { width: 44px; height: 44px; flex: 0 0 44px; font-size: 21px; }
.world-recipe-heading > div { display: grid; min-width: 0; gap: 2px; }
.world-recipe-heading h4 { margin: 0; color: var(--ink); font: 500 18px/1.15 "Cormorant Garamond", serif; overflow-wrap: anywhere; }
.world-recipe-heading small, .world-recipe > p { color: var(--muted); font-size: 10px; }
.world-recipe > p { margin: 0; line-height: 1.45; }
.world-recipe-inputs, .world-monster-card ul { display: grid; align-content: start; gap: 5px; margin: 0; padding: 0; list-style: none; }
.world-recipe-inputs li, .world-monster-card li { display: flex; justify-content: space-between; gap: 8px; color: var(--ink); font-size: 10px; }
.world-recipe-inputs li > span:last-child, .world-monster-card li > span:last-child { white-space: nowrap; }
.world-recipe-inputs .is-enough { color: var(--gold-hover); }
.world-recipe-inputs .is-short, .world-craft-reason { color: var(--muted); }
.world-recipe form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.world-recipe form [data-craft-notice] { flex-basis: 100%; margin: 0; color: var(--gold-hover); font-size: 10px; }
.world-recipe form button { min-height: 32px; padding: 5px 10px; font-size: 10px; }
.world-craft-reason { font-size: 9px; }
.world-craft-confirm { width: min(470px, calc(100vw - 28px)); max-width: none; max-height: min(88vh, 680px); margin: auto; padding: 18px; border: 1px solid rgba(185, 167, 127, .6); border-radius: 4px; background: var(--panel-solid); color: var(--ink); box-shadow: 0 24px 72px rgba(0, 0, 0, .72); }
.world-craft-confirm[open] { display: grid; gap: 8px; }
.world-craft-confirm::backdrop { background: rgba(0, 0, 0, .72); }
.world-craft-confirm h3 { margin: 0 0 12px; color: var(--gold-hover); font: 600 19px/1.25 "Cormorant Garamond", serif; }
.world-craft-confirm-inputs { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; color: var(--muted); font-size: 12px; line-height: 1.5; }
.world-craft-confirm-inputs li { min-width: 0; overflow-wrap: anywhere; }
.world-craft-confirm > p { display: flex; justify-content: space-between; gap: 14px; margin: 0; padding: 7px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.world-craft-confirm > p strong { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.world-craft-confirm > p:nth-of-type(2) strong { color: var(--gold-hover); }
.world-craft-confirm form { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.world-craft-confirm button { justify-self: end; min-height: 34px; }
.world-monster-card .world-recipe-heading strong { overflow-wrap: anywhere; font-size: 13px; }
.world-monster-card .world-recipe-heading small { color: var(--muted); font-size: 9px; }
.world-monster-card li { padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.world-monster-card li span:last-child { color: var(--gold-hover); font-variant-numeric: tabular-nums; }
.world-tab-view [hidden] { display: none !important; }

@media (max-width: 640px) {
  .page-shell { width: calc(100% - 32px); }
  .world-area-cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .world-area-card-art { height: 76px; }
  .world-area-card-body { padding-right: 9px; padding-left: 9px; }
  .world-area-card-numbers { font-size: 9px; }
  .world-selected-heading { align-items: flex-start; flex-direction: column; gap: 4px; padding: 12px; }
  .world-selected-heading > span { text-align: left; }
  .world-donate-head { display: none; }
  .world-donate-row, .world-donate-panel:not(.has-influence) .world-donate-row { grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "icon name step" "icon values total"; row-gap: 3px; min-height: 56px; padding: 7px 4px; }
  .world-donate-icon { grid-area: icon; align-self: start; width: 26px; height: 26px; }
  .world-donate-name { grid-area: name; }
  .world-donate-values { display: flex; grid-area: values; gap: 8px; min-width: 0; }
  .world-donate-values > span { font-size: 9px; text-align: left; }
  .world-donate-step { grid-area: step; }
  .world-donate-step input { width: 34px; }
  .world-donate-row-total { grid-area: total; font-size: 9px; }
  .world-donate-footer { gap: 8px; padding: 10px 6px; }
  .world-donate-footer .world-milestone-hint { flex-basis: 100%; }
  .world-recipe-list, .world-monster-list { grid-template-columns: minmax(0, 1fr); padding: 8px; }
}
