/* StandSkin — стили */
:root {
  --bg: #0b0d12;
  --bg2: #10131a;
  --panel: #141821;
  --panel2: #1a1f2b;
  --panel3: #212735;
  --line: #262d3b;
  --text: #e9ecf2;
  --muted: #8b94a8;
  --dim: #5d6679;
  --accent: #ff8a00;
  --accent2: #ffb800;
  --accent-grad: linear-gradient(135deg, #ffc21a 0%, #ff8a00 55%, #ff5e00 100%);
  --green: #3ddc84;
  --red: #ff4d5e;
  --gold: #ffc43d;
  --radius: 14px;
  --head: 'Russo One', 'Rubik', system-ui, sans-serif;
  --body: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--body);
  font-size: 14px;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(255, 138, 0, .10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(80, 110, 255, .08), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
::selection { background: rgba(255, 138, 0, .35); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a3140; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ───────── Header ───────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  height: 64px; padding: 0;
  background: rgba(11, 13, 18, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
/* содержимое шапки живёт в той же колонке, что и страница: баланс не улетает в угол монитора */
.topbar-inner {
  display: flex; align-items: center; gap: 18px;
  width: 100%; max-width: 1280px; height: 100%; padding: 0 22px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-grad); color: #1a0f00;
  font-family: var(--head); font-size: 22px;
  box-shadow: 0 4px 18px rgba(255, 138, 0, .35);
  transform: skewX(-8deg);
}
.logo-text { font-family: var(--head); font-size: 20px; letter-spacing: .5px; }
.logo-text b { color: var(--accent); font-weight: 400; }

.nav { display: flex; gap: 4px; margin-left: 12px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px;
  color: var(--muted); font-weight: 600; white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: var(--text); background: var(--panel2); }
.nav a.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: -13px; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--accent-grad);
}
.nav-ico { color: var(--accent); font-size: 13px; }
.nav-count {
  min-width: 20px; padding: 1px 6px; border-radius: 10px;
  background: var(--panel3); color: var(--text); font-size: 11px; text-align: center;
}

.top-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.balance {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 5px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line);
  font-family: var(--head); font-size: 13px; line-height: 1; min-width: 0; max-width: 100%;
  cursor: pointer; white-space: nowrap;
  transition: border-color .3s, box-shadow .3s, background .15s, transform .08s;
}
.balance:hover { background: var(--panel2); border-color: rgba(255, 138, 0, .5); }
.balance:active { transform: scale(.97); }
.balance-ico { display: flex; flex-shrink: 0; }
.balance-value { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.balance.empty { border-color: rgba(255, 138, 0, .55); animation: promoPulse 2s ease-in-out infinite; }
@keyframes promoPulse {
  50% { box-shadow: 0 0 0 4px rgba(255, 138, 0, .12); border-color: var(--accent); }
}
.balance .g-icon { width: 15px; height: 15px; }
.balance.up { border-color: var(--green); box-shadow: 0 0 18px rgba(61, 220, 132, .35); }
.balance.down { border-color: var(--red); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); font-size: 16px;
}
.icon-btn:hover { background: var(--panel2); }

img.skin-svg { object-fit: contain; user-select: none; }
img.g-icon { object-fit: contain; user-select: none; }
.g-icon { width: 16px; height: 16px; vertical-align: -3px; flex-shrink: 0; }
.gold { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; white-space: nowrap; }
.gold .g-icon { width: 15px; height: 15px; }

/* ───────── Live-лента ───────── */
.live {
  display: flex; align-items: stretch;
  height: 76px; border-bottom: 1px solid var(--line);
  background: var(--bg2); overflow: hidden;
}
.live-label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 64px; flex-shrink: 0; border-right: 1px solid var(--line);
  font-family: var(--head); font-size: 12px; color: var(--muted); letter-spacing: 1px;
}
.live-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 0 rgba(255, 77, 94, .6); animation: pulse 1.6s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(255, 77, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 94, 0); } }
.live-track { display: flex; gap: 6px; padding: 6px; overflow: hidden; flex: 1; }
.live-item {
  position: relative; flex: 0 0 132px; height: 64px; padding: 4px 8px 5px;
  border-radius: 9px; overflow: hidden;
  background: linear-gradient(180deg, var(--panel) 0%, color-mix(in srgb, var(--rc) 22%, var(--panel)) 100%);
  border-bottom: 2px solid var(--rc);
  animation: liveIn .45s cubic-bezier(.2, .9, .3, 1.2);
}
.live-item.mine { outline: 1px solid var(--accent); }
.live-item .skin-svg { position: absolute; top: 3px; right: 6px; width: 70px; height: 30px; }
.live-item .li-user { font-size: 10px; color: var(--muted); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-item .li-name { position: absolute; left: 8px; right: 8px; bottom: 5px; font-size: 11px; line-height: 1.2; }
.live-item .li-name b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-item .li-name span { color: var(--muted); font-size: 10px; }
@keyframes liveIn { from { transform: translateX(-60px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }

/* ───────── Layout ───────── */
.view { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 26px 22px 40px; }
.footer {
  border-top: 1px solid var(--line); padding: 18px 22px; text-align: center;
  color: var(--dim); font-size: 12px; line-height: 1.6;
}
.footer p { max-width: 760px; margin: 0 auto; }
.page-title { font-family: var(--head); font-size: 28px; font-weight: 400; margin: 0 0 6px; letter-spacing: .3px; }
.page-sub { color: var(--muted); margin: 0 0 22px; }
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--head); font-weight: 400; font-size: 19px; margin: 30px 0 14px;
}
.section-title::before { content: ''; width: 4px; height: 20px; border-radius: 2px; background: var(--accent-grad); }
.section-title small { font-family: var(--body); color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
.back-link:hover { color: var(--text); }

/* ───────── Кнопки ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px;
  background: var(--panel2); border: 1px solid var(--line);
  font-weight: 700; white-space: nowrap;
  transition: background .15s, transform .08s, opacity .15s, box-shadow .15s;
}
.btn:hover { background: var(--panel3); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.is-idle { opacity: .6; } /* кнопка доступна, но условия ещё не собраны — клик подскажет, чего не хватает */
.btn-primary {
  background: var(--accent-grad); border: 0; color: #1d1000;
  box-shadow: 0 6px 22px rgba(255, 138, 0, .28);
}
.btn-primary:hover { background: var(--accent-grad); box-shadow: 0 6px 28px rgba(255, 138, 0, .45); }
.btn-green { background: rgba(61, 220, 132, .14); border-color: rgba(61, 220, 132, .4); color: var(--green); }
.btn-green:hover { background: rgba(61, 220, 132, .24); }
.btn-red { background: rgba(255, 77, 94, .12); border-color: rgba(255, 77, 94, .35); color: var(--red); }
.btn-red:hover { background: rgba(255, 77, 94, .22); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 52px; padding: 0 30px; font-size: 16px; border-radius: 12px; }
.chip {
  height: 34px; padding: 0 13px; border-radius: 9px;
  background: var(--panel2); border: 1px solid var(--line);
  font-weight: 700; color: var(--muted); transition: all .15s;
}
.chip:hover { color: var(--text); border-color: #3a4254; }
.chip.active { color: #1d1000; background: var(--accent-grad); border-color: transparent; }
.toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle i {
  position: relative; width: 36px; height: 20px; border-radius: 20px; background: var(--panel3); transition: background .2s;
}
.toggle i::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #cfd5e0; transition: transform .2s;
}
.toggle input:checked + i { background: var(--accent); }
.toggle input:checked + i::after { transform: translateX(16px); background: #fff; }

.input, .select {
  height: 38px; padding: 0 12px; border-radius: 9px;
  background: var(--bg2); border: 1px solid var(--line); outline: none;
}
.input:focus, .select:focus { border-color: var(--accent); }
.select { padding-right: 8px; }

/* ───────── Hero ───────── */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 20px;
  padding: 34px 38px; border-radius: 20px;
  background:
    radial-gradient(600px 260px at 85% 50%, rgba(255, 138, 0, .22), transparent 70%),
    linear-gradient(135deg, #171b26 0%, #10131a 100%);
  border: 1px solid var(--line);
}
.hero h1 { font-family: var(--head); font-weight: 400; font-size: 40px; line-height: 1.05; margin: 0 0 12px; }
.hero h1 span { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0 0 20px; max-width: 460px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-art { position: relative; height: 200px; }
.hero-art .skin-svg { position: absolute; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .6)); }
.hero-art .h1 { width: 78%; right: 4%; top: 6%; transform: rotate(-10deg); }
.hero-art .h2 { width: 48%; left: 0; bottom: 4%; transform: rotate(14deg); }
.hero-art .h3 { width: 40%; right: 0; bottom: 0; transform: rotate(-4deg); }
.hero-stats { display: flex; gap: 22px; margin-top: 22px; }
.hero-stats div { font-size: 12px; color: var(--muted); }
.hero-stats b { display: block; font-family: var(--head); font-weight: 400; font-size: 20px; color: var(--text); }

/* ───────── Кейсы ───────── */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.case-card {
  --cc: #888;
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding: 14px 12px 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 10%, var(--panel)) 0%, var(--panel) 70%);
  border: 1px solid var(--line);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.case-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--cc) 60%, var(--line)); box-shadow: 0 14px 30px rgba(0, 0, 0, .35), 0 0 30px color-mix(in srgb, var(--cc) 20%, transparent); }
.case-card .case-svg { width: 100%; height: 150px; transition: transform .25s; }
.case-card:hover .case-svg { transform: scale(1.05) rotate(-1deg); }
.case-card .cc-name { font-family: var(--head); font-size: 16px; margin-top: 6px; }
.case-card .cc-price {
  margin-top: 10px; padding: 7px 14px; border-radius: 9px;
  background: var(--panel3); font-family: var(--head); font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.case-card:hover .cc-price { background: var(--accent-grad); color: #1d1000; }
.case-card .cc-tag {
  position: absolute; top: 10px; left: 10px; padding: 3px 8px; border-radius: 6px;
  background: color-mix(in srgb, var(--cc) 25%, transparent); color: var(--cc);
  font-size: 10px; font-weight: 800; letter-spacing: .8px;
}
.case-card.cant .cc-price { color: var(--muted); }

/* Страница кейса */
.case-head { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }
.case-head .case-svg { width: 190px; height: 160px; flex-shrink: 0; }
.case-head h1 { font-family: var(--head); font-weight: 400; font-size: 32px; margin: 0 0 6px; }
.case-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 13px; }
.case-meta b { color: var(--text); }

.roulette-wrap { position: relative; margin-bottom: 16px; }
.roulette { display: flex; flex-direction: column; gap: 8px; }
.r-row {
  --cw: 150px;
  position: relative; height: calc(var(--cw) * .86); overflow: hidden;
  border-radius: var(--radius); background: var(--bg2); border: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%);
}
.roulette.multi .r-row { --cw: 118px; }
.roulette.m4 .r-row, .roulette.m5 .r-row { --cw: 100px; }
.r-strip { display: flex; height: 100%; padding: 8px 0; will-change: transform; }
.r-strip .item-card { flex: 0 0 calc(var(--cw) - 8px); margin-right: 8px; }
.r-marker {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; transform: translateX(-50%);
  background: var(--accent-grad); box-shadow: 0 0 14px rgba(255, 138, 0, .9); z-index: 2; pointer-events: none;
}
.r-marker::before, .r-marker::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent;
}
.r-marker::before { top: 0; border-top-color: var(--accent); }
.r-marker::after { bottom: 0; border-bottom-color: var(--accent); }
.r-idle {
  display: flex; align-items: center; justify-content: center; gap: 14px; height: 100%;
  color: var(--dim); font-family: var(--head); letter-spacing: 1px;
}

.open-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between;
  padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
}
.open-bar .counts { display: flex; gap: 6px; }
.open-bar .right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.result-panel {
  margin-top: 14px; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 138, 0, .08), var(--panel));
  border: 1px solid rgba(255, 138, 0, .3);
  animation: popIn .35s cubic-bezier(.2, .9, .3, 1.3);
}
.result-panel h3 { margin: 0 0 12px; font-family: var(--head); font-weight: 400; font-size: 18px; }
.result-items { display: flex; flex-wrap: wrap; gap: 12px; }
.result-items .res { display: flex; flex-direction: column; gap: 8px; width: 170px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
@keyframes popIn { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

/* ───────── Карточка предмета ───────── */
.item-card {
  --rc: #888;
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 118px; padding: 8px 10px 9px; border-radius: 11px; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 35%, color-mix(in srgb, var(--rc) 30%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, var(--panel2) 0%, var(--panel) 100%);
  border: 1px solid var(--line);
  transition: transform .15s, border-color .15s, box-shadow .15s, opacity .15s;
}
.item-card::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--rc); box-shadow: 0 0 12px var(--rc);
}
.item-card .skin-svg {
  position: absolute; left: 8%; right: 8%; top: 8px; width: 84%; height: 52%;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .55));
}
.item-card .ic-name { position: relative; font-size: 11px; line-height: 1.25; }
.item-card .ic-name span { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-card .ic-name b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-card .ic-price { position: relative; margin-top: 4px; font-size: 12px; }
.item-card .ic-chance {
  position: absolute; top: 6px; right: 7px; font-size: 10px; font-weight: 700;
  color: var(--muted); background: rgba(0, 0, 0, .35); padding: 2px 5px; border-radius: 5px;
}
.item-card .ic-star { position: absolute; top: 6px; left: 8px; color: var(--rc); font-size: 11px; }
.item-card.clickable { cursor: pointer; }
.item-card.clickable:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--rc) 55%, var(--line)); }
.item-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(255, 138, 0, .3); }
.item-card.selected::before {
  content: '✓'; position: absolute; top: 6px; left: 7px; z-index: 1;
  width: 18px; height: 18px; border-radius: 5px; background: var(--accent); color: #1d1000;
  font-size: 12px; font-weight: 900; display: grid; place-items: center;
}
.item-card.disabled { opacity: .35; pointer-events: none; }
.item-card.win { animation: winPulse 1.2s ease-in-out 2; }
@keyframes winPulse { 50% { box-shadow: 0 0 0 2px var(--rc), 0 0 36px var(--rc); } }
.item-card.big { min-height: 150px; }
.item-card.big .ic-name { font-size: 13px; }
.item-card.big .ic-name span { font-size: 11px; }

.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.items-grid.sm { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.items-grid.sm .item-card { min-height: 104px; }

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 40px 20px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty b { color: var(--text); font-size: 15px; }

/* ───────── Апгрейд ───────── */
.upg-top {
  display: grid; grid-template-columns: 1fr 300px 1fr; gap: 16px; align-items: stretch;
}
.upg-slot {
  position: relative; display: flex; flex-direction: column; min-height: 300px; padding: 16px;
  border-radius: 18px; background: var(--panel); border: 1px solid var(--line); overflow: hidden;
}
.upg-slot h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.upg-slot .slot-body { flex: 1; display: flex; align-items: center; justify-content: center; }
.upg-slot .slot-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.upg-slot.target { background: radial-gradient(90% 70% at 50% 40%, color-mix(in srgb, var(--rc, #333) 18%, transparent), transparent 70%), var(--panel); }
.slot-empty { color: var(--dim); text-align: center; font-size: 13px; line-height: 1.5; }
.slot-empty .big-plus { font-size: 44px; color: var(--line); display: block; line-height: 1; margin-bottom: 8px; }
.slot-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.slot-items.one { grid-template-columns: 1fr; max-width: 230px; }
.slot-items .item-card { min-height: 88px; }
.slot-items.one .item-card { min-height: 150px; }
.slot-balance { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.slot-balance .input { width: 100%; }

.upg-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.wheel { position: relative; width: 260px; height: 260px; }
.wheel svg { width: 100%; height: 100%; }
.wheel .w-arrow { transform-origin: 130px 130px; }
.wheel-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
}
.wheel-center .pct { font-family: var(--head); font-size: 38px; line-height: 1; }
.wheel-center .lbl { color: var(--muted); font-size: 12px; margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }
.wheel-center .mult { margin-top: 6px; font-weight: 800; color: var(--accent2); }
.wheel.win .pct { color: var(--green); }
.wheel.lose .pct { color: var(--red); }
.wheel.win { animation: wheelWin .9s ease; }
.wheel.lose { animation: shake .45s ease; }
@keyframes wheelWin { 40% { transform: scale(1.06); filter: drop-shadow(0 0 26px rgba(61, 220, 132, .7)); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
/* строка состояния под колесом: всегда объясняет, что происходит */
.upg-status {
  min-height: 36px; padding: 0 6px; text-align: center;
  font-size: 13px; line-height: 1.45; color: var(--muted);
}
.upg-status b { color: var(--text); font-weight: 700; }
.upg-status.warn, .upg-status.warn b { color: var(--accent2); }
.upg-status.good, .upg-status.good b { color: var(--green); }
/* цели, которые сейчас не подходят под ставку, не прячем — приглушаем */
.item-card.faded { opacity: .4; }
.item-card.faded:hover { opacity: .85; }

.mult-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.upg-btn { width: 100%; }

.upg-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.list-panel { display: flex; flex-direction: column; padding: 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.list-head h3 { margin: 0 auto 0 0; font-size: 15px; }
.list-head .input { width: 150px; }
.list-scroll { max-height: 480px; overflow-y: auto; padding-right: 4px; }
.list-scroll .item-card .ic-chance { color: var(--accent2); }

/* ───────── Контракты ───────── */
.contract-top { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.contract-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.contract-slots .slot {
  min-height: 104px; border-radius: 11px; border: 1px dashed var(--line);
  display: grid; place-items: center; color: var(--dim); font-size: 22px;
}
.contract-slots .item-card { min-height: 104px; }
.contract-info { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.info-row { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.info-row b { color: var(--text); }
.contract-stage {
  position: relative; height: 170px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.contract-stage .item-card { width: 190px; min-height: 140px; }
.contract-stage .stage-idle { color: var(--dim); font-family: var(--head); text-align: center; padding: 0 16px; }

/* ───────── Инвентарь ───────── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.stat b { font-family: var(--head); font-weight: 400; font-size: 20px; display: inline-flex; align-items: center; gap: 6px; }
.inv-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.inv-toolbar .spacer { flex: 1; }
.inv-card-actions { display: flex; gap: 4px; margin-top: 6px; position: relative; }
.inv-card-actions .btn { flex: 1; height: 26px; padding: 0 6px; font-size: 11px; border-radius: 7px; }

/* ───────── Модалки и тосты ───────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 6, 10, .72); backdrop-filter: blur(6px);
  animation: fadeIn .2s ease;
}
.modal {
  position: relative; width: 100%; max-width: 420px; padding: 26px;
  border-radius: 20px; background: linear-gradient(180deg, #1a1f2b, #141821);
  border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: popIn .25s cubic-bezier(.2, .9, .3, 1.3);
}
.modal h2 { font-family: var(--head); font-weight: 400; margin: 0 0 6px; font-size: 22px; }
.modal p { color: var(--muted); margin: 0 0 18px; line-height: 1.5; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); font-size: 18px; }
.modal-close:hover { background: var(--panel3); color: var(--text); }
.promo-input {
  width: 100%; height: 54px; padding: 0 16px; border-radius: 12px;
  background: var(--bg); border: 2px solid var(--line); outline: none;
  font-family: var(--head); font-size: 22px; letter-spacing: 4px; text-transform: uppercase; text-align: center;
  transition: border-color .15s;
}
.promo-input:focus { border-color: var(--accent); }
.promo-input.bad { border-color: var(--red); animation: shake .35s; }
.promo-input.good { border-color: var(--green); }
.promo-msg { min-height: 22px; margin: 10px 0 14px; text-align: center; font-weight: 600; }
.promo-msg.bad { color: var(--red); }
.promo-msg.good { color: var(--green); }
.modal .btn-primary { width: 100%; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }
@keyframes fadeIn { from { opacity: 0; } }

/* ───────── Кошелёк: промокод и пополнение ───────── */
.wallet-sum {
  display: flex; align-items: center; gap: 9px; margin: 0 0 16px;
  font-family: var(--head); font-size: 26px;
}
.wallet-sum .g-icon { width: 26px; height: 26px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab {
  flex: 1; height: 38px; border-radius: 10px;
  background: var(--panel2); border: 1px solid var(--line);
  font-weight: 700; color: var(--muted); transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent-grad); border-color: transparent; color: #1d1000; }
.packs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pack {
  position: relative; padding: 13px 10px; border-radius: 12px; text-align: center;
  background: var(--panel2); border: 1px solid var(--line); cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.pack:hover { transform: translateY(-2px); border-color: var(--accent); }
.pack .p-gold { display: flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--head); font-size: 17px; }
.pack .p-price { margin-top: 6px; color: var(--muted); font-weight: 700; font-size: 13px; }
.pack .p-badge {
  position: absolute; top: -8px; right: 8px; padding: 2px 7px; border-radius: 6px;
  background: var(--accent-grad); color: #1d1000; font-size: 10px; font-weight: 800;
}
.co-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.co-row b { font-family: var(--head); font-size: 16px; }
.co-note {
  margin: 14px 0; padding: 11px 13px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  background: rgba(255, 138, 0, .1); border: 1px solid rgba(255, 138, 0, .3); color: var(--accent2);
}

/* ───────── Раздел в разработке ───────── */
.soon {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: 50px 24px; border-radius: 20px;
  background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px dashed var(--line);
}
.soon-ico { font-size: 44px; }
.soon b { font-family: var(--head); font-weight: 400; font-size: 22px; }
.soon p { max-width: 440px; margin: 0; color: var(--muted); line-height: 1.6; }
.soon-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 340px; padding: 12px 16px;
  border-radius: 12px; background: #1c2230; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45); font-weight: 600;
  animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.good { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--red); }
.toast.out { opacity: 0; transform: translateX(30px); transition: all .3s; }
@keyframes toastIn { from { transform: translateX(40px); opacity: 0; } }

/* Взрыв частиц при крупном выигрыше */
.burst { position: fixed; pointer-events: none; z-index: 130; width: 8px; height: 8px; border-radius: 2px; }

/* ───────── Адаптив ───────── */
@media (max-width: 1080px) {
  .upg-top { grid-template-columns: 1fr 270px 1fr; gap: 12px; }
  .wheel { width: 240px; height: 240px; }
  .contract-top { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .upg-top { grid-template-columns: 1fr 1fr; }
  .upg-center { grid-column: 1 / -1; order: -1; }
  .upg-btn { max-width: 340px; }
  /* шапка всегда одной строкой: логотип, прокручиваемое меню, баланс справа */
  .topbar { height: 56px; padding: 0; }
  .topbar-inner { flex-wrap: nowrap; padding: 0 12px; gap: 8px; }
  .nav { order: 0; width: auto; flex: 1; min-width: 0; margin-left: 6px; }
  .nav a.active::after { bottom: -9px; }
  .balance { min-width: 0; }
  .hero { grid-template-columns: 1fr; padding: 26px 22px; }
  .hero h1 { font-size: 30px; }
  .hero-art { display: none; }
  .upg-lists { grid-template-columns: 1fr; }
  .view { padding: 18px 14px 30px; }
}
@media (max-width: 900px) {
  /* горизонтальная прокрутка меню без полосы */
  .nav { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex-shrink: 0; }
}

/* ───────── Телефон ───────── */
@media (max-width: 600px) {
  .topbar { height: 52px; padding: 0; }
  .topbar-inner { gap: 6px; padding: 0 10px; }
  .logo-mark { width: 30px; height: 30px; font-size: 18px; }
  .logo-text { display: none; }
  .balance { font-size: 12px; padding: 3px 7px 3px 5px; gap: 4px; }
  .balance .g-icon { width: 14px; height: 14px; }
  
  .live { height: 66px; }
  .live-label { width: 48px; font-size: 10px; }
  .live-item { flex-basis: 112px; height: 54px; }
  .live-item .skin-svg { width: 58px; height: 24px; }

  .view { padding: 14px 10px 28px; }
  .page-title { font-size: 23px; }
  .section-title { font-size: 17px; margin: 22px 0 12px; }
  .hero { padding: 20px 16px; border-radius: 16px; }
  .hero h1 { font-size: 26px; }
  .hero-actions .btn-lg { flex: 1; height: 46px; padding: 0 14px; font-size: 14px; }

  .case-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .case-card .case-svg { height: 104px; }
  .case-card .cc-name { font-size: 14px; }
  .case-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .case-head .case-svg { width: 130px; height: 108px; }
  .case-head h1 { font-size: 24px; }

  .items-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .items-grid.sm { grid-template-columns: repeat(3, 1fr); }
  .r-row { --cw: 112px; }
  .roulette.multi .r-row { --cw: 92px; }
  .roulette.m4 .r-row, .roulette.m5 .r-row { --cw: 80px; }
  .open-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .open-bar .counts { display: grid; grid-template-columns: repeat(5, 1fr); }
  .open-bar .right { justify-content: space-between; }
  .open-bar .btn-lg { flex: 1; height: 48px; }
  .result-items .res { width: calc(50% - 6px); }

  .upg-top { grid-template-columns: 1fr; }
  .upg-slot { min-height: 0; padding: 12px; }
  .slot-items .item-card { min-height: 76px; }
  .slot-items.one .item-card { min-height: 120px; }
  .wheel { width: 200px; height: 200px; }
  .wheel-center .pct { font-size: 29px; }
  .upg-btn { max-width: none; height: 48px; }
  .mult-row .chip { flex: 1; min-width: 56px; }
  .list-scroll { max-height: 330px; }
  .list-head .input { width: 100%; }

  .contract-slots { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .contract-stage { height: 150px; }
  .inv-toolbar { gap: 6px; }
  .inv-toolbar .select { flex: 1; min-width: 130px; }
  .inv-toolbar .spacer { display: none; }

  .modal { padding: 20px 16px; border-radius: 16px; }
  .modal h2 { font-size: 19px; }
  .promo-input { height: 48px; font-size: 18px; letter-spacing: 2px; }
  .wallet-sum { font-size: 22px; }
  .toasts { left: 10px; right: 10px; bottom: 10px; align-items: stretch; }
  .toast { max-width: none; }
  .soon { padding: 34px 16px; }
  .footer { padding: 14px 14px 22px; font-size: 11px; }
}

@media (max-width: 380px) {
  .items-grid.sm { grid-template-columns: repeat(2, 1fr); }
  .packs { grid-template-columns: 1fr; }
  .nav a { padding: 8px 9px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
