/* Local HUD overrides, shared by desktop and touch layouts. */
/* The native player already owns fullscreen. The touch controller rewrites
   this button's inline display every frame based on browser fullscreen state. */
.tc .tc-fs{display:none!important;pointer-events:none}
/* Paint the accent against the full panel radius, then expose only its top 6px.
   Keep the parent overflow visible for the danger meter and wallet below it. */
#hud .hud-top::before{height:100%;border-radius:inherit;clip-path:inset(0 0 calc(100% - 6px) 0);pointer-events:none}
/* Overlap the skewed plate behind the round avatar, including its lower edge. */
#hud .tl-plate{margin-left:-52px;padding-left:58px}
#hud .coop-plate{margin-left:-30px;padding-left:36px}
/* Both live counters share one row and identical type/height below danger. */
#hud .pb-battle-counters{display:flex;align-items:center;justify-content:center;gap:8px}
#hud .pb-battle-counters>:is(.wallet,.counter){box-sizing:border-box;min-height:34px;gap:6px;padding:3px 12px;background:var(--paper);box-shadow:var(--shadow-sm);font:900 17px/24px var(--font-title);white-space:nowrap}
#hud .wallet>.pix{width:28px;height:28px;flex:none}
#hud .pb-battle-counters .wallet>b{font:inherit;padding:0}
#hud .pb-kills-label{font:inherit;white-space:pre}
#hud .pb-vitamin{pointer-events:auto;min-width:44px;min-height:44px;box-sizing:border-box;cursor:pointer;touch-action:manipulation}
#hud .pb-vitamin:hover{box-shadow:0 0 0 2px #766395}
#hud .pb-vitamin:active{filter:brightness(.92)}
#hud .pb-vitamin:focus-visible{outline:3px solid #766395;outline-offset:3px}
.pb-gold-amount{display:inline-flex;align-items:center;gap:.12em;vertical-align:middle;white-space:nowrap;font:inherit;color:inherit}
.pb-gold-icon{display:inline-block;flex:none;width:1.5em;height:1.5em;background:url('../assets/items/nugget.png') center/contain no-repeat;image-rendering:pixelated;pointer-events:none}
/* Warn when an upgrade cannot benefit any currently equipped attack. */
#ui .affects.none{display:flex;align-items:flex-start;gap:6px;color:#c62828;background:#fff0f0;opacity:1;font-weight:700}
#ui .affects.none::before{content:'⚠\FE0E';flex:none;font:inherit;font-size:1.2em;line-height:1.2}
/* The summary Pokédex header only needs its title. */
#ui .sm-dex>header>small{display:none}

/* Generated raster skins; scope to attacks so vitamins and ultimate retain their UI. */
#hud .slots>.pb-skill{--skill-skin:url('./skill-skins/normal.png');box-sizing:border-box;width:64px;height:64px;flex:none;padding:0;border:0;border-radius:0;box-shadow:none;background:var(--skill-skin) center/100% 100% no-repeat;image-rendering:pixelated;isolation:isolate;overflow:hidden}
#hud .slots>.pb-skill>img{position:absolute;width:34px;height:34px;top:17px;left:15px;z-index:1;image-rendering:pixelated}
#hud .slots>.pb-skill .nm{position:absolute;top:6px;left:6px;right:6px;color:#201728;text-shadow:0 1px #fff9;font-size:9px;line-height:11px;z-index:3;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}
#hud .slots>.pb-skill .lvl{position:absolute;bottom:4px;left:14px;right:auto;width:36px;height:12px;background:url('./skill-skins/level.png') center/100% 100% no-repeat;color:#201728;text-shadow:none;text-align:center;font:900 10px/12px system-ui,-apple-system,'PingFang SC',sans-serif;z-index:3}
#hud .slots>.pb-skill .cd{inset:5px;z-index:2;pointer-events:none}
#hud .slots>.pb-skill.empty,#hud .slots>.pb-skill.locked{--skill-skin:url('./skill-skins/steel.png');opacity:.65}
#hud .slots>.pb-skill.locked>img{top:18px;left:18px;width:28px;height:28px}
html.touch #hud .hud-bl .slots>.pb-skill{width:58px;height:58px;border-radius:0}
html.touch #hud .slots>.pb-skill>img{width:30px;height:30px;left:14px;top:16px}
html.touch #hud .slots>.pb-skill .nm{top:5px;font-size:8px;line-height:10px}
html.touch #hud .slots>.pb-skill .lvl{left:11px;bottom:3px}
html.touch #hud .slots>.pb-skill.locked>img{left:15px;top:17px;width:28px;height:28px}
#hud .slots>.pb-skill[data-skill-type="normal"]{--skill-skin:url('./skill-skins/normal.png')}
#hud .slots>.pb-skill[data-skill-type="fire"]{--skill-skin:url('./skill-skins/fire.png')}
#hud .slots>.pb-skill[data-skill-type="water"]{--skill-skin:url('./skill-skins/water.png')}
#hud .slots>.pb-skill[data-skill-type="grass"]{--skill-skin:url('./skill-skins/grass.png')}
#hud .slots>.pb-skill[data-skill-type="electric"]{--skill-skin:url('./skill-skins/electric.png')}
#hud .slots>.pb-skill[data-skill-type="ice"]{--skill-skin:url('./skill-skins/ice.png')}
#hud .slots>.pb-skill[data-skill-type="fighting"]{--skill-skin:url('./skill-skins/fighting.png')}
#hud .slots>.pb-skill[data-skill-type="poison"]{--skill-skin:url('./skill-skins/poison.png')}
#hud .slots>.pb-skill[data-skill-type="ground"]{--skill-skin:url('./skill-skins/ground.png')}
#hud .slots>.pb-skill[data-skill-type="flying"]{--skill-skin:url('./skill-skins/flying.png')}
#hud .slots>.pb-skill[data-skill-type="psychic"]{--skill-skin:url('./skill-skins/psychic.png')}
#hud .slots>.pb-skill[data-skill-type="bug"]{--skill-skin:url('./skill-skins/bug.png')}
#hud .slots>.pb-skill[data-skill-type="rock"]{--skill-skin:url('./skill-skins/rock.png')}
#hud .slots>.pb-skill[data-skill-type="ghost"]{--skill-skin:url('./skill-skins/ghost.png')}
#hud .slots>.pb-skill[data-skill-type="dragon"]{--skill-skin:url('./skill-skins/dragon.png')}
#hud .slots>.pb-skill[data-skill-type="dark"]{--skill-skin:url('./skill-skins/dark.png')}
#hud .slots>.pb-skill[data-skill-type="steel"]{--skill-skin:url('./skill-skins/steel.png')}
#hud .slots>.pb-skill[data-skill-type="fairy"]{--skill-skin:url('./skill-skins/fairy.png')}
/* Fusion keeps the existing pixel frame and the engine's actual level cap. */
#hud .slots>.pb-skill.fused::after{content:'✦';position:absolute;top:16px;right:5px;color:#ffe474;text-shadow:1px 1px #35254c;z-index:4;font-size:14px;pointer-events:none}

/* 战斗触屏按钮保留图标与输入区域，白字说明不接管触摸事件。 */
.tc .pb-touch-label{position:absolute;bottom:6px;left:0;right:0;color:#fff;font-size:13px;font-weight:900;line-height:1.2;text-align:center;text-shadow:0 1px 3px #17132a,0 0 2px #17132a;pointer-events:none}
.tc .tc-jump>.pb-touch-label{bottom:10px;font-size:15px}
.tc .tc-lock>.pb-touch-label{bottom:4px;font-size:12px}
.tc .tc-jump>svg,.tc .tc-dash>svg,.tc .tc-lock>svg{transform:translateY(-6px)}
.tc .tc-ultb .ult-nm,.tc .tc-ultb.ready .ult-nm{display:block;color:#fff;opacity:1;font-size:12px;width:max-content;max-width:144px;box-sizing:border-box;white-space:normal;text-align:center;line-height:1.2;pointer-events:none}

/* Match the adjacent pause target without changing its native aim-mode input. */
.tc .tc-aim{box-sizing:border-box;width:50px;height:50px;min-width:50px;min-height:50px;padding:4px 0;border-radius:50%;justify-content:center;align-items:center;gap:0}
.tc .tc-aim>svg,.tc .tc-aim>img{flex:none;width:24px;height:24px}
/* Keep the cinematic portrait inside its round frame on older WebViews too. */
#hud .uc-pt{position:relative;box-sizing:border-box;display:flex;align-items:center;justify-content:center}
#hud .uc-pt>img{position:static;inset:auto;display:block;flex:none;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center;transform:none;translate:none;margin:0}

/* Center the skill cut-in in the usable battle area, below the top HUD. */
#hud .ultcut{--cutin-avatar:clamp(72px,20vh,128px);height:calc(var(--cutin-avatar) + 20px);top:calc(50% - (var(--cutin-avatar) + 20px)/2)}
#hud .ultcut .uc-row{box-sizing:border-box;padding:10px max(20px,var(--sr,0px)) 10px max(20px,var(--sl,0px));gap:16px}
#hud .ultcut .uc-pt{width:var(--cutin-avatar);height:var(--cutin-avatar)}
#hud .ultcut .uc-band{transform-origin:50% 50%;height:calc(var(--cutin-avatar) * .7);top:calc(10px + var(--cutin-avatar) * .15)}
#hud .ultcut .uc-txt{min-width:0;max-width:calc(100% - var(--cutin-avatar) - 32px)}
#hud .ultcut .uc-txt b{font-size:clamp(24px,4.6vw,48px);line-height:1.15;white-space:normal;overflow-wrap:anywhere}

/* Compact, legible boss HUD: two rows inside, live status outside. The original
   touch rules applied another 0.5 scale on top of the player's HUD preference. */
#hud{--pb-boss-scale:calc(clamp(.85,var(--hs,1),1.3) * .8)}
#hud .pb-boss-stack{position:absolute;top:calc(var(--hb,76px) + 12px);left:var(--hc,50%);display:flex;flex-direction:column;gap:8px;pointer-events:none;width:min(580px,max(360px,44vw),calc((100vw - 24px) / var(--pb-boss-scale)));transform:translateX(-50%) scale(var(--pb-boss-scale));transform-origin:top;opacity:var(--bo,1)}
#hud .bossbar,#hud .bossbar.mini{position:relative;top:auto;left:auto;width:100%;transform:none;display:grid;grid-template-columns:40px minmax(0,1fr);align-items:center;row-gap:5px;overflow:visible;animation:none;opacity:1}
#hud .bossbar .bb-pt{box-sizing:border-box;width:60px;height:60px;border:3px solid var(--c);margin-right:-20px}
#hud .bossbar .bb-body{box-sizing:border-box;min-height:60px;border:2px solid var(--c);border-radius:14px;padding:5px 12px 5px 28px;gap:4px;background:var(--w96)}
#hud .bossbar .bb-head{height:22px;gap:5px}
#hud .bossbar .bb-name{min-width:0;flex:1;font-size:18px;line-height:22px}
#hud .pb-boss-types{display:flex;gap:3px;flex:none}
#hud .pb-boss-types .chip{font-size:10px;line-height:16px;padding:0 6px;white-space:nowrap}
#hud .bossbar .bb-tag{flex:none;font-size:10px;line-height:17px;letter-spacing:0;padding:0 7px;white-space:nowrap}
#hud .bossbar .bb-bar{height:19px;flex:none}
#hud .bossbar .bb-bar>b{justify-content:center;padding:0 5px;font-size:13px;line-height:19px;white-space:nowrap}
#hud .bossbar .bb-foot{position:static;grid-column:2;min-width:0;margin-left:28px;min-height:0;gap:4px;flex-wrap:wrap;background:none}
#hud .bossbar .bb-sub,#hud .bossbar .bb-rage,#hud .bossbar .bb-st{box-sizing:border-box;border-radius:8px;padding:3px 7px;background:#231d3ce8;color:#fff;font-size:12px;line-height:18px;letter-spacing:0;white-space:nowrap}
#hud .bossbar .bb-sub{overflow:hidden;text-overflow:ellipsis}
#hud .bossbar .bb-st{min-width:0;max-width:100%;flex-wrap:wrap;padding:2px 5px;gap:4px 8px}
#hud .bossbar .bb-st:empty{display:none}
#hud .bossbar .bb-sti .uiicon{width:20px!important;height:20px!important}
#hud .bossbar .bb-sti>b{color:#fff;font-size:12px}
#hud .bossbar .bb-rage{margin-left:0;flex:none;background:#bc2946;box-shadow:none}
#hud .minibars,#hud .minibars.below{position:static;top:auto;left:auto;width:100%;transform:none;gap:8px;opacity:1}

/* Match the milestone card outline to its portrait and live state accent.
   Keep the portrait ring inside the card instead of crossing a left inset stripe. */
#hud .milepill{box-sizing:border-box;min-width:0;border:2px solid var(--c);border-radius:14px;padding:4px 8px;gap:8px;background:#2a2440ed;box-shadow:var(--shadow-sm)}
#hud .milepill>.mp-pt{box-sizing:border-box;width:34px;height:34px;border:2px solid var(--c);box-shadow:none}
#hud .milepill>.mp-tx{min-width:0;gap:2px}
#hud .milepill>.mp-tx>small{color:var(--c);line-height:14px}
#hud .milepill>.mp-tx>b{color:#fff;line-height:16px}
