.case-opening { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 27px 0 76px; }
.case-opening__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.case-opening__back { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: .875rem; font-weight: 650; text-decoration: none; }
.case-opening__back:hover { color: var(--soft-gold); }
.case-opening__back:first-letter { color: var(--casino-red); font-size: 22px; }
.case-opening__hero { display: grid; justify-items: center; padding-top: 0; text-align: center; }
.case-opening__eyebrow { color: var(--casino-red); font-size: 13px; font-weight: 650; }
.case-opening__art { width: min(350px, 76vw); height: 205px; margin: -7px 0 -4px; object-fit: contain; filter: drop-shadow(0 22px 28px rgba(0, 0, 0, .5)); }
.case-opening__hero h1 { margin: 0; font-size: 26px; font-weight: 850; line-height: 1.15; }
.case-opening__price { margin: 12px 0 0; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.case-opening__price .case-price__coin { width: 1.125rem; height: 1.125rem; }
.case-opening__controls { width: min(360px, 100%); margin: 20px auto 0; }
.case-opening__error { margin: 12px 0 0; color: var(--casino-red); font-size: .875rem; line-height: 1.6; text-align: center; }
.case-opening__error:empty { display: none; }
.case-opening__actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; }
.case-open-button { display: inline-flex; width: 180px; max-width: 100%; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border: 0; border-radius: var(--radius-control); background: var(--casino-red); color: var(--text); font: inherit; font-size: .9375rem; font-weight: 650; line-height: 1.5; cursor: pointer; transition: background-color 150ms ease, transform 150ms ease; }
.case-open-button:hover { background: var(--red-hover); }
.case-open-button:active { transform: translateY(1px); }
.case-open-button:disabled { cursor: not-allowed; color: var(--text-muted); background: var(--surface-hover); border-color: var(--border); filter: none; }
.case-open-button.is-opening:disabled { cursor: wait; opacity: .7; }
.case-open-button img { width: 18px; height: 18px; }
.case-quick-toggle { display: inline-flex; min-height: 44px; align-items: center; gap: 9px; color: var(--text-secondary); font-size: .875rem; cursor: pointer; user-select: none; }
.case-quick-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.case-quick-toggle__track { position: relative; width: 40px; height: 22px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-hover); transition: background 150ms ease, border-color 150ms ease; }
.case-quick-toggle__track::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); content: ""; transition: transform 150ms ease; }
.case-quick-toggle input:checked + .case-quick-toggle__track { border-color: var(--casino-red); background: var(--casino-red); }
.case-quick-toggle input:checked + .case-quick-toggle__track::after { transform: translateX(18px); }
.case-quick-toggle input:focus-visible + .case-quick-toggle__track { outline: 2px solid var(--soft-gold); outline-offset: 3px; }
.case-quantity { position: relative; display: grid; width: min(320px, 100%); grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 16px auto 0; padding: 4px; border: 0; border-radius: 10px; background: var(--surface); }
.case-quantity::before { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 5); border-radius: 6px; background: var(--casino-red); content: ''; transform: translateX(calc(var(--quantity-index, 0) * 100%)); transition: transform 240ms cubic-bezier(.2,.75,.25,1); pointer-events: none; }
.case-quantity button { position: relative; z-index: 1; min-height: 44px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary); font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; transition: color 160ms ease; }
.case-quantity button:hover, .case-quantity button[aria-pressed="true"] { color: var(--text); }
.case-quantity button:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 5px; }
.case-open-button:focus-visible { outline: 2px solid var(--soft-gold); outline-offset: 3px; }
.case-quantity button:disabled { opacity: .6; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .case-quantity::before, .case-quantity button { transition: none; } }
.case-quick-toggle:has(input:disabled) { opacity: .6; cursor: wait; }
.case-roulette { position: relative; width: min(940px, 100%); margin: 20px auto 0; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--dark-black); box-shadow: inset 0 0 45px rgba(0, 0, 0, .5); }
.case-roulette[hidden] { display: none; }
.case-roulette::before, .case-roulette::after { position: absolute; z-index: 2; top: 0; bottom: 0; width: 12%; content: ""; pointer-events: none; }
.case-roulette::before { left: 0; background: linear-gradient(90deg, var(--dark-black), transparent); }
.case-roulette::after { right: 0; background: linear-gradient(270deg, var(--dark-black), transparent); }
.case-roulette__marker { position: absolute; z-index: 3; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--soft-gold); box-shadow: 0 0 14px rgba(242, 218, 163, .55); }
.case-roulette__marker::before, .case-roulette__marker::after { position: absolute; left: 50%; width: 0; height: 0; border-right: 7px solid transparent; border-left: 7px solid transparent; content: ""; transform: translateX(-50%); }
.case-roulette__marker::before { top: 0; border-top: 9px solid var(--soft-gold); }
.case-roulette__marker::after { bottom: 0; border-bottom: 9px solid var(--soft-gold); }
.case-roulette__lane { position: relative; height: 150px; overflow: hidden; border-bottom: 1px solid var(--border); }
.case-roulette__lane:last-child { border-bottom: 0; }
.case-roulette__track { position: absolute; top: 0; left: calc(50% - 64px); display: flex; height: 100%; gap: 8px; align-items: center; will-change: transform; }
.roulette-item { display: flex; width: 128px; height: 132px; flex: 0 0 128px; align-items: center; flex-direction: column; justify-content: center; gap: 2px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .07); border-radius: 6px; background: linear-gradient(160deg, var(--surface-hover), var(--surface)); text-align: center; }
.roulette-item img { width: 72px; height: 55px; object-fit: contain; }
.roulette-item__nothing-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--red-muted); color: var(--casino-red); font-size: 31px; line-height: 1; }
.roulette-item--nothing { border-color: rgba(var(--red-rgb), .22); }
.roulette-item strong { max-width: 115px; overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.roulette-item__term { max-width: 115px; overflow: hidden; color: var(--text-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.roulette-item__price { display: inline-flex; align-items: center; gap: 3px; color: var(--soft-gold); font-size: 12px; font-variant-numeric: tabular-nums; }
.roulette-item__price img { width: 11px; height: 11px; flex: 0 0 auto; }
.roulette-item.rarity-legendary { border-color: rgba(214, 163, 73, .5); background: linear-gradient(160deg, rgba(100, 67, 28, .3), var(--surface)); }
.roulette-item.rarity-epic { border-color: rgba(var(--red-rgb), .42); }
.roulette-item--winner.is-landed { border-color: var(--soft-gold); box-shadow: 0 0 22px rgba(223, 191, 117, .24); animation: roulette-land 360ms cubic-bezier(.2,.75,.2,1) both; }
@keyframes roulette-land { from { opacity: .72; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.case-contents { margin-top: 42px; }
.case-contents__heading { margin: 0 0 15px; font-size: 20px; text-align: center; }
.case-contents__count { color: var(--text-secondary); font-size: 13px; }
.case-contents__grid { display: grid; width: 100%; max-width: 100%; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.case-content-item { display: grid; min-width: 0; min-height: 190px; grid-template-rows: 82px auto; grid-auto-rows: auto; gap: 8px; align-content: start; justify-items: center; padding: 11px 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); text-align: center; }
.case-content-item__art { display: grid; width: 100%; place-items: center; }
.case-content-item__art img { max-width: 100%; width: 108px; height: 76px; object-fit: contain; }
.case-content-item__name { display: block; max-width: 100%; overflow-wrap: anywhere; color: var(--text); font-size: .9375rem; font-weight: 650; line-height: 1.3; white-space: normal; }
.case-content-item.rarity-nothing .case-content-item__name { transform: translateY(5px); }
.case-content-item__type { max-width: 100%; overflow: hidden; color: var(--text-secondary); font-size: .875rem; font-weight: 500; line-height: 1.35; text-overflow: ellipsis; white-space: normal; }
.case-content-item__price { display: flex; align-items: center; gap: 4px; margin-top: 6px; color: var(--soft-gold); font-size: .875rem; font-weight: 650; }
.case-content-item__price img { width: 14px; height: 14px; }
.case-content-item__nothing { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 50%; background: var(--red-muted); color: var(--casino-red); font-size: 38px; font-weight: 400; line-height: 1; }
.case-content-item.rarity-nothing { border-bottom-color: var(--casino-red); }
.case-content-item.rarity-legendary { border-bottom-color: var(--soft-gold); }
.case-content-item.rarity-epic { border-bottom-color: var(--casino-red); }
.case-content-item.rarity-rare { border-bottom-color: var(--casino-red); }
@media (max-width: 760px) {
  .case-opening { width: min(100% - 32px, 560px); padding-top: 21px; }
  .case-opening__art { height: 180px; }
  .case-opening__hero h1 { font-size: 23px; }
  .case-contents { margin-top: 32px; }
  .case-contents__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .case-opening { width: calc(100% - 24px); }
  .case-opening__actions { gap: 11px; }
  .case-quick-toggle { gap: 6px; font-size: 13px; }

}

.case-contents__grid[data-count="2"] { max-width: 600px; margin-inline: auto; }
