/* ---------- case screen ---------- */
.cs-head { position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; margin: 4px 0 6px; }
.cs-back {
  position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line);
}
.cs-back svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cs-head h1 { margin: 0; font-size: 22px; text-align: center; padding: 0 50px; }

.cs-stage { position: relative; min-height: 210px; display: flex; align-items: center; justify-content: center; }
.cs-art {
  width: 220px; height: 210px;
  background: radial-gradient(closest-side, rgba(139, 92, 246, .45), transparent 80%);
}
.cs-art svg, .cs-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .6)); }

.cs-controls { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; }
.cs-count { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.cs-count button { width: 46px; height: 34px; border-radius: 10px; font-weight: 700; color: var(--muted); }
.cs-count button.on { color: var(--text); background: #221b36; box-shadow: inset 0 0 0 1px #6d4fc2; }
.cs-fast { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #c4c1d4; }

.cs-open {
  width: 100%; height: 54px; border-radius: 16px; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(180deg, #a07bff, #7c4ff0); box-shadow: 0 8px 24px rgba(124, 79, 240, .35);
}
.cs-open .coin { width: 20px; height: 20px; }
.cs-open:disabled { opacity: .6; box-shadow: none; }
.cs-open.poor:not(:disabled) { opacity: .7; }
.cs-open:not(:disabled):active { transform: scale(.985); }

.cs-sub { margin: 22px 0 10px; font: 700 13px Inter, sans-serif; letter-spacing: .04em; color: var(--muted); }

/* ---------- item cards (case contents, results, inventory) ---------- */
.items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.item {
  position: relative; display: flex; flex-direction: column; padding: 8px 8px 10px; border-radius: 14px;
  background: radial-gradient(90% 70% at 50% 30%, color-mix(in srgb, var(--r) 30%, transparent), transparent 75%), var(--card);
  border: 1px solid var(--line); border-bottom: 3px solid var(--r);
}
.item-art { aspect-ratio: 1 / 1; }
.item-art svg, .item-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
.item b { font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-price { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #c4c1d4; margin-top: 2px; }
.item-price .coin { width: 14px; height: 14px; }
.item-chance {
  position: absolute; top: 6px; right: 6px; padding: 1px 6px; border-radius: 6px;
  font-size: 10px; font-weight: 700; color: var(--r); background: rgba(13, 12, 18, .7);
}
.item-sell {
  margin-top: 8px; height: 30px; border-radius: 9px; font-size: 12px; font-weight: 700;
  background: #2b2342; border: 1px solid #4b3d72;
}
.item-sell:disabled { opacity: .5; }

/* ---------- roulette ---------- */
.cs-rolls { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.roll {
  position: relative; height: 128px; overflow: hidden; border-radius: 14px;
  background: #121118; border: 1px solid var(--line);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.cs-rolls .roll:nth-child(n+2) { height: 96px; }
.roll-strip { display: flex; gap: 8px; height: 100%; padding: 8px 0; will-change: transform; }
.roll-tile {
  flex: none; width: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px; border-radius: 12px; border-bottom: 3px solid var(--r);
  background: radial-gradient(80% 70% at 50% 35%, color-mix(in srgb, var(--r) 32%, transparent), transparent 75%), var(--card);
}
.roll-tile .item-art { width: 70%; }
.cs-rolls .roll:nth-child(n+2) .roll-tile .item-art { width: 56%; }
.roll-tile b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.roll-mark {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-1px);
  background: #fbbf24; box-shadow: 0 0 12px #fbbf24;
}

/* ---------- result ---------- */
.cs-result {
  margin-top: 12px; padding: 12px; border-radius: var(--radius);
  background: var(--card); border: 1px solid #4b3d72; animation: slideUp .3s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } }
.cs-result-title { font: 700 18px Oswald, sans-serif; text-align: center; margin-bottom: 10px; }
.cs-result .items-1 { grid-template-columns: minmax(0, 160px); justify-content: center; }
.cs-result .items-2 { grid-template-columns: repeat(2, minmax(0, 150px)); justify-content: center; }
.cs-result-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.cs-sell, .cs-keep {
  height: 46px; border-radius: 12px; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.cs-sell { background: linear-gradient(180deg, #4ade80, #16a34a); }
.cs-sell .coin { width: 16px; height: 16px; }
.cs-keep { background: #2b2342; border: 1px solid #4b3d72; }

/* ---------- inventory ---------- */
.inv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 0 12px; }
.inv-head span { display: flex; align-items: center; gap: 4px; color: #c4c1d4; font-weight: 600; font-size: 13px; }
.inv-head .coin { width: 15px; height: 15px; }
.inv-tools { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
.inv-sellall {
  height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 700; font-size: 13px;
  background: linear-gradient(180deg, #4ade80, #16a34a);
}
.inv-sellall.confirm { background: linear-gradient(180deg, #f87171, #dc2626); }
.inv-empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 40px 16px; text-align: center; color: var(--muted); font-size: 13px;
}
.inv-more { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 12px; padding: 6px; }

@media (max-width: 360px) {
  .items { gap: 6px; }
  .item b { font-size: 11.5px; }
}
