/* Reference-led interface finish. These selectors own chrome and layout only;
   card faces, artwork, foil treatments and gameplay are intentionally untouched. */
:root:not(.strong-contrast) {
  --gui-edge: color-mix(in srgb, var(--pm-ui-text) 9%, transparent);
  --gui-gloss: color-mix(in srgb, #fff 9%, transparent);
  --gui-sheet: linear-gradient(155deg, var(--pm-ui-surface-raised), var(--pm-ui-surface) 58%);
  --gui-shadow: 0 8px 28px var(--pm-ui-shadow), inset 0 1px var(--gui-gloss);
  --gui-success: #9ce3ce;
  --gui-risk: #ffb6bd;
}
:root[data-theme=light]:not(.strong-contrast) {
  --gui-gloss: #ffffffd9;
  --gui-edge: #b8cde16b;
  --gui-sheet: linear-gradient(155deg, #fafdff, #eff5fb 62%, #eaf1f9);
  --gui-success: #226c5c;
  --gui-risk: #a13c50;
}
:root.strong-contrast { --gui-edge: var(--pm-ui-line); --gui-gloss: transparent; --gui-sheet: var(--pm-ui-surface); --gui-shadow: none; --gui-success: var(--pm-ui-text); --gui-risk: var(--pm-ui-danger); }

/* Quiet canvases and shared ribbons. Section colours remain local. */
.shell .exp-app:not(:has(.exploration-system)) {
  background: radial-gradient(ellipse at 0 0, color-mix(in srgb, #a6a4f3 12%, transparent), transparent 52%), radial-gradient(ellipse at 100% 100%, color-mix(in srgb, #7cdbd0 12%, transparent), transparent 58%), var(--pm-ui-ink);
}
.shell .exp-app:not(:has(.exploration-system)):before { background: none; }
.shell .exp-app:not(:has(.exploration-system)) > .exp-snow { display: none; }
.shell :is(.exp-screen-heading,.workshop-header,.pause-system>header,.utility-header,.funhouse-heading) {
  background: linear-gradient(169deg, transparent 63%, #ffffff35 63.4%), var(--section-banner);
  color: var(--section-ink);
  border: 1px solid #ffffff50;
  border-radius: 22px;
  box-shadow: var(--gui-shadow);
}
.shell :is(.exp-screen-heading,.workshop-header,.pause-system>header,.utility-header,.funhouse-heading) :is(h1,h2,small,.exp-eyebrow,p) { color: var(--section-ink); text-shadow: none; }
.shell .exp-screen-heading { padding: 10px 12px; }
.shell :is(.exp-screen-heading,.funhouse-heading) .exp-icon-button { background: #ffffff8a; color: var(--section-ink); box-shadow: 0 3px 9px #4563801c; }
.shell .home-system .home-tableau { background: linear-gradient(168deg,transparent 69%,#ffffff18 69.3%), linear-gradient(115deg,#a9b6f32b,#8adccc33); box-shadow: inset 0 1px var(--gui-gloss); }
.shell .home-destinations { background: var(--gui-sheet); box-shadow: var(--gui-shadow); border: 1px solid var(--gui-edge); }
.shell .home-destination { min-height: 52px; }
.shell .home-destination > .exp-icon { width: 26px; height: 26px; }
.shell :is(.campaign-journeys,.ship-catalogue-tabs,.binder-ownership-shortcuts) { gap: 8px; }
.shell :is(.profile-records,.trophy-cabinet,.binder-controls,.workshop-toolbar,.exp-summary-stats) { background: var(--gui-sheet); border-color: var(--gui-edge); box-shadow: var(--gui-shadow); }
.shell :is(.exp-button,.exp-icon-button,.ui-button,.home-destination,.exp-choice,.exp-relic-choice,.event-hero-option) { touch-action: manipulation; }
.shell :is(.exp-button,.ui-button):not(:disabled):not(.danger).primary { background: var(--section-banner); color: var(--section-ink); box-shadow: inset 0 1px #ffffff85, 0 4px 13px color-mix(in srgb,var(--section-b) 20%,transparent); border: 1px solid #ffffff70; }
.shell :is(.exp-button,.exp-icon-button,.ui-button):focus-visible { outline: 3px solid var(--pm-ui-focus); outline-offset: 3px; }

/* A short, content-sized sheet instead of a fixed tall dialog. */
.shell .exp-overlay { background: color-mix(in srgb,var(--pm-ui-ink) 76%,transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
html[data-theme=light] .shell .exp-overlay { background: linear-gradient(145deg,#e6edf7d4,#e8f3f5ca); }
.shell .exp-modal:not(.modal-reward):not(.modal-shopPack):not(.modal-maw-unlock) { background: var(--gui-sheet); box-shadow: 0 18px 56px var(--pm-ui-shadow), inset 0 1px var(--gui-gloss); border: 1px solid var(--gui-edge); border-radius: 26px; }
.shell .exp-modal > .exp-icon-button:first-child { z-index: 12; right: 10px; top: 10px; width: 44px; height: 44px; min-height: 44px; border: 1px solid var(--gui-edge); background: var(--pm-ui-surface); box-shadow: 0 3px 10px var(--pm-ui-shadow); }
.shell .exp-dialog-wallet { background: var(--gui-sheet); border: 1px solid var(--gui-edge); box-shadow: var(--gui-shadow); }
.shell .exp-modal.exp-illustrated:has([data-stop-heading],[data-stop-shop]) { display:flex; flex-direction:column; width:min(650px,100%); height:auto; }
.shell .exp-modal:has([data-stop-heading],[data-stop-shop]) > .exp-location-art { display:block; flex:0 0 64px; height:64px; min-height:64px; max-height:64px; width:100%; margin:0; }
.shell .exp-modal:has([data-stop-heading],[data-stop-shop]) > .exp-dialog-body { padding: 0 16px 14px; gap: 9px; background: transparent; }
.shell .exp-modal:has([data-stop-heading],[data-stop-shop]) > .exp-dialog-body { flex:0 1 auto; max-height:none; }
.gui-stop-heading { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; background: linear-gradient(169deg,transparent 62%,#ffffff38 62.4%),var(--section-banner); color: var(--section-ink); min-width: 0; margin: 0 0 2px; }
.gui-stop-heading > div:last-child { min-width: 0; }
.shell .gui-stop-heading .exp-space-icon { display:grid; place-items:center; width: 44px; height: 44px; margin: 0; border: 1px solid #ffffff70; border-radius: 15px; background: #ffffff70; color: var(--section-ink); box-shadow: 0 3px 9px #4563801c; flex: none; }
.shell .gui-stop-heading :is(.exp-eyebrow,[data-stop-heading],h2,small) { color: var(--section-ink); }
.shell .gui-stop-heading .exp-eyebrow { font-size: 11px; line-height: 1.35; letter-spacing: .02em; display: block; margin-bottom: 3px; }
.shell .gui-stop-heading h2 { font-size: 23px; margin: 0; }
.shell .exp-modal .gui-stop-heading[data-stop-shop] { display:flex; padding:12px 14px; background:linear-gradient(169deg,transparent 62%,#ffffff38 62.4%),var(--section-banner); }
.shell .gui-stop-heading[data-stop-shop] > div:last-child { display: grid; gap: 3px; }
.shell .gui-stop-heading[data-stop-shop] small { font-size: 11px; }
.gui-facts { display:flex; flex-wrap:wrap; gap:7px; margin:0; padding:0; }
.gui-fact { display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:5px 10px; border-radius:12px; background:var(--pm-ui-surface-soft); color:var(--pm-ui-text); border:1px solid var(--gui-edge); font-size:13px; line-height:1.35; }
.gui-fact .exp-icon { width:17px; height:17px; }
.gui-fact.is-risk { color:var(--gui-risk); background:var(--pm-ui-danger-surface); }
.shell .exp-modal :is(.gui-note,.gui-rules) { font-size:13px; line-height:1.45; color:var(--pm-ui-muted); }
.shell .gui-rules > summary { min-height:44px; display:flex; align-items:center; gap:8px; cursor:pointer; list-style:none; }
.gui-rules > summary::after { content:'⌄'; margin-left:auto; }
.gui-rules > summary::-webkit-details-marker { display:none; }
.gui-rules[open] > summary::after { content:'⌃'; }
.shell .gui-rules p { margin:0 0 8px; font-size:13px; line-height:1.45; }
.shell .exp-modal:has([data-stop-heading],[data-stop-shop]) :is(.exp-forge-heroes,.exp-shop-grid) { gap:10px; }
.shell .exp-modal:has([data-stop-heading]) .exp-forge-heroes .exp-button { grid-template-columns:28px minmax(0,1fr) auto; gap:8px; padding:9px 10px; background:var(--gui-sheet); border:1px solid var(--gui-edge); border-radius:17px; }
.gui-forge-avatar { display:block; width:28px; height:36px; object-fit:cover; border-radius:8px; }
.gui-forge-copy { display:grid; gap:3px; min-width:0; }
.shell .exp-modal .gui-forge-copy strong { font-size:13px; line-height:1.3; }
.shell .exp-modal .gui-forge-copy small { font-size:11px; line-height:1.35; margin:0; }
.shell .exp-modal:has([data-stop-heading]) .exp-forge-heroes .forge-health-preview { font-size:11px; line-height:1.35; color:var(--gui-success); }
.shell .exp-modal:has([data-stop-shop]) .exp-shop-grid { grid-template-columns:minmax(0,1fr); }
.shell .exp-modal:has([data-stop-heading],[data-stop-shop]) .exp-shop-item { padding:10px; border:1px solid var(--gui-edge); border-radius:18px; background:var(--gui-sheet); }
.shell .exp-modal:has([data-stop-heading],[data-stop-shop]) .exp-shop-item > h3 { font-size:17px; }
.shell .exp-modal .shop-utilities { display:flex; flex-wrap:wrap; gap:4px 14px; }
.shell .exp-modal .shop-utilities summary { min-height:44px; }
.shell .exp-modal .camp-party-preview { gap:7px; }
.shell .exp-modal .camp-party-member { padding:8px 10px; border:1px solid var(--gui-edge); background:var(--gui-sheet); border-radius:16px; }
.shell .exp-modal .camp-sheet-footer { margin-top:0; }
.shell .exp-modal:has([data-stop-heading=camp]) .camp-party-preview > .camp-party-member { padding:7px 8px; gap:8px; min-height:56px; }
.shell .exp-modal:has([data-stop-heading=camp]) .camp-party-member > img { width:32px; height:40px; flex-basis:32px; border-radius:9px; }
.shell .exp-modal:has([data-stop-heading=camp]) .camp-party-copy { gap:3px; }
.shell .exp-modal:has([data-stop-heading=camp]) .camp-party-copy > strong { font-size:13px; }
.shell .exp-modal:has([data-stop-heading=camp]) .camp-party-copy > span:not(.camp-health-track) { font-size:12px; line-height:1.3; gap:2px 6px; }
.shell .exp-modal:has([data-stop-heading=camp]) .camp-party-copy > span > b { font-size:12px; }
.shell .exp-modal:has([data-stop-heading=camp]) .camp-party-member[data-full-health=true] .camp-party-copy > span > b { display:none; }
.shell .exp-modal:has([data-stop-heading=camp]) .camp-health-track { height:3px; }
.shell .exp-modal .stop-lore > summary { min-height:44px; font-size:12px; }
.shell .exp-event-choices { gap:8px; }
.shell .exp-event-choices > .exp-choice { padding:12px; border-radius:18px; background:var(--gui-sheet); border:1px solid var(--gui-edge); box-shadow:var(--gui-shadow); }
.shell .exp-event-choices .exp-choice strong { color:var(--pm-ui-text); font-size:14px; }
.shell .exp-event-choices .exp-choice small { color:var(--pm-ui-muted); font-size:12px; }
.shell .exp-event-choices .event-health-preview { display:flex; flex-wrap:wrap; gap:4px 10px; padding-top:3px; }

/* Opponent, fighters, Battle: a single compact decision. */
.shell .exp-modal.modal-encounter:has(.encounter-system) { height:auto; max-height:100%; width:min(700px,100%); padding:16px; overflow:hidden; }
.shell .encounter-system { gap:12px; height:auto; max-height:calc(100dvh - 110px); min-height:0; }
.shell .encounter-system .encounter-content { display:grid; grid-template-columns:116px minmax(0,1fr); align-items:center; gap:10px 16px; flex:0 1 auto; padding:0 2px; overflow-y:auto; }
.shell .encounter-system .exp-encounter-art { grid-column:1; grid-row:1; width:116px; height:148px; border-radius:20px; margin:0; box-shadow:var(--gui-shadow); }
.shell .encounter-system .exp-encounter-art :is(.art,.foil-art,.exp-boss-scene) { width:100%; height:100%; object-fit:cover; }
.shell .encounter-system .exp-encounter-copy { display:contents; }
.shell .encounter-system .gui-encounter-heading { grid-column:2; grid-row:1; text-align:left; min-width:0; padding:14px 32px 14px 14px; border-radius:20px; background:linear-gradient(170deg,transparent 62%,#ffffff38 62.4%),var(--section-banner); color:var(--section-ink); }
.shell .encounter-system .gui-encounter-heading h2 { font-size:clamp(21px,3vw,27px); margin:5px 0 8px; color:var(--section-ink); }
.shell .encounter-system .gui-encounter-heading .encounter-region { color:var(--section-ink); font-size:11px; }
.shell .encounter-system .gui-encounter-heading .exp-enemy-preview { justify-content:flex-start; color:var(--section-ink); font-size:18px; }
.shell .encounter-system .gui-encounter-heading .exp-enemy-preview small { color:var(--section-ink); font-size:13px; }
.shell .encounter-system :is(.encounter-fighter-label,.exp-fighter-list,.fighter-readiness,.encounter-preparation) { grid-column:1/-1; grid-row:auto; }
.shell .encounter-system .encounter-fighter-label { margin:2px 0 0; font-size:13px; text-align:left; }
.shell .encounter-system .exp-fighter-list { gap:8px; }
.shell .encounter-system .exp-party-card { min-height:84px; gap:5px; padding:8px 5px; border:1px solid var(--gui-edge); border-radius:18px; background:var(--gui-sheet); }
.shell .encounter-system .exp-party-card.selected { border-color:var(--pm-ui-accent); background:linear-gradient(140deg,color-mix(in srgb,var(--section-a) 16%,var(--pm-ui-surface)),var(--pm-ui-surface)); box-shadow:inset 0 0 0 1px var(--pm-ui-accent); }
.shell .encounter-system .exp-party-image { width:30px; height:36px; }
.shell .encounter-system .exp-party-copy { gap:3px; }
.shell .encounter-system .exp-party-copy strong { font-size:12px; }
.shell .encounter-system .exp-party-copy small { font-size:12px; }
.shell .encounter-system .encounter-preparation { margin:0; border-top:1px solid var(--gui-edge); }
.shell .encounter-system .encounter-preparation > summary { min-height:44px; color:var(--pm-ui-text); }
.shell .encounter-system .encounter-preparation > summary .exp-icon { width:18px; height:18px; margin-right:6px; }
.shell .encounter-system > .exp-dialog-actions { background:transparent; padding:0; }

/* Revelia menus use the same GUI as the rest of the game. */
.shell .modal-amusements { background:var(--gui-sheet)!important; border:1px solid var(--gui-edge)!important; padding:12px!important; border-radius:26px; }
.amusements { --section-a:#ffd0b1; --section-b:#deb8ef; color:var(--pm-ui-text); gap:8px; }
.amuse-casino { --section-a:#c7b8f4; --section-b:#a4d8ec; }
.shell .amuse-heading { background:linear-gradient(169deg,transparent 64%,#ffffff38 64.4%),var(--section-banner); border:0; border-radius:19px; clip-path:none; padding:12px 42px 12px 14px; }
.shell .amuse-heading :is(h1,.exp-eyebrow,.amuse-wallet,.amuse-wallet span) { color:var(--section-ink); }
.shell .amuse-heading h1 { margin:3px 0 8px; font-size:24px; letter-spacing:-.03em; }
.shell .amuse-reading { padding:4px 2px 8px; scrollbar-gutter:auto; }
.shell .amuse-catalogue { grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.shell .amuse-catalogue article { display:flex; flex-direction:column; align-items:stretch; min-width:0; gap:6px; padding:10px; border-radius:18px; clip-path:none; border:1px solid var(--gui-edge); background:var(--pm-ui-surface); box-shadow:var(--gui-shadow); }
.shell .amuse-catalogue h3 { font-size:15px; margin:0; color:var(--pm-ui-text); }
.shell .amuse-catalogue .amuse-illustration { height:64px; border-radius:12px; object-fit:cover; }
.shell .amuse-catalogue article > .amuse-control { margin-top:auto; }
.shell .amuse-catalogue article { position:relative; padding:0; overflow:visible; gap:0; }
.shell .amuse-catalogue [data-amuse-launch] { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; min-height:92px!important; padding:8px!important; border:0!important; background:var(--gui-sheet)!important; color:var(--pm-ui-text)!important; }
.shell .amuse-catalogue [data-amuse-launch] .amuse-illustration { height:54px; width:100%; max-width:100%; margin:0; object-fit:cover; border-radius:10px; }
.shell .amuse-catalogue [data-amuse-launch]:has(img.amuse-illustration) { min-height:112px!important; }
.shell .amuse-midway .amuse-heading .amuse-wallet { display:none; }
.shell .amuse-midway .amuse-heading > .exp-eyebrow { display:none; }
.shell .amuse-midway .amuse-heading h1 { margin:2px 0; }
.shell .amuse-active-banner { height:72px; overflow:hidden; border-radius:16px; margin:4px 0 8px; }
.shell .amuse-active-banner > img { width:100%; height:100%; object-fit:cover; object-position:center 46%; }
.shell .amuse-game-stake { display:inline-flex; align-items:center; gap:5px; }
.shell .amuse-choose > .amuse-reading > .amuse-instruction { display:none; }
.shell .amuse-choose .amuse-footer small { display:none; }
.shell .amuse-catalogue .amuse-control[data-amuse-launch] { background:var(--gui-sheet)!important; color:var(--pm-ui-text)!important; }
.shell .amuse-catalogue [data-amuse-launch] strong { font-size:13px; line-height:1.25; color:var(--pm-ui-text); }
.shell .amuse-launch-cost { display:flex; align-items:center; gap:4px; font-size:12px; color:var(--pm-ui-muted); }
.shell .amuse-game-info { position:absolute; top:0; right:0; }
.shell .amuse-game-info > summary { display:grid; place-items:center; width:44px; height:44px; padding:9px; list-style:none; border-radius:50%; }
.shell .amuse-game-info > summary::-webkit-details-marker { display:none; }
.shell .amuse-game-info > summary .exp-icon { width:15px; height:15px; padding:2px; border:1px solid var(--pm-ui-line); border-radius:50%; background:var(--pm-ui-surface); }
.shell .amuse-game-info[open] { position:static; }
.shell .amuse-game-info[open] > summary { position:absolute; top:0; right:0; }
.shell .amuse-game-info p { font-size:12px; line-height:1.4; padding:8px; }
.shell .amuse-catalogue details { color:var(--pm-ui-muted); font-size:12px; }
.shell .amusements :is(p,small,summary) { color:var(--pm-ui-muted); }
.shell .amusements summary { min-height:44px; font-size:12px; }
.shell .amusements :is(h2,h3) { color:var(--pm-ui-text); }
.shell .amuse-control { background:var(--pm-ui-surface-raised)!important; border:1px solid var(--gui-edge)!important; color:var(--pm-ui-text)!important; border-radius:16px; box-shadow:inset 0 1px var(--gui-gloss); font-size:14px; }
.shell .amuse-control:hover:not(:disabled) { background:var(--pm-ui-surface-soft)!important; outline:none!important; }
.shell .amuse-control:focus-visible { outline:3px solid var(--pm-ui-focus)!important; outline-offset:2px; }
.shell :is(.amuse-catalogue,.amuse-footer) .amuse-control { background:var(--section-banner)!important; color:var(--section-ink)!important; }
.shell :is(.amuse-instruction,.amuse-cashier,.amuse-result,.amuse-hands>div) { background:var(--pm-ui-surface-soft); color:var(--pm-ui-text); border:1px solid var(--gui-edge); border-radius:16px; }
.shell .amuse-cashier { padding:10px 12px; }
.shell .amuse-cashier p { margin:5px 0; font-size:12px; }
.shell .amuse-cashier select { background:var(--pm-ui-surface); color:var(--pm-ui-text); border:1px solid var(--gui-edge); border-radius:12px; }
.shell .amuse-instruction { font-size:13px; margin:0 0 8px; }
.shell .amuse-footer { border-color:var(--gui-edge); }
.shell .amuse-roulette .amuse-control { background:var(--pocket)!important; color:#fff!important; }
.shell .amuse-poker > .amuse-control { background:transparent!important; border-color:transparent!important; }
.shell .amuse-die { color:var(--pm-ui-text); }
.shell .amuse-ring-board strong { color:var(--pm-ui-text); }

/* Room choices keep the exact targets and consequences in a compact grid. */
.shell .funhouse-board { background:radial-gradient(ellipse at top,#b7a4ed1c,transparent 65%),var(--pm-ui-ink); gap:10px; }
.shell .funhouse-heading { --section-a:#c6b9f5; --section-b:#9cdfe2; padding:12px 14px; }
.shell .funhouse-heading h1 { font-size:25px; margin:2px 0; }
.shell .funhouse-heading p { display:none; }
.shell .funhouse-heading .exp-button { background:#ffffff8a; color:var(--section-ink); }
.shell .funhouse-status { background:var(--gui-sheet); border:1px solid var(--gui-edge); border-radius:18px; box-shadow:var(--gui-shadow); }
.shell .funhouse-table-scroll { min-height:0; max-height:none; flex:1 0 340px; }
.shell .funhouse-table { grid-template-rows:repeat(4,minmax(68px,1fr)); }
.shell .funhouse-card { width:52px; height:76px; min-height:76px; }
.shell .funhouse-room h1 { font-size:24px; margin:5px 0 10px; letter-spacing:-.025em; }
.shell .funhouse-room-reading { padding:20px 18px 12px; scrollbar-color:var(--pm-ui-line) transparent; text-align:left; }
.shell .funhouse-room-reading > .exp-eyebrow { display:none; }
.shell .funhouse-room-story { font-size:13px; line-height:1.5; margin-bottom:8px; color:var(--pm-ui-muted); }
.shell .funhouse-room-choices { gap:8px; }
.shell .funhouse-room-choices .exp-button { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:5px 8px; min-height:60px; padding:10px 12px; background:var(--gui-sheet); border:1px solid var(--gui-edge); border-radius:16px; }
.shell .funhouse-room-choices strong { font-size:13px; grid-column:1; }
.shell .funhouse-room-choices span { font-size:12px; line-height:1.35; grid-column:1/-1; }
.shell .funhouse-room-choices .funhouse-check-target { color:var(--pm-ui-text); font-size:11px; grid-column:2; grid-row:1; align-self:start; border-radius:9px; padding:3px 6px; background:var(--pm-ui-surface-soft); white-space:nowrap; }
.shell .funhouse-room-choices .funhouse-check-success { color:var(--gui-success); }
.shell .funhouse-room-choices .funhouse-check-failure { color:var(--gui-risk); }
.shell .funhouse-room-choices .exp-button { display:grid; grid-template-columns:36px minmax(0,1fr); align-items:center; gap:10px; padding:10px; }
.shell .funhouse-room-choices .funhouse-choice-symbol { grid-column:1; display:grid; place-items:center; width:36px; height:42px; border-radius:12px; background:color-mix(in srgb,var(--section-a) 20%,var(--pm-ui-surface-raised)); color:var(--pm-ui-text); }
.shell .funhouse-choice-symbol > .exp-icon { width:23px; height:23px; }
.shell .funhouse-room-choices .funhouse-choice-main { grid-column:2; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:5px 6px; min-width:0; }
.shell .funhouse-choice-main > strong { grid-column:1; font-size:14px; line-height:1.25; align-self:center; }
.shell .funhouse-choice-main > .funhouse-check-target { grid-column:2; grid-row:1; font-size:11px; padding:3px 5px; }
.shell .funhouse-choice-main > :is(.funhouse-check-success,.funhouse-check-failure,.funhouse-unchecked-effect) { display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px; grid-column:1/-1; font-size:11px; }
.shell .funhouse-choice-main .funhouse-impact { display:inline-flex; align-items:center; gap:4px; width:auto; font-size:11px; line-height:1.25; grid-column:auto; }
.shell .funhouse-impact :is(.exp-icon,img) { width:14px; height:14px; flex:none; }
.shell .funhouse-choice-main > :is(.funhouse-check-success,.funhouse-check-failure) > b { font-size:12px; width:10px; text-align:center; }
.shell .funhouse-room-lore { margin:0 0 8px; }
.shell .funhouse-room-lore > summary { min-height:44px; font-size:12px; }
.shell .funhouse-room-lore p { color:var(--pm-ui-muted); font-size:13px; line-height:1.5; }
.shell .funhouse-outcome { background:var(--pm-ui-surface-soft); border:1px solid var(--gui-edge); border-radius:16px; color:var(--pm-ui-text); }
.shell .funhouse-outcome h2 { color:var(--gui-success); font-family:inherit; font-size:18px; }
.shell .funhouse-dice-receipt { background:var(--pm-ui-surface-soft); border-color:var(--gui-edge); }
.shell .funhouse-dice-copy :is(span,small) { color:var(--pm-ui-muted); }
.shell .funhouse-dice-copy strong { font-family:inherit; color:var(--gui-success); }
.shell .failure .funhouse-dice-copy strong { color:var(--gui-risk); }
.shell :is(.funhouse-room,.funhouse-cinematic) > footer { background:var(--pm-ui-surface); border-color:var(--gui-edge); }
.shell :is(.funhouse-room,.funhouse-cinematic) footer small { color:var(--pm-ui-muted); }
.shell .funhouse-revisit { color:var(--pm-ui-muted); border-color:var(--gui-edge); }
.shell .funhouse-stage-label { color:var(--pm-ui-muted); }

/* Location ribbon and compact route controls stay above the existing scenery. */
.shell .exploration-system .exp-map-title { border-left:3px solid var(--location-accent,var(--section-a)); border-radius:3px; padding-left:10px; }
.shell .exploration-system .exp-map-title h2 { font-size:clamp(17px,2.2vw,23px); letter-spacing:-.025em; }
.shell .exploration-system .exp-map-heading { background:linear-gradient(155deg,color-mix(in srgb,var(--pm-ui-surface) 96%,transparent),color-mix(in srgb,var(--pm-ui-surface-raised) 94%,transparent)); box-shadow:var(--gui-shadow); border:1px solid var(--gui-edge); }
.shell .route-option-card { background:var(--gui-sheet); border:1px solid var(--gui-edge); border-radius:18px; box-shadow:var(--gui-shadow); }
.shell .journey-result-heading { background:linear-gradient(169deg,transparent 65%,#ffffff38 65.4%),var(--section-banner); border-radius:22px; padding:14px; }
.shell .journey-result-heading :is(h1,.exp-eyebrow) { color:var(--section-ink); }
.shell .exp-result { background:var(--gui-sheet); box-shadow:var(--gui-shadow); border-radius:26px; }
.shell .exp-result .exp-result-rays { opacity:.12; }

/* Fit the decision; retain real scrolling for expanded details and large text. */
@media(max-width:600px) {
  .shell .exp-modal.modal-encounter:has(.encounter-system) { padding:14px; }
  .shell .encounter-system .encounter-content { grid-template-columns:84px minmax(0,1fr); gap:8px 10px; }
  .shell .encounter-system .exp-encounter-art { width:84px; height:112px; border-radius:16px; }
  .shell .encounter-system .gui-encounter-heading { padding:10px 28px 10px 10px; border-radius:16px; }
  .shell .encounter-system .gui-encounter-heading h2 { font-size:21px; }
  .shell .encounter-system .exp-party-card { min-height:82px; }
  .shell .encounter-system .exp-fighter-list { gap:6px; }
  .shell .amuse-catalogue { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .shell .amuse-catalogue article { gap:0; padding:0; }
  .shell .amuse-catalogue h3 { font-size:14px; }
  .shell .amuse-catalogue .amuse-illustration { height:46px; }
  .shell .amuse-catalogue summary { font-size:11px; }
  .shell .amuse-heading h1 { font-size:21px; }
  .shell .funhouse-heading { padding:10px; }
  .shell .funhouse-heading h1 { font-size:22px; }
  .shell .funhouse-table-scroll { flex-basis:330px; }
  .shell .funhouse-room > .funhouse-room-art { flex:0 0 88px; min-height:88px; height:88px; }
  .shell .funhouse-room-reading { padding:12px; }
  .shell .funhouse-room h1 { font-size:22px; margin-bottom:8px; }
  .shell .funhouse-room-choices .exp-button { padding:9px 10px; }
  .shell .funhouse-room-choices .funhouse-check-target { grid-column:2; grid-row:1; justify-self:end; }
}
@media(max-height:700px) and (orientation:portrait) {
  .shell .exp-modal:has([data-stop-heading],[data-stop-shop]) > .exp-location-art { flex-basis:48px; height:48px; min-height:48px; max-height:48px; }
  .gui-stop-heading { padding:10px 12px; gap:10px; }
  .shell .exp-screen-heading { padding:8px 10px; }
  .shell .encounter-system { max-height:calc(100dvh - 104px); }
  .shell .amusements { max-height:calc(100dvh - 110px); }
  .shell .amuse-heading { padding-block:8px; }
  .shell .amuse-reading > .amuse-instruction { font-size:12px; }
}
@media(min-width:850px) and (min-height:600px) {
  .shell .encounter-system .encounter-content { grid-template-columns:150px minmax(0,1fr); gap:12px 20px; }
  .shell .encounter-system .exp-encounter-art { width:150px; height:194px; grid-row:1/4; align-self:start; }
  .shell .encounter-system :is(.encounter-fighter-label,.exp-fighter-list,.fighter-readiness) { grid-column:2; }
  .shell .encounter-system .gui-encounter-heading { min-height:105px; }
  .shell .funhouse-table-scroll { flex-basis:360px; }
  .shell .funhouse-card { width:60px; height:86px; min-height:86px; }
}
@media(max-height:500px) and (orientation:landscape) {
  .shell .exp-modal.exp-illustrated:has([data-stop-heading],[data-stop-shop]) { flex-direction:row; width:min(900px,100%); height:auto; max-height:100%; }
  .shell .exp-modal:has([data-stop-heading],[data-stop-shop]) > .exp-location-art { flex:0 0 88px; width:88px; height:auto; min-height:0; max-height:none; align-self:stretch; }
  .shell .exp-modal:has([data-stop-heading],[data-stop-shop]) > .exp-dialog-body { flex:1 1 0; }
  .shell .exp-modal:has([data-stop-heading],[data-stop-shop]) > .exp-dialog-body { padding:10px 14px; }
  .gui-stop-heading { padding:8px 46px 8px 10px; gap:8px; }
  .shell .gui-stop-heading .exp-space-icon { width:36px; height:36px; }
  .shell .gui-stop-heading h2 { font-size:21px; }
  .shell .exp-modal.modal-camp > .exp-dialog-body { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px 10px; }
  .shell .modal-camp .gui-stop-heading,.shell .modal-camp .camp-party-preview,.shell .modal-camp .camp-sheet-footer,.shell .modal-camp .care-fallen { grid-column:1/-1; }
  .shell .exp-modal.modal-camp .camp-party-preview { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .shell .exp-modal.modal-camp .camp-party-preview > .camp-party-member { min-height:64px; padding:5px; gap:5px; }
  .shell .exp-modal.modal-camp .camp-party-member > img { width:24px; height:30px; flex-basis:24px; }
  .shell .exp-modal.modal-camp .camp-party-copy > strong { font-size:11px; }
  .shell .exp-modal.modal-camp .camp-party-copy > span:not(.camp-health-track) { font-size:10px; }
  .shell .exp-modal.modal-camp .camp-party-copy > span > b { font-size:10px; }
  .shell .exp-modal.modal-camp .camp-party-member[data-full-health=true] .camp-party-copy > span > b { display:inline; }
  .shell .modal-camp :is(.care-full,.journey-choice-note) { display:none; }
  .shell .exp-modal.modal-camp .camp-sheet-footer { width:100%; justify-content:start; grid-template-columns:44px minmax(0,1fr); }
  .shell .exp-modal.modal-well > .exp-dialog-body { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px 12px; }
  .shell .modal-well .gui-stop-heading { grid-column:1/-1; }
  .shell .modal-well .gui-facts { grid-column:1; grid-row:2; }
  .shell .modal-well .gui-note { grid-column:1; grid-row:3; }
  .shell .modal-well .journey-health-preview { grid-column:2; grid-row:2/4; }
  .shell .modal-well .gui-rules { grid-column:1; grid-row:4; }
  .shell .modal-well .exp-dialog-body > .primary { grid-column:2; grid-row:4; }
  .shell .exp-modal.modal-forge > .exp-dialog-body { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:8px 14px; }
  .shell .modal-forge .gui-stop-heading { grid-column:1; grid-row:1; }
  .shell .modal-forge .gui-facts { grid-column:1; grid-row:2; }
  .shell .modal-forge .gui-note { grid-column:1; grid-row:3; }
  .shell .modal-forge .exp-forge-heroes { grid-column:2; grid-row:1/5; }
  .shell .exp-modal.modal-forge .exp-forge-heroes .exp-button { grid-template-columns:minmax(0,1fr) auto; padding:7px 8px; }
  .shell .modal-forge .gui-forge-avatar { display:none; }
  .shell .modal-forge .exp-dialog-body > .exp-link { grid-column:1; grid-row:4; }
  .shell .exp-modal.modal-encounter:has(.encounter-system) { width:min(850px,100%); padding:12px; }
  .shell .encounter-system { max-height:calc(100dvh - 90px); gap:8px; }
  .shell .encounter-system .encounter-content { grid-template-columns:76px minmax(0,.9fr) minmax(0,1.1fr); gap:6px 12px; }
  .shell .encounter-system .exp-encounter-art { grid-column:1; grid-row:1/3; width:76px; height:100px; }
  .shell .encounter-system .gui-encounter-heading { grid-column:2; grid-row:1/3; padding:10px; align-self:stretch; }
  .shell .encounter-system .gui-encounter-heading h2 { font-size:20px; }
  .shell .encounter-system .encounter-fighter-label { grid-column:3; grid-row:1; padding-right:40px; }
  .shell .encounter-system .exp-fighter-list { grid-column:3; grid-row:2; }
  .shell .encounter-system .exp-party-card { min-height:76px; padding:5px 3px; }
  .shell .encounter-system .exp-party-image { width:24px; height:28px; }
  .shell .encounter-system .exp-party-copy strong { font-size:11px; }
  .shell .encounter-system .encounter-preparation { grid-column:1/-1; grid-row:3; }
  .shell .encounter-system .fighter-readiness { grid-column:1/-1; grid-row:auto; }
  .shell .amuse-catalogue { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .shell .amuse-catalogue .amuse-illustration { height:44px; }
  .shell .amuse-heading { padding:6px 40px 6px 10px; }
  .shell .amuse-heading h1 { font-size:19px; margin-bottom:4px; }
  .shell .amuse-catalogue [data-amuse-launch]:has(img.amuse-illustration) { min-height:92px!important; }
  .shell .amuse-catalogue [data-amuse-launch] .amuse-illustration { height:34px; }
  .shell .amuse-active-banner { display:none; }
  .shell .amuse-choose { display:grid; grid-template-columns:160px minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; gap:8px 12px; }
  .shell .amuse-choose .amuse-heading { grid-column:1; grid-row:1; align-self:stretch; padding:46px 12px 12px; }
  .shell .amuse-choose .amuse-reading { grid-column:2; grid-row:1; }
  .shell .amuse-choose .amuse-footer { grid-column:1/-1; grid-row:2; }
  .shell .modal-amusements:has(.amuse-choose) > .exp-icon-button:first-child { left:12px; right:auto; }
  .shell .funhouse-room-reading { padding:12px 16px; }
  .shell .funhouse-room-choices .exp-button { padding:8px 10px; }
}

/* One-shot arrival and immediate tactile feedback. Never gate a legal action. */
@media(prefers-reduced-motion:no-preference) {
  html:not(.calm-motion) body:not(.calm-motion) .shell :is(.exp-button,.exp-icon-button,.home-destination,.exp-choice,.exp-relic-choice,.event-hero-option,.amuse-control) { transition:background-color 160ms ease,box-shadow 160ms ease,border-color 160ms ease,translate 160ms var(--pm-ui-ease); }
  html:not(.calm-motion) body:not(.calm-motion) .shell :is(.exp-button,.home-destination,.amuse-control):active:not(:disabled) { translate:0 1px; }
  html:not(.calm-motion) body:not(.calm-motion) .gui-stop-heading { animation:gui-ribbon-arrive 260ms var(--pm-ui-ease) both; }
  html:not(.calm-motion) body:not(.calm-motion) .exp-modal.modal-encounter .shell .encounter-system .gui-encounter-heading { animation:gui-ribbon-arrive 260ms var(--pm-ui-ease) both; }
}
@media(hover:hover) and (pointer:fine) {
  .shell :is(.home-destination,.exp-button.secondary,.event-hero-option):hover:not(:disabled) { box-shadow:0 5px 16px var(--pm-ui-shadow),inset 0 0 0 1px var(--gui-edge); }
}
@keyframes gui-ribbon-arrive { from{opacity:.3;translate:0 6px} to{opacity:1;translate:0 0} }
@media(prefers-reduced-motion:reduce) { .shell :is(.gui-stop-heading,.gui-encounter-heading,.amuse-control) { animation:none!important; transition:none!important; } }
.calm-motion .shell :is(.gui-stop-heading,.gui-encounter-heading,.amuse-control),.shell .calm-motion :is(.gui-stop-heading,.gui-encounter-heading,.amuse-control) { animation:none!important; transition:none!important; }
:root.strong-contrast .shell :is(.gui-stop-heading,.gui-encounter-heading,.funhouse-heading,.amuse-heading,.journey-result-heading) { background:var(--pm-ui-surface); color:var(--pm-ui-text); border:1px solid var(--pm-ui-line); }
:root.strong-contrast .shell :is(.gui-stop-heading,.gui-encounter-heading,.funhouse-heading,.amuse-heading,.journey-result-heading) :is(h1,h2,p,span,small) { color:var(--pm-ui-text)!important; }

/* Game-wide sheet: one scroll body, pinned footer actions ≥44px. */
.shell .exp-modal:not(.modal-reward):not(.modal-shopPack):not(.modal-maw-unlock) {
  max-height: min(720px, calc(100dvh - max(16px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom))));
  overflow: hidden;
}
.shell .exp-modal > .exp-dialog-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.shell .exp-modal > :is(.exp-dialog-actions,.exp-screen-footer,.amuse-footer,.discovery-journal-footer) {
  flex: 0 0 auto;
  gap: 10px;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
}
.shell .exp-modal > :is(.exp-dialog-actions,.exp-screen-footer,.amuse-footer) .exp-button {
  min-height: max(44px, var(--pm-ui-target-secondary, 44px));
}
.shell .home-system,
.shell .permanent-binder,
.shell .exploration-system {
  overflow-x: hidden;
}

