/* Тема в духе популярных кейс-сайтов: тёмно-фиолетовый фон, фиолетовый акцент, зелёные цены.
   Подключается после styles.css и переопределяет токены и компоненты. */
:root {
  --bg: #141225;
  --bg2: #1a1730;
  --panel: #1e1a38;
  --panel2: #262147;
  --line: #2f2a55;
  --text: #ffffff;
  --muted: #8a86b8;
  --accent: #7b4dff;
  --accent2: #5f25f4;
  --good: #4af1b8;
  --bad: #ff4d6a;
  --blue: #5a8dff;
  --price: #4af1b8;
  --r: 12px;
}
body { font-family: Montserrat, system-ui, sans-serif; background: var(--bg); }
.bg-glow {
  background:
    radial-gradient(45% 55% at 15% 20%, rgba(95,37,244,.22), transparent 70%),
    radial-gradient(40% 50% at 85% 10%, rgba(74,241,184,.07), transparent 70%);
}

/* ---------- шапка ---------- */
.topbar { display: block; padding: 0; background: rgba(20,18,37,.92); border-bottom: 1px solid var(--line); }
.topbar-row { display: flex; align-items: center; gap: 18px; padding: 8px 24px; max-width: 1400px; margin: 0 auto; }
.logo { gap: 10px; }
.logo-mark {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; font-size: 18px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 6px 20px -6px var(--accent2);
  animation: none;
}
.logo-text { font-weight: 900; font-size: 20px; letter-spacing: .5px; display: flex; flex-direction: column; line-height: 1; }
.logo-sub { margin: 3px 0 0; font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }

.nav { gap: 2px; justify-content: center; }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 10px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); position: relative;
}
.nav a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.nav a:hover { background: transparent; color: #fff; }
.nav a:hover svg { transform: translateY(-2px); }
.nav a.active { background: transparent; color: #fff; }
.nav a.active svg { stroke: var(--accent); filter: drop-shadow(0 0 8px var(--accent)); }
.nav a.active::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -9px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); box-shadow: 0 0 12px var(--accent); }

.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: color .2s, border-color .2s; flex: none; }
.icon-btn:hover { color: #fff; border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.balance { border-radius: 999px; padding: 8px 14px; background: var(--panel); border-color: var(--line); }
.balance .cur, .balance #balNum { color: var(--price); }
.avatar { border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); }

/* лента последних дропов */
.livebar { display: flex; align-items: stretch; gap: 0; border-top: 1px solid var(--line); background: rgba(14,12,28,.7); height: 74px; }
.livebar-label { flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--line); writing-mode: horizontal-tb; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(74,241,184,.6); animation: livePulse 1.6s infinite; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 8px rgba(74,241,184,0); } 100% { box-shadow: 0 0 0 0 rgba(74,241,184,0); } }
.livebar-track { display: flex; gap: 2px; overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
.live-item {
  --rc: #8a86b8; flex: none; width: 128px; position: relative; padding: 6px 8px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
  background: linear-gradient(0deg, color-mix(in srgb, var(--rc) 30%, transparent), transparent 75%), var(--bg2);
  animation: liveIn .5s cubic-bezier(.2,1.2,.4,1);
}
.live-item::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--rc); box-shadow: 0 0 10px var(--rc); }
.live-item img { position: absolute; inset: 2px 10px 18px; width: calc(100% - 20px); height: calc(100% - 20px); object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.live-item .lw { position: relative; font-size: 9px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-item .ls { position: relative; font-size: 10.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-empty { display: flex; align-items: center; padding: 0 18px; color: var(--muted); font-size: 12px; }
@keyframes liveIn { from { opacity: 0; transform: translateX(-30px); width: 0; padding: 0; } }

/* ---------- типографика ---------- */
.view { max-width: 1320px; }
h1 { font-size: 26px; font-weight: 900; text-transform: uppercase; letter-spacing: .3px; }
h2 { font-size: 17px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.sub { color: var(--muted); }
.price { color: var(--price); font-weight: 700; }
.chip.warn { color: #c9b8ff; border-color: rgba(123,77,255,.45); background: rgba(123,77,255,.14); }
.chip.good { color: var(--good); border-color: rgba(74,241,184,.35); background: rgba(74,241,184,.08); }

/* ---------- кнопки и поля ---------- */
.btn { border-radius: 999px; font-weight: 700; background: var(--panel2); border-color: var(--line); }
.btn.primary {
  color: #fff; background: linear-gradient(180deg, #8b62ff 0%, var(--accent2) 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 8px 26px -8px rgba(95,37,244,.9);
  text-transform: uppercase; letter-spacing: .4px;
}
.btn.primary:hover:not(:disabled) { box-shadow: 0 0 0 1px rgba(255,255,255,.15) inset, 0 12px 34px -8px rgba(123,77,255,1); }
.btn.good { color: #062a1e; background: var(--good); }
.btn.lg { padding: 15px 32px; font-size: 15px; }
.input, .select { background: var(--bg2); border-radius: 10px; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123,77,255,.2); }
.qty { border-radius: 999px; background: var(--bg2); }
.qty button { border-radius: 999px; }
.qty button.on { background: var(--accent2); color: #fff; box-shadow: 0 0 16px -2px var(--accent2); }
.toggle input { accent-color: var(--accent); }
.tabs { border-radius: 999px; }
.tabs button { border-radius: 999px; }
.tabs button.on { background: var(--accent2); color: #fff; }
.panel { background: var(--panel); border-color: var(--line); }

/* ---------- кейсы ---------- */
.grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px 18px; }
.case-card {
  background: transparent; border: 0; border-radius: 16px; padding: 10px 10px 18px; text-align: center; overflow: visible;
}
.case-card::before {
  content: ""; position: absolute; inset: 18px 18px 60px; border-radius: 50%; z-index: -1; opacity: 0;
  background: radial-gradient(closest-side, rgba(123,77,255,.55), transparent); transition: opacity .3s;
}
.case-card:hover { transform: none; box-shadow: none; border: 0; }
.case-card:hover::before { opacity: 1; }
.case-card .case-art { height: 170px; margin-bottom: 8px; }
.case-card .case-art img { filter: drop-shadow(0 16px 20px rgba(0,0,0,.55)); }
.case-card:hover .case-art img, .case-card:hover .case-box { transform: translateY(-8px) scale(1.04); }
.case-title { font-size: 15px; font-weight: 700; }
.case-meta { flex-direction: column; gap: 8px; justify-content: center; margin-top: 10px; }
.case-meta .price { display: inline-block; padding: 6px 16px; border-radius: 999px; background: rgba(74,241,184,.1); border: 1px solid rgba(74,241,184,.18); font-size: 14px; }
.case-meta .chip { background: transparent; border: 0; padding: 0; color: var(--muted); font-weight: 600; }
.case-card::after {
  content: ""; position: absolute; left: 30%; right: 30%; bottom: 4px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .5; transition: opacity .3s, left .3s, right .3s;
}
.case-card:hover::after { opacity: 1; left: 20%; right: 20%; }
.case-box { background: linear-gradient(135deg, #8b62ff, var(--accent2)); box-shadow: inset 0 -12px 0 rgba(0,0,0,.2), 0 14px 30px -10px rgba(95,37,244,.8); }

/* ---------- плитки скинов ---------- */
.item-card {
  --rc: #8a86b8; border-radius: 10px; border: 1px solid transparent; padding: 10px 10px 12px;
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--rc) 22%, transparent) 0%, transparent 65%),
    linear-gradient(180deg, #221e40 0%, #1b1834 100%);
}
.item-card::after { height: 2px; }
.item-card::before { content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 34%; background: var(--rc); border-radius: 0 0 3px 0; opacity: .9; }
.item-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--rc) 55%, transparent); }
.item-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 10px 30px -12px var(--accent); }
.item-img { background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 30%, transparent), transparent); }
.item-weapon { font-size: 10.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-name { font-size: 12.5px; font-weight: 700; min-height: 0; -webkit-line-clamp: 1; }
.item-foot .price { font-size: 13px; }
.item-chance { color: var(--muted); }
.item-card.selected .item-check { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- страница кейса и рулетка ---------- */
.case-hero {
  grid-template-columns: 260px 1fr; padding: 26px 30px; border-radius: 18px; border: 1px solid var(--line);
  background: radial-gradient(60% 120% at 15% 50%, rgba(95,37,244,.35), transparent 70%), linear-gradient(180deg, var(--panel), var(--bg2));
}
.case-hero .case-art { height: 210px; }
.case-hero .case-art img { max-height: 210px; filter: drop-shadow(0 20px 26px rgba(0,0,0,.6)); }
.reel { background: linear-gradient(180deg, #17142c, #120f24); border-color: var(--line); border-radius: 14px; }
.reel-marker { background: #ffd34d; box-shadow: 0 0 16px #ffd34d; }
.reel-marker::before { border-top-color: #ffd34d; }
.reel-marker::after { border-bottom-color: #ffd34d; }
.reel .item-card.win { border-color: #ffd34d; }

/* ---------- апгрейдер ---------- */
.upg-slot { border-color: var(--line); background: var(--bg2); }
.upg-slot.filled { border-color: var(--accent); }
.upg-center { background: radial-gradient(circle, #241f45, var(--bg2)); border-color: var(--line); }

/* ---------- таблицы, модалки, тосты ---------- */
table { background: var(--panel); }
th { background: var(--bg2); }
.modal { background: linear-gradient(180deg, #221d42, var(--panel)); border-color: var(--line); }
.modal-back { background: rgba(10,8,22,.75); }
.auth-icon { background: linear-gradient(135deg, #8b62ff, var(--accent2)); color: #fff; }
.toast { background: var(--panel2); }
.debug-toggle { border-radius: 999px; background: var(--panel2); }
.debug-toggle b { background: var(--accent2); color: #fff; }
.debug { background: var(--bg2); }

@media (max-width: 900px) {
  .topbar-row { flex-wrap: wrap; padding: 8px 14px; gap: 8px; }
  .nav { order: 3; width: 100%; justify-content: flex-start; }
  .nav a { padding: 6px 9px; font-size: 9.5px; }
  .nav a.active::after { bottom: -4px; }
  #soundBtn { margin-left: auto; }
  .livebar { height: 62px; }
  .livebar-label { padding: 0 10px; font-size: 0; gap: 0; }
  .live-item { width: 104px; }
  .case-hero { grid-template-columns: 1fr; padding: 20px 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 10px; }
  .case-card .case-art { height: 130px; }
}

/* полоса статистики площадки */
.statsbar { display: flex; align-items: center; gap: 22px; padding: 6px 24px; font-size: 11.5px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); background: rgba(10,9,22,.6); max-width: none; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.statsbar:empty { display: none; }
.statsbar span { display: inline-flex; align-items: center; gap: 6px; }
.statsbar b { color: #fff; font-weight: 800; }
.statsbar .live-dot { display: inline-block; }
.statsbar .age { margin-left: auto; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--bad); color: var(--bad); font-weight: 800; }
@media (max-width: 900px) { .statsbar { gap: 14px; padding: 5px 14px; font-size: 10.5px; } }
