/* Short screens give the task the space between its title and the frame. */
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-overlay>.game-window:not(.game-team):not(.game-classic){inset:8px;transform:none;margin:0;max-width:none;max-height:none;min-height:0;width:auto;height:auto}
 body.game-mode .game-window:not(.game-team):not(.game-classic)>.game-window__heading{flex:none;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;min-height:60px;padding:8px 10px}
 body.game-mode .game-window:not(.game-team):not(.game-classic)>.game-window__heading h1{font:600 26px/1.1 Pixelify,monospace;margin:0;overflow-wrap:anywhere}
 body.game-mode .game-window:not(.game-team):not(.game-classic)>.game-window__heading p{font:400 14px/1.3 var(--body);margin:3px 0 0}
 body.game-mode .game-window:not(.game-team):not(.game-classic)>.game-window__heading .game-window__close{min-height:44px;min-width:120px;max-width:160px;padding:6px 10px;font:600 14px/1.25 var(--body);white-space:normal}
 body.game-mode .game-window:not(.game-team):not(.game-classic)>.game-window__body{min-height:0;flex:1;overflow:auto;padding:8px 10px;scroll-padding:8px}
 body.game-mode .modal{max-height:calc(100dvh - 16px);padding:10px}
 body.game-mode .modal>.modal-heading{position:sticky;top:-10px;z-index:2;min-height:52px;align-items:center;margin:-2px -2px 10px;padding:4px 2px 8px;gap:8px}
 body.game-mode .modal>.modal-heading h2{font:600 26px/1.1 Pixelify,monospace;margin:0}
 body.game-mode .modal>.modal-heading .icon-button{min-width:44px;min-height:44px}
 body.game-mode .modal>.modal-lead{margin:6px 0 10px;font-size:14px;line-height:1.4}
 body.game-mode .modal .supply-fine{margin:8px 0;font-size:14px;line-height:1.4}
}

/* Keep the whole crest trail inside the frame. */
body.game-mode .game-challenges .crest-progress{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;padding:10px 6px;min-width:0;max-width:100%}
body.game-mode .game-challenges .crest-stop{min-width:0;display:flex;align-items:center;flex-direction:column;gap:5px}
body.game-mode .game-challenges .crest-stop .crest{width:32px;height:32px;margin:0}
body.game-mode .game-challenges .crest-stop small{max-width:100%;font-size:11px;white-space:normal;overflow-wrap:anywhere;text-align:center}
/* An equipped move stays readable for comparison even while its action is disabled. */
body.game-mode .modal .learned-move:disabled{opacity:1;filter:none;background:#283448;border-color:#7e94a4;color:#e7eef1}
body.game-mode .modal .learned-move:disabled :is(strong,small,.move-facts,p){opacity:1;color:#dce7ed}
body.game-mode .modal .learned-move:disabled strong{color:#ffe2a7}
body.game-mode .modal .settings-save{margin-top:0}
body.game-mode .modal .settings-save>p{line-height:1.4;margin:8px 0}
body.game-mode .modal .settings-save>details{margin-top:6px}
body.game-mode .modal .settings-save>details>summary,body.game-mode .training-help>summary{min-height:44px;display:flex;align-items:center;color:#ffdb96;font:600 14px/1.3 var(--body);cursor:pointer}
body.game-mode .training-budget{display:flex;flex-wrap:wrap;gap:6px 14px;margin:8px 0;color:#e9ede7}
body.game-mode .training-lock{padding:8px;border-left:3px solid #eac482;background:#2c3b4f}
body.game-mode .game-storage:has(.roster-console--detail) .roster-console__header{display:none}
body.game-mode .game-storage:has(.roster-console--detail) .roster-detail{padding-top:0}
body.game-mode .game-storage:has(.roster-console--detail) .roster-detail__backbar{min-height:44px;margin-bottom:8px}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-storage .storage-console{padding:0;min-height:0}
 body.game-mode .game-storage .roster-console__header{padding:0 0 6px}
 body.game-mode .game-storage .roster-console__navigation{padding:0;gap:8px;min-height:44px;display:flex;align-items:center}
 body.game-mode .game-storage .roster-tabs{gap:6px}
 body.game-mode .game-storage .roster-tabs>button{min-height:44px;padding:4px 8px;font-size:20px}
 body.game-mode .game-storage .roster-console__summary p{font-size:14px;line-height:1.3;margin:4px 0 0}
 body.game-mode .game-storage .storage-controls{grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr);gap:6px;padding:6px}
 body.game-mode .game-storage .storage-controls label>span{font-size:12px;line-height:1.2;margin-bottom:2px}
 body.game-mode .game-storage .storage-controls :is(input,select){min-height:44px;padding:5px;font-size:14px}
 body.game-mode .game-storage .storage-result-heading{margin:6px 0;gap:6px}
 body.game-mode .game-storage .storage-result-heading h2{font-size:20px;margin:0}
 body.game-mode .game-storage .storage-result-heading>span{font-size:12px}
 body.game-mode .game-storage .storage-list{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
 body.game-mode .game-storage .reserve-card{min-height:144px;padding:5px;gap:2px}
 body.game-mode .game-storage .reserve-card>.sprite{height:40px;width:44px;margin:0}
 body.game-mode .game-storage .reserve-card .roster-row__name strong{font-size:20px}
 body.game-mode .game-storage .roster-row__health{gap:2px}
 body.game-mode .game-storage .roster-row__species,body.game-mode .game-storage .roster-row__location{font-size:12px;line-height:1.2}
 body.game-mode .game-collection .guide-console{padding:0}
 body.game-mode .game-collection .page-heading{padding:0 0 6px;margin:0 0 6px;gap:6px}
 body.game-mode .game-collection .page-heading h1{font-size:24px;line-height:1.1}
 body.game-mode .game-collection .page-heading p{font-size:14px;line-height:1.3;margin-top:3px}
 body.game-mode .game-collection .management-links{margin:0 0 6px}
 body.game-mode .game-collection .management-links .button{padding:4px 8px;min-height:44px;font-size:14px}
 body.game-mode .game-collection .collection-toolbar{grid-template-columns:auto minmax(0,1fr) minmax(90px,.6fr);padding:6px;gap:6px;margin-bottom:8px}
 body.game-mode .game-collection .collection-toolbar :is(input,select){min-height:44px;font-size:14px;min-width:0;padding:5px}
 body.game-mode .game-collection .collection-toolbar .segmented button{min-height:44px;padding:5px 8px;font-size:13px}
 body.game-mode .game-collection .dex-grid,body.game-mode .game-collection .dex-grid.compact{grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}
 body.game-mode .game-collection .dex-card{min-height:94px;padding:18px 3px 5px;gap:3px}
 body.game-mode .game-collection .dex-card>.sprite{height:40px;width:40px}
 body.game-mode .game-collection .dex-card strong{font-size:13px;line-height:1.1}
 body.game-mode .roster-console--detail .roster-sheet{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:8px 12px}
 body.game-mode .roster-console--detail .roster-sheet>*{min-width:0;grid-column:1/-1}
 body.game-mode .roster-console--detail .roster-identity{grid-column:1;grid-row:1;margin:0;gap:8px;align-items:center}
 body.game-mode .roster-console--detail .roster-identity>.sprite{width:64px;height:76px;flex-basis:64px}
 body.game-mode .roster-console--detail .roster-identity h2{font-size:26px;margin:2px 0}
 body.game-mode .roster-console--detail .roster-identity p{font-size:12px;margin:3px 0}
 body.game-mode .roster-console--detail .roster-vitals{grid-column:1;grid-row:2;margin:0}
 body.game-mode .roster-console--detail .roster-detail__party-actions{grid-column:2;grid-row:1;display:flex;flex-wrap:wrap;gap:6px;margin:0;align-self:center}
 body.game-mode .roster-console--detail .roster-detail__party-actions>.button{flex:1;min-height:44px;font-size:14px;padding:6px}
 body.game-mode .roster-console--detail .roster-action-reason{grid-column:2;grid-row:2;font-size:14px;line-height:1.3;margin:0}
 body.game-mode .roster-console--detail .roster-detail__order{grid-column:2;grid-row:2;margin:0;gap:4px}
 body.game-mode .roster-console--detail .roster-detail__order .text-button{min-height:44px;font-size:13px;padding:4px}
 body.game-mode .roster-console--detail .roster-detail__tools{grid-column:1/-1;grid-row:3;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:0}
 body.game-mode .roster-console--detail .roster-detail__tools>.button{min-height:44px;padding:5px;font-size:14px}
 body.game-mode .roster-console--detail .roster-sheet:has(.roster-action-reason) .roster-detail__order{grid-column:1/-1;grid-row:4}
 body.game-mode .game-adventure-menu .adventure-recommendation{margin:0 0 8px;padding:8px;font:400 14px/1.3 var(--body)}
 body.game-mode .game-adventure-menu .adventure-options{gap:8px}
 body.game-mode .game-adventure-menu .adventure-options>button{min-height:112px;padding:8px 28px 8px 10px;display:grid;grid-template-columns:24px minmax(0,1fr);gap:4px 8px;text-align:left;align-content:start}
 body.game-mode .game-adventure-menu .adventure-options>button>span{font-size:22px;margin:0;grid-column:1;grid-row:1/4}
 body.game-mode .game-adventure-menu .adventure-options>button>strong{font-size:24px;margin:0;grid-column:2}
 body.game-mode .game-adventure-menu .adventure-options>button>p{font-size:14px;line-height:1.3;margin:0;grid-column:2}
 body.game-mode .game-adventure-menu .adventure-options>button>small{font-size:12px;line-height:1.3;margin:0;grid-column:2}
 body.game-mode .game-adventure-menu .adventure-advanced>summary{min-height:44px;font-size:14px}
 body.game-mode .modal .settings-save{padding:10px}
 body.game-mode .modal .settings-save>strong{font-size:24px}
 body.game-mode .modal .settings-save>div{gap:6px}
 body.game-mode .modal .settings-save>div>.button{min-height:44px;padding:6px 10px}
 body.game-mode .modal .held-item-card{padding:8px}
 body.game-mode .modal .held-item-card h3{font-size:22px;margin:2px 0}
 body.game-mode .modal .held-item-card p{font-size:14px;line-height:1.3;margin:4px 0}
 body.game-mode .modal .held-item-card .button{min-height:44px;padding:6px}
 body.game-mode .modal .ev-training-grid{gap:8px;margin:8px 0}
 body.game-mode .modal .ev-training-grid>div{padding:8px;min-height:100px}
}

/* Keep the task and first choice visible on short landscape screens. */
body.game-mode .game-storage .roster-console--from-list .roster-detail__backbar{display:none}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-storage .storage-controls .storage-search{grid-column:auto}
 body.game-mode .game-storage .storage-master{padding:0 6px 16px}
 body.game-mode .game-storage .storage-controls{margin-bottom:4px}
 body.game-mode .game-collection .guide-console:not(.guide--detail){display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px}
 body.game-mode .game-collection .guide-console:not(.guide--detail)>.page-heading{grid-column:1;margin:0;padding:0;min-width:0}
 body.game-mode .game-collection .guide-console:not(.guide--detail)>.management-links{grid-column:2;margin:0;display:flex;gap:6px}
 body.game-mode .game-collection .guide-console:not(.guide--detail)>.collection-toolbar{grid-column:1/-1;margin:0;grid-template-columns:auto minmax(0,1fr) minmax(90px,.6fr)}
 body.game-mode .game-collection .collection-toolbar .segmented{grid-column:auto;min-width:0}
 body.game-mode .game-collection .guide-console:not(.guide--detail)>.dex-layout{grid-column:1/-1}
 body.game-mode .game-collection .page-heading h1{font-family:Pixelify,monospace}
 body.game-mode .game-collection .collection-total{display:none}
 body.game-mode .roster-console--detail .roster-identity{padding:6px;min-height:0}
 body.game-mode .roster-console--detail .roster-identity>.sprite{width:64px;height:64px;flex-basis:64px}
 body.game-mode .roster-console--detail .roster-identity__name h2{font:600 26px/1.05 Pixelify,monospace}
 body.game-mode .roster-console--detail .roster-identity .eyebrow{font-size:11px}
 body.game-mode .roster-console--detail .roster-identity .detail-tags{margin:3px 0 0}
 body.game-mode .modal .training-budget{padding:6px 8px;min-height:0;margin:6px 0}
 body.game-mode .modal .training-budget strong{font:600 22px/1 Pixelify,monospace}
 body.game-mode .modal .training-budget>span{font-size:14px;line-height:1.3}
 body.game-mode .modal .ev-training-grid{grid-template-columns:repeat(3,minmax(0,1fr));margin:6px 0;gap:6px}
 body.game-mode .modal .ev-training-grid>div{padding:6px;min-height:0}
 body.game-mode .modal .ev-training-grid>div>strong{font-size:22px;line-height:1.1;margin:3px 0}
 body.game-mode .modal .ev-training-grid .button{min-height:44px;padding:6px}
}

body.game-mode .encounter-save-note{color:#cbdce6;font:400 14px/1.4 var(--body);margin:8px 0}
@media(max-width:650px){
 body.game-mode :is(.game-trail-event,.game-journey) .encounter-console{gap:12px}
 body.game-mode :is(.game-trail-event,.game-journey) .encounter-story{display:flow-root;min-width:0}
 body.game-mode :is(.game-trail-event,.game-journey) .encounter-illustration{float:right;width:64px;height:72px;margin:0 0 6px 10px}
 body.game-mode :is(.game-trail-event,.game-journey) .encounter-illustration .encounter-creature{width:64px;height:64px;bottom:0}
 body.game-mode :is(.game-trail-event,.game-journey) .encounter-mark{font-size:13px;right:2px;top:2px}
 body.game-mode :is(.game-trail-event,.game-journey) .encounter-intro{padding:0}
 body.game-mode :is(.game-trail-event,.game-journey) .encounter-intro h2{font-size:26px;line-height:1.1;margin:6px 0}
 body.game-mode :is(.game-trail-event,.game-journey) .encounter-intro p{font-size:14px;line-height:1.4;margin:8px 0 0}
 body.game-mode :is(.game-trail-event,.game-journey) .encounter-choice{padding:10px;gap:6px}
 body.game-mode :is(.game-trail-event,.game-journey) .encounter-choice__body>strong{font-size:24px}
 body.game-mode :is(.game-trail-event,.game-journey) .encounter-choice__body>span{line-height:1.4}
 body.game-mode :is(.game-trail-event,.game-journey) .encounter-choice__cost{line-height:1.35}
}

@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-storage .roster-console__summary{display:none}
 body.game-mode .game-storage .storage-list{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.game-mode .game-storage .reserve-card{display:grid;grid-template-columns:44px minmax(0,1fr);min-height:96px;padding:5px 7px;gap:6px;text-align:left;align-items:center}
 body.game-mode .game-storage .reserve-card>.sprite{grid-column:1;grid-row:1;width:44px;height:44px}
 body.game-mode .game-storage .reserve-card .roster-row__slot{left:3px;top:3px;font-size:12px}
 body.game-mode .game-storage .reserve-card .roster-row__main{grid-column:2;gap:2px}
 body.game-mode .game-storage .reserve-card .roster-row__name strong{font-size:22px}
 body.game-mode .game-storage .reserve-card .roster-row__health{margin:2px 0}
 body.game-mode .game-storage .reserve-card .roster-row__health>span{font-size:13px}
}

body.game-mode .storage-party-shortcut{display:none}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-overlay>.game-window.game-storage:has(.storage-party-shortcut)>.game-window__heading{grid-template-columns:minmax(0,1fr) auto auto}
 body.game-mode .game-storage .storage-party-shortcut{display:inline-flex;min-height:44px;padding:6px 10px;font:600 14px/1.25 var(--body)}
 body.game-mode .game-storage:has(.storage-party-shortcut) .roster-console__header{display:none}
}
@media(max-width:650px) and (max-height:650px){
 body.game-mode .game-overlay>:is(.game-trail-event,.game-journey){top:8px;bottom:8px;left:8px;right:8px;width:auto;transform:none;max-height:none}
}

body.game-mode .game-survival .survival-console>h2{font-size:26px;margin:4px 0 8px}
body.game-mode .game-survival .survival-next{padding:8px;margin:8px 0;gap:8px;min-height:0}
body.game-mode .game-survival .survival-next>.sprite{width:48px;height:48px;flex-basis:48px}
body.game-mode .game-survival .survival-next strong{font-size:23px}
body.game-mode .game-survival .survival-plan{padding:10px;margin:8px 0}
body.game-mode .game-survival .survival-plan p{font-size:14px;line-height:1.4;margin:6px 0}
body.game-mode .game-survival .survival-plan>.button{min-height:44px;margin-top:4px}
body.game-mode .game-survival .survival-plan>.text-button{min-height:44px}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-survival .survival-console{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:6px 12px}
 body.game-mode .game-survival .survival-console>*{grid-column:1/-1}
 body.game-mode .game-survival .survival-console>.depth-eyebrow{grid-column:1;grid-row:1}
 body.game-mode .game-survival .survival-console>h2{grid-column:1;grid-row:2;margin:0;font-size:24px}
 body.game-mode .game-survival .survival-next{grid-column:1;grid-row:3;margin:0;align-self:start}
 body.game-mode .game-survival .survival-plan{grid-column:2;grid-row:1/4;margin:0}
}

/* QA-only proposal: task availability precedes optional explanations. */
body.game-mode .game-research .research-section-nav>a{transition:background-color .12s,border-color .12s}
body.game-mode .game-research[data-research-pane="projects"] .research-section-nav>a:first-child,
body.game-mode .game-research[data-research-pane="mastery"] .research-section-nav>a[href="#research-mastery"],
body.game-mode .game-research[data-research-pane="hunts"] .research-section-nav>a[href="#research-hunts"]{border-color:#ffe3a5;background:linear-gradient(130deg,#735d36,#405161);color:#fff1c4;box-shadow:inset 0 -3px #1c2b3b}
body.game-mode .game-research .research-group-heading{font:600 25px/1.2 Pixelify,monospace;margin:0 0 10px;color:#fff1d2}
body.game-mode .game-research .research-project-group+.research-project-group,
body.game-mode .game-research .research-family-projects{border-top:2px solid #497b80;margin-top:22px;padding-top:18px}
body.game-mode .game-research .research-family-projects>p{margin:0 0 12px}
body.game-mode .game-research .research-contract[data-state=available]{gap:8px}
body.game-mode .game-research .research-contract[data-state=available] .research-contract__reward{padding:8px 10px}
body.game-mode .game-research .research-family-hud{align-items:center}
body.game-mode .game-research .research-family-hud>.sprite,
body.game-mode .game-research .hunt-target-plate>.sprite{background:radial-gradient(ellipse at 50% 85%,#83c7b632 0 32%,transparent 34%),linear-gradient(135deg,#244553,#172c3e);border:1px solid #689b9e;box-sizing:border-box;image-rendering:pixelated;object-fit:contain;padding:4px}
body.game-mode .game-research .research-family-hud .mastery-next-goal{color:#ffe2a7;font-weight:600;font-size:13px;line-height:1.5}
body.game-mode .game-research .hunt-target-plate{display:flex;gap:12px;align-items:center;min-width:0}
body.game-mode .game-research .hunt-target-plate>.sprite{width:70px;height:80px;flex:0 0 70px}
body.game-mode .game-research .hunt-target-plate>div{min-width:0}
body.game-mode .game-research .hunt-target-plate h3{font-size:26px;line-height:1.15;margin:4px 0 0;overflow-wrap:anywhere}
body.game-mode .game-research .hunt-target-plate p{margin:7px 0 0}
body.game-mode .game-research .hunt-project-return{display:flex;align-items:center;justify-content:center;min-height:44px;box-sizing:border-box;padding:8px 10px;border:2px solid #f6d38d;color:#ffe6ad;text-decoration:none;font:700 14px/1.4 var(--body);background:#364354}
body.game-mode .game-research .hunt-encounter-rules{border-top:1px solid #6d969a;margin:2px 0 0;padding-top:3px}
body.game-mode .game-research .hunt-encounter-rules summary{padding:8px 0;min-height:44px}
body.game-mode .game-research .hunt-encounter-rules p{padding:4px 0 8px}
body.game-mode .game-workshop .creature-builds-console>.workshop-brief{padding:0 0 8px;border-bottom:0}
body.game-mode .game-workshop .workshop-brief>p{margin:0;color:#d4e3e6}
body.game-mode .game-workshop .creature-builds-console>label{margin:8px 0 12px}
body.game-mode .game-workshop .workshop-profile{padding:10px;gap:14px;min-height:112px}
body.game-mode .game-workshop .workshop-profile .sprite{background:radial-gradient(ellipse at 50% 85%,#83c7b632 0 32%,transparent 34%),linear-gradient(135deg,#244553,#172c3e);border:1px solid #689b9e;box-sizing:border-box;object-fit:contain;padding:4px;width:84px;height:88px;flex-basis:84px}
body.game-mode .game-workshop .workshop-profile p{margin:4px 0}
body.game-mode .game-workshop .workshop-profile h3{margin:2px 0 5px}
body.game-mode .game-workshop .workshop-availability{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0 18px}
body.game-mode .game-workshop .workshop-availability>a,
body.game-mode .game-workshop .workshop-availability>div{position:relative;display:flex;flex-direction:column;justify-content:center;gap:4px;min-width:0;min-height:72px;box-sizing:border-box;padding:10px 28px 10px 12px;border:2px solid #719e9f;background:linear-gradient(130deg,#2f4e61,#233448);text-decoration:none;color:#e5ece1;overflow-wrap:anywhere}
body.game-mode .game-workshop .workshop-availability .ready{border-color:#f6d38d;background:linear-gradient(130deg,#65583a,#304459)}
body.game-mode .game-workshop .workshop-availability strong{font:600 24px/1.15 Pixelify,monospace;color:#fff1ce}
body.game-mode .game-workshop .workshop-availability span{font:500 13px/1.4 var(--body);color:#d1e4df}
body.game-mode .game-workshop .workshop-availability b{position:absolute;right:10px;top:12px;color:#ffdda2;font:700 20px/1 var(--body)}
body.game-mode .game-workshop .workshop-availability>a:focus-visible,
body.game-mode .game-research .hunt-project-return:focus-visible{outline:3px solid #ffdc8c;outline-offset:3px}
body.game-mode .game-workshop #workshop-techniques,
body.game-mode .game-workshop #workshop-final-form{scroll-margin-top:12px}
body.game-mode .game-workshop .workshop-passive{margin-top:18px;padding-top:8px;border-top:1px solid #5e9394}
body.game-mode .game-chronicle .journey-current__art{border:1px solid #7ba4a0;background:radial-gradient(ellipse at 50% 85%,#83c7b632 0 32%,transparent 34%),linear-gradient(135deg,#3e5356,#1d3345);box-shadow:inset 0 0 0 3px #182f3e}
@media(max-width:700px){
 body.game-mode .game-research .research-mastery{padding-top:10px}
 body.game-mode .game-research .research-mastery>.rpg-progress-heading{margin-top:0}
 body.game-mode .game-research .research-family-hud{gap:10px;padding:10px;margin:12px 0}
 body.game-mode .game-research .research-family-hud>.sprite{width:68px;height:78px;flex-basis:68px}
 body.game-mode .game-workshop .workshop-profile{padding:10px;gap:10px;min-height:104px}
 body.game-mode .game-workshop .workshop-profile .sprite{width:68px;height:78px;flex-basis:68px}
 body.game-mode .game-workshop .workshop-profile h3{font-size:28px}
 body.game-mode .game-workshop .workshop-profile__level{font-size:12px;line-height:1.4}
 body.game-mode .game-workshop .workshop-profile p{font-size:12px;line-height:1.4;margin:3px 0}
 body.game-mode .game-workshop .workshop-availability{grid-template-columns:1fr;gap:8px;margin:10px 0 14px}
 body.game-mode .game-workshop .workshop-availability>a,
 body.game-mode .game-workshop .workshop-availability>div{min-height:68px;padding:9px 28px 9px 11px}
 body.game-mode .game-workshop .workshop-availability strong{font-size:23px}
 body.game-mode .game-research .research-contract[data-state=available]{padding:11px;gap:7px}
 body.game-mode .game-research .research-contract[data-state=available] .research-state{margin-bottom:2px;font-size:11px}
 body.game-mode .game-research .research-contract[data-state=available] h3{font-size:26px}
 body.game-mode .game-research .research-contract[data-state=available] .research-contract__reward{padding:7px 9px;gap:2px}
 body.game-mode .game-research .research-contract[data-state=available] .research-contract__reward>span{font-size:10px}
 body.game-mode .game-research .research-contract[data-state=available] .research-contract__reward>strong{font-size:13px}
}
@media(max-width:360px){
 body.game-mode .game-research .research-section-nav{margin-bottom:8px;padding:6px 0}
 body.game-mode .game-research .research-projects>.rpg-progress-heading h2{margin:0 0 8px}
 body.game-mode .game-research .research-intro{margin:4px 0 8px}
 body.game-mode .game-workshop .creature-builds-console>.workshop-brief{padding-bottom:4px}
 body.game-mode .game-workshop .workshop-availability strong{font-size:20px;line-height:1.2}
}
@media(max-height:500px) and (min-width:480px){
 body.game-mode .game-research .research-console{grid-template-columns:minmax(0,1fr)}
 body.game-mode .game-research .research-section-nav{top:-8px;gap:7px;padding:0 0 5px;margin:0 0 7px}
 body.game-mode .game-research .research-section-nav>a{min-height:44px;font-size:20px;padding:7px}
 body.game-mode .game-research .research-projects{display:grid;grid-template-columns:auto 1fr;align-items:center;align-content:start;column-gap:12px}
 body.game-mode .game-research .research-projects>.rpg-progress-heading h2{font-size:26px;gap:8px;margin:0}
 body.game-mode .game-research .research-projects>.rpg-progress-heading h2 small{font-size:12px;padding:3px 5px}
 body.game-mode .game-research .research-intro{font-size:13px;line-height:1.4;margin:0}
 body.game-mode .game-research .research-projects>:not(.rpg-progress-heading,.research-intro){grid-column:1/-1}
 body.game-mode .game-research .research-project-list{margin-top:8px;gap:10px}
 body.game-mode .game-research .research-contract[data-state=available]{display:grid;grid-template-columns:minmax(0,1fr) minmax(170px,.8fr);padding:6px 8px;gap:4px 10px;align-items:stretch}
 body.game-mode .game-research .research-contract[data-state=available] .research-contract__heading{grid-column:1;grid-row:1}
 body.game-mode .game-research .research-contract[data-state=available]>p{grid-column:1;grid-row:2/4;font-size:13px;line-height:1.4}
 body.game-mode .game-research .research-contract[data-state=available] .research-contract__reward{grid-column:2;grid-row:1;padding:4px 6px;gap:2px}
 body.game-mode .game-research .research-contract[data-state=available] .research-contract__reward>span{font-size:10px;line-height:12px}
 body.game-mode .game-research .research-contract[data-state=available] .research-contract__reward>strong{font-size:12px;line-height:1.35}
 body.game-mode .game-research .research-contract[data-state=available]>.button{grid-column:2;grid-row:2/4;min-height:46px;padding:8px;margin:0}
 body.game-mode .game-workshop .creature-builds-console{display:grid;grid-template-columns:minmax(160px,.8fr) minmax(0,1.2fr);gap:8px 12px;align-items:center}
 body.game-mode .game-workshop .creature-builds-console>.workshop-brief{grid-column:1;padding:0}
 body.game-mode .game-workshop .workshop-brief>p{font-size:13px;line-height:1.4}
 body.game-mode .game-workshop .creature-builds-console>label{grid-column:1;margin:0;gap:4px}
 body.game-mode .game-workshop .workshop-profile{grid-column:2;grid-row:1/3;padding:8px;gap:8px;min-height:104px}
 body.game-mode .game-workshop .workshop-profile .sprite{width:62px;height:76px;flex-basis:62px}
 body.game-mode .game-workshop .workshop-profile h3{font-size:27px}
 body.game-mode .game-workshop .workshop-profile__level{font-size:12px}
 body.game-mode .game-workshop .workshop-profile p{font-size:12px}
 body.game-mode .game-workshop .creature-builds-console>:not(.workshop-brief,label,.workshop-profile){grid-column:1/-1}
 body.game-mode .game-workshop .workshop-availability{grid-template-columns:1fr 1fr;margin:0 0 8px;gap:8px}
 body.game-mode .game-workshop .workshop-availability>a,body.game-mode .game-workshop .workshop-availability>div{min-height:72px}
 body.game-mode .game-workshop .workshop-availability strong{font-size:22px}
}

/* Pause and Help keep their complete heading outside the scrolling text. */
body.game-mode .modal:is([data-modal=pause],[data-modal=help]){display:flex;flex-direction:column;overflow:hidden;padding:0;max-height:calc(var(--game-visible-height,100dvh) - 24px);min-height:0;scroll-padding:0}
body.game-mode .modal[data-modal=pause]{width:min(520px,calc(100vw - 24px))}
body.game-mode .modal:is([data-modal=pause],[data-modal=help])>.modal-heading{position:relative;top:auto;flex:0 0 auto;margin:0;min-height:64px;padding:10px 14px;align-items:center;z-index:2}
body.game-mode .modal:is([data-modal=pause],[data-modal=help])>.modal-heading h2{margin:0;font:600 29px/1.1 Pixelify,monospace}
body.game-mode .modal:is([data-modal=pause],[data-modal=help])>.modal-heading>.icon-button{width:44px;min-width:44px;height:44px;min-height:44px;flex:0 0 44px}
body.game-mode .modal>.modal-body{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-color:#90c8bc #1b2e40;scrollbar-width:thin;padding:12px 14px;scroll-padding:8px;isolation:isolate}
body.game-mode .modal>.modal-body>.modal-lead{font:400 14px/1.5 var(--body);color:#d8e5ec;margin:0 0 12px}
body.game-mode .modal[data-modal=pause] .pause-menu{gap:10px;align-items:stretch;justify-content:flex-start}
body.game-mode .modal[data-modal=pause] .pause-menu__group{align-content:start;grid-auto-rows:max-content;flex:0 0 auto;gap:8px;margin:0;padding:10px 0 0}
body.game-mode .modal[data-modal=pause] .pause-menu__group:first-child{padding:0;border-top:0}
body.game-mode .modal[data-modal=pause] .pause-menu__group>h3{font-size:23px;line-height:1.15;margin:0 0 2px}
body.game-mode .modal[data-modal=pause] .pause-menu__group>button{min-height:46px;height:auto;padding:9px 11px;flex:none;align-content:center;align-items:center;line-height:1.4}
body.game-mode .modal[data-modal=pause] .pause-menu__group .pause-menu__resume{min-height:48px;height:auto;font-size:24px;line-height:1.1}
body.game-mode .modal[data-modal=pause] .pause-menu__more{flex:none}
body.game-mode .modal[data-modal=pause] .pause-menu__more>summary{min-height:48px;box-sizing:border-box;padding:9px 0;margin:0;line-height:1.4}
body.game-mode .modal[data-modal=pause] .pause-controls{font-size:12px;line-height:1.5;margin:12px 0 0;padding:8px 0 0;letter-spacing:0;border-top:1px solid #617e8f}
body.game-mode .modal[data-modal=help] .help-more{scroll-margin-top:8px}
body.game-mode .modal[data-modal=help] .help-more>summary{min-height:48px;line-height:1.5;padding:8px 0}
@media(max-height:500px) and (min-width:480px){
 body.game-mode .modal:is([data-modal=pause],[data-modal=help]){max-height:calc(var(--game-visible-height,100dvh) - 16px)}
 body.game-mode .modal[data-modal=pause]{width:min(720px,calc(100vw - 24px))}
 body.game-mode .modal:is([data-modal=pause],[data-modal=help])>.modal-heading{min-height:60px;padding:7px 12px}
 body.game-mode .modal:is([data-modal=pause],[data-modal=help])>.modal-heading h2{font-size:26px}
 body.game-mode .modal>.modal-body{padding:10px 12px}
 body.game-mode .modal[data-modal=pause] .pause-menu{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:10px 14px}
 body.game-mode .modal[data-modal=pause] .pause-menu__group{border:0;padding:0;gap:7px;min-width:0}
 body.game-mode .modal[data-modal=pause] .pause-menu__group>h3{font-size:21px}
 body.game-mode .modal[data-modal=pause] .pause-menu__group>button{min-height:44px;padding:8px 10px;font-size:14px;gap:5px 8px}
 body.game-mode .modal[data-modal=pause] .pause-menu__group>button small{font-size:12px;line-height:1.35;margin-left:0;max-width:none;text-align:left}
 body.game-mode .modal[data-modal=pause] .pause-menu__group .pause-menu__resume{min-height:46px;font-size:22px}
 body.game-mode .modal[data-modal=pause] .pause-menu__more{grid-column:1/-1}
 body.game-mode .modal[data-modal=pause] .pause-menu__more>.pause-menu__group{display:grid;grid-template-columns:1fr 1fr;margin-top:8px;gap:8px}
}


/* Put the companions before optional collection controls. */
body.game-mode .game-storage .storage-filters{margin:0 0 8px;border:2px solid #78b7b6;background:#25364a}
body.game-mode .game-storage .storage-filters>summary{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;padding:6px 10px;color:#fff0d5;font:600 15px/1.3 var(--body);cursor:pointer}
body.game-mode .game-storage .storage-filters>summary:after{content:'▾';color:#ffda8b}
body.game-mode .game-storage .storage-filters[open]>summary:after{content:'▴'}
body.game-mode .game-storage .storage-filters>summary>span{margin-left:auto;color:#bce8dc;font:400 13px/1.3 var(--body)}
body.game-mode .game-storage .storage-filters .storage-controls{border:0;margin:0}
body.game-mode .game-storage .storage-filters>summary:focus-visible{outline:3px solid #ffe0a0;outline-offset:-3px}
@media(max-width:650px){
 body.game-mode .game-storage .roster-console__summary{display:none}
}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-team .roster-console:not(.storage-console).roster-console--detail .roster-identity{padding:6px;gap:8px}
 body.game-mode .game-team .roster-console:not(.storage-console).roster-console--detail .roster-identity>.sprite{width:64px;height:64px;flex-basis:64px}
 body.game-mode .game-team .roster-console:not(.storage-console).roster-console--detail .roster-identity__name h2{font-size:26px}
 body.game-mode .game-team .roster-console:not(.storage-console).roster-console--detail .roster-identity__name{flex-wrap:nowrap;gap:6px}
 body.game-mode .game-team .roster-console:not(.storage-console).roster-console--detail .roster-detail__tools{grid-template-columns:repeat(4,minmax(0,1fr))}
}

body.game-mode .game-habitat .habitat-console{height:auto;align-items:start}
body.game-mode .game-habitat .habitat-console__preview{overflow:visible}
@media(max-width:650px) and (max-height:650px){
 body.game-mode .game-overlay>.game-habitat{top:8px;bottom:8px;left:8px;right:8px;width:auto;transform:none;max-height:none}
 body.game-mode .game-habitat .habitat-console__landscape{height:100px;min-height:100px;flex:none;padding:8px 12px}
 body.game-mode .game-habitat .habitat-console__landscape>div{height:40px}
 body.game-mode .game-habitat .habitat-console__landscape .sprite{height:48px;width:48px}
 body.game-mode .game-habitat .habitat-console__landscape h2{font-size:26px;margin:2px 0}
 body.game-mode .game-habitat .first-expedition-intro{margin:0;padding:8px 12px;font-size:14px;line-height:1.4}
}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-habitat .habitat-console{grid-template-columns:minmax(0,1fr)}
 body.game-mode .game-habitat .habitat-console__preview{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:6px 10px;order:0;padding:8px}
 body.game-mode .game-habitat .habitat-console__preview>*{grid-column:1/-1;min-width:0}
 body.game-mode .game-habitat .habitat-console__landscape{grid-column:1;grid-row:1/3;min-height:116px;height:116px;align-self:start;padding:8px}
 body.game-mode .game-habitat .habitat-console__landscape>div{height:50px}
 body.game-mode .game-habitat .habitat-console__landscape .sprite{height:48px;width:48px}
 body.game-mode .game-habitat .habitat-console__landscape h2{font-size:25px;margin:4px 0}
 body.game-mode .game-habitat .habitat-console__preview>p{grid-column:2;grid-row:1;padding:0;margin:0;font-size:14px;line-height:1.4}
 body.game-mode .game-habitat .habitat-console__preview>.habitat-launch{grid-column:2;grid-row:2;width:100%;margin:0;min-height:50px;padding:6px;align-self:end}
 body.game-mode .game-habitat .habitat-console__list{order:1}
 body.game-mode .game-habitat .first-expedition-steps{padding:6px;margin:0;gap:6px}
 body.game-mode .game-habitat .first-expedition-steps li{display:flex;gap:6px;align-items:center;font-size:14px}
 body.game-mode .game-habitat .first-expedition-steps b{flex:none}
}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .roster-console--detail .roster-vitals{padding:4px 0 6px;margin:0}
 body.game-mode .game-team .roster-console:not(.storage-console).roster-console--detail .roster-detail__backbar{min-height:44px;margin-bottom:8px}
 body.game-mode .game-team .roster-console:not(.storage-console).roster-console--detail .roster-identity .eyebrow{margin:0;font-size:11px;line-height:1.2}
 body.game-mode .game-team .roster-console:not(.storage-console).roster-console--detail .roster-identity__name{margin:3px 0}
 body.game-mode .game-team .roster-console:not(.storage-console).roster-console--detail .roster-identity p{margin:2px 0}
 body.game-mode .game-team .roster-console:not(.storage-console).roster-console--detail .roster-identity .detail-tags{margin-top:3px}
}

body.game-mode .game-challenges .crest-overview{padding:0 0 10px;margin:0 0 10px;border-bottom:1px solid #79a4ad}
body.game-mode .game-challenges .crest-overview>strong{font:600 25px/1.1 Pixelify,monospace;color:#ffdda0}
body.game-mode .game-challenges .crest-overview>p{font:400 14px/1.4 var(--body);color:#dce8ed;margin:6px 0 0}
body.game-mode .game-challenges .crest-preparation{border:3px double #8bd3c1;border-left:4px solid #ffda8b;background:linear-gradient(135deg,#4b707a44,transparent 45%),#2b4055;padding:10px;margin:0 0 12px;display:grid;gap:6px}
body.game-mode .game-challenges .crest-preparation>.eyebrow{color:#b9e6db;font:600 12px/1.3 var(--body)}
body.game-mode .game-challenges .crest-preparation>strong{font:600 28px/1.1 Pixelify,monospace;color:#fff2d0}
body.game-mode .game-challenges .crest-preparation>p{font:400 14px/1.4 var(--body);margin:0;color:#e0ebf0}
body.game-mode .game-challenges .crest-preparation>.button{min-height:44px;font:600 15px/1.3 var(--body);margin:0;padding:8px}
body.game-mode .game-challenges .crest-preparation>a{display:flex;align-items:center;min-height:44px;font:600 14px/1.3 var(--body);color:#ffdda0}
body.game-mode .game-challenges .challenge-card{scroll-margin-top:10px}
@media(max-width:650px){
 body.game-mode .game-challenges .crest-progress{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 6px}
 body.game-mode .game-challenges .crest-stop small{font-size:12px;overflow-wrap:normal;white-space:nowrap}
}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-challenges .crest-preparation{grid-template-columns:minmax(0,1fr) minmax(150px,.7fr);gap:4px 12px}
 body.game-mode .game-challenges .crest-preparation>.eyebrow{grid-column:1;grid-row:1}
 body.game-mode .game-challenges .crest-preparation>strong{grid-column:1;grid-row:2}
 body.game-mode .game-challenges .crest-preparation>p{grid-column:1;grid-row:3}
 body.game-mode .game-challenges .crest-preparation>.button{grid-column:2;grid-row:1/3;align-self:center}
 body.game-mode .game-challenges .crest-preparation>a{grid-column:2;grid-row:3}
 body.game-mode .game-challenges .crest-overview{margin-bottom:6px;padding-bottom:6px}
 body.game-mode .game-challenges .crest-overview>strong{font-size:22px}
}

/* Research uses three clear pages within the same game window. */
body.game-mode .game-research .research-console{grid-template-columns:minmax(0,1fr);max-width:1000px}
body.game-mode .game-research[data-research-pane="projects"] .research-mastery{display:none}
body.game-mode .game-research:is([data-research-pane="mastery"],[data-research-pane="hunts"]) .research-projects{display:none}
body.game-mode .game-research[data-research-pane="mastery"] .research-hunt{display:none}
body.game-mode .game-research[data-research-pane="hunts"] .research-mastery>:not(.research-hunt){display:none}
body.game-mode .game-research .research-console .research-mastery{padding:0;border:0;margin:0;scroll-margin-top:60px}
body.game-mode .game-research .research-console .research-hunt{padding:0;border:0;margin:0}
body.game-mode .game-research :is(#research-projects,#research-hunts){scroll-margin-top:60px}
body.game-mode .game-research .research-mastery>.rpg-progress-heading h2{font-size:27px;margin:4px 0}
body.game-mode .game-research .research-mastery>p{margin:6px 0;font-size:14px;line-height:1.4}
body.game-mode .game-research .research-mastery>label{display:flex;align-items:center;gap:8px;margin:8px 0;font-size:14px}
body.game-mode .game-research .research-mastery>label>select{flex:1;min-width:0;min-height:44px;font-size:15px}
body.game-mode .game-research .research-family-hud{padding:8px;gap:8px;margin:8px 0;min-height:0}
body.game-mode .game-research .research-family-hud>.sprite{width:56px;height:64px;flex-basis:56px}
body.game-mode .game-research .research-family-hud h3{font-size:25px;margin:0 0 4px}
body.game-mode .game-research .research-family-hud p{font-size:14px;line-height:1.4;margin:3px 0}
body.game-mode .game-research .hunt-readiness{padding:10px;border:2px solid #85c3b5;border-left:4px solid #ffda8b;background:#293e52;margin:8px 0 12px}
body.game-mode .game-research .hunt-readiness>p{font:400 14px/1.4 var(--body);margin:0 0 8px;color:#edf0e6}
body.game-mode .game-research .hunt-readiness>.button,body.game-mode .game-research .hunt-readiness>.hunt-project-return{min-height:44px;display:flex;align-items:center;justify-content:center;margin:0;padding:8px;font:600 14px/1.3 var(--body)}
body.game-mode .game-research .hunt-target-plate{padding:8px;gap:10px}
body.game-mode .game-research .hunt-target-plate>.sprite{width:56px;height:64px;flex-basis:56px}
body.game-mode .game-research .hunt-target-plate h3{font-size:24px}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-research[data-research-pane="mastery"] .research-console .research-mastery{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px 12px}
 body.game-mode .game-research .research-mastery>*{grid-column:1/-1}
 body.game-mode .game-research .research-mastery>.rpg-progress-heading{grid-column:1;grid-row:1}
 body.game-mode .game-research .research-mastery>p{grid-column:1;grid-row:2;margin:0}
 body.game-mode .game-research .research-mastery>label{grid-column:1;grid-row:3;margin:0}
 body.game-mode .game-research .research-family-hud{grid-column:2;grid-row:1/4;margin:0;align-items:center}
 body.game-mode .game-research .research-hunt>h2{font-size:26px;margin:0 0 6px}
}
/* Settings and preparation dialogs retain their title while content scrolls. */
body.game-mode .modal:is([data-modal=settings],[data-modal=held],[data-modal=moves],[data-modal=training]){display:flex;flex-direction:column;overflow:hidden;padding:0;max-height:calc(var(--game-visible-height,100dvh) - 24px);min-height:0}
body.game-mode .modal:is([data-modal=settings],[data-modal=held],[data-modal=moves],[data-modal=training])>.modal-heading{position:relative;top:auto;flex:none;margin:0;min-height:64px;padding:10px 14px;align-items:center;z-index:2}
body.game-mode .modal:is([data-modal=settings],[data-modal=held],[data-modal=moves],[data-modal=training])>.modal-heading h2{margin:0;font:600 29px/1.1 Pixelify,monospace}
body.game-mode .modal:is([data-modal=settings],[data-modal=held],[data-modal=moves],[data-modal=training])>.modal-heading>.icon-button{width:44px;min-width:44px;height:44px;min-height:44px;flex:0 0 44px}
body.game-mode .modal .moveset-ready{padding:10px;border:2px solid #82c5b7;background:#2b4054;color:#e5efed}
body.game-mode .modal .moveset-ready>strong{font:600 26px/1.1 Pixelify,monospace;color:#ffdfa4}
body.game-mode .modal .moveset-ready>p{font:400 14px/1.4 var(--body);margin:8px 0}
body.game-mode .modal .moveset-ready>.button{min-height:44px;font-size:14px}
body.game-mode .modal .moveset-equipped>summary{min-height:44px;display:flex;align-items:center;color:#ffdfa4;font:600 14px/1.4 var(--body);cursor:pointer}
body.game-mode .modal .held-item-library{margin:8px 0;gap:8px}
body.game-mode .game-collection .guide--detail .guide-return{display:none}
body.game-mode .game-discoveries .discoveries-empty{padding:14px;border:3px double #86c8b8;background:linear-gradient(130deg,#37616a55,transparent 50%),#293e52;display:grid;gap:12px;color:#e6eeeb}
body.game-mode .game-discoveries .discoveries-empty>strong{font:600 31px/1.1 Pixelify,monospace;color:#ffe0a0}
body.game-mode .game-discoveries .discoveries-empty>p{font:400 15px/1.5 var(--body);margin:0}
body.game-mode .game-discoveries .discoveries-empty>.button{min-height:44px;font-size:15px}
body.game-mode .game-ending .game-ending-emblem{float:right;width:48px;height:48px;margin:0 0 8px 10px}
body.game-mode .game-ending .game-ending-emblem .icon{width:40px;height:40px}
body.game-mode .game-ending .game-result-message{font:600 26px/1.2 Pixelify,monospace;margin:0 0 12px}
body.game-mode .game-ending .ending-actions{clear:both;margin:10px 0}
@media(max-width:650px){
 body.game-mode .camp-screen--clear .camp-companion__name{font:600 18px/1.2 Pixelify,monospace}
 body.game-mode .camp-screen--clear .camp-companion__name small{display:block;font:500 14px/1.2 var(--body)}
}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .modal:is([data-modal=settings],[data-modal=held],[data-modal=moves],[data-modal=training]){max-height:calc(var(--game-visible-height,100dvh) - 16px)}
 body.game-mode .modal:is([data-modal=settings],[data-modal=held],[data-modal=moves],[data-modal=training])>.modal-heading{min-height:60px;padding:7px 12px}
 body.game-mode .modal:is([data-modal=settings],[data-modal=held],[data-modal=moves],[data-modal=training])>.modal-heading h2{font-size:26px}
 body.game-mode .modal .held-item-library>article{grid-template-columns:minmax(0,1fr) 110px;padding:8px;gap:6px 10px;align-items:stretch}
 body.game-mode .modal .held-item-library>article>div{grid-column:1;grid-row:1/3}
 body.game-mode .modal .held-item-library>article>button{grid-column:2;min-height:44px;padding:6px;font:600 14px/1.3 var(--body)}
 body.game-mode .modal .held-item-library>article p{font:400 14px/1.4 var(--body);margin:4px 0}
 body.game-mode .game-collection .guide--detail .dex-detail{display:grid;grid-template-columns:120px minmax(0,1fr);gap:8px;align-items:start}
 body.game-mode .game-collection .guide--detail .detail-art{grid-column:1;grid-row:1;height:150px;min-height:0;border:0}
 body.game-mode .game-collection .guide--detail .detail-art>.detail-sprite{width:96px;height:96px}
 body.game-mode .game-collection .guide--detail .detail-content{grid-column:2;grid-row:1;padding:6px}
 body.game-mode .game-collection .guide--detail .detail-content>.eyebrow{font-size:11px;line-height:1.2}
 body.game-mode .game-collection .guide--detail .detail-content>h2{font-size:28px;margin:4px 0}
 body.game-mode .game-collection .guide--detail .detail-tags{margin:4px 0}
 body.game-mode .game-collection .guide--detail .dex-habitat{padding:5px 0;margin:4px 0}
 body.game-mode .game-collection .guide--detail .dex-habitat>span{font-size:11px}
 body.game-mode .game-collection .guide--detail .dex-habitat>strong{font-size:15px}
 body.game-mode .game-collection .guide--detail .guide-owned{padding:0;margin:6px 0}
 body.game-mode .game-collection .guide--detail .guide-owned h3{font-size:20px;margin:2px 0}
 body.game-mode .game-collection .guide--detail .guide-owned .button{min-height:44px;padding:6px;font-size:14px}
}
@media(max-width:650px){
 body.game-mode .game-storage>.game-window__heading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
 body.game-mode .game-storage>.game-window__heading h1{font-size:24px;line-height:1.1;min-width:0;overflow-wrap:normal}
 body.game-mode .game-storage>.game-window__heading .game-window__close{max-width:112px;padding:6px 8px;font-size:14px;line-height:1.2;white-space:normal}
 body.game-mode .game-adventure-menu .adventure-options>button{min-height:0;padding:12px 28px 12px 12px;display:grid;grid-template-columns:24px minmax(0,1fr);gap:6px 10px;text-align:left}
 body.game-mode .game-adventure-menu .adventure-options>button>span{grid-column:1;grid-row:1/4;font-size:24px;margin:0}
 body.game-mode .game-adventure-menu .adventure-options>button>strong{grid-column:2;font-size:27px;margin:0}
 body.game-mode .game-adventure-menu .adventure-options>button>p{grid-column:2;font-size:14px;line-height:1.4;margin:0}
 body.game-mode .game-adventure-menu .adventure-options>button>small{grid-column:2;font-size:13px;line-height:1.4;margin:0}
}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-collection .guide-console.guide--detail .dex-detail{display:grid;grid-template-columns:120px minmax(0,1fr)}
 body.game-mode .game-research .research-mastery>label{flex-direction:row;justify-content:flex-start;text-align:left}
 body.game-mode .game-window:is(.game-trail-event,.game-journey) .encounter-console{grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:12px;align-items:start}
 body.game-mode .game-window:is(.game-trail-event,.game-journey) .encounter-story{display:flow-root}
 body.game-mode .game-window:is(.game-trail-event,.game-journey) .encounter-illustration{float:right;width:56px;height:64px;margin:0 0 6px 8px}
 body.game-mode .game-window:is(.game-trail-event,.game-journey) .encounter-illustration .encounter-creature{width:56px;height:56px}
 body.game-mode .game-window:is(.game-trail-event,.game-journey) .encounter-intro h2{font-size:25px;line-height:1.1;margin:6px 0}
 body.game-mode .game-window:is(.game-trail-event,.game-journey) .encounter-choice{padding:8px;gap:6px}
 body.game-mode .game-window:is(.game-trail-event,.game-journey) .encounter-choice__body{gap:5px}
 body.game-mode .game-window:is(.game-trail-event,.game-journey) .encounter-choice__body>strong{font-size:23px}
 body.game-mode .game-window:is(.game-trail-event,.game-journey) .encounter-choice__body>span{line-height:1.4}
}

/* Classic uses its compact native panes at wider phone landscape sizes too. */
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-classic .game-window__heading{min-height:46px;padding:3px 8px}
 body.game-mode .game-classic .game-window__heading h1{font-size:22px}
 body.game-mode .game-classic .game-window__heading p{font-size:14px;margin-top:2px}
 body.game-mode .game-classic .game-window__body{padding:5px;gap:4px}
 body.game-mode .game-classic .classic-phone-nav{display:block;position:static;margin:0;padding:0;border:0;background:none}
 body.game-mode .game-classic .classic-phone-summary{display:none}
 body.game-mode .game-classic .classic-phone-nav nav{display:grid;grid-template-columns:1fr 1fr 1.25fr;gap:6px}
 body.game-mode .game-classic .classic-phone-nav button{min-height:44px;font-size:14px;padding:5px;border-radius:0}
 body.game-mode .game-classic .starter-console{display:flex;flex-direction:column;flex:1;min-height:0}
 body.game-mode .game-classic .starter-console>:is(.starter-console__grid,.starter-console__detail,.starter-console__party){display:none;flex:1;min-height:0;overflow:auto;max-height:none}
 body.game-mode .game-classic .starter-console[data-classic-section="starters"]>.starter-console__grid{display:flex;flex-direction:column;padding:3px;gap:3px;overflow:hidden}
 body.game-mode .game-classic .starter-console[data-classic-section="profile"]>.starter-console__detail{display:block;position:relative;padding:7px 8px 8px 108px}
 body.game-mode .game-classic .starter-console[data-classic-section="team"]>.starter-console__party{display:flex;flex-direction:column;padding:4px;gap:4px}
 body.game-mode .game-classic .console-grid-heading,body.game-mode .game-classic .console-grid-note{display:none}
 body.game-mode .game-classic .console-grid{grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-rows:66px;padding:2px;gap:4px}
 body.game-mode .game-classic .console-species{min-height:66px;height:66px;padding:10px 1px 1px;gap:0}
 body.game-mode .game-classic .console-species .sprite{width:34px;height:34px}
 body.game-mode .game-classic .console-species>span{font-size:14px;line-height:1.15}
 body.game-mode .game-classic .console-species>b{font-size:14px;padding:0 2px;top:1px;left:1px}
 body.game-mode .game-classic .starter-console__detail .console-dex{position:absolute;left:8px;top:6px;font-size:14px}
 body.game-mode .game-classic .starter-console__detail .console-portrait{position:absolute;left:8px;top:25px;width:88px;height:88px;min-height:0;margin:0}
 body.game-mode .game-classic .starter-console__detail .console-portrait .sprite{width:88px;height:88px}
 body.game-mode .game-classic .starter-console__detail h2{font-size:26px;line-height:1.05;margin:0 0 4px}
 body.game-mode .game-classic .starter-console__detail .console-guest,body.game-mode .game-classic .starter-console__detail .console-stats-label{font-size:14px}
 body.game-mode .game-classic .starter-console__detail .console-stats-label{margin-top:8px}
 body.game-mode .game-classic .starter-console__party .console-budget{display:none}
 body.game-mode .game-classic .console-party{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:52px;gap:4px;flex:1;overflow:auto;padding:0}
 body.game-mode .game-classic .console-party-slot{min-height:52px;padding:3px 4px;gap:4px}
 body.game-mode .game-classic .console-party-slot .sprite{width:32px;height:32px}
 body.game-mode .game-classic .console-party-slot strong{font-size:21px}
 body.game-mode .game-classic .console-party-slot small,body.game-mode .game-classic .console-party-slot:not(.filled)>small,body.game-mode .game-classic .console-party-note{font-size:14px;line-height:1.15;margin-top:1px}
 body.game-mode .game-classic .console-party-slot:not(.filled){min-height:44px}
 body.game-mode .game-classic .console-start-level{display:none}
 body.game-mode .game-classic .rpg-starter-prompt{padding:3px 7px;min-height:50px}
 body.game-mode .game-classic .rpg-starter-prompt__wide{display:none}
 body.game-mode .game-classic .rpg-starter-prompt__phone{display:flex;align-items:center;justify-content:space-between;width:100%;gap:8px}
 body.game-mode .game-classic .rpg-starter-prompt__phone p{font-size:22px}
 body.game-mode .game-classic .rpg-starter-prompt__phone p>span{display:inline;margin-left:9px;font-size:14px}
 body.game-mode .game-classic .rpg-starter-prompt__phone .button{min-height:44px;padding:6px 10px;font-size:14px}
 body.game-mode .game-classic .starter-console__detail>.button:last-child,body.game-mode .game-classic .starter-console__party>.console-launch{display:none}
}
body.game-mode .modal{display:flex;flex-direction:column;overflow:hidden;padding:0;max-height:calc(var(--game-visible-height,100dvh) - 24px);min-height:0}
body.game-mode .modal>.modal-heading{position:relative;top:auto;flex:none;margin:0;min-height:64px;padding:10px 14px;align-items:center;z-index:2}
body.game-mode .modal>.modal-heading h2{margin:0;font:600 29px/1.1 Pixelify,monospace}
body.game-mode .modal>.modal-heading>.icon-button{width:44px;min-width:44px;height:44px;min-height:44px;flex:0 0 44px}
body.game-mode .modal .care-selector{display:flex;flex-direction:column;gap:6px;font:600 14px/1.3 var(--body);margin:8px 0;color:#e6ece8}
body.game-mode .modal .care-selector>select{width:100%;min-width:0;min-height:44px;font-size:15px;background:#1d3549;color:#fff2d7;border:1px solid #8abcb5;border-radius:0}
body.game-mode .modal .care-status{display:flex;align-items:center;gap:10px;margin:8px 0;padding:8px;background:#2b4054;border:2px solid #83c8b6}
body.game-mode .modal .care-status>.sprite{width:44px;height:44px;flex:none}
body.game-mode .modal .care-status>div{min-width:0;display:grid;gap:4px}
body.game-mode .modal .care-status strong{font:600 24px/1.1 Pixelify,monospace;color:#fff0ce}
body.game-mode .modal .care-status span{font:400 14px/1.4 var(--body);color:#dfe9eb}
body.game-mode .modal .care-action{min-height:44px;padding:8px}
body.game-mode .modal .care-action>strong{font:600 15px/1.35 var(--body)}
body.game-mode .modal .care-action>small{font:400 14px/1.4 var(--body)}
body.game-mode .modal .care-reason{font:400 14px/1.4 var(--body);margin:6px 0;color:#ffe0b6}
body.game-mode .modal .held-reward-targets button strong{font:600 24px/1.1 Pixelify,monospace;overflow-wrap:normal}
body.game-mode .modal .held-reward-targets button small{font:400 14px/1.4 var(--body)}
body.game-mode .game-route-window .route-console{display:grid;gap:12px}
body.game-mode .game-route-window :is(.checkpoint-condition,.sector-recovery){padding:8px}
body.game-mode .game-route-window :is(.checkpoint-condition,.sector-recovery) p{font-size:14px;line-height:1.4;margin:0 0 8px}
body.game-mode .game-route-window .game-loot-tools{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0}
body.game-mode .game-route-window .game-loot-tools>.button{min-height:44px;font:600 12px/1.3 var(--body);padding:6px;white-space:normal}
body.game-mode .game-route-window .route-recovery-details>summary{min-height:44px;display:flex;align-items:center;color:#ffe0a0;font:600 14px/1.3 var(--body);cursor:pointer}
body.game-mode .game-route-window .route-commitment{font:400 14px/1.4 var(--body);margin:8px 0 0;color:#dce8ed}
body.game-mode .game-route-window .game-route-choices>button{min-height:44px;padding:10px;display:grid;grid-template-columns:minmax(0,1fr);gap:6px}
body.game-mode .game-route-window .game-route-choices>button>strong{font:600 26px/1.1 Pixelify,monospace}
body.game-mode .game-route-window .game-route-choices>button>small{font:400 14px/1.4 var(--body);margin:0}
body.game-mode .game-route-window .game-route-choices>button>b{position:static;font:600 14px/1.3 var(--body);color:#ffe0a0}
body.game-mode .game-route-window .game-route-choices .route-preview{display:none}
@media(max-width:650px) and (max-height:650px){
 body.game-mode .game-overlay>.game-route-window{top:8px;bottom:8px;left:8px;right:8px;width:auto;transform:none;max-height:none}
}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .modal{max-height:calc(var(--game-visible-height,100dvh) - 16px)}
 body.game-mode .modal>.modal-heading{min-height:60px;padding:7px 12px}
 body.game-mode .modal>.modal-heading h2{font-size:26px}
 body.game-mode .modal .expedition-care{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px 12px}
 body.game-mode .modal .expedition-care>*{grid-column:1/-1;min-width:0}
 body.game-mode .modal .expedition-care>.modal-lead{margin:0;font-size:14px;line-height:1.4}
 body.game-mode .modal .expedition-care>.care-selector{grid-column:1;grid-row:2;margin:0;gap:4px}
 body.game-mode .modal .expedition-care>.care-status{grid-column:1;grid-row:3;margin:0;padding:4px}
 body.game-mode .modal .expedition-care>.care-status>.sprite{height:36px;width:36px}
 body.game-mode .modal .expedition-care>[data-id=potion]{grid-column:2;grid-row:2;margin:0}
 body.game-mode .modal .expedition-care>.care-reason--tonic{grid-column:2;grid-row:3;margin:0}
 body.game-mode .game-route-window .route-console{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);align-items:start}
 body.game-mode .game-route-window .game-route-choices{gap:8px}
}
body.game-mode .modal[data-modal=run-info] .run-modal-label{font:600 26px/1.1 Pixelify,monospace;color:#ffe0a0;margin:8px 0}
body.game-mode .modal[data-modal=run-info] .run-relics{gap:6px;margin:8px 0}
body.game-mode .modal[data-modal=run-info] .run-relics>span{font:600 14px/1.4 var(--body);padding:6px 8px;white-space:normal}
body.game-mode .modal[data-modal=run-info] .build-effect-list>p{font:400 14px/1.4 var(--body);margin:8px 0;color:#dfe9ed}
body.game-mode .modal[data-modal=run-info] .build-effect-list strong{font-size:15px;color:#ffe2a5}
body.game-mode .modal[data-modal=run-info] .run-build-details>summary{min-height:44px;display:flex;align-items:center;font:600 14px/1.4 var(--body);color:#ffe2a5;cursor:pointer}
body.game-mode .modal[data-modal=run-info] .classic-build :is(.eyebrow,.classic-build-heading>span,.classic-build-stats small,.classic-build-note){font-size:13px;line-height:1.4}
body.game-mode .modal[data-modal=run-info] .classic-build-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
body.game-mode .modal[data-modal=run-info] .classic-build-stats b{font-size:20px}
@media(max-width:650px){
 body.game-mode .game-journey .journey-faction-trial .encounter-choice{grid-template-columns:minmax(0,1fr) 10px;padding:8px}
 body.game-mode .game-journey .journey-faction-trial .encounter-choice__number{display:none}
 body.game-mode .game-journey .journey-faction-trial .encounter-choice__body{gap:5px}
 body.game-mode .game-journey .journey-faction-trial .encounter-choice__body>span{line-height:1.4}
}

/* Setup choices put readiness, stakes and the existing commitment ahead of optional detail. */
body.game-mode .game-activities .activity-grid{align-items:start;gap:12px}
body.game-mode .game-activities .activity-card{gap:7px;padding:12px;align-items:stretch}
body.game-mode .game-activities .activity-card-heading h2{font-size:28px;line-height:1.1;margin:2px 0 0}
body.game-mode .game-activities .activity-card-heading .depth-eyebrow{font-size:11px;line-height:1.3}
body.game-mode .game-activities .activity-card .activity-entry-party{padding:7px 9px;font-size:13px;line-height:1.4;margin:0;width:100%}
body.game-mode .game-activities .activity-entry-party>small{display:block;font-size:12px;color:#c9e2e0;line-height:1.4}
body.game-mode .game-activities .activity-card .activity-first-foe{font-size:13px;line-height:1.4;margin:0}
body.game-mode .game-activities .activity-card .activity-prize{font-size:13px;line-height:1.4;margin:0}
body.game-mode .game-activities .activity-card>.primary{min-height:46px;margin:0;padding:9px 10px;line-height:1.4}
body.game-mode .game-activities .activity-card :is(.activity-rules,.activity-roster){width:100%;border-top:1px solid #648b96;padding-top:0;margin:0}
body.game-mode .game-activities .activity-card :is(.activity-rules,.activity-roster)>summary{min-height:44px;box-sizing:border-box;align-content:center;cursor:pointer;color:#ffe1a3;font:600 13px/1.4 var(--body);padding:7px 0}
body.game-mode .game-activities .activity-rules p{margin:5px 0 10px;font-size:13px;line-height:1.5}
body.game-mode .game-activities .activity-rules .button{width:100%;min-height:44px;font-size:13px}
body.game-mode .game-daily .daily-commit{display:grid;gap:9px}
body.game-mode .game-daily .daily-commit .daily-banner{padding:10px 35px 10px 11px;margin:0}
body.game-mode .game-daily .daily-commit .daily-banner>strong{font-size:28px;margin:3px 0 0}
body.game-mode .game-daily .daily-commit .daily-banner .adventure-eyebrow{font-size:12px;line-height:1.3}
body.game-mode .game-daily .daily-console .daily-commit :is(.daily-summary,.daily-reward){margin:0;font-size:13px;line-height:1.45}
body.game-mode .game-daily .daily-console .daily-commit .daily-reward{padding:8px 10px;gap:2px}
body.game-mode .game-daily .daily-commit .daily-reward>strong{font-size:13px;line-height:1.35}
body.game-mode .game-daily .daily-commit .daily-reward>span{font-size:12px;line-height:1.4}
body.game-mode .game-daily .daily-commit .daily-launch{min-height:46px;padding:9px;font:700 14px/1.4 var(--body);margin:0}
body.game-mode .game-challenge .challenge-console{gap:12px}
body.game-mode .game-challenge .challenge-choices{gap:8px;align-content:start}
body.game-mode .game-challenge .challenge-console .challenge-card{min-height:60px;padding:10px 22px 10px 10px;gap:0}
body.game-mode .game-challenge .challenge-card>strong{font:700 17px/1.2 var(--body)}
body.game-mode .game-challenge .challenge-card>:is(.challenge-card__number,small),body.game-mode .game-challenge .challenge-card>span:not(.challenge-card__number){display:none}
body.game-mode .game-challenge .challenge-card>b{right:8px;top:10px;font-size:12px}
body.game-mode .game-challenge .challenge-detail{padding:12px;display:grid;gap:8px;align-content:start}
body.game-mode .game-challenge .challenge-detail__heading h2{font-size:28px;line-height:1.1;margin:3px 0 0}
body.game-mode .game-challenge .challenge-detail__heading .adventure-eyebrow{font-size:10px;line-height:1.3}
body.game-mode .game-challenge .challenge-element{margin:0;gap:5px;font-size:12px}
body.game-mode .game-challenge .challenge-console .challenge-readiness{margin:0;font-size:13px;line-height:1.4;color:#bcebdc;font-weight:600}
body.game-mode .game-challenge .challenge-detail>.challenge-reward{margin:0;padding:7px 9px;gap:1px}
body.game-mode .game-challenge .challenge-detail>.challenge-reward>strong{font-size:13px;line-height:1.3}
body.game-mode .game-challenge .challenge-detail>.challenge-reward>span{font-size:12px;line-height:1.35}
body.game-mode .game-challenge .challenge-console .challenge-launch{min-height:46px;padding:9px;font:700 14px/1.4 var(--body);margin:0}
body.game-mode .game-challenge .challenge-more-rules{border-top:1px solid #6d969a;margin:0;padding:0}
body.game-mode .game-challenge .challenge-more-rules>summary{min-height:44px;box-sizing:border-box;align-content:center;font:600 13px/1.4 var(--body);color:#ffe1a3;cursor:pointer;padding:7px 0}
body.game-mode .game-challenge .challenge-more-rules .challenge-eligible{padding-top:10px;margin-top:10px}
@media(max-width:650px){
 body.game-mode .game-challenge .challenge-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 body.game-mode .game-challenge .challenge-console .challenge-card{min-height:68px;padding:8px;justify-content:center}
 body.game-mode .game-challenge .challenge-card>strong{font-size:13px;line-height:1.35}
 body.game-mode .game-challenge .challenge-card>b{display:none}
}
@media(max-height:500px) and (min-width:480px){
 body.game-mode .game-activities .activity-grid{grid-template-columns:minmax(0,1fr)}
 body.game-mode .game-activities .activity-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px 12px;padding:9px 10px;align-items:center}
 body.game-mode .game-activities .activity-card-heading{grid-column:1;grid-row:1}
 body.game-mode .game-activities .activity-card-heading h2{font-size:25px}
 body.game-mode .game-activities .activity-card .activity-entry-party{grid-column:2;grid-row:1;padding:5px 7px;font-size:12px}
 body.game-mode .game-activities .activity-card .activity-first-foe{grid-column:1;grid-row:2;font-size:12px}
 body.game-mode .game-activities .activity-card .activity-prize{grid-column:2;grid-row:2;font-size:12px}
 body.game-mode .game-activities .activity-card>.primary{grid-column:1;grid-row:3;min-height:46px;font-size:13px}
 body.game-mode .game-activities .activity-card>.activity-rules{grid-column:2;grid-row:3;border:0}
 body.game-mode .game-activities .activity-card>.activity-rules[open]{grid-column:1/-1;grid-row:4}
 body.game-mode .game-activities .activity-card>.activity-roster{grid-column:1/-1}
 body.game-mode .game-activities .activity-card>.activity-requirement{grid-column:1/-1;grid-row:3}
 body.game-mode .game-activities .activity-card:has(>.activity-requirement)>.primary{grid-row:4}
 body.game-mode .game-activities .activity-card:has(>.activity-requirement)>.activity-rules{grid-row:5;grid-column:1/-1}
 body.game-mode .game-daily .daily-console{grid-template-columns:minmax(0,1fr)}
 body.game-mode .game-daily .daily-commit{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px 12px;align-items:start}
 body.game-mode .game-daily .daily-commit .daily-banner{grid-column:1;grid-row:1;padding:8px 30px 8px 9px}
 body.game-mode .game-daily .daily-commit .daily-banner>strong{font-size:25px}
 body.game-mode .game-daily .daily-commit .daily-summary{grid-column:1;grid-row:2;font-size:12px;line-height:1.4}
 body.game-mode .game-daily .daily-commit .daily-reward{grid-column:2;grid-row:1}
 body.game-mode .game-daily .daily-commit .daily-launch{grid-column:2;grid-row:2;min-height:46px}
 body.game-mode .game-challenge .challenge-console{grid-template-columns:minmax(145px,.65fr) minmax(0,1.35fr);gap:10px}
 body.game-mode .game-challenge .challenge-choices{grid-template-columns:minmax(0,1fr);gap:7px}
 body.game-mode .game-challenge .challenge-console .challenge-card{min-height:48px;padding:7px 9px}
 body.game-mode .game-challenge .challenge-card>strong{font-size:14px;line-height:1.3}
 body.game-mode .game-challenge .challenge-detail{padding:8px;gap:5px}
 body.game-mode .game-challenge .challenge-detail__heading h2{font-size:25px}
 body.game-mode .game-challenge .challenge-element{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;font-size:12px;gap:4px 8px}
 body.game-mode .game-challenge .challenge-element select{grid-column:1;grid-row:2;min-height:44px;font-size:13px;padding:6px}
 body.game-mode .game-challenge .challenge-element>.type-tag{grid-column:2;grid-row:2;font-size:10px}
 body.game-mode .game-challenge .challenge-readiness{font-size:12px!important}
 body.game-mode .game-challenge .challenge-detail>.challenge-reward{padding:5px 7px}
 body.game-mode .game-challenge .challenge-detail>.challenge-reward>strong{font-size:12px}
 body.game-mode .game-challenge .challenge-detail>.challenge-reward>span{font-size:11px}
}

@media(max-height:500px) and (min-width:480px){
 body.game-mode .game-challenge .challenge-detail__heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
 body.game-mode .game-challenge .challenge-detail__heading h2{font-size:23px;margin:0;order:-1}
 body.game-mode .game-challenge .challenge-detail__heading .adventure-eyebrow{font-size:9px;line-height:1.25;max-width:90px}
 body.game-mode .game-challenge .challenge-element{grid-template-columns:45px minmax(0,1fr) auto;gap:5px}
 body.game-mode .game-challenge .challenge-element>span:not(.type-tag){font-size:11px;line-height:1.3;grid-column:1;grid-row:1}
 body.game-mode .game-challenge .challenge-element select{grid-column:2;grid-row:1}
 body.game-mode .game-challenge .challenge-element>.type-tag{grid-column:3;grid-row:1}
}

body.game-mode .game-challenge .challenge-card.selected>.challenge-rule-summary{display:block;font:500 11px/1.3 var(--body);color:#e1eaf0;margin-top:5px;letter-spacing:0}

/* Small modal content keeps its next action and complete companion names readable. */
body.game-mode .modal[data-modal=research-start] .research-intro{margin:0}
body.game-mode .modal[data-modal=research-start] .research-intro__offer{display:grid;gap:10px}
body.game-mode .modal[data-modal=research-start] .research-intro__project h3{font:600 27px/1.1 Pixelify,monospace;margin:0 0 8px;color:#ffe0a0}
body.game-mode .modal[data-modal=research-start] .research-intro__project p{margin:0 0 8px;font:400 13px/1.45 var(--body);color:#dae6ef}
body.game-mode .modal[data-modal=research-start] .research-intro__project .research-intro__timing{margin:0;color:#bee8dc;font-weight:600}
body.game-mode .modal[data-modal=research-start] .research-intro__decision{display:grid;gap:8px}
body.game-mode .modal[data-modal=research-start] .research-intro__reward{margin:0;padding:8px 10px;font:600 13px/1.4 var(--body);color:#ffdfa0}
body.game-mode .modal[data-modal=research-start] .research-intro__decision>.button{min-height:46px;padding:9px;font:700 14px/1.4 var(--body);margin:0}
body.game-mode .modal[data-modal=research-start] .research-intro__decision>.text-button{min-height:44px;font:600 13px/1.4 var(--body);margin:0;padding:7px}
body.game-mode .modal[data-modal=research-start] .research-intro__rules{border-top:1px solid #648c98;margin-top:10px}
body.game-mode .modal[data-modal=research-start] .research-intro__rules>summary{min-height:44px;box-sizing:border-box;align-content:center;font:600 13px/1.4 var(--body);color:#ffe0a0;cursor:pointer}
body.game-mode .modal[data-modal=research-start] .research-intro__rules>p{font-size:13px;line-height:1.5;margin:3px 0 8px}
body.game-mode .modal[data-modal=evolution] .evolution-celebration{padding:4px 0 0;display:grid;gap:10px;align-items:center}
body.game-mode .modal[data-modal=evolution] .evolution-glow{width:132px;height:132px;margin:0 auto}
body.game-mode .modal[data-modal=evolution] .evolution-glow .sprite{width:132px;height:132px;max-width:100%;max-height:100%;object-fit:contain}
body.game-mode .modal[data-modal=evolution] .evolution-result{min-width:0;text-align:center}
body.game-mode .modal[data-modal=evolution] .evolution-result .eyebrow{font-size:11px;line-height:1.4;color:#bee8dc}
body.game-mode .modal[data-modal=evolution] .evolution-result h2{font:600 32px/1.1 Pixelify,monospace;margin:5px 0;color:#fff2d6}
body.game-mode .modal[data-modal=evolution] .evolution-result p{font:400 14px/1.45 var(--body);margin:6px 0 10px}
body.game-mode .modal[data-modal=evolution] .evolution-result>.button{min-height:46px;margin:12px 0 0;padding:9px;font:700 14px/1.4 var(--body)}
body.game-mode .modal[data-modal=team-replace] .replacement-incoming{padding:8px;gap:9px;margin:0 0 8px;align-items:center}
body.game-mode .modal[data-modal=team-replace] .replacement-incoming>.sprite{width:48px;height:48px;flex:0 0 48px}
body.game-mode .modal[data-modal=team-replace] .replacement-incoming>span{min-width:0}
body.game-mode .modal[data-modal=team-replace] .replacement-incoming strong{font-size:20px;line-height:1.2}
body.game-mode .modal[data-modal=team-replace] .replacement-incoming small{font-size:12px;line-height:1.4}
body.game-mode .modal[data-modal=team-replace] .replacement-note{font:400 13px/1.45 var(--body);margin:0 0 10px}
body.game-mode .modal[data-modal=team-replace] .replacement-grid{gap:8px;margin:0 0 10px}
body.game-mode .modal[data-modal=team-replace] .replacement-grid>button{padding:8px;gap:8px;min-height:84px}
body.game-mode .modal[data-modal=team-replace] .replacement-grid>button>.sprite{width:44px;height:44px;flex:0 0 44px}
body.game-mode .modal[data-modal=team-replace] .replacement-grid>button>span{min-width:0}
body.game-mode .modal[data-modal=team-replace] .replacement-grid strong{font-size:21px;line-height:1.2;overflow-wrap:normal;word-break:normal}
body.game-mode .modal[data-modal=team-replace] .replacement-grid small{font-size:12px;line-height:1.4}
body.game-mode .modal[data-modal=team-replace] .replacement-grid b{font-size:12px;line-height:1.4}
body.game-mode .scout-modal .scout-roster{grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px}
body.game-mode .scout-modal .scout-roster>div{display:grid;grid-template-columns:minmax(0,1fr);justify-items:center;align-content:start;text-align:center;gap:4px;padding:8px}
body.game-mode .scout-modal .scout-roster>div>.sprite{width:48px;height:48px;flex:none}
body.game-mode .scout-modal .scout-roster>div>span{min-width:0;width:100%;display:grid;justify-items:center;gap:3px}
body.game-mode .scout-modal .scout-roster strong{font-size:21px;line-height:1.15;overflow-wrap:normal;word-break:normal;white-space:nowrap}
body.game-mode .scout-modal .scout-roster small{font-size:12px;line-height:1.4}
body.game-mode .scout-modal .scout-roster .type-tag{font-size:10px}
@media(max-width:360px){body.game-mode .scout-modal .scout-roster{grid-template-columns:repeat(2,minmax(0,1fr))}body.game-mode .scout-modal .scout-roster strong{font-size:20px}}
@media(max-height:500px) and (min-width:480px){
 body.game-mode .modal[data-modal=research-start] .research-intro__offer{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:start}
 body.game-mode .modal[data-modal=research-start] .research-intro__project h3{font-size:25px;margin-bottom:6px}
 body.game-mode .modal[data-modal=research-start] .research-intro__project p{font-size:12px;line-height:1.4;margin-bottom:6px}
 body.game-mode .modal[data-modal=research-start] .research-intro__decision{gap:6px}
 body.game-mode .modal[data-modal=research-start] .research-intro__reward{font-size:12px;line-height:1.4;padding:7px}
 body.game-mode .modal[data-modal=research-start] .research-intro__rules{margin-top:8px}
 body.game-mode .modal[data-modal=evolution] .evolution-celebration{grid-template-columns:96px minmax(0,1fr);gap:14px;padding:0}
 body.game-mode .modal[data-modal=evolution] .evolution-glow,body.game-mode .modal[data-modal=evolution] .evolution-glow .sprite{width:96px;height:96px}
 body.game-mode .modal[data-modal=evolution] .evolution-result h2{font-size:29px;margin:3px 0}
 body.game-mode .modal[data-modal=evolution] .evolution-result p{font-size:13px;margin:5px 0}
 body.game-mode .modal[data-modal=evolution] .evolution-result>.button{margin-top:9px}
 body.game-mode .modal[data-modal=team-replace]>.modal-body{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:8px 12px;align-items:start;align-content:start}
 body.game-mode .modal[data-modal=team-replace] .replacement-incoming{grid-column:1;grid-row:1;margin:0;gap:6px;padding:6px}
 body.game-mode .modal[data-modal=team-replace] .replacement-incoming>.sprite{width:36px;height:36px;flex-basis:36px}
 body.game-mode .modal[data-modal=team-replace] .replacement-incoming strong{font-size:18px}
 body.game-mode .modal[data-modal=team-replace] .replacement-note{grid-column:1;grid-row:2;margin:0;font-size:12px}
 body.game-mode .modal[data-modal=team-replace] .replacement-grid{grid-column:2;grid-row:1/4;grid-template-columns:minmax(0,1fr);margin:0}
 body.game-mode .modal[data-modal=team-replace]>.modal-body>.button{grid-column:1;grid-row:3;min-height:44px;font-size:12px;padding:8px;margin:0;white-space:normal}
}

body.game-mode .scout-modal .scout-sector{margin-bottom:10px;font-size:13px;line-height:1.4}
body.game-mode .scout-modal .scout-focus{display:grid;gap:10px;align-items:start}
body.game-mode .scout-modal .scout-focus .scout-recovery{grid-row:1;margin:0;padding:9px}
body.game-mode .scout-modal .scout-focus .scout-recovery strong{font-size:12px;line-height:1.4}
body.game-mode .scout-modal .scout-focus .scout-recovery p{font-size:13px;line-height:1.4;margin:5px 0 0}
body.game-mode .scout-modal .scout-focus .scout-target{margin:0;padding:10px}
body.game-mode .scout-modal .scout-focus .scout-target>.eyebrow{font-size:11px;line-height:1.3}
body.game-mode .scout-modal .scout-focus .scout-target h3{font-size:26px;margin:4px 0 8px}
body.game-mode .scout-modal .scout-focus .scout-target .scout-target-rule{font-size:12px;line-height:1.4;margin:7px 0 0}
body.game-mode .scout-modal .scout-actions{margin:10px 0;gap:8px}
body.game-mode .scout-modal .scout-actions>.button{min-height:44px;font-size:12px;padding:8px}
body.game-mode .scout-modal .scout-route-details{border-top:1px solid #648c98}
body.game-mode .scout-modal .scout-route-details>summary{min-height:44px;box-sizing:border-box;align-content:center;font:600 13px/1.4 var(--body);color:#ffe0a0;cursor:pointer;padding:7px 0}
@media(max-height:500px) and (min-width:480px){
 body.game-mode .scout-modal .scout-sector{margin-bottom:6px;font-size:12px}
 body.game-mode .scout-modal .scout-focus{grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr);gap:10px}
 body.game-mode .scout-modal .scout-focus .scout-target{grid-column:1;grid-row:1;padding:8px}
 body.game-mode .scout-modal .scout-focus .scout-recovery{grid-column:2;grid-row:1;padding:8px}
 body.game-mode .scout-modal .scout-roster{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 body.game-mode .scout-modal .scout-roster>div{padding:5px;gap:2px}
 body.game-mode .scout-modal .scout-roster>div>.sprite{width:32px;height:32px}
 body.game-mode .scout-modal .scout-roster strong{font-size:20px}
 body.game-mode .scout-modal .scout-roster small{font-size:11px}
 body.game-mode .scout-modal .scout-roster .type-tag{font-size:9px}
 body.game-mode .scout-modal .scout-focus .scout-target h3{font-size:24px;margin:4px 0 6px}
 body.game-mode .scout-modal .scout-focus .scout-target>.eyebrow{font-size:10px}
 body.game-mode .scout-modal .scout-focus .scout-recovery p{font-size:12px}
}

@media(max-height:500px) and (min-width:480px){
 body.game-mode .modal[data-modal=team-replace] .replacement-context{grid-column:1;grid-row:1;min-width:0;align-self:start}
 body.game-mode .modal[data-modal=team-replace] .replacement-context .replacement-note{margin-top:9px}
 body.game-mode .modal[data-modal=team-replace] .replacement-grid{grid-row:1}
 body.game-mode .modal[data-modal=team-replace]>.modal-body>.button{grid-row:2}
}

/* Protected capture shows the decision that can be taken now. */
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture:not(:has(.capture-card:not(:disabled))) .capture-advice{display:flex;flex-direction:column;align-items:stretch;gap:8px}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture:not(:has(.capture-card:not(:disabled))) .capture-advice>p{order:1}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .capture-advice>[data-action=prepare-catch]{order:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;justify-content:stretch;gap:6px;min-height:44px;width:100%;margin:0;padding:6px 8px;font:700 14px/1.25 var(--body)}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .capture-advice>[data-action=prepare-catch]>.icon{display:none}
body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .capture-advice>[data-action=prepare-catch]>small{grid-column:2;display:block;flex-basis:auto;margin:0;font:700 12px/1.25 var(--body);white-space:normal}
@media(max-width:700px){
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .capture-card{display:grid;grid-template-columns:minmax(0,1fr) 92px;min-width:0;height:auto;min-height:48px;max-height:none;padding:4px 6px;gap:6px;align-items:center}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .capture-card>.capture-orb{display:none}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .capture-card>span{min-width:0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .capture-card strong{font:700 16px/1.15 var(--body);white-space:normal}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .capture-card small{font:500 13px/1.2 var(--body);white-space:normal}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .capture-card>b{font:700 20px/1.1 var(--body);white-space:normal}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .capture-card>b small{display:block;font:500 12px/1.2 var(--body);white-space:normal}
}
@media(max-width:700px) and (min-height:501px){
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.capture-area.visitor-capture{height:clamp(260px,calc(100dvh - 514px),330px);max-height:clamp(260px,calc(100dvh - 514px),330px);left:var(--game-gutter);right:var(--game-gutter);width:auto;display:flex;flex-direction:column;gap:6px;padding:8px;overflow:auto}
 body.game-mode:has(.battle-shell .visitor-capture)[data-battle-format=singles] .battle-shell :is(.battle-message,.battle-bottom){visibility:hidden}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture>.controls-heading{order:-3;position:sticky;top:-8px;gap:4px 8px;padding-bottom:4px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .controls-heading>div>span{font:500 12px/1.3 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .visitor-requirements{padding:5px 6px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .visitor-requirements p{font:600 13px/1.3 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture .visitor-requirements p+p{margin-top:2px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture:has(.capture-card:not(:disabled))>.capture-options{order:-2;display:grid;grid-template-columns:minmax(0,1fr);gap:6px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture:has(.capture-card:not(:disabled))>.visitor-decision{order:0}
}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture:has(.capture-card:not(:disabled))>.capture-options{grid-row:1;align-self:start}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .capture-area.visitor-capture:has(.capture-card:not(:disabled))>.visitor-decision{grid-row:2}
 /* A complete switch is one full-width row inside the existing command lane. */
 body.game-mode:has(.battle-shell .tactical-switch)[data-battle-format=singles] .battle-shell :is(.battle-message,.battle-bottom){visibility:hidden}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.tactical-switch{left:var(--game-gutter);right:var(--game-gutter);width:auto;display:flex;flex-direction:column;gap:6px;padding:6px;overflow:auto}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.controls-heading{display:grid;grid-template-columns:minmax(0,1fr) 128px;gap:6px;align-items:center;min-height:44px;position:sticky;top:-6px;padding:0;margin:0;border-bottom:0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.controls-heading strong{display:block;font:600 24px/1 Pixelify,monospace}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.controls-heading>div>span{display:block;font:500 13px/1.35 var(--body);margin:2px 0 0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.controls-heading>.text-button{min-height:44px;min-width:0;padding:4px;font:600 14px/1.25 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.switch-grid{grid-template-columns:minmax(0,1fr);gap:6px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-card{display:grid;grid-template-columns:minmax(180px,.9fr) minmax(210px,1.1fr);align-items:center;gap:10px;min-height:64px;height:auto;padding:6px 8px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-identity{gap:8px;min-width:0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-identity>.sprite{width:44px;height:44px;flex:0 0 44px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-identity strong{font:600 22px/1.05 Pixelify,monospace}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-identity small{font:500 14px/1.25 var(--body);margin-top:3px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-forecast{display:flex;flex-direction:column;gap:3px;min-width:0;margin:0;padding:0 0 0 10px;border:0;border-left:1px solid #628395}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-forecast>span{font:600 14px/1.3 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-forecast>small{font:500 13px/1.3 var(--body)}
}
/* Doubles commands reserve the toolbar; content scrolls within its own row. */
@media(max-width:1000px){
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-commands.action-area:not(.double-replacements){display:grid;grid-template-columns:112px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 44px;gap:6px 8px;padding:8px;overflow:hidden;align-items:stretch}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-actor-tabs{grid-column:1;grid-row:1;display:flex;flex-direction:column;gap:6px;min-width:0;min-height:0;height:100%;overflow:auto}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-actor-tabs>button{flex:none;min-height:54px;padding:4px 6px;gap:3px}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-actor-tabs strong{font:600 20px/1.1 Pixelify,monospace;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:normal}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-actor-tabs small{font:500 12px/1.3 var(--body);white-space:normal;overflow-wrap:normal;max-width:100%}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-commands>.double-moves,
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-commands>.double-targets{grid-column:2;grid-row:1;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:none;grid-auto-rows:max-content;gap:6px;min-height:0;min-width:0;height:100%;max-height:100%;overflow:auto;align-content:start}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-moves>button{min-height:58px;height:auto;min-width:0;padding:6px}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-moves strong{font:600 22px/1.1 Pixelify,monospace;white-space:normal}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-moves small{font:500 12px/1.3 var(--body);white-space:normal}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-turn-actions{grid-column:1/-1;grid-row:2;position:static;bottom:auto;display:grid;grid-template-columns:72px minmax(0,1fr) 122px;gap:6px;min-height:44px;min-width:0;padding:0;margin:0;align-self:stretch}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-turn-actions>button{height:44px;min-height:44px;padding:5px;font:700 12px/1.25 var(--body);white-space:normal}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-turn-actions>span{font:700 12px/1.25 var(--body);max-width:none;align-self:center;white-space:normal}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-commands:has([data-action=double-reserve])>.double-actor-tabs{display:none}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-commands:has([data-action=double-reserve])>.double-targets{grid-column:1/-1}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets>button[data-action=double-reserve]{display:flex;align-items:center;justify-content:flex-start;min-height:64px;min-width:0;height:auto;padding:6px 10px;gap:12px;background:#263e53;color:#fff1d9;border:2px solid #7db9b6}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets>button[data-action=double-reserve]>.sprite{width:44px;height:44px;flex:0 0 44px}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets>button[data-action=double-reserve]>span{font:600 24px/1.1 Pixelify,monospace;white-space:normal;overflow-wrap:normal;min-width:0}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets>button[data-action=double-reserve] small{display:block;font:500 14px/1.3 var(--body);margin-top:3px;color:#d7e6eb}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets>.double-cancel{min-height:44px;height:auto;font:700 13px/1.3 var(--body)}
}
@media(max-width:1000px){
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets:not(:has([data-action=double-reserve])){gap:4px}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets:not(:has([data-action=double-reserve]))>span{font:700 12px/1 var(--body);margin:0;padding:0}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets>button[data-action=double-target]{display:grid;grid-template-columns:28px minmax(0,1fr);gap:6px;align-items:center;min-height:48px;height:auto;padding:3px 6px}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets>button[data-action=double-target]>.double-target-portrait{width:28px;height:28px;min-width:0}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets>button[data-action=double-target] .sprite{width:28px;height:28px;min-width:0}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets>button[data-action=double-target]>span:last-child{min-width:0;font:600 20px/1.05 Pixelify,monospace;white-space:normal;overflow-wrap:normal}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets>button[data-action=double-target] small{display:block;margin-top:1px;font:500 12px/1.2 var(--body);white-space:normal}
}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets:has([data-action=double-reserve]){grid-template-columns:100px minmax(0,1fr);gap:6px}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets:has([data-action=double-reserve])>span{grid-column:1;grid-row:1;align-self:start;font:700 12px/1.3 var(--body);margin:0;padding:0}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets:has([data-action=double-reserve])>button{grid-column:2}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets>button[data-action=double-reserve]{min-height:64px;padding:4px 6px;gap:8px}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-targets>button[data-action=double-reserve]>span{font-size:22px}
}
@media(max-width:700px) and (min-height:501px){
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.tactical-switch{display:flex;flex-direction:column;gap:6px;padding:8px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.controls-heading{display:grid;grid-template-columns:minmax(0,1fr) 110px;gap:4px 6px;align-items:center;margin:0;padding:0 0 4px;top:-8px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.controls-heading:not(:has(button)){grid-template-columns:minmax(0,1fr)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.controls-heading strong{font:600 22px/1.05 Pixelify,monospace}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.controls-heading>div>span{font:500 12px/1.25 var(--body);margin-top:3px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.controls-heading>.text-button{font:600 14px/1.25 var(--body);min-height:44px;padding:4px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-card{padding:6px 8px;min-height:96px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-forecast{gap:2px;margin-top:5px;padding-top:5px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-forecast :is(span,small){font:500 13px/1.2 var(--body)}
}
/* The same complete command rows also fit the wider arena lane. */
@media(min-width:1001px) and (min-height:501px){
 body.game-mode:has(.battle-shell .visitor-capture,.battle-shell .tactical-switch)[data-battle-format=singles] .battle-shell :is(.battle-message,.battle-bottom){visibility:hidden}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area:is(.visitor-capture,.tactical-switch){left:var(--game-gutter);right:var(--game-gutter);width:auto;padding:10px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.visitor-capture{display:grid;grid-template-columns:minmax(260px,1fr) minmax(210px,.8fr) minmax(280px,1fr);grid-template-rows:minmax(0,1fr);gap:12px;overflow:hidden}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .visitor-capture>.controls-heading{grid-column:1;grid-row:1;position:static;min-width:0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .visitor-capture>.visitor-decision{grid-column:2;grid-row:1;min-height:0;overflow:auto}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .visitor-capture>.capture-options{grid-column:3;grid-row:1;display:grid;grid-template-columns:minmax(0,1fr);gap:7px;min-height:0;overflow:auto;align-content:start}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .visitor-capture .capture-advice{margin:0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .visitor-capture .capture-card{display:grid;grid-template-columns:minmax(0,1fr) 105px;min-height:64px;padding:6px;gap:6px;align-items:center}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .visitor-capture .capture-card>.capture-orb{display:none}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .visitor-capture .capture-card strong{font:700 16px/1.2 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .visitor-capture .capture-card small{font:500 13px/1.2 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .visitor-capture .capture-card>b{font:700 20px/1 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .visitor-capture .capture-card>b small{display:block;font:500 12px/1.1 var(--body);white-space:normal}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.tactical-switch{display:flex;flex-direction:column;gap:6px;overflow:auto}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.controls-heading{display:grid;grid-template-columns:minmax(0,1fr) 140px;align-items:center;gap:6px;min-height:44px;position:sticky;top:-10px;padding:0;margin:0;border:0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.controls-heading strong{font:600 26px/1 Pixelify,monospace}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.controls-heading>div>span{display:block;font:500 14px/1.3 var(--body);margin-top:2px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch>.switch-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-card{display:grid;grid-template-columns:minmax(180px,.9fr) minmax(210px,1.1fr);align-items:center;gap:10px;min-height:64px;height:auto;padding:6px 8px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-identity{gap:8px;min-width:0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-identity>.sprite{width:44px;height:44px;flex:0 0 44px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-identity strong{font:600 22px/1.05 Pixelify,monospace}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-identity small{font:500 14px/1.25 var(--body);margin-top:3px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-forecast{display:flex;flex-direction:column;gap:3px;min-width:0;margin:0;padding:0 0 0 10px;border:0;border-left:1px solid #628395}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-forecast>span{font:600 14px/1.3 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .tactical-switch .switch-forecast>small{font:500 13px/1.3 var(--body)}
}

@media(max-width:700px) and (min-height:501px){
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-health strong{font:600 18px/1.05 Pixelify,monospace;overflow:visible;text-overflow:clip;white-space:nowrap}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-health .double-health-value{font:600 12px/1.15 var(--body)}
}

/* The blocked recovery reason gets a complete row before supplemental advice. */
@media(min-width:480px) and (max-width:1000px) and (max-height:500px), (min-width:1001px){
 body.game-mode:has(.battle-shell .recovery-bag)[data-battle-format=singles] .battle-shell :is(.battle-message,.battle-bottom){visibility:hidden}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .action-area.recovery-bag{left:var(--game-gutter);right:var(--game-gutter);width:auto;display:flex;flex-direction:column;gap:6px;padding:6px;overflow:auto}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .recovery-bag>.controls-heading{display:grid;grid-template-columns:minmax(0,1fr) 140px;align-items:center;gap:6px;min-height:44px;position:sticky;top:-6px;padding:0;margin:0;border:0}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .recovery-bag>.controls-heading strong{font:600 24px/1.05 Pixelify,monospace}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .recovery-bag>.controls-heading>.text-button{min-height:44px;padding:4px;font:600 14px/1.25 var(--body)}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .recovery-bag>.capture-options{display:grid;grid-template-columns:minmax(0,1fr);gap:6px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .recovery-bag .capture-card{min-height:44px;height:auto;padding:6px 8px}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .recovery-bag .capture-card strong{font:700 16px/1.2 var(--body);overflow-wrap:normal}
 body.game-mode:has(.battle-shell)[data-battle-format=singles] .battle-shell .recovery-bag .capture-card small{font:500 13px/1.3 var(--body);margin-top:3px;overflow-wrap:normal}
}

/* Candidate 3: root-r3.css */
/* Empty searches put recovery ahead of the optional expanded controls. */
body.game-mode .game-storage .storage-master:has(.roster-empty){display:flex;flex-direction:column}
body.game-mode .game-storage .storage-master:has(.roster-empty)>.storage-results{order:0}
body.game-mode .game-storage .storage-master:has(.roster-empty)>.storage-filters{order:1;margin-top:10px}
body.game-mode .game-storage .storage-results:has(.roster-empty) .storage-list{display:block}
body.game-mode .game-storage .roster-empty{padding:10px;min-height:0}
body.game-mode .game-storage .roster-empty>strong{font:600 25px/1.1 Pixelify,monospace}
body.game-mode .game-storage .roster-empty>p{font:400 14px/1.4 var(--body);margin:6px 0}
body.game-mode .game-storage .roster-empty>.button{min-height:44px;font:600 14px/1.3 var(--body);padding:8px}
/* A stock reward states its full recovery restriction before committing. */
body.game-mode .game-loot .loot-choice.run-reward.run-reward--recovery{grid-template-columns:minmax(0,1fr) 12px;gap:6px;padding:8px;min-height:44px}
body.game-mode .game-loot .run-reward--recovery>.run-reward-icon{display:none}
body.game-mode .game-loot .run-reward--recovery .loot-choice__text{display:flex;flex-direction:column;gap:5px;min-width:0}
body.game-mode .game-loot .run-reward--recovery .loot-choice__text :is(strong,small,b){display:block;margin:0}
body.game-mode .game-loot .run-reward--recovery .loot-choice__text strong{font-size:24px;line-height:1.1}
body.game-mode .game-loot .run-reward--recovery .loot-choice__text :is(small,b){font:400 14px/1.35 var(--body)}
body.game-mode .game-loot .run-reward--recovery .loot-choice__text b{font-weight:700;color:#ffe0a0}
@media(max-width:650px) and (max-height:650px){
 body.game-mode .game-overlay>:is(.game-adventure-menu,.game-loot){top:8px;bottom:8px;left:8px;right:8px;width:auto;max-width:none;transform:none;max-height:none}
 body.game-mode .game-loot .game-window__heading h1{font-size:25px}
 body.game-mode .game-loot .loot-summary{padding:0 0 8px;margin:0}
 body.game-mode .game-loot .loot-summary p{font-size:14px;line-height:1.4}
 body.game-mode .game-loot .reward-commitment{padding:8px;margin:8px 0;font-size:14px;line-height:1.4}
 body.game-mode .game-loot .game-window__body{gap:8px}
}
@media(min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-window.game-loot>.game-window__body{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:8px 10px;align-items:start;align-content:start}
 body.game-mode .game-loot .loot-summary{grid-column:1;grid-row:1;min-height:0;padding:0 0 6px;margin:0}
 body.game-mode .game-loot .loot-summary p{font-size:14px;line-height:1.4}
 body.game-mode .game-loot .reward-commitment{grid-column:1;grid-row:2;padding:8px;margin:0;font-size:14px;line-height:1.4}
 body.game-mode .game-loot .game-loot-choices{grid-column:2;grid-row:1/5;align-self:start;gap:8px;margin:0}
 body.game-mode .game-loot .game-loot-tools{grid-column:1;grid-row:3;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:0;padding:0}
 body.game-mode .game-loot .game-loot-tools>.button{min-height:44px;font-size:13px;padding:6px;white-space:normal}
 body.game-mode .game-loot .run-horizon{grid-column:1/-1;grid-row:5}
 body.game-mode .game-loot .earned-notices{grid-column:1/-1;grid-row:6}
}
body.game-mode .game-loot .run-reward--recovery .loot-choice__text{grid-column:1;grid-row:1}
body.game-mode .game-loot .run-reward--recovery .loot-pointer{grid-column:2;grid-row:1}
body.game-mode .game-loot .game-loot-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
body.game-mode .game-loot .game-loot-tools>.button{width:auto;min-width:0;min-height:44px;margin:0;padding:8px;font:600 14px/1.3 var(--body);white-space:normal;justify-content:center}
body.game-mode .game-loot .game-loot-tools>.reroll-rewards{grid-column:1/-1;margin:0!important}

/* Native WebKit selects must retain a full touch target. */
body.game-mode .game-research .research-mastery>label>select[data-field="mastery-focus"]{min-height:44px;height:44px;font-size:14px}

/* Candidate 3: combat-queued-r3.css */
/* Both compact orders stay visible before the turn is committed. */
@media(min-width:480px) and (max-width:700px) and (max-height:500px){
 body.game-mode[data-screen=battle][data-battle-format=doubles]{--game-dock-height:154px}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-commands.action-area:not(.double-replacements){height:154px;max-height:154px;padding:6px;grid-template-columns:188px minmax(0,1fr)}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .battle-message{height:154px}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-actor-tabs{gap:2px}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-actor-tabs>button{min-height:44px;padding:2px 4px;gap:1px;justify-content:center}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-actor-tabs strong{font:600 18px/1.05 Pixelify,monospace}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-actor-tabs small{font:500 12px/1.2 var(--body);margin:0}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-health{height:64px;min-height:64px;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:19px 12px 5px 14px;gap:1px 3px;padding:3px 6px}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-health strong{grid-column:1/-1;grid-row:1;font:600 18px/1.05 Pixelify,monospace;white-space:nowrap;overflow:visible;text-overflow:clip;overflow-wrap:normal}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-health>div>small{grid-column:2;grid-row:2;align-self:center;margin:0;font:600 11px/1.2 var(--body)}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-health-types{grid-column:1;grid-row:2;gap:2px;margin:0}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-health-track{grid-column:1/-1;grid-row:3;height:5px;margin:0}
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-health .double-health-value{grid-column:1/-1;grid-row:4;font:600 12px/1.15 var(--body);margin:0}
}
@media(max-width:700px) and (min-height:501px){
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-commands.action-area:not(.double-replacements){grid-template-columns:148px minmax(0,1fr)}
}
@media(min-width:701px) and (max-width:1000px) and (max-height:500px){
 body.game-mode[data-screen=battle][data-battle-format=doubles] .double-commands.action-area:not(.double-replacements){grid-template-columns:188px minmax(0,1fr)}
}

/* Candidate 3: classic-context-r3.css */
body.game-mode .game-classic--challenge .classic-challenge-tools{position:relative;z-index:5;flex:none;display:flex;justify-content:space-between;align-items:end;gap:6px}
body.game-mode .game-classic--challenge .classic-challenge-rules{margin-left:auto;flex:none;min-width:0}
body.game-mode .game-classic--challenge .classic-challenge-rules>summary{display:flex;align-items:center;justify-content:center;min-width:96px;min-height:44px;margin:0;padding:5px 8px;border:2px solid #7dbbb8;background:#29495b;color:#ffe3ab;font:600 14px/1.25 var(--body);cursor:pointer;list-style:none}
body.game-mode .game-classic--challenge .classic-challenge-rules>summary::before{content:'▸';margin-right:5px}
body.game-mode .game-classic--challenge .classic-challenge-rules[open]>summary{background:#f0d59a;color:#203744}
body.game-mode .game-classic--challenge .classic-challenge-rules[open]>summary::before{content:'▾'}
body.game-mode .game-classic--challenge .classic-challenge-rules__body{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:6;max-height:min(220px,calc(100dvh - 140px));overflow:auto;padding:10px;border:2px solid #85c7c0;background:#26364d;color:#edf0e7;box-shadow:0 4px #132238;font:400 14px/1.4 var(--body)}
body.game-mode .game-classic--challenge .classic-challenge-rules__body>strong{font:600 22px/1.1 Pixelify,monospace;color:#ffe2a1}
body.game-mode .game-classic--challenge .classic-challenge-rules__body>p{margin:6px 0 0;font:400 14px/1.4 var(--body)}
@media(max-width:700px) and (min-height:501px), (min-width:480px) and (max-width:1000px) and (max-height:500px){
 body.game-mode .game-classic--challenge .classic-challenge-tools{display:grid;grid-template-columns:minmax(0,1fr) 96px;gap:4px 6px;align-items:end}
 body.game-mode .game-classic--challenge .classic-challenge-tools>.classic-phone-nav{display:contents}
 body.game-mode .game-classic--challenge .classic-phone-summary{grid-column:1/-1;grid-row:1}
 body.game-mode .game-classic--challenge .classic-phone-nav>nav{grid-column:1;grid-row:2;grid-template-columns:1fr 1fr 1.15fr;gap:4px}
 body.game-mode .game-classic--challenge .classic-phone-nav>nav>button{min-width:0;min-height:44px;padding:3px;font:600 13px/1.2 var(--body)}
 body.game-mode .game-classic--challenge .classic-challenge-rules{grid-column:2;grid-row:2;width:96px;margin:0}
 body.game-mode .game-classic--challenge .game-window__heading h1{font:600 24px/1.05 Pixelify,monospace;overflow-wrap:normal}
 body.game-mode .game-classic--challenge .game-window__heading p{font:400 13px/1.3 var(--body);margin-top:3px}
}

/* Keep WebKit's native select semantics with a full44px rendered field. */
body.game-mode .game-research .research-mastery>label>select[data-field="mastery-focus"]{appearance:none;-webkit-appearance:none;box-sizing:border-box;flex:1 0 0%;align-self:stretch;min-height:44px;height:44px;padding:8px 32px 8px 10px;font:600 14px/20px var(--body);background-image:linear-gradient(45deg,transparent 50%,#ffe1a3 50%),linear-gradient(135deg,#ffe1a3 50%,transparent 50%);background-position:calc(100% - 17px) center,calc(100% - 12px) center;background-size:5px 5px;background-repeat:no-repeat}
