:root {
  color-scheme: dark;
  --background: #101510;
  --surface: #192019;
  --surface-soft: #202920;
  --line: #354233;
  --line-bright: #61745a;
  --text: #efeede;
  --muted: #acb6a4;
  --faint: #818e7d;
  --accent: #8daa64;
  --accent-light: #c8dca4;
  --accent-ink: #14200e;
  --gold: #e1bd7f;
  --danger: #e3a494;
  --safe: #b4cf9c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 0; background: var(--background); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(ellipse at 48% -15%, #2b3926 0, transparent 53%), var(--background); }
button, input, select, textarea { font: inherit; }
button { min-height: 44px; border: 1px solid var(--line-bright); padding: .7rem .9rem; border-radius: 7px; font-size: .87rem; font-weight: 700; line-height: 1.3; cursor: pointer; transition: background .15s, border-color .15s; }
button:hover:not(:disabled) { filter: brightness(1.12); }
button:disabled { opacity: .42; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid #d4e7b3; outline-offset: 3px; }
a { color: var(--text); }
button.primary { background: var(--accent-light); color: var(--accent-ink); border-color: #c2d59f; }
button.secondary { background: #2a3526; color: var(--text); border-color: #4b5d42; }
button.quiet { background: transparent; color: var(--muted); border-color: var(--line); }
button.text-button { min-height: 40px; background: transparent; border: 0; color: var(--muted); padding: .4rem .2rem; font-size: .8rem; }
button.small { min-height: 36px; padding: .45rem .65rem; font-size: .78rem; }
.eyebrow, .stat-label { font-size: .64rem; line-height: 1.4; font-weight: 800; letter-spacing: .13em; color: #bccbaa; text-transform: uppercase; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: clamp(1.1rem,2.2vw,1.45rem); font-weight: 750; line-height: 1.2; }
h2 { font-size: 1.05rem; line-height: 1.3; font-weight: 750; }
h3 { font-size: .97rem; line-height: 1.3; }
p { color: var(--muted); font-size: .84rem; line-height: 1.55; }
.muted { color: var(--faint); }
.safe { color: var(--safe); }
.loss { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-header { max-width: 1180px; margin: 0 auto; min-height: 66px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 1.5rem; border-bottom: 1px solid rgb(211 229 191 / .12); }
.brand { display: flex; align-items: baseline; flex-wrap: wrap; gap: .7rem; text-decoration: none; letter-spacing: .11em; font-weight: 900; font-size: 1.08rem; }
.brand span { color: var(--faint); font-size: .57rem; font-weight: 700; letter-spacing: .18em; }
.save-state { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .68rem; text-align: right; }
.save-state i { flex: 0 0 5px; height: 5px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px #8daa6444; }
.save-state.is-error { color: var(--danger); }
.save-state.is-error i { background: var(--danger); }
main { max-width: 1180px; margin: 0 auto; padding: 1rem 1.5rem 2rem; }
.loading-screen { max-width: 640px; padding-top: 5rem; }
.loading-screen h1 { margin: .7rem 0; }
.loading-screen p { margin: .7rem 0; }
.status-bar { display: flex; align-items: center; gap: 1.5rem; margin-bottom: .8rem; padding: .85rem 1.1rem; border: 1px solid var(--line); border-radius: 9px; background: #171e16; }
.health-stat { flex: 1; min-width: 0; }
.health-stat > div:first-child { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.status-bar strong { font-size: 1.2rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.status-bar strong small { font-size: .75rem; color: var(--muted); font-weight: 500; }
.health-track, .enemy-track { width: 100%; height: 5px; background: #30382c; overflow: hidden; border-radius: 10px; }
.health-track { margin-top: .45rem; }
.health-track i { display: block; height: 100%; background: linear-gradient(90deg,#718e53,#bed59b); }
.compact-stat { min-width: 66px; display: flex; flex-direction: column; gap: .2rem; padding-left: 1.3rem; border-left: 1px solid var(--line); }
.coin-stat strong { color: var(--gold); }
.journey-notice { margin-bottom: .8rem; padding: .7rem .9rem; border-left: 2px solid var(--accent); background: #20291b; color: #d3ddc6; font-size: .82rem; line-height: 1.5; }
.error-banner { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 1rem; margin-bottom: 1rem; border: 1px solid #a77664; border-radius: 8px; background: #3a2821; }
.error-banner p { margin-top: .3rem; color: #e7c5b8; }
.error-banner strong { font-size: .95rem; }
.play-layout { display: grid; grid-template-columns: minmax(0,1.24fr) minmax(280px,.8fr); gap: 1rem; align-items: start; }
.main-column, .side-column { display: grid; gap: .8rem; min-width: 0; }
.enemy-panel, .wheel-panel, .inventory-panel, .selected-panel, .grant-panel, .route-panel, .receipt, .outcome-panel, .workshop, .objective-choice { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(145deg,#1a2118,#151c14); }
.enemy-panel { padding: .95rem 1rem .8rem; }
.enemy-top { display: flex; align-items: center; gap: .7rem; margin-bottom: .7rem; }
.enemy-glyph { width: 32px; flex: 0 0 32px; height: 37px; overflow: visible; }
.enemy-glyph path:first-child { fill: #263024; stroke: #81916f; stroke-width: 1.4; }
.enemy-glyph path+path { fill: none; stroke: #c8b28a; stroke-width: 1.8; stroke-linejoin: round; }
.enemy-title { flex: 1; min-width: 0; }
.enemy-title .eyebrow { font-size: .59rem; }
.enemy-title h1 { margin-top: .2rem; }
.enemy-hp { text-align: right; font-size: 1.2rem; font-variant-numeric: tabular-nums; line-height: 1; }
.enemy-hp small { display: block; margin-top: .3rem; color: var(--muted); font-size: .64rem; font-weight: 500; white-space: nowrap; }
.enemy-track i { display: block; height: 100%; background: linear-gradient(90deg,#a87763,#c6aa7b); }
.defense-line { display: block; color: #cbbf9f; font-size: .78rem; margin-top: .7rem; line-height: 1.5; }
.enemy-resources { display: flex; gap: 1rem; margin-top: .35rem; font-size: .74rem; color: var(--faint); }
.enemy-resources b { color: #ccd4c2; margin-left: .1rem; }
.intent-line { display: flex; flex-direction: column; gap: .18rem; margin-top: .7rem; padding: .65rem .75rem; background: #252c20; border-left: 2px solid #9caa7b; }
.intent-line > span { color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; }
.intent-line strong { font-size: .84rem; line-height: 1.45; font-weight: 650; }
.condition-copy { margin-top: .6rem; color: #d7ba91; font-size: .75rem; }
.condition-copy strong { display: block; font-weight: 650; }
.condition-copy span { display: block; margin-top: .25rem; }
details { min-width: 0; }
summary { cursor: pointer; color: var(--muted); font-size: .78rem; line-height: 1.4; padding: .6rem 0 .1rem; }
details[open] > summary { color: #d1ddc2; padding-bottom: .55rem; }
details > p + p { margin-top: .45rem; }
.enemy-panel details p { font-size: .76rem; }
.refuge-scene { display: flex; gap: 1rem; align-items: center; min-height: 160px; }
.refuge-flame { color: var(--accent-light); font-family: Georgia,serif; font-size: 4rem; text-shadow: 0 0 24px #99b67944; }
.refuge-scene h1 { margin: .3rem 0; font-family: Georgia,serif; font-weight: normal; font-size: 1.5rem; }
.refuge-scene p { font-size: .79rem; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: .7rem; }
.section-heading .eyebrow + h2 { margin-top: .25rem; }
.wheel-panel { padding: .9rem 1rem 1rem; background: radial-gradient(circle at 50% 44%,#27332155,transparent 65%),#161e15; }
.wheel-panel .section-heading h2 { font-size: .95rem; }
.wheel-panel .eyebrow { font-size: .6rem; }
.wheel-mode { font-size: .65rem; color: var(--faint); text-align: right; padding-top: .1rem; }
.wheel-wrap { position: relative; width: min(100%,490px); margin: .2rem auto; aspect-ratio: 1; }
.wheel-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wheel-rim { fill: none; stroke: #526044; stroke-width: 2; stroke-dasharray: 1 8; }
.wheel-cell { stroke: #141b12; stroke-width: 2; filter: saturate(.65) brightness(.8); cursor: pointer; transition: filter .12s, stroke .12s; }
.wheel-cell:hover { filter: saturate(.8) brightness(1); }
.wheel-cell.is-selected { filter: saturate(.78) brightness(.96); stroke: #d0dbb3; stroke-width: 2.5; }
.wheel-cell.is-abandoning { stroke: #e2ac84; stroke-width: 4; filter: saturate(.7) brightness(.95); }
.wheel-cell[aria-disabled="true"], .wedge-label[aria-disabled="true"] { cursor: default; }
.wheel-cell.is-empty { fill: #293328; filter: none; }
.wheel-cell.is-packed { opacity: .66; }
.wheel-cell.is-ghost { opacity: .78; stroke: #eef0c6; stroke-width: 3; stroke-dasharray: 6 4; }
.wheel-cell.is-candidate { stroke: #eff6c9; stroke-width: 5; }
.wheel-cell.is-legal-start { filter: brightness(1.05); }
.packed-overlay { pointer-events: none; }
.cell-number { fill: #a6b49a; font-size: 12px; font-weight: 600; text-anchor: middle; pointer-events: none; }
.empty-label { fill: #8c9b7f; font-size: 16px; text-anchor: middle; pointer-events: none; }
.wedge-label { cursor: pointer; }
.wedge-label circle { fill: #172015; stroke: #8b997666; stroke-width: 1.5; }
.wedge-label.is-selected circle { stroke: #d2e1af; stroke-width: 2.5; }
.wedge-label.is-ghost circle { stroke: #ebedc7; stroke-dasharray: 3 3; }
.wedge-label text { fill: #f0efdc; font-size: 12px; font-weight: 850; text-anchor: middle; pointer-events: none; }
.wedge-label .wedge-subtitle { fill: #c2cdb3; font-size: 10px; font-weight: 650; }
.wheel-hub { fill: #121a11; stroke: #657453; stroke-width: 2; }
.wheel-hub-line { fill: none; stroke: #32402a; stroke-width: 1; }
.hub-kicker, .hub-sub { fill: #aab89d; text-anchor: middle; font-size: 10px; font-weight: 750; letter-spacing: 1.4px; }
.hub-main { fill: #e8ecd6; text-anchor: middle; font-family: Georgia,serif; font-size: 42px; }
.pointer-arm { position: absolute; left: calc(50% - 1.5px); bottom: 50%; width: 3px; height: 43%; background: linear-gradient(to top,transparent 0%,#bbc894 65%,#f2edc7); transform: rotate(var(--pointer-angle)); transform-origin: 50% 100%; pointer-events: none; filter: drop-shadow(0 1px 3px #000); transition: transform 420ms cubic-bezier(.12,.66,.18,1); }
.pointer-arm::after { content: ''; position: absolute; top: -4px; left: -4px; width: 11px; height: 11px; transform: rotate(45deg); background: #eae7c1; border: 1px solid #556347; }
.play-controls { display: grid; gap: .55rem; }
.play-controls > .primary { width: 100%; font-size: .97rem; min-height: 48px; }
.spin-button { letter-spacing: .04em; }
.action-hint, .supply-hint { font-size: .72rem; line-height: 1.5; color: var(--faint); }
.play-controls > .action-hint { text-align: center; }
.secondary-actions { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.secondary-actions button { font-size: .77rem; }
.button-note { display: block; color: #aebda0; font-size: .65rem; margin-top: .15rem; font-weight: 500; }
.supply-hint { color: #a6b297; }
.no-supplies { font-size: .73rem; color: var(--faint); }
.inline-hint { margin: .3rem 0 .6rem; padding: .5rem .7rem; border: 1px solid #9b8c56; border-radius: 5px; color: #dcc68e; font-size: .76rem; }
.refuge-wheel-hint { text-align: center; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.editor-panel { border-top: 1px solid var(--line-bright); padding-top: .8rem; }
.editor-panel h3 { font-size: .95rem; }
.editor-panel > p { margin: .5rem 0; font-size: .77rem; }
.placement-controls { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .65rem 0 .5rem; }
.editor-panel > .button-row { justify-content: space-between; }
.staged-items { display: flex; gap: .35rem; flex-wrap: wrap; margin: .7rem 0; padding: .65rem; background: #332c2055; border: 1px dashed #7a7654; border-radius: 6px; }
.staged-items > .stat-label { flex-basis: 100%; color: #d3bd8e; margin-bottom: .2rem; }
button.staged-item { background: #342e21; color: #ead2a7; border: 1px solid #645941; font-size: .73rem; padding: .45rem .6rem; }
.editor-commit { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding-top: .8rem; margin-top: .7rem; border-top: 1px solid var(--line); }
.editor-commit > .primary { flex: 1; }
.entrance-finds { min-width: 0; }
.offer-guidance { margin: .15rem 0 .7rem; padding: .65rem .75rem; border-left: 2px solid #8c9864; background: #232c1d; }
.offer-guidance strong { color: #dce4c5; font-size: .8rem; }
.offer-guidance p { margin-top: .3rem; color: #bac6a9; font-size: .73rem; line-height: 1.55; }
.offer-panel { padding: .85rem; margin: .1rem 0 .85rem; border: 1px solid #7d7f51; border-radius: 8px; background: linear-gradient(135deg,#303621,#22291a); }
.offer-panel h3 { font-size: 1.06rem; margin-top: .3rem; }
.offer-panel .item-meta { color: #c4c99e; }
.offer-panel .effect-text { margin-top: .65rem; font-size: .85rem; }
.offer-panel .support-text, .offer-rank, .offer-packed { font-size: .73rem; line-height: 1.55; margin-top: .5rem; }
.offer-rank strong, .offer-packed strong { color: #dbdfc2; }
.offer-panel .action-hint { margin-top: .6rem; color: #b4c09f; }
.offer-panel > .button-row { margin-top: .75rem; }
.offer-panel > .button-row .primary { flex: 1; }
.offer-panel > .button-row button { white-space: normal; }
.offer-history { margin-top: .6rem; color: #c4c99e; font-size: .73rem; line-height: 1.55; }
.offer-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .7rem; margin-bottom: .75rem; border: 1px solid #59603d; border-radius: 7px; background: #262e1e; }
.offer-strip p { font-size: .73rem; flex: 1 1 160px; }
.offer-strip button { font-size: .72rem; padding: .5rem .7rem; }
.replacement-capacity { margin-top: .8rem; padding: .7rem; border: 1px solid #4e5d40; border-radius: 7px; background: #202b1c; }
.replacement-capacity dl { display: flex; flex-wrap: wrap; gap: .65rem 1.1rem; margin: 0; }
.replacement-capacity dl > div { flex: 1 1 110px; }
.replacement-capacity dt { color: #a9b59a; font-size: .65rem; }
.replacement-capacity dd { margin: .2rem 0 0; color: #e0e8cd; font-size: .79rem; font-weight: 700; }
.replacement-capacity > p { margin-top: .55rem; font-size: .7rem; }
.replacement-capacity .supply-lockout { border-top: 1px solid #8a6b43; padding-top: .65rem; color: #e6c796; font-size: .73rem; }
.supply-lockout strong { display: block; margin-bottom: .15rem; }
.supply-lockout-copy { color: #dfbc8d; font-size: .73rem; }
.surrender-panel { margin-top: .9rem; }
.surrender-panel > p { margin-top: .45rem; font-size: .73rem; }
.surrender-list { list-style: none; padding: 0; margin: .7rem 0; display: grid; gap: .4rem; }
.surrender-choice { display: grid; grid-template-columns: minmax(0,1fr) 142px; gap: .65rem; align-items: center; padding: .65rem; border: 1px solid #394a31; border-radius: 6px; background: #1b2518; }
.surrender-choice.is-marked { border-color: #a7775c; background: #352a20; }
.surrender-choice strong { display: block; color: #e0e4d0; font-size: .77rem; line-height: 1.4; }
.surrender-choice span, .surrender-choice small { display: block; font-size: .65rem; color: #aeba9d; line-height: 1.45; margin-top: .2rem; }
.surrender-choice small, .surrender-choice.is-marked span { color: #d6b99d; }
.surrender-choice button { padding: .5rem .55rem; font-size: .71rem; }
button.surrender-marked { background: #684c37; border-color: #be9174; color: #fff0dc; }
.replacement-confirmation > h3 { margin-top: .4rem; font-size: 1.05rem; }
.replacement-confirmation .permanent-warning { color: #e1b797; font-size: .79rem; }
.abandonment-confirmation > h3 { margin-top: .4rem; font-size: 1.05rem; }
.abandonment-confirmation .abandonment-target { color: #dec6a8; font-size: .75rem; }
.abandonment-confirmation .permanent-warning { color: #e1b797; font-size: .8rem; }
.abandonment-confirmation .permanent-warning strong { color: #f0d0ae; }
.abandonment-confirmation .abandonment-salve-note { color: #d9c3a6; font-size: .74rem; }
.abandonment-confirmation .last-equipment-warning { margin: .8rem 0; padding: .75rem; border: 1px solid #b27d5a; border-radius: 6px; background: #3a291e; color: #f0cfaa; font-size: .78rem; line-height: 1.6; }
.release-summary { list-style: none; padding: .7rem; margin: .65rem 0; display: grid; gap: .6rem; background: #34281f; border: 1px solid #95694f; border-radius: 6px; }
.release-summary strong, .release-summary span { display: block; }
.release-summary strong { color: #f0d2b6; font-size: .83rem; }
.release-summary span { color: #c8af96; font-size: .7rem; margin-top: .2rem; }
button.permanent-button { background: #d4b18d; border-color: #e5c29d; color: #2e2015; flex: 1; }
.arrangement-changes { padding: .65rem .75rem; background: #273322; margin-top: .75rem; border-radius: 5px; }
.arrangement-changes > .stat-label { font-size: .6rem; }
.arrangement-changes ul { margin: .4rem 0 0; padding: 0; list-style: none; }
.arrangement-changes li { display: flex; flex-direction: column; font-size: .73rem; line-height: 1.5; margin: .3rem 0; }
.arrangement-changes li strong { color: #d9e4c9; }
.arrangement-changes li span { color: #b9c7aa; }
.arrangement-changes p { font-size: .7rem; margin-top: .35rem; }
.pill { display: inline-block; white-space: nowrap; background: #293323; border: 1px solid #3c4c32; border-radius: 20px; padding: .23rem .5rem; font-size: .65rem; color: #c7d3b9; }
.inventory-panel, .selected-panel, .grant-panel, .route-panel, .receipt { padding: 1rem; }
.grant-panel { border-color: #758356; background: linear-gradient(130deg,#2c3924,#1b2418); }
.grant-panel h2 { font-size: 1.2rem; margin-top: .4rem; }
.grant-panel > p + p { margin-top: .55rem; }
.grant-panel > button, .grant-panel > .pill { margin-top: .85rem; }
.item-meta { color: var(--faint); font-size: .7rem; margin-top: .35rem; }
.effect-text { color: #e4e7d7; font-size: .88rem; font-weight: 650; line-height: 1.5; margin-top: .75rem; }
.support-text { font-size: .77rem; line-height: 1.55; margin-top: .55rem; }
.item-swatch { width: 10px; height: 26px; background: var(--item-color); border-radius: 4px; opacity: .8; }
.inventory-list { margin-top: .65rem; display: grid; gap: .3rem; }
button.inventory-item { display: flex; align-items: center; gap: .65rem; padding: .55rem .6rem; text-align: left; background: #1b2419; color: var(--text); border: 1px solid transparent; border-radius: 5px; min-height: 52px; }
button.inventory-item.is-selected { border-color: #647b50; background: #2a3623; }
button.inventory-item.is-staged { border-style: dashed; border-color: #8d7b52; }
.inventory-item > i { font-style: normal; width: 36px; height: 32px; flex: 0 0 36px; display: grid; place-items: center; color: var(--item-color); background: #141c12; border: 1px solid #4a5c40; border-radius: 5px; font-size: .58rem; font-weight: 850; }
.inventory-item > span { flex: 1; min-width: 0; }
.inventory-item strong { display: block; font-size: .79rem; font-weight: 650; }
.inventory-item small { display: block; font-size: .64rem; color: var(--faint); margin-top: .15rem; font-weight: 500; }
.inventory-item > b { font-size: .73rem; color: #c9d5bb; }
.inventory-note { font-size: .7rem; color: var(--faint); margin-top: .75rem; }
.neighbors { display: grid; gap: .35rem; margin-top: .75rem; padding-top: .65rem; border-top: 1px solid var(--line); }
.neighbors span { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: .5rem; font-size: .67rem; color: var(--faint); }
.neighbors b { font-weight: 550; color: #c8d1bd; }
.item-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.item-actions button { font-size: .74rem; padding: .55rem .7rem; }
.abandon-action { display: flex; align-items: center; gap: .65rem; margin-top: .85rem; padding-top: .8rem; border-top: 1px solid #62503c; }
.abandon-action > button { flex: 0 0 auto; font-size: .74rem; padding: .55rem .7rem; }
.abandon-action > p { font-size: .7rem; line-height: 1.5; }
button.destructive-text { color: #dfb795; border-color: #826245; }
.selected-panel > .action-hint { margin-top: .65rem; }
.landing-preview { margin-top: .85rem; padding: .7rem; background: #121c10; border: 1px solid #35482c; border-radius: 6px; }
.landing-preview .stat-label { font-size: .59rem; }
.preview-numbers, .receipt-numbers { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .45rem; }
.preview-numbers span, .receipt-numbers span { font-size: .69rem; color: var(--muted); }
.preview-numbers b, .receipt-numbers b { font-size: .9rem; color: var(--text); margin-right: .15rem; }
.preview-numbers .loss b, .receipt-numbers .loss b { color: var(--danger); }
.preview-numbers .safe b, .receipt-numbers .safe b { color: var(--safe); }
.landing-preview p { font-size: .71rem; margin-top: .45rem; }
.payment-note { color: #d3c299; font-size: .76rem; margin-top: .65rem; }
.guard-flow { display: flex; flex-wrap: wrap; gap: .2rem .8rem; margin-top: .6rem; font-size: .69rem; color: #b7c1aa; }
.guard-flow b { color: #d9dfcb; font-weight: 700; }
.reply-preview { color: #c4d1b6; }
.landing-preview summary { font-size: .69rem; }
.coin-gain { color: var(--gold); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.event-list { margin: .1rem 0 0; padding-left: 1.1rem; }
.event-list li { font-size: .74rem; line-height: 1.55; color: #b6c3a9; padding: .2rem 0; }
.receipt .event-list li { font-size: .77rem; }
.outcome-panel { padding: .3rem 1rem .8rem; }
.outcome-panel > details > summary { font-size: .82rem; color: #d0dbc2; }
.summary-note { color: var(--faint); font-size: .65rem; margin-left: .25rem; }
.outcome-panel p { font-size: .72rem; }
.table-wrap { max-width: 100%; overflow-x: auto; margin-top: .65rem; }
.outcome-table { width: 100%; border-collapse: collapse; font-size: .72rem; line-height: 1.4; }
.outcome-table th, .outcome-table td { text-align: left; padding: .5rem .35rem; border-bottom: 1px solid #2e3a28; vertical-align: top; }
.outcome-table thead th { font-size: .61rem; color: #a7b598; font-weight: 600; }
.outcome-table th:first-child { padding-left: 0; }
.outcome-table td:last-child { padding-right: 0; }
.outcome-table td:nth-child(n+3), .outcome-table thead th:nth-child(n+3) { text-align: right; }
.outcome-table td small { display: block; font-size: .59rem; color: #97a78a; line-height: 1.4; margin-top: .15rem; }
.outcome-table .safe-row td:last-child { color: var(--safe); }
.outcome-panel .muted { margin-top: .65rem; }
.route-panel > h2 { margin-top: .3rem; }
.route-panel > p { font-size: .75rem; margin-top: .4rem; }
.route-list { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .65rem; }
.route-list > li { display: flex; align-items: flex-start; gap: .6rem; }
.route-list > li > span { display: grid; place-items: center; flex: 0 0 24px; height: 24px; color: #a4b395; border: 1px solid #46563b; border-radius: 50%; font-size: .67rem; }
.route-list strong { display: block; font-size: .73rem; color: #b5c3a8; font-weight: 600; }
.route-list p { font-size: .64rem; line-height: 1.45; margin-top: .2rem; }
.route-list .is-current > span { background: #9eb87a; color: #17220f; border-color: #9eb87a; }
.route-list .is-current strong { color: var(--text); }
.route-list .is-complete > span { color: var(--safe); background: #2d3e22; }
.route-list .is-complete { opacity: .65; }
.refuge-panel { margin-top: 1rem; display: grid; gap: 1rem; }
.objective-choices { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,300px),1fr)); gap: .8rem; }
.objective-choice { padding: 1rem; }
.objective-choice h3 { font-size: 1.07rem; margin-top: .35rem; }
.objective-choice > p { margin-top: .45rem; font-size: .78rem; }
.objective-choice > button { margin-top: .85rem; width: 100%; }
.enemy-route-preview { list-style: none; margin: .25rem 0 .4rem; padding: 0; display: grid; gap: .6rem; }
.enemy-route-preview strong, .enemy-route-preview span { display: block; }
.enemy-route-preview strong { font-size: .77rem; font-weight: 650; }
.enemy-route-preview span { color: var(--muted); font-size: .69rem; margin-top: .15rem; line-height: 1.5; }
.workshop { padding: 1.1rem; }
.workshop h2 { font-size: 1.15rem; }
.wallet { color: var(--gold); padding: .35rem .6rem; border: 1px solid #645b3f; border-radius: 6px; font-weight: 700; font-size: .82rem; white-space: nowrap; }
.workshop-note { font-size: .76rem; margin-top: .6rem; }
.upgrade-list { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .85rem; }
.upgrade-option { border: 1px solid #3a4931; border-radius: 7px; padding: .85rem; background: #1c2619; }
.upgrade-name { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .35rem; font-size: .88rem; font-weight: 700; }
.upgrade-name small { color: #adbca0; font-size: .66rem; font-weight: 500; }
.upgrade-option p { font-size: .75rem; line-height: 1.5; margin-top: .5rem; }
.upgrade-option button { margin-top: .7rem; font-size: .74rem; min-height: 40px; width: 100%; }
.purchased-label { display: inline-block; color: var(--safe); font-size: .74rem; margin-top: .75rem; }
.salve-shop { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border: 1px solid #425439; background: #24321f; border-radius: 7px; margin-top: .8rem; }
.salve-shop h3 { color: #d7e5c5; }
.salve-shop p { font-size: .78rem; margin: .3rem 0; }
.salve-shop .muted { font-size: .69rem; }
.salve-shop button { flex-shrink: 0; font-size: .77rem; }
footer { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
footer p { color: var(--faint); font-size: .7rem; }
@media (max-width: 780px) {
  .app-header { padding: .75rem 1rem; min-height: 60px; }
  main { padding: .8rem 1rem 1.5rem; }
  .play-layout { grid-template-columns: 1fr; gap: .8rem; }
  .main-column, .side-column { gap: .75rem; }
  .wheel-wrap { max-width: 450px; }
  .side-column { grid-template-columns: 1fr 1fr; align-items: start; }
  .side-column > .grant-panel, .side-column > .route-panel { grid-column: 1 / -1; }
  .side-column > .selected-panel { position: sticky; top: .5rem; }
  .wheel-panel .section-heading h2 { font-size: 1rem; }
}
@media (max-width: 520px) {
  .app-header { padding: .7rem .8rem; gap: .7rem; }
  .brand { font-size: .93rem; gap: .35rem; }
  .brand span { display: none; }
  .save-state { font-size: .61rem; max-width: 155px; }
  main { padding: .65rem .65rem 1.2rem; }
  .status-bar { padding: .65rem .75rem; gap: .8rem; margin-bottom: .65rem; }
  .status-bar strong { font-size: 1.12rem; }
  .compact-stat { min-width: 48px; padding-left: .75rem; }
  .stat-label { font-size: .57rem; }
  .journey-notice { font-size: .75rem; padding: .55rem .7rem; margin-bottom: .65rem; }
  .enemy-panel { padding: .8rem .85rem .65rem; }
  .enemy-title .eyebrow { font-size: .53rem; }
  .enemy-title h1 { font-size: 1.04rem; }
  .enemy-glyph { width: 27px; flex-basis: 27px; height: 32px; }
  .enemy-top { gap: .55rem; margin-bottom: .55rem; }
  .enemy-hp { font-size: 1.06rem; }
  .enemy-hp small { font-size: .58rem; }
  .defense-line { font-size: .73rem; margin-top: .55rem; }
  .enemy-resources { font-size: .68rem; }
  .intent-line { margin-top: .55rem; padding: .5rem .6rem; }
  .intent-line strong { font-size: .79rem; }
  .enemy-panel summary { font-size: .71rem; }
  .wheel-panel { padding: .75rem .7rem .8rem; }
  .wheel-panel .section-heading h2 { font-size: .85rem; }
  .wheel-panel .eyebrow { font-size: .52rem; }
  .wheel-panel .section-heading button { font-size: .7rem; padding: .4rem .55rem; }
  .wheel-mode { font-size: .58rem; max-width: 72px; }
  .wheel-wrap { margin: .05rem auto .1rem; max-width: 360px; }
  .play-controls { gap: .45rem; }
  .play-controls > .primary { min-height: 48px; }
  .action-hint, .supply-hint { font-size: .67rem; }
  .secondary-actions { gap: .4rem; }
  .secondary-actions button { padding: .55rem .65rem; font-size: .72rem; }
  .secondary-actions .button-note { font-size: .6rem; }
  .side-column { grid-template-columns: 1fr; }
  .side-column > .selected-panel { position: static; }
  .selected-panel, .inventory-panel, .route-panel, .receipt, .grant-panel { padding: .9rem; }
  .grant-panel h2 { font-size: 1.12rem; }
  .inventory-list { grid-template-columns: 1fr 1fr; gap: .35rem; }
  button.inventory-item { padding: .45rem; gap: .4rem; min-height: 56px; }
  .inventory-item > i { flex-basis: 29px; width: 29px; height: 30px; font-size: .48rem; }
  .inventory-item strong { font-size: .7rem; line-height: 1.35; }
  .inventory-item small { font-size: .58rem; }
  .inventory-item > b { font-size: .62rem; }
  .editor-panel h3 { font-size: .85rem; }
  .editor-panel > p { font-size: .71rem; }
  .editor-panel button { font-size: .72rem; padding: .6rem .7rem; }
  .editor-commit { flex-direction: column; }
  .editor-commit > .button-row { justify-content: space-between; }
  .editor-commit > .primary { min-height: 45px; width: 100%; }
  .editor-commit > .permanent-button { min-height: 48px; width: 100%; }
  .offer-panel { padding: .7rem; }
  .offer-guidance { padding: .6rem; }
  .offer-guidance p, .offer-history { font-size: .68rem; }
  .offer-panel h3 { font-size: .98rem; }
  .offer-panel .effect-text { font-size: .79rem; }
  .offer-panel .support-text, .offer-rank, .offer-packed { font-size: .68rem; }
  .offer-panel .button-row button { font-size: .72rem; padding: .6rem .7rem; }
  .replacement-capacity { padding: .6rem; }
  .replacement-capacity dl { gap: .6rem; }
  .replacement-capacity dl > div { flex-basis: 100px; }
  .replacement-capacity dd { font-size: .73rem; }
  .surrender-choice { grid-template-columns: minmax(0,1fr) 108px; padding: .55rem; gap: .5rem; }
  .surrender-choice strong { font-size: .72rem; }
  .surrender-choice span, .surrender-choice small { font-size: .6rem; }
  .surrender-choice button { font-size: .67rem; padding: .55rem .35rem; }
  .replacement-confirmation > h3 { font-size: .95rem; }
  .replacement-confirmation .permanent-warning { font-size: .73rem; }
  .abandonment-confirmation > h3 { font-size: .95rem; }
  .abandonment-confirmation .permanent-warning { font-size: .74rem; }
  .abandonment-confirmation .abandonment-target, .abandonment-confirmation .abandonment-salve-note { font-size: .69rem; }
  .abandonment-confirmation .last-equipment-warning { padding: .65rem; font-size: .73rem; }
  .release-summary strong { font-size: .76rem; }
  .release-summary span { font-size: .64rem; }
  .arrangement-changes { padding: .6rem; }
  .arrangement-changes li { font-size: .68rem; }
  .outcome-panel { padding: .25rem .8rem .7rem; }
  .summary-note { display: block; margin: .25rem 0 0; }
  .outcome-table { font-size: .66rem; }
  .outcome-table th, .outcome-table td { padding: .45rem .25rem; }
  .outcome-table thead th { font-size: .56rem; }
  .outcome-table td small { font-size: .54rem; }
  .objective-choice, .workshop { padding: .85rem; }
  .upgrade-list { grid-template-columns: 1fr; gap: .55rem; }
  .upgrade-option { padding: .75rem; }
  .salve-shop { padding: .8rem; flex-direction: column; align-items: stretch; gap: .7rem; }
  .refuge-scene { min-height: 140px; }
  .refuge-scene h1 { font-size: 1.25rem; }
  .refuge-flame { font-size: 3rem; }
  footer { gap: .6rem; }
  footer p { max-width: 70%; font-size: .65rem; }
  footer button.text-button { font-size: .71rem; }
}
@media (max-width: 350px) {
  .status-bar { gap: .6rem; }
  .compact-stat { min-width: 43px; padding-left: .55rem; }
  .inventory-list { grid-template-columns: 1fr; }
  .inventory-item strong { font-size: .75rem; }
  .enemy-title h1 { font-size: .95rem; }
  .enemy-glyph { display: none; }
  .wheel-panel .section-heading { gap: .35rem; }
  .secondary-actions { align-items: stretch; }
  .secondary-actions button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Continuing circuits: compact, scroll-safe persistent catalogue. */
.catalogue-panel{margin-top:1.5rem;min-width:0;padding:1rem;border:1px solid var(--stroke,#4a4f46);border-radius:16px}
.catalogue-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:.75rem;margin-top:1rem}
.catalogue-option{min-width:0;border:1px solid var(--stroke,#4a4f46);border-radius:12px;padding:.85rem;display:flex;flex-direction:column;gap:.5rem}
.catalogue-option h3{margin:0}.catalogue-option .item-meta,.catalogue-option p{overflow-wrap:anywhere}
.catalogue-option details{min-width:0}.catalogue-option .button-row{margin-top:auto}.catalogue-option summary{cursor:pointer}
@media(max-width:390px){.catalogue-panel{padding:.65rem}.catalogue-option{padding:.65rem}}
