/* Cases and custom models */
.cs-flash { padding: 12px 16px; margin-bottom: 18px; border: 1px solid var(--line); font-size: 14px; }
.cs-flash.ok { border-color: #3c7a4a; background: rgba(60,122,74,0.12); }
.cs-flash.err { border-color: #9a3b3b; background: rgba(154,59,59,0.12); }

.cs-wallet { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.cs-chip { display: inline-flex; align-items: baseline; gap: 7px; padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--text-dim); }
.cs-chip i { font-style: normal; color: var(--cc, #fff); display: inline-flex; align-items: center; gap: 6px; }
.cs-chip i::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--cc, #fff); }
.cs-chip b { color: var(--text); font-family: 'Rajdhani', sans-serif; font-size: 20px; line-height: 1; }

.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.cs-card { display: block; background: var(--surface); border: 1px solid var(--line); text-decoration: none; transition: border-color .15s, transform .15s; }
.cs-card:hover { border-color: var(--text); transform: translateY(-2px); }
.cs-card-img { aspect-ratio: 4 / 3; background: radial-gradient(circle at 50% 40%, #202020, #0d0d0d); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cs-card-img img { max-width: 80%; max-height: 80%; object-fit: contain; }
.ph { display: flex; align-items: center; justify-content: center; font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 54px; color: var(--text-dim); }
.cs-card-body { padding: 14px 16px 16px; }
.cs-card-name { font-family: 'Rajdhani', sans-serif; font-size: 21px; font-weight: 700; }
.cs-card-desc { font-size: 12.5px; color: var(--text-dim); margin: 3px 0 10px; }
.cs-card-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 8px; font-size: 12px; }
.cs-price { color: var(--cc, #fff); font-weight: 600; font-size: 14px; }
.dim { color: var(--text-dim); }

.cs-recent { border: 1px solid var(--line); background: var(--surface); }
.cs-recent-row { padding: 10px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line); display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.cs-recent-row:last-child { border-bottom: 0; }
.cs-recent-row .dot { width: 8px; height: 8px; border-radius: 50%; align-self: center; }

/* Opening */
.cs-open { margin-top: 14px; }
.cs-open-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.cs-btn { display: inline-block; background: #fff; color: #080808; border: 0; padding: 13px 26px; font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: .03em; cursor: pointer; text-decoration: none; }
.cs-btn:hover { background: #ddd; }
.cs-btn:disabled { opacity: .45; cursor: not-allowed; }
.cs-btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.cs-btn.ghost:hover { border-color: var(--text); }
.cs-fine { font-size: 12.5px; }
.cs-err { margin-top: 12px; padding: 11px 14px; border: 1px solid #9a3b3b; background: rgba(154,59,59,.12); font-size: 14px; }

.cs-reel { position: relative; overflow: hidden; border: 1px solid var(--line); background: #0b0b0b; padding: 14px 0; }
.cs-reel[hidden] { display: none; }
.cs-reel::before, .cs-reel::after { content: ''; position: absolute; top: 0; bottom: 0; width: 80px; z-index: 2; pointer-events: none; }
.cs-reel::before { left: 0; background: linear-gradient(90deg, #0b0b0b, transparent); }
.cs-reel::after { right: 0; background: linear-gradient(-90deg, #0b0b0b, transparent); }
.cs-pointer { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #fff; z-index: 3; box-shadow: 0 0 12px rgba(255,255,255,.7); }
.cs-track { display: flex; gap: 8px; will-change: transform; }
.cs-rc { flex: 0 0 128px; height: 150px; border: 1px solid var(--line); border-bottom: 3px solid var(--rc); background: linear-gradient(180deg, #181818, #101010); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; }
.cs-rc img { max-width: 100%; max-height: 92px; object-fit: contain; }
.cs-rc .ph { font-size: 44px; height: 92px; }
.cs-rc .n { font-size: 12px; text-align: center; line-height: 1.2; overflow: hidden; max-height: 30px; }

.cs-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.cs-item { background: var(--surface); border: 1px solid var(--line); border-bottom: 3px solid var(--rc, var(--line)); padding: 14px 12px; text-align: center; min-width: 0; }
.ci-img { display: block; margin: 0 auto 10px; max-width: 100%; height: 96px; object-fit: contain; }
.ci-img.ph { font-size: 46px; }
.ci-img.sm { height: 48px; width: 48px; margin: 0; }
.ci-img.sm.ph { font-size: 26px; }
.cs-item-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.cs-item-meta { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.cs-item-team { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.cs-item-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.cs-item-actions form { margin: 0; }
.cs-mini { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 12px; padding: 6px 10px; cursor: pointer; font-family: 'Inter', sans-serif; }
.cs-mini:hover { border-color: #fff; }
.cs-on { font-size: 12px; padding: 6px 10px; border: 1px solid #3c7a4a; color: #5fd38a; }
.cs-link { background: none; border: 0; color: var(--text-dim); text-decoration: underline; cursor: pointer; font-size: 12.5px; font-family: 'Inter', sans-serif; }

.cs-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 28px; }
.cs-slot { background: var(--surface); border: 1px solid var(--line); padding: 14px 16px; min-width: 0; }
.cs-slot-h { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 10px; }
.cs-slot-body { display: flex; align-items: center; gap: 12px; border-left: 3px solid var(--rc); padding-left: 12px; }
.cs-slot-body > div { flex: 1; min-width: 0; }

/* Result popup */
.cs-modal { position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.cs-modal[hidden] { display: none; }
.cs-modal-box { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--rc, var(--line)); box-shadow: 0 0 40px color-mix(in srgb, var(--rc, #fff) 35%, transparent); padding: 24px 22px; text-align: center; }
.cs-modal-title { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: .1em; text-transform: uppercase; }
#resImg { display: flex; justify-content: center; margin: 16px 0 10px; }
#resImg .cs-rc { flex-basis: 150px; height: 170px; }
.cs-modal-name { font-family: 'Rajdhani', sans-serif; font-size: 28px; font-weight: 700; }
.cs-modal-sub { font-size: 13.5px; color: var(--text-dim); margin: 6px 0 18px; }
.cs-modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cs-modal-actions .cs-btn { padding: 10px 18px; font-size: 16px; }

@media (max-width: 640px) {
  .cs-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .cs-card-body { padding: 10px 12px 12px; }
  .cs-card-name { font-size: 18px; }
  .cs-items { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cs-rc { flex-basis: 104px; height: 128px; }
  .cs-btn { width: 100%; text-align: center; }
  .cs-open-bar { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) { .cs-card { transition: none; } }
