/* ——— SO2 Cases: тёмная тема в стиле Standoff 2 ——— */
:root {
  --bg: #0c0f16;
  --bg2: #121724;
  --panel: #161c2b;
  --panel2: #1d2436;
  --line: #262f45;
  --text: #e8edf7;
  --muted: #8b96ad;
  --gold: #ffd76b;
  --accent: #ff5f1f;
  --blue: #4f8cff;
  --green: #3ddc97;
  --radius: 14px;
  --radius-sm: 10px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --btn-h: 40px;
  --font-main: 'Inter', 'SN Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --success: #3ddc97;
  --danger: #ff4d6d;
  --primary: #4f8cff;
  --bg-e: #141a28;
  --bg-c: #0b0e15;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: hidden; scroll-behavior: smooth; }
body {
  overflow-x: hidden;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(79, 140, 255, .18), transparent 60%),
    radial-gradient(900px 400px at 0% 0%, rgba(255, 95, 31, .14), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
main { max-width: 1180px; margin: 0 auto; padding: 18px; }

/* цифры — моноширинные, хорошо различимы */
.chip b, .price, #goldValue, #openedValue, #invTotal, .inp,
.odd b, .upg__slot em, .card__meta b, .inspect__price,
.gresult b, .stat b {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

/* ——— HUD ——— */
.hud {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 18px;
  background: rgba(12, 15, 22, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hud__brand { display: flex; align-items: center; gap: 10px; }
.hud__logo {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff9d3f);
  border-radius: 11px; font-size: 20px; color: #1a1205;
}
.hud__titles b { display: block; font-size: 17px; letter-spacing: .08em; }
.hud__titles small { color: var(--muted); font-size: 11px; }
.hud__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  font-weight: 700; font-size: 14px;
}
.chip--gold { color: var(--gold); border-color: rgba(255, 215, 107, .4); }

.iconbtn {
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font-size: 15px;
}
.iconbtn:hover { background: var(--panel2); }

/* ——— Кнопки: понятные состояния (наведение / нажатие / отключение / фокус) ——— */
.btn {
  border: 1px solid transparent; cursor: pointer;
  min-height: var(--btn-h); padding: 9px 16px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 14px; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .12s, filter .15s, background .15s, box-shadow .15s, opacity .15s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.1); }
.btn:active:not(:disabled) { transform: translateY(1px); filter: brightness(.96); }
.btn:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(79, 140, 255, .3);
}
.btn:disabled {
  opacity: .45; cursor: not-allowed; filter: grayscale(.7) brightness(.8);
  transform: none;
}
.btn--primary { background: var(--blue); color: #fff; }
.btn--accent { background: linear-gradient(135deg, var(--accent), #ff9d3f); color: #20120a; }
.btn--ghost { background: var(--panel2); color: var(--text); border-color: var(--line); }
.btn--ghost:hover:not(:disabled) { border-color: var(--blue); }
.btn--primary:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -2px 0 rgba(0,0,0,.28), 0 4px 0 -1px rgba(0,0,0,.45), 0 8px 22px -8px rgba(79,140,255,.9); }
.btn--accent:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -2px 0 rgba(0,0,0,.28), 0 4px 0 -1px rgba(0,0,0,.45), 0 8px 22px -8px rgba(255,95,31,.9); }
.btn--bonus:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 4px 0 -1px rgba(0,0,0,.45), 0 8px 22px -8px rgba(255,182,72,.9); }
.btn--danger { background: #3a1620; color: #ff7a90; border-color: #58202e; }
.btn--danger:hover:not(:disabled) { background: #4d1a28; }
.btn--bonus { background: linear-gradient(135deg, #ffe08a, #ffb648); color: #2a1c02; }
.btn--mini { padding: 6px 12px; min-height: 34px; font-size: 13px; }

/* ——— Табы ——— */
.tabs {
  display: flex; gap: 6px; max-width: 1180px; margin: 0 auto; padding: 14px 18px 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 0 0 auto; min-height: 42px; padding: 10px 18px; cursor: pointer; font-family: inherit;
  background: transparent; color: var(--muted); border: 1px solid transparent;
  border-radius: 10px 10px 0 0; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.tab-btn:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.tab-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.tab-btn.is-active {
  color: var(--text); background: var(--panel);
  border-color: var(--line); border-bottom-color: var(--panel);
}
.tab-btn__count {
  background: var(--blue); color: #fff; font-size: 11px;
  padding: 1px 7px; border-radius: 999px;
}
.tab { display: none; }
.tab.is-active { display: block; animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-head h1 { margin: 8px 0 4px; font-size: clamp(21px, 3vw, 26px); font-weight: 800; letter-spacing: -.01em; }
.section-head h2 { margin: 20px 0 4px; font-size: clamp(17px, 2.4vw, 19px); font-weight: 800; }
.section-head p { margin: 0 0 16px; color: var(--muted); font-size: 14px; max-width: 720px; }
.section-head--row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font-family: inherit; font-size: 14px;
}

/* ——— Кейсы ——— */
.cases {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
}
.case {
  background: linear-gradient(160deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; position: relative; overflow: hidden;
  transition: transform .15s, border-color .15s;
}
.case::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(220px 120px at 50% -20%, color-mix(in srgb, var(--t0, #4f8cff) 32%, transparent), transparent 70%);
  pointer-events: none;
}
.case:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--t0, #4f8cff) 65%, transparent); }
.case--locked { opacity: .62; }
.case h3 { margin: 10px 0 2px; font-size: 17px; position: relative; }
.case__note { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; position: relative; min-height: 32px; }
.case__art { display: grid; place-items: center; position: relative; }
.case__box {
  font-size: 54px; line-height: 1;
  filter: drop-shadow(0 8px 18px color-mix(in srgb, var(--t0, #4f8cff) 55%, transparent));
  animation: none;
}
@media (prefers-reduced-motion: no-preference) {
  .case__box { animation: floaty 3.4s ease-in-out infinite; }
  .upg__arrowbig { animation: upgPulse 1.4s ease-in-out infinite; }
  .reel__marker { animation: markerPulse 1.1s ease-in-out infinite; }
}
@keyframes markerPulse { 50% { box-shadow: 0 0 26px var(--accent); filter: brightness(1.35); } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
.case__preview { display: flex; gap: 8px; margin: 10px 0 12px; position: relative; min-height: 86px; }
.case-chip {
  flex: 1; text-align: center; overflow: hidden;
  background: linear-gradient(165deg,
    color-mix(in srgb, var(--r, #4f7dff) 16%, #11151f) 0%, #0b0e15 80%);
  border: 1px solid color-mix(in srgb, var(--r, #4f7dff) 50%, transparent);
  border-radius: 10px; padding: 4px 4px 6px;
}
.case-chip .art-img {
  width: 134%; margin-left: -17%;
}
/* реальные картинки оружия с вики Standoff 2 */
/* реальные картинки оружия с вики Standoff 2
   --k / --o выставляет trim.js по bbox содержимого (обрезка полей) */
.art-img {
  display: block; width: 100%; height: auto;
  object-fit: contain; object-position: center;
  transform: scale(var(--k, 1));
  transform-origin: var(--o, 50% 50%);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55));
  transition: transform .18s;
}
.case-chip .art-img { height: 52px; }
.case__note { overflow-wrap: anywhere; }
.card__name, .reel__label, .upg__slotname { overflow-wrap: anywhere; }
.card:hover .art-img, .case:hover .art-img {
  transform: scale(calc(var(--k, 1) * 1.07)) rotate(-2deg);
}
.reel__cell .art-img { height: 86px; }
.reel__cell { justify-content: center; }
.reel__label { line-height: 1.2; }
.result__card .result__art .art-img { max-width: 420px; }
.result__card .result__art { min-height: 150px; }
.art-img--failed { opacity: 0; }

.case-chip span {
  display: block; font-size: 10px; color: var(--r); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.case__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; }
.price { font-weight: 800; color: var(--gold); }

/* ——— Карточки предметов ——— */
/* единая сетка карточек: широкая на десктопе, меньше на планшете, 1–2 на телефоне */
.inv, .stats {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}
.card {
  background: linear-gradient(170deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.card::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--r); box-shadow: 0 0 14px var(--r);
}
.card__rarity {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--r); font-weight: 800;
}
/* фон в зависимости от редкости + обрезка пустых полей у картинки.
   Фиксированная высота ниши = одинаковый размер оружия на одинаковом фоне. */
.card__art, .reel__art, .result__art, .case-chip {
  position: relative; overflow: hidden;
}
/* ——— Редкости как в Standoff 2: фон тайла подсвечен цветом редкости ——— */
.card, .reel__cell, .upg__slot, .result__card, .case-chip {
  background: linear-gradient(165deg,
    color-mix(in srgb, var(--r, #4f7dff) 16%, #11151f) 0%,
    #0b0e15 78%);
}
.card { border-color: color-mix(in srgb, var(--r, var(--line)) 45%, transparent); }
.reel__cell { border-color: color-mix(in srgb, var(--r, #4f7dff) 55%, transparent); }
.upg__slot { border-color: color-mix(in srgb, var(--r, var(--line)) 50%, transparent); }
.result__card { border-color: color-mix(in srgb, var(--r, #4f7dff) 60%, #262f45); }
.case-chip { border: 1px solid color-mix(in srgb, var(--r, #4f7dff) 45%, transparent); border-radius: 10px; padding: 4px 4px 6px; }
.card__art {
  height: 132px; display: grid; place-items: center;
  background: none; border: none;
  border-radius: 10px; padding: 2px;
}
.card__art .art-img { max-height: 120px; }
.card__art::after, .reel__cell::after, .result__card::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--r), transparent);
  opacity: .65;
}
.card:hover .card__art .art-img {
  transform: scale(calc(var(--k, 1) * 1.07)) rotate(-2deg);
}
.card__name { font-weight: 800; font-size: 14.5px; line-height: 1.25; }
.card__meta {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12.5px; color: var(--muted);
}
.card__meta b { color: var(--gold); }
.card__actions { display: flex; gap: 8px; margin-top: auto; }

/* ——— Осмотр оружия ——— */
.inspect {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center; padding: 16px;
  background: rgba(4, 6, 11, .93); backdrop-filter: blur(8px);
}
.inspect__panel {
  width: min(760px, 100%); max-height: 94vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px color-mix(in srgb, var(--r, #4f8cff) 22%, transparent);
}
.inspect__head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.inspect__weapon {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--r, var(--muted));
}
.inspect__head h2 { margin: 4px 0 0; font-size: 24px; }
.inspect__stage {
  position: relative;
  height: 300px; margin: 14px 0;
  display: grid; place-items: center;
  border-radius: 14px; cursor: grab;
  background:
    radial-gradient(400px 200px at 50% 60%, color-mix(in srgb, var(--r, #4f8cff) 20%, transparent), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 39px, rgba(255,255,255,.04) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.04) 39px 40px);
  overflow: hidden;
}
.inspect__stage:active { cursor: grabbing; }

/* тень на «полу» под оружием — пульсирует синхронно с покачиванием */
.inspect__stage::after {
  content: ''; position: absolute; left: 50%; bottom: 18px;
  width: 44%; height: 16px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, .6), transparent 70%);
  filter: blur(3px); z-index: 1; pointer-events: none;
  transform: translateX(-50%);
  animation: shadowPulse 3.6s ease-in-out infinite;
}
@keyframes shadowPulse {
  0%, 100% { transform: translateX(-50%) scaleX(1); opacity: .65; }
  50% { transform: translateX(-50%) scaleX(.84); opacity: .4; }
}

/* «доставание» оружия: въезд сбоку + полный проворот, как в оригинальном SO2 */
.inspect__rig {
  position: relative; width: min(460px, 80%);
  transform-style: preserve-3d; z-index: 2;
  animation: inspectDraw 1.15s cubic-bezier(.18, .8, .25, 1) both;
  will-change: transform;
}
@keyframes inspectDraw {
  0%   { opacity: 0; transform: translate(46%, 42%) rotateZ(-34deg) rotateY(-150deg) scale(.55); }
  25%  { opacity: 1; }
  55%  { transform: translate(-3%, -7%) rotateZ(7deg) rotateY(105deg) scale(1.07); }
  78%  { transform: translate(1%, -2%) rotateZ(-4deg) rotateY(290deg) scale(.98); }
  92%  { transform: translate(0, 1%) rotateZ(1.5deg) rotateY(350deg) scale(1.01); }
  100% { opacity: 1; transform: translate(0, 0) rotateZ(0deg) rotateY(360deg) scale(1); }
}

/* «рука» с оружием: после входа — живое покачивание */
.inspect__float {
  position: relative; width: 100%;
  animation: inspectSwing 3.6s ease-in-out 1.2s infinite;
  will-change: transform;
}
@keyframes inspectSwing {
  0%, 100% { transform: translateY(0) rotate(-2.4deg); }
  50%      { transform: translateY(-14px) rotate(2.4deg); }
}

/* блик, пробегающий по оружию */
.inspect__gloss {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg,
    transparent 40%, rgba(255, 255, 255, .3) 50%, transparent 60%);
  background-size: 320% 100%;
  background-position: 130% 0;
  mix-blend-mode: screen;
  animation: glossSweep 3.6s ease-in-out .6s infinite;
}
@keyframes glossSweep {
  0%   { background-position: 130% 0; }
  55%  { background-position: -70% 0; }
  100% { background-position: -70% 0; }
}

/* редкая искра-блик на оружии */
.inspect__spark {
  position: absolute; left: 50%; top: 44%; z-index: 4;
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff; opacity: 0; pointer-events: none;
  box-shadow: 0 0 16px 5px rgba(255, 255, 255, .8);
  animation: sparkPop 3.6s ease-in-out infinite;
}
@keyframes sparkPop {
  0%, 72%, 100% { opacity: 0; transform: scale(.4); }
  80%           { opacity: 1; transform: scale(1.5); }
  90%           { opacity: 0; transform: scale(.6); }
}

.inspect__box {
  width: 100%; transform-style: preserve-3d;
  transition: transform .05s linear;
}
.inspect__box .art-img {
  width: 100%;
  transform: scale(var(--k, 1));
  transform-origin: var(--o, 50% 50%);
}
.inspect__anim { text-align: center; margin-bottom: 10px; }
.inspect__anim img { max-width: 100%; max-height: 220px; border-radius: 12px; background: #000; }
.inspect__bar {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(0, 0, 0, .25);
}
.inspect__rarity { color: var(--r, #4f8cff); font-weight: 700; }
.inspect__meta { color: var(--muted); font-size: 13px; flex: 1; }
.inspect__price { color: var(--gold); }
.inspect__controls { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ctl {
  padding: 9px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-e); color: var(--text);
  font: inherit; font-size: 14px; transition: .15s;
}
.ctl:hover { border-color: var(--r, #4f8cff); }
.ctl.is-on { background: var(--r, #4f8cff); color: #08090d; border-color: transparent; font-weight: 700; }
#insZoomIn, #insZoomOut { font-size: 18px; padding: 4px 16px; }
.inspect__hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* ——— Рефлексы раскрытия кейса ——— */
.reveal-flash {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, #fff 0%, var(--r) 45%, transparent 75%);
  animation: flash .9s ease-out forwards;
}
@keyframes flash { 0% { opacity: .95; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.6); } }

.confetti {
  position: absolute; top: -14px; z-index: 4; width: 9px; height: 14px;
  border-radius: 2px; pointer-events: none; opacity: .95;
  animation: confettiFall 1.6s ease-in forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(340px) rotate(560deg); opacity: 0; }
}

.result__inspect { margin-top: 10px; }
.result__card .art-img { cursor: pointer; }

/* ——— Казино ——— */
.gametabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.gametab {
  padding: 10px 18px; border-radius: 12px; cursor: pointer; font: inherit; font-weight: 700;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); transition: .15s;
}
.gametab:hover { border-color: var(--accent); color: var(--text); }
.gametab.is-active {
  background: linear-gradient(160deg, var(--accent), var(--primary));
  color: #fff; border-color: transparent; box-shadow: 0 6px 20px rgba(79, 140, 255, .35);
}
.gstage {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 20px; min-height: 340px;
}
.gstage h3 { margin: 0 0 10px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.gresult { min-height: 22px; font-weight: 700; color: var(--muted); }
.gresult.is-win { color: var(--success, #3ddc97); }
.gresult.is-lose { color: var(--danger, #ff4d6d); }
.muted { color: var(--muted); }

.betrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.betrow input, .select, .upg input {
  background: var(--bg-e); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 9px 12px; font: inherit; width: 130px;
}
.select { cursor: pointer; }
.betq { display: flex; gap: 6px; }
.betq button {
  border: 1px solid var(--line); background: var(--bg-e); color: var(--muted);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px;
}
.betq button:hover { color: var(--text); border-color: var(--accent); }

/* Апгрейд v2 — как в популярных кейс-рулетках: дуэль предметов + бар зон */
.upg--v2 { display: flex; flex-direction: column; gap: 18px; }
.upg__gallery {
  background: var(--bg-e); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px;
}
.upg__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.upg__head h3 { margin: 0; font-size: 14px; color: var(--text); letter-spacing: .5px; }
.upg__slots {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px; max-height: 210px; overflow: auto; padding: 4px 6px 4px 0;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.upg__empty { grid-column: 1 / -1; text-align: center; padding: 24px 8px; }
.upg__slot {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 6px; border-radius: 12px; cursor: pointer; position: relative;
  background: linear-gradient(165deg,
    color-mix(in srgb, var(--r, #4f7dff) 16%, #11151f) 0%, #0b0e15 80%);
  border: 1px solid color-mix(in srgb, var(--r, var(--line)) 50%, transparent);
  color: var(--text); font: inherit; font-size: 10px; text-align: center;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.upg__slot .art-img { background: none; }
.upg__slot:hover { transform: translateY(-3px); border-color: var(--r); }
.upg__slot.is-sel {
  border-color: var(--r); transform: translateY(-3px);
  box-shadow: 0 0 22px color-mix(in srgb, var(--r) 65%, transparent);
}
.upg__slot.is-sel::after {
  content: '✓'; position: absolute; top: 5px; right: 7px;
  width: 18px; height: 18px; border-radius: 50%; font-size: 11px; line-height: 18px;
  background: var(--r); color: #07090d; font-weight: 900;
}
.upg__slotname { line-height: 1.15; font-weight: 700; }
.upg__slot em { font-style: normal; color: var(--muted); font-size: 9.5px; }

/* панель: дуэль предметов */
.upg__panel {
  background: var(--bg-e); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px;
  display: flex; flex-direction: column; gap: 16px;
}
.upg__duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.upg__side {
  border-radius: 14px; padding: 12px; text-align: center;
  display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center;
  border: 1px solid color-mix(in srgb, var(--r, var(--line)) 45%, transparent);
  background: linear-gradient(180deg, #10141d, #0b0e15);
  min-height: 170px;
}
.upg__side--from { --r: #4f8cff; }
.upg__side--to { --r: #3ddc97; }
.upg__sidelabel {
  font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); font-weight: 800;
}
.upg__sidebody { display: flex; flex-direction: column; gap: 4px; align-items: center; font-size: 12px; }
.upg__sidebody b { font-size: 13px; }
.upg__sidebody em { font-style: normal; color: var(--gold); font-size: 11.5px; }
.upg__sidebody .art-img { max-width: 150px; }
.upg__vs {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.upg__arrowbig { font-size: 34px; color: var(--accent); }
@keyframes upgPulse { 50% { transform: translateX(6px); opacity: .7; } }
.upg__multbig {
  font-size: 20px; font-weight: 900; color: var(--gold);
  background: var(--bg-c); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px;
}

/* ——— Колесо апгрейда: премиум-прибор (металл, свечение, игла) ——— */
.upg__wheelpart {
  display: flex; gap: 30px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.upg__gaugewrap { position: relative; padding: 18px; }
.upg__gaugewrap::before {           /* ореол за колесом */
  content: ''; position: absolute; inset: -6px; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle, rgba(79, 140, 255, .22), transparent 68%);
  filter: blur(16px); pointer-events: none;
}
.upg__gauge {
  position: relative; width: 272px; height: 272px; border-radius: 50%; z-index: 1;
  background:
    radial-gradient(circle at 36% 26%, #1a2233, #10151f 55%, #0a0d14 78%);
  box-shadow:
    0 24px 54px -18px rgba(0, 0, 0, .85),
    inset 0 1px 0 rgba(255, 255, 255, .1),
    inset 0 -10px 26px rgba(0, 0, 0, .7),
    0 0 0 1px var(--line);
}
.upg__gauge::after {                /* металлический обод */
  content: ''; position: absolute; inset: -11px; border-radius: 50%; z-index: 0;
  background: conic-gradient(from 210deg,
    #6d82ad, #2a344e, #8fa5d0, #1f2740, #6d82ad);
  -webkit-mask: radial-gradient(circle, transparent 0 87%, #000 88%);
  mask: radial-gradient(circle, transparent 0 87%, #000 88%);
  opacity: .95;
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .9);
}
.upg__arc {
  position: absolute; inset: 0; border-radius: 50%; z-index: 1;
  -webkit-mask: radial-gradient(circle, transparent 0 64%, #000 65%);
  mask: radial-gradient(circle, transparent 0 64%, #000 65%);
  filter:
    drop-shadow(0 0 10px rgba(0, 0, 0, .55))
    drop-shadow(0 0 6px color-mix(in srgb, var(--success) 22%, transparent));
}
.upg__arc::after {                  /* внутренний хайрлайн дуги */
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  -webkit-mask: radial-gradient(circle, transparent 0 63.4%, #000 64%, #000 65.4%, transparent 66%);
  mask: radial-gradient(circle, transparent 0 63.4%, #000 64%, #000 65.4%, transparent 66%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.upg__ticks {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none; z-index: 2;
  background:
    repeating-conic-gradient(from 0deg,
      rgba(255,255,255,.34) 0 .55deg, transparent .55deg 9deg),
    repeating-conic-gradient(from 0deg,
      rgba(255,255,255,.75) 0 1deg, transparent 1deg 45deg);
  -webkit-mask: radial-gradient(circle, transparent 0 66%, #000 67% 74%, transparent 75%);
  mask: radial-gradient(circle, transparent 0 66%, #000 67% 74%, transparent 75%);
  opacity: .55;
}
.upg__ring {
  position: absolute; inset: -14px; border-radius: 50%; pointer-events: none; z-index: 0;
  box-shadow: 0 0 0 0 transparent; transition: box-shadow .5s; opacity: 0;
}
.upg__gauge.is-win .upg__ring { opacity: 1; box-shadow: 0 0 54px 8px color-mix(in srgb, var(--success) 60%, transparent), inset 0 0 34px color-mix(in srgb, var(--success) 35%, transparent); }
.upg__gauge.is-lose .upg__ring { opacity: 1; box-shadow: 0 0 54px 8px color-mix(in srgb, var(--danger) 60%, transparent), inset 0 0 34px color-mix(in srgb, var(--danger) 35%, transparent); }
.upg__needle {
  position: absolute; inset: 12px; z-index: 5; pointer-events: none;
}
.upg__needle i {
  position: absolute; left: 50%; top: 50%;
  width: 6px; height: calc(50% - 6px);
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%);
  background: linear-gradient(180deg, #ffffff 0%, #eaf0fa 45%, #93a7cd 100%);
  border-radius: 6px 6px 3px 3px;
  box-shadow: 0 0 12px rgba(255, 255, 255, .75), 0 3px 8px rgba(0, 0, 0, .65);
}
.upg__needle i::before {            /* остриё */
  content: ''; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  border: 9px solid transparent; border-top-color: #fff;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .8));
}
.upg__needle i::after {             /* противовес */
  content: ''; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f2f6fd, #96a9cd);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .7);
}
.upg__needle.is-win i { background: linear-gradient(180deg, #d6ffed, #16c47f); box-shadow: 0 0 18px var(--success), 0 3px 8px rgba(0,0,0,.65); }
.upg__needle.is-lose i { background: linear-gradient(180deg, #ffe0e6, #e83b5f); box-shadow: 0 0 18px var(--danger), 0 3px 8px rgba(0,0,0,.65); }
.upg__core {
  position: absolute; inset: 23%; border-radius: 50%; z-index: 4;
  background:
    radial-gradient(circle at 34% 26%, #222d43, #0e1421 62%, #0a0e17 85%);
  border: 2px solid #3a4a68;
  display: grid; place-items: center; text-align: center;
  grid-auto-rows: min-content; align-content: center; gap: 1px; padding: 8px;
  box-shadow:
    0 14px 30px -12px rgba(0, 0, 0, .9),
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -8px 18px rgba(0, 0, 0, .55);
}
.upg__core::after {                 /* блик на стекле */
  content: ''; position: absolute; inset: 4px; border-radius: 50%; pointer-events: none;
  background: linear-gradient(160deg, rgba(255,255,255,.14), transparent 45%);
}
.upg__coreitem { height: 78px; display: grid; place-items: center; position: relative; z-index: 1; }
.upg__coreitem span { font-size: 11px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }
.upg__coreitem .art-img { max-height: 78px; width: 112px; }
.upg__core b { font-size: 25px; line-height: 1; position: relative; z-index: 1; font-family: var(--font-num); }
.upg__corelabel { font-size: 9.5px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; position: relative; z-index: 1; }
.upg__zonetag {
  position: absolute; z-index: 6;
  font-size: 11px; font-weight: 900; letter-spacing: 1px;
  padding: 5px 11px; border-radius: 999px;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.upg__zonetag--win { top: 2px; left: 50%; transform: translate(-50%, -50%); background: linear-gradient(180deg, #3ee8a4, #12a871); color: #04160e; }
.upg__zonetag--lose { bottom: 2px; right: -6px; transform: translateY(50%); background: linear-gradient(180deg, #ff6d84, #cf2a47); color: #1d040a; }
.upg__wheelinfo { display: flex; flex-direction: column; gap: 12px; align-items: center; max-width: 240px; text-align: center; }
.upg__hint { font-size: 12.5px; margin: 0; }

.upg__chance { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.upg__chance .ctl { padding: 9px 18px; font-size: 14px; font-weight: 700; }
.upg__actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.upg__go { min-width: 260px; letter-spacing: 2px; font-size: 16px; padding: 13px 26px; }

@media (max-width: 860px) {
  .upg__duel { grid-template-columns: 1fr; }
  .upg__vs { flex-direction: row; }
}

/* Минер */
.mines { display: flex; flex-direction: column; gap: 16px; }
.mines__top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mines__minesel { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.mines__grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  max-width: 430px; margin: 0 auto; width: 100%;
}
.mines__cell {
  aspect-ratio: 1; border-radius: 10px; cursor: pointer; font-size: 20px;
  border: 1px solid var(--line); background: linear-gradient(160deg, #171d2b, #10141d);
  color: var(--muted); transition: .12s;
}
.mines__cell:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
.mines__cell.is-open { background: linear-gradient(160deg, #123526, #0d1f18); border-color: var(--success); }
.mines__cell.is-mine { background: linear-gradient(160deg, #3a1220, #1f0d14); border-color: var(--danger); animation: shake .3s; }
.mines__cell:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.mines__info { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.mines__mult { font-size: 26px; font-weight: 800; color: var(--success); }

/* Краш */
.crash { display: flex; flex-direction: column; gap: 14px; }
.crash__top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.crash__field {
  position: relative; height: 240px; border-radius: 14px; overflow: hidden;
  background:
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(255,255,255,.05) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 63px, rgba(255,255,255,.05) 63px 64px),
    linear-gradient(160deg, #0e1420, #0a0d14);
}
.crash__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.crash__path { fill: none; stroke: var(--success); stroke-width: 3; }
.crash__path.is-crash { stroke: var(--danger); }
.crash__fill { fill: rgba(61, 220, 151, .14); stroke: none; }
.crash__mult {
  position: absolute; top: 18px; left: 0; right: 0; text-align: center;
  font-size: 52px; font-weight: 900; color: var(--success);
  text-shadow: 0 4px 24px rgba(61, 220, 151, .5);
}
.crash__mult.is-crash { color: var(--danger); text-shadow: 0 4px 24px rgba(255, 77, 109, .55); }
.crash__state { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-weight: 700; color: var(--muted); }
.crash__state.is-win { color: var(--success); }
.crash__state.is-crash { color: var(--danger); }
.crash__hist { display: flex; gap: 6px; flex-wrap: wrap; }
.crash__stats { display: flex; gap: 8px; flex-wrap: wrap; }
.crash__stat {
  font-size: 12.5px; color: var(--muted); padding: 6px 12px;
  background: var(--bg-e); border: 1px solid var(--line); border-radius: 999px;
}
.crash__stat b { color: var(--gold); font-family: var(--font-num); }
.crash__chip {
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(255, 77, 109, .14); color: var(--danger); border: 1px solid rgba(255, 77, 109, .4);
}
.crash__chip.is-win { background: rgba(61, 220, 151, .14); color: var(--success); border-color: rgba(61, 220, 151, .4); }

/* Монетка */
.coin { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.coin__field {
  perspective: 700px; height: 180px; display: grid; place-items: center;
}
.coin__disc {
  width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center;
  font-size: 46px; font-weight: 900;
  background: radial-gradient(circle at 32% 28%, #ffe9a8, #e0a526 60%, #9a6a11);
  color: #5b3c05;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .55), 0 0 30px rgba(255, 196, 60, .35),
    inset 0 2px 6px rgba(255, 255, 255, .6), inset 0 -6px 12px rgba(120, 70, 0, .5);
  transform-style: preserve-3d;
  position: relative;
}
.coin__disc::after {
  content: ''; position: absolute; inset: 8px; border-radius: 50%;
  border: 2px dashed rgba(120, 70, 0, .45); pointer-events: none;
}
.coin__disc.is-head::before,
.coin__disc.is-tail::before {
  position: absolute; font-size: 54px; color: #6b4708; text-shadow: 0 2px 3px rgba(0,0,0,.3);
}
.coin__disc.is-head::before { content: '🦅'; }
.coin__disc.is-tail::before { content: '⭐'; }
.coin__disc.is-flip { animation: coinFlip 1.6s cubic-bezier(.3,.7,.3,1); }
@keyframes coinFlip {
  0%   { transform: rotateY(0) translateY(0); }
  50%  { transform: rotateY(1080deg) translateY(-46px); }
  100% { transform: rotateY(2160deg) translateY(0); }
}
.coin__side {
  display: flex; flex-direction: column; gap: 12px; width: min(560px, 100%);
}

/* Колесо удачи */
.wheel { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.wheel__wrap { position: relative; width: min(340px, 90%); aspect-ratio: 1; }
.wheel__disc {
  position: absolute; inset: 0; border-radius: 50%;
  transition: transform 4.6s cubic-bezier(.15,.65,.12,1);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55), 0 0 0 8px #1a2130, 0 0 0 10px #2a3448;
  background: conic-gradient(#ff4d6d 0 12.5%, #4f8cff 12.5% 25%, #ffd76b 25% 37.5%, #3ddc97 37.5% 50%,
    #a06bff 50% 62.5%, #ff9f43 62.5% 75%, #2c3e50 75% 87.5%, #e84393 87.5% 100%);
}
.wheel__disc::after {
  content: 'SO2'; position: absolute; inset: 38%; border-radius: 50%;
  background: var(--bg-c); display: grid; place-items: center;
  font-weight: 900; color: var(--muted); border: 4px solid #2a3448;
}
.wheel__pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 3;
  border: 12px solid transparent; border-top: 22px solid #fff; filter: drop-shadow(0 3px 6px rgba(0,0,0,.6));
}
.wheel__labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: 100%; }
.wheel__labels span {
  text-align: center; font-size: 12px; padding: 6px; border-radius: 8px;
  background: var(--bg-e); border: 1px solid var(--line); color: var(--muted);
}

/* ——— Статистика ——— */
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat span { color: var(--muted); font-size: 13px; }
.stat b { font-size: 18px; }
.odds { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.odd { display: grid; grid-template-columns: 130px 1fr 56px; align-items: center; gap: 12px; }
.odd__name { color: var(--r); font-weight: 700; font-size: 13.5px; }
.odd__bar { background: #0e1220; border: 1px solid var(--line); border-radius: 999px; height: 12px; overflow: hidden; }
.odd__bar i { display: block; height: 100%; border-radius: 999px; }
.odd b { text-align: right; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 34px 0; }

/* ——— Окно открытия ——— */
.opening {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5, 7, 12, .9); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 16px;
}
/* display:grid выше по приоритету, чем display:none у [hidden] — гасим явно */
.opening[hidden], [hidden] { display: none !important; }
.opening__panel {
  width: min(1020px, 96vw);
  background: linear-gradient(170deg, var(--panel2), var(--bg2));
  border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.opening__head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 800; font-size: 17px; margin-bottom: 14px;
}
.opening__hint { text-align: center; color: var(--muted); margin: 14px 0 0; font-size: 13.5px; }

.reel {
  position: relative; height: 168px; overflow: hidden;
  background: #0a0d16; border: 1px solid var(--line); border-radius: 12px;
}
.reel__strip { display: flex; gap: 8px; padding: 12px 0; will-change: transform; }
.reel__cell {
  flex: 0 0 140px; width: 140px; height: 140px;
  position: relative; overflow: hidden;
  background: linear-gradient(165deg,
    color-mix(in srgb, var(--r, #4f7dff) 18%, #11151f) 0%, #0b0e15 80%);
  border: 1px solid color-mix(in srgb, var(--r, #4f7dff) 55%, transparent);
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 6px;
}
.reel__art { width: 100%; overflow: hidden; display: grid; place-items: center; }
.reel__art .art-img { width: 138%; margin-left: -19%; }
.reel__label {
  font-size: 11px; font-weight: 700; color: var(--r); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px;
}
.reel__fade {
  position: absolute; top: 0; bottom: 0; width: 130px; z-index: 4; pointer-events: none;
}
.reel__fade--l { left: 0; background: linear-gradient(90deg, #0a0d16 15%, transparent); }
.reel__fade--r { right: 0; background: linear-gradient(270deg, #0a0d16 15%, transparent); }
.reel__marker {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; z-index: 5;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--accent), var(--gold));
  box-shadow: 0 0 16px var(--accent);
}
.reel__marker::before, .reel__marker::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  border-left: 9px solid transparent; border-right: 9px solid transparent;
}
.reel__marker::before { top: 0; border-top: 12px solid var(--accent); }
.reel__marker::after { bottom: 0; border-bottom: 12px solid var(--accent); }

/* ——— Результат ——— */
.result { margin-top: 16px; text-align: center; }
.result__card {
  --r: #4f8cff;
  position: relative; overflow: hidden;
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  background: linear-gradient(165deg,
    color-mix(in srgb, var(--r) 22%, #11151f) 0%, #0a0d14 82%);
  border: 1px solid color-mix(in srgb, var(--r) 60%, #262f45);
  border-radius: 16px; padding: 18px 34px; min-width: 320px;
  box-shadow: 0 0 44px color-mix(in srgb, var(--r) 34%, transparent);
}
.result__card::after { content: none; }
.result__card .result__art { overflow: hidden; width: 100%; display: grid; place-items: center; }
.result__card .result__art .art-img { width: 128%; margin-left: -14%; }
.result__card.is-pop { animation: pop .5s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.result__rarity {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--r); font-weight: 800;
}
.result__name { font-size: 22px; font-weight: 800; }
.result__meta { color: var(--muted); font-size: 13.5px; }
.result__actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ——— Тосты ——— */
.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--panel2); border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  padding: 11px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: slideIn .25s ease;
  max-width: 340px;
}
.toast.is-out { opacity: 0; transform: translateX(20px); transition: .45s; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* панель открытия въезжает, барабан светится во время вращения */
@media (prefers-reduced-motion: no-preference) {
  .opening__panel { animation: panelIn .32s cubic-bezier(.2, .9, .3, 1.05); }
  .reel__marker { animation: markerPulse 1.2s ease-in-out infinite; }
}
@keyframes panelIn { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.reel { transition: box-shadow .3s; }
.opening.is-spinning .reel {
  box-shadow: inset 0 3px 12px rgba(0, 0, 0, .8), 0 0 34px -6px rgba(79, 140, 255, .55);
}
@media (prefers-reduced-motion: reduce) {
  .opening__panel { animation: none; }
}

/* ——— Провал апгрейда: «Ratka.com» на весь экран ——— */
.ratka {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .97);
  animation: ratkaIn .18s ease-out;
}
.ratka span {
  font-size: clamp(38px, 11vw, 130px);
  font-weight: 900; letter-spacing: .04em;
  color: #ff1f2e;
  text-shadow:
    0 0 24px rgba(255, 31, 46, .9),
    0 0 70px rgba(255, 31, 46, .55),
    0 0 140px rgba(255, 31, 46, .35);
  animation: ratkaPulse .7s ease-in-out infinite;
}
@keyframes ratkaIn { from { opacity: 0; } }
@keyframes ratkaPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .72; transform: scale(1.02); }
}

/* ——— Профиль, уровни, вход ——— */
.chip--prof { cursor: pointer; font-weight: 700; line-height: 1; }
.chip--prof:hover { border-color: var(--blue); color: var(--text); }
.chip--prof:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.levelbar {
  height: 14px; border-radius: 999px; overflow: hidden;
  background: var(--bg-e); border: 1px solid var(--line);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6);
}
.levelbar__fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--accent));
  box-shadow: 0 0 14px rgba(79, 140, 255, .6);
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

/* модалки (профиль и другие) */
.modal {
  position: fixed; inset: 0; z-index: 75;
  display: grid; place-items: center; padding: 16px;
  background: rgba(4, 6, 11, .88); backdrop-filter: blur(6px);
}
.modal__panel {
  width: min(480px, 100%); max-height: 92vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    0 40px 90px -30px rgba(0, 0, 0, .95);
}
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.modal__head h3 { margin: 0; font-size: 18px; }

.prof__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.prof__big { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.prof__lvl {
  font-size: 12px; font-weight: 800; letter-spacing: 1px; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--primary));
  color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.prof__lvl b { font-family: var(--font-num); }
.prof__reward {
  margin: 10px 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px;
  background: rgba(255, 215, 107, .1); border: 1px solid rgba(255, 215, 107, .35);
  color: var(--gold);
}
.prof__actions { display: flex; gap: 10px; margin-top: 14px; }
.prof__actions .btn { flex: 1; }

/* экран входа */
.auth {
  position: fixed; inset: 0; z-index: 95;
  display: grid; place-items: center; padding: 16px;
  background:
    radial-gradient(900px 400px at 80% -10%, rgba(79, 140, 255, .25), transparent 60%),
    radial-gradient(700px 360px at 5% 100%, rgba(255, 95, 31, .2), transparent 60%),
    rgba(6, 8, 13, .97);
}
.auth__panel {
  width: min(420px, 100%); text-align: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px; padding: 26px 22px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    0 40px 90px -30px rgba(0, 0, 0, .95);
}
.auth__logo {
  width: 74px; height: 74px; margin: 0 auto 10px; border-radius: 20px;
  display: grid; place-items: center; font-size: 38px;
  background: linear-gradient(160deg, #1e2740, #10141f);
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px -10px rgba(79, 140, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.auth__panel h2 { margin: 0 0 4px; font-size: 23px; }
.auth__field { display: block; text-align: left; margin-top: 12px; }
.auth__field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; letter-spacing: .5px; }
.auth__field .inp { width: 100%; color: var(--text); }
.auth__err { min-height: 20px; margin: 10px 0 4px; color: var(--danger); font-size: 13.5px; font-weight: 700; }
.auth__btn { width: 100%; margin-top: 8px; }
.auth__note { font-size: 12px; margin: 14px 0 0; }

/* админ-панель */
.admin { display: flex; flex-direction: column; gap: 16px; }
.admin__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin__head h3 { margin: 0; font-size: 18px; }
.admin__badge {
  font-size: 12px; font-weight: 800; letter-spacing: .5px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(61, 220, 151, .14); color: var(--success);
  border: 1px solid rgba(61, 220, 151, .5);
}
.admin__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.admin__card {
  background: var(--bg-e); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 -1px 0 rgba(0, 0, 0, .5);
}
.admin__card--wide { grid-column: 1 / -1; }
.admin__card h4 { margin: 0 0 10px; font-size: 14px; letter-spacing: .5px; }
.admin__stats { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--muted); }
.admin__stats b { color: var(--text); font-family: var(--font-num); }
.admin--locked { align-items: center; text-align: center; gap: 8px; }
.admin--locked .levelbar { width: min(420px, 100%); }
.admin__lock { font-size: 52px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .6)); }
.admin--locked h3 { margin: 4px 0; }
.admin--locked p { margin: 4px 0; font-size: 14px; }

@media (max-width: 640px) {
  .auth__panel { padding: 20px 16px; }
  .admin__grid { grid-template-columns: 1fr; }
  .prof__row { flex-direction: column; align-items: flex-start; }
}
/* ——— Адаптивность: десктоп → планшет → телефон ——— */
@media (max-width: 980px) {
  main { padding: 14px; }
  .cases { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .inv, .stats { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .hud { flex-wrap: wrap; row-gap: 10px; }
  .section-head--row { flex-direction: column; align-items: stretch; }
  .gstage { padding: 14px; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .hud { flex-direction: column; align-items: stretch; padding: 10px 12px; }
  .hud__actions { justify-content: space-between; flex-wrap: wrap; row-gap: 8px; }
  .hud__titles small { display: none; }
  main { padding: 12px 10px; }
  .cases { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .inv, .stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .odd { grid-template-columns: 96px 1fr 48px; gap: 8px; }
  .result__card { min-width: 0; width: 100%; padding: 14px; }
  .result__actions { flex-direction: column; }
  .result__actions .btn { width: 100%; }
  .btn { min-height: 44px; }
  .btn--mini { min-height: 40px; }
  .gametab { min-height: 44px; flex: 1 1 auto; justify-content: center; }
  .ctl { min-height: 42px; }
  .opening { padding: 8px; }
  .opening__panel { padding: 12px; border-radius: 14px; }
  .reel { height: 148px; }
  .inspect__panel { padding: 14px; }
  .inspect__stage { height: 210px; }
  .inspect__head h2 { font-size: 19px; }
  .upg__wheelpart { gap: 14px; }
  .upg__gauge { width: 210px; height: 210px; }
  .upg__slots { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: 180px; }
  .mines__grid { gap: 6px; }
  .crash__mult { font-size: 38px; }
  .toolbar { flex-wrap: wrap; }
  .select, .inp { min-height: 42px; }
  .toolbar .btn { flex: 1 1 auto; }
}

@media (max-width: 380px) {
  .cases { grid-template-columns: 1fr; }
  .inv, .stats { grid-template-columns: 1fr 1fr; }
  .hud__actions .chip { font-size: 13px; }
}

/* ——— Премиум-оформление: выступы, блики, объём ——— */

/* 1. Выступ сверху у панелей/карточек: светлая грань + тень снизу */
.case, .card, .stat, .gstage, .inspect__panel, .opening__panel,
.upg__gallery, .upg__panel, .case-chip, .chip, .select, .gametab, .ctl {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    inset 0 -1px 0 rgba(0, 0, 0, .5),
    0 10px 24px -14px rgba(0, 0, 0, .8);
}
/* грани: верхний блик */
.case::after, .card::before, .gstage::before {
  content: ''; position: absolute; top: 0; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
  pointer-events: none;
}
.card { position: relative; }
.gstage { position: relative; }
.card::before { z-index: 1; }
/* у карточки уже есть ::after (цветная полоса редкости) — блик уходит в ::before */

/* 2. Кнопки: выпуклые снизу, вдавливаются при нажатии */
.btn {
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    inset 0 -2px 0 rgba(0, 0, 0, .28),
    0 4px 0 -1px rgba(0, 0, 0, .45),
    0 8px 18px -8px rgba(0, 0, 0, .8);
}
.btn::before {
  content: ''; position: absolute; left: 6%; right: 6%; top: 2px; height: 42%;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .28), transparent);
}
.btn:hover:not(:disabled) { filter: brightness(1.08) saturate(1.1); }
.btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, .5),
    inset 0 -1px 0 rgba(255, 255, 255, .15);
}
.btn:active:not(:disabled)::before { opacity: 0; }
.btn--ghost { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 4px 0 -1px rgba(0,0,0,.4), 0 8px 16px -8px rgba(0,0,0,.7); }

.iconbtn {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 0 -1px rgba(0, 0, 0, .5);
}
.iconbtn:active { transform: translateY(2px); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .55); }

/* 3. HUD: выраженный выступ и тень вниз */
.hud {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 10px 30px -12px rgba(0, 0, 0, .9);
}
.hud::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 140, 255, .55), rgba(255, 95, 31, .5), transparent);
}
.hud__logo {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .5),
    inset 0 -3px 6px rgba(0, 0, 0, .3),
    0 6px 16px -6px rgba(255, 95, 31, .7);
}
.chip {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 0 -2px 0 rgba(0, 0, 0, .45),
    0 3px 0 -1px rgba(0, 0, 0, .5);
}
.chip--gold { text-shadow: 0 0 10px rgba(255, 215, 107, .55); }

/* 4. Табы: выпуклые «язычки» с фаской */
.tab-btn {
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.tab-btn.is-active {
  background: linear-gradient(180deg, #1e2637, var(--panel));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 1px 0 0 rgba(255, 255, 255, .05),
    inset -1px 0 0 rgba(255, 255, 255, .05),
    0 -6px 16px -8px rgba(79, 140, 255, .5);
}
.tab-btn.is-active::after {
  content: ''; position: absolute; left: 12px; right: 12px; top: 0; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), var(--accent));
  box-shadow: 0 0 10px var(--blue);
}
.tab-btn__count { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 2px 0 rgba(0, 0, 0, .4); }

/* 5. Заголовки секций с акцентным выступом-чертой */
.section-head h1, .section-head h2 {
  position: relative; display: inline-block; padding-bottom: 8px;
}
.section-head h1::after, .section-head h2::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 64px; height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  box-shadow: 0 2px 0 rgba(0, 0, 0, .5), 0 0 14px rgba(255, 95, 31, .6);
}

/* 6. Кейсы: рёбрышко-полка под превью + объёмная кнопка цены */
.case {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 -1px 0 rgba(0, 0, 0, .55),
    0 14px 30px -16px rgba(0, 0, 0, .9);
}
.case__preview {
  padding: 8px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, .2));
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, .65),
    inset 0 -1px 0 rgba(255, 255, 255, .07);
}
.case__foot {
  padding-top: 10px; border-top: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.price {
  text-shadow: 0 0 12px rgba(255, 215, 107, .4);
}

/* 7. Карточки: фаска по краям и «полка» под артом */
.card__meta b { text-shadow: 0 0 10px rgba(255, 215, 107, .45); }

/* 8. Окно открытия: панель с выраженным выступом */
.opening__panel, .inspect__panel {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    inset 0 -2px 0 rgba(0, 0, 0, .6),
    0 40px 90px -30px rgba(0, 0, 0, .95);
}
.reel {
  box-shadow:
    inset 0 3px 12px rgba(0, 0, 0, .8),
    inset 0 -1px 0 rgba(255, 255, 255, .07);
}
.result__card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    inset 0 -2px 0 rgba(0, 0, 0, .5),
    0 0 44px color-mix(in srgb, var(--r) 38%, transparent),
    0 24px 50px -22px rgba(0, 0, 0, .9);
}

/* 9. Геймплейные панели казино: выступ у поля ставки и секций */
.betbox, .mines__top, .crash__top {
  background: linear-gradient(180deg, #1a2130, #12172441);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 -2px 0 rgba(0, 0, 0, .5);
}
.gametab {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    0 4px 0 -1px rgba(0, 0, 0, .5);
}
.gametab:active { transform: translateY(2px); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .5); }
.gametab.is-active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .35),
    0 4px 0 -1px rgba(0, 0, 0, .55),
    0 10px 22px -8px rgba(79, 140, 255, .6);
}
.ctl {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 3px 0 -1px rgba(0, 0, 0, .5);
}
.ctl:active { transform: translateY(2px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5); }
.ctl.is-on {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .4),
    0 0 18px color-mix(in srgb, var(--r, var(--blue)) 55%, transparent);
}
.mines__cell {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    inset 0 -3px 0 rgba(0, 0, 0, .55),
    0 3px 0 -1px rgba(0, 0, 0, .5);
}
.mines__cell:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 3px 6px rgba(0, 0, 0, .6); }
.betbox__bal { margin-left: auto; font-size: 13px; color: var(--muted); }
.betbox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.betbox label { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); }
.inp {
  background: var(--bg-e); border: 1px solid var(--line); color: var(--gold);
  border-radius: 10px; padding: 9px 12px; font: inherit; font-weight: 700; width: 130px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6);
}
.inp:focus { outline: none; border-color: var(--blue); box-shadow: inset 0 2px 6px rgba(0,0,0,.6), 0 0 0 3px rgba(79,140,255,.25); }

/* 10. Осмотр: сцена с выступом-подиумом */
.inspect__stage {
  box-shadow:
    inset 0 3px 14px rgba(0, 0, 0, .75),
    inset 0 -1px 0 rgba(255, 255, 255, .08);
}
.inspect__bar {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 -2px 0 rgba(0, 0, 0, .55);
}

/* 11. Галочка выбора и подсветка активных пилюль */
.ctl.is-on, .gametab.is-active { transform: translateY(0); }
.upg__slot.is-sel { animation: slotPop .25s ease; }
@keyframes slotPop { 50% { transform: translateY(-5px) scale(1.04); } }

/* 12. Скроллбары под тему */
* { scrollbar-width: thin; scrollbar-color: #33405c transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0d1119; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #33405c, #232c42);
  border-radius: 8px; border: 2px solid #0d1119;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #405074, #2b3650); }

/* ——— 🔴 Провал апгрейда: сайт гаснет на 5 секунд ——— */
.ratka {
  position: fixed; inset: 0; z-index: 120;
  background: #000;
  display: grid; place-items: center;
  animation: ratkaIn .18s ease-out;
}
.ratka__text {
  font-family: var(--font-num); font-weight: 700;
  font-size: clamp(44px, 13vw, 150px); letter-spacing: .04em;
  color: #ff2020;
  text-shadow: 0 0 34px rgba(255, 32, 32, .9), 0 0 90px rgba(255, 0, 0, .55);
  animation: ratkaBlink 1s steps(2, end) infinite;
}
@keyframes ratkaIn { from { opacity: 0; } }
@keyframes ratkaBlink { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .ratka, .ratka__text { animation: none !important; }
}

/* 13. Плавность и доступность */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
.btn, .gametab, .ctl, .iconbtn, .tab-btn, .case, .card { will-change: transform; }

