/* V103: Emerald windows. Frames are the original graphics (assets/ui-emerald, scripts/import-ui-v103.cjs):
   the teal message box (WindowFunc_DrawDialogueFrame tile layout) and the standard menu frame (std.png).
   Loaded last; one GBA pixel = 1.5 CSS pixels, so an 8 px frame tile is 12 px. */
:root{--gba-ink:#505058;--gba-shadow:#d0d0c8;--gba-px:1.5px}
.gba-text{color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow)}

/* Message box (dialogue, signs, notices) */
#appShell .message-box.window-frame{left:4px;right:4px;bottom:4px;margin:0;padding:6px 8px;border-style:solid;border-width:12px 24px;border-color:transparent;border-radius:0;
 border-image:url("./assets/ui-emerald/dialog-frame.png?h=4089a85408") 8 16 fill / 12px 24px stretch;background:none;box-shadow:none;image-rendering:pixelated}
#appShell .message-box #messageText{margin:0;font-size:17px;line-height:1.6;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);white-space:pre-line;overflow-wrap:anywhere}
#appShell .message-box.is-dialogue #messageText{height:3.2em;overflow:hidden}
.message-box .msg-rest{visibility:hidden}
.message-box .msg-arrow{position:absolute;right:-12px;bottom:-4px;width:12px;height:12px;display:none;background:url("./assets/ui-emerald/down-arrow.png?h=41e34f41d1") 0 0/12px 72px no-repeat;image-rendering:pixelated;animation:gba-arrow .6s steps(6) infinite}
.message-box .msg-arrow.is-on{display:block}
@keyframes gba-arrow{to{background-position:0 -72px}}

/* Standard window frame */
.gba-window,#appShell .start-menu-window{border-style:solid;border-width:12px;border-color:transparent;border-radius:0;border-image:url("./assets/ui-emerald/menu-frame.png?h=d5eb6dffca") 8 fill / 12px stretch;background:none;box-shadow:none;image-rendering:pixelated}

/* Start menu: a window on the right with the ▶ cursor, like the original. */
#appShell .start-menu-window{padding:2px 4px}
#appShell .start-menu .menu-item{position:relative;background:none;border:0;border-radius:0;box-shadow:none;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);font-size:17px;min-height:42px;padding:6px 8px 6px 26px;text-align:left}
#appShell .start-menu .menu-item.is-selected{background:none;color:var(--gba-ink)}
#appShell .start-menu .menu-item.is-selected::before{content:"▶";position:absolute;left:6px;top:50%;transform:translateY(-50%);font-size:13px;color:var(--gba-ink);border:0}

/* Service panels (choicePanel with a list): shown over the field like an Emerald conversation —
   the lines in the message box at the bottom, the options in a window on the right, the title in a small
   window at the top left (money, place). */
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode){background:transparent;backdrop-filter:none;pointer-events:none}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .placeholder-window{position:absolute;inset:0;width:auto;height:auto;max-height:none;padding:4px;display:block;background:transparent;border:0;box-shadow:none;overflow:visible}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) :is(.placeholder-symbol,.window-help,.menu-back){display:none}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .window-title{position:absolute;left:4px;top:4px;max-width:62%;min-height:0;margin:0;padding:2px 6px;pointer-events:auto;
 border-style:solid;border-width:12px;border-color:transparent;border-image:url("./assets/ui-emerald/menu-frame.png?h=d5eb6dffca") 8 fill / 12px stretch;background:none;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);font-size:15px;line-height:1.4;font-weight:400;white-space:normal}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices{position:absolute;left:4px;right:4px;bottom:4px;top:64px;display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-end;gap:4px;padding:0;overflow:visible;grid-template-columns:none}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions{order:1;flex:0 1 auto;min-height:0;width:max-content;min-width:44%;max-width:86%;overflow:auto;overscroll-behavior:contain;margin:0;padding:2px 2px;pointer-events:auto;
 border-style:solid;border-width:12px;border-color:transparent;border-image:url("./assets/ui-emerald/menu-frame.png?h=d5eb6dffca") 8 fill / 12px stretch;background:none;display:block}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-notes{order:2;align-self:stretch;flex:none;max-height:36%;overflow:auto;margin:0;padding:6px 8px;pointer-events:auto;
 border-style:solid;border-width:12px 24px;border-color:transparent;border-image:url("./assets/ui-emerald/dialog-frame.png?h=4089a85408") 8 16 fill / 12px 24px stretch;background:none;box-shadow:none;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);font-size:16px;line-height:1.55}
#placeholderScreen[data-menu-view="choices"] .view-choices .menu-notes p{margin:0 0 2px;padding:0;border:0}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions .party-choice{min-height:40px;padding:6px 10px 6px 26px;border:0;background:none;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);font-size:16px;line-height:1.35;text-align:left;white-space:normal;box-shadow:none}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions .party-choice.is-selected{background:none}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions .party-choice.is-selected::before{content:"▶";left:8px;top:50%;transform:translateY(-50%);border:0;width:auto;height:auto;font-size:12px;color:var(--gba-ink)}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions .party-choice:has(.party-icon){padding-right:56px;min-height:52px}
#placeholderScreen[data-menu-view="choices"] .view-choices .menu-actions .option-row{display:flex;justify-content:space-between;gap:14px}
/* Rows written "name · price" or "name ¥price" show the price right-aligned, like the mart list. */
#placeholderScreen .view-choices .menu-actions .gba-price{float:right;margin-left:14px}

/* Battle: the message box frame for the text; commands and moves in standard windows on the right. */
#battleScreen .battle-ui{position:relative;display:grid;grid-template-columns:minmax(0,1fr);gap:0;padding:8px 10px;border-style:solid;border-width:12px 24px;border-color:transparent;border-radius:0;
 border-image:url("./assets/ui-emerald/dialog-frame.png?h=4089a85408") 8 16 fill / 12px 24px stretch;background:none;box-shadow:none;image-rendering:pixelated}
#battleScreen .battle-ui p{color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);font-size:17px;line-height:1.55;white-space:pre-line;margin:0;min-height:3.1em}
#battleScreen .battle-choices{min-height:0}
#battleScreen .battle-choices button{position:relative;background:none;border:0;border-radius:0;box-shadow:none;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);font-size:17px;min-height:42px;padding:4px 6px 4px 24px;text-align:left}
#battleScreen .battle-choices button.is-selected{background:none;color:var(--gba-ink)}
#battleScreen .battle-choices button.is-selected::before{content:"▶";position:absolute;left:6px;top:50%;transform:translateY(-50%);font-size:12px}
#battleScreen .battle-choices button:disabled{color:#a0a0a0;text-shadow:none}
/* Command / bag: text on the left, a 2×2 window on the right (the Emerald battle menu). */
#battleScreen:is([data-phase="command"],[data-phase="bag"]) .battle-ui{grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);align-items:stretch;column-gap:6px;padding-right:0}
#battleScreen:is([data-phase="command"],[data-phase="bag"]) .battle-choices{grid-template-columns:1fr 1fr;align-content:center;margin:-10px -24px -10px 0;
 border-style:solid;border-width:12px;border-color:transparent;border-image:url("./assets/ui-emerald/menu-frame.png?h=d5eb6dffca") 8 fill / 12px stretch;background:none;padding:0 2px}
#battleScreen[data-phase="bag"] .battle-choices{grid-template-columns:1fr}
/* Fight: moves 2×2 across, PP and type of the selected move in a window on the right; no text. */
#battleScreen[data-phase="fight"] .battle-ui{grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);column-gap:6px;padding-right:0}
#battleScreen[data-phase="fight"] .battle-ui > p{display:none}
#battleScreen[data-phase="fight"] .battle-choices{grid-template-columns:1fr 1fr;align-content:center}
#battleScreen[data-phase="fight"] .battle-choices button{font-size:15px;padding-left:20px;min-height:40px}
#battleScreen .battle-choices .mv-pp{display:none}
#battleScreen .battle-info{display:none}
#battleScreen[data-phase="fight"] .battle-info{display:flex;flex-direction:column;justify-content:center;gap:4px;margin:-10px 0 -10px 0;white-space:nowrap;padding:0 8px;
 border-style:solid;border-width:12px;border-color:transparent;border-image:url("./assets/ui-emerald/menu-frame.png?h=d5eb6dffca") 8 fill / 12px stretch;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);font-size:15px;line-height:1.45}
#battleScreen .battle-info .pp-low{color:#e08030}#battleScreen .battle-info .pp-empty{color:#d04030}
/* Text-only phases: no "继续" button — the whole box is the tap target and the red arrow blinks. */
#battleScreen:is([data-phase="intro"],[data-phase="result"]) .battle-choices{position:absolute;inset:-12px -24px;min-height:0;display:block}
#battleScreen:is([data-phase="intro"],[data-phase="result"]) .battle-choices button{position:absolute;inset:0;width:100%;height:100%;padding:0;color:transparent;text-shadow:none;font-size:0}
#battleScreen:is([data-phase="intro"],[data-phase="result"]) .battle-choices button::before{content:"";position:absolute;left:auto;top:auto;right:12px;bottom:10px;transform:none;width:12px;height:12px;background:url("./assets/ui-emerald/down-arrow.png?h=41e34f41d1") 0 0/12px 72px no-repeat;image-rendering:pixelated;animation:gba-arrow .6s steps(6) infinite}
#battleScreen[data-phase="turn"] .battle-choices{display:none}
@media(orientation:landscape) and (max-height:560px){#battleScreen .battle-ui p,#battleScreen .battle-choices button{font-size:15px}#battleScreen .battle-choices button{min-height:36px}}
/* Fixed box height in every phase, so the scene above never moves. */
#battleScreen .battle-ui{flex:none;height:138px;max-height:none;min-height:0;overflow:hidden}
#battleScreen .battle-ui > p{overflow:auto}
@media(orientation:landscape) and (max-height:560px){#battleScreen .battle-ui{height:112px}}
/* Start menu help text: in the message box, like the menu descriptions of the originals. */
#appShell #startInfo{border-style:solid;border-width:12px 24px;border-color:transparent;border-radius:0;border-image:url("./assets/ui-emerald/dialog-frame.png?h=4089a85408") 8 16 fill / 12px 24px stretch;background:none;box-shadow:none;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);padding:4px 6px}
#appShell #startInfo .start-heading{font-size:16px;font-weight:400}
#appShell #startInfo p{font-size:15px;margin:2px 0}
#appShell #startInfo .start-counts{border:0;color:var(--gba-ink);font-size:13px;gap:10px}
#appShell #startInfo .start-location{color:#808088}
#battleScreen .battle-choices button{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#battleScreen:is([data-phase="command"],[data-phase="bag"]) .battle-ui{grid-template-columns:minmax(0,.95fr) minmax(0,1.2fr)}
#battleScreen:is([data-phase="command"],[data-phase="bag"]) .battle-choices{margin:-8px -14px -8px 0}#battleScreen[data-phase="fight"] .battle-info{margin:-8px 0 -8px 0}
#battleScreen:is([data-phase="command"],[data-phase="bag"]) .battle-choices button{padding-left:20px;font-size:16px}
#battleScreen[data-phase="fight"] .battle-choices button{display:flex;flex-direction:column;justify-content:center;line-height:1.2}
#battleScreen .battle-choices .mv-mark{display:block;font-size:11px;color:#708070;text-shadow:none;margin-top:1px}
/* Full-screen menus (party, bag, summary, storage, records): no web-style header bar or hint footer.
   The title sits in a small window, and B / 取消 is a window at the bottom right, as in the Emerald party screen. */
#placeholderScreen:not(.dex-mode):not(.starter-mode):not([data-menu-view="choices"]) .window-title{min-height:0;padding:2px 8px;margin:6px 6px 0;align-self:flex-start;border-style:solid;border-width:12px;border-color:transparent;border-image:url("./assets/ui-emerald/menu-frame.png?h=d5eb6dffca") 8 fill / 12px stretch;background:none;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);font-size:16px;font-weight:400}
#placeholderScreen:not(.dex-mode):not(.starter-mode):not([data-menu-view="choices"]) :is(.placeholder-symbol,.window-help){display:none}
#placeholderScreen:not(.dex-mode):not(.starter-mode):not([data-menu-view="choices"]) .menu-back{top:auto;bottom:6px;right:6px;min-width:0;min-height:0;padding:4px 12px;border-style:solid;border-width:12px;border-color:transparent;border-image:url("./assets/ui-emerald/menu-frame.png?h=d5eb6dffca") 8 fill / 12px stretch;background:none;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);font-size:15px}
#placeholderScreen:not(.dex-mode):not(.starter-mode):not([data-menu-view="choices"]) .placeholder-copy{padding-bottom:64px}
/* Pokédex: Emerald's red Pokédex casing, standard windows for the list, preview and pages, the ▶ cursor. */
#placeholderScreen.dex-mode .placeholder-window{background:#c85848}
#appShell .dex-header{background:#a83838;border-bottom:3px solid #702828;color:#fff;text-shadow:1.5px 1.5px 0 #602020}
#appShell .dex-mode :is(button,input,select){border-radius:0;border-style:solid;border-width:12px;border-color:transparent;border-image:url("./assets/ui-emerald/menu-frame.png?h=d5eb6dffca") 8 fill / 12px stretch;background:none;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);min-height:0;padding:0 6px;-webkit-appearance:none;appearance:none;box-shadow:none}
#appShell .dex-mode .dex-back{border-image:none;border:0;background:none!important;color:#fff!important;text-shadow:1.5px 1.5px 0 #602020}
#appShell .dex-tools{background:none;padding:4px}
#appShell .dex-list{background:none;padding:4px}
#appShell .dex-mode .dex-row{position:relative;border-image:none;border:0;border-bottom:1px solid #e0d8d0;padding:6px 6px 6px 22px;background:#f8f8f8;color:var(--gba-ink);min-height:40px}
#appShell .dex-mode .dex-row:first-of-type{border-top:0}
#appShell .dex-mode .dex-row.selected{background:#f8f8f8;color:var(--gba-ink);box-shadow:none}
#appShell .dex-mode .dex-row.selected::before{content:"▶";position:absolute;left:6px;top:50%;transform:translateY(-50%);font-size:11px}
#appShell .dex-mode .dex-number{color:#806858}
#appShell .dex-preview{margin:4px;border-style:solid;border-width:12px;border-color:transparent;border-image:url("./assets/ui-emerald/menu-frame.png?h=d5eb6dffca") 8 fill / 12px stretch;background:none;color:var(--gba-ink)}
#appShell .dex-content{margin:4px;border-style:solid;border-width:12px;border-color:transparent;border-image:url("./assets/ui-emerald/menu-frame.png?h=d5eb6dffca") 8 fill / 12px stretch;background:none;color:var(--gba-ink)}
#appShell .dex-tabs{background:none;padding:2px 4px}
#appShell .dex-mode .dex-tabs button.selected{color:#c04030}
#appShell .dex-footer{background:#a83838;color:#fff;text-shadow:1.5px 1.5px 0 #602020;border-top:3px solid #702828}
#appShell .dex-pagination{background:#f8f8f8}
/* V105: text-only battle phases page through long messages (A turns the page). */
#battleScreen:is([data-phase="intro"],[data-phase="result"]) .battle-ui > p{height:100%;overflow:hidden}
/* V105: long-text lists (挑战纪录 and similar): one full-screen standard window — title, scrolling text, options. */
#placeholderScreen[data-menu-view="longchoices"] .placeholder-window{background:#f8f8f8}
#placeholderScreen[data-menu-view="longchoices"] .view-choices{display:flex;flex-direction:column;gap:8px;padding:6px 8px 64px;height:100%;overflow:hidden;grid-template-columns:none}
#placeholderScreen[data-menu-view="longchoices"] .view-choices .menu-notes{flex:1 1 auto;min-height:0;overflow:auto;margin:0;border-style:solid;border-width:12px;border-color:transparent;border-image:url("./assets/ui-emerald/menu-frame.png?h=d5eb6dffca") 8 fill / 12px stretch;background:none;box-shadow:none;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);font-size:15px;line-height:1.6}
#placeholderScreen[data-menu-view="longchoices"] .view-choices .menu-notes p{border:0;padding:2px 0;margin:0}
#placeholderScreen[data-menu-view="longchoices"] .view-choices .menu-actions{flex:none;max-height:40%;overflow:auto;border-style:solid;border-width:12px;border-color:transparent;border-image:url("./assets/ui-emerald/menu-frame.png?h=d5eb6dffca") 8 fill / 12px stretch;background:none}
#placeholderScreen[data-menu-view="longchoices"] .view-choices .menu-actions .party-choice{min-height:40px;padding:6px 10px 6px 26px;border:0;background:none;color:var(--gba-ink);text-shadow:var(--gba-px) var(--gba-px) 0 var(--gba-shadow);font-size:16px}
#placeholderScreen[data-menu-view="longchoices"] .view-choices .menu-actions .party-choice.is-selected{background:none}
#placeholderScreen[data-menu-view="longchoices"] .view-choices .menu-actions .party-choice.is-selected::before{content:"▶";left:8px;top:50%;transform:translateY(-50%);border:0;width:auto;height:auto;font-size:12px;color:var(--gba-ink)}
#appShell .dex-tools{grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}
#appShell .dex-mode .dex-cycle{min-height:40px;text-align:left;padding-left:8px}
.menu-notes .msg-rest{visibility:hidden}
/* V157: the original healthboxes (battle-ui-v157.js) replace the plain boxes; sizes from the GBA screen (the player's box
   104 of 240 px wide, the opponent's 101), the old text and bars stay for screen readers only */
.battle-arena .battle-status.hb-on{padding:0;border:0;border-radius:0;background:none;box-shadow:none;width:43.3%}
.battle-arena .enemy-status.hb-on{width:42.1%;left:5%;top:8%}.battle-arena .ally-status.hb-on{right:4%;bottom:2%}
.battle-status.hb-on>p,.battle-status.hb-on>progress,.battle-status.hb-on>small{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip-path:inset(50%);opacity:0}
.hb-canvas{display:block;width:100%;height:auto;image-rendering:pixelated}
.battle-transition{position:absolute;inset:0;width:100%;height:100%;z-index:40;pointer-events:none;image-rendering:pixelated}

/* V165: the gate's region picker is a grid of cards (a picture of the first stage, the five level bands, the crystals held). */
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.region-grid{width:100%;max-width:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:3px}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.region-grid .party-choice.region-card{display:flex;flex-direction:column;align-items:stretch;gap:2px;min-height:auto;padding:3px 3px 4px;border:2px solid #90a0a8;border-radius:5px;background:#f8f8f0;font-size:13px;line-height:1.25;text-align:left}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.region-grid .party-choice.region-card.is-selected{border-color:#e06030;box-shadow:0 0 0 2px #f8b070;background:#fff8e0}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.region-grid .party-choice.region-card.is-selected::before{content:none}
.region-grid .region-thumb{display:block;flex:none;width:100%;height:auto;aspect-ratio:390/180;border-radius:3px;background:url("./assets/challenge/regions.png?h=45acc4bde9") 0 0/100% 1000% no-repeat;image-rendering:pixelated}
.region-grid .is-locked .region-thumb{filter:grayscale(1) brightness(.75)}.region-grid .is-locked{color:#88909a!important}
.region-grid .region-name{font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 2px}
.region-grid .region-pips{display:flex;gap:2px;padding:0 2px}.region-grid .region-pips i{flex:1;height:5px;border:1px solid #a8b0b8;border-radius:1px;background:#e0e4e8}
.region-grid .region-pips i.is-open{border-color:#58a060;background:#fff}.region-grid .region-pips i.is-cleared{border-color:#388048;background:#58b060}
.region-grid .region-meta{font-size:11px;color:#607078;padding:0 2px}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.region-grid .party-choice.region-leave{grid-column:1/-1;min-height:40px}
/* V166: move rows — the label stays the button's own text, the type shown first as a coloured tag, the name, and PP or power right-aligned. */
#placeholderScreen .view-choices .menu-actions .party-choice.move-row{display:flex;align-items:center;gap:8px;white-space:nowrap}
#placeholderScreen .menu-actions .move-row .dex-type{order:-1;flex:none;min-width:40px;padding:1px 4px;font-size:12px;font-weight:400;line-height:1.5;text-shadow:none}
#placeholderScreen .menu-actions .move-row .move-row-right{margin-left:auto;padding-left:12px;white-space:nowrap;font-size:14px}
/* V184: online battle team screens — the opponent's 6 on top, your 6 as cards, the 3 taken with their moves as chips. */
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.pvp-grid{width:100%;max-width:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:4px}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.pvp-grid .party-choice.pvp-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:1px;min-height:0;padding:4px 3px 5px;border:2px solid #a0acb0;border-radius:6px;background:#f8f8f0;font-size:13px;line-height:1.2;text-align:center}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.pvp-grid .party-choice.pvp-card.is-picked{border-color:#3a8a4a;background:#eaf6e2}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.pvp-grid .party-choice.is-selected{box-shadow:0 0 0 2px #e06030}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.pvp-grid .party-choice.is-selected::before{content:none}
.pvp-grid .pvp-art{width:52px;height:52px;image-rendering:pixelated}
.pvp-grid .pvp-name{font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.pvp-grid .pvp-tags{display:flex;gap:2px;flex-wrap:wrap;justify-content:center}.pvp-grid .pvp-tags .dex-type{min-width:0;padding:0 3px;font-size:10px;font-weight:400;line-height:1.5;text-shadow:none}
.pvp-grid .pvp-order{position:absolute;left:4px;top:3px;min-width:18px;height:18px;border-radius:9px;background:#3a8a4a;color:#fff;font-size:12px;line-height:18px;text-shadow:none}.pvp-grid .pvp-order:empty{display:none}
.pvp-grid .pvp-legend{position:absolute;right:4px;top:3px;font-size:10px;color:#b05020}
.pvp-grid .pvp-foes{grid-column:1/-1;display:flex;align-items:center;gap:2px;padding:2px 4px 4px;border-bottom:1px dashed #b0b8b8;margin-bottom:2px}
.pvp-grid .pvp-foes .pvp-art{width:40px;height:40px}.pvp-grid .pvp-foes-title{font-size:13px;color:#a04030;margin-right:4px;white-space:nowrap}.pvp-grid .pvp-wait{font-size:12px;color:#708088}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.pvp-grid .party-choice.pvp-bar{min-height:38px;padding:6px 4px;border:2px solid #a0acb0;border-radius:6px;background:#fff;text-align:center;font-size:14px}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.pvp-grid .party-choice.pvp-bar.is-ready{border-color:#3a8a4a;background:#3a8a4a;color:#fff;text-shadow:none}
.pvp-grid .pvp-bar-wide{grid-column:1/-1}
/* the 3 taken: one row each with the 4 move chips */
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.pvp-grid.pvp-prep .party-choice.pvp-card.pvp-row{grid-column:1/-1;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:center;gap:4px 8px;padding:5px 8px 5px 30px;text-align:left}
.pvp-prep .pvp-row .pvp-order{left:6px;top:50%;transform:translateY(-50%)}.pvp-prep .pvp-row .pvp-art{width:44px;height:44px}.pvp-prep .pvp-row .pvp-name{min-width:72px}
.pvp-chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;flex:1 1 150px}
.pvp-chip{display:block;padding:1px 5px;border-radius:3px;color:#fff;font-size:12px;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:none}
.pvp-chip.pvp-empty{background:#d8dde0;color:#8090a0}
.menu-actions .pvp-current{grid-template-columns:repeat(4,minmax(0,1fr));padding:4px 4px 6px;margin-bottom:4px;border-bottom:1px dashed #b0b8b8}
.menu-actions .party-choice.is-on{background:#eaf6e2!important}
:where(.pvp-chip){background:#647887}
.pvp-grid .pvp-bar-first{grid-column-start:1}
/* V230: on a short phone (375×667 and smaller) the rows were squeezed below their content, so the name hid under the
   picture and the type tags spilled out of the card. Rows keep their own height (the window scrolls if it has to),
   and short screens use smaller pictures so the 6 cards still fit. */
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.pvp-grid{grid-auto-rows:max-content}
#placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.pvp-grid .party-choice{flex-shrink:0;min-height:max-content}
@media (max-height:740px){.pvp-grid .pvp-foes .pvp-art{width:28px;height:28px}.pvp-grid .pvp-foes{padding:0 4px 2px}
 #placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.pvp-grid:not(.pvp-prep) .party-choice.pvp-card{display:grid;grid-template-columns:32px minmax(0,1fr);grid-template-rows:auto auto;column-gap:3px;row-gap:1px;align-items:center;justify-items:start;padding:3px 3px 3px 2px;text-align:left}
 .pvp-grid:not(.pvp-prep) .pvp-card .pvp-art{grid-row:1/3;width:32px;height:32px}
 .pvp-grid:not(.pvp-prep) .pvp-card .pvp-name{grid-column:2}.pvp-grid:not(.pvp-prep) .pvp-card .pvp-tags{grid-column:2;justify-content:flex-start}
 .pvp-grid:not(.pvp-prep) .pvp-card .pvp-order{left:1px;top:1px;min-width:15px;height:15px;line-height:15px;font-size:10px}
 #placeholderScreen[data-menu-view="choices"]:not(.dex-mode):not(.starter-mode) .view-choices .menu-actions.pvp-grid .party-choice.pvp-bar{min-height:32px;padding:4px}}
/* V186: a phrase stays on one line when it fits (talk-v103.js fill) */
.phr{display:inline-block;max-width:100%;text-indent:0}.phr>.wd{display:inline-block;max-width:100%}
