/* Case page (owner package UPSKINS_CASE_PAGES_CONTENTS_v1): top as reference 01 (closed crate on a pedestal), contents as the lower
   part of reference 02 (near-square cards, soft rarity glow, centred two-line captions, short rarity bar). Based on the package's
   case-page.reference.css, scoped to #caseView. Scene = the site's own night-city picture (home/assets/city-original.jpg);
   the package has no separate pedestal picture, so the pedestal is drawn here in CSS. */
.case-detail:not([hidden]){display:block;color:#f6ecd6;padding-bottom:48px;background:#101318}   /* one solid floor under the whole page: no city below the scene */
body.case-page main.container{display:none}
.case-detail__container{width:calc(100% - clamp(32px,8.7vw,136px));max-width:1400px;margin-inline:auto}
/* scene (package UPSKINS_CASE_SCENE_FIX_v2): the supplied city + stone pedestal picture, shown once at full width from the top;
   a fade to #101318 sits over the picture only; title, crate, back link and actions are real elements above it.
   The pedestal's contact point is 1086,496 of the 2172-wide picture, so with the picture at 100% width it is at 496/2172 of the width. */
.case-detail__hero{position:relative}
.case-detail__stage{--sw:100cqw;--st:0px;--contact:calc(var(--st) + var(--sw) * 496 / 2172);--boxh:16.2cqw;position:relative;isolation:isolate;width:100%;aspect-ratio:10/3;overflow:hidden;background:#101318;container-type:inline-size}
.case-detail__scene-art{position:absolute;top:var(--st);left:50%;transform:translateX(-50%);display:block;width:var(--sw);max-width:none;height:auto;z-index:0;pointer-events:none;user-select:none}
.case-detail__stage::after{content:'';position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(to bottom,rgba(16,19,24,0) 0%,rgba(16,19,24,0) 65%,rgba(16,19,24,.2) 78%,rgba(16,19,24,.76) 91%,#101318 100%)}
.case-detail__back{position:absolute;z-index:3;left:max(24px,5%);top:20px;display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:#f6ecd6;padding:6px 0}
.case-detail__back:hover{color:#ff963f}
.case-detail__heading{position:absolute;z-index:3;left:50%;top:14px;transform:translateX(-50%);text-align:center;width:max-content;max-width:80%}
.case-detail__collection{margin:0 0 4px;color:#ff8a2b;font-size:14px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}
.case-detail__title-row{display:flex;align-items:center;justify-content:center;gap:14px}
.case-detail__title{margin:0;font-family:var(--font);font-size:clamp(28px,3.1vw,46px);line-height:1.1;font-weight:800;color:#f6ecd6;text-transform:uppercase;letter-spacing:.02em}
.case-detail__fav{background:none;font-size:28px;line-height:1;color:#f6ecd6;padding:4px}
.case-detail__fav[aria-pressed=true]{color:#ff8a2b}
.case-detail__missing-text{margin:8px 0 0;color:#b5aea6}
/* the crate: a box whose bottom edge is the contact point; inside it the picture is scaled so that its OPAQUE part
   (bounds --x0..--x1, --y0..--y1 from home/case-art-bounds.js) fits the box and its opaque bottom touches the stone */
.case-detail__case-box{--bw:calc(var(--x1) - var(--x0));--bh:calc(var(--y1) - var(--y0));position:absolute;z-index:2;left:50%;width:42cqw;height:var(--boxh);
  top:calc(var(--contact) - var(--boxh));transform:translateX(-50%);container-type:size;pointer-events:none}
.case-detail__case-art{--s:min(calc(100cqw / var(--bw)),calc(100cqh / var(--bh)));position:absolute;z-index:1;width:var(--s);height:var(--s);max-width:none;
  left:calc(50cqw - (var(--x0) + var(--x1)) / 2 * var(--s));top:calc(100cqh - var(--y1) * var(--s));filter:drop-shadow(0 8px 6px rgba(0,0,0,.4))}
.case-detail__contact{position:absolute;z-index:0;left:50%;bottom:-7px;width:calc(var(--bw) * min(calc(100cqw / var(--bw)),calc(100cqh / var(--bh))) * .86);height:16px;
  transform:translateX(-50%);border-radius:50%;background:radial-gradient(closest-side,rgba(0,0,0,.6),rgba(0,0,0,0))}
.case-detail__actions{position:absolute;z-index:3;left:50%;bottom:14px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px;padding:0 16px}
.case-detail__qty{display:flex;border:1px solid #ffffff2b;border-radius:8px;background:#14161bcc;padding:3px;gap:2px}
.case-detail__qty button{min-width:44px;height:38px;border-radius:6px;background:transparent;color:#f6ecd6;font-weight:700;font-size:15px;border:1px solid transparent}
.case-detail__qty button[aria-pressed=true]{border-color:#ff7200;background:#ff72001f;color:#ff963f}
.case-detail__open{min-width:216px;height:44px;padding:0 24px;border-radius:7px;background:linear-gradient(110deg,#ff8522,#ff7200);color:#1b120b;font-weight:800;font-size:17px;letter-spacing:.02em}
.case-detail__open:disabled{background:#3b2b20;color:#bfb2a3;opacity:1}
.case-detail__demo{min-width:92px;height:44px;border-radius:7px;background:#14161bcc;border:1px solid #ffffff40;color:#f6ecd6;font-weight:700;font-size:15px}
.case-detail__sep{width:1px;height:30px;background:#ffffff26}
.case-detail__fast{display:inline-flex;align-items:center;gap:10px;font-size:14px;font-weight:600;cursor:pointer}
.case-detail__fast input{position:absolute;opacity:0;width:1px;height:1px}
.case-detail__fast i{width:40px;height:22px;border-radius:11px;background:#2a2c33;border:1px solid #ffffff2e;position:relative;transition:background .2s}
.case-detail__fast i::after{content:'';position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#9a97a0;transition:transform .2s,background .2s}
.case-detail__fast input:checked+i{background:#ff72005c;border-color:#ff7200}
.case-detail__fast input:checked+i::after{transform:translateX(18px);background:#ff8a2b}
.case-detail__fast input:focus-visible+i{outline:2px solid #ff963f;outline-offset:3px}
.case-detail__contents{position:relative;background:#101318;padding-top:6px}
.case-detail__contents-heading{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;margin:14px 0 14px}
.case-detail__contents-heading h2{grid-column:2;margin:0;font-family:var(--font);font-size:clamp(20px,1.8vw,27px);font-weight:800;text-align:center;letter-spacing:.03em}
.case-detail__odds{grid-column:3;justify-self:end;background:none;color:#f6ecd6;font-size:14px;font-weight:600;text-decoration:underline dotted;text-underline-offset:4px;padding:6px 0}
.case-detail__odds:hover{color:#ff963f}
.case-detail__grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.case-detail__empty,.case-detail__missing p{color:#b5aea6;text-align:center;margin:24px 0}
.case-detail__missing{display:grid;place-items:center;gap:6px;padding:80px 0}
/* contents card */
.case-item{--rarity-rgb:138 145 155;position:relative;min-width:0;aspect-ratio:1.07;display:grid;grid-template-rows:minmax(0,1fr) auto auto 3px;gap:2px;padding:12px 8px 10px;overflow:hidden;
  border:1px solid rgb(220 224 233/.22);border-radius:12px;text-align:center;
  background:radial-gradient(ellipse 62% 52% at 50% 38%,rgb(var(--rarity-rgb)/.32),transparent 72%),linear-gradient(150deg,#202126,#1b1e23);box-shadow:inset 0 0 0 1px rgb(255 255 255/.025)}
.case-item__image-area{display:grid;place-items:center;min-height:0}
.case-item__image,.case-item__image-area svg{display:block;width:96%;height:100%;min-height:0;object-fit:contain;stroke:none;fill:none}
.case-item__noimg{font-size:12px;color:#8e8a92}
.case-item__model{margin:0;font-size:14px;line-height:1.25;color:#f2f1ed;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.case-item__skin{margin:0 0 7px;font-size:17px;line-height:1.15;font-weight:700;color:#fff9eb;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.case-item__rarity{display:block;justify-self:center;width:40px;height:3px;border-radius:999px;background:rgb(var(--rarity-rgb));box-shadow:0 0 7px rgb(var(--rarity-rgb)/.35)}
/* odds window */
.case-odds{max-height:min(60vh,520px);overflow:auto;margin-top:8px}
.case-odds table{width:100%;border-collapse:collapse;font-size:13px}
.case-odds th,.case-odds td{padding:6px 8px;border-bottom:1px solid #ffffff14;text-align:right;white-space:nowrap}
.case-odds th:first-child,.case-odds td:first-child{text-align:left;white-space:normal}
.case-odds td i{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:8px}
@media(max-width:1199px){.case-detail__grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:820px){.case-detail__grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){
  .case-detail__grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .case-detail__contents-heading{display:flex;flex-direction:column;gap:4px}
  .case-detail__actions{gap:10px}
  .case-detail__qty button{min-width:40px;height:44px}
  .case-detail__open{min-width:0;flex:1 1 100%;order:-1}
  .case-detail__sep{display:none}
  .case-item{aspect-ratio:.92;padding:10px 6px}
  .case-item__model{font-size:12px}
  .case-item__skin{font-size:14px;-webkit-line-clamp:2}
  .case-detail button{min-height:44px}
}
@media(max-width:700px){
  .case-detail__stage{--sw:960px;--st:48px;--boxh:150px;aspect-ratio:auto;height:340px}
  .case-detail__stage::after{background:linear-gradient(#101318 48px,rgba(16,19,24,0) 120px),linear-gradient(to bottom,rgba(16,19,24,0) 0%,rgba(16,19,24,0) 65%,rgba(16,19,24,.2) 78%,rgba(16,19,24,.76) 91%,#101318 100%)}
  .case-detail__case-box{width:min(78%,330px)}
  .case-detail__back{left:12px;top:12px;font-size:13px}
  .case-detail__heading{top:40px;max-width:calc(100% - 24px);width:100%}
  .case-detail__actions{position:relative;left:auto;bottom:auto;transform:none;width:auto;max-width:none;margin:4px 12px 0;padding:0}
}
/* ---------- opening ribbon on the case page (package UPSKINS_CASE_CURTAIN_OPENING_v1, 2026-11-24) ----------
   Base: home/curtain/curtain-layer.css (package). Here: its place in this scene. The shell has its final size from the first frame,
   is absolute inside the stage (the page does not grow) and stands over the crate's lower part; the crate's top stays visible above it.
   Reference 1448 wide: frame 216,298 1018x184 -> 70.3% of the width, 12.7% high, its bottom ~0.9% of the width above the stone's contact point. */
.case-detail .case-curtain{--curtain-width:70.3cqw;position:absolute;z-index:3;left:50%;top:calc(var(--contact) - 13.6cqw);height:12.7cqw;margin:0;transform:translateX(-50%)}
.case-detail .case-curtain__window{container-type:size}
.case-curtain--plain .case-curtain__window{border:1px solid #ffffff2e;border-radius:6px;box-shadow:0 0 0 1px #00000080,0 10px 28px #0009}
/* ribbon cards: the case page's own card (.case-item), compact: picture on top, captions left, rarity line along the bottom */
.case-curtain .case-item{flex:0 0 calc(100cqh * 1.2);height:100%;aspect-ratio:auto;padding:6px 8px 0;gap:0;border-radius:6px;text-align:left;grid-template-rows:minmax(0,1fr) auto auto 3px}
.case-curtain .case-item__model{font-size:clamp(10px,10cqh,13px);color:#d9dbe0}
.case-curtain .case-item__skin{font-size:clamp(10px,10cqh,13px);font-weight:600;margin:0 0 4px;-webkit-line-clamp:1}
.case-curtain .case-item__rarity{justify-self:stretch;width:auto;margin:0 -8px;height:3px;border-radius:0}
.case-curtain .case-item.is-won{border-color:#ff8308;box-shadow:inset 0 0 0 1px #ff8308,0 0 18px #ff830866}
.case-curtain__result{position:absolute;z-index:3;left:50%;top:calc(var(--contact) - 0.4cqw);transform:translateX(-50%);margin:0;width:max-content;max-width:calc(100% - 24px);
  font-size:14px;font-weight:700;color:#f6ecd6;text-align:center;text-shadow:0 1px 3px #000}
.case-curtain__result:empty{display:none}
@media(max-width:700px){
  .case-detail .case-curtain{--curtain-width:calc(100% - 16px);top:calc(var(--contact) - 146px);height:150px}
  .case-curtain__result{top:calc(var(--contact) + 6px);font-size:13px}
}
/* ---------- 2–5 crates (package UPSKINS_CASE_CURTAIN_OPENING_v3, 2026-11-24): N vertical windows, base home/curtain/multi-reel.css.
   The crate (.case-detail__case-box, z 2) is a separate layer UNDER the windows (z 3) and is never hidden: the reveal mask belongs to
   the windows' group only. Sizes are the package's 1280 px geometry in container units of the stage (146–180 px wide, 18–30 px gap),
   the group is centred under the title; its bottom stays above the result line and the buttons. */
.case-detail .case-multi{position:absolute;z-index:3;left:0;right:0;top:7.4cqw;height:calc(14cqw + 24px);width:auto;pointer-events:none}
.case-detail__stage[data-count="1"] .case-multi{display:none}
.case-detail .ups-opening-group{--lane-h:14cqw;--card-h:calc((var(--lane-h) - 32px) * .58)}
.case-detail .ups-opening-group:not([data-count="1"]) .ups-reel__window{inset:16px 13px}
.case-detail .ups-opening-group[data-count="2"]{--lane-w:14.06cqw;--lane-gap:2.34cqw}
.case-detail .ups-opening-group[data-count="3"]{--lane-w:12.97cqw;--lane-gap:2.03cqw}
.case-detail .ups-opening-group[data-count="4"]{--lane-w:12.03cqw;--lane-gap:1.72cqw}
.case-detail .ups-opening-group[data-count="5"]{--lane-w:11.41cqw;--lane-gap:1.41cqw}
.case-detail .ups-reel__card{flex:0 0 var(--card-h);height:var(--card-h)}
.case-detail .ups-reel__focus{height:var(--card-h)}
.case-multi--plain .ups-reel__window{border:1px solid #ffffff2e;box-shadow:0 0 0 1px #00000080,0 10px 28px #0009}
/* window cards: the case page's own card (.case-item), compact like the single ribbon */
.case-multi .case-item{aspect-ratio:auto;padding:5px 6px 0;gap:0;border-radius:6px;grid-template-rows:minmax(0,1fr) auto auto 3px}
.case-multi .case-item__model{font-size:11px;line-height:1.2;color:#d9dbe0}
.case-multi .case-item__skin{font-size:11px;line-height:1.2;font-weight:600;margin:0 0 3px;-webkit-line-clamp:1}
.case-multi .case-item__rarity{justify-self:stretch;width:auto;margin:0 -6px;height:3px;border-radius:0}
.case-multi .case-item.is-winner{border-color:#ff8308;box-shadow:inset 0 0 0 1px #ff8308,0 0 14px #ff830855}
.case-detail__stage:not([data-count="1"]) .case-curtain{display:none}
@media(max-width:700px){
  .case-detail__stage[data-count="2"]{height:376px}
  .case-detail__stage[data-count="3"],.case-detail__stage[data-count="4"]{height:496px}
  .case-detail__stage[data-count="5"]{height:666px}
  .case-detail .case-multi{top:122px;height:auto;bottom:34px}
  .case-detail .ups-opening-group:not([data-count="1"]){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:30px 12px;top:12px;transform:translateX(-50%);
    width:min(350px,calc(100% - 24px));--lane-w:100%;--lane-h:142px;--card-h:66px}
  .case-detail .ups-reel{width:100%}
  .case-detail .ups-opening-group[data-count="3"] .ups-reel:last-child,.case-detail .ups-opening-group[data-count="5"] .ups-reel:last-child{grid-column:1/-1;width:calc((100% - 12px)/2);justify-self:center}
  .case-detail .ups-reel__window{inset:14px 12px}
  .case-detail__stage:not([data-count="1"]) .case-curtain__result{top:auto;bottom:6px}
}
/* темы открытия (24.11, пакет OPENING_THEMES_10): окна 2–5 под тематическую рамку nine-slice — окно чуть уже, чтобы кромка рамки
   (угол 40 px) обнимала его внутри холста; одиночная лента — прежняя геометрия */
.case-detail .case-multi--atlas .ups-opening-group:not([data-count="1"]) .ups-reel__window{inset:18px 17px}
@media(max-width:700px){.case-detail .case-multi--atlas .ups-reel__window{inset:15px 14px}}
