/* One card size and one horizontal rail, before and after every reveal. */
.pr-group{--pr-card-width:clamp(110px,calc(68.49dvh - 274px),185px);--pr-card-height:calc(var(--pr-card-width)*1.46)}
.pr-group .pr-grid{display:flex;flex-wrap:nowrap;align-items:stretch;gap:14px;width:100%;max-width:none;margin:0;padding:8px 5px 13px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:#a58a57 #ffffff08}
.pr-grid:focus-visible{outline:1px solid #cfb87566;outline-offset:2px;border-radius:8px}
.pr-group .pr-slot{flex:0 0 calc(var(--pr-card-width) + 24px);width:calc(var(--pr-card-width) + 24px);min-height:calc(var(--pr-card-height) + 36px);scroll-snap-align:center}
.pr-group .pr-slot:first-child{margin-left:auto}.pr-group .pr-slot:last-child{margin-right:auto}
.pr-group .pr-content{height:100%}.pr-group .reveal-card{height:100%}
.pr-group .pr-content :is(.card-tile,.run-pack-card),.pr-group .pr-content>article,.pr-group .pr-content>button{box-sizing:border-box;display:flex;flex-direction:column;align-items:stretch;gap:6px;width:100%;height:100%;padding:10px!important;border-width:2px!important;border-top-width:2px!important;min-height:0;overflow:hidden}
.pr-group .pr-cover{padding:12px!important;gap:13px}
.pr-group .pr-cover{touch-action:pan-x}
.pr-group .pr-back{width:var(--pr-card-width);max-width:none;height:var(--pr-card-height);aspect-ratio:auto;flex-shrink:0}
.pr-group .pr-sealed{width:var(--pr-card-width);max-width:none}
.pr-group .pr-content :is(.card-face,.draft-face,.run-pack-face,.treasury-art,.preview-card>button:first-child){width:var(--pr-card-width);max-width:none;height:var(--pr-card-height);aspect-ratio:auto;align-self:center;flex-shrink:0;margin:0;padding:0;border:0;display:block;transform:none}
.pr-group .pr-content :is(.card-face,.draft-face,.run-pack-face,.treasury-art,.preview-card>button:first-child)>img,.pr-group .pr-content>button>img{display:block;width:var(--pr-card-width);min-width:var(--pr-card-width);max-width:none;height:var(--pr-card-height);max-height:none;aspect-ratio:auto;object-fit:fill;margin:0 auto;flex-shrink:0}
.pr-group .run-pack-face .full-face{display:block;width:var(--pr-card-width);height:var(--pr-card-height);max-width:none;aspect-ratio:auto;margin:0;position:relative;transform:none}
.pr-group .run-pack-face .full-face>img{width:100%;height:100%;object-fit:fill}
.pr-group .run-pack-face>span{display:none}
.pr-group .pr-content :is(.card-face,.treasury-art):hover{transform:none}
.pr-group .pr-content :is(h3,.draft-card-name){font:600 12px/1.35 Arial,sans-serif!important;min-height:32px;max-height:32px;overflow:hidden;margin:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;text-align:left}
.pr-group .pr-content :is(.rarity,.treasury-rarity,.market-rarity,.preview-rarity){font-size:10px!important;line-height:1.4;min-height:18px;margin:0;padding:2px 4px;letter-spacing:0;white-space:nowrap}
.pr-group .pr-content .treasury-rarity b{font-size:10px;padding:0 3px}
.pr-group .pr-content .statline{font-size:11px;line-height:1.5}.pr-group .pr-content .pull-status{font-size:10px;line-height:1.4;margin:0}
.pr-group .pr-content .subtle{font-size:11px;line-height:1.3;padding:4px 0;min-height:23px;margin-top:auto}
.pr-group .pr-content .treasury-draft-pick{padding:7px 8px;min-height:32px;font-size:11px;margin-top:auto}

/* Keep the three probability figures; remove the repeated context line. */
.pull-odds.is-compact{container-type:normal;padding:5px 6px;margin:0;min-height:65px}
.pull-odds.is-compact .pull-odds-equation{display:grid;grid-template-columns:1fr;gap:2px}
.pull-odds.is-compact .pull-odds-term{display:grid;grid-template-columns:47px minmax(0,1fr);gap:3px;text-align:left}
.pull-odds.is-compact .pull-odds-term-label{display:flex;gap:3px;margin:0;font-size:10px!important}
.pull-odds.is-compact .pull-odds-symbol{position:static;top:auto;left:auto;font-size:10px!important;width:7px}
.pull-odds.is-compact .pull-odds-values{display:flex;flex-direction:row;justify-content:flex-end;gap:0}
.pull-odds.is-compact .pull-odds-values>strong{font-size:11px!important;line-height:1.35!important}
.pull-odds.is-compact .pull-odds-combined{display:flex;grid-column:auto;justify-content:center;gap:5px;margin:3px 0 0;padding:3px 4px;box-shadow:none;border-radius:4px;min-height:23px}
.pull-odds.is-compact .pull-odds-combined>.pull-odds-symbol{font-size:11px!important;margin:0;align-self:center}
.pull-odds.is-compact .pull-odds-combined .pull-odds-values>strong{font-size:12px!important;line-height:1.2!important}

/* A compact round header and fixed footer leave the vertical space to cards. */
:is(dialog,.modal):has(.pack-draft),:is(dialog,.modal):has(.pack-opening-actions){width:min(1200px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:14px 22px;overflow:hidden;scrollbar-gutter:auto}
.pack-draft{position:relative;min-width:0}
.pack-draft>header.draft-heading{display:flex;position:static;height:auto;align-items:center;justify-content:space-between;gap:18px;padding:0 48px 0 0;margin:0 0 10px;min-height:44px;border:0;background:none}
.pack-draft .draft-heading .eyebrow{display:block;font-size:9px;line-height:1.3;margin:0 0 4px;letter-spacing:.12em;text-transform:uppercase;color:#c4ac76}
.pack-draft .draft-heading h2{font-size:24px;line-height:1.15;margin:0;font-weight:500}
.draft-pick-goal{flex-shrink:0;display:flex;flex-direction:column;text-align:right;gap:3px}
.draft-pick-goal>strong{font-size:16px;color:#ead391;font-weight:650}.draft-pick-goal>small{font-size:11px;color:#b9acc8}
.pack-draft .draft-rounds{display:flex;gap:8px;margin:0 0 9px;padding:0;list-style:none;max-width:none}
.pack-draft .draft-rounds li{display:flex;align-items:center;gap:7px;padding:5px 9px;border-radius:6px;flex:1;min-width:0;font-size:10px}
.pack-draft .draft-rounds li>span{width:21px;height:21px;font-size:10px;margin:0;flex-shrink:0}
.pack-draft .draft-rounds li>div{display:flex;align-items:center;justify-content:space-between;gap:7px;flex:1;min-width:0}
.pack-draft .draft-rounds strong{font-size:10px;line-height:1.3;white-space:nowrap}.pack-draft .draft-rounds small{font-size:9px;line-height:1.3;margin:0;white-space:nowrap}
.pack-draft .pr-toolbar{font-size:11px;margin:0 0 3px;gap:10px;min-height:28px}.pack-draft .pr-instruction small{display:none}
.pack-draft .pr-tools{flex-wrap:nowrap;gap:12px}.pack-draft .pr-text-button{white-space:nowrap}
.pack-draft .draft-footer{position:relative;bottom:auto;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 0 0;margin:0;border-top:1px solid #ffffff18;background:none;min-height:54px}
.treasury-draft-dialog .draft-footer{padding-top:6px;min-height:44px}
.draft-selection-status{min-width:0;flex:1}.draft-selection-status>strong{font-size:13px;line-height:1.4}.draft-selection-status>small{font-size:11px;line-height:1.4;color:#b3a4c0;display:block;margin:3px 0 0;max-width:none}
.pack-draft .draft-footer .buy{min-width:150px;font-size:12px;min-height:40px;padding:10px 15px;flex-shrink:0}
.pack-draft .draft-kept{position:relative;flex:none;font-size:11px;border:0;padding:0}.pack-draft .draft-kept summary{font-size:11px;white-space:nowrap;padding:7px 0;color:#d2bd89}
.pack-draft .draft-kept>ul{position:absolute;right:0;bottom:100%;width:240px;max-width:70vw;list-style:none;margin:0 0 7px;padding:12px;border:1px solid #ffffff25;border-radius:9px;background:#21192c;box-shadow:0 8px 28px #0008;z-index:10;display:grid;gap:8px;line-height:1.4}
.draft-close{position:absolute;right:0;top:0}.draft-close>button{position:static}.draft-save-note{font-size:10px;color:#aa9db8;white-space:nowrap}
.pack-opening-actions{display:flex;justify-content:center;align-items:center;gap:20px;margin-top:10px}.pack-opening-actions .reveal-done{margin:0;min-width:170px}.pack-opening-actions .subtle{font-size:11px}
:is(dialog,.modal):has(.pack-opening-actions) .reveal-heading{padding:0 45px 8px}.reveal-heading h2{margin:5px 0;font-size:26px}.reveal-heading p{font-size:12px;margin:5px 0}
:is(dialog,.modal):has(.pack-opening-actions) .pr-toolbar{margin:5px 0 8px;font-size:11px}
#detail:has(.pack-opening-actions){padding:14px 22px}
:is(dialog,.modal):has(.pack-opening-actions) .reveal-heading{display:flex;flex-direction:column;align-items:center;gap:4px}
:is(dialog,.modal):has(.pack-opening-actions) .reveal-heading .eyebrow{margin:0;font-size:9px;line-height:1.4}
:is(dialog,.modal):has(.pack-opening-actions) .reveal-heading h2{margin:0;line-height:1.15}
:is(dialog,.modal):has(.pack-opening-actions) .reveal-heading p{margin:0;line-height:1.4}
:is(dialog,.modal):has(.pack-opening-actions) .pr-instruction small{display:none}

@media(max-width:760px){
 :is(dialog,.modal):has(.pack-draft),:is(dialog,.modal):has(.pack-opening-actions){width:calc(100vw - 16px);padding:16px 14px;max-height:calc(100dvh - 16px)}
 .pack-draft>header.draft-heading{padding-right:42px;gap:10px}.pack-draft .draft-heading h2{font-size:21px}.draft-pick-goal>strong{font-size:14px}.draft-pick-goal>small{font-size:10px}
 .pack-draft .draft-rounds li>div{display:block}.pack-draft .draft-rounds small{display:none}.pack-draft .draft-rounds{gap:6px}.pack-draft .draft-rounds li{padding:5px 6px;gap:5px}
 .pack-draft .pr-toolbar{align-items:center;flex-wrap:wrap;gap:1px 8px}.pack-draft .pr-tools{margin-left:auto}.pack-draft .pr-instruction{font-size:10px}
 .pack-draft .draft-footer{gap:9px}.pack-draft .draft-footer .buy{min-width:125px;padding:10px;font-size:11px}.draft-selection-status>small{font-size:10px}.draft-save-note{display:none}.pack-draft .draft-kept summary{font-size:10px}
}
@media(max-width:480px){
 .pack-draft>header.draft-heading{align-items:flex-start}.pack-draft .draft-heading h2{font-size:18px;max-width:160px}.draft-pick-goal{padding-top:2px}.draft-pick-goal>strong{font-size:13px}.draft-pick-goal>small{max-width:100px}
 .pack-draft .pr-instruction{display:none}.pack-draft .pr-tools{justify-content:space-between;width:100%;gap:8px}.pack-draft .draft-kept{display:none}
 .pack-opening-actions{gap:14px}.pack-opening-actions .reveal-done{min-width:145px}
}
@media(max-height:600px){
 #detail:has(.pack-opening-actions){padding:10px 16px}
 :is(dialog,.modal):has(.pack-opening-actions) .reveal-heading h2{font-size:20px}
 :is(dialog,.modal):has(.pack-opening-actions) .reveal-heading p{display:none}
 :is(dialog,.modal):has(.pack-opening-actions) .pr-toolbar{margin:3px 0 6px}
 :is(dialog,.modal):has(.pack-draft),:is(dialog,.modal):has(.pack-opening-actions){padding:10px 16px;max-height:calc(100dvh - 12px)}
 .pack-draft>header.draft-heading{min-height:35px;margin-bottom:6px}.pack-draft .draft-heading h2{font-size:19px}.pack-draft .draft-heading .eyebrow{font-size:8px}
 .pack-draft .draft-rounds{margin-bottom:4px}.pack-draft .draft-rounds li{padding:3px 7px}.pack-draft .draft-rounds small{display:none}.pack-draft .pr-toolbar{min-height:22px;font-size:10px}.pr-group .pr-grid{padding-top:5px;padding-bottom:8px}
 .pack-draft .draft-footer{min-height:44px;padding-top:6px}.pack-draft .draft-footer .buy{min-height:34px;padding:7px 12px}
 .pr-group .pr-content :is(h3,.draft-card-name){font-size:11px!important;min-height:29px;max-height:29px}.pr-group .pr-content>article,.pr-group .pr-content .card-tile{gap:4px}
 .pull-odds.is-compact{padding:3px;min-height:60px}.pull-odds.is-compact .pull-odds-term{grid-template-columns:38px minmax(0,1fr)}.pull-odds.is-compact .pull-odds-values>strong{font-size:10px!important}
}

/* On short landscape screens, put the details beside the art. */
@media(max-height:540px){
 .pr-group{--pr-card-width:clamp(110px,calc(68.49dvh - 158px),185px)}
 .pr-group .pr-slot{flex-basis:calc(var(--pr-card-width) + 176px);width:calc(var(--pr-card-width) + 176px);min-height:calc(var(--pr-card-height) + 24px)}
 .pr-group .pr-content :is(.card-tile,.run-pack-card),.pr-group .pr-content>article,.pr-group .pr-content>button{display:grid;grid-template-columns:var(--pr-card-width) 142px;align-content:start;align-items:start;gap:6px 10px}
 .pr-group .pr-content :is(.card-tile,.run-pack-card)>*,.pr-group .pr-content>article>*,.pr-group .pr-content>button>*{grid-column:2}
 .pr-group .pr-content :is(.card-face,.draft-face,.run-pack-face,.treasury-art,.preview-card>button:first-child),.pr-group .pr-content>button>img{grid-column:1;grid-row:1 / span 6;align-self:start}
 .pr-group .pr-cover{display:grid;grid-template-columns:var(--pr-card-width) minmax(0,1fr);align-items:center;gap:10px}
 .pr-group .pr-sealed{width:auto}
 .pack-draft .draft-rounds{display:none}
}

/* Keep the pack action at the bottom of each card, aligned across the rail. */
.pack-card-footer{display:flex;flex-direction:column;gap:5px;min-height:74px;margin-top:auto;padding-top:8px;border-top:1px solid #ffffff1b;color:#bfb2cb;font-size:11px;line-height:1.4}
.pack-card-footer strong{font-size:11px;color:#ece4f1}
.pack-card-footer .pack-card-recycled{color:#a9dcc7}
.pack-recycle-button{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:1px 6px;min-height:44px;width:100%;padding:6px 8px;border:1px solid #d7bc775c;border-radius:7px;background:#d7bc7712;color:#f0d69a;font:600 12px/1.25 Arial,sans-serif;text-align:left;cursor:pointer}
.pack-recycle-button b{white-space:nowrap;font-variant-numeric:tabular-nums}
.pack-recycle-button:hover{border-color:#d7bc77;background:#d7bc772b}
.pack-recycle-button:focus-visible{outline:2px solid #f0d69a;outline-offset:2px}

.pack-recycle-error{margin:7px 5px;padding:9px 12px;border-radius:7px;background:#ff9c8815;color:#ffc5b9;font-size:12px;text-align:center}
.pack-opening-actions{flex-wrap:wrap}.pack-opening-actions [data-pack-recycle-all]{width:auto;min-width:170px;justify-content:center;padding-inline:12px}.pack-opening-actions [data-pack-recycle-all][hidden]{display:none}

/* Auto pick prepares selections; the gold confirmation remains separate. */
.draft-pick-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.pack-draft .draft-auto-pick{border:1px solid #cfb87580;border-radius:8px;background:#cfb87512;color:#ead391;font:inherit;font-weight:600;font-size:12px;line-height:1.3;padding:10px 14px;min-height:42px;white-space:nowrap;cursor:pointer}
.pack-draft .draft-auto-pick:hover:not(:disabled){background:#cfb87525;border-color:#ead391}
.pack-draft .draft-auto-pick:disabled{opacity:.45;cursor:not-allowed}
.pack-draft .draft-auto-pick:focus-visible{outline:2px solid #ead391;outline-offset:3px}
.pack-draft .pr-content>article.selected{border-color:#ead391!important;box-shadow:inset 0 0 0 1px #ead391;background:#cfb87512}
@media(max-width:600px){
 .pack-draft .draft-footer:has(.draft-pick-actions){flex-wrap:wrap}
 .pack-draft .draft-pick-actions{width:100%}
 .pack-draft .draft-pick-actions>button{flex:1;min-width:0}
}
