/* ==========================================================================
   crates.css — TF2Bolt crates + shared item styles (also loaded on battles)
   Prefix: cx-
   ========================================================================== */
.cx-root{
  --cx-panel:#121925;--cx-panel-2:#172030;--cx-panel-3:#1d2839;
  --cx-line:rgba(148,172,210,.11);--cx-line-2:rgba(148,172,210,.2);
  --cx-text:#e9eef5;--cx-muted:#8d99ab;--cx-dim:#627086;
  --cx-accent:#f2a14a;--cx-accent-2:#ffbd6e;--cx-ink:#261403;
  --cx-good:#5ad08a;--cx-bad:#f0695e;--cx-unusual:#a173d6;
  --cx-display:'Roboto Condensed','Arial Narrow','Segoe UI',sans-serif;
  --cx-body:'Segoe UI',Roboto,Arial,sans-serif;
  color:var(--cx-text);font-family:var(--cx-body);
  max-width:1360px;margin:0 auto;padding:22px 24px 56px;box-sizing:border-box;
}
.cx-root *,.cx-root *::before,.cx-root *::after{box-sizing:border-box}
.cx-root h1,.cx-root h2,.cx-root h3,.cx-root h4{font-family:var(--cx-display);text-transform:none;letter-spacing:0;margin:0;color:var(--cx-text)}
:where(.cx-root) p{margin:0}
.cx-root a{color:inherit}
.cx-root button{font:inherit;color:inherit}
.cx-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.cx-muted{color:var(--cx-muted)}

/* ---------- Bolts ---------- */
.cx-bolts{display:inline-flex;align-items:center;gap:.32em;font-family:var(--cx-display);font-weight:700;font-variant-numeric:tabular-nums;white-space:nowrap;line-height:1}
.cx-bolt{display:inline-block;width:1.05em;height:1.05em;flex:0 0 auto;background:url('/uploads/tokens/bolt-full.png') center/auto 123% no-repeat}

/* ---------- Buttons / chips ---------- */
.cx-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:0 18px;border-radius:9px;border:1px solid var(--cx-line-2);background:var(--cx-panel-2);color:var(--cx-text);font-weight:650;font-size:14px;text-decoration:none;cursor:pointer;white-space:nowrap;transition:background .15s,border-color .15s,transform .12s,opacity .15s}
.cx-btn:hover{background:var(--cx-panel-3);border-color:rgba(170,192,226,.3)}
.cx-btn:active{transform:translateY(1px)}
.cx-btn:disabled,.cx-btn[aria-disabled="true"]{opacity:.45;cursor:not-allowed;transform:none}
.cx-btn.primary{background:linear-gradient(180deg,var(--cx-accent-2),var(--cx-accent));border-color:transparent;color:var(--cx-ink);font-weight:750;box-shadow:0 6px 18px rgba(242,161,74,.18)}
.cx-btn.primary:hover{filter:brightness(1.06)}
.cx-btn.good{background:rgba(90,208,138,.13);border-color:rgba(90,208,138,.35);color:#9ff0bf}
.cx-btn.good:hover{background:rgba(90,208,138,.2)}
.cx-btn.ghost{background:transparent}
.cx-btn.sm{min-height:32px;padding:0 12px;font-size:12.5px;border-radius:8px}
.cx-btn.lg{min-height:50px;padding:0 24px;font-size:15.5px;border-radius:11px}
.cx-btn .cx-bolts{font-size:1.04em}
.cx-root :focus-visible{outline:2px solid var(--cx-accent-2);outline-offset:2px}

.cx-seg{display:inline-flex;padding:3px;gap:3px;border-radius:11px;background:rgba(0,0,0,.25);border:1px solid var(--cx-line)}
.cx-seg button{min-height:34px;min-width:44px;padding:0 13px;border:0;border-radius:8px;background:transparent;color:var(--cx-muted);font-weight:650;font-size:13px;cursor:pointer;transition:background .15s,color .15s}
.cx-seg button:hover{color:var(--cx-text)}
.cx-seg button[aria-pressed="true"]{background:var(--cx-panel-3);color:var(--cx-text);box-shadow:inset 0 0 0 1px var(--cx-line-2)}

/* ---------- Page tabs (Crates / Crate battles) ---------- */
.cx-top{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:22px;flex-wrap:wrap}
.cx-tabs{display:flex;gap:4px}
.cx-tabs a{position:relative;padding:8px 2px;margin-right:18px;text-decoration:none;color:var(--cx-muted);font-family:var(--cx-display);font-size:19px;font-weight:700;transition:color .15s}
.cx-tabs a:hover{color:var(--cx-text)}
.cx-tabs a[aria-current="page"]{color:var(--cx-text)}
.cx-tabs a[aria-current="page"]::after{content:'';position:absolute;left:0;right:0;bottom:0;height:3px;border-radius:3px;background:var(--cx-accent)}
.cx-top-links{display:flex;gap:8px;align-items:center}
.cx-link{color:var(--cx-muted)!important;font-size:13.5px;text-decoration:none;display:inline-flex;align-items:center;gap:6px;padding:6px 4px}
.cx-link:hover{color:var(--cx-text)!important}

/* ---------- Item artwork + cards ---------- */
.cx-art{position:relative;display:grid;place-items:center;aspect-ratio:1/1;width:100%;border-radius:9px;overflow:hidden;
  background:radial-gradient(70% 62% at 50% 55%,color-mix(in srgb,var(--q,#ffd700) 20%,transparent),transparent 72%),linear-gradient(180deg,rgba(255,255,255,.025),rgba(0,0,0,.12))}
.cx-art>img{position:relative;z-index:2;width:76%;height:76%;object-fit:contain;filter:drop-shadow(0 6px 10px rgba(0,0,0,.45));user-select:none;-webkit-user-drag:none}
.cx-art .cx-fx{position:absolute;inset:-6%;z-index:1;background-size:cover;background-position:center;background-repeat:no-repeat;opacity:.95;pointer-events:none}
.cx-art.has-fx{background:radial-gradient(70% 70% at 50% 50%,rgba(134,80,172,.35),rgba(20,12,34,.2) 70%),#120d1c}

.cx-item{--q:#ffd700;position:relative;display:flex;flex-direction:column;gap:8px;min-width:0;padding:10px 10px 0;border-radius:12px;background:linear-gradient(180deg,var(--cx-panel-2),var(--cx-panel));border:1px solid var(--cx-line);overflow:hidden}
.cx-item::after{content:'';position:absolute;left:0;right:0;bottom:0;height:3px;background:var(--q);opacity:.85}
.cx-item.is-unusual{border-color:rgba(161,115,214,.32);box-shadow:0 0 0 1px rgba(161,115,214,.08),0 10px 30px -14px rgba(134,80,172,.6)}
.cx-item>.cx-item-head{display:flex;justify-content:space-between;align-items:center;gap:6px;font-size:11.5px;line-height:1.2}
.cx-q{color:var(--q);font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cx-odds{color:var(--cx-muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.cx-item h4{font-family:var(--cx-body)!important;font-size:13.5px;font-weight:650;line-height:1.25;min-height:2.5em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.cx-effect{margin-top:-5px!important;font-size:12px;color:#c4a5ec;min-height:1.25em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cx-effect.cx-blank{visibility:hidden}
.cx-item>.cx-item-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 -10px;padding:10px 10px 12px;border-top:1px solid var(--cx-line);font-size:14px}
.cx-item-sm{padding:7px 7px 0;gap:6px;border-radius:10px}
.cx-item-sm h4{font-size:12px;min-height:2.5em}
.cx-item-sm>.cx-item-head{font-size:10.5px}
.cx-item-sm .cx-effect{font-size:11px}
.cx-item-sm>.cx-item-foot{margin:0 -7px;padding:7px 7px 9px;font-size:12.5px}

/* ---------- Toasts ---------- */
.cx-toasts{position:fixed;right:20px;bottom:20px;z-index:1200;display:flex;flex-direction:column;gap:8px;pointer-events:none}
.cx-toast{pointer-events:auto;max-width:360px;padding:12px 15px;border-radius:10px;background:#1b2535;border:1px solid rgba(148,172,210,.22);color:#e9eef5;font:600 13.5px/1.35 'Segoe UI',Roboto,Arial,sans-serif;box-shadow:0 14px 40px rgba(0,0,0,.45);animation:cxToastIn .2s ease-out}
.cx-toast.bad{border-color:rgba(240,105,94,.45);background:#2a1a1d}
.cx-toast.good{border-color:rgba(90,208,138,.4);background:#152a20}
.cx-toast.out{opacity:0;transform:translateY(6px);transition:.25s}
@keyframes cxToastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

.cx-empty{padding:56px 20px;text-align:center;color:var(--cx-muted);display:grid;justify-items:center;gap:12px}
.cx-empty h2{font-size:22px}
.cx-skeleton{height:280px;border-radius:14px;background:linear-gradient(100deg,var(--cx-panel) 30%,var(--cx-panel-2) 50%,var(--cx-panel) 70%);background-size:300% 100%;animation:cxShimmer 1.4s linear infinite}
@keyframes cxShimmer{to{background-position:-300% 0}}

/* ==========================================================================
   Catalog
   ========================================================================== */
.cx-feature{--accent:#b786ef;position:relative;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);align-items:center;gap:28px;padding:34px 40px;margin-bottom:30px;border-radius:18px;overflow:hidden;
  background:radial-gradient(60% 90% at 78% 50%,color-mix(in srgb,var(--accent) 26%,transparent),transparent 70%),linear-gradient(135deg,#151e2c,#0f1520 60%);border:1px solid var(--cx-line)}
.cx-feature-copy{display:grid;gap:14px;align-content:center;max-width:520px}
.cx-feature-kicker{font-size:13.5px;color:var(--cx-muted);display:flex;align-items:center;gap:8px}
.cx-feature-kicker b{color:var(--accent);font-weight:700}
.cx-feature .cx-feature-title{font-size:clamp(34px,4.4vw,56px);line-height:.98;font-weight:800}
.cx-feature-copy>p{font-size:15.5px;line-height:1.5;color:#b9c3d1;max-width:46ch}
.cx-feature-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
.cx-feature-visual{position:relative;display:grid;grid-template-columns:1fr 150px;align-items:center;gap:8px;min-height:260px}
.cx-feature-crate{display:grid;place-items:center}
.cx-feature-crate img{width:min(100%,320px);aspect-ratio:1;object-fit:contain;filter:drop-shadow(0 26px 40px rgba(0,0,0,.55))}
.cx-feature-best{display:grid;gap:8px;align-self:center}
.cx-feature-best small{font-size:12px;color:var(--cx-muted)}

.cx-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.cx-toolbar h2{font-size:24px;font-weight:800;margin-right:auto}
.cx-search{position:relative;display:flex;align-items:center}
.cx-search svg{position:absolute;left:12px;color:var(--cx-dim);pointer-events:none}
.cx-search input{width:230px;height:42px;padding:0 14px 0 36px;border-radius:10px;border:1px solid var(--cx-line);background:rgba(0,0,0,.22);color:var(--cx-text);font:inherit;font-size:14px;outline:none}
.cx-search input:focus{border-color:rgba(242,161,74,.5)}
.cx-select{height:42px;padding:0 34px 0 12px;border-radius:10px;border:1px solid var(--cx-line);background:rgba(0,0,0,.22) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238d99ab' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") right 12px center no-repeat;color:var(--cx-text);font:inherit;font-size:13.5px;appearance:none;cursor:pointer}
.cx-select option{background:#151d2a}

.cx-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:16px}
.cx-crate{--accent:#e9ad63;position:relative;display:flex;flex-direction:column;border-radius:16px;overflow:hidden;text-decoration:none;color:inherit;background:linear-gradient(180deg,#161f2d,#111823);border:1px solid var(--cx-line);transition:transform .18s ease,border-color .18s,box-shadow .18s}
.cx-crate:hover{transform:translateY(-3px);border-color:color-mix(in srgb,var(--accent) 45%,transparent);box-shadow:0 18px 40px -18px color-mix(in srgb,var(--accent) 55%,transparent)}
.cx-crate-art{position:relative;display:grid;place-items:center;height:190px;background:radial-gradient(55% 60% at 50% 58%,color-mix(in srgb,var(--accent) 30%,transparent),transparent 72%)}
.cx-crate-art img{width:168px;height:168px;object-fit:contain;filter:drop-shadow(0 16px 22px rgba(0,0,0,.55));transition:transform .25s ease}
.cx-crate:hover .cx-crate-art img{transform:scale(1.05) rotate(-2deg)}
.cx-crate-count{position:absolute;top:12px;left:12px;font-size:12px;color:var(--cx-muted);background:rgba(0,0,0,.35);padding:4px 9px;border-radius:999px}
.cx-crate-body{display:grid;gap:6px;padding:4px 16px 14px}
.cx-crate-body h3{font-size:20px;font-weight:800}
.cx-crate-body p{font-size:13.5px;color:var(--cx-muted);line-height:1.4;min-height:2.8em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.cx-crate-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:auto;padding:12px 16px 16px;border-top:1px solid var(--cx-line)}
.cx-crate-price{font-size:19px;color:var(--cx-accent-2)}
.cx-tops{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.cx-tops .cx-art{width:40px;height:40px;flex:0 0 40px;border-radius:9px;border:1px solid color-mix(in srgb,var(--q) 40%,transparent);background-color:rgba(255,255,255,.03)}
.cx-tops .cx-art>img{width:82%;height:82%}
.cx-note{margin-top:26px;font-size:13.5px;color:var(--cx-muted);line-height:1.5}

/* ==========================================================================
   Crate detail / opening stage
   ========================================================================== */
.cx-back{display:inline-flex;align-items:center;gap:6px;color:var(--cx-muted)!important;text-decoration:none;font-size:14px;margin-bottom:14px}
.cx-back:hover{color:var(--cx-text)!important}
.cx-stage{--accent:#e9ad63;position:relative;border-radius:18px;overflow:hidden;border:1px solid var(--cx-line);
  background:radial-gradient(45% 70% at 14% 30%,color-mix(in srgb,var(--accent) 20%,transparent),transparent 70%),linear-gradient(160deg,#161f2d,#0f1520 70%)}
.cx-stage-head{display:grid;grid-template-columns:220px minmax(0,1fr) auto;align-items:center;gap:28px;padding:26px 30px}
.cx-stage-art{display:grid;place-items:center}
.cx-stage-art img{width:200px;height:200px;object-fit:contain;filter:drop-shadow(0 18px 28px rgba(0,0,0,.55))}
.cx-stage-copy{display:grid;gap:10px;min-width:0}
.cx-stage-copy .cx-stage-title{font-size:clamp(30px,3.4vw,44px);font-weight:800;line-height:1}
.cx-stage-copy>p{color:#b9c3d1;font-size:15px;line-height:1.45;max-width:58ch}
.cx-facts{display:flex;flex-wrap:wrap;gap:8px 22px;margin-top:4px;font-size:13px;color:var(--cx-muted)}
.cx-facts b{display:block;color:var(--cx-text);font-size:16px;font-family:var(--cx-display);font-weight:700;margin-top:2px}
.cx-controls{display:grid;gap:10px;justify-items:stretch;min-width:260px}
.cx-controls .cx-seg{justify-content:space-between}
.cx-controls .cx-seg button{flex:1}
.cx-balance{font-size:12.5px;color:var(--cx-muted);text-align:center}
.cx-balance .cx-bolts{color:var(--cx-text);font-size:13px}

.cx-reels{display:grid;gap:10px;padding:0 30px 26px}
.cx-reel{--card:146px;--gap:10px;position:relative;padding:16px 0;border-radius:14px;overflow:hidden;background:rgba(4,8,14,.45);border:1px solid var(--cx-line);
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 9%,#000 91%,transparent);mask-image:linear-gradient(90deg,transparent,#000 9%,#000 91%,transparent)}
.cx-reels.many .cx-reel{--card:118px;padding:12px 0}
.cx-reel-track{position:relative;display:flex;gap:var(--gap);width:max-content;transform:translate3d(0,0,0);will-change:transform}
.cx-reel-track .cx-item{width:var(--card);flex:0 0 var(--card)}
.cx-reels.many .cx-item .cx-effect,.cx-reels.many .cx-item>.cx-item-head{display:none}
.cx-reels.many .cx-item h4{min-height:0;-webkit-line-clamp:1;font-size:11.5px}
.cx-reels.many .cx-item{padding-top:7px}
/* Center pointer: notches at the edges so nothing is drawn across item text. */
.cx-reel::before,.cx-reel::after{content:'';position:absolute;left:50%;z-index:3;width:0;height:0;transform:translateX(-50%);border-left:9px solid transparent;border-right:9px solid transparent}
.cx-reel::before{top:0;border-top:11px solid var(--cx-accent)}
.cx-reel::after{bottom:0;border-bottom:11px solid var(--cx-accent)}
.cx-reel .cx-item{transition:opacity .3s}
.cx-reel.settled .cx-item:not(.is-hit){opacity:.35}
.cx-reel .cx-item.is-hit{border-color:var(--q);box-shadow:0 0 0 1px var(--q),0 0 34px -6px var(--q)}
.cx-reel.idle .cx-reel-track{animation:cxIdle 60s linear infinite}
.cx-reel.idle .cx-item{opacity:.55}
@keyframes cxIdle{from{transform:translate3d(0,0,0)}to{transform:translate3d(calc(-50% - 5px),0,0)}}
/* Vertical reels for 3–5 openings: side-by-side columns, result in the
   middle row, pointers at the sides of each column. */
.cx-reels.vertical{display:grid;grid-template-columns:repeat(var(--n,3),minmax(0,1fr));gap:10px}
.cx-reel.v{--slot:128px;height:calc(var(--slot) * 3);padding:0;
  -webkit-mask-image:linear-gradient(180deg,transparent,#000 18%,#000 82%,transparent);mask-image:linear-gradient(180deg,transparent,#000 18%,#000 82%,transparent)}
.cx-reel.v .cx-reel-track{flex-direction:column;gap:0;width:auto}
.cx-reel.v::before,.cx-reel.v::after{left:auto;top:50%;bottom:auto;transform:translateY(-50%);border-top:9px solid transparent;border-bottom:9px solid transparent;border-left:0;border-right:0}
.cx-reel.v::before{left:0;border-left:11px solid var(--cx-accent)}
.cx-reel.v::after{right:0;border-right:11px solid var(--cx-accent)}
.cx-vcard{--q:#ffd700;position:relative;height:var(--slot);flex:0 0 var(--slot);display:grid;justify-items:center;align-content:center;gap:4px;padding:8px 14px;text-align:center;transition:opacity .3s}
.cx-vcard .cx-art{width:70px;border-radius:10px}
.cx-vcard-name{display:block;max-width:100%;font-size:12px;font-weight:600;line-height:1.2;color:#d6dde8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cx-vcard-price{font-size:13px;color:var(--cx-accent-2)}
.cx-reel.v.settled .cx-vcard:not(.is-hit){opacity:.3}
.cx-vcard.is-hit::before{content:'';position:absolute;inset:4px 12px;border-radius:12px;border:1px solid var(--q);box-shadow:0 0 30px -8px var(--q),inset 0 0 24px -12px var(--q);pointer-events:none}
@media (max-width:820px){.cx-reels.vertical{gap:6px}.cx-reel.v{--slot:104px}.cx-vcard{padding:6px 8px}.cx-vcard .cx-art{width:52px}.cx-vcard-name{font-size:11px}}
@media (max-width:520px){.cx-vcard-name{display:none}.cx-vcard .cx-art{width:44px}.cx-vcard-price{font-size:11.5px}}
.cx-stage-foot{display:flex;justify-content:center;padding:0 30px 20px;margin-top:-12px}

.cx-results{padding:4px 30px 28px;display:grid;gap:16px;animation:cxReveal .35s ease-out}
@keyframes cxReveal{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.cx-results-head{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.cx-results-head h2{font-size:24px;font-weight:800}
.cx-results-head .cx-sum{display:flex;gap:18px;font-size:13px;color:var(--cx-muted);margin-left:auto}
.cx-results-head .cx-sum b{display:block;font-size:18px;color:var(--cx-text);margin-top:3px}
.cx-results-head .cx-sum .up{color:var(--cx-good)}
.cx-results-head .cx-sum .down{color:var(--cx-bad)}
.cx-results-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,190px));gap:12px}
.cx-results-grid .cx-item.sold{opacity:.55}
.cx-results-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.cx-results-actions .cx-link{margin-left:auto}
.cx-demo-tag{font-size:12px;font-weight:700;color:#ffd38f;background:rgba(242,161,74,.14);border:1px solid rgba(242,161,74,.3);padding:4px 9px;border-radius:999px}
.cx-alert{padding:12px 14px;border-radius:10px;background:rgba(240,105,94,.1);border:1px solid rgba(240,105,94,.35);color:#ffc2bc;font-size:14px;display:flex;align-items:center;gap:12px;flex-wrap:wrap}

.cx-contents{margin-top:34px}
.cx-contents-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.cx-contents-head h2{font-size:24px;font-weight:800}
.cx-contents-head p{font-size:13.5px;color:var(--cx-muted)}
.cx-drops{display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:12px}
.cx-oddsbar{height:4px;border-radius:4px;background:rgba(255,255,255,.06);overflow:hidden;margin-top:-2px}
.cx-oddsbar i{display:block;height:100%;background:var(--q);opacity:.75;min-width:2px}

/* ---------- Responsive ---------- */
@media (max-width:1100px){
  .cx-stage-head{grid-template-columns:150px minmax(0,1fr)}
  .cx-stage-art img{width:150px;height:150px}
  .cx-controls{grid-column:1/-1;grid-template-columns:auto 1fr auto;align-items:center;min-width:0}
  .cx-balance{text-align:right}
}
@media (max-width:820px){
  .cx-root{padding:16px 14px 44px}
  .cx-feature{grid-template-columns:1fr;padding:24px 22px}
  .cx-feature-visual{min-height:0;grid-template-columns:1fr 130px}
  .cx-feature-crate img{width:200px}
  .cx-toolbar h2{width:100%}
  .cx-search{flex:1}.cx-search input{width:100%}
  .cx-stage-head{grid-template-columns:1fr;padding:20px;gap:16px;justify-items:start}
  .cx-stage-art img{width:130px;height:130px}
  .cx-controls{grid-template-columns:1fr;width:100%}
  .cx-balance{text-align:left}
  .cx-reels,.cx-results{padding-left:16px;padding-right:16px}
  .cx-reel{--card:120px}
  .cx-results-head .cx-sum{margin-left:0;width:100%}
  .cx-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))}
  .cx-drops,.cx-results-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
}
@media (prefers-reduced-motion:reduce){
  .cx-crate,.cx-crate-art img,.cx-reel.idle .cx-reel-track{transition:none;animation:none}
}

/* ---------- Game guide (SEO section under crates / crate battles) ---------- */
.crates-page .game-seo-guide,.battle-page .game-seo-guide{width:min(1312px,calc(100% - 48px));margin-top:8px}
.game-seo-faq{margin-top:22px;padding-top:18px;border-top:1px solid rgba(255,255,255,.06)}
.game-seo-faq>h3{margin:0 0 12px;color:#f4f5f7;font-size:17px;line-height:1.3}
.game-seo-faq details{border:1px solid rgba(255,255,255,.065);border-radius:11px;background:rgba(255,255,255,.02);margin-bottom:8px;overflow:hidden}
.game-seo-faq summary{cursor:pointer;list-style:none;padding:13px 44px 13px 16px;position:relative;color:#e3e7ec;font-size:14px;font-weight:650;line-height:1.4}
.game-seo-faq summary::-webkit-details-marker{display:none}
.game-seo-faq summary::after{content:'+';position:absolute;right:16px;top:50%;transform:translateY(-50%);color:var(--accent,#e88b35);font-size:20px;font-weight:600;line-height:1}
.game-seo-faq details[open] summary::after{content:'−'}
.game-seo-faq summary:hover{color:#fff}
.game-seo-faq summary:focus-visible{outline:2px solid var(--accent,#e88b35);outline-offset:-2px}
.game-seo-faq details p{margin:0;padding:0 16px 14px;color:#929ba7;font-size:13.5px;line-height:1.7}
@media(max-width:850px){.crates-page .game-seo-guide,.battle-page .game-seo-guide{width:calc(100% - 24px)}}


/* Separate TF2 scenes behind the existing crate and battle UI. */
body.crates-page,body.battle-page{background:transparent!important}
body.crates-page{--tf2-page-scene:url('/assets/backgrounds/tf2-crates-warehouse-20261011.webp')}
body.battle-page{--tf2-page-scene:url('/assets/backgrounds/tf2-battles-arena-20261011.webp')}
body.crates-page::before,body.battle-page::before{
  content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;
  background-color:#0b1017;
  background-image:linear-gradient(180deg,rgba(4,7,12,.75),rgba(4,7,12,.88)),var(--tf2-page-scene);
  filter:brightness(1.5) saturate(1.1) blur(0px);
  background-size:cover;background-position:center;background-repeat:no-repeat;
}
/* Portrait screens keep some of the environment in frame. */
@media(max-width:600px){
  body.crates-page::before{background-position:center,18% center}
  body.battle-page::before{background-position:center,82% center}
}

/* Panels: glass over the blueprint, lit from above */
body.crates-page .cx-feature,body.crates-page .cx-stage,body.battle-page .cb-arena,body.battle-page .cx-empty{
  background:linear-gradient(165deg,rgba(32,41,56,.74),rgba(13,18,26,.84))!important;
  -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,.07)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07),0 24px 60px rgba(0,0,0,.35),0 0 0 1px rgba(255,178,84,.04)!important;
}
/* Featured crate sits under the lamp */
body.crates-page .cx-feature-visual{position:relative}
body.crates-page .cx-feature-visual::before{content:"";position:absolute;left:50%;top:-30%;width:120%;height:150%;transform:translateX(-50%);background:radial-gradient(ellipse 45% 55% at 50% 30%,rgba(255,186,96,.18),transparent 70%);pointer-events:none;z-index:0}
body.crates-page .cx-feature-visual>*{position:relative;z-index:1}

/* Crate tiles: quiet at rest, catch the light when picked up */
body.crates-page .cx-crate{background:linear-gradient(170deg,rgba(28,36,49,.82),rgba(14,19,27,.9))!important;border:1px solid rgba(255,255,255,.06)!important;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
body.crates-page .cx-crate-art{position:relative}
body.crates-page .cx-crate-art::after{content:"";position:absolute;inset:0;background:radial-gradient(ellipse 55% 60% at 50% 35%,rgba(255,186,96,.0),transparent 70%);transition:background .18s ease;pointer-events:none}
body.crates-page .cx-crate:hover,body.crates-page .cx-crate:focus-visible{transform:translateY(-3px);border-color:rgba(255,178,84,.32)!important;box-shadow:0 18px 40px rgba(0,0,0,.45),0 0 0 1px rgba(255,178,84,.12)}
body.crates-page .cx-crate:hover .cx-crate-art::after{background:radial-gradient(ellipse 55% 60% at 50% 35%,rgba(255,186,96,.16),transparent 70%)}

/* Page tabs: a solid segmented control instead of loose links */
body.crates-page .cx-tabs,body.battle-page .cx-tabs{padding:4px;gap:2px;border-radius:12px;background:rgba(10,14,20,.6);border:1px solid rgba(255,255,255,.06)}
body.crates-page .cx-tabs>*,body.battle-page .cx-tabs>*{padding:7px 14px;border-radius:9px;border-bottom:0!important;text-decoration:none}
body.crates-page .cx-tabs [aria-current="page"],body.battle-page .cx-tabs [aria-current="page"],body.crates-page .cx-tabs .active,body.battle-page .cx-tabs .active{background:linear-gradient(180deg,rgba(255,178,84,.2),rgba(255,178,84,.08));color:#ffd9a8;box-shadow:inset 0 0 0 1px rgba(255,178,84,.28)}

/* Battle rooms: RED and BLU tints for team battles */
body.battle-page .cb-team:first-child .cb-col{box-shadow:inset 0 2px 0 rgba(201,64,52,.55)}
body.battle-page .cb-team:last-child .cb-col{box-shadow:inset 0 2px 0 rgba(78,130,201,.6)}
body.battle-page .cb-team:first-child .cb-team-head{color:#ff9a8f}
body.battle-page .cb-team:last-child .cb-team-head{color:#9cc3ff}

@media (prefers-reduced-motion:reduce){body.crates-page .cx-crate{transition:none}body.crates-page .cx-crate:hover{transform:none}}

/* Crates catalog controls and clearly separated opening / contents panels. */
body.crates-page .cx-sort{position:relative;flex:0 0 224px;min-width:0;z-index:10}
body.crates-page .cx-sort-trigger{display:grid;grid-template-columns:1fr 16px;gap:2px 12px;width:100%;min-height:50px;padding:8px 14px;text-align:left;color:#edf1f7;background:#19212d;border:1px solid #364254;border-radius:12px;font:inherit;cursor:pointer}
body.crates-page .cx-sort-caption{grid-column:1;font-size:12px;font-weight:600;color:#a4b1c3;line-height:1.2}
body.crates-page #cxSortLabel{grid-column:1;font-size:15px;font-weight:650;line-height:1.4}
body.crates-page .cx-sort-trigger svg{grid-column:2;grid-row:1/3;align-self:center;transition:transform .16s ease}
body.crates-page .cx-sort-trigger[aria-expanded="true"]{border-color:#e9ad63;box-shadow:0 0 0 3px rgba(233,173,99,.1)}
body.crates-page .cx-sort-trigger[aria-expanded="true"] svg{transform:rotate(180deg)}
body.crates-page .cx-sort-menu{position:absolute;top:calc(100% + 8px);right:0;width:100%;padding:6px;background:#161e2a;border:1px solid #40506a;border-radius:14px;box-shadow:0 18px 45px rgba(0,0,0,.55);overflow:hidden}
body.crates-page .cx-sort-menu[hidden]{display:none!important}
body.crates-page .cx-sort-menu [role="option"]{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;border:0;border-radius:8px;padding:10px 12px;color:#e6edf7;background:transparent;text-align:left;font:inherit;font-size:15px;cursor:pointer}
body.crates-page .cx-sort-menu [aria-selected="true"]{background:#332c25;color:#ffdbad}
body.crates-page .cx-sort-check{visibility:hidden;color:#f1bb77;font-weight:700}
body.crates-page .cx-sort-menu [aria-selected="true"] .cx-sort-check{visibility:visible}
body.crates-page .cx-sort-menu [role="option"]:hover{background:#293549}
body.crates-page .cx-sort-trigger:focus-visible,body.crates-page .cx-sort-menu [role="option"]:focus-visible{outline:2px solid #f1bb77;outline-offset:-3px}
body.crates-page .cx-stage{background:linear-gradient(155deg,#202936,#111822)!important;border-color:#3d4857!important;box-shadow:inset 0 2px 0 var(--accent,#e9ad63),0 18px 44px rgba(0,0,0,.28)!important}
body.crates-page .cx-stage-head{border-bottom:1px solid rgba(255,255,255,.09);margin-bottom:18px}
body.crates-page .cx-reel{border-color:rgba(255,255,255,.12);background:#0c121b;box-shadow:inset 0 2px 16px rgba(0,0,0,.35)}
body.crates-page .cx-contents{margin-top:24px;border:1px solid #344052;border-radius:18px;background:#131b26;box-shadow:0 12px 32px rgba(0,0,0,.2);overflow:hidden}
body.crates-page .cx-contents-head{padding:20px 24px;margin:0;border-bottom:1px solid #2c3748;background:#192230}
body.crates-page .cx-contents-head h2{font-size:26px;line-height:1.25}
body.crates-page .cx-contents-head p{font-size:15px;line-height:1.5;color:#b1bed0}
body.crates-page .cx-drops{padding:20px 24px}
body.crates-page .cx-contents .cx-item h4{font-size:14px}
body.crates-page .cx-contents .cx-item-head{font-size:13px}
@media(max-width:820px){
  body.crates-page .cx-contents-head{padding:18px 16px;gap:8px}
  body.crates-page .cx-drops{padding:16px}
  body.crates-page .cx-contents-head h2{font-size:24px}
}
@media(max-width:520px){body.crates-page .cx-sort{flex:1 1 100%}}
@media(prefers-reduced-motion:reduce){body.crates-page .cx-sort-trigger svg{transition:none}}

/* Fairness access stays within the game UI, without a duplicate page toolbar. */
body.crates-page .cx-fair-btn,body.battle-page .cx-fair-btn{
  min-height:44px;padding:0 14px;gap:9px;border-radius:12px;
  border:1px solid #3d665e;background:linear-gradient(160deg,#203c36,#192d2b);
  color:#d5f8eb;font-size:16px;font-weight:650;line-height:1.3;
  box-shadow:inset 0 1px 0 rgba(201,255,232,.07);
}
body.crates-page .cx-fair-btn svg,body.battle-page .cx-fair-btn svg{flex:0 0 20px;color:#8fe0bd}
body.crates-page .cx-fair-btn:hover,body.battle-page .cx-fair-btn:hover{background:#294a42;border-color:#69b599}
body.crates-page .cx-fair-btn:focus-visible,body.battle-page .cx-fair-btn:focus-visible{outline:2px solid #9debc7;outline-offset:3px}
body.crates-page .cx-facts{align-items:center}
body.crates-page .cx-feature-actions{align-items:center}
body.battle-page .cb-intro-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px}

/* Seasonal crate scenery: clipped to the artwork, behind the crate itself. */
body.crates-page .cx-season-art{position:relative;isolation:isolate}
body.crates-page .cx-season-art>img{position:relative;z-index:1}
body.crates-page .cx-season-art>.cx-crate-count{z-index:2}
.cx-season{position:absolute;inset:0;display:block;overflow:hidden;border-radius:inherit;pointer-events:none;z-index:0;
  -webkit-mask-image:linear-gradient(#000 78%,transparent);mask-image:linear-gradient(#000 78%,transparent)}
.cx-season::before,.cx-season::after{content:"";position:absolute;pointer-events:none}
.cx-season-christmas{background:radial-gradient(ellipse at 50% 30%,#8cbfe22e,transparent 72%),linear-gradient(180deg,#19374b30,transparent)}
.cx-season-christmas::before{inset:0;background:radial-gradient(ellipse at 5% 90%,#a8d6eb1f,transparent 42%),radial-gradient(ellipse at 96% 90%,#a8d6eb1f,transparent 42%)}
.cx-season-christmas::after{left:10%;right:10%;bottom:4%;height:22%;border-radius:50%;background:radial-gradient(ellipse,#d5edf51c,transparent 70%)}
.cx-season i{position:absolute;display:block;left:var(--sx);top:var(--sy);width:4px;height:4px;opacity:.45;animation-duration:var(--sd);animation-delay:var(--ss);animation-timing-function:linear;animation-iteration-count:infinite;animation-play-state:paused}
.cx-season-christmas i{border-radius:50%;background:#e7f6ff;box-shadow:0 0 4px #d8f4ff44;animation-name:cx-season-snow}
.cx-season-christmas i:nth-child(3n){width:9px;height:9px;border-radius:0;background:linear-gradient(90deg,transparent 42%,#dcefff 42% 58%,transparent 58%),linear-gradient(transparent 42%,#dcefff 42% 58%,transparent 58%);box-shadow:none;opacity:.55}
.cx-season-halloween{background:radial-gradient(ellipse at 50% 70%,#e273272b,transparent 63%),radial-gradient(ellipse at 12% 15%,#8c5dc52b,transparent 60%)}
.cx-season-halloween::before{inset:25% -20% -20%;background:radial-gradient(ellipse at 15% 75%,#b58cce20,transparent 43%),radial-gradient(ellipse at 75% 55%,#9059c522,transparent 48%);animation:cx-season-mist 18s ease-in-out infinite alternate paused}
.cx-season-halloween i{width:3px;height:3px;border-radius:50%;background:#efa35d;box-shadow:0 0 6px #df853e66;animation-name:cx-season-ember}
.cx-season-halloween i:nth-child(3n){background:#b992e3;box-shadow:0 0 6px #ac7ad366}
.cx-season-newyear{background:radial-gradient(ellipse at 50% 45%,#d0a64c27,transparent 70%),radial-gradient(ellipse at 90% 5%,#7b69cc20,transparent 58%)}
.cx-season-newyear::before{inset:0;background:radial-gradient(circle at 16% 24%,#eed5a833 0 1px,transparent 2px),radial-gradient(circle at 76% 16%,#eed5a833 0 1px,transparent 2px),radial-gradient(circle at 87% 64%,#a9cce933 0 1px,transparent 2px),radial-gradient(circle at 34% 73%,#eed5a82b 0 1px,transparent 2px)}
.cx-season-newyear i{width:3px;height:7px;border-radius:1px;background:#e7c37a;animation-name:cx-season-confetti}
.cx-season-newyear i:nth-child(3n){background:#a9c4d8;height:4px}
.cx-season-newyear i:nth-child(4n){background:#b69cd9;width:5px;height:3px}
.cx-season.is-visible i,.cx-season.is-visible::before{animation-play-state:running}
.cx-seasons-paused .cx-season i,.cx-seasons-paused .cx-season::before{animation-play-state:paused}
@keyframes cx-season-snow{0%{transform:translate3d(0,-210px,0);opacity:0}15%{opacity:.55}85%{opacity:.55}100%{transform:translate3d(var(--sw),330px,0);opacity:0}}
@keyframes cx-season-ember{0%{transform:translate3d(0,180px,0);opacity:0}20%{opacity:.5}75%{opacity:.4}100%{transform:translate3d(var(--sw),-230px,0);opacity:0}}
@keyframes cx-season-confetti{0%{transform:translate3d(0,-210px,0) rotate(0);opacity:0}18%{opacity:.55}80%{opacity:.5}100%{transform:translate3d(var(--sw),330px,0) rotate(240deg);opacity:0}}
@keyframes cx-season-mist{to{transform:translate3d(8%,-5%,0)}}
@media(prefers-reduced-motion:reduce){.cx-season i,.cx-season::before{animation:none!important}.cx-season i{opacity:.3}}

/* Progressive catalog: one stable grid, with the existing button style. */
body.crates-page .cx-catalog-more{display:flex;justify-content:center;padding:22px 0 4px;min-height:72px}
body.crates-page .cx-catalog-more[hidden]{display:none}
body.crates-page .cx-catalog-more .cx-btn{min-height:46px;padding:0 26px;font-size:16px}
