/* F1: one dense, art-first card tile shared by the collection, wishlist, Explore set grid and
   family/printings grids. Loaded last; the #app prefix beats every earlier per-page tile rule. */

/* ---- grid: >=4 columns at 820, >=6 at 1366, 3 at 390 ---- */
#app #cards .grid,#app .wishlist-grid,#app .xp-grid,#app .printing-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(158px,1fr));gap:12px;align-items:start}
#app .xp-grid{margin-top:4px}
@media(max-width:649px){
 #app #cards .grid,#app .wishlist-grid,#app .xp-grid,#app .printing-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
}

/* ---- tile: image edge to edge at 5:7, no inner frames ---- */
#app .cb-tile{position:relative;display:flex;flex-direction:column;min-width:0;height:auto;padding:0;margin:0;overflow:hidden;border:1px solid #43d7f43a;border-radius:12px;background:#071a2c;box-shadow:none;transform:none;color:var(--cb-ice-50,#e4f2fa);text-decoration:none;transition:transform .15s,border-color .15s,box-shadow .15s;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
#app .cb-tile:hover{transform:translateY(-2px);border-color:#43d7f4cc;box-shadow:0 0 16px #27e1d155}
#app .cb-tile.owned,#app .cb-tile.owned:hover{border-color:#27e1d1;box-shadow:0 0 14px #27e1d144}
#app .cb-tile.favorite-frame{border-color:#f2be4699;box-shadow:none}
#app .cb-tile.favorite-frame:after{display:none}
#app .cb-tile .cb-art{display:block;position:relative;flex:none;width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:5/7;margin:0;padding:0;border:0;border-radius:0;background:#031020;overflow:hidden;-webkit-user-drag:none}
#app .cb-tile .cb-art picture{display:block;width:100%;height:100%}
#app .cb-tile .cb-art img{display:block;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;object-fit:cover;border-radius:0;border:0;box-shadow:none;filter:none;background:#031020;-webkit-user-drag:none;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
#app .cb-tile .cb-art .no-image,#app .cb-tile .cb-art .wish-placeholder,#app .cb-tile .cb-art .xp-noart,#app .cb-tile .cb-art .printing-fallback{display:grid;place-items:center;width:100%;height:100%;font-size:12px;text-align:center;color:#8fb4c6;padding:6px}

/* ---- compact caption ---- */
#app .cb-tile .cb-cap{display:flex;flex-direction:column;gap:2px;min-width:0;padding:5px 7px 7px;margin:0;background:none;border:0}
#app .cb-tile .cb-cap h2,#app .cb-tile .cb-cap h3,#app .cb-tile .cb-cap>strong{margin:0;padding:0;font:600 12.5px/1.3 var(--font-ui,system-ui);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--cb-ice-50,#eaf8ff);letter-spacing:0;display:block}
#app .cb-tile .cb-cap h3 a{color:inherit;text-decoration:none}
#app .cb-tile .cb-cap strong span{color:#7fe0d2;font-weight:600}
#app .cb-tile .cb-cap>small,#app .cb-tile .cb-cap>p{display:block;margin:0;padding:0;min-height:0;font-size:10.5px;line-height:1.3;color:#98b6c8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#app .cb-tile .cb-cap>p.tiny{display:none}
#app .cb-tile .cb-cap .tile-value,#app .cb-tile .cb-cap .xp-value{display:flex;align-items:baseline;justify-content:flex-start;gap:6px;align-self:flex-start;max-width:100%;min-height:0;margin:2px 0 0;padding:2px 8px;border-radius:999px;background:#0a2d3dcc;border:1px solid #27e1d155;color:#c9fff7;font:700 11.5px/1.4 var(--font-ui,system-ui);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#app .cb-tile .cb-cap .tile-value strong{font-size:11.5px;line-height:1.4;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#app .cb-tile .cb-cap .tile-value span:empty{display:none}
#app .cb-tile .cb-cap .tile-value span{font-size:9.5px;opacity:.8;white-space:nowrap}
#app .cb-tile .cb-cap .tile-value.unknown,#app .cb-tile .cb-cap .xp-value.unknown{color:#a9c4d6;border-style:dashed;font-weight:600}
#app .cb-tile .cb-cap .tile-value small{display:none}

/* ---- overlay chips on the art ---- */
#app .cb-tile>.badge.cb-chip,#app .cb-tile>.printing-status-rail.cb-chip{position:absolute;top:5px;left:5px;right:auto;z-index:2;display:inline-flex;align-items:center;max-width:calc(100% - 38px);margin:0;padding:2px 7px;border:0;border-radius:999px;background:#031020d9;color:#ffd7e4;font:700 10.5px/1.4 var(--font-ui,system-ui);letter-spacing:.01em;text-transform:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
#app .cb-tile>.printing-status-rail.cb-chip{color:#8ff5e6}
#app .cb-tile>.printing-status-rail.cb-chip:empty{display:none}
#app .cb-tile>.collection-favorite-rail{position:absolute;top:5px;right:5px;z-index:2;display:grid;place-items:center;width:22px;height:22px;margin:0;padding:0;border:0;border-radius:50%;background:#f2be46;font-size:0;letter-spacing:0;overflow:hidden}
#app .cb-tile>.collection-favorite-rail:before{content:"\2605";font-size:13px;line-height:1;color:#3a2a00}
#app .xp-card.owned:before,#app .xp-mini.owned:before{top:5px;right:5px;padding:3px 7px;font-size:9px}

/* ---- wishlist priority row (below the art) and per-tile controls ---- */
#app .wish-card .wishlist-priority-rail{order:3;display:flex;align-items:center;justify-content:space-between;gap:4px;margin:0;padding:0 7px 6px;border:0;background:none;min-height:0}
#app .wish-card .wishlist-priority-rail strong{font-size:10.5px;font-weight:700;color:#8fd8e8}
#app .wish-card .wishlist-moves,#app .tile .rank>div{display:flex;align-items:center;gap:4px;margin-left:auto}
#app .cb-tile .cb-cap button,#app .wish-card .wishlist-moves button,#app .tile .rank button{min-height:30px;min-width:30px;padding:2px 8px;font-size:11px;line-height:1.2;border-radius:8px}
#app .tile .rank{display:flex;align-items:center;justify-content:flex-end;gap:4px;margin:2px 0 0;padding:0;border:0;background:none}
#app .tile .rank>small{display:none}
#app .cb-tile .cb-cap .wishlist-state{display:block;margin:0;padding:0;border:0;background:none;font-size:10px;line-height:1.3;color:#7fe0d2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#app .cb-tile .cb-cap .wishlist-state:empty{display:none}
#app .cb-tile .cb-cap .wishlist-card-actions,#app .family-page .printing-meta>div,#app .printings-page .printing-meta>div{display:flex;flex-wrap:wrap;gap:4px;margin:3px 0 0}
#app .cb-tile .cb-cap .wishlist-card-actions>*,#app .cb-tile .printing-meta>div>*{flex:1 1 auto;min-height:30px;margin:0;padding:2px 8px;font-size:11px;border-radius:999px}
#app .cb-tile .cb-cap details{margin:0;padding:0;border:0;background:none;font-size:10px}
#app .cb-tile .cb-cap details>summary{padding:1px 0;min-height:0;font-size:10px;color:#8fb4c6;cursor:pointer}
#app .cb-tile .cb-cap details[open]{font-size:11px}

/* ---- drag affordances (shared) ---- */
#app .dr-item,#app .dr-item *{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}
#app .dr-item:not(.dr-lifted){touch-action:pan-y pinch-zoom}
#app .cb-tile.dr-lifted{transform:scale(1.06) rotate(-.6deg);border-color:#27e1d1;box-shadow:0 0 24px #27e1d188,0 22px 44px #000c;touch-action:none}
.dr-placeholder{border-radius:12px}
.dr-hint{position:fixed;z-index:2000;max-width:min(300px,90vw);transform:translateX(-50%);padding:8px 14px;border-radius:999px;background:#031020f2;border:1px solid #43d7f4aa;color:#e8fbff;font:600 13px/1.3 var(--font-ui,system-ui);box-shadow:0 8px 28px #000a;pointer-events:none;opacity:0;transition:opacity .15s}
.dr-hint.show{opacity:1}

/* ---- collection page: compact hero, strips and toolbar so cards start in the first iPad screen ---- */
#app .hero.collector-hero{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;min-height:0;padding:8px 14px;margin:0 0 8px;border-radius:14px}
#app .hero.collector-hero:before{display:none}
#app .collector-hero>div{display:contents}
#app .collector-hero .eyebrow,#app .collector-hero .collector-intro,#app .collector-hero .collector-fan{display:none}
#app .collector-hero h1{margin:0;max-width:none;font-size:clamp(20px,2.4vw,28px);line-height:1.1;letter-spacing:-.01em;flex:0 1 auto;min-width:0}
#app .collector-hero .flex,#app .collector-hero>.flex,#app .collector-hero .collector-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;grid-column:auto;order:0}
#app .collector-hero>.flex:last-of-type{margin-left:auto}
#app .collector-hero button,#app .collector-hero .button{min-height:34px;padding:3px 11px;font-size:13px;border-radius:999px;margin:0}
#app .collector-hero .badge{font-size:11px;padding:3px 8px}
#app.page-collection>.stats{margin:0 0 8px;gap:6px;flex-wrap:wrap}
#app.page-collection>.stats .stat{padding:3px 10px;border-radius:999px;min-height:0}
#app .collector-value-strip{padding:8px 14px;gap:14px;margin:0 0 8px;border-radius:12px}
#app .collector-value-strip>div>strong{font-size:22px;line-height:1.1}
#app .collector-value-strip .eyebrow{font-size:10px}
#app .collector-value-strip small{font-size:11px}
#app .collector-value-strip .coverage-track{margin-top:2px}
#app .collector-value-strip .button{min-height:34px;padding:3px 12px;font-size:13px}
#app .collector-destinations{gap:8px;margin:0 0 8px}
#app .collector-destinations a{padding:6px 12px;gap:10px;border-radius:12px;min-height:0}
#app .collector-destinations a small{display:none}
#app .collector-destinations a strong{font-size:13px}
#app .collector-destinations .destination-icon{font-size:15px;width:auto;height:auto}
#app.page-collection .toolbar{padding:6px 8px;gap:6px;margin:0 0 10px;border-radius:12px}
#app.page-collection .toolbar button,#app.page-collection .toolbar select,#app.page-collection .toolbar input{min-height:36px;padding-top:4px;padding-bottom:4px;font-size:13px}
#app .collection-recovery{padding:8px 12px;margin:0 0 8px}
#app .collection-stage,#app .collection-main{min-width:0}
@media(max-width:649px){
 #app .hero.collector-hero{padding:6px 10px}
 #app .collector-hero h1{font-size:20px}
 #app .collector-value-strip{flex-wrap:wrap;gap:8px}
 #app .collector-destinations{grid-template-columns:repeat(3,minmax(0,1fr))}
 #app .collector-destinations a{padding:6px 8px;gap:6px}
 #app .collector-destinations a strong{font-size:11px}
 #app .cb-tile .cb-cap h2,#app .cb-tile .cb-cap h3,#app .cb-tile .cb-cap>strong{font-size:11.5px}
 #app .cb-tile .cb-cap .tile-value,#app .cb-tile .cb-cap .xp-value{font-size:10.5px;padding:1px 6px}
 #app .cb-tile .cb-cap .tile-value strong{font-size:10.5px}
 #app .cb-tile .cb-cap{padding:4px 5px 6px}
}

/* ---- the floating nav must never cover the last row ---- */
main,#app{scroll-padding-bottom:calc(var(--cb-bottom-nav,72px) + 24px)}
@media(max-width:1099px){main{padding-bottom:calc(var(--cb-bottom-nav,72px) + 40px)}#nav{background:#041426f7}}
@media(prefers-reduced-motion:reduce){#app .cb-tile,.dr-hint{transition:none}#app .cb-tile:hover{transform:none}}

/* ---- compact page heroes above the grids ---- */
#app .wishlist-hero{margin:4px 0 10px;gap:10px}
#app .wishlist-hero .eyebrow,#app .wishlist-hero p{display:none}
#app .wishlist-hero h1{margin:0;font-size:clamp(24px,3vw,34px)}
#app .wishlist-tools{padding:8px 12px;margin-bottom:8px;gap:10px}
#app .xp-hero{padding:12px 18px;gap:6px;margin:0}
#app .xp-hero h1{font-size:clamp(26px,3.4vw,38px);margin:0}
#app .xp-setview{gap:12px}
/* ---- phones: keep the grid near the top ---- */
@media(max-width:649px){
 #app .collector-hero .flex,#app .collector-hero>.flex,#app .collector-hero .collector-actions{gap:4px}
 #app .collector-hero button,#app .collector-hero .button{min-height:32px;padding:2px 9px;font-size:12px}
 #app .collector-hero>.flex:last-of-type{margin-left:0}
 #app .collector-hero .badge{display:none}
 #app.page-collection>.stats{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
 #app.page-collection>.stats .stat{flex:0 0 auto;white-space:nowrap}
 #app .collector-value-strip{display:grid;grid-template-columns:1fr auto;padding:6px 10px}
 #app .collector-value-strip>div>strong{font-size:18px}
 #app .collector-value-strip small,#app .collector-value-strip .collector-coverage{display:none}
 #app .collector-value-strip .button{min-height:32px;font-size:12px;padding:2px 10px}
 #app .collector-destinations{display:none}
 #app.page-collection .toolbar{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
 #app.page-collection .toolbar>*{flex:0 0 auto;width:auto;min-width:0}
 #app.page-collection .toolbar select{max-width:150px}
 #app.page-collection .toolbar input{width:150px;flex-basis:150px}
}
@media(max-width:649px){#app .cb-tile .cb-cap .tile-value strong,#app .cb-tile .cb-cap .tile-value{font-size:10px}#app .cb-tile .cb-cap .tile-value{padding:1px 5px}}
