:root {
  --bg: #07080d;
  --bg-2: #0b0d16;
  --panel: #10131f;
  --panel-2: #141826;
  --line: #1e2333;
  --text: #eef1f8;
  --muted: #8b91a6;
  --violet: #8b5cf6;
  --violet-2: #a78bfa;
  --teal: #2dd4bf;
  --green: #22c55e;
  --gold: #f5b027;
  --pink: #f43f5e;

  /* rarity colors */
  --r-common: #6b7280;
  --r-uncommon: #4f7dd6;
  --r-rare: #7b5cff;
  --r-mythic: #d946ef;
  --r-legendary: #f59e0b;
  --r-gold: #ffd54a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: "Rubik", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(139,92,246,.10), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(45,212,191,.06), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ---------- LIVE STRIP ---------- */
.live-strip {
  display: flex;
  align-items: stretch;
  height: 92px;
  background: linear-gradient(180deg, #0a0c14, #070810);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.live-strip__labels {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 0 16px;
  border-right: 1px solid var(--line);
  min-width: 66px;
}
.live-strip__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--muted);
}
.live-strip__label--top { color: var(--gold); position: relative; padding-left: 12px; }
.live-strip__label--top::before {
  content: "\2605"; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  font-size: 9px; color: var(--gold);
}
.live-strip__label--live { color: var(--green); position: relative; padding-left: 12px; }
.live-strip__label--live::before {
  content: "";
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.4s infinite;
}
.live-strip__viewport { flex: 1; overflow: hidden; position: relative; }
.live-strip__track {
  display: flex;
  gap: 8px;
  padding: 10px 8px;
  height: 100%;
  width: max-content;
  animation: marquee 60s linear infinite;
}
.live-strip__track:hover { animation-play-state: paused; }
.drop {
  width: 92px; height: 70px;
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.05);
  background: #0e1119;
  flex: 0 0 auto;
}
.drop::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 0%, var(--rc, #333), transparent 70%);
  opacity: .45;
}
.drop__img {
  position: relative;
  height: 38px;
  margin: 0 auto;
  width: 80px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.6));
}
.drop__name {
  position: relative;
  font-size: 9px;
  color: #cdd2e0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- HEADER ---------- */
.header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(8,9,15,.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  max-width: 1180px; margin: 0 auto;
  height: 66px;
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.header__left { display: flex; align-items: center; gap: 18px; }
.header__right { display: flex; align-items: center; gap: 14px; }

.logo {
  display: inline-flex; align-items: center; text-decoration: none;
}
.logo-img { height: 46px; width: auto; display: block; }
.logo--sm .logo-img { height: 34px; }

.online { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.online__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
  animation: pulse 1.6s infinite;
}
.online__label { color: var(--muted); }
.online__count { color: #fff; font-weight: 700; }

/* ---------- LANGUAGE SWITCHER ---------- */
.lang-wrap { position: relative; }
.lang {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line); color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; border-radius: 999px;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.lang:hover { background: rgba(255, 255, 255, .08); border-color: #2c3348; }
.lang-wrap.is-open .lang {
  background: rgba(139, 92, 246, .12);
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .14);
}
.lang__code { letter-spacing: .5px; }
.lang__flag {
  width: 22px; height: 15px; flex: none; border-radius: 3px; overflow: hidden;
  display: inline-flex; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 1px 2px rgba(0, 0, 0, .35);
}
.lang__flag svg, .lang-menu__item .flag svg { width: 100%; height: 100%; display: block; }
.lang__caret { display: inline-flex; width: 11px; color: var(--muted); transition: transform .2s ease; }
.lang__caret svg { width: 100%; }
.lang-wrap.is-open .lang__caret { transform: rotate(180deg); color: var(--violet-2); }

.lang-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  min-width: 190px; padding: 6px;
  background: rgba(20, 24, 38, .92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid #262c40; border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05);
  display: flex; flex-direction: column; gap: 3px;
  transform-origin: top right;
  animation: langMenuIn .16s cubic-bezier(.2, .8, .3, 1);
}
.lang-menu[hidden] { display: none; }
@keyframes langMenuIn {
  from { opacity: 0; transform: translateY(-8px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.lang-menu__item {
  display: flex; align-items: center; gap: 11px;
  background: transparent; border: none; color: var(--muted);
  font-family: inherit; font-size: 14px; font-weight: 600; text-align: left;
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.lang-menu__item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.lang-menu__item .flag {
  width: 26px; height: 18px; flex: none; border-radius: 4px; overflow: hidden;
  display: inline-flex; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3);
}
.lang-menu__name { flex: 1; }
.lang-menu__check {
  width: 16px; display: inline-flex; color: var(--teal);
  opacity: 0; transform: scale(.6); transition: opacity .15s ease, transform .15s ease;
}
.lang-menu__check svg { width: 100%; }
.lang-menu__item.is-active { color: #fff; background: rgba(45, 212, 191, .1); }
.lang-menu__item.is-active .lang-menu__check { opacity: 1; transform: scale(1); }

/* ---------- LOGGED-IN USER CHIP ---------- */
.user-chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 8px 5px 6px;
}
.user-chip__avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-chip__info { display: flex; flex-direction: column; line-height: 1.15; }
.user-chip__name { font-size: 13px; font-weight: 700; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip__coins { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--gold); }
.user-chip__coins .coin-img { width: 13px; height: 13px; }
.user-chip__logout {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(244, 63, 94, .1); border: 1px solid rgba(244, 63, 94, .28);
  color: #fda4af; border-radius: 50%; cursor: pointer;
}
.user-chip__logout svg { width: 16px; height: 16px; }
.user-chip__logout:hover { background: rgba(244, 63, 94, .2); }

/* ---------- AUTH MODAL ---------- */
.auth-modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-modal[hidden] { display: none; }
.auth-modal__backdrop { position: absolute; inset: 0; background: rgba(3, 4, 8, .72); backdrop-filter: blur(5px); }
.auth-modal__card {
  position: relative; z-index: 1; width: 360px; max-width: 100%;
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px 26px;
  text-align: center; box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
  animation: authIn .2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes authIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.auth-modal__close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--muted); font-size: 26px; line-height: 1; cursor: pointer; }
.auth-modal__close:hover { color: #fff; }
.auth-modal__logo { font-size: 26px; font-weight: 900; letter-spacing: .5px; margin-bottom: 6px; }
.auth-modal__logo span { color: var(--violet-2); }
.auth-modal__title { font-size: 19px; font-weight: 800; }
.auth-modal__sub { color: var(--muted); font-size: 13px; margin: 6px 0 20px; }
.auth-modal__widget { min-height: 46px; display: flex; justify-content: center; }
.auth-modal__note { color: var(--muted); font-size: 13px; margin-top: 12px; min-height: 18px; }
.auth-modal__note.is-error { color: #fca5a5; }
.auth-modal__note.is-ok { color: #6ee7b7; }

/* login / register tabs */
.auth-tabs {
  display: flex; gap: 4px; margin: 18px 0 18px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px;
}
.auth-tab {
  flex: 1; padding: 10px; border: none; border-radius: 9px; cursor: pointer;
  background: transparent; color: var(--muted); font-family: inherit;
  font-size: 14px; font-weight: 700; transition: background .18s ease, color .18s ease;
}
.auth-tab:hover { color: #fff; }
.auth-tab.is-active { background: rgba(139,92,246,.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(139,92,246,.4); }

/* form fields */
.auth-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.auth-form[hidden] { display: none; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field__lbl { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .2px; }
.auth-field input {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; color: #fff; font-family: inherit; font-size: 14px; outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.auth-field input::placeholder { color: #565d72; }
.auth-field input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139,92,246,.14); }
.auth-submit {
  margin-top: 4px; padding: 13px; border: none; border-radius: 11px; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  box-shadow: 0 8px 20px rgba(124,58,237,.35);
  transition: filter .18s ease, transform .1s ease;
}
.auth-submit:hover { filter: brightness(1.08); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: .6; cursor: default; }

/* divider */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 12px; margin: 18px 0 14px;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* provider buttons (telegram / google) */
.auth-providers { display: flex; gap: 10px; }
.auth-provider {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border-radius: 11px; cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: #dfe3ee;
  font-family: inherit; font-size: 14px; font-weight: 700;
  transition: background .18s ease, border-color .18s ease;
}
.auth-provider:hover { background: rgba(255,255,255,.08); border-color: #2c3348; }
.auth-provider svg { width: 20px; height: 20px; }
#tgProvider svg { color: #29a9eb; }

/* ---------- LOGIN-REQUIRED GUARD (Bonuslar tab) ---------- */
.auth-guard { margin-top: 34px; }
.auth-guard__card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: 20px;
  padding: 48px 28px; text-align: center; max-width: 560px; margin: 0 auto;
}
.auth-guard__icon {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139,92,246,.14); border: 1px solid rgba(139,92,246,.3); color: var(--violet-2);
}
.auth-guard__icon svg { width: 30px; height: 30px; }
.auth-guard__title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.auth-guard__sub { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 auto 22px; max-width: 400px; }
.auth-guard .btn--login { padding: 13px 28px; font-size: 15px; }

/* ---------- BUTTONS ---------- */
.btn {
  font-family: inherit; font-weight: 700; font-size: 14px;
  border: none; border-radius: 10px; cursor: pointer;
  padding: 11px 20px; color: #fff;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn--login {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 6px 18px rgba(34,197,94,.35);
}
.btn--login:hover { filter: brightness(1.08); }
.btn--teal {
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
  color: #04201c;
  box-shadow: 0 6px 18px rgba(45,212,191,.3);
}
.btn--teal:hover { filter: brightness(1.06); }
.btn--outline {
  background: transparent; color: var(--gold);
  border: 1px solid rgba(245,176,39,.5);
}
.btn--outline:hover { background: rgba(245,176,39,.08); }
.btn--gold {
  background: linear-gradient(135deg, #f5b027, #e0951a);
  color: #241701; box-shadow: 0 6px 18px rgba(245,176,39,.3);
}
.btn--gold:hover { filter: brightness(1.06); }

/* ---------- NAV ---------- */
.nav { border-bottom: 1px solid var(--line); }
.nav__inner {
  max-width: 1180px; margin: 0 auto;
  padding: 0 20px;
  display: flex; gap: 26px; justify-content: center;
  overflow-x: auto;
}
.nav__item {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: .6px;
  color: var(--muted);
  padding: 16px 2px; position: relative; white-space: nowrap;
}
.nav__item:hover { color: #fff; }
.nav__item.is-active { color: #fff; }
.nav__item.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--pink));
  border-radius: 2px;
}

/* ---------- BONUS CARDS ---------- */
.bonuses {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-top: 34px;
}
.bonus-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 28px;
  position: relative; overflow: hidden;
}
.bonus-card::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,.18), transparent 70%);
}
.bonus-card__title { font-size: 27px; font-weight: 800; margin-bottom: 18px; }
.bonus-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.bonus-list li { display: flex; align-items: center; gap: 10px; color: #cbd0de; font-size: 15px; }
.check {
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(45,212,191,.15); color: var(--teal); font-size: 11px;
}
.bonus-card__text { color: #cbd0de; font-size: 15px; line-height: 1.5; margin-bottom: 22px; }
.bonus-card__promo { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

.grad-teal { background: linear-gradient(90deg, #2dd4bf, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-orange { background: linear-gradient(90deg, #f59e0b, #f43f5e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-gold { background: linear-gradient(90deg, #f5b027, #fcd34d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-pink { background: linear-gradient(90deg, #f43f5e, #fb7185); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-violet { background: linear-gradient(90deg, #8b5cf6, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-blue { background: linear-gradient(90deg, #38bdf8, #3b82f6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grad-green { background: linear-gradient(90deg, #22c55e, #4ade80); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- DAILY REWARD + TASKS ---------- */
.promo-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 34px; }
.panel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px;
  display: flex; flex-direction: column;
}
.panel__head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.panel__icon { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.panel__icon--svg {
  display: flex; align-items: center; justify-content: center;
  background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.3); border-radius: 12px;
  color: var(--violet-2);
}
.panel__icon--svg svg { width: 28px; height: 28px; }
.panel__title { font-size: 22px; font-weight: 800; }
.panel__sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

/* day tiles */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 18px; }
.day {
  border: 1px solid var(--line); border-radius: 14px; padding: 9px 6px 9px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(255,255,255,.02); position: relative; min-height: 96px; justify-content: space-between;
}
.day__label { font-size: 13px; font-weight: 700; color: var(--muted); }
.day__mid { flex: 1; display: flex; align-items: center; justify-content: center; }
.day__reward { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 800; color: #fff; }
.day__check { color: var(--green); display: flex; }
.day__check svg { width: 20px; height: 20px; }
.day__lock { width: 22px; height: 22px; object-fit: contain; opacity: .8; }
.day__chest { width: 62px; height: 40px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.day--claimed { border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.06); }
.day--claimed .day__label { color: var(--green); }
.day--active { border-color: var(--violet); box-shadow: 0 0 0 1px var(--violet), 0 0 22px -6px var(--violet); }
.day--active .day__label { color: var(--violet-2); }
.day--locked { opacity: .6; }
.day--special {
  border-color: var(--gold); background: rgba(245,176,39,.08);
  box-shadow: 0 0 0 1px var(--gold), 0 0 26px -6px var(--gold);
}
.day--special .day__label, .day--special .day__reward { color: var(--gold); }
.day__key { font-size: 14px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.daily__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; }
.daily__timer { color: var(--muted); font-size: 14px; }
.daily__timer b { color: var(--violet-2); font-weight: 800; }
.daily__claim { min-width: 150px; }
.daily__claim:disabled { opacity: .5; cursor: not-allowed; }

/* tasks */
.task-list { display: flex; flex-direction: column; gap: 10px; flex: 1; margin-bottom: 16px; }
.task {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.02); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
}
.task__ic {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.25);
  color: var(--violet-2);
}
.task__ic svg { width: 18px; height: 18px; }
.task__label { flex: 1; font-size: 14.5px; font-weight: 600; }
.task__reward { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--gold); }
.tasks__all {
  background: rgba(255,255,255,.03); border: 1px solid var(--line); color: #cdd2e0;
  border-radius: 12px; padding: 13px; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
}
.tasks__all:hover { background: rgba(255,255,255,.06); color: #fff; }

/* user stat tiles with icons */
.stats--user .stat--icon { display: flex; align-items: center; gap: 14px; }
.stat__badge {
  width: 52px; height: 52px; border-radius: 14px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.stat__badge--gold { background: none; box-shadow: none; }
.stat__badge--violet { background: radial-gradient(circle, rgba(139,92,246,.22), rgba(139,92,246,.06)); box-shadow: inset 0 0 0 1px rgba(139,92,246,.3); }
.stat__badge--blue { background: radial-gradient(circle, rgba(56,189,248,.22), rgba(56,189,248,.06)); box-shadow: inset 0 0 0 1px rgba(56,189,248,.3); }
.stat__badge--green { background: radial-gradient(circle, rgba(34,197,94,.22), rgba(34,197,94,.06)); box-shadow: inset 0 0 0 1px rgba(34,197,94,.3); }
.stat__ic { width: 34px; height: 34px; object-fit: contain; }
.stat__badge--gold .stat__ic { width: auto; height: 48px; }
.stats--user .stat__num { font-size: 26px; }

/* ---------- STATS ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: 22px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
}
.stat__num { font-size: 30px; font-weight: 900; letter-spacing: .5px; }
.stat__label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 1px; margin-top: 4px; }

/* ---------- CASES ---------- */
.cases-section { margin-top: 44px; }
.cases-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-size: 22px; font-weight: 800; }
.cases-search { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.cases-search input {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; color: #fff; font-family: inherit;
  font-size: 14px; width: 220px; outline: none;
}
.cases-search input:focus { border-color: var(--violet); }
.cases-search .cases-price { width: 118px; }
.cases-price::-webkit-outer-spin-button,
.cases-price::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cases-price { -moz-appearance: textfield; }

.cases-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.case {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: transform .15s ease, box-shadow .25s ease, border-color .2s ease;
  aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.case:hover {
  transform: translateY(-4px);
  border-color: var(--rc, var(--violet));
  box-shadow: 0 14px 34px rgba(0,0,0,.5), 0 0 0 1px var(--rc, var(--violet));
}
.case__art {
  position: absolute; inset: 0;
  background:
    radial-gradient(90% 70% at 50% 30%, var(--rc, #333), transparent 70%),
    linear-gradient(180deg, #12151f, #0a0c13);
  display: flex; align-items: center; justify-content: center;
}
.case__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.case:hover .case__img { transform: scale(1.04); transition: transform .25s ease; }
.case__crate {
  width: 62%; height: 52%;
  position: relative;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.14), rgba(0,0,0,.35)),
    linear-gradient(135deg, var(--rc, #555), #1a1e2b);
  box-shadow: inset 0 0 30px rgba(0,0,0,.55), 0 10px 24px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  transition: transform .25s ease;
}
.case:hover .case__crate { transform: scale(1.05) rotate(-1deg); }
.case__crate::before {
  content: ""; position: absolute; left: 8%; right: 8%; top: 42%;
  height: 3px; background: rgba(0,0,0,.4);
  box-shadow: 0 -1px 0 rgba(255,255,255,.08);
}
.case__crate::after {
  content: ""; position: absolute; left: 42%; top: 40%;
  width: 16%; height: 18%;
  background: rgba(0,0,0,.5); border-radius: 3px;
  border: 1px solid rgba(255,255,255,.15);
}
.case__label {
  z-index: 1; font-size: 15px; font-weight: 900; letter-spacing: .5px;
  color: rgba(255,255,255,.92); text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0,0,0,.7), 0 0 18px var(--rc);
  padding: 0 8px; text-align: center;
}
.case__meta {
  position: relative; z-index: 2;
  padding: 12px;
  background: linear-gradient(180deg, transparent, rgba(6,7,12,.92) 55%);
}
.case__name {
  font-weight: 700; font-size: 15px; text-align: center; margin-bottom: 8px;
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
}
.case__stats { display: flex; gap: 8px; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,.55);
  border: 1px solid var(--line);
  border-radius: 20px; padding: 4px 10px;
  font-size: 12px; font-weight: 700;
}
.pill--price { color: #fff; }
.pill--count { color: var(--muted); }
.pill--count svg { width: 12px; height: 12px; vertical-align: -2px; }
.coin { color: var(--gold); }
.coin-img {
  height: 1.05em; width: auto; vertical-align: -0.18em;
  margin: 0 1px; display: inline-block;
  filter: drop-shadow(0 0 3px rgba(244,63,94,.5));
}
.reveal__price .coin-img { height: 0.95em; vertical-align: -0.1em; }

/* ---------- UPGRADE ---------- */
.upgrade { margin-top: 44px; }
.upg-stage {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px;
  align-items: center; margin: 10px 0 26px;
}
.upg-side { text-align: center; }
.upg-side__label { color: var(--muted); font-size: 13px; font-weight: 700; margin-bottom: 12px; letter-spacing: .5px; }
.upg-slot {
  min-height: 200px; border-radius: 16px;
  border: 1px dashed var(--line); background: var(--panel);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.upg-slot__empty { color: var(--muted); font-size: 14px; }
.upg-slot .upg-card { width: 170px; }

/* wheel */
.upg-wheel { position: relative; width: 240px; height: 240px; }
.upg-wheel__svg { width: 240px; height: 240px; transform: rotate(0deg); }
.upg-ring__bg { fill: none; stroke: #1b2130; stroke-width: 16; }
.upg-ring__win {
  fill: none; stroke: var(--teal); stroke-width: 16; stroke-linecap: round;
  stroke-dasharray: 0 999; transition: stroke-dasharray .35s ease;
  filter: drop-shadow(0 0 8px rgba(45,212,191,.6));
}
/* marker: a single line that travels along the ring border */
.upg-wheel__pointer {
  position: absolute; inset: 0; z-index: 3;
  transform-origin: 50% 50%; transform: rotate(0deg);
  pointer-events: none;
}
.upg-wheel__pointer::before {
  content: ""; position: absolute; top: 3px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 22px; border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 0 10px 2px rgba(255,255,255,.85), 0 0 4px #fff;
}
.upg-wheel__center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.upg-wheel__chance { font-size: 34px; font-weight: 900; color: #fff; }
.upg-wheel__mult { font-size: 14px; font-weight: 700; color: var(--teal); margin-top: 2px; }

.upg-actions { text-align: center; margin-bottom: 30px; }
.upg-actions .btn { min-width: 220px; font-size: 16px; padding: 14px 24px; }
.upg-actions .btn:disabled { opacity: .5; cursor: not-allowed; }
.upg-result { margin-top: 14px; font-weight: 700; min-height: 22px; }
.upg-result.is-win { color: var(--green); }
.upg-result.is-lose { color: var(--pink); }

/* cards + pickers */
.upg-card {
  background: #0d101a; border: 1px solid var(--line);
  border-top: 3px solid var(--rc, #444); border-radius: 12px;
  padding: 10px; text-align: center;
}
.upg-card__art {
  height: 74px; display: flex; align-items: center; justify-content: center; position: relative;
}
.upg-card__art::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(75% 60% at 50% 45%, var(--rc), transparent 70%); opacity: .26;
}
.upg-card__art img { position: relative; max-height: 70px; max-width: 100%; object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.upg-card__name { font-size: 12px; font-weight: 600; margin-top: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upg-card__val { font-size: 13px; font-weight: 800; color: var(--gold); margin-top: 3px; }

.upg-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.upg-pick__title {
  font-size: 14px; font-weight: 700; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.upg-pick__title input {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; color: #fff; font-family: inherit; font-size: 13px; width: 160px; outline: none;
}
.upg-pick__title input:focus { border-color: var(--violet); }
.upg-pick__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
  max-height: 360px; overflow-y: auto; padding: 4px;
  background: rgba(0,0,0,.15); border: 1px solid var(--line); border-radius: 12px;
}
.upg-pick__item { cursor: pointer; border-radius: 12px; transition: transform .1s ease; }
.upg-pick__item:hover { transform: translateY(-2px); }
.upg-pick__item.is-sel .upg-card { box-shadow: 0 0 0 2px var(--teal); }
.upg-empty { color: var(--muted); font-size: 13px; padding: 20px; grid-column: 1 / -1; text-align: center; }

@media (max-width: 760px) {
  .upg-stage { grid-template-columns: 1fr; }
  .upg-wheel { margin: 0 auto; }
  .upg-pick { grid-template-columns: 1fr; }
}

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 40px; }
.footer__inner {
  max-width: 1180px; margin: 0 auto; padding: 44px 20px 28px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px;
}
.footer__col h4 { font-size: 14px; margin-bottom: 14px; }
.footer__col a { display: block; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 9px; }
.footer__col a:hover { color: #fff; }
.footer__desc { color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 320px; margin-top: 12px; }
.footer__desc--sm { margin-top: 0; }
.footer__bottom {
  text-align: center; color: #5a6072; font-size: 12px;
  padding: 18px; border-top: 1px solid var(--line);
}

/* ---------- MODAL ---------- */
/* full-page case view */
.case-view { margin-top: 20px; position: relative; }
.case-view__back {
  background: rgba(255,255,255,.04); border: 1px solid var(--line); color: #cdd2e0;
  border-radius: 10px; padding: 9px 18px; font-family: inherit; font-weight: 700;
  font-size: 14px; cursor: pointer; margin-bottom: 22px;
}
.case-view__back:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ---------- SKIN DETAIL POPUP ---------- */
.skin-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; }
.skin-modal__backdrop { position: absolute; inset: 0; background: rgba(3,4,8,.72); backdrop-filter: blur(4px); }
.skin-modal__card {
  position: relative; z-index: 1; width: 380px; max-width: 92vw;
  background: linear-gradient(180deg, #0e1119, #0a0c13);
  border: 1px solid color-mix(in srgb, var(--rc) 45%, var(--line));
  border-radius: 18px; padding: 26px 24px 22px; text-align: center; overflow: hidden;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc) 28%, transparent), 0 30px 70px rgba(0,0,0,.6);
  animation: revealIn .28s ease both;
}
.skin-modal__close {
  position: absolute; top: 10px; right: 14px; background: none; border: none;
  color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; z-index: 2;
}
.skin-modal__close:hover { color: #fff; }
.skin-modal__glow {
  position: absolute; left: 50%; top: -30%; transform: translateX(-50%);
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, var(--rc), transparent 62%); opacity: .3; pointer-events: none;
}
.skin-modal__imgwrap { position: relative; height: 130px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.skin-modal__imgwrap img {
  max-height: 128px; max-width: 88%; object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.6)) drop-shadow(0 0 20px color-mix(in srgb, var(--rc) 50%, transparent));
}
.skin-modal__tier {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--rc); padding: 3px 12px; border-radius: 20px; margin-bottom: 8px;
  background: color-mix(in srgb, var(--rc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
}
.skin-modal__name { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.skin-modal__price { font-size: 22px; font-weight: 900; color: var(--gold); margin-bottom: 16px; }
.skin-modal__rows { text-align: left; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.skin-modal__rows > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.skin-modal__rows span { color: var(--muted); }
.skin-modal__rows b { color: #eef1f8; font-weight: 700; white-space: nowrap; }

/* case detail hero (styled after the source case page) */
.case-hero {
  display: grid; grid-template-columns: minmax(0, 44%) 1fr;
  border-radius: 20px; overflow: hidden; margin-bottom: 22px;
  background: linear-gradient(120deg, #0b0d14, #12151f);
  border: 1px solid var(--line); min-height: 240px;
}
.case-hero__art { position: relative; overflow: hidden; background: #0a0c13; }
.case-hero__crate { width: 100%; height: 100%; object-fit: cover; display: block; }
.case-hero__panel {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 30px 24px;
  background: radial-gradient(120% 100% at 100% 0%, rgba(139,92,246,.12), transparent 60%);
}
.case-hero__opened {
  position: absolute; top: 16px; right: 18px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.5); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700; color: #cdd2e0;
}
.case-hero__opened .coin-img { width: 14px; height: 14px; }
.case-hero__title {
  font-size: 46px; font-weight: 800; line-height: 1; text-align: center;
  text-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.case-hero__price {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 18px; font-weight: 800; color: var(--gold);
}
.case-hero__price .coin-img { width: 18px; height: 18px; }
.case-hero__open {
  display: inline-block; text-align: center; text-decoration: none;
  min-width: 220px; padding: 15px 26px; border: none; cursor: pointer;
  border-radius: 999px; font-family: inherit; font-size: 17px; font-weight: 800; color: #fff;
  background: linear-gradient(180deg, #23a3ff, #0091ff);
  box-shadow: 0 8px 22px rgba(0,145,255,.35);
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.case-hero__open:hover { filter: brightness(1.06); box-shadow: 0 10px 28px rgba(0,145,255,.5); }
.case-hero__open:active { transform: translateY(1px); }
.case-hero__open:disabled { opacity: .55; cursor: default; box-shadow: none; }
@media (max-width: 640px) {
  .case-hero { grid-template-columns: 1fr; }
  .case-hero__art { height: 170px; }
  .case-hero__title { font-size: 34px; }
}

/* items inside the case */
.case-contents { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 20px; }
.case-contents__title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.case-contents__count { color: var(--muted); font-weight: 600; }
.case-contents__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.citem {
  position: relative; border-radius: 18px; overflow: hidden; cursor: pointer;
  padding: 12px; min-height: 172px; display: flex; flex-direction: column;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--rc) 55%, #2b303a) 0%,
    color-mix(in srgb, var(--rc) 20%, #23262f) 55%,
    #181b22 100%);
  transition: transform .12s ease, box-shadow .2s ease;
}
.citem:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(0,0,0,.5); }
.citem__wear {
  position: absolute; top: 11px; left: 13px;
  font-size: 12px; font-weight: 600; color: #fff; opacity: .85;
}
.citem__chance {
  position: absolute; top: 9px; right: 10px;
  font-size: 12px; font-weight: 700; color: #46d977;
  background: rgba(0,0,0,.6); border-radius: 999px; padding: 2px 8px;
}
.citem__art {
  flex: 1; min-height: 74px; margin-top: 18px;
  display: flex; align-items: center; justify-content: center;
}
.citem__img {
  max-height: 84px; max-width: 92%; object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.55));
}
.citem__weapon {
  font-size: 13px; font-weight: 500; color: rgba(255,255,255,.68);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.citem__name {
  font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.citem__price {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  font-size: 13px; font-weight: 800; color: #ffd15a;
  background: rgba(0,0,0,.32); border-radius: 999px; padding: 4px 10px;
}
.citem__price .coin-img { width: 14px; height: 14px; }
.modal__close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer;
}
.modal__close:hover { color: #fff; }
.modal__title { text-align: center; font-size: 22px; font-weight: 800; margin-bottom: 20px; }

/* ---------- PRO case-opening animation ---------- */
.opening {
  position: relative; height: 168px; overflow: hidden; margin: 8px 0 18px;
  border-radius: 16px; border: 1px solid #232a3d;
  background:
    radial-gradient(120% 130% at 50% 0%, rgba(139,92,246,.14), transparent 55%),
    linear-gradient(180deg, #0c0f18, #070910);
  box-shadow: inset 0 0 40px rgba(0,0,0,.6), 0 10px 40px rgba(0,0,0,.35);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.opening[hidden] { display: none; }
.opening__glow {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 220px; transform: translateX(-50%);
  background: radial-gradient(60% 80% at 50% 50%, rgba(45,212,191,.16), transparent 70%);
  z-index: 1; pointer-events: none;
}
.opening__marker {
  position: absolute; left: 50%; top: 8px; bottom: 8px; width: 2px; transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--teal) 18%, #fff 50%, var(--teal) 82%, transparent);
  box-shadow: 0 0 16px var(--teal), 0 0 40px rgba(45,212,191,.5); z-index: 5;
}
.opening__pointer {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 6;
  width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent;
  filter: drop-shadow(0 0 6px rgba(45,212,191,.8));
}
.opening__pointer--top { top: -1px; border-top: 11px solid var(--teal); }
.opening__pointer--bottom { bottom: -1px; border-bottom: 11px solid var(--teal); }
.opening__track {
  display: flex; gap: 10px; padding: 20px 0; height: 100%; align-items: center;
  will-change: transform; position: relative; z-index: 2;
}
.roul-item {
  flex: 0 0 auto; width: 114px; height: 100%;
  border-radius: 10px; padding: 8px;
  display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, #11141e, #0b0d14);
  position: relative; overflow: hidden;
}
.roul-item::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(110% 80% at 50% 0%, var(--rc), transparent 70%);
  opacity: .4;
}
.roul-item__img {
  position: relative; height: 52px; width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.6));
}
.roul-item__name { position: relative; font-size: 10px; color: #cdd2e0; text-align: center; }
.roul-item.is-winner {
  border-color: color-mix(in srgb, var(--rc) 75%, #fff);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 60%, transparent),
              0 0 28px color-mix(in srgb, var(--rc) 65%, transparent);
  animation: winnerPulse 1s ease-in-out infinite alternate;
}
@keyframes winnerPulse { from { filter: brightness(1); } to { filter: brightness(1.28); } }

/* sound toggle — icon button (volume-high when on, volume-mute when off) */
.sound-ctl {
  position: absolute; top: 0; right: 0;
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  border-radius: 12px; color: var(--muted);
  cursor: pointer; user-select: none; outline: none;
  transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.sound-ctl:hover { color: #fff; background: rgba(255,255,255,.09); border-color: #2c3348; }
.sound-ctl:active { transform: scale(.94); }
.sound-ctl:focus-visible { box-shadow: 0 0 0 3px rgba(45,212,191,.28); }
.sound-ctl .sound-ic { width: 22px; height: 22px; display: block; }
/* swap the two icons based on state */
.sound-ctl .sound-ic--off { display: none; }
.sound-ctl:not(.is-on) .sound-ic--on { display: none; }
.sound-ctl:not(.is-on) .sound-ic--off { display: block; }
/* on = teal/active, muted = dim */
.sound-ctl.is-on {
  color: var(--teal);
  background: rgba(45,212,191,.1); border-color: rgba(45,212,191,.4);
}
.sound-ctl.is-on:hover { color: #5eead4; background: rgba(45,212,191,.16); }

/* ---------- REVEAL CARD ---------- */
.reveal-box {
  position: relative;
  margin: 18px auto 4px;
  max-width: 460px;
  border-radius: 18px;
  padding: 26px 22px 20px;
  text-align: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--rc) 45%, var(--line));
  background:
    radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rc) 22%, transparent), transparent 60%),
    linear-gradient(180deg, #0d1019, #0a0c13);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc) 30%, transparent),
              0 20px 60px rgba(0,0,0,.55),
              0 0 60px -10px color-mix(in srgb, var(--rc) 60%, transparent);
}
.reveal-box.is-in { animation: revealIn .5s cubic-bezier(.2,.9,.25,1.15) both; }
@keyframes revealIn {
  0% { transform: scale(.82) translateY(14px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.reveal__glow {
  position: absolute; left: 50%; top: -30%; transform: translateX(-50%);
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, var(--rc), transparent 62%);
  opacity: .35; filter: blur(6px);
  animation: glowPulse 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glowPulse { 0%,100% { opacity: .28; } 50% { opacity: .5; } }

.reveal__imgwrap {
  position: relative; height: 150px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
}
.reveal__img {
  position: relative; max-height: 148px; max-width: 92%; object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.6))
          drop-shadow(0 0 24px color-mix(in srgb, var(--rc) 55%, transparent));
  animation: revealPop .6s .05s cubic-bezier(.2,.9,.25,1.3) both;
}
@keyframes revealPop {
  0% { transform: scale(.4) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.reveal__shine {
  position: absolute; top: 0; left: -60%; width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg);
  animation: shineSweep 1.1s .35s ease-out both;
  pointer-events: none; z-index: 2;
}
@keyframes shineSweep { 0% { left: -60%; } 100% { left: 130%; } }

.reveal__tier {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--rc);
  padding: 3px 12px; border-radius: 20px; margin-bottom: 8px;
  background: color-mix(in srgb, var(--rc) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
}
.reveal__name { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.reveal__price {
  font-size: 24px; font-weight: 900; color: var(--gold);
  margin-bottom: 16px; text-shadow: 0 0 18px rgba(245,176,39,.35);
}
.reveal__details {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px;
  text-align: left; border-top: 1px solid var(--line); padding-top: 14px;
}
.reveal__row { display: flex; justify-content: space-between; font-size: 13px; gap: 10px; }
.reveal__row span { color: var(--muted); }
.reveal__row b { color: #eef1f8; font-weight: 700; white-space: nowrap; }

.modal__result { text-align: center; min-height: 0; margin-top: 8px; font-weight: 700; }
.modal__result .win-name { color: var(--gold); }
.modal__actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }
.modal__actions .btn { min-width: 130px; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed; top: 16px; bottom: auto; left: 50%; transform: translateX(-50%) translateY(-30px);
  background: var(--panel-2); border: 1px solid var(--line);
  color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; z-index: 300;
  max-width: calc(100% - 24px); text-align: center;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border-color: rgba(34, 197, 94, .55);
  color: #fff;
  box-shadow: 0 14px 40px rgba(22, 163, 74, .4);
}
.toast--error {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: rgba(244, 63, 94, .55);
  color: #fff;
  box-shadow: 0 14px 40px rgba(220, 38, 38, .4);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .bonuses { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cases-grid { grid-template-columns: repeat(3, 1fr); }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .cases-grid { grid-template-columns: repeat(2, 1fr); }
  .cases-search input { width: 150px; }
  .bonus-card__title { font-size: 22px; }
  .stat__num { font-size: 24px; }
  .footer__inner { grid-template-columns: 1fr; }
}

/* ============================================================
   MOBILE CHROME — burger header, drawer, bottom nav bar
   ============================================================ */
/* Mobile-only chrome is hidden on desktop */
.hdr-icon { display: none; }
.mbar { display: none; }

/* --- header icon buttons (burger, bell, avatar) --- */
.hdr-icon {
  width: 40px; height: 40px; flex: 0 0 auto;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); cursor: pointer; position: relative;
  transition: background .18s ease, border-color .18s ease;
}
.hdr-icon:hover { background: rgba(255,255,255,.09); }
.hdr-icon:active { transform: scale(.94); }
.hdr-icon svg { width: 22px; height: 22px; }
.hdr-avatar { border-radius: 50%; overflow: hidden; padding: 0; }
.hdr-avatar__img { width: 100%; height: 100%; object-fit: cover; }
.hdr-avatar__ic { color: var(--muted); }
.hdr-bell__dot {
  position: absolute; top: 8px; right: 9px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--violet);
  box-shadow: 0 0 0 2px var(--bg), 0 0 8px var(--violet);
}

/* --- DRAWER (off-canvas menu) --- */
.drawer { position: fixed; inset: 0; z-index: 120; }
.drawer[hidden] { display: none !important; }
.drawer__backdrop {
  position: absolute; inset: 0; background: rgba(3,4,8,.6);
  backdrop-filter: blur(4px); animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer__panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 84%; max-width: 320px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, var(--panel-2), var(--bg-2));
  border-right: 1px solid var(--line);
  box-shadow: 24px 0 60px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
  animation: drawerIn .26s cubic-bezier(.2,.8,.3,1);
}
@keyframes drawerIn { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.drawer__head { display: flex; align-items: center; justify-content: space-between; }
.drawer__close {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer;
}
.drawer__close:hover { color: #fff; }

.drawer__account { display: flex; flex-direction: column; gap: 10px; }
.drawer-user {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px;
}
.drawer-user__avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  background: rgba(139,92,246,.14); border: 1px solid rgba(139,92,246,.3);
}
.drawer-user__info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.drawer-user__name { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-user__coins { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--gold); }
.drawer-user__coins .coin-img { width: 14px; height: 14px; }
.drawer-user__logout {
  margin-left: auto; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(244,63,94,.1); border: 1px solid rgba(244,63,94,.28); color: #fda4af; cursor: pointer;
}
.drawer-user__logout svg { width: 17px; height: 17px; }
.drawer__login {
  width: 100%; padding: 14px; border-radius: 12px; font-size: 15px;
  background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff;
  border: none; font-family: inherit; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 18px rgba(34,197,94,.3);
}

.drawer__nav { display: flex; flex-direction: column; gap: 2px; }
.dnav {
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: inherit; font-size: 15px; font-weight: 700; letter-spacing: .3px;
  color: var(--muted); padding: 13px 12px; border-radius: 11px; position: relative;
  transition: background .15s ease, color .15s ease;
}
.dnav:hover { background: rgba(255,255,255,.04); color: #fff; }
.dnav.is-active { color: #fff; background: rgba(139,92,246,.14); }
.dnav.is-active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 3px;
  background: linear-gradient(180deg, var(--violet), var(--pink));
}

.drawer__lang { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.dlang {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--muted);
  border-radius: 10px; padding: 9px 6px; font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer;
}
.dlang .flag { width: 20px; height: 14px; border-radius: 3px; overflow: hidden; display: inline-flex; }
.dlang .flag svg { width: 100%; height: 100%; }
.dlang.is-active { color: #fff; border-color: var(--violet); background: rgba(139,92,246,.14); }

/* --- BOTTOM NAV BAR --- */
.mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(9,11,18,.94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  align-items: stretch; justify-content: space-around;
  box-shadow: 0 -8px 30px rgba(0,0,0,.45);
}
.mbar__item, .mbar__center {
  flex: 1; background: none; border: none; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); padding: 6px 2px;
}
.mbar__ic svg { width: 23px; height: 23px; display: block; }
.mbar__lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .2px; }
.mbar__item.is-active { color: var(--violet-2); }
.mbar__item:active { transform: scale(.93); }
/* elevated center Battle button */
.mbar__center { position: relative; }
.mbar__center-btn {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #a78bfa, #7c3aed);
  border: 3px solid var(--bg);
  box-shadow: 0 8px 22px rgba(124,58,237,.55), 0 0 0 1px rgba(167,139,250,.4);
  color: #fff; transition: transform .15s ease, box-shadow .2s ease;
}
.mbar__center .mbar__lbl { margin-top: 38px; }
.mbar__center-btn svg { width: 26px; height: 26px; }
.mbar__center:active .mbar__center-btn { transform: translateX(-50%) scale(.92); }
.mbar__center.is-active .mbar__center-btn {
  box-shadow: 0 8px 26px rgba(124,58,237,.75), 0 0 0 3px rgba(167,139,250,.5);
}
.mbar__center.is-active .mbar__lbl { color: var(--violet-2); }

/* ============================================================
   MOBILE LAYOUT SWITCH (phones / small tablets)
   ============================================================ */
@media (max-width: 820px) {
  .hdr-icon { display: inline-flex; }
  .mbar { display: flex; }
  /* phone: the bottom nav replaces the footer's links, so drop the footer */
  .footer { display: none; }

  /* header becomes: [burger] [centered logo] [bell + avatar] */
  .header__inner {
    height: 58px; padding: 0 12px;
    display: grid; grid-template-columns: 40px 1fr auto; align-items: center;
  }
  .header__left { justify-content: center; gap: 0; min-width: 0; }
  .header__right { gap: 8px; }
  .promo-grid, .bonuses { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cases-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-width: 0; }
  .stat__body { min-width: 0; }
  .stat__num, .stat__label { overflow: hidden; text-overflow: ellipsis; }
  .online, .lang-wrap, .btn--login, .user-chip { display: none !important; }
  .logo-img { height: 34px; }

  /* the desktop tab strip is replaced by the drawer + bottom bar */
  .nav { display: none; }

  /* keep content clear of the fixed bottom bar */
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .container { padding: 0 14px 30px; }

  /* tighter live strip */
  .live-strip { height: 74px; }
  .live-strip__labels { min-width: 54px; padding: 0 10px; gap: 8px; }
  .drop { width: 80px; height: 60px; }

  /* section spacing */
  .promo-grid { margin-top: 18px; gap: 14px; }
  .panel { padding: 18px 16px; border-radius: 16px; }
  .panel__icon, .panel__icon--svg { width: 44px; height: 44px; }
  .panel__title { font-size: 19px; }
  .stats { margin-top: 14px; gap: 12px; }
  .cases-section { margin-top: 30px; }
  .upgrade { margin-top: 30px; }

  /* daily reward tiles: keep 7 across but compact.
     minmax(0,1fr) lets the tracks shrink instead of overflowing (grid blowout). */
  .days { gap: 6px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .day { min-width: 0; min-height: 82px; border-radius: 11px; padding: 7px 3px; overflow: hidden; }
  .day__label { font-size: 11px; }
  .day__reward { font-size: 12px; }
  .day__reward, .day__key { max-width: 100%; }
  .day__chest { width: 100%; max-width: 44px; height: 30px; }
  .day__key { font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
  .daily__foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .daily__claim { min-width: 0; width: 100%; }

  /* stat tiles */
  .stat { padding: 14px; border-radius: 14px; }
  .stats--user .stat--icon { gap: 10px; }
  .stat__badge { width: 44px; height: 44px; }
  .stats--user .stat__num { font-size: 21px; }

  /* cases header stacks */
  .cases-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .cases-search { justify-content: stretch; }
  .cases-search input { flex: 1; width: auto; min-width: 0; }
  .cases-search .cases-price { flex: 1; }
}

@media (max-width: 400px) {
  .days { grid-template-columns: repeat(4, 1fr); }
  .cases-search { flex-wrap: wrap; }
  .cases-search input[type="text"] { flex-basis: 100%; }
}

/* ---------- INVENTORY (personal) ---------- */
.inventory-view { margin-top: 30px; }
.inv-total { color: var(--muted); font-size: 14px; font-weight: 600; }
.inv-total b { color: var(--gold); font-weight: 800; }
.inv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px;
}
.inv-empty {
  color: var(--muted); font-size: 15px; text-align: center;
  padding: 50px 20px; border: 1px dashed var(--line); border-radius: 16px;
}
.inv-card {
  position: relative; border-radius: 16px; overflow: hidden;
  padding: 12px; display: flex; flex-direction: column;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--rc) 45%, #23262f) 0%,
    color-mix(in srgb, var(--rc) 16%, #1c1f27) 55%, #16181f 100%);
  border: 1px solid color-mix(in srgb, var(--rc) 35%, var(--line));
}
.inv-card__wear { font-size: 11px; font-weight: 600; color: #fff; opacity: .8; }
.inv-card__art {
  height: 84px; margin: 8px 0; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.inv-card__art img {
  max-height: 82px; max-width: 92%; object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.55));
}
.inv-card__weapon { font-size: 12px; color: rgba(255,255,255,.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-card__name { font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px; }
.inv-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.inv-card__price { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; color: var(--gold); }
.inv-card__price .coin-img { width: 14px; height: 14px; }
.inv-card__sell {
  border: none; cursor: pointer; font-family: inherit; font-weight: 800; font-size: 12px;
  padding: 7px 12px; border-radius: 9px; color: #241701;
  background: linear-gradient(135deg, #f5b027, #e0951a);
}
.inv-card__sell:hover { filter: brightness(1.06); }
.inv-card__sell:disabled { opacity: .5; cursor: default; }

/* ---------- CASE BATTLES ---------- */
.battle-view { margin-top: 26px; --cbBlue: linear-gradient(180deg, #3b93ff, #1f6fe5); }
.cb-coin { width: 15px; height: 15px; vertical-align: -3px; }
.cb-box { width: 15px; height: 15px; vertical-align: -3px; color: var(--muted); }

/* --- lobby --- */
.cb-lobby { display: grid; grid-template-columns: 232px 1fr; gap: 18px; align-items: start; }
.cb-side {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: 16px; padding: 12px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 78px;
}
.cb-tab {
  text-align: left; background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 700; color: var(--muted); padding: 12px 14px; border-radius: 10px;
  transition: background .15s ease, color .15s ease;
}
.cb-tab:hover { color: #fff; background: rgba(255,255,255,.04); }
.cb-tab.is-active { color: #fff; background: rgba(255,255,255,.06); }
.cb-create-btn {
  margin-top: 8px; padding: 12px; border: none; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 15px; color: #fff; background: var(--cbBlue);
  box-shadow: 0 8px 20px rgba(31,111,229,.35);
}
.cb-create-btn:hover { filter: brightness(1.06); }
.cb-list { display: flex; flex-direction: column; gap: 14px; min-height: 200px; }
.cb-loading, .cb-empty { color: var(--muted); text-align: center; padding: 50px 20px; }
.cb-empty { border: 1px dashed var(--line); border-radius: 16px; }

/* battle card */
.cb-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px;
}
.cb-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cb-card__price { font-size: 22px; font-weight: 900; }
.cb-card__count { font-size: 14px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.cb-card__cases { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cb-card__case {
  width: 84px; height: 84px; border-radius: 12px; overflow: hidden; flex: 0 0 auto;
  background: #0c0f18; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
}
.cb-card__case img { width: 100%; height: 100%; object-fit: cover; }
.cb-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cb-card__slots { display: flex; gap: 8px; }
.cb-slot {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--muted);
}
.cb-slot svg { width: 20px; height: 20px; }
.cb-slot--empty { border-style: dashed; background: none; }
.cb-slot.is-you { background: rgba(139,92,246,.18); border-color: rgba(139,92,246,.4); color: var(--violet-2); }
.cb-slot.is-won { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.cb-open {
  padding: 11px 26px; border: none; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 14px; color: #fff; background: var(--cbBlue);
  box-shadow: 0 6px 16px rgba(31,111,229,.32);
}
.cb-open:hover { filter: brightness(1.07); }

/* --- create --- */
.cb-create { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.cb-cpanel {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: 16px; padding: 18px; position: sticky; top: 78px;
  display: flex; flex-direction: column;
}
.cb-back-link { align-self: flex-start; background: none; border: none; color: var(--muted); font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; margin-bottom: 14px; padding: 0; }
.cb-back-link:hover { color: #fff; }
.cb-cpanel__label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.cb-pchoice { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.cb-pchoice button {
  flex: 1; padding: 9px; border: none; border-radius: 8px; cursor: pointer; background: none;
  color: var(--muted); font-family: inherit; font-weight: 800; font-size: 15px;
}
.cb-pchoice button.is-active { background: rgba(255,255,255,.08); color: #fff; }
.cb-cost { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; font-size: 14px; color: var(--muted); }
.cb-cost b { color: #fff; font-size: 18px; font-weight: 900; }
.cb-cost__sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cb-cpanel__msg { font-size: 13px; font-weight: 700; min-height: 18px; margin-top: 10px; }
.cb-cpanel__msg.is-err { color: #f87171; }
.cb-create-submit {
  margin-top: 12px; padding: 13px; border: none; border-radius: 12px; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 15px; color: #fff; background: var(--cbBlue);
  box-shadow: 0 8px 20px rgba(31,111,229,.3);
}
.cb-create-submit:hover { filter: brightness(1.06); }
.cb-create-submit:disabled { opacity: .5; cursor: default; box-shadow: none; }

.cb-select__title { font-size: 18px; font-weight: 800; margin: 4px 0 14px; }
.cb-selected { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 26px; min-height: 40px; }
.cb-select__empty { grid-column: 1/-1; color: var(--muted); padding: 20px 0; }
.cb-sel-case, .cb-pool-case {
  position: relative; border-radius: 14px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); background: #0c0f18; text-align: left;
  aspect-ratio: 4 / 3; display: block; padding: 0;
}
.cb-sel-case img, .cb-pool-case img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cb-sel-case::after, .cb-pool-case::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(6,7,12,.9)); }
.cb-sel-case__name, .cb-pool-case__name { position: absolute; left: 10px; bottom: 26px; z-index: 1; font-weight: 800; font-size: 14px; color: #fff; text-shadow: 0 1px 4px #000; }
.cb-sel-case__price, .cb-pool-case__price { position: absolute; left: 10px; bottom: 8px; z-index: 1; font-weight: 800; font-size: 12px; color: #fff; background: rgba(0,0,0,.5); border-radius: 999px; padding: 2px 8px; }
.cb-pool-case { transition: transform .12s ease, border-color .2s ease; }
.cb-pool-case:hover { transform: translateY(-3px); border-color: var(--violet); }
.cb-sel-case { border-color: color-mix(in srgb, var(--rc) 45%, var(--line)); }
.cb-sel-x {
  position: absolute; top: 6px; right: 6px; z-index: 2; width: 24px; height: 24px; border-radius: 50%;
  border: none; cursor: pointer; background: #ef4444; color: #fff; font-size: 16px; line-height: 1; font-weight: 800;
}
.cb-sel-x:hover { filter: brightness(1.1); }
.cb-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }

@media (max-width: 760px) {
  .cb-lobby { grid-template-columns: 1fr; }
  .cb-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .cb-side .cb-tab { flex: 1; text-align: center; padding: 10px 8px; font-size: 14px; }
  .cb-create-btn { flex-basis: 100%; }
  .cb-create { grid-template-columns: 1fr; }
  .cb-cpanel { position: static; }
  .cb-card__case { width: 66px; height: 66px; }
  .cb-card__price { font-size: 19px; }
}

/* arena — VS reels (case-battle style) */
.battle-view { --cbH: 84px; }
.cb-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 0 16px; }
.cb-head__title { font-size: 22px; font-weight: 800; }
.cb-head__pot { color: var(--muted); font-size: 15px; }
.cb-head__pot b { color: var(--gold); font-size: 20px; font-weight: 900; }
.cb-head__pot .coin-img { width: 16px; height: 16px; }

.cb-players { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 12px; }
.cb-player {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: 16px; padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .3s ease, border-color .3s ease;
}
.cb-player__head { display: flex; align-items: center; gap: 8px; }
.cb-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--muted);
}
.cb-avatar.is-you { background: rgba(139,92,246,.18); border-color: rgba(139,92,246,.4); color: var(--violet-2); }
.cb-avatar svg { width: 18px; height: 18px; }
.cb-player__name { flex: 1; font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-player__total { font-weight: 900; font-size: 13px; color: var(--gold); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.cb-player__total .coin-img { width: 13px; height: 13px; }

.cb-reel {
  position: relative; height: calc(var(--cbH) * 3); overflow: hidden;
  border-radius: 12px; background: #0b0d14; border: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
.cb-reel::after {
  content: ""; position: absolute; left: 8px; right: 8px; top: 50%; height: 2px;
  transform: translateY(-50%); z-index: 3;
  background: linear-gradient(90deg, transparent, var(--violet-2), transparent);
  box-shadow: 0 0 12px var(--violet);
}
.cb-reel__strip { display: flex; flex-direction: column; will-change: transform; }
.cb-cell { height: var(--cbH); display: flex; align-items: center; justify-content: center; position: relative; }
.cb-cell::before {
  content: ""; position: absolute; inset: 7px; border-radius: 10px;
  background: radial-gradient(80% 70% at 50% 45%, color-mix(in srgb, var(--rc) 34%, transparent), transparent 70%);
}
.cb-cell img { position: relative; max-height: 62px; max-width: 82%; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }

.cb-player__won { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-won {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; color: var(--gold);
  background: rgba(0,0,0,.3); border: 1px solid color-mix(in srgb, var(--rc) 40%, var(--line)); border-radius: 8px; padding: 3px 7px;
}
.cb-won .coin-img { width: 11px; height: 11px; }

.cb-player.is-winner { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 34px -8px var(--gold); }
.cb-player.is-winner .cb-player__name { color: var(--gold); }
.cb-player.is-winner .cb-avatar { border-color: var(--gold); color: var(--gold); }

.cb-result { text-align: center; font-size: 18px; font-weight: 800; min-height: 26px; margin: 20px 0 6px; color: var(--muted); }
.cb-result.is-win { color: var(--green); }
.cb-result.is-lose { color: var(--muted); }
.cb-result .coin-img { width: 18px; height: 18px; }
.battle-again {
  display: block; margin: 8px auto 0; padding: 13px 30px; border: none; cursor: pointer;
  border-radius: 11px; font-family: inherit; font-weight: 800; font-size: 15px; color: #04201c;
  background: linear-gradient(135deg, #2dd4bf, #14b8a6);
}
.battle-again:hover { filter: brightness(1.06); }

@media (max-width: 560px) {
  .battle-view { --cbH: 58px; }
  .cb-head__title { font-size: 18px; }
  .cb-players { gap: 7px; }
  .cb-player { padding: 8px 6px; gap: 7px; }
  .cb-avatar { width: 26px; height: 26px; }
  .cb-avatar svg { width: 14px; height: 14px; }
  .cb-player__name { font-size: 11px; }
  .cb-cell img { max-height: 44px; }
}

/* The open button's price/XP meta only appears in the mobile fixed CTA. */
.open__meta { display: none; }

/* ============================================================
   MOBILE — case-open page (image → name/price → items → CTA)
   ============================================================ */
@media (max-width: 820px) {
  .case-view { margin-top: 6px; padding-bottom: 96px; }
  .case-view__back {
    position: relative; z-index: 2; margin-bottom: 10px; padding: 8px 14px; font-size: 13px;
  }
  .sound-ctl { top: 2px; }
  .sound-ctl__label { display: none; } /* keep just the toggle to save room */

  /* hero: full-bleed image on top, then centered name + price (no boxed panel).
     margin-top keeps the image from sticking to the back/sound buttons above it. */
  .case-hero {
    grid-template-columns: 1fr; border: none; background: none;
    min-height: 0; overflow: visible; margin-top: 14px; margin-bottom: 10px;
  }
  .case-hero__art {
    height: auto; aspect-ratio: 16 / 11; border-radius: 18px; overflow: hidden;
    background: radial-gradient(120% 90% at 50% 30%, rgba(139,92,246,.12), transparent 60%), #0a0c13;
  }
  .case-hero__panel { padding: 12px 8px 0; gap: 6px; background: none; }
  .case-hero__title { font-size: 30px; }
  .case-hero__price { font-size: 17px; }

  /* items grid: 2 columns with a centered heading */
  .case-contents { border-top: none; margin-top: 4px; padding-top: 4px; }
  .case-contents__title { text-align: center; font-size: 17px; }
  .case-contents__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

  /* fixed bottom OPEN button — takes the bottom bar's place while a case is open */
  body.case-open .mbar { display: none; }
  .case-hero__open {
    position: fixed; left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 110;
    min-width: 0; width: auto;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 16px; border-radius: 16px; font-size: 16px;
  }
  .open__meta { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; }
  .open__meta .coin-img { width: 16px; height: 16px; }
  .open__xp {
    font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 999px;
    background: rgba(255,255,255,.22);
  }
}
