/* Pokémon screen (js/pokemon.js): Party & Box (home) and a Pokémon's page (Overview · Stats · Moves).
   Loaded after mobile.css. Stats / Moves internals (.gt, .mv-card, .ln-row...) live in panels.css "Pokémon summary".
   Calm by design: dark surfaces, gold only for selection / drop targets / the lead, no coloured tiles behind portraits. */

/* ---------------------------------------------------------------- frame */
.modal.pk-panel .modal-body { min-height: 0; display: flex; flex-direction: column; padding: 12px; }
.modal.pk-panel.pk-home .modal-body { overflow: hidden; padding-bottom: 0; }
html:not(.touch) .modal.size-lg.pk-panel { width: min(1120px, calc(calc(100 * var(--uvw, 1vw)) - 32px)); height: min(780px, calc(calc(100 * var(--uvh, 1vh)) - 40px)); }

/* ---------------------------------------------------------------- home: party strip, box, bottom bar */
.pkb { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.pkb-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 6px; min-height: 26px; }
.pkb-h h4 { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #dfe5ff; white-space: nowrap; }
.pkb-h h4 small { margin-left: 4px; font-size: 12px; font-weight: 700; letter-spacing: 0; color: var(--muted); }
.pkb-exp { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin: -8px 0; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.pkb-exp .ic { width: 15px; height: 15px; flex: none; }
.pkb-exp .switch { width: 40px; height: 24px; }
.pkb-exp .switch::after { top: 3px; left: 3px; width: 18px; height: 18px; }
.pkb-exp .switch:checked::after { transform: translateX(16px); }

.pkb-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.pkb-slot, .pkb-tile { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; padding: 6px 2px 5px;
  border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid transparent; color: inherit; font: inherit; cursor: pointer;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), border-color .12s, background .12s; }
.pkb-slot { background: rgba(255, 255, 255, .06); border-color: var(--line); padding: 6px 4px 7px; }
.pkb-slot:hover, .pkb-tile:hover { background: rgba(255, 255, 255, .09); }
.pkb-slot:focus-visible, .pkb-tile:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.pkb-slot.empty { border: 1.5px dashed var(--line-2); background: none; cursor: default; min-height: 74px; }
.pkb-pic { position: relative; width: 52px; height: 52px; flex: none; display: grid; place-items: center; pointer-events: none; }
.pkb-pic img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); -webkit-user-drag: none; }
.pkb-name { max-width: 100%; font-size: 12px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.pkb-lv { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.pkb-ty { width: 8px; height: 8px; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--c) 50%, var(--c2) 50%); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.pkb-hp { display: block; width: 78%; height: 3px; margin-top: 1px; border-radius: 2px; background: rgba(0, 0, 0, .45); overflow: hidden; pointer-events: none; }
.pkb-hp i { display: block; height: 100%; background: #5fdc84; }
.pkb-hp.mid i { background: #f2c94c; } .pkb-hp.low i { background: #ff6a6a; }
.pkb-shiny { position: absolute; right: -3px; top: -4px; font-style: normal; font-size: 12px; line-height: 1; color: #ffd75e; text-shadow: 0 0 6px rgba(255, 215, 94, .7); }
.pkb-held { position: absolute; right: -4px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: #f4ead2; border: 1.5px solid #f2b84b; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.pkb-held .item-art { width: 13px; height: 13px; }
.pkb-held .item-art img { width: 100%; height: 100%; object-fit: contain; }
.pkb-lead { position: absolute; left: -4px; top: -4px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10px; line-height: 1;
  background: var(--gold); color: #2a1a00; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.pkb-slot.shiny, .pkb-tile.shiny { border-color: rgba(255, 215, 94, .5); }
.pkb .fainted .pkb-pic { filter: grayscale(.9); opacity: .6; }
.pkb-slot.sel, .pkb-tile.sel { border-color: var(--gold); background: rgba(242, 184, 75, .14); box-shadow: inset 0 0 0 1px var(--gold); }
/* a finger holding still: the tile sinks in until it lifts */
.pkb .hold { transform: scale(.9); }
.pkb .drag-src { opacity: .3; }
.pkb .drop-on { outline: 2px solid var(--gold); outline-offset: 2px; background: rgba(242, 184, 75, .14); }
.pkb-grid.drop-on, .pkb-slots.drop-on { outline-offset: -2px; border-radius: 12px; }
.pkb-ghost { position: fixed; z-index: 9999; pointer-events: none; margin: 0; transform: scale(1.12); transition: none; opacity: .96;
  background: #1d2c5e; border: 1px solid var(--gold); box-shadow: 0 16px 32px rgba(0, 0, 0, .55); }
.pkb.dragging, .pkb.dragging * { cursor: grabbing; }
/* tap-to-move: every place it can go gets a dashed gold edge */
.pkb.moving .pkb-slot:not(.sel) { border-style: dashed; border-color: rgba(242, 184, 75, .65); }
.pkb.moving .pkb-grid { box-shadow: inset 0 0 0 1px rgba(242, 184, 75, .35); }

.pkb-box { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.pkb-tools { display: flex; gap: 6px; }
.pkb-search { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.pkb-search:focus-within { border-color: var(--accent-2); }
.pkb-search .ic { width: 16px; height: 16px; opacity: .6; flex: none; }
.pkb-search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: inherit; font-family: inherit; font-size: 14px; font-weight: 700; }
.pkb-search input::placeholder { color: var(--muted); font-weight: 600; }
.modal.pk-panel .pkb-tools select { flex: 0 0 auto; max-width: 120px; min-width: 0; min-height: 0; height: 40px; padding: 0 24px 0 10px; border-radius: 12px; border: 1px solid var(--line); color: inherit;
  background: rgba(0, 0, 0, .25) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23aab' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 9px center;
  font-family: inherit; font-size: 13px; font-weight: 700; appearance: none; -webkit-appearance: none; cursor: pointer; text-overflow: ellipsis; }

.pkb-boxbar { display: flex; align-items: center; gap: 6px; }
.pkb-arrow, .pkd-arrow { flex: none; width: 40px; height: 36px; padding: 0; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: inherit; cursor: pointer; }
.pkb-arrow .ic, .pkd-arrow .ic { width: 18px; height: 18px; }
.pkb-arrow:hover:not(:disabled), .pkd-arrow:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.pkb-arrow:disabled, .pkd-arrow:disabled { opacity: .3; cursor: default; }
.pkb-boxname { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.pkb-boxname b { font-size: 14px; font-weight: 800; }
.pkb-boxname small { font-size: 12px; font-weight: 700; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.pkb-clear { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(242, 184, 75, .5); background: rgba(242, 184, 75, .1); color: #ffd98a; font-family: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.pkb-clear .ic { width: 12px; height: 12px; }

.pkb-grid { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 6px; align-content: start; padding: 2px 2px 10px; border-radius: 12px; }
.pkb-grid > .empty { grid-column: 1 / -1; }

.pkb-bar { flex: none; min-height: 62px; display: flex; align-items: center; margin: 0 -12px; padding: 8px 12px calc(8px + var(--sab, 0px)); border-top: 1px solid var(--line); background: rgba(6, 11, 30, .45); }
.pkb-hint { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.pkb-hint .ic { width: 16px; height: 16px; flex: none; opacity: .7; }
.pkb-hint.drag { color: #ffd98a; } .pkb-hint.drag .ic { opacity: 1; }
.pkb-sel { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.pkb-mini { width: 40px; height: 40px; flex: none; display: grid; place-items: center; }
.pkb-mini img { width: 100%; height: 100%; object-fit: contain; }
.pkb-sel > p { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; gap: 1px; }
.pkb-sel > p b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkb-sel > p small { font-size: 11.5px; font-weight: 700; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkb-sel.moving > p b { color: #ffd98a; }
.pkb-acts { flex: none; display: flex; gap: 4px; }
.pkb-a { width: 58px; height: 46px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: #e8edff; font-family: inherit; font-size: 11px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.pkb-a .ic { width: 18px; height: 18px; }
.pkb-a:hover:not(:disabled) { background: rgba(255, 255, 255, .11); }
.pkb-a:disabled { opacity: .35; cursor: default; }
.pkb-a.danger { color: #ffb3b3; }
/* party order (js/pokemon.js Up / Down; the first one follows you): a slim pair stacked in one column */
.pkb-ud { display: flex; flex-direction: column; gap: 2px; }
.pkb-ud .pkb-a { width: 40px; height: 22px; border-radius: 8px; }
.pkb-ud .pkb-a .ic { width: 16px; height: 16px; }

/* desktop / tablets: bigger portraits in the party */
@media (min-width: 761px) and (min-height: 561px) {
  .pkb-slot .pkb-pic { width: 60px; height: 60px; }
  .pkb-tile .pkb-pic { width: 56px; height: 56px; }
}
/* phones (portrait): the party is one row of six portraits, the box five across */
@media (max-width: 760px) {
  .pkb { gap: 8px; }
  .pkb-slots { gap: 4px; }
  .pkb-slot { padding: 5px 1px 6px; }
  .pkb-slot .pkb-pic { width: 40px; height: 40px; }
  .pkb-slot .pkb-name { display: none; }
  .pkb-slot.empty { min-height: 66px; }
  .pkb-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .pkb-tile { padding: 5px 0 4px; }
  .pkb-tile .pkb-pic { width: 44px; height: 44px; }
}
@media (max-width: 400px) {
  .pkb-mini { display: none; }
  .modal.pk-panel .pkb-tools select { padding: 0 22px 0 9px; background-position: right 7px center; }
  .pkb-a { width: 56px; }
}
/* short landscape phones: the party on the left; box arrows + search in one row over the box; the bar along the bottom */
@media (max-height: 560px) and (min-width: 600px) {
  .modal.pk-panel .modal-body { padding: 8px 10px; }
  .modal.pk-panel.pk-home .modal-body { padding-bottom: 0; }
  .pkb { display: grid; grid-template-columns: 180px auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: 'party boxbar tools' 'party grid grid' 'bar bar bar'; gap: 6px 10px; }
  .pkb-box { display: contents; }
  .pkb-party { grid-area: party; min-height: 0; overflow: hidden; }
  .pkb-h { margin-bottom: 4px; } .pkb-exp > span { display: none; }
  .pkb-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .pkb-slot { padding: 4px 1px 5px; } .pkb-slot .pkb-pic { width: 34px; height: 34px; } .pkb-slot .pkb-name { display: none; } .pkb-slot.empty { min-height: 56px; }
  .pkb-boxbar { grid-area: boxbar; }
  .pkb-boxname { flex: none; }
  .pkb-tools { grid-area: tools; }
  .pkb-search, .modal.pk-panel .pkb-tools select { height: 36px; }
  .pkb-arrow { height: 36px; }
  .pkb-grid { grid-area: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 5px; }
  .pkb-tile .pkb-pic { width: 40px; height: 40px; }
  .pkb-bar { grid-area: bar; min-height: 54px; margin: 0 -10px; padding: 4px 10px calc(4px + var(--sab, 0px)); }
}

/* ---------------------------------------------------------------- a Pokémon's page */
.pkd { display: flex; flex-direction: column; gap: 10px; }
.pkd-l, .pkd-r { display: contents; }
.pkd-top { order: 0; display: flex; align-items: center; gap: 8px; }
.pkd-back { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 8px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05);
  color: inherit; font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.pkd-back .ic { width: 18px; height: 18px; }
.pkd-back:hover { background: rgba(255, 255, 255, .1); }
.pkd-pos { flex: 1; min-width: 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pkd-step { flex: none; display: flex; gap: 4px; }
.pkd-arrow { height: 40px; }

.pkd-hero { order: 1; display: grid; grid-template-columns: 128px minmax(0, 1fr); grid-template-areas: 'stage id' 'acts acts'; gap: 10px 12px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.pkd-stage.stage { grid-area: stage; min-height: 0; height: 128px; border-radius: 14px; }
.pkd-stage.shiny { box-shadow: inset 0 0 0 2px #ffd23f, 0 0 16px rgba(255, 210, 80, .3); }
.pkd-ball { position: absolute; right: 6px; bottom: 6px; pointer-events: none; }
.pkd-id { grid-area: id; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pkd-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pkd-name h3 { margin: 0; min-width: 0; font-size: 20px; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkd-name .sx { flex: none; font-style: normal; font-size: 17px; font-weight: 900; } .pkd-name .sx.f { color: #ff8fc0; } .pkd-name .sx.m { color: #7ab8ff; }
.pkd-lock { margin-left: auto; flex: none; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--muted); cursor: pointer; }
.pkd-lock .ic { width: 16px; height: 16px; }
.pkd-lock.on { color: #ffd98a; border-color: rgba(242, 184, 75, .6); background: rgba(242, 184, 75, .12); }
.pkd-line { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.pkd-line b { color: #fff; font-weight: 900; }
.pkd-line .shiny-tag { margin: 0; }
.pkd-types { display: flex; gap: 6px; flex-wrap: wrap; }
.pkd-bars { display: grid; gap: 2px; }
.pkd-bars .hpbar, .pkd-bars .xpbar { margin-top: 2px; }
.pkd-bars .hp-num { min-width: 52px; font-size: 11.5px; }
.pkd-bars .xpbar .hp-num { color: var(--muted); font-weight: 700; }
.pkd-acts { grid-area: acts; display: flex; gap: 6px; flex-wrap: wrap; }
.pkd-acts .btn { flex: 1 1 auto; justify-content: center; }
.pkd-acts .btn.gold { color: #3a2400; background: linear-gradient(var(--gold), var(--gold-2)); border-color: rgba(255, 233, 168, .8); opacity: 1; }
.pkd-acts .evolve-btn { flex-basis: 100%; }
.pkd-hero.just-evolved { animation: pkd-pop .6s ease-out; }
@keyframes pkd-pop { 40% { box-shadow: 0 0 0 3px var(--gold), 0 0 28px rgba(255, 207, 74, .6); } }

/* tabs: stick to the top of the page while it scrolls (phones) */
.pkd-tabs { order: 2; display: flex; width: 100%; box-sizing: border-box; position: sticky; top: -12px; z-index: 3; background: #101937; box-shadow: 0 6px 12px rgba(6, 10, 26, .55); }
.pkd-tabs .seg-b { flex: 1; min-width: 0; }
.pkd-pane { order: 3; display: none; min-width: 0; }
.pkd[data-sec=overview] .pkd-over, .pkd[data-sec=stats] .pkd-stats, .pkd[data-sec=moves] .pkd-moves { display: block; }

/* overview: ability, held item, friendship, ball; evolution; release */
.pkd-facts { margin: 0; display: grid; padding: 2px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.pkd-f { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 44px; padding: 7px 0; }
.pkd-f + .pkd-f { border-top: 1px solid var(--line); }
.pkd-f dt { font-size: 12px; font-weight: 800; color: var(--muted); }
.pkd-f dd { margin: 0; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: 13.5px; font-weight: 800; }
.pkd-f dd > small { font-size: 12px; font-weight: 600; line-height: 1.35; color: var(--muted); }
.pkd-link { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 36px; padding: 4px 12px 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04);
  color: inherit; font-family: inherit; font-size: 13.5px; font-weight: 800; text-align: left; cursor: pointer; }
.pkd-link:hover { border-color: #f2b84b; }
.pkd-link small { margin-left: 2px; font-size: 11px; font-weight: 800; color: var(--gold); }
.pkd-link.held { padding-left: 5px; }
.pkd-link.give { color: #ffd98a; border-style: dashed; border-color: rgba(242, 184, 75, .6); }
.pkd-link .ic { width: 16px; height: 16px; }
.pkd-link .item-art { width: 24px; height: 24px; flex: none; }
.pkd-link .item-art img { width: 100%; height: 100%; object-fit: contain; }
.pkd-inline { display: inline-flex; align-items: center; gap: 6px; }
.pkd-f dd.pkd-friend { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; width: 100%; }
.pkd-friend .fr-hearts { display: inline-flex; gap: 2px; font-size: 15px; line-height: 1; }
.pkd-friend .fr-hearts i { font-style: normal; color: rgba(255, 255, 255, .18); }
.pkd-friend .fr-hearts i.full { color: #ff5f9a; }
.pkd-friend .fr-hearts i.half { background: linear-gradient(90deg, #ff5f9a 50%, rgba(255, 255, 255, .18) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pkd-friend .fr-track { flex-basis: 100%; }
.pkd-friend .fr-bonus { flex-basis: 100%; color: #ffb3cf; }
.abil-hid { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px; font-size: 10px; font-weight: 700; letter-spacing: .02em; vertical-align: middle; background: rgba(168, 120, 255, .25); color: #d9c4ff; }
.abil-soon { display: block; font-style: normal; font-size: 11px; opacity: .6; }
.pkd-friend .fr-track { position: relative; flex: 1; max-width: 220px; height: 7px; border-radius: 4px; background: rgba(0, 0, 0, .45); }
.pkd-friend .fr-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff9ac0, #ff5f9a); }
.pkd-friend .fr-track b { position: absolute; top: -3px; width: 2px; height: 13px; border-radius: 1px; background: var(--gold); }
.pkd-friend em { font-style: normal; font-variant-numeric: tabular-nums; }

.pkd-evo { margin-top: 10px; display: grid; gap: 8px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.pkd-evo h4 { margin: 0 0 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.pkd-evo h4 .ic { width: 18px; height: 18px; color: var(--gold); }
.pkd-evo h4 small { font-size: 12px; font-weight: 700; color: var(--muted); }
.pkd-evo-none { margin: 12px 2px 0; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pkd-evo-none .ic { width: 18px; height: 18px; flex: none; }
.pkd .eo { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px; border-radius: 12px; background: rgba(0, 0, 0, .2); }
.pkd .eo.ready { box-shadow: inset 0 0 0 1px rgba(255, 207, 74, .6); background: rgba(255, 207, 74, .08); }
.pkd .eo-pic { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: rgba(255, 255, 255, .04); }
.pkd .eo-pic img { width: 100%; height: 100%; object-fit: contain; }
.pkd .eo-pic.unseen img { filter: brightness(0) drop-shadow(0 0 3px rgba(160, 190, 255, .8)); }
.pkd .eo-pic .ic { width: 26px; height: 26px; color: var(--muted); }
.pkd .eo-main { min-width: 0; }
.pkd .eo-name { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; } .pkd .eo-name b { font-size: 14px; margin-right: 2px; }
.pkd .eo-reqs { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12px; font-weight: 700; }
.pkd .eo-reqs li { display: flex; align-items: center; gap: 6px; color: #c9d4f5; }
.pkd .eo-reqs li .ic { width: 15px; height: 15px; color: var(--ok); flex: none; }
.pkd .eo-reqs .dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--muted); margin: 0 2px; flex: none; box-sizing: border-box; }
.pkd .eo-reqs li small { margin-left: auto; padding-left: 6px; color: var(--muted); font-weight: 800; white-space: nowrap; }
.pkd .eo-reqs li.met span { color: #fff; } .pkd .eo-reqs li.met small { color: var(--ok); }
.pkd .eo-why { color: var(--gold); font-size: 12px; font-weight: 800; }
.pkd .ty-dot { display: inline-grid; place-items: center; min-width: 26px; height: 16px; padding: 0 3px; border-radius: 6px; background: var(--c); color: #fff; font-size: 9px; font-weight: 900; text-shadow: 0 1px 1px rgba(0, 0, 0, .45); }
.pkd .evolve-btn { color: #2a1a00; background: linear-gradient(#ffe089, #ffbf2e); border-color: #ffe9a8; }
.pkd .evolve-btn[disabled] { color: #d8c18f; background: linear-gradient(#5d4f2c, #463b20); border-color: #6d5d33; opacity: .8; }
.pkd-release { margin-top: 16px; display: flex; align-items: center; gap: 10px; padding: 0 2px 6px; }
.pkd-release small { font-size: 12px; font-weight: 600; color: var(--muted); }
.pkd .release-btn { flex: none; background: transparent; border: 1px solid rgba(255, 120, 120, .55); color: #ffb3b3; }
.pkd .release-btn .ic { width: 16px; height: 16px; }
.pkd .release-btn:hover:not([disabled]) { background: rgba(255, 90, 90, .14); }

/* stats / moves inside the page: no scroll boxes of their own */
.pkd .ln-list { max-height: none; overflow: visible; }
.pkd .sum-stats { grid-template-columns: 1fr; gap: 8px; }
.pkd-moves { container-type: inline-size; }
@container (max-width: 430px) {
  .pkd-moves .mv-pending { grid-template-columns: auto minmax(0, 1fr); }
  .pkd-moves .mp-btns { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
}

/* wide screens and landscape phones: header + overview on the left, Stats | Moves on the right (each column scrolls) */
@media (min-width: 761px) and (min-height: 561px), (max-height: 560px) and (min-width: 600px) {
  .modal.pk-panel:not(.pk-home) .modal-body { overflow: hidden; }
  .pkd { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 10px 16px; }
  .pkd-top { grid-column: 1 / -1; }
  .pkd-l, .pkd-r { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 4px 12px 0; }
  .pkd-tabs { position: static; flex: none; box-shadow: none; background: rgba(0, 0, 0, .3); }
  .pkd-tabs [data-sec=overview] { display: none; }
  .pkd-tabs .seg-b.on:not(.on-wide) { background: none; color: var(--muted); }
  .pkd-tabs .seg-b.on-wide { background: #fff; color: #13204a; }
  .pkd .pkd-over { display: block; }
  .pkd .pkd-moves { display: block; }
  .pkd[data-sec=stats] .pkd-moves { display: none; }
  .pkd[data-sec=stats] .pkd-stats { display: block; }
}
@media (max-height: 560px) and (min-width: 600px) {
  .pkd { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 8px 12px; }
  .pkd-top .pkd-back, .pkd-arrow { height: 34px; }
  .pkd-hero { grid-template-columns: 96px minmax(0, 1fr); padding: 8px; gap: 8px 10px; }
  .pkd-stage.stage { height: 96px; }
  .pkd-name h3 { font-size: 18px; }
}
/* phones: the page scrolls as one; the header portrait a little smaller */
@media (max-width: 760px) and (min-height: 561px), (max-width: 599px) {
  .modal.pk-panel:not(.pk-home) .modal-body { overflow-y: auto; display: block; padding-bottom: calc(var(--sab, 0px) + 20px); }
  .pkd-hero { grid-template-columns: 112px minmax(0, 1fr); }
  .pkd-stage.stage { height: 112px; }
}
@media (max-width: 360px) {
  .pkd-hero { grid-template-columns: 96px minmax(0, 1fr); } .pkd-stage.stage { height: 96px; }
  .pkd-f { grid-template-columns: 80px minmax(0, 1fr); }
}

/* moves: the whole card drags (a finger holds first); the grip is only a hint */
.pkd .mv-card[data-slot] { touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow var(--t); }
.pkd .mv-card.hold, .pkd .ln-row.hold { transform: scale(.96); }
.pkd .mv-card.drag-src, .pkd .ln-row.drag-src { opacity: .35; }
.pkd .mv-tools { display: inline-flex; align-items: center; gap: 2px; }
.pkd .mv-grip { display: grid; place-items: center; width: 26px; height: 36px; color: var(--muted); opacity: .7; cursor: grab; touch-action: pan-y; }
.pkd .mv-grip .ic { width: 16px; height: 16px; }
.pkd .mv-desc .mv-cd { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.pkd .mv-card .mv-ty { width: 40px; height: 40px; }

/* while a party Pokémon is dragged, the bottom bar is the "store it in the box" target */
.pkb-dropbox { flex: 1; align-self: stretch; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px;
  border: 1.5px dashed rgba(242, 184, 75, .7); color: #ffd98a; font-size: 13px; font-weight: 800; text-align: center; }
.pkb-dropbox .ic { width: 18px; height: 18px; flex: none; }
.pkb .pkb-dropbox.drop-on { outline: none; border-style: solid; background: rgba(242, 184, 75, .18); }
.pkb .pkb-boxname.drop-on { outline-offset: 0; border-radius: 10px; }
.pkd .mv-card { grid-template-columns: minmax(0, 1fr) auto; }
.pkd .mv-card .mv-desc { grid-column: 1 / -1; grid-row: 2; margin: 2px 6px 4px 52px; }
.pkd .mv-tools { margin-top: 0; }
@media (max-width: 420px) { .pkd .mv-card .mv-desc { margin-left: 6px; } }

/* the bought-Pokémon level cap (js/boughtcap.js): a lock on the tile, the explanation on its page */
.pkb-cap { position: absolute; left: -4px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: #0b1430; color: #ffd56a; box-shadow: 0 0 0 1.5px rgba(255, 213, 106, .7), 0 1px 3px rgba(0, 0, 0, .4); }
.pkb-cap .ic { width: 12px; height: 12px; }
.pkd-cap { margin: 6px 0 0; display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px;
  background: rgba(255, 213, 106, .08); border: 1px solid rgba(255, 213, 106, .28); font-size: 12px; line-height: 1.35; }
.pkd-cap > .ic { flex: none; width: 16px; height: 16px; color: #ffd56a; margin-top: 1px; }
.pkd-cap b { display: block; color: #ffe39a; font-size: 12.5px; }
.pkd-cap small { display: block; color: var(--muted); font-weight: 600; margin-top: 2px; }
.pkd-hero.capped { grid-template-areas: 'stage id' 'cap cap' 'acts acts'; }
.pkd-hero .pkd-cap { grid-area: cap; margin: 0; }

/* Evolution path and Mega preview (js/evopath.js): a row of small cards, and the stat comparison of the one tapped.
   Also in the Pokédex entry (.dex-evp). Portraits are the official models, never tinted. */
.evp { margin-top: 10px; display: grid; gap: 8px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.evp[hidden] { display: none; }
.evp h4 { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.evp h4 > .ic { width: 18px; height: 18px; color: var(--gold); }
.evp-megas { margin-left: auto; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 900; color: #1a1030; background: linear-gradient(135deg, #ffd76a, #ff9ad5 55%, #8fd0ff); }
.evp-megas i { font-style: normal; margin-right: 3px; }
.evp-lead { margin: -4px 0 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.evp-row { display: flex; align-items: stretch; gap: 2px; overflow-x: auto; padding: 8px 1px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.evp-row::-webkit-scrollbar { display: none; }
.evp-arr { flex: none; align-self: center; display: grid; place-items: center; width: 10px; color: var(--muted); font-style: normal; }
.evp-arr .ic { width: 12px; height: 12px; }
.evp-arr.mega { color: #ffd76a; font-size: 11px; }
.evp-arr.or { width: 4px; font-weight: 900; }
.evp-card { position: relative; flex: 1 0 60px; min-width: 0; max-width: 84px; display: grid; justify-items: center; align-content: start; gap: 2px; padding: 6px 2px 5px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--t) 22%, transparent), rgba(0, 0, 0, .22)); color: var(--text); font: inherit; cursor: pointer; touch-action: manipulation; }
.evp-card.cur { border-color: var(--line-2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }
.evp-card.mega { border-color: rgba(255, 215, 106, .45); }
.evp-card.sel { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 207, 74, .55); }
.evp-pic { width: 44px; height: 44px; display: grid; place-items: center; }
.evp-pic img { width: 100%; height: 100%; object-fit: contain; }
.evp-pic.unseen img { filter: brightness(0) drop-shadow(0 0 3px rgba(160, 190, 255, .8)); }
.evp-pic .ic { width: 24px; height: 24px; color: var(--muted); }
.evp-card b { max-width: 100%; font-size: 10px; letter-spacing: -.1px; line-height: 1.1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evp-ty { display: flex; gap: 2px; }
.evp .ty-dot { display: inline-grid; place-items: center; min-width: 24px; height: 14px; padding: 0 2px; border-radius: 5px; background: var(--c); color: #fff; font-size: 8.5px; font-weight: 900; text-shadow: 0 1px 1px rgba(0, 0, 0, .45); }
.evp-tot { font-size: 11px; font-weight: 900; color: #dfe7ff; }
.evp-tag { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); padding: 1px 6px; border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: .02em; background: #e9efff; color: #14204a; white-space: nowrap; }
.evp-tag.mega { background: linear-gradient(135deg, #ffd76a, #ff9ad5 55%, #8fd0ff); color: #1a1030; }
.evp-cmp { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, .22); }
.evp-cmp.mega { box-shadow: inset 0 0 0 1px rgba(255, 215, 106, .35); }
.evp-cmp-h { display: flex; align-items: center; gap: 8px; }
.evp-cmp-h b { flex: 1; min-width: 0; font-size: 13.5px; } .evp-cmp-h b i { font-style: normal; color: var(--muted); margin: 0 2px; }
.evp-x { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: var(--muted); cursor: pointer; }
.evp-x .ic { width: 14px; height: 14px; }
.evp-rows { display: grid; gap: 4px; }
.evp-r { display: grid; grid-template-columns: 58px minmax(30px, 1fr) auto 38px; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.evp-sn { color: #c9d4f5; white-space: nowrap; }
.evp-bar { position: relative; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.evp-bar i { position: absolute; top: 0; bottom: 0; left: 0; background: var(--c); opacity: .75; }
.evp-bar i.gain { opacity: 1; background: repeating-linear-gradient(135deg, #fff 0 2px, var(--c) 2px 5px); }
.evp-bar i.loss { opacity: 1; background: repeating-linear-gradient(135deg, rgba(255, 90, 90, .95) 0 2px, rgba(255, 90, 90, .35) 2px 5px); }
.evp-v { text-align: right; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; } .evp-v b { color: #fff; } .evp-v i { font-style: normal; opacity: .7; }
.evp-d { font-style: normal; text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--muted); }
.evp-d.up { color: var(--ok, #5bd16a); } .evp-d.down { color: #ff7a7a; }
.evp-r.tot { margin-top: 3px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 13px; } .evp-r.tot .evp-sn { color: #fff; font-weight: 900; }
.evp-note { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #c9d4f5; }
.evp-note > span:first-child { color: var(--muted); } .evp-note .ic { width: 14px; height: 14px; flex: none; color: var(--gold); } .evp-note .ic + span { color: #c9d4f5; }
.evp-where { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.evp-haves { display: flex; gap: 6px; flex-wrap: wrap; }
.evp-have { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: 12px; }
.evp-have .item-art { width: 20px; height: 20px; flex: none; } .evp-have .item-art img { width: 100%; height: 100%; object-fit: contain; }
.evp-have > .ic { width: 14px; height: 14px; color: var(--ok, #5bd16a); } .evp-no { font-style: normal; font-weight: 900; color: #ff7a7a; }
.evp-have.ok { border-color: rgba(91, 209, 106, .5); } .evp-have small { color: var(--muted); font-weight: 800; }
.evp-have .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.evp-get { margin: 0; display: grid; gap: 2px; font-size: 12px; font-weight: 600; color: #c9d4f5; }
.evp-mall { justify-self: start; }
.dex-evp { margin-top: 12px; }
