:root{
  box-sizing:border-box;
  --bg:#f6f7f9; --panel:#fff; --panel2:#f0f2f5; --ink:#15181d; --muted:#697084;
  --line:#e2e6ec; --accent:#b8860b; --accent2:#2f5bd0; --good:#1a7f4b; --bad:#b3261e;
  --chip:#eceff4; --shadow:0 1px 2px rgba(16,20,28,.07); --scrim:rgba(12,14,18,.55);
}
/* Dark is an explicit choice (theme.js), never inherited from the OS. Warm
   gallery charcoal rather than blue-black, so card artwork sits comfortably. */
:root[data-theme="dark"]{
  --bg:#151617; --panel:#1d1f21; --panel2:#25282b; --ink:#f3f1ec; --muted:#aaa9a3;
  --line:#34373b; --accent:#e0b44a; --accent2:#8fb4ff; --good:#5fd39a; --bad:#ff8a80; --chip:#2a2d31;
  --shadow:none; --scrim:rgba(0,0,0,.7);}
*,*::before,*::after{box-sizing:inherit}
html{-webkit-text-size-adjust:100%;scroll-padding-top:64px}
body{margin:0;background:var(--bg);color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-size:15px;line-height:1.45;padding-bottom:env(safe-area-inset-bottom,0px)}
body.locked{overflow:hidden}
button{font:inherit;color:inherit}
a{color:var(--accent2)}
:focus-visible{outline:2px solid var(--accent2);outline-offset:2px}
.skip{position:absolute;left:-999px;top:0;background:var(--panel);padding:8px 12px;z-index:100}
.skip:focus{left:8px}
.wrap{max-width:960px;margin:0 auto;padding:0 16px}
img{max-width:100%}

/* ---------- top nav ---------- */
.topnav{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:14px;
  padding:calc(8px + env(safe-area-inset-top,0px)) 16px 8px;background:var(--bg);border-bottom:1px solid var(--line);
  max-width:992px;margin:0 auto}
.brand{display:flex;align-items:center;gap:8px;font-weight:700;color:var(--ink);text-decoration:none;letter-spacing:-.01em}
.mark{width:20px;height:20px;border-radius:6px;background:var(--ink);position:relative;flex:0 0 auto}
.mark::after{content:"";position:absolute;left:5px;top:4px;width:9px;height:5px;border-left:2.5px solid var(--accent);
  border-bottom:2.5px solid var(--accent);transform:rotate(-45deg)}
.navsp{flex:1}
.navlink{color:var(--muted);text-decoration:none;font-size:14px;padding:6px 8px;border-radius:8px;white-space:nowrap}
.navlink:hover{background:var(--panel2);color:var(--ink)}
.navlink.me{display:flex;align-items:center;gap:7px}
.navlink img{width:22px;height:22px;border-radius:50%}
.tbtn{width:34px;height:34px;border-radius:9px;border:1px solid var(--line);background:var(--panel);color:var(--muted);
  cursor:pointer;display:grid;place-items:center;padding:0;flex:0 0 auto}
.tbtn:hover{color:var(--ink);background:var(--panel2)}
.tbtn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tbtn .sun{display:none}
:root[data-theme="dark"] .tbtn .sun{display:block}
:root[data-theme="dark"] .tbtn .moon{display:none}

/* ---------- shared bits ---------- */
h1{font-size:22px;margin:18px 0 4px;letter-spacing:-.015em}
.sub{color:var(--muted);font-size:13px;margin:0 0 12px}
.stats{display:flex;gap:8px;margin-bottom:8px}
.stat{flex:1;background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:7px 9px;
  box-shadow:var(--shadow);min-width:0}
.stat b{display:block;font-size:16px;line-height:1.2;font-variant-numeric:tabular-nums}
.stat span{font-size:11px;color:var(--muted)}
.bar{height:6px;border-radius:99px;background:var(--panel2);overflow:hidden;margin-bottom:9px}
.bar>i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--accent),var(--accent2));transition:width .25s}
.chip{border:1px solid var(--line);background:var(--chip);border-radius:99px;
  padding:6px 11px;font-size:12.5px;cursor:pointer;white-space:nowrap;-webkit-tap-highlight-color:transparent;text-decoration:none;color:var(--ink);display:inline-flex;align-items:center;gap:6px}
.chip[aria-pressed="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.chip:disabled{opacity:.5;cursor:default}
select,input[type=text],input[type=search]{background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:9px;
  padding:8px 10px;font-size:15px;min-width:0}
select{font-size:12.5px;padding:7px 8px}
.btn{border:1px solid var(--line);background:var(--panel2);border-radius:10px;padding:9px 14px;
  font-size:13.5px;font-weight:600;cursor:pointer;text-decoration:none;display:inline-flex;
  align-items:center;gap:7px;color:var(--ink)}
.btn.own{background:var(--good);border-color:var(--good);color:#fff}
.btn .ck{width:16px;height:16px;stroke:currentColor;stroke-width:3;fill:none;margin-left:-2px}
#dOwn.primary{background:var(--accent2);border-color:var(--accent2);color:#fff;box-shadow:0 1px 2px rgba(0,0,0,.15)}
#dOwn.primary.own{background:var(--good);border-color:var(--good)}
.btn.tcg{background:transparent}
.btn.tcg{color:var(--accent2)}
.btn.primary{background:var(--accent2);border-color:var(--accent2);color:#fff}
.btn.danger{color:var(--bad)}
.btn:disabled{opacity:.5;cursor:default}
.empty{text-align:center;color:var(--muted);padding:40px 10px}
.card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:14px 16px;box-shadow:var(--shadow);margin:12px 0}
.card h2{font-size:15px;margin:0 0 8px}
.row2{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.note{font-size:12.5px;color:var(--muted);border-left:3px solid var(--accent);padding:2px 0 2px 10px;margin:0 0 18px}
.err{color:var(--bad);font-size:13px}
.sitefoot{margin-top:40px;padding-bottom:32px;color:var(--muted);font-size:11.5px;line-height:1.6}
.sitefoot a{color:var(--muted);margin-right:12px}
#toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0px));transform:translate(-50%,20px);
  background:var(--ink);color:var(--bg);padding:9px 14px;border-radius:10px;font-size:13px;opacity:0;
  transition:opacity .2s,transform .2s;pointer-events:none;z-index:80;max-width:calc(100vw - 32px)}
#toast.on{opacity:1;transform:translate(-50%,0)}

/* ad slots: empty until ADS_CLIENT is set, then a labelled box */
.ad{margin:16px 0;display:none}
.ad.on{display:block;min-height:90px;background:var(--panel2);border:1px dashed var(--line);border-radius:10px;
  text-align:center;color:var(--muted);font-size:11px;line-height:90px}
.ad ins{display:block;line-height:normal}

/* ---------- home ---------- */
.hero{padding:22px 0 8px}
.hero h1{font-size:26px;margin:0 0 6px}
.hero p{margin:0 0 14px;color:var(--muted);max-width:560px}
.searchbox{position:relative}
.searchbox input{width:100%;padding:12px 14px;font-size:16px;border-radius:12px}
.hgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:8px;margin-top:10px}
.pk{display:flex;flex-direction:column;align-items:center;gap:2px;padding:10px 6px 8px;background:var(--panel);
  border:1px solid var(--line);border-radius:12px;text-decoration:none;color:var(--ink);text-align:center;box-shadow:var(--shadow)}
.pk:hover{background:var(--panel2)}
.pk img{width:64px;height:64px;image-rendering:pixelated;background:var(--panel2);border-radius:50%}
.pk b{font-size:13px;line-height:1.2;font-weight:600}
.pk span{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.pk .pbar{width:100%;height:4px;border-radius:9px;background:var(--panel2);margin-top:5px;overflow:hidden}
.pk .pbar i{display:block;height:100%;background:var(--good)}
.sect{margin-top:22px}
.sect h2{font-size:13px;font-weight:600;color:var(--muted);margin:0 0 6px;display:flex;justify-content:space-between}
.sect h2 a{font-weight:500}
.more{display:block;text-align:center;margin:14px 0}

/* ---------- species page (tracker) ---------- */
.phead{display:flex;align-items:center;gap:12px;padding-top:14px}
.phead img{width:72px;height:72px;image-rendering:pixelated;background:var(--panel2);border-radius:50%;flex:0 0 auto}
.phead h1{margin:0}
.phead .sub{margin:2px 0 0}
.phead .act{margin-left:auto;display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.stickyhead{position:sticky;top:calc(45px + env(safe-area-inset-top,0px));z-index:20;background:var(--bg);
  padding-top:10px;border-bottom:1px solid var(--line);margin:0 -16px;padding-left:16px;padding-right:16px}
.controls{display:flex;flex-wrap:wrap;gap:6px;padding-bottom:9px;align-items:center}
.controls input[type=search]{flex:1 1 150px}
.setgroup{margin-top:18px}
.setgroup>h2{font-size:12.5px;font-weight:600;color:var(--muted);
  margin:0 0 6px;padding:0 2px;display:flex;justify-content:space-between;gap:8px}
.setgroup>h2 em{font-style:normal;font-variant-numeric:tabular-nums}
ul.cards{list-style:none;margin:0;padding:0;background:var(--panel);border:1px solid var(--line);
  border-radius:12px;overflow:hidden;box-shadow:var(--shadow)}
li.row{display:flex;align-items:center;gap:10px;padding:9px 11px;border-top:1px solid var(--line);cursor:pointer}
li.row:first-child{border-top:0}
li.row:hover{background:var(--panel2)}
li.own{background:color-mix(in srgb,var(--good) 8%,var(--panel))}
li.own:hover{background:color-mix(in srgb,var(--good) 13%,var(--panel))}
.box{flex:0 0 auto;width:28px;height:28px;border-radius:7px;border:2px solid var(--line);
  background:var(--panel2);cursor:pointer;display:grid;place-items:center;padding:0;
  -webkit-tap-highlight-color:transparent}
.box[aria-pressed="true"]{background:var(--good);border-color:var(--good)}
.box:disabled{cursor:default;opacity:.7}
.box svg{width:15px;height:15px;stroke:#fff;stroke-width:3;fill:none;opacity:0}
.box[aria-pressed="true"] svg{opacity:1}
.thumb{flex:0 0 auto;width:46px;height:64px;border-radius:4px;background:var(--panel2);object-fit:cover;display:block}
.body{flex:1;min-width:0}
.name{font-weight:600;font-size:14.5px;line-height:1.3;word-wrap:break-word}
.meta{font-size:12px;color:var(--muted);margin-top:2px;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.tag{background:var(--chip);border-radius:5px;padding:1px 6px;font-size:10.5px}
.tag.ext{color:var(--accent)}
.right{flex:0 0 auto;text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.price{font-weight:600;font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}
.price.na{color:var(--muted);font-weight:400;font-size:12px}
a.buy{font-size:11.5px;color:var(--accent2);text-decoration:none;border:1px solid var(--line);
  border-radius:7px;padding:3px 8px;white-space:nowrap}
ul.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(108px,1fr));gap:12px;list-style:none;margin:0;padding:0}
.tile{position:relative;cursor:pointer}
.tile img{width:100%;aspect-ratio:1/1.395;border-radius:6px;background:var(--panel2);
  object-fit:cover;display:block;border:2px solid transparent}
.tile.own img{border-color:var(--good)}
.tile .box{position:absolute;top:6px;right:6px;width:26px;height:26px;border-radius:50%;
  background:rgba(20,22,26,.55);border:2px solid rgba(255,255,255,.75)}
.tile .box[aria-pressed="true"]{background:var(--good);border-color:var(--good)}
.tile .cap{font-size:11px;color:var(--muted);margin-top:4px;line-height:1.3;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tile .cap b{color:var(--ink);font-variant-numeric:tabular-nums}
.ro{background:color-mix(in srgb,var(--accent2) 10%,var(--panel));border:1px solid var(--line);border-radius:10px;
  padding:9px 12px;font-size:13px;margin:12px 0;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.ro .sp{flex:1}
.avatar{width:34px;height:34px;border-radius:50%;background:var(--panel2)}

/* ---------- detail view ---------- */
#dv{position:fixed;inset:0;z-index:60;display:none}
#dv.on{display:block}
#dv .scrim{position:absolute;inset:0;background:var(--scrim);opacity:0;transition:opacity .2s}
#dv.on .scrim{opacity:1}
.sheet{position:absolute;left:50%;top:50%;width:min(920px,calc(100vw - 32px));
  max-height:calc(100vh - 48px);transform:translate(-50%,-48%);opacity:0;
  transition:transform .22s ease,opacity .2s;background:var(--panel);border:1px solid var(--line);
  border-radius:16px;display:grid;grid-template-columns:minmax(0,380px) minmax(0,1fr);overflow:hidden}
#dv.on .sheet{transform:translate(-50%,-50%);opacity:1}
.art{background:var(--panel2);padding:22px;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:12px;min-height:0}
.art img{width:100%;max-width:336px;aspect-ratio:1/1.395;object-fit:contain;border-radius:12px;
  box-shadow:0 10px 30px rgba(0,0,0,.28);cursor:zoom-in}
.art .hint{font-size:11.5px;color:var(--muted)}
.info{overflow-y:auto;padding:18px 22px 24px;min-height:0;overscroll-behavior:contain}
.topbar{display:flex;align-items:center;gap:6px;margin-bottom:8px}
.topbar .sp{flex:1}
.ib{width:34px;height:34px;border-radius:9px;border:1px solid var(--line);background:var(--panel2);
  cursor:pointer;display:grid;place-items:center;padding:0}
.ib svg{width:16px;height:16px;stroke:currentColor;stroke-width:2.2;fill:none}
.ib:disabled{opacity:.35;cursor:default}
.pos{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.dn{font-size:22px;font-weight:700;letter-spacing:-.015em;line-height:1.2;margin:0}
.ds{color:var(--muted);font-size:13.5px;margin:3px 0 14px}
.act{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:18px}
.bigprice{font-size:26px;font-weight:700;font-variant-numeric:tabular-nums;margin-right:4px}
.bigprice small{display:block;font-size:11px;font-weight:400;color:var(--muted)}
.facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:var(--line);
  border:1px solid var(--line);border-radius:10px;overflow:hidden;margin:0 0 18px}
.facts div{background:var(--panel);padding:8px 11px;min-width:0}
.facts dt{font-size:11px;color:var(--muted)}
.facts div:last-child:nth-child(odd){grid-column:span 2}
.facts dd{margin:1px 0 0;font-size:13.5px;font-weight:500;overflow-wrap:anywhere}
.sec{margin:0 0 18px}
.sec h3{font-size:13px;font-weight:600;color:var(--muted);margin:0 0 8px}
.cardtext{border:1px solid var(--line);border-radius:10px;padding:12px 13px}
.hpline{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;
  font-size:13px;color:var(--muted)}
.hpline b{color:var(--ink);font-size:17px}
.move{padding:9px 0;border-top:1px solid var(--line)}
.move:first-of-type{border-top:0;padding-top:0}
.mh{display:flex;align-items:center;gap:8px}
.mh .mn{font-weight:600;flex:1}
.mh .dmg{font-weight:700;font-size:16px;font-variant-numeric:tabular-nums}
.mh .ab{font-size:10.5px;font-weight:700;color:#fff;background:#c0392b;border-radius:4px;padding:1px 6px}
.mt{font-size:13px;color:var(--muted);margin-top:3px}
.cost{display:inline-flex;gap:3px}
.e{width:18px;height:18px;border-radius:50%;display:inline-grid;place-items:center;
  font-size:9.5px;font-weight:800;color:#fff;box-shadow:inset 0 0 0 1px rgba(0,0,0,.18);flex:0 0 auto}
.e.Fire{background:#e4502f}.e.Water{background:#2f8ae0}.e.Grass{background:#3fa34d}
.e.Lightning{background:#f2c200;color:#3a2e00}.e.Psychic{background:#9b4fc4}.e.Fighting{background:#b85a28}
.e.Darkness{background:#343a42}.e.Metal{background:#8c96a1}.e.Dragon{background:#a88a2e}
.e.Fairy{background:#e07aae}.e.Colorless{background:#e3e3e3;color:#555}
.wrr{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px;padding-top:10px;
  border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
.wrr b{display:flex;align-items:center;gap:4px;color:var(--ink);font-size:13px;margin-top:2px;min-height:18px}
.rule{font-size:12.5px;color:var(--muted);margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}
.flavor{font-style:italic;font-size:13px;color:var(--muted);margin:10px 0 0}
.legal{display:flex;flex-wrap:wrap;gap:6px}
.lg{font-size:12px;border-radius:6px;padding:3px 8px;background:var(--chip)}
.lg.yes{color:var(--good)}
.lg.no{color:var(--muted);text-decoration:line-through}
.others{list-style:none;margin:0;padding:0;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.others li{display:flex;align-items:center;gap:10px;padding:8px 10px;border-top:1px solid var(--line);cursor:pointer}
.others li:first-child{border-top:0}
.others li:hover{background:var(--panel2)}
.others img{width:32px;height:45px;border-radius:3px;object-fit:cover;background:var(--panel2)}
.others .o1{flex:1;min-width:0;font-size:13px}
.others .o1 span{display:block;font-size:11.5px;color:var(--muted)}
.others .o2{font-size:13px;font-weight:600;font-variant-numeric:tabular-nums;text-align:right}
.others .o2 span{display:block;font-size:11px;font-weight:400;color:var(--good)}

/* ---------- account / profile ---------- */
.signin{display:flex;flex-direction:column;gap:8px;max-width:360px}
.signin .btn{justify-content:center;padding:12px 14px}
.prof{display:flex;align-items:center;gap:12px;padding-top:16px}
.prof img{width:56px;height:56px;border-radius:50%;background:var(--panel2)}
.prof h1{margin:0}
.field{display:flex;flex-direction:column;gap:4px;margin:10px 0}
.field label{font-size:12px;color:var(--muted)}
.field .inline{display:flex;gap:6px}
.field .inline input{flex:1}
.toggle{display:flex;align-items:center;gap:10px;cursor:pointer;font-size:14px;margin:10px 0}
.toggle input{width:20px;height:20px}
code.link{background:var(--chip);padding:3px 7px;border-radius:6px;font-size:12.5px;overflow-wrap:anywhere}
.legaltext{max-width:700px}
.legaltext h2{font-size:16px;margin:22px 0 6px}
.legaltext p,.legaltext li{color:var(--ink);font-size:14px}

@media (max-width:400px){
  .topnav{gap:6px}
  .topnav .navlink:not(#navAccount){display:none}  /* the brand already goes home */
}
@media (max-width:720px){
  .wrap{padding:0 12px}
  .topnav{padding-left:12px;padding-right:12px}
  .stickyhead{margin:0 -12px;padding-left:12px;padding-right:12px}
  .phead img{width:56px;height:56px}
  .phead .act{margin-left:0;width:100%;justify-content:flex-start}
  .phead{flex-wrap:wrap}
  .hgrid{grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:6px}
  .sheet{left:0;right:0;bottom:0;top:auto;width:100%;max-height:calc(100% - 28px);
    transform:translateY(100%);opacity:1;border-radius:18px 18px 0 0;border-bottom:0;
    grid-template-columns:1fr;grid-template-rows:auto;overflow-y:auto;
    padding-bottom:env(safe-area-inset-bottom,0px)}
  #dv.on .sheet{transform:translateY(0)}
  .art{padding:14px 16px 6px;background:var(--panel)}
  .art img{max-width:min(250px,62vw);max-height:48vh;width:auto}
  .art::before{content:"";width:38px;height:4px;border-radius:9px;background:var(--line);margin-bottom:2px}
  .art .hint{display:none}
  .info{overflow:visible;padding:8px 16px 28px}
  .topbar{position:sticky;top:0;background:var(--panel);margin:0 -16px 8px;padding:8px 16px;z-index:2}
  .dn{font-size:20px}
  .stat b{font-size:14px}
}
@media (prefers-reduced-motion:reduce){.sheet,#dv .scrim,.bar>i,#toast{transition:none}}

/* ---------- binder view ---------- */
.seg{display:inline-flex}
.seg .chip{border-radius:0}
.seg .chip:first-child{border-radius:99px 0 0 99px}
.seg .chip:last-child{border-radius:0 99px 99px 0}
.seg .chip+.chip{margin-left:-1px}
.binder{margin-top:14px}
.bnav{display:flex;align-items:center;justify-content:center;gap:12px;margin:8px 0}
.bnav .pos{font-size:13px;min-width:120px;text-align:center}
.spread{display:grid;grid-template-columns:1fr;gap:14px}
@media (min-width:720px){.spread{grid-template-columns:1fr 1fr}}
.bpage{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;padding:10px;border-radius:14px;
  background:linear-gradient(180deg,color-mix(in srgb,var(--panel) 80%,var(--ink)),color-mix(in srgb,var(--panel) 92%,var(--ink)));
  border:1px solid var(--line);box-shadow:var(--shadow)}
.pocket{position:relative;aspect-ratio:1/1.395;border-radius:7px;background:color-mix(in srgb,var(--panel2) 70%,var(--ink));
  overflow:hidden;cursor:pointer;border:2px solid transparent;box-shadow:inset 0 0 0 1px rgba(0,0,0,.25);
  -webkit-tap-highlight-color:transparent}
.pocket.empty{cursor:default;border:2px dashed var(--line);background:transparent;box-shadow:none}
.pocket img{width:100%;height:100%;object-fit:cover;display:block;filter:grayscale(1) brightness(.5);transition:filter .2s,transform .2s}
.pocket:hover img{filter:grayscale(.6) brightness(.75)}
.pocket.own img{filter:none}
.pocket.own{border-color:var(--good)}
.pocket.own:hover img{filter:none;transform:scale(1.03)}
.bd{position:absolute;font-size:9px;font-weight:700;line-height:1;padding:3px 5px;border-radius:4px;
  background:rgba(12,14,18,.78);color:#fff;letter-spacing:.02em;pointer-events:none;font-variant-numeric:tabular-nums}
.bd.tl{top:5px;left:5px;background:var(--accent);color:#1a1300}
.bd.tr{top:5px;right:5px;color:var(--accent)}
.bd.bl{bottom:5px;left:5px}
.bd.br{bottom:5px;right:5px}
.pocket.own .bd.br{background:var(--good)}
.binfo{position:absolute;top:50%;right:6px;transform:translateY(-50%);width:24px;height:24px;border-radius:50%;
  border:1px solid rgba(255,255,255,.6);background:rgba(12,14,18,.7);color:#fff;font:700 12px/1 Georgia,serif;
  cursor:pointer;opacity:0;transition:opacity .15s;padding:0}
.pocket:hover .binfo,.pocket:focus-within .binfo{opacity:1}
@media (hover:none){.binfo{opacity:1}}
.bset{position:absolute;left:0;right:0;bottom:22px;font-size:9px;text-align:center;color:#fff;
  background:linear-gradient(transparent,rgba(12,14,18,.7));padding:10px 4px 2px;white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis;pointer-events:none;opacity:0;transition:opacity .15s}
.pocket:hover .bset{opacity:1}
.bhint{text-align:center;margin-top:6px}
@media (max-width:720px){
  .bpage{gap:6px;padding:8px}
  .bd{font-size:8px;padding:2px 4px}
  .binfo{width:28px;height:28px}
}

/* ---------- adaptive card theme (detail sheet only) ----------
   The card lights the room, it does not recolor every object in it. The art
   stage carries the palette; the reading column is a mostly opaque neutral
   surface with a faint undertone. Variables come from applyTheme() in
   tracker.js; without .themed the neutral design above applies unchanged. */
#dv .scrim{background:var(--dv-scrim,var(--scrim))}
.sheet.themed{background:var(--dv-sheet);color:var(--dv-fg);border-color:var(--dv-border);
  box-shadow:0 30px 80px rgba(0,0,0,.4)}
.sheet.themed .art{position:relative;isolation:isolate;overflow:hidden;
  background:linear-gradient(160deg,var(--dv-a) 0%,color-mix(in srgb,var(--dv-a) 70%,var(--dv-b2)) 62%,var(--dv-b2) 100%)}
/* blurred artwork, faded out toward the bottom: a card's lower half is frame and text,
   not illustration, and letting it through is what turned Zekrom's stage khaki */
.sheet.themed .art::before{content:"";position:absolute;inset:-30% -30% -10%;z-index:-2;
  background:var(--dv-art) center 30%/cover no-repeat;filter:blur(38px) saturate(1.2);opacity:.42;transform:scale(1.15);
  -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 45%,transparent 80%);mask-image:linear-gradient(to bottom,#000 0%,#000 45%,transparent 80%)}
.sheet.themed .art::after{content:"";position:absolute;left:50%;top:46%;width:96%;aspect-ratio:1;z-index:-1;
  transform:translate(-50%,-50%);border-radius:50%;
  background:radial-gradient(closest-side,var(--dv-glow) 0%,color-mix(in srgb,var(--dv-glow) 50%,transparent) 48%,transparent 100%)}
.sheet.themed .art img{box-shadow:0 24px 54px rgba(0,0,0,.42),0 2px 6px rgba(0,0,0,.25),0 0 0 1px rgba(0,0,0,.1)}
.sheet.themed .art .hint{color:var(--dv-stage-muted)}
.sheet.themed .info{background:var(--dv-surface);position:relative}
.sheet.themed .info::before{content:"";position:absolute;left:0;top:0;bottom:0;width:32px;pointer-events:none;z-index:0;
  background:linear-gradient(to right,var(--dv-seam),transparent);opacity:.55}
.sheet.themed .info{box-shadow:inset 14px 0 18px -16px rgba(0,0,0,.28)}
.sheet.themed .info>*{position:relative;z-index:1}
.sheet.themed .ds,.sheet.themed .pos,.sheet.themed .facts dt,.sheet.themed .mt,.sheet.themed .sec h3,
.sheet.themed .flavor,.sheet.themed .rule,.sheet.themed .wrr,.sheet.themed .hpline,.sheet.themed .bigprice small,
.sheet.themed .others .o1 span,.sheet.themed .note,.sheet.themed .lg{color:var(--dv-muted)}
.sheet.themed .hpline b,.sheet.themed .wrr b,.sheet.themed .mh .dmg,.sheet.themed .others .o1,.sheet.themed .others .o2{color:var(--dv-fg)}
.sheet.themed .ib,.sheet.themed .btn{background:var(--dv-surface2);border-color:var(--dv-border);color:var(--dv-fg)}
.sheet.themed #dOwn.primary{background:var(--dv-c);border-color:var(--dv-c);color:var(--dv-on-c)}
.sheet.themed #dOwn.primary.own,.sheet.themed .btn.own{background:var(--good);border-color:var(--good);color:#fff}
.sheet.themed .btn.tcg{color:var(--dv-link);background:transparent}
.sheet.themed .facts{background:var(--dv-border);border-color:var(--dv-border)}
.sheet.themed .facts div{background:var(--dv-surface2)}
.sheet.themed .cardtext,.sheet.themed .others{border-color:var(--dv-border);background:var(--dv-surface2)}
.sheet.themed .move,.sheet.themed .wrr,.sheet.themed .rule,.sheet.themed .others li{border-color:var(--dv-border)}
.sheet.themed .others li:hover{background:color-mix(in srgb,var(--dv-c) 10%,transparent)}
.sheet.themed .others .o2 span,.sheet.themed .lg.yes{color:var(--dv-link)}
.sheet.themed .lg{background:var(--dv-surface2)}
.sheet.themed .note{border-left-color:var(--dv-c)}
.sheet.themed :focus-visible{outline-color:var(--dv-link)}
.sheet.themed,.sheet.themed .art,.sheet.themed .info,.sheet.themed .btn,.sheet.themed .facts div{transition:background .3s ease,color .3s ease,border-color .3s ease}
@media (max-width:720px){
  .sheet.themed .art::before{inset:-20% -20% -10%}
  .sheet.themed .info{background:var(--dv-surface);box-shadow:inset 0 14px 18px -16px rgba(0,0,0,.28)}
  .sheet.themed .info::before{left:0;right:0;top:0;bottom:auto;width:auto;height:28px;background:linear-gradient(to bottom,var(--dv-seam),transparent)}
  .sheet.themed .topbar{background:var(--dv-surface)}
}
@media (prefers-reduced-motion:reduce){.sheet.themed,.sheet.themed .art,.sheet.themed .info,.sheet.themed .btn,.sheet.themed .facts div{transition:none}}
