body,button,input,select{font-family:Pixelify,"Microsoft JhengHei","Noto Sans TC",sans-serif} .friends-panel{width:min(720px,96vw);max-height:92vh;overflow:auto;text-align:left}.friends-panel>.row{justify-content:space-between}.friends-panel h2{font-size:22px}.friends-panel h3{color:#ffdc6a;margin:8px 0}.friends-panel p{line-height:1.6}.adventure-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.adventure-region,.mode-card{padding:12px;background:#102b5577;border:2px solid #6896bf88;border-radius:10px}.adventure-region>small{float:right;color:#ffb3cd}.stage-row{display:flex;gap:5px;margin-top:8px}.stage-row button{flex:1;min-width:0;padding:10px 3px}.stage span{font-size:13px;color:#fddd80}.mode-card{margin:12px 0}.mode-toggle{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:12px 0;border-bottom:1px solid #ffffff22}.mode-toggle small{display:block;line-height:1.5;color:#c4d9f2}.mode-toggle input[type=checkbox]{width:28px;height:28px;accent-color:#ffcb4a}.mode-toggle input[type=range]{max-width:42%;accent-color:#ffcb4a}.biome-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.biome-grid button{font-size:13px;padding:9px 3px}.friends-panel input[type=text]{max-width:100%;margin:8px 0}.room-code{font-size:30px;letter-spacing:4px;color:#ffda67}.room-status{min-height:28px;color:#ffda67}.room-members{padding:8px 0}.room-member{padding:10px;border-bottom:1px solid #ffffff33}.friends-panel .btn:disabled{opacity:.5}.dungeon-dialog{position:fixed;inset:0;z-index:100;background:#0009;display:grid;place-items:center}.dungeon-dialog.hidden{display:none}.dungeon-dialog .box{max-width:92vw;max-height:85vh;overflow:auto}.dungeon-dialog button{margin:6px}.friends-panel .sub{font-size:14px}@media(max-width:540px){.adventure-grid{grid-template-columns:1fr}.biome-grid{grid-template-columns:repeat(3,1fr)}.friends-panel h2{font-size:18px}.stage-row .btn{font-size:14px}}

.room-members{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.room-member{display:flex;align-items:center;gap:8px;min-width:0;padding:8px;border:1px solid #789bd966;border-radius:10px;background:#102b5577}
.room-member-sprite{width:112px;height:104px;flex:0 0 112px;image-rendering:pixelated}
.room-member-info{display:flex;flex-direction:column;gap:6px;min-width:0}
.room-member-info b,.room-member-pokemon{overflow-wrap:anywhere}
.room-member-pokemon{color:#ffdc6a;font-size:15px}
.room-member-info small{color:#c4d9f2}
@media(max-width:540px){.room-members{grid-template-columns:1fr}}

.potential-panel{margin-top:16px;padding:14px;border:1px solid #9470cf;border-radius:12px;background:#17152c}.potential-panel table{width:100%;border-collapse:collapse;text-align:right}.potential-panel th:first-child{text-align:left}.potential-panel td,.potential-panel th{padding:5px;border-bottom:1px solid #ffffff20}.potential-panel small{display:block;color:var(--muted);line-height:1.5}.potential-panel .btn{width:100%}

#dex-detail .potential-panel{flex-shrink:0}#dex-detail .potential-panel .btn{position:static;margin-top:8px}

/* Merchant dialog uses the game's existing PMD box, pixel icons and buttons. */
.dungeon-dialog .shop-box{width:min(560px,94vw);padding:18px}
.shop-heading{display:flex;align-items:center;gap:12px}.shop-heading h2{margin:0}
.shop-heading p{margin:4px 0}.shop-portrait{flex:none;image-rendering:pixelated}
.shop-wallet{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.shop-products{display:grid;gap:8px}.dungeon-dialog .shop-product{margin:0;width:100%;display:flex;align-items:center;gap:12px;text-align:left;padding:10px}
.shop-product>span:first-of-type{flex:1}.shop-product small{display:block;color:var(--muted);font-size:13px;margin-top:3px}
.shop-price{display:flex;align-items:center;gap:4px;white-space:nowrap;color:var(--gold)}
.shop-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.dungeon-dialog .shop-actions .btn{margin:0;display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap}
.shop-actions small{font-size:11px;color:#ffb0b0;width:100%}#shop-status{min-height:1.3em;color:var(--gold);margin:8px 0 0}
@media(max-height:520px){.dungeon-dialog .shop-box{max-height:94dvh;padding:10px 14px}.shop-heading .shop-portrait{width:48px;height:44px}.shop-heading h2{font-size:20px}.shop-heading p,.shop-wallet,.shop-box .note{font-size:12px;margin:3px 0}.shop-products{gap:4px}.dungeon-dialog .shop-product{padding:5px 8px}.shop-actions{margin-top:6px;gap:4px}.dungeon-dialog .shop-actions .btn{padding:5px;font-size:13px}}

/* Expansion catalog uses native collection cards; no fabricated character previews. */
#dex-series{margin-bottom:6px}
.bleach-placeholder{height:80px;display:flex;align-items:center;justify-content:center;opacity:.65}
.bleach-cell{font:inherit;color:var(--text,#eaf2ff);min-width:0}
.bleach-cell small{display:block;font-size:11px;color:var(--muted)}
.bleach-cell:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.bleach-stage{width:220px;min-height:150px;padding:16px 8px;display:flex;flex-direction:column;gap:12px;align-items:center;justify-content:center;text-align:center;max-width:100%;box-sizing:border-box}
.bleach-stage small{color:var(--muted);font-size:12px}
.bleach-skills{padding-left:18px;margin:4px 0}
.bleach-skills li{margin:5px 0}
.bleach-assets{margin:12px 0;overflow-wrap:anywhere;font-size:13px}
.bleach-assets a{color:var(--gold)}
@media(max-height:500px){.bleach-placeholder{height:45px}#dex-detail .bleach-stage{width:100%;min-height:110px;height:auto}}

/* Keep the collection header and independent panels visible for pending long details. */
#scr-dex[data-series="bleach"] .box{height:100%;display:flex;flex-direction:column}
#scr-dex[data-series="bleach"] .split{flex:1;min-height:0}
#scr-dex[data-series="bleach"] .split>div:first-child{display:flex;flex-direction:column;min-height:0}
#scr-dex[data-series="bleach"] .grid{max-height:none;min-height:0;flex:1}
#scr-dex[data-series="bleach"] #dex-detail{overflow-y:auto;min-height:0;display:block}
#scr-dex[data-series="bleach"] #dex-detail>.btn{position:static;width:100%;margin-top:12px}

.bleach-animation-buttons{display:flex;flex-wrap:wrap;gap:4px;justify-content:center;margin:6px 0}.bleach-cell canvas{max-width:100%;image-rendering:pixelated}

/* Linked Pokemon awakening, phone and desktop. */
.awakening-title{font-size:24px;font-weight:700;color:#e7d2ff;margin:8px 0}.card.awakening-card{border-color:#bd95ef;background:linear-gradient(110deg,rgba(128,76,200,.25),rgba(69,40,110,.12))}.card.awakening-card .nm{color:#e2c7ff}.awakening-branches .ico{flex-basis:64px;height:56px}.awakening-branches .ds{line-height:1.5}.awakening-summary{line-height:1.6;color:#d9c5f3}#awakening-back{margin-top:12px}#scr-levelup .box{max-height:calc(100dvh - 24px);overflow-y:auto}#scr-levelup .txt{min-width:0}

#scr-levelup.choosing-awakening .box > h2,#scr-levelup.choosing-awakening .box > p.sub:first-of-type{display:none}

@media(max-width:520px){.awakening-branches .card{padding:12px 10px;gap:10px}.awakening-branches .ico{flex-basis:56px}.awakening-branches .nm{font-size:16px}.awakening-branches .ds{font-size:13px}.awakening-branches .key{display:none}}

.gm-dialog{color:#f4f8ff;background:#162847;border:2px solid #c8a95b;border-radius:16px;width:min(600px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:22px;box-sizing:border-box;overflow:auto}.gm-dialog::backdrop{background:#000a}.gm-heading{display:flex;justify-content:space-between;align-items:center;gap:8px}.gm-heading h2{font-size:22px;margin:0 0 12px}.gm-dialog label{display:block;font-weight:bold;margin:16px 0 8px}.gm-dialog input,.gm-dialog select{box-sizing:border-box;border:1px solid #687d9c;border-radius:7px;background:#0c1930;color:white;padding:9px;font:inherit;min-width:0}.gm-target-row{display:flex;gap:7px;align-items:center}.gm-target-row input{flex:1;width:60px}#gm-self{margin-top:8px}#gm-target-result{overflow-wrap:anywhere}#gm-search,#gm-pokemon{width:100%;margin-bottom:8px}#gm-pokemon option{padding:7px}#gm-summary{color:#ffe2a2;line-height:1.5}#gm-status{min-height:24px;line-height:1.6}#gm-history{padding-left:20px;overflow-wrap:anywhere;font-size:13px}.gm-dialog details{margin-top:16px}.gm-dialog .sub{line-height:1.6}#btn-gm{white-space:nowrap}@media(max-width:520px){.gm-dialog{padding:14px}.gm-heading h2{font-size:18px}.gm-target-row{flex-wrap:wrap}.gm-target-row input{min-width:100px}.gm-dialog .btn{font-size:13px}}

.encounter-open{position:fixed;z-index:45;bottom:max(120px,18vh);left:50%;transform:translateX(-50%);max-width:calc(100vw - 28px);white-space:normal;font-size:14px;box-shadow:0 3px 16px #000b}.encounter-open:active,.encounter-open:disabled{transform:translateX(-50%)}.encounter-open[hidden]{display:none!important}#encounter-dialog{box-sizing:border-box;width:min(460px,calc(100vw - 24px));max-height:calc(100dvh - 30px);overflow:auto;padding:18px;border:2px solid #92b6ed;border-radius:16px;background:#172941;color:#f4f8ff;box-shadow:0 18px 80px #000b}#encounter-dialog::backdrop{background:#030914aa}#encounter-dialog header{display:flex;align-items:center;justify-content:space-between;gap:12px}#encounter-title{font-size:20px;margin:0}#encounter-portrait{text-align:center;min-height:60px}#encounter-desc{line-height:1.65;color:#d1def3;font-size:14px}#encounter-wallet{color:#ffdf76;font-weight:bold}#encounter-options{display:grid;gap:10px}.encounter-option{width:100%;white-space:normal!important;text-align:left;padding:12px!important;line-height:1.5!important}#encounter-message{min-height:24px;line-height:1.6;font-size:14px;color:#b9eed7}.encounter-reels{padding:22px 6px;background:#0b162b;border:2px solid #e0b857;border-radius:8px;text-align:center;font-size:18px;color:#ffe3a1}.level-tools{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:10px}.level-tools button{font-size:13px}.card.banish-target{outline:2px solid #f184a6}.level-tools[hidden]{display:none!important}

/* Full-screen Mega evolution stage, rendered above every gameplay panel. */
#mega-evolution{position:fixed;inset:0;z-index:10050;isolation:isolate;overflow:hidden;background:#080916;color:#eee8ff;font-family:"Microsoft JhengHei","PingFang TC",sans-serif;touch-action:none}
#mega-evolution[hidden]{display:none!important}
#mega-evolution canvas{position:absolute;inset:0;width:100%;height:100%}
.mega-heading{position:absolute;top:max(24px,7vh);left:20px;right:20px;text-align:center;pointer-events:none}
.mega-eyebrow{font-size:10px;font-weight:700;letter-spacing:3px;color:#b8a4df}
.mega-heading h2{margin:12px 0 8px;font-size:clamp(24px,4.4vw,40px);font-weight:900;letter-spacing:7px;color:#f5dfac;text-shadow:0 0 28px #c58bff55}
.mega-subtitle{margin:0;font-size:12px;letter-spacing:3px;color:#b5a8ca}
.mega-result{position:absolute;bottom:max(50px,9vh);left:20px;right:20px;text-align:center;opacity:0;transform:translateY(12px);transition:opacity .55s,transform .55s;pointer-events:none}
.mega-result.revealed{opacity:1;transform:translateY(0)}
.mega-name{font-size:clamp(23px,3.5vw,34px);font-weight:900;letter-spacing:4px;color:#f8e5b6;text-shadow:0 0 24px #ae72ff55}
.mega-name:after{content:"";display:block;width:210px;max-width:65%;height:1px;margin:13px auto;background:linear-gradient(90deg,transparent,#c0a7ed,transparent)}
.mega-stats{display:flex;justify-content:center;flex-wrap:wrap;gap:2px 22px;font-size:12px;line-height:1.9;letter-spacing:1px;color:#e3dcf5}.mega-stats span{white-space:nowrap}
.mega-caption{font-size:10px;margin-top:8px;letter-spacing:3px;color:#a69aba}
.mega-skip{position:absolute;right:max(20px,env(safe-area-inset-right));bottom:max(15px,env(safe-area-inset-bottom));padding:10px 16px;min-height:44px;border:1px solid #c6b4ee44;border-radius:24px;background:#181326aa;color:#c9bddd;font:12px "Microsoft JhengHei",sans-serif;letter-spacing:1px;cursor:pointer}
.mega-skip:hover,.mega-skip:focus-visible{border-color:#dec8ff;color:#fff;outline:2px solid #a88fe177;outline-offset:3px}
.mega-skip:disabled{opacity:.35;cursor:default}
#mega-evolution.calm .mega-result{transition:opacity .3s;transform:none}
@media(max-height:500px){.mega-heading{top:15px}.mega-eyebrow{font-size:8px}.mega-heading h2{font-size:24px;margin:7px 0 5px;letter-spacing:5px}.mega-subtitle{font-size:10px;letter-spacing:2px}.mega-result{bottom:18px}.mega-name{font-size:22px;letter-spacing:2px}.mega-name:after{margin:6px auto}.mega-stats{font-size:10px}.mega-caption{display:none}.mega-skip{right:12px;bottom:12px;padding:7px 12px}}
@media(max-width:500px){.mega-eyebrow{font-size:8px;letter-spacing:1.5px}.mega-heading{top:9vh}.mega-heading h2{letter-spacing:4px}.mega-subtitle{font-size:10px;letter-spacing:1px}.mega-stats{display:grid;grid-template-columns:repeat(2,1fr);max-width:240px;margin:auto;gap:2px 15px;font-size:11px}.mega-stats i{padding:0 3px}.mega-result{bottom:13vh}}

/* Local Traditional Chinese pixel glyphs; keep native pixel strokes at every weight.
   Fusion Pixel 12px Proportional (zh_tw), 2026.10.16, SIL OFL 1.1. */
@font-face{font-family:"Fusion Pixel TC";src:url("../assets/fonts/fusion-pixel/fusion-pixel-12px-proportional-zh_tw.otf.woff2") format("woff2");font-style:normal;font-weight:400 900;font-display:swap}
:root{--event-font:"Fusion Pixel TC",Pixelify,"Microsoft JhengHei",monospace}
#encounter-dialog,#encounter-open,.dungeon-dialog,
#encounter-dialog button,.dungeon-dialog button{font-family:var(--event-font);font-synthesis:none;letter-spacing:0}
#encounter-dialog,.dungeon-dialog .shop-box{font-size:16px;line-height:1.5}
#encounter-title,.dungeon-dialog .shop-heading h2{font-size:24px;line-height:1.5;letter-spacing:1px}
#encounter-desc,#encounter-message{font-size:16px;line-height:1.65}
#encounter-open,#encounter-wallet,.encounter-option{font-size:16px}
.dungeon-dialog .shop-product,.dungeon-dialog .shop-actions .btn{font-size:16px;line-height:1.5}
.dungeon-dialog .shop-product>span:first-of-type{min-width:0}
.dungeon-dialog .shop-product small,.dungeon-dialog .shop-box .note{font-size:14px;line-height:1.6}
.dungeon-dialog .shop-actions small{font-size:12px;line-height:1.5}
@media(max-height:520px){#encounter-title,.dungeon-dialog .shop-heading h2{font-size:24px}#encounter-dialog{padding:12px 16px}.dungeon-dialog .shop-heading p,.dungeon-dialog .shop-wallet,.dungeon-dialog .shop-box .note,.dungeon-dialog .shop-product small{font-size:12px;line-height:1.5}.dungeon-dialog .shop-product,.dungeon-dialog .shop-actions .btn{font-size:14px}.dungeon-dialog .shop-actions small{font-size:12px}}

/* Level-up idle selection uses the same local pixel face as the HUD. */
#lvl-auto{font-family:"Fusion Pixel TC",Pixelify,monospace;font-size:16px;line-height:1.5;color:#fff1a8;background:#172b55;border:2px solid #637caf;border-radius:6px;padding:4px 10px;margin:6px auto 10px;width:fit-content;text-shadow:2px 2px #102046}
#lvl-auto.urgent{color:#ffd0bb;border-color:#ffa477}
@media(max-height:500px){#lvl-auto{margin:2px auto 6px;padding:2px 8px}}

#scr-support,#scr-support button,#scr-support a{font-family:"Fusion Pixel TC",Pixelify,monospace;font-synthesis:none}
#scr-support p{line-height:1.65}

@media(max-width:640px){#btn-support span{display:none}#btn-support{white-space:nowrap}}

.ranking-status{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;color:#ffe38e;font-size:14px;line-height:1.5}.ranking-note{font-size:14px;line-height:1.5;margin:8px 0}#rk-refresh{margin:6px 0}

#scr-support h3{margin:18px 0 10px;font-size:17px}#scr-support .sup-tab td:first-child{padding-right:12px}#scr-support .sup-tab td{line-height:1.5}@media(max-width:440px){#scr-support .sup-tab{font-size:13px}#scr-support .sup-tab td.num{white-space:normal;min-width:7em}}

/* Keep collection stats and breakthrough controls in one responsive panel. */
#dex-detail .character-growth{flex-shrink:0;min-width:0;width:100%}#dex-detail .character-growth .potential-panel{margin:10px 0;padding:10px}#dex-detail .potential-panel table{font-variant-numeric:tabular-nums;font-size:12px;table-layout:fixed}#dex-detail .potential-panel th,#dex-detail .potential-panel td{padding:5px 3px;overflow-wrap:anywhere}#dex-detail .potential-panel .potential-combat:first-of-type{border-top:1px solid #9470cf}#dex-detail .potential-panel small{font-size:11px}

/* Friend actions stay readable on narrow phone screens. */
@media (max-width:600px){
 #scr-friends .fr-row{flex-wrap:wrap;gap:8px}
 #scr-friends .fr-row>b{flex:1 0 calc(100% - 32px);min-width:0;overflow-wrap:anywhere}
 #scr-friends .fr-row .st,#scr-friends .fr-row .btn{white-space:nowrap;flex-shrink:0}
 #scr-friends .fr-row>.grow{display:none}
}

/* Upgrade choices use their own row so names never squeeze the description. */
#upg-list .upg-config{grid-template-columns:40px minmax(0,1fr) auto}
#upg-list .upg-config>.ic{grid-column:1;grid-row:1}
#upg-list .upg-config>div:nth-child(2){grid-column:2;grid-row:1;min-width:0;overflow-wrap:break-word}
#upg-list .upg-config .upg-btns{display:contents}
#upg-list .upg-config [data-buy]{grid-column:3;grid-row:1;justify-self:end}
#upg-list .upg-config [data-ban],#upg-list .upg-config [data-start]{grid-column:1/-1;grid-row:2;max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left;line-height:1.4}

/* Keep regional recruitment readable on narrow screens. */
#scr-gacha .split > div { min-width: 0; }
@media (max-width: 600px) {
  #scr-gacha .banner { padding: 12px; }
  #scr-gacha .banner h3 { font-size: 24px; }
  #scr-gacha .banner .feat { height: 130px; margin-bottom: -12px; }
  #scr-gacha .banner .feat canvas { width: calc((100% - 12px) / 3); height: auto; }
  #scr-gacha .split > div > .row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

/* Promotion rewards follow the native blue pixel panels. */
.promo-btn{white-space:nowrap;display:inline-flex;align-items:center;gap:5px}
.promo-dialog{width:min(600px,calc(100vw - 24px));max-height:calc(100dvh - 28px);box-sizing:border-box;overflow:auto}
.promo-dialog h2{display:flex;align-items:center;gap:10px}
.promo-dialog form{display:flex;flex-direction:column;gap:8px}
.promo-dialog input:not([type=checkbox]){width:100%;box-sizing:border-box;min-width:0}
.promo-dialog input[type=file]{font-size:13px;padding:10px 0}
.promo-dialog #promo-player,.promo-dialog #promo-history{overflow-wrap:anywhere}
#promo-preview{max-width:100%;max-height:240px;object-fit:contain;border:2px solid #8eace8;border-radius:8px;align-self:center}
#promo-preview[hidden]{display:none}
.promo-dialog .promo-consent{display:flex;align-items:flex-start;gap:9px;font-size:13px;line-height:1.7}
.promo-consent input{flex:none;width:18px;height:18px;margin-top:4px}
#promo-status{white-space:pre-wrap;color:#ffe28a;font-size:14px;line-height:1.7;overflow-wrap:anywhere}
#promo-status.error{color:#ffb9b9}
#promo-history{padding-left:20px;font-size:13px}
#promo-history li{margin:12px 0;white-space:pre-line}
#promo-history button{margin-top:8px}
@media(max-width:600px){.promo-dialog{padding:16px}.promo-dialog h2{font-size:21px}.topbar .promo-btn{font-size:12px}}

/* Item encyclopedia shares the collection's pixel panels and native item art. */
#scr-dex[data-series="items"] .dex-tools,#scr-dex[data-series="items"] #dex-gens,#scr-dex[data-series="items"] #dex-sort{display:none}
#scr-dex[data-series="items"] #dex-filters{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
#itemdex-q{flex:1;min-width:150px;font:inherit}
#scr-dex[data-series="items"] #dex-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
#scr-dex[data-series="items"] .itemdex-cell{height:auto;min-height:104px;padding:12px 6px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
#scr-dex[data-series="items"] .itemdex-cell b{font-size:16px;white-space:normal;line-height:1.5;overflow-wrap:anywhere}
#scr-dex[data-series="items"] #dex-detail{display:block;overflow-y:auto}
.itemdex-hero{display:flex;align-items:center;justify-content:center;min-height:120px;background:rgba(12,28,66,.35);border-radius:10px}
.itemdex-effect{font-size:17px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}
.itemdex-empty{grid-column:1/-1}
@media(max-width:700px){#scr-dex[data-series="items"] .split{display:flex;flex-direction:column}#scr-dex[data-series="items"] #dex-grid{max-height:36vh;overflow-y:auto}#scr-dex[data-series="items"] #dex-detail{min-height:230px}.itemdex-hero{min-height:88px}}

.itemdex-stacks{margin-top:20px;padding-top:12px;border-top:1px solid #7192cc}.itemdex-layers{display:flex;gap:8px}.itemdex-layers .chip{flex:1;padding:8px;font:inherit}.itemdex-stack-effect{line-height:1.8;font-size:16px;color:#ffe29b;min-height:90px;overflow-wrap:anywhere}

.room-invites{margin:14px 0;padding:12px;border:1px solid #7192cc;border-radius:10px}.room-invites h3{margin:0 0 10px}.room-invite-row{justify-content:space-between;padding:8px 0;gap:10px}.room-invite-row b{overflow-wrap:anywhere;min-width:0}.room-code{user-select:all}

/* Upstream October controls and responsive layout. */
/* ============ barra de arriba en el móvil en vertical (25-10-2026) ============
 * No cabía en una línea y se salía por la izquierda: justo las monedas, los
 * tickets y el nombre quedaban fuera de la pantalla. Ahora ocupa todo el ancho y
 * pasa a dos líneas (las monedas siempre a la vista), con botones más compactos;
 * lo que empieza debajo de ella baja lo que haga falta. */
@media (max-width: 600px) {
  .topbar { left: 6px; right: 6px; top: 6px; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
  .topbar .pill { padding: 3px 8px; font-size: 13px; gap: 4px; }
  .topbar .btn.small { padding: 3px 5px; }
  #user-pill { max-width: 120px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  #btn-support span { display: none; }
  .sound-panel { top: 82px; }
  .menu-left { padding-top: 92px; }
  #scr-goals, #scr-dex, #scr-upgrades, #scr-gacha, #scr-friends, #scr-rank, #scr-lobby, #scr-profile, #scr-shop, #scr-news { padding-top: 92px; }
}

/* ============ barra de arriba: limpia en cualquier pantalla (26-10-2026) ============
 * Antes iba en una sola línea pegada a la derecha y, con todo puesto (Guardar,
 * EN DIRECTO, Apoyar, los caramelos de Halloween...), en muchas pantallas (hasta
 * en tabletas de 1180 px) las monedas y los tickets se salían por la izquierda y
 * los botones se partían en dos líneas. Ahora:
 *   - nada se parte por dentro (cada pastilla y cada botón en una línea)
 *   - según se estrecha la pantalla, los botones se quedan sólo con su icono
 *     (el nombre sigue en el título al pasar el ratón) y el apodo se recorta
 *   - si aun así no cabe, pasa a otra línea en vez de salirse
 *     (la barra ocupa todo el ancho, pero sólo sus botones reciben los clics) */
.topbar { left: 16px; justify-content: flex-end; flex-wrap: wrap; row-gap: 6px; pointer-events: none; }
.topbar > * { pointer-events: auto; flex: 0 0 auto; white-space: nowrap; }
.topbar .btn { display: inline-flex; align-items: center; gap: 5px; }
#user-pill { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
#user-pill > span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1600px) {
  #btn-news span, #btn-support span, #btn-save span, #btn-yt:not(.live) span { display: none; }
  #user-pill { max-width: 170px; }
}
@media (max-width: 1280px) {
  .topbar { gap: 6px; }
  .topbar .pill { padding: 4px 10px; gap: 6px; }
  .topbar .btn.small { padding: 4px 8px; }
  #user-pill { max-width: 160px; }
}
@media (max-width: 1000px), (max-height: 520px) {
  .topbar { gap: 4px; }
  .topbar .pill { padding: 2px 7px; font-size: 13px; gap: 4px; }
  .topbar .btn.small { padding: 2px 5px; }
  #user-pill { max-width: 104px; }
  .topbar img { width: 16px; height: 16px; }
}
/* Las pantallas más estrechas: tu apodo se queda en la corona (tocarla abre tu perfil),
 * y EN DIRECTO, en el botón rojo con el punto que parpadea. */
@media (max-width: 800px) {
  #user-pill > span { display: none; }
  #btn-yt.live span { display: none; }
  .topbar { gap: 3px; }
}
/* Los móviles más pequeños (568 px): «Salir» sólo en Ajustes → Cuenta (Cerrar sesión). */
@media (max-width: 620px) and (max-height: 520px) {
  #btn-logout { display: none; }
  .topbar .pill { padding: 2px 5px; gap: 3px; }
  .topbar .btn.small { padding: 2px 4px; }
  .topbar img { width: 14px; height: 14px; }
}

/* Ficha de la colección: recuadro de cada ataque al pasar por su icono (menu.js, moveTips). */
#dex-moves { gap: 4px; }
#dex-moves span { cursor: help; }
.move-tip { position: fixed; z-index: 30; max-width: 260px; padding: 8px 10px; pointer-events: none; font-size: 14px;
  background: linear-gradient(180deg, var(--box1), var(--box2)); border: 2px solid var(--edge); border-radius: 8px;
  box-shadow: 0 0 0 2px var(--edge-out), 0 8px 22px rgba(0,0,0,.55); }
.move-tip-tags { display: flex; gap: 4px; margin: 5px 0; }
.move-tip .sub { margin: 0; font-size: 12px; line-height: 1.4; }

/* Halloween: cuenta atrás bajo el título del menú (menu.js). */
.hw-count { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 5px 14px 5px 10px; border-radius: 999px;
  background: rgba(38, 19, 63, .82); border: 2px solid #ff8a2a; color: #ffd9a8; font-size: 15px; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 14px rgba(255, 138, 42, .35); }
.hw-count.hidden { display: none; }
/* Halloween: la pestaña del banner Noche Espectral (gacha-ui.js). */
.gen-tab.spooky { background: linear-gradient(135deg, rgba(61,34,102,.55), rgba(122,58,18,.45)); border-color: #7a4ab8; }
.gen-tab.spooky small { color: #ffb05a; }
.gen-tab.spooky.on { border-color: #ff8a2a; }
.gen-tab.spooky.on b { color: #ff8a2a; }

.toast,.ach-pop{pointer-events:none} body.touch #scr-levelup,body.touch #scr-bond,body.touch #scr-item{touch-action:none} .over-sum{min-width:0}.over-tabs{margin:8px 0}.sum-moves{width:100%} .tag-chip.cat{background:#142543;color:#fff;border:1px solid #a8c3ff}
@media(max-height:520px){.splash{display:none}.mon-extra .mx-row .btn{font-size:12px;padding:5px 8px}.mon-extra .mx-row{flex-wrap:wrap}} @media(min-height:521px){#scr-shop,#scr-news{padding-top:66px}}
/* Move encyclopedia */
#scr-dex[data-series="moves"] .dex-tools,#scr-dex[data-series="moves"] #dex-sort{display:none}
#scr-dex[data-series="moves"] #dex-gens{gap:5px;max-height:110px;overflow-y:auto}
#scr-dex[data-series="moves"] #dex-gens .chip{font:inherit;font-size:13px;padding:6px 9px}
#scr-dex[data-series="moves"] #dex-filters{display:flex;flex-wrap:wrap;gap:6px}
#movedex-q{width:100%;min-width:0;font:inherit;padding:9px}
#scr-dex[data-series="moves"] #dex-grid{grid-template-columns:repeat(3,minmax(0,1fr));align-content:start}
#scr-dex[data-series="moves"] .movedex-cell{height:auto;min-height:126px;padding:10px 5px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:7px;white-space:normal}
.movedex-cell b{font-size:15px;line-height:1.5;overflow-wrap:anywhere}
.movedex-cell small{font-size:12px;color:#c6dbff}
.movedex-tags{display:flex;flex-wrap:wrap;gap:5px;align-items:center;justify-content:center}
#scr-dex[data-series="moves"] #dex-detail{display:block;overflow-y:auto;text-align:left}
#scr-dex[data-series="moves"] #dex-detail p{line-height:1.75;overflow-wrap:anywhere;font-size:14px}
.movedex-heading{display:flex;align-items:center;gap:12px}
.movedex-heading h3{margin:8px 0}
.movedex-levels{display:flex;flex-wrap:wrap;gap:5px}
.movedex-levels .chip{padding:8px;font:inherit}
.movedex-stats{width:100%;border-collapse:collapse;margin-top:12px;font-size:14px}
.movedex-stats caption{color:#ffe29b;text-align:left;padding:8px 0;line-height:1.6}
.movedex-stats th,.movedex-stats td{padding:7px 5px;border-bottom:1px solid #5271a5;text-align:left;font-weight:normal}
.movedex-stats td{text-align:right;color:#ffe29b}
@media(max-width:700px){#scr-dex[data-series="moves"] .split{display:flex;flex-direction:column}#scr-dex[data-series="moves"] #dex-grid{max-height:32vh;overflow-y:auto;grid-template-columns:repeat(2,minmax(0,1fr))}#scr-dex[data-series="moves"] #dex-detail{min-height:250px}#scr-dex[data-series="moves"] #dex-gens{max-height:88px}}

#scr-dex[data-series="moves"] #dex-gens{flex-wrap:wrap;overflow-x:hidden}
#scr-dex[data-series="moves"] #dex-gens .chip{flex:0 0 auto;white-space:nowrap}
@media(min-width:701px){
 #scr-dex[data-series="moves"] .box{height:100%;display:flex;flex-direction:column;overflow:hidden}
 #scr-dex[data-series="moves"] .split{flex:1;min-height:0;grid-template-columns:minmax(0,1fr) minmax(320px,40%)}
 #scr-dex[data-series="moves"] .split>div:first-child{display:flex;flex-direction:column;min-height:0;min-width:0}
 #scr-dex[data-series="moves"] #dex-grid{flex:1;min-height:0;max-height:none;overflow-y:auto}
 #scr-dex[data-series="moves"] #dex-detail{min-height:0}
}

/* Keep names readable when the full move catalog fills the scrolling grid. */
#scr-dex[data-series="moves"] #dex-grid{grid-auto-rows:minmax(min-content,max-content)}
#scr-dex[data-series="moves"] .movedex-cell> *{flex-shrink:0}
#scr-dex[data-series="moves"] .movedex-cell b{width:100%;white-space:normal;overflow:visible;text-overflow:clip;line-height:1.5;overflow-wrap:anywhere}

/* Catalog layout inspired by Poketide: a category rail and independent panes. */
#scr-dex.dex-atlas .box{width:min(1480px,100%);height:100%;max-height:100%;padding:18px;display:grid;grid-template-columns:112px minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr);gap:12px;overflow:hidden;position:relative}
#scr-dex.dex-atlas .box>.row{grid-column:1/-1}
#scr-dex.dex-atlas #dex-series{grid-column:1/-1;margin:0;flex-wrap:wrap;overflow:visible;gap:8px}
#scr-dex.dex-atlas #dex-gens{grid-column:1;grid-row:3;display:flex;flex-direction:column;flex-wrap:nowrap;overflow:auto;max-height:none;min-height:0;margin:0;padding:2px;gap:6px}
#scr-dex.dex-atlas #dex-gens :is(.gen-tab,.chip){width:100%;min-height:38px;flex:none;white-space:normal;border-radius:7px;font:inherit;font-size:13px;text-align:left;padding:9px}
#scr-dex.dex-atlas #dex-gens small{margin-left:auto}
#scr-dex.dex-atlas .split{grid-column:2;grid-row:3;display:grid;grid-template-columns:minmax(0,1fr) minmax(310px,43%);gap:16px;margin:0!important;min-height:0;overflow:hidden}
#scr-dex.dex-atlas .split>div:first-child{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}
#scr-dex.dex-atlas #dex-filters,#scr-dex.dex-atlas #dex-sort{flex:none;flex-wrap:wrap;gap:5px;margin-bottom:8px;overflow:visible}
#scr-dex.dex-atlas #dex-grid{flex:1;min-height:0;max-height:none;overflow:auto;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));grid-auto-rows:minmax(min-content,max-content);align-content:start;gap:8px;padding:4px}
#scr-dex.dex-atlas #dex-grid .cell{min-width:0;min-height:112px;height:auto;padding:10px 5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px}
#scr-dex.dex-atlas #dex-grid .cell>*{flex-shrink:0}
#scr-dex.dex-atlas #dex-grid .cell b{font-size:13px;line-height:1.5;white-space:normal;overflow:visible;overflow-wrap:anywhere;max-width:100%}
#scr-dex.dex-atlas #dex-detail{display:block;min-width:0;min-height:0;overflow:auto;padding:16px;border-radius:10px;background:rgba(12,27,60,.55);scrollbar-gutter:stable}
#scr-dex.dex-atlas #dex-detail>.btn{position:static;width:100%;margin-top:12px}
#scr-dex.dex-atlas #dex-detail h4{padding-bottom:7px;border-bottom:1px solid #5472a7;color:#ffe49a}
#scr-dex.dex-atlas #dex-detail #dex-big{display:block;margin:0 auto;max-width:100%;height:auto}
#scr-dex.dex-atlas :is(button,input,select):focus-visible{outline:2px solid #ffdf82;outline-offset:2px}
#scr-dex.dex-atlas #dex-list-back{display:none}
#scr-dex.dex-atlas[data-series="items"] .split{grid-column:1/-1}
#scr-dex.dex-atlas .dex-tools{flex-wrap:wrap}
#scr-dex.dex-atlas .dex-tools input{min-width:120px;flex:1}
#scr-dex.dex-atlas .movedex-cell small{font-size:11px}
#scr-dex.dex-atlas .movedex-tags{gap:3px}
#scr-dex.dex-atlas .movedex-tags .move-category{margin-left:0}
#scr-dex.dex-atlas .move-sort{width:100%;font:inherit;padding:7px}
#scr-dex.dex-atlas .move-partner-filter{display:flex;align-items:center;gap:6px;font-size:13px}
#scr-dex.dex-atlas .move-partner-filter input{width:17px;height:17px;margin:0}
#scr-dex.dex-atlas .dex-move-link{display:inline-flex;align-items:center;gap:5px;font:inherit;font-size:12px;padding:6px;border:1px solid #728fc7;background:#1c3566;color:#fff;border-radius:6px;cursor:pointer}
#scr-dex.dex-atlas #dex-moves{display:flex;flex-wrap:wrap;gap:6px}
#scr-dex.dex-atlas .movedex-compatible{display:flex;gap:6px;flex-wrap:wrap}
#scr-dex.dex-atlas .movedex-compatible .chip{font-size:12px}
@media(max-width:1050px) and (min-width:701px){
 #scr-dex.dex-atlas .box{grid-template-columns:105px minmax(0,1fr);padding:12px;gap:8px}
 #scr-dex.dex-atlas .split{grid-template-columns:minmax(0,1fr) minmax(280px,44%);gap:10px}
 #scr-dex.dex-atlas #dex-grid{grid-template-columns:repeat(auto-fill,minmax(88px,1fr))}
}
@media(max-width:700px){
 #scr-dex.dex-atlas .box{padding:10px;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto auto minmax(0,1fr);gap:7px}
 #scr-dex.dex-atlas #dex-gens{grid-column:1;grid-row:3;flex-direction:row;max-height:76px;overflow:auto}
 #scr-dex.dex-atlas #dex-gens :is(.gen-tab,.chip){width:auto;min-width:68px;white-space:nowrap;font-size:12px;padding:7px}
 #scr-dex.dex-atlas #dex-series .gen-tab{font-size:12px;padding:6px}
 #scr-dex.dex-atlas .split{grid-column:1;grid-row:4;display:block;position:relative}
 #scr-dex.dex-atlas .split>div:first-child{height:100%}
 #scr-dex.dex-atlas #dex-grid{grid-template-columns:repeat(auto-fill,minmax(90px,1fr))}
 #scr-dex.dex-atlas #dex-detail{display:none}
 #scr-dex.dex-atlas.dex-detail-open .split>div:first-child{visibility:hidden}
 #scr-dex.dex-atlas.dex-detail-open #dex-detail{display:block;position:fixed;inset:145px 22px 18px;z-index:4;background:#19315c;border:1px solid #6b8dcb;padding:16px}
 #scr-dex.dex-atlas.dex-detail-open #dex-list-back{display:block;position:fixed;top:99px;left:28px;z-index:5;background:#244780;width:auto}
 #scr-dex.dex-atlas[data-series="items"] .split{grid-row:4}
}

@media(max-width:700px){#scr-dex.dex-atlas.dex-detail-open .box>.row h2{visibility:hidden}}

/* Combat dashboard and readable result panels. */
.lay-dash{border-radius:50%;border:3px solid #ffda67;background:#122343e8;display:flex;align-items:center;justify-content:center;color:#ffda67}
#scr-pause .pause-box{width:min(1180px,100%);text-align:left}
#scr-pause .pause-box>h2,#scr-pause .pause-box>p{text-align:center}
.battle-layout{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(280px,1fr);gap:24px}
.battle-main,.battle-side{min-width:0}
.battle-identity{display:flex;align-items:center;gap:12px;margin:8px 0 16px;font-size:20px}
.battle-identity>span{color:#b9d2f5;font-size:14px}
.battle-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.battle-metrics>div,.battle-result-metrics>div{background:#12204b80;border:1px solid #91b7ed30;border-radius:10px;padding:13px 6px;text-align:center;display:flex;flex-direction:column;gap:6px}
.battle-metrics b{font-size:18px;overflow-wrap:anywhere}.battle-metrics span{font-size:13px;color:#c6daf8}
.battle-table-scroll{overflow-x:auto}.battle-table{width:100%;font-size:14px}
.battle-table th{white-space:nowrap;color:#aec8ed;font-size:12px}.battle-table td{padding:10px 4px!important}
.battle-move{display:flex;align-items:center;gap:7px;min-width:130px}.battle-move small{display:block;font-size:12px;color:#c2d4f2;margin-top:4px}
.battle-share{display:inline-block;min-width:44px;padding:3px;background:linear-gradient(90deg,#5d91cf80 var(--share),transparent var(--share));border-radius:4px}
.battle-note{font-size:12px!important;color:#c1d1ec!important;line-height:1.7!important}
.battle-slot{display:flex;width:100%;gap:10px;align-items:center;text-align:left;padding:12px;margin:8px 0;background:#12234a70;border:1px solid #819fce70;border-radius:8px;color:#f0f6ff;font:inherit}
.battle-slot>span{flex:1}.battle-slot em{font-style:normal;color:#b9cfef;font-size:12px}.battle-slot.on{border-color:#ffdb64;background:#304681}.battle-slot.on em{color:#ffdb64}
.battle-item{display:flex;gap:14px;background:#10214a80;border-radius:10px;padding:14px;align-items:center}.battle-item p{font-size:14px;line-height:1.8;margin:8px 0 0}
.battle-help{padding:14px;border:1px solid #819fce50;border-radius:10px;margin-top:18px;font-size:13px;line-height:1.8;color:#c9ddfa}
.battle-details{margin-top:20px;border-top:1px solid #819fce50;padding-top:14px}.battle-details summary{cursor:pointer;color:#ffda67;margin-bottom:12px}
#scr-pause .pause-box>.row{justify-content:center;position:sticky;bottom:-1px;padding:12px;background:#223e7bee;z-index:2}
#pause-sound{margin:16px 0 0 auto;max-width:430px}
#over-stats.battle-results{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(260px,1fr);gap:22px}
#over-stats.battle-results>section,#over-stats.battle-results>aside{padding:0;background:none;text-align:left;min-width:0}
.battle-result-metrics{display:grid;grid-template-columns:1fr 1fr;gap:10px}.battle-result-metrics b{font-size:24px}
.battle-result-side>div{border:1px solid #9cb8e345;border-radius:10px;padding:16px;margin-bottom:12px;background:#12204b65;text-align:left}
.battle-result-side>div>span{display:block;color:#bfceed;margin-bottom:8px}.battle-result-side>div>b{display:block}
.battle-result-main .over-sum{margin-top:20px;padding:14px;border-radius:10px;background:#12204b65}
#scr-over .box{max-height:calc(100dvh - 24px);overflow-y:auto}
@media(max-width:760px){.battle-layout,#over-stats.battle-results{grid-template-columns:1fr}.battle-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.battle-layout{gap:12px}.battle-table{font-size:12px}.battle-move{min-width:115px}#scr-pause .pause-box{padding:16px}#pause-sound{max-width:none}}

/* Long custom move descriptions must not determine the modal's intrinsic width. */
#scr-levelup .box{width:min(640px,100%);min-width:0}
#scr-levelup #cards{width:100%;min-width:0;gap:10px}
#scr-levelup #cards>.card{flex:0 0 auto;min-width:0}
#scr-levelup #cards .txt{min-width:0;overflow-wrap:anywhere}
#scr-levelup #cards .key{flex-shrink:0}

@media(max-width:520px){
 #scr-levelup .box{padding:16px 12px}
 #scr-levelup #cards>.card{display:grid;grid-template-columns:40px minmax(0,1fr) auto;gap:8px;padding:10px}
 #scr-levelup #cards .txt{display:contents}
 #scr-levelup #cards .ico{grid-column:1;grid-row:1;width:40px;height:40px}
 #scr-levelup #cards .nm{grid-column:2;grid-row:1;min-width:0;font-size:16px;overflow-wrap:anywhere}
 #scr-levelup #cards .key{grid-column:3;grid-row:1}
 #scr-levelup #cards .ds{grid-column:1/-1;min-width:0;overflow-wrap:anywhere;line-height:1.55}
}

/* Multiple run items stay readable without stretching the pause/results panel. */
.battle-items{display:grid;gap:6px;max-height:min(340px,42dvh);overflow:auto;overscroll-behavior:contain;padding-right:4px}.battle-items .battle-item{padding:9px 10px;gap:10px}.battle-item>div{min-width:0}.battle-item>img,.battle-item>canvas{flex-shrink:0}.battle-items .battle-item p{margin:4px 0 0;line-height:1.55}.item-layers{color:#ffda63;white-space:nowrap;font-size:13px}

.itemdex-layers{flex-wrap:wrap}.itemdex-layers .chip{flex:0 0 calc(20% - 7px);min-width:42px}

/* Compact region labels and native game select frames. */
#scr-dex.dex-atlas[data-series="pokemon"] #dex-gens .gen-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:46px;padding:5px 7px;text-align:center}
#scr-dex.dex-atlas[data-series="pokemon"] #dex-gens .gen-tab b{line-height:1.3;font-size:14px}
#scr-dex.dex-atlas[data-series="pokemon"] #dex-gens .gen-tab small{display:block;margin:0;line-height:1.25;font-size:11px}
#scr-dex.dex-atlas .move-sort{background:rgba(0,0,0,.3);color:var(--text,#f4f8ff);border:2px solid rgba(244,248,255,.3);border-radius:8px;padding:7px 10px;min-height:36px;color-scheme:dark;cursor:pointer}
#scr-dex.dex-atlas .move-sort option{background:#14204a;color:#f4f8ff}
#scr-dex.dex-atlas .move-partner-filter input{accent-color:var(--gold,#ffd23f)}
