:root {
  --bg: #0d0716;
  --panel: rgba(255, 255, 255, .055);
  --panel-brd: rgba(255, 255, 255, .1);
  --text: #f4f1ff;
  --muted: rgba(244, 241, 255, .58);
  --gold: #ffca3a;
  --gold2: #ff9f1c;
  --accent: #a06bff;
  --ok: #3ddc97;
  --danger: #ff6b7d;
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(60% 45% at 15% 0%, rgba(160, 107, 255, .28), transparent 70%),
    radial-gradient(55% 40% at 88% 8%, rgba(255, 92, 138, .22), transparent 70%),
    radial-gradient(70% 50% at 50% 110%, rgba(255, 202, 58, .16), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

.hidden { display: none !important; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ic { width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -0.12em; }

/* ================= вход ================= */
.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 18px calc(24px + var(--safe-b));
}

.auth__card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid var(--panel-brd);
  border-radius: 28px;
  padding: 28px 22px 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255,255,255,.09);
  text-align: center;
  backdrop-filter: blur(14px);
  animation: rise .5s cubic-bezier(.2,.9,.3,1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.auth__mascot {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 12px 26px rgba(255, 202, 58, .4));
  animation: float 3.4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-9px) rotate(3deg); }
}

.auth__title { margin: 8px 0 6px; font-size: clamp(24px, 6vw, 30px); letter-spacing: -.02em; }
.auth__sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.45; }

.field { display: block; text-align: left; margin-bottom: 12px; }
.field > span {
  display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 7px;
}

.field input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(0,0,0,.32);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: rgba(244,241,255,.32); font-weight: 500; }
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 202, 58, .16); }

.auth__error { min-height: 18px; margin: 0 0 8px; color: var(--danger); font-size: 13px; text-align: left; }

.primary {
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 800;
  color: #1a1024;
  cursor: pointer;
  background: linear-gradient(180deg, #ffe07a, var(--gold) 45%, var(--gold2));
  box-shadow: 0 12px 26px rgba(255, 159, 28, .32), inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform .08s ease, filter .15s;
}
.primary:hover { filter: brightness(1.06); }
.primary:active { transform: scale(.975); }
.primary:disabled { opacity: .6; cursor: default; }

.auth__note { margin: 16px 0 0; font-size: 12px; line-height: 1.5; color: rgba(244, 241, 255, .42); }

/* ================= каркас ================= */
.app {
  min-height: 100dvh;
  padding: 12px 14px calc(90px + var(--safe-b));
  max-width: 1180px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 2px 12px;
}

.me { display: flex; align-items: center; gap: 10px; min-width: 0; }

.avatar {
  position: relative;
  width: 46px; height: 46px;
  flex: none;
  padding: 0;
  border: 1px solid rgba(255, 202, 58, .4);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255,202,58,.28), rgba(255,159,28,.1));
  cursor: pointer;
  overflow: hidden;
  transition: transform .1s, border-color .15s;
}
.avatar:hover { border-color: var(--gold); }
.avatar:active { transform: scale(.95); }
.avatar__img { position: absolute; inset: 0; display: grid; place-items: center; }
.avatar__img svg { width: 100%; height: 100%; display: block; }
.avatar__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar__cam {
  position: absolute;
  right: 1px; bottom: 1px;
  width: 17px; height: 17px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: rgba(13, 7, 22, .85);
  color: var(--gold);
  font-size: 11px;
  border: 1px solid rgba(255, 202, 58, .35);
}

.me__text { min-width: 0; }
.me__nick {
  font-weight: 800; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 44vw;
}
.me__rank { font-size: 12px; color: var(--muted); }
.me__rank b { color: var(--gold); }

.topbar__actions { display: flex; align-items: center; gap: 8px; flex: none; }

.iconbtn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.iconbtn:hover { background: rgba(255,255,255,.1); color: var(--text); }

.ghost {
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ghost:hover { background: rgba(255,255,255,.1); color: var(--text); }

.board { display: grid; gap: 14px; }

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.028));
  border: 1px solid var(--panel-brd);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
}

.panel__title {
  margin: 0 0 14px;
  font-size: 15px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (min-width: 980px) {
  .app { padding: 22px 22px 30px; }
  .board {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    grid-template-areas:
      "game cases"
      "game upgrader"
      "game shop"
      "game top";
    align-items: start;
  }
  .panel--game { grid-area: game; position: sticky; top: 16px; }
  .panel--cases { grid-area: cases; }
  .panel--upgrader { grid-area: upgrader; }
  .panel--shop { grid-area: shop; }
  .panel--top  { grid-area: top; }
  .nav { display: none; }
}

/* ================= игра ================= */
.panel--game {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  padding: 20px 16px 18px;
}

.balance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}
.balance__coin { width: clamp(26px, 7vw, 38px); height: clamp(26px, 7vw, 38px); flex: none; }
.balance__num {
  font-size: clamp(34px, 10vw, 58px);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff6d6, var(--gold) 55%, var(--gold2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 18px rgba(255, 159, 28, .3));
  transition: transform .07s ease;
}
.balance__num.pop { transform: scale(1.05); }
.balance__cap {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin: 4px 0 6px;
}

.hamster {
  position: relative;
  width: min(72vw, 300px);
  aspect-ratio: 1;
  margin: 4px 0;
  padding: 0;
  border: 2px solid rgba(255, 202, 58, .26);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 202, 58, .26), rgba(255, 159, 28, .08) 55%, transparent 72%),
    rgba(255, 255, 255, .025);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  display: grid;
  place-items: center;
  transition: transform .07s ease, border-color .2s;
}
.hamster:active { transform: scale(.94); }
.hamster:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.hamster__face {
  width: 84%;
  height: 84%;
  filter: drop-shadow(0 16px 28px rgba(0,0,0,.45));
  transition: transform .09s ease;
  pointer-events: none;
}
.hamster.tap .hamster__face { transform: scale(.92) rotate(-4deg); }

.hamster__glow {
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,202,58,.2), transparent 65%);
  animation: pulse 2.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulse {
  0%, 100% { transform: scale(.96); opacity: .5; }
  50%      { transform: scale(1.08); opacity: 1; }
}

.hamster__badge {
  position: absolute;
  bottom: 8%;
  right: 2%;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(12, 7, 22, .8);
  border: 1px solid rgba(255, 202, 58, .45);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
}
.stat .ic { width: 14px; height: 14px; color: var(--gold); }
.stat b { color: var(--text); font-variant-numeric: tabular-nums; }

.hint {
  margin: 12px 2px 0;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(244, 241, 255, .38);
  text-align: center;
}
.hint b { color: rgba(255, 202, 58, .85); }

/* всплывающие +N */
.plus {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  font-weight: 900;
  font-size: 22px;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(255, 159, 28, .6);
  animation: plusUp .85s ease-out forwards;
  will-change: transform, opacity;
}
.plus.crit { color: #fff3b0; font-size: 27px; text-shadow: 0 0 18px rgba(255,220,120,.95); }
@keyframes plusUp {
  0%   { transform: translate(-50%, -50%) scale(.7); opacity: 1; }
  25%  { transform: translate(-50%, -70%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -230%) scale(.9); opacity: 0; }
}

/* ================= апгрейды ================= */
.card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.075);
  margin-bottom: 9px;
  transition: border-color .2s, background .2s;
}
.card.afford { border-color: rgba(255, 202, 58, .3); background: rgba(255, 202, 58, .06); }
.card__icon {
  width: 44px; height: 44px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 13px;
  font-size: 21px;
  background: linear-gradient(180deg, rgba(160,107,255,.28), rgba(160,107,255,.08));
  border: 1px solid rgba(160,107,255,.3);
  color: #d8c4ff;
}
.card__body { flex: 1; min-width: 0; }
.card__body h3 { margin: 0 0 2px; font-size: 14.5px; }
.card__body p { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.card__body b { color: var(--gold); }
.card__body .lvl {
  display: inline-block;
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(244,241,255,.42);
}

.buy {
  flex: none;
  min-width: 88px;
  padding: 10px 10px;
  border-radius: 13px;
  border: 1px solid rgba(255, 202, 58, .4);
  background: linear-gradient(180deg, rgba(255, 224, 122, .95), rgba(255, 159, 28, .95));
  color: #1a1024;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .08s, filter .15s, opacity .15s;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.buy .ic { width: 13px; height: 13px; }
.buy:hover:not(:disabled) { filter: brightness(1.07); }
.buy:active:not(:disabled) { transform: scale(.96); }
.buy:disabled {
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.1);
  color: rgba(244,241,255,.4);
  cursor: default;
}
.buy:disabled .ic { opacity: .5; }

/* ================= топ ================= */
.leaders { list-style: none; margin: 0; padding: 0; }
.leaders li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  font-size: 14px;
}
.leaders li:last-child { border-bottom: 0; }
.leaders__place {
  width: 24px; flex: none; text-align: center;
  font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted);
}
.leaders li.top1 .leaders__place { color: #ffd700; }
.leaders li.top2 .leaders__place { color: #cfd8e3; }
.leaders li.top3 .leaders__place { color: #e0955a; }
.leaders__ava {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 202, 58, .12);
  border: 1px solid rgba(255, 202, 58, .22);
  display: grid;
  place-items: center;
}
.leaders__ava svg, .leaders__ava img { width: 100%; height: 100%; display: block; object-fit: cover; }
.leaders__nick {
  flex: 1; min-width: 0; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.leaders__sum { flex: none; font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 700; }
.leaders li.mine {
  background: rgba(255, 202, 58, .1);
  border-radius: 12px;
  border-bottom-color: transparent;
  padding-left: 8px; padding-right: 8px;
}
.leaders__empty { color: var(--muted); font-size: 13px; padding: 12px 0; }

/* ================= нижнее меню ================= */
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 7px 10px calc(7px + var(--safe-b));
  background: rgba(13, 7, 22, .9);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(255,255,255,.08);
}
.nav__item {
  border: 0;
  background: transparent;
  color: rgba(244,241,255,.5);
  font-size: 10px;
  font-weight: 700;
  padding: 6px 2px;
  border-radius: 14px;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 2px;
  transition: background .15s, color .15s;
}
.nav__item .ic { width: 19px; height: 19px; }
.nav__item.on { background: rgba(255, 202, 58, .14); color: var(--gold); }

/* ================= тост ================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-b));
  transform: translate(-50%, 14px);
  z-index: 60;
  padding: 11px 16px;
  border-radius: 14px;
  background: rgba(20, 12, 32, .96);
  border: 1px solid rgba(255,255,255,.14);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: min(90vw, 420px);
  text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ================= кейсы ================= */
.panel__sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 10px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel__subNote { color: var(--gold); font-size: 11.5px; letter-spacing: 0; text-transform: none; }

.cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.casecard {
  position: relative;
  overflow: hidden;
  padding: 14px 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.09);
  text-align: center;
  display: grid;
  gap: 6px;
  justify-items: center;
}
.casecard::before {
  content: "";
  position: absolute;
  inset: -45% 18% 52% 18%;
  background: radial-gradient(circle, var(--cc), transparent 70%);
  filter: blur(26px);
  opacity: .55;
  pointer-events: none;
}
.casecard__icon { width: 52px; height: 52px; color: var(--cc); position: relative; }
.casecard__name { font-size: 12.5px; font-weight: 700; position: relative; line-height: 1.25; }
.casecard__price {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted); position: relative;
  font-variant-numeric: tabular-nums;
}
.casecard__price .ic { width: 12px; height: 12px; }
.casecard__btn {
  position: relative;
  width: 100%;
  padding: 9px 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.09);
  color: var(--text);
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, transform .08s;
}
.casecard__btn:hover:not(:disabled) { background: rgba(255,255,255,.16); }
.casecard__btn:active:not(:disabled) { transform: scale(.97); }
.casecard__btn:disabled { opacity: .4; cursor: default; }

/* ================= предметы ================= */
.r-common    { --rc: #b0b6c3; }
.r-uncommon  { --rc: #4ad991; }
.r-rare      { --rc: #4aa8ff; }
.r-epic      { --rc: #b06bff; }
.r-legendary { --rc: #ffb020; }
.r-mythic    { --rc: #ff4d6d; }

.inv {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
}
.inv .empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 0;
  text-align: center;
  color: rgba(244,241,255,.38);
  font-size: 12.5px;
}

.item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 9px 5px 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-bottom-color: var(--rc);
  cursor: pointer;
  text-align: center;
  transition: transform .1s, background .15s, border-color .15s, box-shadow .15s;
  overflow: hidden;
}
.item:hover { background: rgba(255,255,255,.085); }
.item:active { transform: scale(.96); }
.item__icon { width: 30px; height: 30px; color: var(--rc); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--rc) 45%, transparent)); }
.item__name {
  font-size: 10.5px; line-height: 1.2; color: rgba(244,241,255,.82);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.item__val {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10px; color: rgba(244,241,255,.5); font-variant-numeric: tabular-nums;
}
.item__val .ic { width: 10px; height: 10px; }
.item__qty {
  position: absolute; top: 4px; right: 5px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(0,0,0,.6);
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
}
.item.sel {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(255, 202, 58, .3), 0 0 22px rgba(255, 202, 58, .18);
  background: rgba(255, 202, 58, .1);
}
.item.target {
  border-color: var(--rc);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 45%, transparent);
}

.item--big { width: 100%; padding: 16px 10px; gap: 6px; }
.item--big .item__icon { width: 66px; height: 66px; }
.item--big .item__name { font-size: 14px; -webkit-line-clamp: 3; }
.item--big .item__val { font-size: 12px; }

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
}

/* ================= рулетка кейса ================= */
.roulette { position: relative; min-width: 0; margin: 12px -6px 2px; }
.roulette__viewport {
  overflow: hidden;
  padding: 10px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.roulette__strip {
  display: flex;
  gap: 6px;
  will-change: transform;
  backface-visibility: hidden;
}
.roulette__card {
  flex: 0 0 74px;
  height: 94px;
  padding: 9px 4px 6px;
  gap: 3px;
  align-content: start;
  cursor: default;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.roulette__card .item__icon { width: 34px; height: 34px; filter: none; }
.roulette__card .item__name { font-size: 9.5px; }
.roulette__card .item__val { display: none; }
.roulette__card.win {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 0 0 2px var(--gold), 0 0 26px rgba(255, 202, 58, .45);
  border-color: var(--gold);
  z-index: 2;
}
.roulette__marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--gold) 16%, var(--gold) 84%, transparent);
  box-shadow: 0 0 12px rgba(255, 202, 58, .85);
  pointer-events: none;
}
.roulette__marker::before,
.roulette__marker::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}
.roulette__marker::before { top: -1px; border-top: 7px solid var(--gold); }
.roulette__marker::after { bottom: -1px; border-bottom: 7px solid var(--gold); }

/* ================= апгрейдер ================= */
.upg { display: grid; gap: 14px; }
@media (min-width: 640px) {
  .upg { grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
}
.upg__wheelBox { display: grid; justify-items: center; gap: 8px; }

.wheel { position: relative; width: min(56vw, 208px); aspect-ratio: 1; }
.wheel__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
  display: block;
}
.wheel__track {
  fill: none;
  stroke: rgba(255, 92, 108, .16);
  stroke-width: 13;
}
.wheel__spin {
  transform-box: view-box;
  transform-origin: 60px 60px;
  will-change: transform;
  backface-visibility: hidden;
}
.wheel__glow {
  fill: none;
  stroke: var(--gold);
  stroke-width: 26;
  stroke-linecap: butt;
  stroke-dasharray: 0 400;
  opacity: .14;
  transition: stroke-dasharray .35s ease, stroke .3s ease;
}
.wheel__fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 13;
  stroke-linecap: butt;
  stroke-dasharray: 0 400;
  transition: stroke-dasharray .35s ease, stroke .3s ease;
}
.wheel__ticks { stroke: rgba(255, 255, 255, .2); stroke-width: .9; }
.wheel__ticks .big { stroke: rgba(255, 255, 255, .55); stroke-width: 1.5; }

.wheel__hub {
  position: absolute;
  inset: 25%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 34%, rgba(255, 255, 255, .1), rgba(12, 7, 20, .94) 72%);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, .65), 0 6px 18px rgba(0, 0, 0, .35);
}
.wheel__icon {
  width: 54%;
  height: 54%;
  color: rgba(255, 202, 58, .85);
  transform-origin: 50% 50%;
}
.wheel.spinning .wheel__icon { animation: hubPulse .55s ease-in-out infinite; }
@keyframes hubPulse {
  0%, 100% { transform: scale(1); opacity: .85; }
  50%      { transform: scale(1.14); opacity: 1; }
}

.wheel__pointer {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 13px solid var(--gold);
  filter: drop-shadow(0 0 6px rgba(255, 202, 58, .65));
  pointer-events: none;
  z-index: 2;
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: 0;
  pointer-events: none;
}
.wheel.win::after { border-color: #3ddc97; animation: ringPulse .9s ease-out; }
.wheel.lose::after { border-color: #ff5c6c; animation: ringPulse .7s ease-out; }
@keyframes ringPulse {
  0%   { opacity: .95; transform: scale(.94); }
  100% { opacity: 0; transform: scale(1.14); }
}
.wheel.lose { animation: wheelShake .42s ease-in-out; }
@keyframes wheelShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  45%      { transform: translateX(3px); }
  70%      { transform: translateX(-2px); }
}

.upg__chance b { transition: color .2s ease; }
.upg__note {
  min-height: 16px;
  margin: 0;
  max-width: 230px;
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
  color: rgba(244, 241, 255, .45);
}
.upg__note.warn { color: #ff8b9a; }
.upg__note.good { color: #6fe3a1; }

.upg__chance { display: grid; justify-items: center; line-height: 1.2; }
.upg__chance b {
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.upg__chance span { font-size: 11.5px; color: var(--muted); }

.upg__go {
  width: 100%;
  max-width: 230px;
  padding: 13px;
  font-size: 15px;
}
.upg__go:disabled { filter: grayscale(.6); }

.upg__side { min-width: 0; }
.upg__sum {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 202, 58, .13);
  color: var(--gold);
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 800;
}

/* ================= модалка ================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 20px;
  background: rgba(6, 3, 12, .8);
  backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.modal.on { opacity: 1; pointer-events: auto; }
.modal__card {
  width: min(340px, 100%);
  min-width: 0;
  padding: 22px 18px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
  text-align: center;
  transform: scale(.94);
  transition: transform .22s cubic-bezier(.2,.9,.3,1);
}
.modal.on .modal__card { transform: scale(1); }
.modal__title { margin: 0 0 4px; font-size: 17px; }
.modal__title[class*=" r-"] { color: var(--rc); }
.modal__text { margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.modal__btns { display: flex; gap: 8px; margin-top: 14px; }
.modal__btns > * { flex: 1; }

.reveal { display: grid; justify-items: center; gap: 10px; padding: 8px 0 14px; }
.reveal__case { width: 86px; height: 86px; color: var(--gold); animation: caseShake .9s ease-in-out infinite; }
@keyframes caseShake {
  0%, 100% { transform: rotate(-7deg) scale(1); }
  50%      { transform: rotate(7deg) scale(1.06); }
}
.reveal__label { font-size: 12.5px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

