/* ---------- deck & collection ---------- */
/* the picked hand: 5 cards spread in a gentle arc, spaced so each card's art stays visible */
.dk-tray{position:sticky;bottom:0;z-index:2;container-type:inline-size;padding:16px 18px 10px;border-radius:20px;
  background:linear-gradient(180deg,var(--surf2),var(--surf));border:1px solid var(--line2);box-shadow:0 -20px 40px -20px rgba(var(--sh),calc(.8*var(--shk)))}
/* covers the screen's bottom padding so grid cards don't peek out under the sticky tray */
.dk-tray::after{content:"";position:absolute;left:-2px;right:-2px;top:calc(100% + 1px);height:max(24px,env(safe-area-inset-bottom));background:var(--bg0)}
/* 5 cards × 5em + 4 gaps × .5em = 27em, plus room for the tilt; shrinks to fit narrow screens */
.dk-fan{position:relative;height:8.4em;font-size:min(16px,calc(100cqw / 28.5))}
.dk-fs{position:absolute;bottom:1.6em;left:50%;width:5em;height:6em;margin-left:-2.5em;transform-origin:50% 100%;transition:transform .45s var(--spring)}
.dk-fs .dk-empty{width:100%;height:100%;border-radius:.6em;border:.08em dashed var(--line2);display:grid;place-items:center;color:var(--muted);font:700 max(10px,.8em) var(--display);opacity:.7}
.dk-fs .card{cursor:pointer;transition:filter .18s}
.dk-fs .card.deal{animation:deal .45s var(--spring)}
@keyframes deal{from{transform:translateY(4em) rotate(8deg);opacity:0}}
@media (hover:hover){.dk-fs:has(.card):hover{transform:var(--t) translateY(-.5em)!important}.dk-fs .card:hover{filter:brightness(1.12)}}
.dk-power{display:flex;flex-direction:column;gap:2px;font:600 11.5px var(--body);color:var(--muted);letter-spacing:.06em;text-transform:uppercase}
.dk-power b{font:800 22px/1 var(--display);color:var(--text);letter-spacing:0;font-variant-numeric:tabular-nums}
.dk-sides{display:grid;grid-template-columns:repeat(2,auto auto);gap:3px 8px;align-items:center;font-size:12px;color:var(--muted)}
.dk-bar{width:40px;height:5px;border-radius:3px;background:rgba(var(--tint),.1);overflow:hidden}
.dk-bar i{display:block;height:100%;background:var(--accent);border-radius:3px;transition:width .3s var(--ease)}
.dk-bar.weak i{background:var(--danger)}
.dk-act{flex:1 1 0;min-width:0;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:6px 10px;border-radius:12px;
  border:1px solid var(--line2);background:rgba(var(--tint),.03);color:var(--text);font:600 13.5px var(--body);cursor:pointer;white-space:nowrap;
  transition:background .18s,border-color .18s,color .18s,transform .2s var(--spring)}
.dk-act svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;flex:none}
.dk-act:hover:not(:disabled){background:rgba(var(--tint),.07);border-color:var(--accent)}
.dk-act:active:not(:disabled){transform:scale(.96)}
.dk-act:disabled{opacity:.4;cursor:default}
.dk-act.gold{color:var(--accent-ink);border-color:color-mix(in srgb,var(--accent) 45%,transparent)}
.dk-act.quiet{color:var(--muted)}
.dk-act.quiet:hover:not(:disabled){color:var(--danger);border-color:color-mix(in srgb,var(--danger) 55%,transparent)}
/* loadouts: saved hands above the collection */
.dk-lo{display:flex;flex-direction:column;gap:8px}
.dk-lohead{display:flex;justify-content:space-between;align-items:center;min-height:28px}
.dk-lohead .lbl{margin:0}
.dk-lohead .btn.text{min-height:28px;padding:2px 8px;font-size:13px}
.dk-lorow{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.dk-loslot{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:8px 10px 9px;border-radius:14px;border:1px solid var(--line2);
  background:var(--surf);cursor:pointer;text-align:left;min-width:0;transition:border-color .18s,box-shadow .18s,transform .2s var(--spring)}
.dk-loslot:hover{border-color:var(--accent)}
.dk-loslot:active{transform:scale(.97)}
.dk-loslot.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent),0 8px 20px -10px var(--accent-glow)}
.dk-loslot .stack{display:flex;font-size:5.2px;height:6em;padding-left:2.4em}
.dk-loslot .stack .card{margin-left:-2.4em;box-shadow:0 0 0 .15em var(--surf)}
.dk-loslot .stack .miss{width:5em;height:6em;margin-left:-2.4em;border-radius:.6em;border:.2em dashed var(--danger);background:var(--surf)}
.dk-loslot b{font:700 13.5px var(--display);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.dk-loslot span{font-size:11.5px;color:var(--muted);font-variant-numeric:tabular-nums}
.dk-loslot span.bad{color:var(--danger)}
.dk-loslot .tagx{position:absolute;right:8px;top:8px;font:700 10.5px var(--body);padding:1px 6px;border-radius:5px;background:var(--accent);color:var(--on-accent)}
.dk-loslot.empty{border-style:dashed;justify-content:center;align-items:center;min-height:86px;color:var(--muted);font:600 12.5px var(--body);text-align:center}
.dk-loslot.pick{border-color:var(--accent);border-style:solid;animation:loPulse 1.2s ease-in-out infinite}
@keyframes loPulse{50%{box-shadow:0 0 0 3px var(--accent-glow)}}
.dk-lowrap{position:relative;display:flex;min-width:0}
.dk-lowrap>.dk-loslot{flex:1}
.dk-lowrap.named .dk-loslot b{padding-right:28px}
.dk-loedit{position:absolute;right:5px;bottom:5px;width:32px;height:32px;border-radius:9px;border:0;background:none;color:var(--muted);cursor:pointer;display:grid;place-items:center;padding:0;transition:background .18s,color .18s}
.dk-loedit svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.dk-loedit:hover{background:rgba(var(--tint),.08);color:var(--accent-ink)}
.dk-loopts{display:flex;justify-content:center;flex-wrap:wrap;gap:4px;margin-top:10px}
.dk-lomain{color:var(--accent-ink)!important;font-size:13.5px}
.dk-lomain:disabled{opacity:1}
.dk-star{font-style:normal;color:var(--accent-ink);margin-right:4px}
.dk-lodel{color:var(--danger)!important;font-size:13.5px}
.dk-lodel:hover{background:color-mix(in srgb,var(--danger) 10%,transparent)}
.dk-lodel svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.dk-lonote{font-size:12.5px;color:var(--muted);min-height:18px;margin-top:-2px}
.dk-lonote b{color:var(--text);font-weight:600} .dk-lonote .bad{color:var(--danger)}
@media (max-width:380px){.dk-sides{display:none}.dk-act{padding:6px;font-size:13px;gap:4px}}
.dk-sides{min-width:0;overflow:hidden}

.meta{color:var(--muted);font-size:13px;text-align:center}

/* ---------- collection book ---------- */
/* a book on the table, kept flat and modern: the game's own colours, no textures. Pages by rarity, two side by side
   on wide screens, one on phones. --book is the cover and boards, --page the paper, --edge the stack of pages. */
#scr-coll .wrap,#scr-coll .topbar{max-width:1120px}
:root{--leather:#241452;--leather2:#120a2c;--book:#1a1240;--page:#171036;--edge:#2c2160;--cover1:#5a33b8;--cover2:#2a1868}
:root[data-theme="light"]{--leather:#3a2470;--leather2:#22124a;--book:#ddd3f5;--page:#ffffff;--edge:#d4caf0;--cover1:#7b4fe0;--cover2:#4a2aa0}
/* the background: the game's own, with a soft glow behind the book */
#scr-coll{background:radial-gradient(60% 50% at 50% 38%,var(--glow-a),transparent 70%),radial-gradient(40% 35% at 85% 90%,var(--glow-b),transparent 70%)}
.bd-gap{flex:1;pointer-events:none!important}
.binder{position:relative;z-index:1;flex:1;min-height:0;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:minmax(0,1fr);gap:4px;padding:12px 14px 16px;border-radius:14px;perspective:2400px;touch-action:pan-y;
  --ear:0px;--earl:0px;
  background:var(--book);box-shadow:inset 0 0 0 1px var(--line2),0 24px 48px -20px rgba(var(--sh),calc(.9*var(--shk)))}
/* the spine: a soft crease between the pages */
.binder::before{content:"";position:absolute;left:50%;top:10px;bottom:12px;width:18px;margin-left:-9px;z-index:7;pointer-events:none;
  background:linear-gradient(90deg,transparent,rgba(var(--sh),calc(.35*var(--shk))) 50%,transparent)}
/* one page: the spine sits at the left, with the edge of the pages already turned beside it */
.binder.single{grid-template-columns:1fr;padding-left:26px;overflow:hidden}
.binder.single::before{left:18px;width:12px;margin-left:0;background:linear-gradient(90deg,rgba(var(--sh),calc(.4*var(--shk))),transparent)}
.binder.single::after{content:"";position:absolute;left:8px;top:16px;bottom:20px;width:11px;border-radius:3px 0 0 3px;pointer-events:none;
  background:repeating-linear-gradient(90deg,var(--edge) 0 2px,var(--book) 2px 3.5px)}
.binder.single .bd-page.l,.binder.single .bd-sheet.l,.binder.single #bdPrevEar{display:none}
#bdL,.bd-sheet.l{grid-column:1;grid-row:1}
#bdR,.bd-sheet.r{grid-column:2;grid-row:1}
.binder.single #bdR,.binder.single .bd-sheet.r{grid-column:1}
/* the pages under the open ones (seen under a folded corner), with a few thin page edges showing */
.bd-sheet{position:relative;z-index:0;border-radius:6px;background:color-mix(in srgb,var(--page) 88%,var(--edge))}
.bd-sheet.l{box-shadow:-2px 2px 0 var(--edge),-4px 4px 0 var(--book),-5px 5px 0 var(--edge)}
.bd-sheet.r{box-shadow:2px 2px 0 var(--edge),4px 4px 0 var(--book),5px 5px 0 var(--edge)}
/* pages: plain paper with a soft shadow into the spine */
.bd-page{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0;min-height:0;padding:12px 14px 8px;border-radius:6px;container:bdpage/size;overflow:hidden;
  background:var(--curve,none),var(--page)}
.bd-page.l{--curve:linear-gradient(270deg,rgba(var(--sh),calc(.28*var(--shk))),transparent 7%);padding-right:20px;border-radius:6px 2px 2px 6px}
.bd-page.r{--curve:linear-gradient(90deg,rgba(var(--sh),calc(.28*var(--shk))),transparent 7%);padding-left:20px;border-radius:2px 6px 6px 2px}
/* a folded corner cuts the open page; the ear (below) is the flap folded back over it */
#bdR{clip-path:polygon(0 0,100% 0,100% calc(100% - var(--ear)),calc(100% - var(--ear)) 100%,var(--earl1,0px) 100%,0 calc(100% - var(--earl1,0px)));transition:clip-path .3s var(--spring)}
#bdL{clip-path:polygon(0 0,100% 0,100% 100%,var(--earl) 100%,0 calc(100% - var(--earl)));transition:clip-path .3s var(--spring)}
.binder.has-next{--ear:22px}
.binder:not(.single).has-prev{--earl:22px}
.binder.single.has-prev{--earl1:22px}
.binder.has-next:has(#bdNextEar:hover,#bdNextEar:focus-visible){--ear:34px}
.binder:not(.single).has-prev:has(#bdPrevEar:hover,#bdPrevEar:focus-visible){--earl:34px}
.binder.single.has-prev:has(#bdPrevEar:hover,#bdPrevEar:focus-visible){--earl1:34px}
.bd-ear{position:relative;z-index:8;grid-row:1;align-self:end;width:var(--ear);height:var(--ear);border:0;padding:0;background:none;cursor:pointer;
  filter:drop-shadow(-1px -1px 2px rgba(var(--sh),calc(.4*var(--shk))));transition:width .3s var(--spring),height .3s var(--spring)}
.bd-ear i{position:absolute;top:0;right:0;bottom:0;left:0;clip-path:polygon(0 0,100% 0,0 100%);
  background:linear-gradient(135deg,color-mix(in srgb,var(--page) 80%,var(--edge)),color-mix(in srgb,var(--page) 70%,var(--edge)))}
.bd-ear.r{grid-column:2;justify-self:end}
.binder.single .bd-ear.r{grid-column:1}
.bd-ear.l{grid-column:1;justify-self:start;width:var(--earl);height:var(--earl)}
.bd-ear.l i{clip-path:polygon(0 0,100% 0,100% 100%);background:linear-gradient(225deg,color-mix(in srgb,var(--page) 80%,var(--edge)),color-mix(in srgb,var(--page) 70%,var(--edge)))}
.binder.single #bdPrevEar{display:block;width:var(--earl1,0px);height:var(--earl1,0px)}
.bd-ear:focus-visible{outline:none}
.bd-ear:focus-visible i{filter:brightness(1.4)}
/* the arrows give way to the folded corners; the row only keeps room for the bookmarks */
.bd-top{height:40px;margin:0;pointer-events:none}
.bd-top>*{display:none}
/* a quiet chapter line at the top of each page */
.bd-chap{flex:none;display:flex;align-items:center;gap:.8em;font:500 11px/1 var(--display);letter-spacing:.3em;text-transform:uppercase;color:color-mix(in srgb,var(--text) 55%,transparent);padding-left:.3em;white-space:nowrap}
.bd-chap::before,.bd-chap::after{content:"";width:2.2em;height:1px;background:var(--line2)}
.bd-chap em{font-style:normal;letter-spacing:0;margin-right:.5em}
.bd-chap .done{color:var(--accent-ink)}
/* 2×2 cards, as big as the page allows */
/* --res: the page's height that isn't cards (the chapter line and the page number) */
.bd-grid{flex:1;min-height:0;align-self:stretch;display:grid;grid-template-columns:repeat(2,auto);grid-template-rows:repeat(2,auto);align-content:center;justify-content:center;gap:1.65em 2.1em;padding-top:4px;
  --res:46px;font-size:min(44px,calc((100cqw - 34px) / 13.4),calc((100cqh - var(--res)) / 16.1))}
.bd-grid.big .pocket::before{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--rc) 55%,transparent),0 0 1.1em -.4em var(--rc)}
.bd-num{flex:none;font:500 10.5px var(--body);color:var(--muted);opacity:.6;font-variant-numeric:tabular-nums}
@container bdpage (max-height:260px){.bd-num{display:none}.bd-grid{--res:27px}}
/* a wide, short page (a short browser window, a phone held sideways): the 4 cards in one row, so they can be bigger */
@container bdpage (min-aspect-ratio:3/2){
  .bd-grid{grid-template-columns:repeat(4,auto);grid-template-rows:auto;font-size:min(44px,calc((100cqw - 34px) / 27.6),calc((100cqh - var(--res)) / 8.2))}}
/* each card sits in a shallow spot pressed into the page; a card not found yet leaves the spot empty */
.pocket{position:relative;width:5em;height:6em;border-radius:.6em;display:grid;place-items:center;border:0;padding:0;cursor:pointer;background:none;transition:transform .25s var(--spring)}
.pocket::before{content:"";position:absolute;top:-.22em;right:-.22em;bottom:-.22em;left:-.22em;border-radius:.78em;pointer-events:none;background:var(--well);box-shadow:inset 0 0 0 1px var(--line)}
.pocket .card{font-size:1em;box-shadow:inset 0 0 0 .05em rgba(255,255,255,.32),0 .15em .35em rgba(var(--sh),calc(.5*var(--shk)));transition:box-shadow .25s}
.pocket .card .cnt{display:none}
.pocket .card.unknown{background:none;box-shadow:none}
.pocket .card.unknown i{opacity:.2}
@media (hover:hover){.pocket:not(.blank):hover{transform:translateY(-.18em) rotate(-1deg)}.pocket:not(.blank):hover .card:not(.unknown){box-shadow:inset 0 0 0 .05em rgba(255,255,255,.32),0 .5em .8em -.1em rgba(0,0,0,.7)}}
.pocket.blank{cursor:default}
.pocket.blank::before{display:none}
.pocket:focus-visible{outline:2px solid var(--accent-hi);outline-offset:.3em}
/* a wax seal shows how many copies you have */
/* every copy is in your hand: the card fades in its spot and says so */
.pocket.out .card{opacity:.22;filter:grayscale(.85)}
.pocket.out::after{content:"In hand";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:2;white-space:nowrap;pointer-events:none;
  font:600 .5em/1 var(--display);letter-spacing:.06em;padding:.45em .8em;border-radius:99px;color:var(--text);background:var(--book);box-shadow:inset 0 0 0 1px var(--line2)}
.pocket{z-index:1}
.pocket::before{z-index:-2}
/* spare copies: their edges stack up behind the card (one for 2 copies, two for 3 or more), and a tab hanging from under
   the card counts the copies still in the book */
.pocket.x2::after,.pocket.x3::after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;border-radius:.6em;transform:translate(.2em,.2em);pointer-events:none;
  background:linear-gradient(160deg,var(--grey1),var(--grey2));box-shadow:inset 0 0 0 .08em color-mix(in srgb,var(--rc) 60%,transparent)}
.pocket.x3::after{box-shadow:inset 0 0 0 .08em color-mix(in srgb,var(--rc) 60%,transparent),.2em .2em 0 -.02em var(--grey2),.2em .2em 0 .04em color-mix(in srgb,var(--rc) 40%,transparent)}
/* the tab starts under the card's bottom edge, so it reads as part of that card */
.seal{position:absolute;left:50%;top:calc(100% - 1em);z-index:0;transform:translateX(-50%);pointer-events:none;white-space:nowrap;
  font:700 .58em/1 var(--display);letter-spacing:.04em;padding:1.8em .85em .42em;border-radius:0 0 .7em .7em;
  color:var(--text);background:color-mix(in srgb,var(--accent) 22%,var(--book));box-shadow:inset 0 0 0 1px var(--line2)}
/* the turning page: a sheet cut into 8 strips, each bent a little more than the last, so the paper curls (collection.js) */
.bd-leaf{position:absolute;transform-style:preserve-3d;pointer-events:none;will-change:transform}
.bd-strip{position:absolute;top:0;transform-style:preserve-3d}
.bd-face{position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.bd-face.back{transform:rotateY(180deg)}
.bd-face>.bd-page{position:absolute;top:0}
.bd-dim{position:absolute;top:0;right:0;bottom:0;left:0;background:#000;opacity:0;pointer-events:none;z-index:4}
/* one page: the sheet swings inside a box the size of the page, seen from the spine */
.bd-clip{position:absolute;z-index:20;overflow:hidden;border-radius:4px;perspective:1400px;perspective-origin:0 50%;pointer-events:none}
/* the shadow on the page under a lifting sheet (or the cover as it opens) */
.bd-under{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:4px;pointer-events:none;z-index:5;opacity:0}
.bd-under.to-r{background:linear-gradient(90deg,rgba(0,0,0,.6),rgba(0,0,0,.14) 55%,transparent)}
.bd-under.to-l{background:linear-gradient(270deg,rgba(0,0,0,.6),rgba(0,0,0,.14) 55%,transparent)}
/* the blank page that keeps each rarity on its own spread */
.bd-blank{flex:1}
/* empty paper can be grabbed to turn the page */
#bdL,#bdR{cursor:grab}
.binder.grabbing,.binder.grabbing *{cursor:grabbing!important}

/* ---------- binder pages: clear sleeves ----------
   Each card sits in its own clear, stiff sleeve: a bright edge all round, a thicker sealed lip under the card, an
   open top with a thumb notch, and a soft band of light across the plastic that slides a little when you point at
   it. The page itself stays plain. The back of the sleeve is the cell's ::before (under the card and its tab), the
   front sheet is the cell's ::after (over the card, under the + button, never catching a click). */
#bdWrap{
  /* how far the sleeve reaches past the card: top, sides, and the lip at the bottom. The top stays short so a copies
     tab hanging from the card above never touches this sleeve */
  --sl-t:.26em;--sl-s:.3em;--sl-b:.48em;
  /* the plastic: a shade of the page edge, a little denser in the sealed lip */
  --sl-body:color-mix(in srgb,var(--edge) 42%,transparent);
  --sl-lip:color-mix(in srgb,var(--edge) 78%,transparent);
  /* light on the edges: soft on the dark page, stronger on the light one (where white needs more to show) */
  --sl-hi:rgba(255,255,255,calc(.92 - .56*var(--shk)));
  --sl-glint:rgba(255,255,255,calc(.5 - .32*var(--shk)))}
/* the old soft spot under the card gives way to the sleeve */
#bdWrap .pocket::before{display:none}
/* the back of the sleeve: clear plastic a shade off the page, a bright edge, a little shade where you look into the
   open top, and the sealed lip the card rests on, with a bright seam and a thicker bright bottom edge */
#bdWrap .pk-cell::before{content:"";position:absolute;z-index:0;pointer-events:none;
  top:calc(-1*var(--sl-t));left:calc(-1*var(--sl-s));right:calc(-1*var(--sl-s));bottom:calc(-1*var(--sl-b));border-radius:.82em .82em .72em .72em;
  background:
    linear-gradient(180deg,var(--sl-hi) 0 1px,var(--sl-lip) 1px,color-mix(in srgb,var(--sl-lip) 80%,transparent)) 0 100%/100% var(--sl-b) no-repeat,
    linear-gradient(180deg,rgba(var(--sh),calc(.26*var(--shk))),transparent .22em),
    var(--sl-body);
  box-shadow:0 0 0 1px var(--line2),inset 0 0 0 1px var(--sl-hi),inset 0 -.07em 0 var(--sl-hi),0 .2em .45em -.2em rgba(var(--sh),calc(.55*var(--shk)))}
/* the front sheet: a faint haze, a soft band of light, bright inner edges at the sides, and its top edge a little
   lower than the back's, broken by a thumb notch, so the sleeve reads as open at the top. It stops where the card
   rests, so the copies tab under the card stays crisp. */
#bdWrap .pk-cell::after{content:"";position:absolute;z-index:1;pointer-events:none;
  top:calc(.09em - var(--sl-t));left:calc(-1*var(--sl-s));right:calc(-1*var(--sl-s));bottom:0;border-radius:.7em .7em 0 0;
  background:
    radial-gradient(circle at 50% 0,transparent calc(.42em - 1.5px),var(--sl-hi) calc(.42em - .5px),transparent calc(.42em + .5px)) 50% 0/.9em .45em no-repeat,
    linear-gradient(var(--sl-hi),var(--sl-hi)) 0 0/calc(50% - .42em) 1px no-repeat,
    linear-gradient(var(--sl-hi),var(--sl-hi)) 100% 0/calc(50% - .42em) 1px no-repeat,
    linear-gradient(180deg,rgba(var(--sh),calc(.2*var(--shk))) 1px,transparent .12em),
    linear-gradient(90deg,var(--sl-glint),transparent .14em,transparent calc(100% - .12em),color-mix(in srgb,var(--sl-glint) 60%,transparent)),
    linear-gradient(115deg,transparent 36%,rgba(255,255,255,.13) 44%,rgba(255,255,255,.045) 49%,transparent 53%,transparent 57%,rgba(255,255,255,.085) 58.5%,transparent 60%) 30% 0/200% 100% no-repeat,
    radial-gradient(120% 55% at 0 0,rgba(255,255,255,.06),transparent 70%),
    linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.015) 45%,rgba(255,255,255,.03));
  transition:background-position .6s var(--ease)}
/* a slot with no card on it has no sleeve */
#bdWrap .pk-cell.blank::before,#bdWrap .pk-cell.blank::after{display:none}
/* 4★ and 5★ pages: the sleeve's edge takes the rarity colour, with a soft glow */
#bdWrap .bd-grid.big .pk-cell::before{box-shadow:0 0 0 1px color-mix(in srgb,var(--rc) 55%,transparent),inset 0 0 0 1px var(--sl-hi),inset 0 -.07em 0 var(--sl-hi),
  0 0 1.1em -.4em var(--rc),0 .2em .45em -.2em rgba(var(--sh),calc(.55*var(--shk)))}
/* keyboard focus rings the whole sleeve, instead of a box round the card that cuts across the lip */
@supports selector(:has(*)){
  #bdWrap .pocket:focus-visible{outline:none}
  #bdWrap .pk-cell:has(>.pocket:focus-visible)::before{outline:2px solid var(--accent-hi);outline-offset:1px}}
/* spare copies sit a little tighter, so the whole stack fits inside the sleeve. Their edges take the card's rarity
   colour on every page (1★–3★ pages have no colour of their own, so the pocket gets its card's rar class: cards.css) */
#bdWrap .pocket.x2::after,#bdWrap .pocket.x3::after{transform:translate(.11em,.11em);box-shadow:inset 0 0 0 .08em color-mix(in srgb,var(--rc,var(--muted)) 60%,transparent)}
#bdWrap .pocket.x3::after{box-shadow:inset 0 0 0 .08em color-mix(in srgb,var(--rc,var(--muted)) 60%,transparent),.11em .11em 0 -.02em var(--grey2),.11em .11em 0 .04em color-mix(in srgb,var(--rc,var(--muted)) 40%,transparent)}
/* pointing at a card: it slides straight up in its sleeve, toward the open top, and the light on the plastic moves */
@media (hover:hover){
  #bdWrap .pocket:not(.blank):hover{transform:translateY(-.18em)}
  #bdWrap .pk-cell:hover::after{background-position:50% 0,0 0,100% 0,0 0,0 0,42% 0,0 0,0 0}}
#bdWrap .pk-cell:has(>.pocket:focus-visible)::after{background-position:50% 0,0 0,100% 0,0 0,0 0,42% 0,0 0,0 0}
/* less motion: the card and the light stay put */
@media (prefers-reduced-motion:reduce){
  #bdWrap .pk-cell::after{transition:none}
  #bdWrap .pocket:not(.blank):hover{transform:none}
  #bdWrap .pk-cell:hover::after,#bdWrap .pk-cell:has(>.pocket:focus-visible)::after{background-position:50% 0,0 0,100% 0,0 0,0 0,30% 0,0 0,0 0}}

/* bookmarks: one ribbon per rarity, tucked into the book behind the pages. The open rarity's ribbon is pulled all
   the way out; the ones still ahead peek out on the right; the ones you've passed lie on the left, and flip over the
   spine with the page (in time with the turn). One page: the passed ones stack by the spine instead. */
.bd-wrap{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;perspective:2400px}
.coll-book{overflow-x:clip}
.bd-ribs{position:absolute;left:0;right:0;top:-40px;height:74px;z-index:0;perspective:2000px;perspective-origin:50% 100%;pointer-events:none;transition:opacity .35s}
.bd-ribs.hide{opacity:0;transition:none}
.bd-rib{--w:clamp(34px,5.4cqw,54px);--x:calc(18px + (var(--r) - 1) * (var(--w) + 6px));position:absolute;top:0;left:calc(50% + var(--x));width:var(--w);height:100%;
  border:0;padding:0;background:none;cursor:pointer;pointer-events:auto;transform-style:preserve-3d;transform-origin:calc(-1 * var(--x)) 50%;translate:0 17px;--dim:brightness(.78) saturate(.85);
  transition:transform .7s cubic-bezier(.45,.05,.2,1),translate .4s var(--spring),left .6s cubic-bezier(.45,.05,.2,1)}
.bd-rib.rar1{--r:1} .bd-rib.rar2{--r:2} .bd-rib.rar3{--r:3} .bd-rib.rar4{--r:4} .bd-rib.rar5{--r:5}
/* a narrow book (a small phone, zoomed in): slimmer ribbons, closer together, so all five still fit */
@container (max-width:259px){.bd-rib{--w:28px;--x:calc(18px + (var(--r) - 1) * (var(--w) + 3px))}.bd-rib i{font-size:11px}}
.cq-poly .coll-book.cq-b260 .bd-rib{--w:28px;--x:calc(18px + (var(--r) - 1) * (var(--w) + 3px))}
.cq-poly .coll-book.cq-b260 .bd-rib i{font-size:11px}
.bd-rib.left{transform:rotateY(-180deg)}
.bd-rib.on{translate:0 0;--dim:none}
.bd-rib:not(.on):hover{translate:0 10px;--dim:brightness(.92)}
.bd-rib i{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;gap:2px;padding-top:10px;font:600 13px/1 var(--display);font-style:normal;color:#1b0d22;
  backface-visibility:hidden;-webkit-backface-visibility:hidden;filter:var(--dim);transition:filter .3s;clip-path:polygon(0 0,50% 13%,100% 0,100% 100%,0 100%);
  background:linear-gradient(transparent 55%,rgba(0,0,0,.18)),var(--rc)}
.bd-rib.rar5 i{background:linear-gradient(transparent 55%,rgba(0,0,0,.15)),var(--prism)}
.bd-rib i.b{transform:rotateY(180deg)}
.bd-rib i em{font-style:normal;font-size:9px}
.bd-rib:focus-visible{outline:none}
.bd-rib:focus-visible i{outline:2px solid var(--text);outline-offset:-2px}
.coll-book.single .bd-rib{left:calc(36px + var(--x) - 18px)}
.coll-book.single .bd-rib.left{transform:none;left:calc(4px + var(--d) * 9px);z-index:calc(10 - var(--d));translate:0 calc(12px + var(--d) * 3px)}
/* browsers without the translate property (Chrome before 104): the same drops, inside transform */
@supports not (translate:0 0){
  .bd-rib{transform:translateY(17px)}
  .bd-rib.on{transform:none}
  .bd-rib:not(.on):hover{transform:translateY(10px)}
  .bd-rib.left{transform:translateY(17px) rotateY(-180deg)}
  .bd-rib.left:hover{transform:translateY(10px) rotateY(-180deg)}
  .coll-book.single .bd-rib.left,.coll-book.single .bd-rib.left:hover{transform:translateY(calc(12px + var(--d) * 3px))}}

/* the front cover: smooth violet, the Leylines sigil in light lines, an elastic band round it. Opening the collection:
   the band snaps off, the sigil lights, then the cover swings open on the spine and lands as the left half while the
   book slides to the middle. One page: it swings off to the left and fades. Leaving plays it backwards, quickly.
   Not when picking. */
.bd-cover{position:absolute;z-index:30;transform-style:preserve-3d;transform-origin:0 50%;pointer-events:none;container-type:inline-size}
.bd-cover .cf{position:absolute;top:0;right:0;bottom:0;left:0;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.bd-cover .cf.front{border-radius:6px 16px 16px 6px;background:linear-gradient(150deg,var(--cover1),var(--cover2));
  box-shadow:inset 10px 0 10px -8px rgba(0,0,0,.4),inset 0 0 0 1px rgba(255,255,255,.12),0 24px 48px -20px rgba(var(--sh),calc(.9*var(--shk)))}
.bd-cover .cv-spine{position:absolute;left:12px;top:0;bottom:0;width:1px;background:rgba(255,255,255,.14)}
.bd-cover .cv-sigil{position:absolute;left:50%;top:45%;width:clamp(110px,44cqw,240px);transform:translate(-50%,-50%);overflow:visible}
.cv-sigil .eng{fill:none;stroke:#fff;stroke-opacity:.45;stroke-width:2.4}
.cv-sigil .eng.f{fill:rgba(255,255,255,.05)}
.cv-sigil .ln{fill:none;stroke:#ff86c4;stroke-width:5;stroke-linecap:round;stroke-dasharray:1;stroke-dashoffset:1;filter:drop-shadow(0 0 6px #ff5fa8)}
.cv-sigil .gem{fill:rgba(255,255,255,.12);stroke:#fff;stroke-opacity:.6;stroke-width:2;transition:fill .3s}
.cv-sigil.lit .gem{fill:#ffd2ea;filter:drop-shadow(0 0 7px #ff5fa8)}
.cv-sigil .pulse{fill:none;stroke:#ff86c4;stroke-width:3;opacity:0;transform-box:fill-box;transform-origin:center;filter:drop-shadow(0 0 6px #ff5fa8)}
.bd-cover .cv-title{position:absolute;left:50%;bottom:12%;transform:translateX(-50%);padding-left:.4em;font:500 clamp(10px,3.4cqw,15px)/1 var(--display);letter-spacing:.4em;text-transform:uppercase;color:rgba(255,255,255,.75);white-space:nowrap}
/* the elastic band: top to bottom near the edge */
.bd-cover .cv-band{position:absolute;top:-2px;bottom:-2px;right:9%;width:clamp(9px,3cqw,15px);border-radius:3px;transform-origin:50% 50%;
  background:linear-gradient(90deg,rgba(0,0,0,.25),transparent 35%,rgba(255,255,255,.18) 50%,transparent 65%,rgba(0,0,0,.25)),var(--cta);box-shadow:-2px 0 4px rgba(0,0,0,.35)}
.bd-cover .cf.back{transform:rotateY(180deg);border-radius:16px 6px 6px 16px;background:var(--book);box-shadow:inset 0 0 0 1px var(--line2)}
.bd-cover .cf.back .bd-page{position:absolute}
/* light and shadow as the cover swings: the front darkens as it turns away, the inside lightens as it lands */
.bd-cover .cv-shd{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;background:#05020f;opacity:0;pointer-events:none;z-index:5}


/* + adds a card to the hand: shows on hover (always on touch screens), so the page stays quiet */
.pk-cell{position:relative}
.pk-add{position:absolute;right:-.35em;bottom:-.35em;z-index:2;width:1.3em;height:1.3em;min-width:22px;min-height:22px;border-radius:50%;padding:0;cursor:pointer;opacity:0;
  display:grid;place-items:center;font:800 max(11px,.85em)/1 var(--display);color:var(--on-accent);border:2px solid var(--page);
  background:linear-gradient(180deg,var(--accent-hi),var(--accent));box-shadow:0 3px 8px rgba(var(--sh),calc(.5*var(--shk)));transition:transform .2s var(--spring),opacity .18s}
.pk-add:hover:not(.off){transform:scale(1.12)}
.pk-add:active:not(.off){transform:scale(.92)}
.pk-cell:hover .pk-add,.pk-add:focus-visible{opacity:1}
.pk-cell:hover .pk-add.off{opacity:.3}
.pk-add.off{cursor:default;filter:grayscale(.6)}
@media (hover:none){.pk-add{opacity:.9}.pk-add.off{opacity:.3}}
@media (pointer:coarse){.pk-add{min-width:26px;min-height:26px}}
/* dragging a card from the binder onto the hand */
.pocket.dragging{opacity:.3}
.coll-tray{transition:border-color .18s,box-shadow .18s}
.coll-tray.over{border-color:var(--accent-ink);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 30%,transparent),0 -20px 40px -20px rgba(var(--sh),calc(.8*var(--shk)))}


/* card detail popup: a single page of the book, the card lifted out of its sleeve */
.mbox.cd-box{position:relative;max-width:420px;padding:10px;background:var(--book);border-color:var(--line2)}
.cd-sheet{border-radius:8px;background:var(--page);box-shadow:2px 2px 0 var(--edge),4px 4px 0 var(--book),5px 5px 0 var(--edge);padding:14px 16px 16px;display:flex;flex-direction:column;align-items:center;gap:12px}
.cd-top{align-self:stretch;display:flex;justify-content:space-between;font:600 12px var(--body);color:var(--muted);font-variant-numeric:tabular-nums}
.cd-top b{color:var(--accent-ink);font-weight:600}
.cd-pulled{font-size:30px}
/* a short screen: a smaller card, so the buttons stay in sight */
@media (max-height:640px){.cd-pulled{font-size:22px}.cd-sheet{gap:10px}}
@media (max-height:500px){.cd-pulled{font-size:17px}.mbox h2.cd-name{font-size:22px}}
/* a phone held sideways: the card on the left, what it is and the buttons beside it */
@media (orientation:landscape) and (max-height:520px){
  .mbox.cd-box{max-width:600px}
  .cd-sheet{display:grid;grid-template-columns:auto minmax(0,1fr);justify-items:center;align-items:center;gap:8px 18px;padding:12px 16px 14px}
  .cd-sheet>*{grid-column:2}
  .cd-sheet>.cd-top{grid-column:1/-1;justify-self:stretch}
  .cd-sheet>.cd-pulled{grid-column:1;grid-row:2/span 6;font-size:20px}
  .cd-sheet>.cd-sides,.cd-sheet>.mbtns{justify-self:stretch}
  .cd-sub{margin-top:-4px}
}
.cd-sleeve{position:relative;padding:.3em;border-radius:.8em;background:var(--well);box-shadow:inset 0 0 0 1px var(--line2)}
.cd-sleeve::after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;pointer-events:none;background:linear-gradient(115deg,transparent 30%,rgba(255,255,255,.1) 45%,transparent 58%)}
.cd-sleeve .card{transform:translateY(-.55em) rotate(-2.5deg);box-shadow:inset 0 0 0 .05em rgba(255,255,255,.32),0 .5em 1em -.2em rgba(0,0,0,.8)}
/* Epic and Legendary: a band of light sweeps across the card as it lands (collection.js) */
.card .shine{position:absolute;top:-20%;right:-60%;bottom:-20%;left:-60%;z-index:4;pointer-events:none;opacity:0;background:linear-gradient(105deg,transparent 38%,rgba(255,255,255,.55) 48%,rgba(255,240,255,.15) 53%,transparent 62%)}
.cd-stamp{position:absolute;left:50%;top:44%;transform:translate(-50%,-50%) rotate(-14deg);z-index:2;font:900 .5em/1 var(--display);letter-spacing:.12em;text-transform:uppercase;
  color:var(--danger);border:.08em solid var(--danger);border-radius:.18em;padding:.15em .4em;background:rgba(20,4,4,.55)}
.mbox h2.cd-name{margin:0;font-size:26px}
.cd-sub{margin-top:-8px;font-size:13.5px;color:var(--muted)}
.cd-sides{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;align-self:stretch}
.cd-sides div{border-radius:10px;background:var(--well);border:1px solid var(--line);padding:6px 4px 5px;display:flex;flex-direction:column;align-items:center;gap:1px}
.cd-sides b{font:900 20px/1 var(--display)} .cd-sides span{font-size:11px;color:var(--muted)}
.cd-own{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted)}
.cd-own b{font:800 15px var(--display);color:var(--on-accent);background:var(--accent);border-radius:7px;padding:1px 8px}
.cd-own.lost b{background:var(--danger);color:#fff}
.mbox p.cd-msg{font-size:13px;color:var(--danger);margin:-4px auto 0;max-width:34ch}
.cd-sheet .mbtns{align-self:stretch;margin-top:0}
.vh{position:absolute!important;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* ---------- collection fits one screen ----------
   The book takes whatever height is left. Under it, things on the table: the loadouts as deck boxes, the hand as a
   mat, and a panel with power, side strength and the buttons. Wide screens: those side by side under the book.
   Phones: the deck boxes in a row, the mat, then the panel. */
#scr-coll .topbar.coll-top{margin:2px 0 2px}
.coll-title{flex:1;min-width:0;display:flex;flex-direction:column}
.coll-title h2{margin:0}
.coll-title .meta{text-align:left;font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#scr-coll .wrap.coll-wrap{flex:1 1 auto;min-height:420px;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:16px}
.coll-book{display:flex;flex-direction:column;min-height:0;min-width:0;width:100%;max-width:1000px;justify-self:center;container-type:inline-size}
.bd-top{position:relative;z-index:1}
.coll-side{display:flex;flex-direction:column;gap:10px;min-width:0}
/* loadouts: deck boxes shaped to hold the cards on the mat (taller than wide), a lid, the name on the front.
   The one in your hand is outlined; the star and the pencil sit on the lid. */
#scr-coll .dk-lo{gap:6px}
#scr-coll .dk-lohead{min-height:22px;justify-content:flex-start;gap:10px}
#scr-coll .dk-lohead .lbl{flex:none}
#scr-coll .dk-lohead .btn.text{flex:none}
/* the note: one line at the top right of the loadouts, cut short with … if it is long */
#scr-coll .dk-lonote{flex:1 1 auto;min-width:0;min-height:0;margin:0;text-align:right;font-size:12px;line-height:22px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#scr-coll .dk-lonote:empty{display:none}
#scr-coll .dk-lorow{grid-template-columns:repeat(3,auto);justify-content:start;gap:10px}
#scr-coll .dk-loslot{width:82px;height:104px;min-height:0;padding:22px 6px 7px;justify-content:flex-end;gap:2px;border:0;border-radius:7px 7px 6px 6px;overflow:hidden;
  background:linear-gradient(150deg,var(--cover1),var(--cover2));box-shadow:inset 0 0 0 1px rgba(255,255,255,.12),0 9px 16px -8px rgba(var(--sh),calc(.8*var(--shk)))}
#scr-coll .dk-loslot::before{content:"";position:absolute;left:0;right:0;top:16px;height:1px;background:rgba(0,0,0,.3);box-shadow:0 1px 0 rgba(255,255,255,.12)}
#scr-coll .dk-loslot:hover{box-shadow:inset 0 0 0 1px rgba(255,255,255,.4),0 9px 16px -8px rgba(var(--sh),calc(.8*var(--shk)))}
#scr-coll .dk-loslot b{max-width:100%;font:600 11px/1.15 var(--display);color:#fff;white-space:normal;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
#scr-coll .dk-loslot span{font-size:10.5px;line-height:1.2;color:rgba(255,255,255,.7)}
#scr-coll .dk-loslot span.bad{color:#ff8a9a}
#scr-coll .dk-loslot .stack{display:none}
#scr-coll .dk-loslot .tagx{display:none}
#scr-coll .dk-loslot.on{box-shadow:inset 0 0 0 2px #fff,0 0 0 2px var(--cta),0 9px 16px -8px rgba(var(--sh),calc(.8*var(--shk)))}
#scr-coll .dk-loslot.empty{min-height:0;padding:6px;justify-content:center;align-items:center;background:none;box-shadow:inset 0 0 0 1.5px var(--line2);color:var(--muted);font-size:10.5px;line-height:1.25}
#scr-coll .dk-loslot.empty::before{display:none}
#scr-coll .dk-loslot.pick{box-shadow:inset 0 0 0 1.5px var(--accent-hi);animation:loPulse 1.2s ease-in-out infinite}
#scr-coll .dk-loedit{right:1px;top:0;bottom:auto;width:24px;height:17px;border-radius:5px;color:rgba(255,255,255,.75)}
#scr-coll .dk-loedit svg{width:12px;height:12px}
#scr-coll .dk-loedit:hover{background:rgba(255,255,255,.12);color:#fff}
#scr-coll .dk-star{position:absolute;left:6px;top:1px;margin:0;font-size:11px;line-height:15px;color:#ffd76a}
/* the hand: a mat with five places */
#scr-coll .dk-tray{position:relative;bottom:auto;padding:0;border:0;border-radius:0;background:none;box-shadow:none;display:flex;flex-direction:column;gap:10px}
#scr-coll .dk-tray::after{display:none}
#scr-coll .dk-fan{height:auto;display:flex;justify-content:center;align-items:center;gap:.55em;padding:.8em 1em;border-radius:14px;font-size:min(14px,calc((100cqw - 24px) / 29.6));transition:box-shadow .2s;
  background:var(--book);box-shadow:inset 0 0 0 1px var(--line2),0 12px 22px -14px rgba(var(--sh),calc(.8*var(--shk)))}
#scr-coll .dk-fs{position:relative;left:auto;bottom:auto;margin:0;transform:none!important;transition:transform .25s var(--spring)}
@media (hover:hover){#scr-coll .dk-fs:has(.card):hover{transform:translateY(-.3em)!important}}
#scr-coll .dk-fs .card{box-shadow:inset 0 0 0 .05em rgba(255,255,255,.32),0 .15em .35em rgba(var(--sh),calc(.5*var(--shk)))}
#scr-coll .dk-fs .dk-empty{border:.08em dashed var(--line2);color:var(--muted);opacity:.8}
/* a hand card dragged over the book: the book lights up to take it back */
.bd-wrap.drop .binder{box-shadow:inset 0 0 0 2px var(--accent-hi),0 0 30px -6px var(--accent-glow),0 24px 48px -20px rgba(var(--sh),calc(.9*var(--shk)))}
.coll-tray.over .dk-fan{box-shadow:inset 0 0 0 2px var(--accent-hi),0 0 22px -4px var(--accent-glow)}
/* the panel: power, the best number on each side, Best 5 / Clear / Save hand (and Play when picking) */
.coll-panel{display:flex;flex-direction:column;justify-content:center;gap:8px;min-width:0;padding:10px 12px;border-radius:14px;
  background:var(--book);box-shadow:inset 0 0 0 1px var(--line2),0 12px 22px -14px rgba(var(--sh),calc(.8*var(--shk)))}
.coll-sides{grid-template-columns:repeat(4,auto minmax(14px,40px))!important;justify-content:space-between;column-gap:6px!important;min-width:0}
.coll-sides .dk-bar{width:auto}
.coll-row{display:flex;align-items:center;gap:8px}
.coll-row .dk-power{flex:none;margin-right:4px}
.coll-row .dk-act{flex:none;min-height:42px}
#scr-coll:not(.pick) .coll-row #collClear{width:42px;padding:0}
#scr-coll:not(.pick) .coll-row #collClear span{display:none}
.coll-row .btn.primary{flex:1;min-width:0;min-height:42px;padding:6px 12px;font-size:15px;white-space:nowrap}
@media (max-width:599px){#scr-coll .coll-sides{display:none}}
/* a narrow panel shows Best 5 as an icon so Save hand keeps one line */
@container (max-width:330px){.coll-row .dk-act span{display:none}.coll-row #collBest{width:42px;padding:0}}
.cq-poly .dk-tray.cq-b331 .coll-row .dk-act span{display:none}
.cq-poly #scr-coll:not(.pick) .dk-tray.cq-b331 .coll-row #collBest{width:42px;padding:0}
/* narrower still (a small phone held sideways, zoomed in): Save hand a little smaller so its words fit */
@container (max-width:260px){.coll-row .btn.primary{padding:4px 6px;font-size:13.5px;line-height:1.05;white-space:normal}}
.cq-poly .dk-tray.cq-b261 .coll-row .btn.primary{padding:4px 6px;font-size:13.5px;line-height:1.05;white-space:normal}
/* picking cards for a match: Best 5, Clear and Save hand share the row with their words, and Play gets its own row under them */
#scr-coll.pick .coll-row{flex-wrap:wrap}
#scr-coll.pick .coll-row .dk-act{flex:1 1 0;width:auto;padding:6px 8px;white-space:normal;line-height:1.1} /* tight: two lines, never past the edge */
#scr-coll.pick .coll-row .dk-act span{display:inline}
#scr-coll.pick .coll-row #collGo{flex:1 0 100%;min-height:48px;font-size:16px}
@container (max-width:360px){#scr-coll.pick .coll-row .dk-act svg{display:none}}
.cq-poly #scr-coll.pick .dk-tray.cq-b361 .coll-row .dk-act svg{display:none}
/* a card you can't add right now (every copy in hand, hand full, over the rarity limit) fades */
.pk-cell.used .pocket{opacity:.35}
/* the Forge's picker (forge.js): no power, side strength or Best 5, just what the cards would dissolve for */
#collWorth{display:none}
#scr-coll.forge #collWorth{display:flex}
#scr-coll.forge .coll-row .dk-power:not(#collWorth),#scr-coll.forge #collBest,#scr-coll.forge .coll-sides{display:none}
#collWorth b{display:flex;align-items:center;color:var(--shard-ink)}
/* older phones without container queries: the same sizes from the box each thing sits in (cq.js) */
.cq-poly .dk-fan{font-size:min(16px,calc(var(--cqw) / 28.5))}
.cq-poly #scr-coll .dk-fan{font-size:min(14px,calc((var(--cqw) - 24px) / 29.6))}
.cq-poly .bd-grid{font-size:min(44px,calc((var(--cqw) - 34px) / 13.4),calc((var(--cqh) - var(--res)) / 16.1))}
.cq-poly .bd-page.cq-h261 .bd-num{display:none}
.cq-poly .bd-page.cq-h261 .bd-grid{--res:27px}
.cq-poly .bd-page.cq-wide .bd-grid{grid-template-columns:repeat(4,auto);grid-template-rows:auto;font-size:min(44px,calc((var(--cqw) - 34px) / 27.6),calc((var(--cqh) - var(--res)) / 8.2))}
.cq-poly .bd-rib{--w:clamp(34px,calc(var(--cqw) * .054),54px)}
.cq-poly .bd-cover .cv-sigil{width:clamp(110px,calc(var(--cqw) * .44),240px)}
.cq-poly .bd-cover .cv-title{font:500 clamp(10px,calc(var(--cqw) * .034),15px)/1 var(--display)}
.cq-poly .bd-cover .cv-band{width:clamp(9px,calc(var(--cqw) * .03),15px)}
/* wide screens: deck boxes | mat | panel, in one row under the book (phones held sideways have their own layout, below) */
@media (min-width:700px) and (orientation:landscape) and (min-height:521px){
  .coll-side{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:end;gap:16px;width:100%;max-width:1000px;justify-self:center}
  /* picking for a match has no loadouts: the hand gets the whole row */
  .coll-side.nolo{grid-template-columns:minmax(0,1fr)}
  #scr-coll .dk-tray{flex-direction:row;align-items:stretch;gap:14px;container-type:inline-size}
  #scr-coll .dk-fan{flex:none;font-size:min(13px,calc(56cqw / 29.6))}
  .cq-poly #scr-coll .dk-fan{font-size:min(13px,calc(var(--cqw) * .56 / 29.6))}
  .coll-panel{flex:1}
}
/* short screens (a phone in its browser, under the browser's own bars): the table round the book gets tighter, so
   the book keeps its room. The deck boxes lie flat, three across. */
@media (max-height:760px) and (max-width:699px),(max-height:760px) and (orientation:portrait),(orientation:landscape) and (max-height:520px){
  #scr-coll .wrap.coll-wrap{gap:10px}
  .coll-side{gap:8px}
  .binder{padding:8px 10px 10px}
  .bd-page{padding:8px 10px 6px}
  .bd-page.l{padding-right:16px}
  .bd-page.r{padding-left:16px}
  #scr-coll .dk-lorow{grid-template-columns:repeat(3,minmax(0,124px));gap:8px}
  #scr-coll .dk-loslot{width:auto;height:56px;padding:20px 8px 6px}
  #scr-coll .dk-loslot b{display:block;max-width:100%;white-space:nowrap;text-overflow:ellipsis;padding-right:0}
  #scr-coll .dk-loslot.empty{padding:4px 6px}
  #scr-coll .dk-fan{padding:.55em .8em}
  .coll-panel{padding:7px 10px}
  .coll-row .dk-act,.coll-row .btn.primary{min-height:40px}
  #scr-coll:not(.pick) .coll-row #collClear{width:40px}
  #scr-coll.pick .coll-row #collGo{min-height:44px}
}
/* very short screens (an iPhone 6, 7 or 8 in Safari, an older Android in its browser): the book keeps a size you can
   read and the hand sits right under it; the loadouts come after, a short scroll down (Save hand brings them up) */
@media (max-height:600px) and (orientation:portrait){
  #scr-coll .wrap.coll-wrap{min-height:auto;grid-template-rows:minmax(270px,1fr) auto auto}
  .coll-side{display:contents}
  #scr-coll .coll-tray{order:1}
  #collLo{order:2}
}
/* picking for a match adds the Play button under the hand: the book gives a little back so Play stays in sight */
@media (max-height:540px) and (orientation:portrait){#scr-coll.pick .wrap.coll-wrap{grid-template-rows:minmax(250px,1fr) auto auto}}
@media (max-height:500px) and (orientation:portrait){#scr-coll .wrap.coll-wrap,#scr-coll.pick .wrap.coll-wrap{grid-template-rows:minmax(240px,1fr) auto auto}}
/* phones held sideways: the book down the left, the title, loadouts, hand and buttons in a column on the right */
@media (orientation:landscape) and (max-height:520px){
  #scr-coll.on{display:grid;grid-template-columns:minmax(0,1fr) clamp(240px,42%,360px);grid-template-rows:auto minmax(0,1fr);
    grid-template-areas:"book top" "book side";column-gap:14px;align-items:start}
  #scr-coll .wrap.coll-wrap{display:contents}
  #scr-coll .topbar.coll-top{grid-area:top;width:auto;min-width:0;margin:0 0 4px}
  .coll-book{grid-area:book;align-self:stretch;max-width:none}
  .coll-side{grid-area:side}
  /* the column has no room for the side strength bars, and the screen's edge comes in a little */
  #scr-coll .coll-sides{display:none}
  :root:not(.ios-short) #scr-coll{padding-bottom:max(12px,env(safe-area-inset-bottom))}
  .coll-panel{gap:6px}
}
