/* DingleGG case opening — paired with cases.php */

.cases-tab-shell {
  padding: 0;
  overflow: visible;
}

.cases-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--glass-border);
  background: transparent;
}

.cases-tab {
  border: 1px solid #EEE;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cases-tab:hover {
  color: var(--text);
  background: transparent;
}

.cases-tab.is-active {
  color: var(--text);
  background: transparent;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--glass-border));
  box-shadow: 0 2px 10px rgba(20, 30, 44, 0.06);
}

.cases-tab-panels {
  padding: 14px 16px 18px;
}

.cases-tab-panel {
  display: none;
}

.cases-tab-panel.is-active {
  display: block;
}

.cases-tab-lead {
  margin: 0 0 12px;
}

.cases-tab-heading {
  font-size: 1rem;
  margin: 18px 0 8px;
  color: var(--text);
}

.cases-tab-heading:first-child {
  margin-top: 0;
}

.cases-guest-panel {
  padding: 8px 0 12px;
}

.cases-hero-preview-strip {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 12px;
  justify-content: center;
  align-items: center;
}

.cases-hero-preview-tile {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--glass-border) 80%, var(--accent));
  background: transparent;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(20, 30, 44, 0.08);
}

.cases-hero-preview-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cases-shop-previews {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.cases-shop-previews img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(120, 120, 140, 0.35);
  background: transparent;
}

.cases-ext-steps {
  margin: 12px 0 16px;
  padding-left: 1.25rem;
  line-height: 1.55;
  color: var(--muted);
}

.cases-ext-steps li {
  margin-bottom: 8px;
}

.cases-hero h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cases-hero-lead strong {
  color: var(--accent);
}

.cases-wallet-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  margin-top: 12px;
}

.cases-stat {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.cases-stat i {
  color: var(--accent);
  margin-right: 4px;
}

.cases-db-warn code {
  font-size: 0.85em;
}

.cases-section h2 {
  margin-bottom: 8px;
}

.cases-subh {
  font-size: 0.95rem;
  margin: 16px 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cases-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 12px;
  margin-top: 10px;
}

.cases-shop-card {
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* Only a direct promo image — never marquee thumbnails inside .cases-marquee */
.cases-shop-card > img {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16/10;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
}

.cases-shop-card--key .cases-shop-key-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  font-size: 2.25rem;
  color: color-mix(in srgb, var(--accent) 70%, var(--muted));
  opacity: 0.9;
}

.cases-shop-actions,
.cases-inv-case-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.cases-shop-buy-row {
  margin-top: 6px;
}

.cases-shop-qty-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.cases-shop-qty {
  max-width: 5.5rem;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--text);
  font-size: 0.95rem;
}

.cases-shop-total-line {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.cases-shop-total-line strong {
  color: var(--text);
}

.cases-shop-card .cases-shop-buy {
  margin-top: 4px;
}

.action-btn.ghost {
  background: transparent;
  border: 1px dashed color-mix(in srgb, var(--glass-border) 70%, var(--accent));
  color: var(--text);
  font-weight: 600;
}

.action-btn.ghost:hover {
  background: transparent;
  border-style: solid;
}

/* Infinite horizontal marquee (duplicated row in JS) */
.cases-marquee {
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 4px;
  border: 1px solid var(--glass-border);
  background: transparent;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  max-width: 100%;
  min-width: 0;
}

.cases-shop-card .cases-marquee,
.cases-case-card .cases-marquee {
  align-self: stretch;
}

.cases-marquee--sm .cases-marquee-item {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  box-sizing: border-box;
}

.cases-marquee--sm .cases-marquee-item img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
}

.cases-marquee--md .cases-marquee-item {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  box-sizing: border-box;
}

.cases-marquee--md .cases-marquee-item img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
}

.cases-marquee-track {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: max-content;
  padding: 8px 0;
  animation: cases-marquee-x 55s linear infinite;
}

.cases-marquee--md .cases-marquee-track {
  animation-duration: 42s;
}

@keyframes cases-marquee-x {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .cases-marquee-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-height: 120px;
    overflow-y: auto;
  }
}

.cases-marquee-item {
  flex: 0 0 auto;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(120, 120, 140, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}

.cases-marquee-item img {
  display: block;
  object-fit: cover;
  max-width: 100%;
}

/* Marquee tiles: rarity border + glow (each item has its own tier) */
.cases-marquee-item.cases-rarity-consumer {
  border-color: #9aa7b8;
  box-shadow: 0 0 12px rgba(154, 167, 184, 0.35);
  background: transparent;
}
.cases-marquee-item.cases-rarity-industrial {
  border-color: #5e98d9;
  box-shadow: 0 0 14px rgba(94, 152, 217, 0.4);
  background: transparent;
}
.cases-marquee-item.cases-rarity-mil_spec {
  border-color: #4b69ff;
  box-shadow: 0 0 16px rgba(75, 105, 255, 0.45);
  background: transparent;
}
.cases-marquee-item.cases-rarity-restricted {
  border-color: #8847ff;
  box-shadow: 0 0 18px rgba(136, 71, 255, 0.48);
  background: transparent;
}
.cases-marquee-item.cases-rarity-classified {
  border-color: #d32ce6;
  box-shadow: 0 0 18px rgba(211, 44, 230, 0.45);
  background: transparent;
}
.cases-marquee-item.cases-rarity-covert {
  border-color: #eb4b4b;
  box-shadow: 0 0 20px rgba(235, 75, 75, 0.5);
  background: transparent;
}
.cases-marquee-item.cases-rarity-rare_special {
  border-color: #e4ae39;
  box-shadow: 0 0 22px rgba(228, 174, 57, 0.55);
  background: transparent;
  animation: cases-marquee-rare-glint 2.5s ease-in-out infinite;
}

@keyframes cases-marquee-rare-glint {
  0%, 100% { filter: brightness(1); box-shadow: 0 0 18px rgba(228, 174, 57, 0.45); }
  50% { filter: brightness(1.08); box-shadow: 0 0 26px rgba(255, 210, 120, 0.65); }
}

.cases-marquee-block {
  margin: 0 0 14px;
}

.cases-marquee-inventory-label {
  margin-bottom: 6px;
}

.cases-btn-bought {
  animation: cases-btn-flash 0.9s ease;
}

@keyframes cases-btn-flash {
  0%, 100% { filter: brightness(1); box-shadow: none; }
  25% { filter: brightness(1.15); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
  50% { filter: brightness(1.05); }
}

.cases-contents-modal .cases-modal {
  max-width: min(900px, 100%);
}

.cases-contents-odds {
  margin-bottom: 12px;
  line-height: 1.45;
}

.cases-contents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr));
  gap: 10px;
  max-height: min(60vh, 520px);
  overflow-y: auto;
  padding: 4px 2px 8px;
}

.cases-contents-cell {
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  padding: 8px;
  text-align: center;
  background: transparent;
  min-width: 0;
}

.cases-contents-img-wrap {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
  background: transparent;
  min-width: 0;
}

.cases-contents-img-wrap img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cases-contents-name {
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
  margin-bottom: 2px;
}

.cases-item-rarity-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin: 6px 0 4px;
}

.cases-rarity-pill {
  font-size: 0.62rem;
  font-weight: 750;
  padding: 3px 7px;
  border-radius: 999px;
  line-height: 1.2;
  white-space: nowrap;
}

.cases-rarity-pill.cases-rarity-consumer {
  background: rgba(154, 167, 184, 0.45);
  color: #12161c;
  border: 1px solid #9aa7b8;
}
.cases-rarity-pill.cases-rarity-industrial {
  background: rgba(94, 152, 217, 0.4);
  color: #0c1520;
  border: 1px solid #5e98d9;
}
.cases-rarity-pill.cases-rarity-mil_spec {
  background: rgba(75, 105, 255, 0.42);
  color: #0a0e18;
  border: 1px solid #4b69ff;
}
.cases-rarity-pill.cases-rarity-restricted {
  background: rgba(136, 71, 255, 0.38);
  color: #f2e8ff;
  border: 1px solid #8847ff;
}
.cases-rarity-pill.cases-rarity-classified {
  background: rgba(211, 44, 230, 0.35);
  color: #fff8ff;
  border: 1px solid #d32ce6;
}
.cases-rarity-pill.cases-rarity-covert {
  background: rgba(235, 75, 75, 0.38);
  color: #fff6f6;
  border: 1px solid #eb4b4b;
}
.cases-rarity-pill.cases-rarity-rare_special {
  background: rgba(228, 174, 57, 0.45);
  color: #1a1406;
  border: 1px solid #e4ae39;
}

.cases-has-multi-rarity {
  position: relative;
}

.cases-marquee-item.cases-has-multi-rarity {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 16px rgba(255, 255, 255, 0.08);
}

.cases-reel-item-name {
  display: block;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  margin-top: 2px;
  line-height: 1.15;
}

.cases-reel-rarity-tags {
  margin-top: 3px;
  max-width: 118px;
}

.cases-reel-rarity-tags .cases-item-rarity-pills {
  margin: 0;
  gap: 2px;
}

.cases-reel-rarity-tags .cases-rarity-pill {
  font-size: 0.5rem;
  padding: 1px 4px;
}

.cases-skin-rarity-row {
  margin-top: 6px;
}

.cases-skin-rarity-row .cases-item-rarity-pills {
  margin: 0;
}

.cases-reveal-rarities {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.cases-reveal-rarities .cases-item-rarity-pills {
  margin: 0;
}

.cases-reveal-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--glass-border) 80%, transparent);
  text-align: center;
}

.cases-reveal-actions .cases-open-another-btn {
  min-width: 200px;
}

.cases-reveal-actions-hint {
  margin: 8px 0 0;
}

.cases-open-modal .cases-rarity-pill.cases-rarity-restricted,
.cases-open-modal .cases-rarity-pill.cases-rarity-classified,
.cases-open-modal .cases-rarity-pill.cases-rarity-covert {
  color: #f4f7fb;
}

.cases-contents-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.cases-list-preview {
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px;
  background: transparent;
}

.cases-list-preview-inner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cases-list-preview-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
  flex-shrink: 0;
}

.cases-list-preview-placeholder {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.cases-list-preview-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

.cases-list-preview-title {
  font-weight: 750;
  font-size: 1rem;
  margin: 2px 0 4px;
}

.cases-list-preview-price {
  margin-top: 8px;
}

.cases-market-offer {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cases-market-thumb-frame,
.cases-list-preview-thumb-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 10px;
  line-height: 0;
  flex-shrink: 0;
  background: transparent;
}

.cases-market-thumb-frame.cases-thumb-frame-neutral,
.cases-list-preview-thumb-frame.cases-thumb-frame-neutral {
  box-shadow:
    0 0 0 2px rgba(120, 120, 140, 0.45),
    0 3px 10px rgba(40, 50, 70, 0.12);
}

.cases-market-thumb-frame.cases-thumb-frame-key,
.cases-list-preview-thumb-frame.cases-thumb-frame-key {
  box-shadow:
    0 0 0 2px #d4a21e,
    0 3px 12px rgba(212, 162, 30, 0.38);
}

.cases-market-thumb-frame.cases-rarity-consumer,
.cases-list-preview-thumb-frame.cases-rarity-consumer {
  box-shadow:
    0 0 0 2px #9aa7b8,
    0 3px 10px rgba(154, 167, 184, 0.35);
}
.cases-market-thumb-frame.cases-rarity-industrial,
.cases-list-preview-thumb-frame.cases-rarity-industrial {
  box-shadow:
    0 0 0 2px #5e98d9,
    0 3px 11px rgba(94, 152, 217, 0.38);
}
.cases-market-thumb-frame.cases-rarity-mil_spec,
.cases-list-preview-thumb-frame.cases-rarity-mil_spec {
  box-shadow:
    0 0 0 2px #4b69ff,
    0 3px 12px rgba(75, 105, 255, 0.42);
}
.cases-market-thumb-frame.cases-rarity-restricted,
.cases-list-preview-thumb-frame.cases-rarity-restricted {
  box-shadow:
    0 0 0 2px #8847ff,
    0 3px 12px rgba(136, 71, 255, 0.42);
}
.cases-market-thumb-frame.cases-rarity-classified,
.cases-list-preview-thumb-frame.cases-rarity-classified {
  box-shadow:
    0 0 0 2px #d32ce6,
    0 3px 12px rgba(211, 44, 230, 0.42);
}
.cases-market-thumb-frame.cases-rarity-covert,
.cases-list-preview-thumb-frame.cases-rarity-covert {
  box-shadow:
    0 0 0 2px #eb4b4b,
    0 3px 12px rgba(235, 75, 75, 0.45);
}
.cases-market-thumb-frame.cases-rarity-rare_special,
.cases-list-preview-thumb-frame.cases-rarity-rare_special {
  box-shadow:
    0 0 0 2px #e4ae39,
    0 3px 12px rgba(228, 174, 57, 0.48);
}

.cases-market-thumb-frame.cases-has-multi-rarity,
.cases-list-preview-thumb-frame.cases-has-multi-rarity {
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 55%, #e4ae39),
    0 4px 14px rgba(255, 255, 255, 0.15);
}

.cases-market-thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
  flex-shrink: 0;
  display: block;
}

.cases-market-thumb-ph {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  flex-shrink: 0;
}

.cases-market-offer-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.cases-market-offer-cell {
  min-width: 200px;
}

.cases-ext-download-card {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: transparent;
}

.cases-ext-big {
  margin: 0 0 14px;
}

.cases-ext-short li {
  margin-bottom: 10px;
}

.cases-unopened-grid,
.cases-skins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: 10px;
}

.cases-skins-grid--inventory {
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

@media (min-width: 480px) {
  .cases-skins-grid--inventory {
    grid-template-columns: repeat(auto-fill, minmax(92px, 104px));
  }
}

.cases-skins-grid--inventory .cases-skin-card {
  padding: 6px 5px 8px;
}

.cases-skins-grid--inventory .cases-skin-card .cases-skin-img-wrap {
  margin-bottom: 4px;
}

.cases-skin-card-name {
  font-size: 0.72rem;
  line-height: 1.2;
  margin-top: 2px;
}

.cases-skins-grid--inventory .cases-skin-card-name strong {
  font-weight: 700;
}

.cases-skins-grid--inventory .cases-skin-card-wear {
  font-size: 0.62rem;
  line-height: 1.2;
}

.cases-skins-grid--inventory .cases-rarity-pill {
  font-size: 0.5rem;
  padding: 1px 4px;
}

.cases-skins-grid--inventory .cases-item-rarity-pills {
  gap: 2px;
  margin: 4px 0 0;
  justify-content: center;
}

.cases-skins-pager {
  display: none;
  justify-content: center;
  margin-top: 12px;
}

.cases-skins-pager-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.cases-skins-pager-meta {
  font-size: 0.88rem;
  color: var(--muted);
}

.cases-skins-pager-count {
  font-weight: 500;
}

.cases-case-card,
.cases-skin-card {
  border-radius: 12px;
  border: 2px solid rgba(120, 120, 140, 0.35);
  padding: 10px;
  text-align: center;
  background: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}

.cases-case-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(20, 30, 44, 0.1);
}

/* Skin cards keep rarity glow on hover (do not replace with flat grey shadow) */
.cases-skin-card:hover {
  transform: translateY(-2px);
}

/* Unopened case cards only use .cases-marquee for art — do not target img here
   or huge intrinsics can defeat flex/grid sizing next to .cases-marquee--sm rules. */
.cases-skin-card .cases-skin-img-wrap {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  margin-bottom: 6px;
  overflow: hidden;
  background: transparent;
  box-sizing: border-box;
  min-width: 0;
}

.cases-skin-img-wrap img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Card outline by rarity (inventory / reveal container) */
.cases-skin-card.cases-rarity-consumer,
.cases-reveal-card.cases-rarity-consumer {
  border-color: #8a96a8;
  box-shadow: 0 6px 18px rgba(154, 167, 184, 0.2);
}
.cases-skin-card.cases-rarity-industrial,
.cases-reveal-card.cases-rarity-industrial {
  border-color: #4a8bc4;
  box-shadow: 0 6px 20px rgba(94, 152, 217, 0.28);
}
.cases-skin-card.cases-rarity-mil_spec,
.cases-reveal-card.cases-rarity-mil_spec {
  border-color: #3d5cff;
  box-shadow: 0 6px 22px rgba(75, 105, 255, 0.32);
}
.cases-skin-card.cases-rarity-restricted,
.cases-reveal-card.cases-rarity-restricted {
  border-color: #7738e8;
  box-shadow: 0 6px 24px rgba(136, 71, 255, 0.35);
}
.cases-skin-card.cases-rarity-classified,
.cases-reveal-card.cases-rarity-classified {
  border-color: #c028d4;
  box-shadow: 0 6px 26px rgba(211, 44, 230, 0.38);
}
.cases-skin-card.cases-rarity-covert,
.cases-reveal-card.cases-rarity-covert {
  border-color: #d63d3d;
  box-shadow: 0 6px 28px rgba(235, 75, 75, 0.42);
}
.cases-skin-card.cases-rarity-rare_special,
.cases-reveal-card.cases-rarity-rare_special {
  border-color: #d4a21e;
  box-shadow: 0 6px 30px rgba(228, 174, 57, 0.5);
  animation: cases-shine-pulse 2.4s ease-in-out infinite;
}

/* Colored frame directly around item artwork */
.cases-skin-card.cases-rarity-consumer .cases-skin-img-wrap,
.cases-reveal-card.cases-rarity-consumer .cases-skin-img-wrap {
  border: 3px solid #9aa7b8;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 4px 14px rgba(138, 150, 168, 0.45);
}
.cases-skin-card.cases-rarity-industrial .cases-skin-img-wrap,
.cases-reveal-card.cases-rarity-industrial .cases-skin-img-wrap {
  border: 3px solid #5e98d9;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(94, 152, 217, 0.45);
}
.cases-skin-card.cases-rarity-mil_spec .cases-skin-img-wrap,
.cases-reveal-card.cases-rarity-mil_spec .cases-skin-img-wrap {
  border: 3px solid #4b69ff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 18px rgba(75, 105, 255, 0.5);
}
.cases-skin-card.cases-rarity-restricted .cases-skin-img-wrap,
.cases-reveal-card.cases-rarity-restricted .cases-skin-img-wrap {
  border: 3px solid #8847ff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 20px rgba(136, 71, 255, 0.52);
}
.cases-skin-card.cases-rarity-classified .cases-skin-img-wrap,
.cases-reveal-card.cases-rarity-classified .cases-skin-img-wrap {
  border: 3px solid #d32ce6;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 22px rgba(211, 44, 230, 0.52);
}
.cases-skin-card.cases-rarity-covert .cases-skin-img-wrap,
.cases-reveal-card.cases-rarity-covert .cases-skin-img-wrap {
  border: 3px solid #eb4b4b;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 24px rgba(235, 75, 75, 0.55);
}
.cases-skin-card.cases-rarity-rare_special .cases-skin-img-wrap,
.cases-reveal-card.cases-rarity-rare_special .cases-skin-img-wrap {
  border: 3px solid #e4ae39;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 26px rgba(228, 174, 57, 0.6);
  animation: cases-rarity-frame-pulse 2.4s ease-in-out infinite;
}

@keyframes cases-shine-pulse {
  0%, 100% { filter: brightness(1); box-shadow: 0 6px 30px rgba(228, 174, 57, 0.45); }
  50% { filter: brightness(1.06); box-shadow: 0 8px 36px rgba(255, 210, 120, 0.62); }
}

@keyframes cases-rarity-frame-pulse {
  0%, 100% {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 22px rgba(228, 174, 57, 0.45);
  }
  50% {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 6px 32px rgba(255, 210, 120, 0.75);
  }
}

.cases-skin-shiny {
  position: relative;
  overflow: hidden;
}

.cases-skin-shiny::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    105deg,
    transparent 42%,
    rgba(255, 255, 255, 0.45) 48%,
    rgba(255, 255, 255, 0.75) 50%,
    rgba(255, 255, 255, 0.45) 52%,
    transparent 58%
  );
  animation: cases-shine-sweep 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes cases-shine-sweep {
  0% { transform: translateX(-60%) rotate(12deg); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateX(60%) rotate(12deg); opacity: 0; }
}

.cases-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cases-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: transparent;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
  font-family: inherit;
  text-align: left;
}

.cases-badge-subhint {
  margin-top: 8px;
  margin-bottom: 0;
}

.cases-badge-pill.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Badge picker: rarity ring on thumbnail */
.cases-badge-pill.cases-rarity-consumer img {
  box-shadow: 0 0 0 2px #9aa7b8;
}
.cases-badge-pill.cases-rarity-industrial img {
  box-shadow: 0 0 0 2px #5e98d9;
}
.cases-badge-pill.cases-rarity-mil_spec img {
  box-shadow: 0 0 0 2px #4b69ff;
}
.cases-badge-pill.cases-rarity-restricted img {
  box-shadow: 0 0 0 2px #8847ff;
}
.cases-badge-pill.cases-rarity-classified img {
  box-shadow: 0 0 0 2px #d32ce6;
}
.cases-badge-pill.cases-rarity-covert img {
  box-shadow: 0 0 0 2px #eb4b4b;
}
.cases-badge-pill.cases-rarity-rare_special img {
  box-shadow: 0 0 0 2px #e4ae39;
}

.cases-market-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.cases-market-filter-bar {
  margin-bottom: 12px;
}

.cases-market-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.cases-market-pagination .pagination-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cases-trade-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 10px 0 14px;
}

.cases-trade-status-bar {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, rgba(255, 255, 255, 0.04) 100%, transparent);
}

.cases-trade-status-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.92rem;
}

.cases-trade-status-mid,
.cases-trade-status-end {
  color: var(--muted);
}

.cases-trade-result {
  margin: 8px 0 12px;
}

.cases-trade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

@media (min-width: 480px) {
  .cases-trade-grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 104px));
  }
}

.cases-trade-grid .cases-trade-card {
  cursor: pointer;
  padding: 6px 5px 8px;
}

.cases-trade-grid .cases-trade-card.is-disabled {
  opacity: 0.38;
  cursor: not-allowed;
  filter: grayscale(0.35);
  pointer-events: none;
}

.cases-trade-grid .cases-trade-card.is-selected {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, #5e98d9);
  transform: translateY(-1px);
}

.cases-trade-grid .cases-skin-card .cases-skin-img-wrap {
  margin-bottom: 4px;
}

.cases-trade-grid .cases-skin-card-name strong {
  font-weight: 700;
}

.cases-trade-grid .cases-skin-card-wear {
  font-size: 0.62rem;
  line-height: 1.2;
}

.cases-trade-grid .cases-rarity-pill {
  font-size: 0.5rem;
  padding: 1px 4px;
}

.cases-trade-grid .cases-item-rarity-pills {
  gap: 2px;
  margin: 4px 0 0;
  justify-content: center;
}

.cases-table-wrap {
  overflow-x: auto;
}

.cases-market-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.cases-market-table th,
.cases-market-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--glass-border);
  text-align: left;
}

.cases-modal-root {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cases-modal-root.is-open {
  display: flex;
  background: #000 !important;
}

.cases-modal-backdrop {
  position: absolute;
  inset: 0;
  background: #000 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

.cases-modal {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(90vh, 820px);
  overflow: auto;
  background: linear-gradient(168deg, #151b24 0%, #0a0d12 48%, #0d1118 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, rgba(255, 255, 255, 0.1));
  border-radius: 18px;
  padding: 22px 20px 24px;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  color: #e4eaf2;
}

.cases-modal-x {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cases-modal-x:hover {
  color: #fff;
  background: transparent;
}

.cases-modal-title {
  margin: 0 0 12px;
  padding-right: 36px;
  color: #f4f7fb;
  font-weight: 750;
}

.cases-modal .hint {
  color: rgba(228, 234, 242, 0.62);
}

.cases-modal .action-btn.secondary {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, rgba(255, 255, 255, 0.14));
  color: #f0f4fa;
}

.cases-modal .action-btn.secondary:hover {
  background: transparent;
}

.cases-modal .cases-field input,
.cases-modal .cases-field select {
  background: transparent;
  border-color: color-mix(in srgb, var(--glass-border) 55%, rgba(255, 255, 255, 0.08));
  color: #eef3f9;
}

.cases-modal .cases-field input:focus,
.cases-modal .cases-field select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 1px;
}

/* New listing: readable closed select + option menu (black / white) */
.cases-modal.cases-listing-modal .cases-field select {
  background-color: #0a0a0a;
  color: #fff;
  color-scheme: dark;
  border-color: color-mix(in srgb, var(--glass-border) 40%, rgba(255, 255, 255, 0.2));
}

.cases-modal.cases-listing-modal .cases-field select option {
  background-color: #000;
  color: #fff;
}

.cases-modal.cases-listing-modal .cases-field select option:hover,
.cases-modal.cases-listing-modal .cases-field select option:focus,
.cases-modal.cases-listing-modal .cases-field select option:active {
  background-color: #1c1c1c;
  color: #fff;
}

.cases-modal .cases-list-preview {
  background: transparent;
  border-color: color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, 0.1));
  color: #e4eaf2;
}

.cases-modal .cases-list-preview-type {
  color: rgba(228, 234, 242, 0.55);
}

.cases-modal .cases-contents-cell {
  background: transparent;
  border-color: color-mix(in srgb, var(--accent) 20%, rgba(255, 255, 255, 0.1));
  color: #e8eef8;
}

/* Case contents modal: each cell styled by item rarity; % uses same tier color */
.cases-contents-modal .cases-contents-cell.cases-rarity-consumer {
  border: 2px solid #9aa7b8 !important;
  background: transparent !important;
  box-shadow: 0 4px 22px rgba(154, 167, 184, 0.2) !important;
}
.cases-contents-modal .cases-contents-cell.cases-rarity-industrial {
  border: 2px solid #5e98d9 !important;
  background: transparent !important;
  box-shadow: 0 4px 24px rgba(94, 152, 217, 0.28) !important;
}
.cases-contents-modal .cases-contents-cell.cases-rarity-mil_spec {
  border: 2px solid #4b69ff !important;
  background: transparent !important;
  box-shadow: 0 4px 26px rgba(75, 105, 255, 0.32) !important;
}
.cases-contents-modal .cases-contents-cell.cases-rarity-restricted {
  border: 2px solid #8847ff !important;
  background: transparent !important;
  box-shadow: 0 4px 28px rgba(136, 71, 255, 0.34) !important;
}
.cases-contents-modal .cases-contents-cell.cases-rarity-classified {
  border: 2px solid #d32ce6 !important;
  background: transparent !important;
  box-shadow: 0 4px 28px rgba(211, 44, 230, 0.32) !important;
}
.cases-contents-modal .cases-contents-cell.cases-rarity-covert {
  border: 2px solid #eb4b4b !important;
  background: transparent !important;
  box-shadow: 0 4px 30px rgba(235, 75, 75, 0.38) !important;
}
.cases-contents-modal .cases-contents-cell.cases-rarity-rare_special {
  border: 2px solid #e4ae39 !important;
  background: transparent !important;
  box-shadow: 0 4px 32px rgba(228, 174, 57, 0.45) !important;
  animation: cases-contents-rare-pulse 2.4s ease-in-out infinite;
}

@keyframes cases-contents-rare-pulse {
  0%, 100% { box-shadow: 0 4px 26px rgba(228, 174, 57, 0.35); }
  50% { box-shadow: 0 6px 40px rgba(255, 210, 120, 0.55); }
}

@media (prefers-reduced-motion: reduce) {
  .cases-marquee-item.cases-rarity-rare_special,
  .cases-contents-modal .cases-contents-cell.cases-rarity-rare_special {
    animation: none !important;
  }
}

.cases-contents-modal .cases-contents-cell.cases-rarity-consumer .cases-contents-img-wrap {
  border: 2px solid #9aa7b8;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 12px rgba(154, 167, 184, 0.25);
}
.cases-contents-modal .cases-contents-cell.cases-rarity-industrial .cases-contents-img-wrap {
  border: 2px solid #5e98d9;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 14px rgba(94, 152, 217, 0.3);
}
.cases-contents-modal .cases-contents-cell.cases-rarity-mil_spec .cases-contents-img-wrap {
  border: 2px solid #4b69ff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 16px rgba(75, 105, 255, 0.35);
}
.cases-contents-modal .cases-contents-cell.cases-rarity-restricted .cases-contents-img-wrap {
  border: 2px solid #8847ff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 16px rgba(136, 71, 255, 0.35);
}
.cases-contents-modal .cases-contents-cell.cases-rarity-classified .cases-contents-img-wrap {
  border: 2px solid #d32ce6;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 18px rgba(211, 44, 230, 0.35);
}
.cases-contents-modal .cases-contents-cell.cases-rarity-covert .cases-contents-img-wrap {
  border: 2px solid #eb4b4b;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 18px rgba(235, 75, 75, 0.4);
}
.cases-contents-modal .cases-contents-cell.cases-rarity-rare_special .cases-contents-img-wrap {
  border: 2px solid #e4ae39;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 20px rgba(228, 174, 57, 0.45);
}

.cases-contents-modal .cases-contents-cell.cases-rarity-consumer .cases-contents-pct {
  color: #c5d0de !important;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(154, 167, 184, 0.35);
}
.cases-contents-modal .cases-contents-cell.cases-rarity-industrial .cases-contents-pct {
  color: #8ec5f0 !important;
  font-weight: 800;
  text-shadow: 0 0 14px rgba(94, 152, 217, 0.4);
}
.cases-contents-modal .cases-contents-cell.cases-rarity-mil_spec .cases-contents-pct {
  color: #9cb4ff !important;
  font-weight: 800;
  text-shadow: 0 0 14px rgba(75, 105, 255, 0.45);
}
.cases-contents-modal .cases-contents-cell.cases-rarity-restricted .cases-contents-pct {
  color: #c4a6ff !important;
  font-weight: 800;
  text-shadow: 0 0 14px rgba(136, 71, 255, 0.45);
}
.cases-contents-modal .cases-contents-cell.cases-rarity-classified .cases-contents-pct {
  color: #f0a8ff !important;
  font-weight: 800;
  text-shadow: 0 0 14px rgba(211, 44, 230, 0.4);
}
.cases-contents-modal .cases-contents-cell.cases-rarity-covert .cases-contents-pct {
  color: #ffb0b0 !important;
  font-weight: 800;
  text-shadow: 0 0 16px rgba(235, 75, 75, 0.45);
}
.cases-contents-modal .cases-contents-cell.cases-rarity-rare_special .cases-contents-pct {
  color: #ffe08a !important;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(228, 174, 57, 0.55);
}

.cases-reel-viewport {
  position: relative;
  height: 200px;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, rgba(255, 255, 255, 0.12));
  box-shadow: none;
}

/* Centers item 0 under the pointer when translateX(0); item k centers at translateX(-k * stride) */
.cases-reel-track {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  width: max-content;
  padding-left: calc(50% - 60px);
  padding-right: 80px;
  box-sizing: content-box;
  will-change: transform;
  transition: transform 3.2s cubic-bezier(0.08, 0.82, 0.12, 1);
}

.cases-reel-item {
  flex: 0 0 120px;
  width: 120px;
  height: 160px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.cases-reel-img-wrap {
  width: 100%;
  max-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-bottom: 2px;
  padding: 4px;
  box-sizing: border-box;
}

.cases-reel-img-wrap img {
  max-width: 100%;
  max-height: 82px;
  object-fit: contain;
  display: block;
}

.cases-open-modal .cases-reel-item.cases-rarity-consumer .cases-reel-img-wrap {
  border: 3px solid #9aa7b8;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    0 3px 12px rgba(154, 167, 184, 0.45);
}
.cases-open-modal .cases-reel-item.cases-rarity-industrial .cases-reel-img-wrap {
  border: 3px solid #5e98d9;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    0 3px 12px rgba(94, 152, 217, 0.48);
}
.cases-open-modal .cases-reel-item.cases-rarity-mil_spec .cases-reel-img-wrap {
  border: 3px solid #4b69ff;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    0 3px 14px rgba(75, 105, 255, 0.52);
}
.cases-open-modal .cases-reel-item.cases-rarity-restricted .cases-reel-img-wrap {
  border: 3px solid #8847ff;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    0 3px 14px rgba(136, 71, 255, 0.52);
}
.cases-open-modal .cases-reel-item.cases-rarity-classified .cases-reel-img-wrap {
  border: 3px solid #d32ce6;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    0 3px 14px rgba(211, 44, 230, 0.52);
}
.cases-open-modal .cases-reel-item.cases-rarity-covert .cases-reel-img-wrap {
  border: 3px solid #eb4b4b;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    0 3px 16px rgba(235, 75, 75, 0.55);
}
.cases-open-modal .cases-reel-item.cases-rarity-rare_special .cases-reel-img-wrap {
  border: 3px solid #e4ae39;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    0 3px 16px rgba(228, 174, 57, 0.58);
  animation: cases-reel-img-rare-pulse 2.2s ease-in-out infinite;
}

@keyframes cases-reel-img-rare-pulse {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.06),
      0 3px 14px rgba(228, 174, 57, 0.45);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(0, 0, 0, 0.06),
      0 5px 20px rgba(255, 210, 120, 0.65);
  }
}

.cases-reel-item span {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  margin-top: 4px;
  line-height: 1.15;
}

/* Reel tile shell: soft tint; tier-colored frame matches inventory (on .cases-reel-img-wrap) */
.cases-open-modal .cases-reel-item.cases-rarity-consumer {
  border: 1px solid rgba(154, 167, 184, 0.45);
  background: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.cases-open-modal .cases-reel-item.cases-rarity-industrial {
  border: 1px solid rgba(94, 152, 217, 0.45);
  background: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.cases-open-modal .cases-reel-item.cases-rarity-mil_spec {
  border: 1px solid rgba(75, 105, 255, 0.45);
  background: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.cases-open-modal .cases-reel-item.cases-rarity-restricted {
  border: 1px solid rgba(136, 71, 255, 0.45);
  background: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.cases-open-modal .cases-reel-item.cases-rarity-classified {
  border: 1px solid rgba(211, 44, 230, 0.45);
  background: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.cases-open-modal .cases-reel-item.cases-rarity-covert {
  border: 1px solid rgba(235, 75, 75, 0.45);
  background: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.cases-open-modal .cases-reel-item.cases-rarity-rare_special {
  border: 1px solid rgba(228, 174, 57, 0.5);
  background: transparent;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
}

.cases-reel-pointer {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  z-index: 8;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  width: 32px;
}

.cases-reel-pointer-arrow {
  display: block;
  width: 0;
  height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 16px solid var(--accent);
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.55));
  flex-shrink: 0;
  margin-top: 4px;
}

.cases-reel-pointer-line {
  flex: 1;
  width: 3px;
  min-height: 20px;
  margin-top: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 20%, transparent));
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 60%, transparent);
}

.cases-reveal-panel {
  margin-top: 16px;
  text-align: center;
}

.cases-open-modal .cases-reveal-card .cases-reveal-hero-img {
  width: 180px;
  height: 180px;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.cases-open-modal .cases-reveal-card {
  display: inline-block;
  padding: 16px;
  border-radius: 14px;
  max-width: 280px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, rgba(255, 255, 255, 0.12));
  background: transparent;
  color: #e8eef8;
  box-shadow: none;
}

.cases-open-modal .cases-reveal-card h3 {
  color: #f4f7fb;
}

.cases-open-modal .cases-reveal-card .hint {
  color: rgba(228, 234, 242, 0.58);
}

.cases-reveal-card {
  display: inline-block;
  padding: 16px;
  border-radius: 14px;
  max-width: 280px;
  border: 2px solid rgba(120, 120, 140, 0.35);
  background: transparent;
}

.cases-list-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.cases-field {
  display: grid;
  gap: 4px;
  font-weight: 600;
  font-size: 0.9rem;
}

.cases-field input,
.cases-field select {
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.cases-drop-toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 3000;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(20, 28, 42, 0.96), rgba(35, 48, 72, 0.96));
  color: #e8eef8;
  border: 1px solid rgba(228, 174, 57, 0.55);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  animation: cases-toast-in 0.45s ease;
}

@keyframes cases-toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.cases-drop-toast h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #ffd88a;
}

.cases-drop-toast a {
  color: #9ecbff;
  font-weight: 700;
}

.profile-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.profile-case-mini {
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  padding: 8px;
  font-size: 0.82rem;
  text-align: center;
  background: transparent;
}

.profile-case-mini img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 4px;
  box-sizing: border-box;
}

/* Public profile skin tiles (when cases.css is loaded with profile) */
.profile-case-mini.cases-rarity-consumer img {
  border: 3px solid #9aa7b8;
  box-shadow: 0 3px 12px rgba(154, 167, 184, 0.35);
}
.profile-case-mini.cases-rarity-industrial img {
  border: 3px solid #5e98d9;
  box-shadow: 0 3px 14px rgba(94, 152, 217, 0.4);
}
.profile-case-mini.cases-rarity-mil_spec img {
  border: 3px solid #4b69ff;
  box-shadow: 0 3px 16px rgba(75, 105, 255, 0.45);
}
.profile-case-mini.cases-rarity-restricted img {
  border: 3px solid #8847ff;
  box-shadow: 0 3px 16px rgba(136, 71, 255, 0.45);
}
.profile-case-mini.cases-rarity-classified img {
  border: 3px solid #d32ce6;
  box-shadow: 0 3px 18px rgba(211, 44, 230, 0.45);
}
.profile-case-mini.cases-rarity-covert img {
  border: 3px solid #eb4b4b;
  box-shadow: 0 3px 18px rgba(235, 75, 75, 0.48);
}
.profile-case-mini.cases-rarity-rare_special img {
  border: 3px solid #e4ae39;
  box-shadow: 0 3px 20px rgba(228, 174, 57, 0.5);
}

.profile-market-mini-table {
  width: 100%;
  font-size: 0.86rem;
  border-collapse: collapse;
}

.profile-market-mini-table td,
.profile-market-mini-table th {
  padding: 6px 8px;
  border-bottom: 1px solid var(--glass-border);
  text-align: left;
}

.profile-case-badge-showcase {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: transparent;
}

.profile-case-badge-img {
  border-radius: 10px;
  object-fit: contain;
  background: transparent;
  flex-shrink: 0;
}

.profile-listing-offer {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.profile-listing-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: transparent;
  flex-shrink: 0;
}

.profile-listing-thumb-ph {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  flex-shrink: 0;
}

.profile-listing-type {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
}

/* Rare Special toast — bottom-right when a ★ Rare Special is unboxed */
.cases-toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 24px));
}

.cases-toast-host .cases-toast {
  pointer-events: auto;
}

.cases-toast {
  position: relative;
  width: 100%;
  max-width: 340px;
  border-radius: 16px;
  border: 2px solid #d4a21e;
  background: linear-gradient(155deg, rgba(28, 22, 12, 0.97) 0%, rgba(18, 14, 24, 0.96) 100%);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(228, 174, 57, 0.35),
    0 0 28px rgba(228, 174, 57, 0.22);
  padding: 14px 38px 14px 14px;
  transform: translateX(120%);
  opacity: 0;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
}

.cases-toast.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.cases-toast--rare-special .cases-toast-kicker {
  color: #f0c85c;
}

.cases-toast-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 250, 230, 0.85);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease;
}

.cases-toast-x:hover {
  background: rgba(255, 255, 255, 0.16);
}

.cases-toast-inner {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cases-toast-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #e4ae39;
  box-shadow: 0 4px 14px rgba(228, 174, 57, 0.35);
  background: rgba(0, 0, 0, 0.25);
}

.cases-toast-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cases-toast-thumb--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e4ae39;
  font-size: 1.4rem;
}

.cases-toast-text {
  min-width: 0;
  flex: 1;
}

.cases-toast-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cases-toast-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #fff8eb;
  line-height: 1.25;
  word-break: break-word;
}

.cases-toast-sub {
  font-size: 0.78rem;
  color: rgba(255, 245, 220, 0.72);
  margin-top: 4px;
  line-height: 1.3;
}

/* --- Cases: tablets & phones (layout, touch, no horizontal page scroll) --- */
@media (max-width: 900px) {
  .cases-tablist {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 10px 10px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .cases-tab {
    flex: 0 0 auto;
    padding: 10px 16px;
    min-height: 44px;
    font-size: 0.88rem;
  }

  .cases-tab-panels {
    padding: 12px 12px 16px;
  }

  .cases-hero-preview-strip {
    gap: 6px;
  }

  .cases-hero-preview-tile {
    width: 48px;
    height: 48px;
  }

  /* Marketplace has 4 controls; global .filter-bar is only 3 columns */
  .cases-market-filter-bar.filter-bar {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    gap: 10px;
  }

  .cases-market-filter-bar .filter-input,
  .cases-market-filter-bar .filter-select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }
}

@media (max-width: 640px) {
  .cases-hero h1 {
    font-size: clamp(1.2rem, 5vw, 1.5rem);
    line-height: 1.25;
    flex-wrap: wrap;
  }

  .cases-hero-lead {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .cases-wallet-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .cases-tab-lead {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .cases-shop-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .cases-unopened-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(126px, 100%), 1fr));
  }

  .cases-table-wrap {
    margin: 0 -6px;
    padding: 0 6px;
    -webkit-overflow-scrolling: touch;
  }

  .cases-market-table {
    font-size: 0.84rem;
  }

  .cases-market-table th,
  .cases-market-table td {
    padding: 8px 6px;
    vertical-align: top;
  }

  .cases-market-offer-cell {
    min-width: 0;
  }

  .cases-market-offer {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }

  .cases-market-offer-title {
    word-break: break-word;
  }

  .cases-market-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .cases-market-pagination .pagination-buttons {
    width: 100%;
    justify-content: stretch;
  }

  .cases-market-pagination .pagination-buttons .action-btn {
    flex: 1 1 0;
    min-height: 44px;
  }

  .cases-market-pagination .pagination-info-right {
    text-align: center;
    width: 100%;
  }

  .cases-trade-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cases-trade-actions .action-btn {
    width: 100%;
    justify-content: center;
    min-height: 46px;
  }

  .cases-trade-status-bar {
    padding: 10px 12px;
  }

  .cases-trade-status-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.88rem;
  }

  .cases-market-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .cases-market-toolbar .action-btn {
    width: 100%;
    min-height: 44px;
  }

  .cases-badge-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding: 2px 2px 6px;
    margin: 0 -4px;
    gap: 8px;
  }

  .cases-badge-pill {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 8px 12px;
  }

  .cases-modal-root {
    padding: max(10px, env(safe-area-inset-top, 0px))
      max(10px, env(safe-area-inset-right, 0px))
      max(10px, env(safe-area-inset-bottom, 0px))
      max(10px, env(safe-area-inset-left, 0px));
  }

  .cases-modal {
    width: 100%;
    max-width: none;
    max-height: min(90dvh, 100%);
    padding: 18px 14px 20px;
    border-radius: 14px;
  }

  .cases-modal-title {
    font-size: 1.1rem;
    padding-right: 44px;
  }

  .cases-modal-x {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .cases-list-form {
    max-width: none;
  }

  .cases-contents-modal .cases-modal {
    max-height: min(88dvh, 100%);
  }

  .cases-contents-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(96px, 100%), 1fr));
    gap: 8px;
    max-height: min(55dvh, 420px);
  }

  /* iOS: 16px inputs reduce focus-zoom */
  .cases-modal .cases-field input,
  .cases-modal .cases-field select,
  .cases-market-filter-bar .filter-input,
  .cases-market-filter-bar .filter-select {
    font-size: 16px;
  }

  .cases-shop-qty {
    font-size: 16px;
    min-height: 44px;
  }

  .cases-list-preview-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .cases-open-modal .cases-reveal-card .cases-reveal-hero-img {
    width: min(200px, 72vw);
    height: min(200px, 72vw);
  }
}

@media (max-width: 480px) {
  .cases-tab-panels {
    padding: 10px 10px 14px;
  }

  .cases-reel-viewport {
    height: 168px;
  }

  .cases-reel-track {
    gap: 8px;
    padding-left: calc(50% - 52px);
    padding-right: 64px;
  }

  .cases-reel-item {
    flex: 0 0 104px;
    width: 104px;
    height: 140px;
    padding: 4px;
  }

  .cases-reel-img-wrap {
    max-height: 78px;
  }

  .cases-reel-item span {
    font-size: 0.58rem;
  }

  .cases-unopened-grid,
  .cases-skins-grid:not(.cases-skins-grid--inventory) {
    grid-template-columns: repeat(auto-fill, minmax(min(118px, 100%), 1fr));
  }

  .cases-case-card .cases-inv-case-actions .action-btn,
  .cases-shop-actions .action-btn {
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .cases-toast-host {
    right: 10px;
    bottom: 10px;
    left: 10px;
    align-items: stretch;
    max-width: none;
  }

  .cases-toast {
    max-width: none;
  }
}
