/* Flow Mini App — кейсы */

.cases-mark {
  background: linear-gradient(135deg, #f5b301, #ff4d6d 60%, #a855f7);
}

.sub-badge {
  flex-shrink: 0;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--flow);
  background: var(--flow-soft);
  white-space: nowrap;
}

.cases-root {
  padding-bottom: 10px;
}

.float {
  animation: caseFloat 3.6s ease-in-out infinite;
}

@keyframes caseFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(1deg); }
}

.case-art-svg {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.28));
}

.wing-l { transform-origin: 62px 104px; animation: flapL 1.6s ease-in-out infinite; }
.wing-r { transform-origin: 138px 104px; animation: flapR 1.6s ease-in-out infinite; }
@keyframes flapL { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(10deg); } }
@keyframes flapR { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-10deg); } }

.safe-dial { transform-origin: 96px 103px; animation: dialSpin 6s ease-in-out infinite; }
@keyframes dialSpin { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(120deg); } 60% { transform: rotate(-40deg); } }
.safe-ring { animation: ringGlow 2.4s ease-in-out infinite; }
@keyframes ringGlow { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

/* ---------- Бесплатный кейс ---------- */
.free-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  width: calc(100% - 28px);
  margin: 4px 14px 0;
  padding: 12px 16px 12px 4px;
  border-radius: 24px;
  text-align: left;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 15% 30%, rgba(255, 255, 255, 0.28), transparent 50%),
    linear-gradient(135deg, var(--ca), var(--cb));
  box-shadow: 0 12px 30px -14px var(--cg);
}

.free-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 45%, transparent 60%);
  transform: translateX(-100%);
}

.free-card.ready::after {
  animation: shine 2.8s ease-in-out infinite;
}

@keyframes shine {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

.free-art {
  flex-shrink: 0;
}

.free-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.free-kicker {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
}

.free-title {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.free-sub {
  font-size: 13px;
  opacity: 0.92;
}

.free-cta {
  align-self: flex-start;
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--cb);
  background: #fff;
}

/* ---------- Платные кейсы ---------- */
.case-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 14px;
}

.case-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 132px;
  padding: 12px 14px 12px 4px;
  border-radius: 24px;
  text-align: left;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(90% 120% at 10% 40%, var(--cg), transparent 60%),
    linear-gradient(140deg, #141b2b, #0b1020 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 14px 30px -18px var(--cg);
  transition: transform 0.15s ease;
}

.case-card:active,
.free-card:active {
  transform: scale(0.985);
}

.case-card::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ca), transparent 70%);
  opacity: 0.18;
}

.case-card-art {
  flex-shrink: 0;
  margin: -6px -2px -6px 0;
}

.case-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.case-name {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.case-tag {
  font-size: 12.5px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.68);
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.chance-pill,
.top-pill {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
}

.chance-pill b {
  color: #fff;
}

.top-pill {
  color: var(--rc);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 45%, transparent);
  background: color-mix(in srgb, var(--rc) 14%, transparent);
}

.case-buyrow {
  /* кнопка тянется, плашка звёзд фиксированной ширины — во всех карточках одинаково */
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
}

.case-stars,
.cs-stars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.case-stars {
  padding: 8px 12px 8px 10px;
  border-radius: 12px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  line-height: normal;
  color: #ffd36a;
  background: rgba(245, 179, 1, 0.12);
  box-shadow: inset 0 0 0 1px rgba(245, 179, 1, 0.42);
}

.star-ico {
  flex: none;
  color: #f5b301;
  filter: drop-shadow(0 0 6px rgba(245, 179, 1, 0.45));
}

.case-price {
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: 12px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  color: #0b1020;
  background: linear-gradient(135deg, #fff, #dfe6ff);
}

.case-price.has {
  color: #fff;
  background: linear-gradient(135deg, #22c55e, #15803d);
}

/* ---------- Лента выигрышей ---------- */
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: livePulse 1.8s infinite;
  align-self: center;
}

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 14px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--line);
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface);
}

.feed-art {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
}

.feed-art .case-art-svg {
  filter: none;
}

.feed-text {
  display: flex;
  flex-direction: column;
  font-size: 13.5px;
  line-height: 1.3;
  color: var(--ink-2);
}

.feed-text b {
  color: var(--ink);
  font-weight: 600;
}

.feed-text .feed-prize {
  color: var(--rc);
}

.feed-case {
  font-size: 12px;
  color: var(--ink-3);
}

.cases-foot {
  margin: 16px 18px 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-3);
}

/* ---------- Лист кейса ---------- */
.case-sheet {
  padding: 0 0 calc(14px + var(--safe-bottom));
  overflow: hidden;
}

.cs-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 18px 16px;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(70% 80% at 50% 30%, var(--cg), transparent 70%),
    linear-gradient(160deg, #141b2b, #0b1020);
}

.cs-close {
  position: absolute;
  right: 12px;
  top: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.cs-title {
  margin-top: 4px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cs-tag {
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.cs-chance {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.cs-chance b {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.cs-chance span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.cs-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px 4px;
  max-height: 36vh;
  overflow-y: auto;
}

.cs-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
}

.cs-ico {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--rc);
  background: color-mix(in srgb, var(--rc) 15%, transparent);
}

.cs-label {
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.cs-label small {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--rc);
}

.cs-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}

.cs-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--rc);
}

.cs-pct {
  text-align: right;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cs-note {
  margin: 6px 18px 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.pity {
  margin: 8px 16px 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-2);
}

.pity-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
}

.pity-head b {
  font-family: var(--display);
  color: var(--flow);
}

.pity-bar {
  height: 7px;
  margin: 8px 0 6px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}

.pity-bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--flow), #a855f7);
  transition: width 0.4s var(--ease);
}

.pity small {
  font-size: 12px;
  color: var(--ink-3);
}

.cs-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 0;
}

.btn-case {
  width: 100%;
  height: 54px;
  border-radius: 17px;
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #5b7cff, #a855f7);
  box-shadow: 0 10px 24px -12px rgba(120, 90, 255, 0.8);
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn-case:active {
  transform: scale(0.98);
}

.btn-case:disabled {
  opacity: 0.5;
  box-shadow: none;
}

.btn-link {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--flow);
}

.pay-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  font-size: 13px;
  color: var(--ink-2);
}

.spin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--flow);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Сцена открытия ---------- */
.case-stage {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05070d;
  color: #fff;
  overflow: hidden;
  animation: viewEnter 0.25s ease;
}

.stage-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(40% 35% at 50% 45%, var(--cg), transparent 70%);
  transition: background 0.5s ease;
}

.stage-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-conic-gradient(from 0deg at 50% 45%, rgba(255, 255, 255, 0.06) 0deg 8deg, transparent 8deg 20deg);
  animation: rays 18s linear infinite;
  mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 55%);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 55%);
}

@keyframes rays {
  to { transform: rotate(360deg); }
}

.stage-glow.g-miss { background: radial-gradient(40% 35% at 50% 45%, rgba(123, 132, 150, 0.35), transparent 70%); }
.stage-glow.g-common { background: radial-gradient(40% 35% at 50% 45%, rgba(143, 179, 217, 0.45), transparent 70%); }
.stage-glow.g-rare { background: radial-gradient(45% 40% at 50% 45%, rgba(79, 124, 255, 0.6), transparent 70%); }
.stage-glow.g-epic { background: radial-gradient(50% 45% at 50% 45%, rgba(168, 85, 247, 0.7), transparent 70%); }
.stage-glow.g-legendary { background: radial-gradient(55% 50% at 50% 45%, rgba(245, 179, 1, 0.75), transparent 72%); }

.case-confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.stage-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 var(--safe-bottom);
}

.stage-case.shake {
  animation: caseShake 1.1s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes caseShake {
  0% { transform: scale(0.85); }
  15% { transform: scale(1) rotate(-4deg); }
  25% { transform: rotate(5deg); }
  35% { transform: rotate(-6deg); }
  45% { transform: rotate(6deg); }
  55% { transform: rotate(-5deg) scale(1.04); }
  70% { transform: rotate(3deg) scale(1.08); }
  85% { transform: scale(1.18); opacity: 1; filter: brightness(1.4); }
  100% { transform: scale(1.35); opacity: 0; filter: brightness(2.2); }
}

.stage-hint {
  margin-top: 18px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.roulette {
  position: relative;
  width: 100%;
  animation: viewEnter 0.3s ease;
}

.roul-window {
  overflow: hidden;
  padding: 18px 0;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}

.roul-strip {
  display: flex;
  will-change: transform;
}

.roul-marker {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  margin-left: -1.5px;
  z-index: 2;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
}

.roul-marker::before,
.roul-marker::after {
  content: '';
  position: absolute;
  left: 50%;
  margin-left: -8px;
  border: 8px solid transparent;
}

.roul-marker::before { top: -2px; border-top-color: #fff; }
.roul-marker::after { bottom: -2px; border-bottom-color: #fff; }

.tile {
  flex: 0 0 104px;
  height: 128px;
  margin: 0 4px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #fff;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--rc) 30%, #10162a), #0c1122 85%);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rc) 55%, transparent), inset 0 -4px 0 var(--rc);
  transition: transform 0.35s cubic-bezier(.3, 1.6, .5, 1), box-shadow 0.35s ease;
}

.tile-ico {
  color: var(--rc);
  margin-bottom: 2px;
}

.tile-num {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.tile-unit {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
}

.tile.r-miss .tile-num { color: rgba(255, 255, 255, 0.45); }

.tile.won {
  transform: scale(1.1);
  box-shadow: inset 0 0 0 2px var(--rc), inset 0 -4px 0 var(--rc), 0 0 28px var(--rc);
}

.stage-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
  text-align: center;
}

.res-card {
  width: 190px;
  padding: 18px 16px 20px;
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 35%, #10162a), #0c1122 90%);
  box-shadow: inset 0 0 0 2px var(--rc), 0 0 60px -10px var(--rc);
  animation: resPop 0.6s cubic-bezier(.2, 1.6, .4, 1) both;
}

@keyframes resPop {
  from { transform: scale(0.5) rotate(-6deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.res-rarity {
  font-size: 12px;
  font-weight: 700;
  color: var(--rc);
}

.res-ico {
  color: var(--rc);
  transform: scale(1.5);
  margin: 10px 0 6px;
}

.res-num {
  font-family: var(--display);
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
}

.r-miss .res-num { color: rgba(255, 255, 255, 0.5); }

.res-unit {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.res-title {
  margin-top: 22px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  animation: viewEnter 0.5s ease 0.2s both;
}

.res-sub {
  margin-top: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  animation: viewEnter 0.5s ease 0.3s both;
}

.res-sub b {
  color: #fff;
}

.res-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 340px;
  margin-top: 26px;
  animation: viewEnter 0.5s ease 0.45s both;
}

.res-actions .btn-link,
.case-stage .btn-link {
  color: rgba(255, 255, 255, 0.8);
}

.stage-err {
  margin-bottom: 20px;
  font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .float, .wing-l, .wing-r, .safe-dial, .safe-ring, .stage-glow::before { animation: none !important; }
}

/* ---------- Чёрный ящик ---------- */
.bb-beacon { animation: bbBeacon 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bbBeacon { 0%, 100% { opacity: .15; transform: scale(.6); } 45% { opacity: 1; transform: scale(1.15); } }

/* ---------- Колесо недели ---------- */
.wheel-svg { filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.45)); }
.wheel-svg .wheel-disc { transform-box: fill-box; transform-origin: center; will-change: transform; }
.wheel-idle .wheel-disc { animation: wheelIdle 24s linear infinite; }
@keyframes wheelIdle { to { transform: rotate(360deg); } }

.wheel-svg .wl {
  font-family: var(--display, Unbounded, sans-serif);
  font-weight: 800;
  fill: #fff;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 2px;
}
.wheel-svg .wl-miss { fill: rgba(255, 255, 255, 0.35); stroke: none; font-weight: 600; }
.wheel-svg .r-legendary .wl { fill: #5a3a00; stroke: none; }
.wheel-svg .r-legendary path { filter: drop-shadow(0 0 4px rgba(255, 210, 60, 0.9)); }
.wheel-svg .hub-txt {
  font-family: var(--display, Unbounded, sans-serif);
  font-size: 10px;
  font-weight: 800;
  fill: #5a3a00;
  letter-spacing: 0.5px;
}
.wheel-mini .hub-txt { font-size: 16px; }

.wheel-svg .bulb { fill: #ffe9a3; }
.wheel-svg .bulb.b1 { animation: bulb 1.6s steps(1) infinite; }
.wheel-svg .bulb.b2 { animation: bulb 1.6s steps(1) infinite 0.8s; }
.wheel-svg.spinning .bulb.b1 { animation-duration: 0.28s; }
.wheel-svg.spinning .bulb.b2 { animation-duration: 0.28s; animation-delay: 0.14s; }
@keyframes bulb {
  0% { fill: #fff6c9; filter: drop-shadow(0 0 3px #ffd34d); }
  50% { fill: #6b5418; filter: none; }
}
.wheel-svg.landed .bulb { animation: bulbWin 0.45s steps(1) infinite; }
@keyframes bulbWin { 0% { fill: #fff; } 50% { fill: #ffd34d; } }

.wheel-svg .wheel-pin { transform-box: fill-box; transform-origin: 50% 0%; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.wheel-svg .wheel-pin.tick { animation: pinTick 0.14s ease-out; }
@keyframes pinTick { 0% { transform: rotate(0); } 35% { transform: rotate(-16deg); } 100% { transform: rotate(0); } }

.wheel-svg.landed .wseg:not(.won) path,
.wheel-svg.landed-miss .wseg:not(.won):not(.almost) path { opacity: 0.35; transition: opacity 0.5s ease; }
.wheel-svg .wseg.won path { animation: segWin 0.6s ease-in-out 3; }
@keyframes segWin { 50% { filter: brightness(1.8) drop-shadow(0 0 10px #fff); } }
.wheel-svg .wseg.almost path { animation: segWin 0.9s ease-in-out 2; }

.wheel-stage {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  animation: wheelIn 0.5s cubic-bezier(.2, 1.3, .4, 1) both;
}
.wheel-stage .wheel-svg { width: min(86vw, 340px); height: auto; }
@keyframes wheelIn { from { transform: scale(0.6) rotate(-20deg); opacity: 0; } }

.free-art.wheel-idle { padding: 4px 6px 4px 10px; }
.cs-art.wheel-idle { display: block; margin: 0 auto; }

/* ---------- Вероятность словами ---------- */
.cs-odds {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.cs-odds.lvl-1, .cs-odds.lvl-0 { color: var(--rc); }
.cs-signal { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.cs-signal i { display: block; width: 4px; border-radius: 1.5px; background: var(--surface-2); }
.cs-signal i.on { background: var(--rc); }
.cs-signal i.faint { opacity: .45; }

/* ── покупка: количество и кнопка «Купить» ── */
.cs-buy {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 6px;
  border-radius: 17px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.qty-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.qty-btn:disabled {
  opacity: 0.35;
}

.qty-val {
  min-width: 48px;
  text-align: center;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.btn-case-soft {
  width: 100%;
  height: 50px;
  border-radius: 17px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: rgba(91, 124, 255, 0.18);
  border: 1px solid rgba(91, 124, 255, 0.35);
}

.btn-case-soft:disabled {
  opacity: 0.5;
}

.cs-stars {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
}

.cs-stars b {
  color: var(--ink);
  font-weight: 600;
}

.case-buyrow .case-price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 0;
  padding: 8px 10px;
  white-space: nowrap;
}

.case-buyrow .case-price.has {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 8px 14px;
}

.case-buyrow .case-stars {
  padding: 8px 6px;
  white-space: nowrap;
}

/* ожидание бесплатной прокрутки: одна строка, текст читается (не серый на градиенте) */
.btn-case.btn-wait {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}

/* блок действий в карточке кейса: ничего не сжимается, ровные отступы */
.cs-actions {
  gap: 10px;
}

.cs-actions > *,
.cs-buy > * {
  flex-shrink: 0;
}

/* «Открыть» сверху, покупка ниже — отделяем тонкой линией */
.cs-actions .btn-case + .cs-buy {
  /* при «Открыть» покупка — второстепенная */
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* число и «д/ч» таймера не разрываются переносом */
#free-countdown {
  white-space: nowrap;
}

.btn-case-soft {
  padding: 0 16px;
  line-height: 1;
}

.btn-case-soft:active {
  transform: scale(0.98);
}

/* карточка кейса: скроллится целиком, все призы видны, кнопки всегда внизу */
.case-sheet {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 0;
}

.case-sheet > * {
  flex-shrink: 0;
}

.case-sheet .cs-list {
  max-height: none;
  overflow: visible;
}

.case-sheet .cs-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: 6px;
  padding: 18px 16px calc(14px + var(--safe-bottom));
  background: linear-gradient(to bottom, transparent, var(--surface) 18px);
}

/* шанс приза: только шкала из полосок, без слов */
.cs-signal { gap: 3px; height: 18px; }
.cs-signal i { width: 5px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 13%, transparent); }
.cs-signal i.on { background: var(--rc); }
