/* Scoped preparation and Field Guide additions. */
body.game-mode .roster-console .roster-detail__backbar{margin-bottom:0;gap:8px}
body.game-mode .roster-console .roster-back{display:inline-flex;align-items:center;gap:8px;white-space:nowrap;font-size:22px}
body.game-mode .roster-console .roster-sheet-nav{position:sticky;top:57px;z-index:2;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:6px 0 8px;margin-bottom:10px;background:#192d3cf7;border-bottom:2px solid #68aaa5}
body.game-mode .roster-console .roster-sheet-nav>button{min-width:0;min-height:44px;padding:6px 10px;border:2px solid #79b7b2;background:#243d50;color:#ffdfa4;font:600 20px/1.2 Pixelify,monospace;box-shadow:inset 0 2px #b5efdc22,inset 0 -2px #102532}
body.game-mode .roster-console .roster-sheet-nav>button:hover{background:#34596b;border-color:#ffdfa4}
body.game-mode .roster-console .roster-sheet-nav>button:focus-visible{outline:3px solid #ffe2a7;outline-offset:1px}
body.game-mode .roster-console [data-roster-section]{scroll-margin-top:128px}
body.game-mode .roster-console .roster-profile>summary,body.game-mode .roster-console .roster-lore>summary{font:600 22px/1.2 Pixelify,monospace;min-height:52px;padding:7px 0;color:#ffe0a0}
body.game-mode .roster-console .complete-stats{gap:8px;margin:10px 0 14px}
body.game-mode .roster-console .complete-stats>div{border:2px solid #5d9190;border-radius:0;background:linear-gradient(135deg,#74abaf13 0 40%,transparent 40%),#1c3544;padding:10px 5px;box-shadow:inset 0 2px #a3e4d51a}
body.game-mode .roster-console .complete-stats>div>span{font:500 14px/1.4 var(--body);color:#d8e9e3}
body.game-mode .roster-console .complete-stats>div>strong{font:600 30px/1.1 Pixelify,monospace;color:#fff0ca}
body.game-mode .roster-console .trait-sheet{gap:8px}
body.game-mode .roster-console .trait-sheet>div,body.game-mode .roster-console .trait-sheet>button{border:3px double #76aaa3;border-radius:0;padding:12px;background:linear-gradient(125deg,#487c811c 0 40%,transparent 40%),#203c4b;box-shadow:inset 0 0 0 2px #152c38}
body.game-mode .roster-console .trait-sheet span{font:600 12px/1.4 var(--body);letter-spacing:.8px;color:#b9ded3}
body.game-mode .roster-console .trait-sheet strong{font:600 23px/1.2 Pixelify,monospace;color:#ffe1a1;margin-top:4px}
body.game-mode .roster-console .trait-sheet small{font:400 14px/1.55 var(--body);color:#d7e7e1}
body.game-mode .roster-console .individual-training{border:2px solid #6c9f99;background:#183340;padding:0 10px 12px;margin-top:14px}
body.game-mode .roster-console .individual-training>summary{font:600 14px/1.4 var(--body);min-height:52px;color:#ffdfa4;gap:8px;padding:7px 0}
body.game-mode .roster-console .individual-training>summary>span{font:500 12px/1.4 var(--body);color:#c7e2d8;white-space:nowrap}
body.game-mode .roster-console .individual-training p,body.game-mode .roster-console .individual-training table{font:400 14px/1.6 var(--body);color:#d9e7e1}
body.game-mode .roster-console .individual-training p strong{color:#fff0c9}
body.game-mode .roster-console .individual-training th,body.game-mode .roster-console .individual-training td{padding:8px 3px;border-bottom:1px solid #476b6e;font-size:14px}
body.game-mode .roster-console .individual-training th{font-weight:600;color:#e5efe7}
body.game-mode .roster-console .individual-training td:last-child{font-weight:700;color:#ffe0a0}
body.game-mode .roster-console .individual-training abbr{text-decoration:none}
body.game-mode .roster-console .roster-lore>p{font:400 14px/1.6 var(--body);color:#d7e7df;padding:0 4px}
body.game-mode .game-storage .roster-sheet-nav{background:#213648f7;top:44px}
body.game-mode .game-storage .roster-console--from-list .roster-sheet-nav{top:0}
body.game-mode .game-storage .roster-console--from-list [data-roster-section]{scroll-margin-top:66px}
body.game-mode .game-collection .guide-owned>.button{display:grid;grid-template-columns:minmax(0,1fr) auto;min-width:0;width:100%;max-width:100%;padding:10px;gap:4px 8px;text-align:left}
body.game-mode .game-collection .guide-owned>.button>span{min-width:0;overflow-wrap:anywhere;grid-column:1}
body.game-mode .game-collection .guide-owned>.button>small{grid-column:1;white-space:normal;overflow-wrap:anywhere}
body.game-mode .game-collection .guide-owned>.button>.icon{grid-column:2;grid-row:1/3}
body.game-mode .game-collection .species-base-stats{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
body.game-mode .game-collection .species-base-stats>span{display:grid;gap:6px;min-width:0;font:500 14px/1.3 var(--body);color:#d9e9e2;text-align:center;border:2px solid #5d9190;background:#1b3544;padding:10px 4px}
body.game-mode .game-collection .species-base-stats>span>b{float:none;font:600 28px/1 Pixelify,monospace;color:#ffe1a1}
body.game-mode .game-collection .species-mechanics :is(p,.species-learnset>span){font:400 14px/1.6 var(--body);color:#d7e7df}
body.game-mode .game-collection .species-mechanics h3{font:600 24px/1.2 Pixelify,monospace;color:#ffdfa4;margin:16px 0 8px}
body.game-mode .game-collection .species-abilities p{border-left:3px solid #68aaa5;background:#1c3545;padding:9px 10px;margin:8px 0}
body.game-mode .game-collection .species-abilities p>strong,body.game-mode .game-collection .species-abilities p>span{display:block;font:inherit}
body.game-mode .game-collection .species-abilities p>strong{font-weight:700;color:#f1ead1;margin-bottom:3px}
body.game-mode .game-collection .species-mechanics .species-catch-note{padding:10px;border:1px solid #688f8c;background:#243746}
body.game-mode .game-collection .species-growth>summary{min-height:44px;font:600 14px/1.4 var(--body);color:#ffdfa4}
body.game-mode .game-collection .species-learnset{gap:0}
body.game-mode .game-collection .species-learnset>span{display:flex;gap:12px;border-bottom:1px solid #47686d;padding:8px 4px}
body.game-mode .game-collection .species-learnset>span>b{font:600 14px/1.6 var(--body);min-width:50px;color:#ffdfa4}
@media(max-width:700px){
 body.game-mode .game-overlay>.game-window.game-collection{inset:6px;transform:none;max-width:none;max-height:none;width:auto;height:auto;margin:0}
 body.game-mode .game-collection>.game-window__heading{padding:8px 10px;min-height:62px}
 body.game-mode .game-collection>.game-window__heading h1{font:600 27px/1.1 Pixelify,monospace}
 body.game-mode .game-collection>.game-window__heading .game-window__close{font:600 14px/1.3 var(--body);min-height:44px;max-width:128px;padding:6px 8px}
 body.game-mode .game-collection>.game-window__body{padding:10px;min-height:0;flex:1;overflow:auto}
 body.game-mode .game-collection .guide-console{padding:0;min-width:0}
 body.game-mode .game-collection .page-heading{padding:0 0 9px;margin:0 0 9px;gap:8px}
 body.game-mode .game-collection .page-heading p{font-size:14px;line-height:1.4;margin:0}
 body.game-mode .game-collection .collection-total{flex:none}
 body.game-mode .game-collection .collection-total strong{font-size:28px}
 body.game-mode .game-collection .collection-total>small{font-size:10px;letter-spacing:.3px}
 body.game-mode .game-collection .management-links{margin:0 0 10px;gap:8px}
 body.game-mode .game-collection .management-links .button{min-height:44px;padding:8px 6px;font-size:14px}
 body.game-mode .game-collection .collection-toolbar{display:grid;grid-template-columns:minmax(0,1fr) 108px;gap:8px;padding:8px;margin-bottom:10px}
 body.game-mode .game-collection .collection-toolbar .segmented{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
 body.game-mode .game-collection .collection-toolbar .segmented button{font-size:14px;min-height:44px;padding:6px 3px}
 body.game-mode .game-collection .collection-toolbar :is(input,select){width:100%;min-width:0;min-height:44px;padding:7px;font-size:16px}
 body.game-mode .game-collection .dex-grid,body.game-mode .game-collection .dex-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 body.game-mode .game-collection .dex-card{min-width:0;min-height:130px;padding:22px 5px 8px;gap:3px}
 body.game-mode .game-collection .dex-card>.sprite{width:64px;height:64px}
 body.game-mode .game-collection .dex-card strong{font:600 20px/1.2 Pixelify,monospace;overflow-wrap:normal;word-break:normal}
 body.game-mode .game-collection .dex-detail{min-width:0;max-width:100%;padding:0;border-radius:0}
 body.game-mode .game-collection .detail-content{padding:12px;min-width:0}
 body.game-mode .game-collection .detail-content>h2{font-size:32px}
 body.game-mode .game-collection .detail-art{height:178px;min-height:0}
 body.game-mode .game-collection .detail-art>.detail-sprite{width:144px;height:144px}
 body.game-mode .roster-console .roster-detail__backbar>span{display:none}
 body.game-mode .roster-console .roster-detail__backbar{min-height:48px}
 body.game-mode .roster-console .roster-back{font:600 22px/1.1 Pixelify,monospace;min-height:44px;padding:6px 0}
 body.game-mode .roster-console .roster-sheet-nav{top:48px;padding:5px 0 7px}
 body.game-mode .roster-console [data-roster-section]{scroll-margin-top:118px}
 body.game-mode .game-storage .roster-sheet-nav{top:44px}
 body.game-mode .game-storage .roster-console--from-list .roster-sheet-nav{top:0}
 body.game-mode .game-storage .roster-console--from-list [data-roster-section]{scroll-margin-top:66px}
}
@media(max-width:360px){
 body.game-mode .game-collection .dex-grid,body.game-mode .game-collection .dex-grid.compact{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.game-mode .game-collection .dex-card strong{font-size:23px}
 body.game-mode .roster-console .individual-training>summary{flex-wrap:wrap;gap:2px;padding:8px 0}
 body.game-mode .roster-console .individual-training>summary>span{font-size:12px}
}
@media(min-width:701px) and (max-height:500px){
 body.game-mode .roster-console .roster-sheet-nav{top:44px}
 body.game-mode .roster-console [data-roster-section]{scroll-margin-top:112px}
 body.game-mode .game-storage .roster-console--from-list .roster-sheet-nav{top:0}
 body.game-mode .game-storage .roster-console--from-list [data-roster-section]{scroll-margin-top:66px}
}
@media(max-width:600px){
 body.game-mode .modal .held-item-library article{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px;gap:10px}
 body.game-mode .modal .held-item-library article>div{grid-column:1/-1}
 body.game-mode .modal .held-item-library article>button{min-height:44px;font-size:14px;padding:8px;white-space:normal}
 body.game-mode .modal .held-item-library article>button:first-of-type{grid-column:1}
 body.game-mode .modal .held-item-library article>button:last-of-type{grid-column:2}
}
/* A species profile needs the full compact frame, including landscape tablets. */
@media(max-width:1000px){
 body.game-mode .game-collection .dex-layout{display:block}
 body.game-mode .game-collection .guide-console.guide--detail :is(.page-heading,.management-links,.collection-toolbar,.dex-grid){display:none}
 body.game-mode .game-collection .guide-console:not(.guide--detail) .dex-detail{display:none}
 body.game-mode .game-collection .guide-console.guide--detail .dex-detail{position:static;width:100%;max-width:100%;min-width:0}
}
@media(min-width:1001px){
 body.game-mode .game-collection .dex-layout{grid-template-columns:minmax(0,1fr) minmax(360px,34%)}
}
/* The family stays available on compact screens; unknown names remain undiscovered. */
body.game-mode .game-collection .evolution-chain{display:flex;flex-wrap:wrap;gap:6px;padding-top:12px;margin-top:16px}
body.game-mode .game-collection .evolution-chain:before{content:'Evolution family';flex:0 0 100%;font:600 24px/1.2 Pixelify,monospace;color:#ffdfa4;text-align:left;margin-bottom:4px}
body.game-mode .game-collection .evolution-chain>span{min-width:0;flex:1}
body.game-mode .game-collection .evolution-chain .sprite{width:56px;height:56px}
body.game-mode .game-collection .evolution-chain small{font:500 14px/1.4 var(--body);overflow-wrap:anywhere}
body.game-mode .game-collection .guide-owned>.button>small{border:0;background:none;padding:0;box-shadow:none;font:500 14px/1.4 var(--body);color:#243844}
body.game-mode .game-collection .collection-toolbar input::placeholder{font:400 14px/1.4 var(--body);color:#c9dcd9}

/* Keep the name above an independently wrapping level in compact landscape cards. */
@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__name{flex-wrap:wrap;justify-content:flex-start;gap:2px 8px}
 body.game-mode .game-team .roster-console:not(.storage-console).roster-console--detail .roster-identity__name>h2{flex:1 0 100%;min-width:0}
 body.game-mode .game-team .roster-console:not(.storage-console).roster-console--detail .roster-identity__name>span{flex:none}
}

/* Keep Storage detail within its existing native scrolling sheet. */
body.game-mode .game-storage .storage-console.roster-console--detail .team-workbench{max-height:100%}
