/* ============================================================
   UpBetter — тема «Neon Violet»
   Тёмный космос + авроры, глассморфизм, градиент violet→magenta
   ============================================================ */

:root {
  --bg: #07060f;
  --bg-2: #0c0a1a;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-solid: #12101f;
  --panel-2: rgba(255, 255, 255, 0.02);
  --inset: rgba(8, 6, 18, 0.55);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(160, 130, 255, 0.35);
  --text: #eeecf8;
  --muted: #9a94bd;
  --accent: #7c5cff;
  --accent-2: #b44dff;
  --accent-hot: #ff4ecd;
  --accent-hover: #9378ff;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --grad-accent: linear-gradient(135deg, #7c5cff 0%, #a44dff 55%, #ff4ecd 120%);
  --gold: #ffd166;
  --green: #3ddc97;
  --red: #ff5a7a;
  --blue: #5ad1ff;
  --radius: 16px;
  --glow-accent: 0 4px 24px rgba(124, 92, 255, 0.35);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --mono: Consolas, 'JetBrains Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Нативные контролы не наследуют шрифт сами — иначе кнопки/инпуты
   рендерятся системным шрифтом и «выпадают» из дизайна */
button, input, select, textarea { font-family: inherit; }

button {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:
    radial-gradient(1000px 520px at 85% -140px, rgba(124, 92, 255, 0.16), transparent 65%),
    radial-gradient(900px 600px at -10% -80px, rgba(255, 78, 205, 0.09), transparent 60%),
    radial-gradient(1100px 800px at 50% 115%, rgba(90, 209, 255, 0.06), transparent 62%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 420px);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Лёгкая неоновая сетка на фоне */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 122, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 122, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 20%, transparent 75%);
}

::selection { background: rgba(124, 92, 255, 0.45); color: #fff; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2b2545; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.page { flex: 1; padding: 28px 16px 56px; }

a { color: var(--blue); text-decoration: none; transition: color 0.15s ease; }
a:hover { text-decoration: underline; }
h1 { font-size: 27px; margin-bottom: 6px; letter-spacing: 0.2px; }
h2 { font-size: 17px; margin-bottom: 12px; letter-spacing: 0.2px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.gold { color: var(--gold); }
.green { color: var(--green); }
.red { color: var(--red); }
.hidden { display: none !important; }

/* Полоса прогресса SPA-навигации */
.router-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  opacity: 0;
  background: linear-gradient(90deg, #7c5cff, #ff4ecd);
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.8);
  z-index: 200;
  pointer-events: none;
}

hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(9, 7, 19, 0.72);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
.site-header::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(124, 92, 255, 0.55), rgba(255, 78, 205, 0.4), transparent 95%);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 72px;
}

.logo {
  position: relative;
  font-size: 23px; font-weight: 900; letter-spacing: 1px; color: var(--text);
  display: inline-flex; align-items: baseline;
  line-height: 1;
  flex-shrink: 0;
}
.logo span {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(150, 92, 255, 0.55));
}
.logo:hover { text-decoration: none; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--muted); font-size: 14.5px; font-weight: 600;
  padding: 8px 13px; border-radius: 9px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.nav-link:hover {
  color: var(--text);
  background: var(--accent-soft);
  text-decoration: none;
}
.nav-link.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: rgba(124, 92, 255, 0.35);
}
.nav-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.nav-user {
  color: var(--accent-hover); font-size: 14px; font-weight: 700;
  padding: 5px 13px; border: 1px solid var(--border-strong);
  border-radius: 999px; background: var(--accent-soft);
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pill {
  background: rgba(61, 220, 151, 0.1);
  border: 1px solid rgba(61, 220, 151, 0.35);
  color: var(--green);
  padding: 2px 10px; border-radius: 999px; font-size: 13px; white-space: nowrap;
}

/* Бургер и мобильная панель */
.nav-burger {
  display: none;
  width: 44px; height: 44px;
  margin-left: auto;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--accent-soft);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-burger span {
  width: 20px; height: 2px; border-radius: 2px;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.2s ease;
  display: block;
}
body.nav-open .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
body.nav-open .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
body.nav-open { overflow: hidden; }

.mobile-nav {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 70;
  width: min(320px, 88vw);
  background: rgba(12, 10, 26, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid var(--border);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 0.32s cubic-bezier(0.22, 0.9, 0.3, 1), visibility 0.32s;
  display: flex;
  flex-direction: column;
  padding: 12px 18px 24px;
  overflow-y: auto;
}
.mobile-nav.open { transform: none; visibility: visible; }
.mobile-nav-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  min-height: 60px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.mobile-nav-head .logo { font-size: 20px; line-height: 1; }
.mobile-nav-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  padding: 0;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 22px; line-height: 1;
  cursor: pointer;
}
.mobile-nav-links { display: flex; flex-direction: column; gap: 6px; }
.mobile-link {
  display: flex; align-items: center;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 15.5px; font-weight: 600;
  transition: color 0.15s ease, background 0.15s ease;
}
.mobile-link:hover, .mobile-link.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: rgba(124, 92, 255, 0.3);
  text-decoration: none;
}
.mobile-nav-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
}
.mobile-nav-sep { height: 1px; background: var(--border); margin: 10px 0; }
.mobile-register { margin-top: 12px; }

.nav-backdrop {
  position: fixed; inset: 0;
  z-index: 60;
  background: rgba(5, 4, 12, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.nav-backdrop.show { opacity: 1; pointer-events: auto; }

@media (max-width: 940px) {
  .main-nav, .nav-actions { display: none !important; }
  .nav-burger { display: inline-flex; }
  .header-inner { height: 64px; gap: 12px; }
  .logo { font-size: 21px; }
}

/* На десктопе панель и оверлей не существуют, даже если остался класс open */
@media (min-width: 941px) {
  .mobile-nav, .nav-backdrop { display: none !important; }
}

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018) 55%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 34px rgba(3, 2, 10, 0.45);
}
.card-inset {
  background: var(--inset);
  border: 1px dashed rgba(160, 130, 255, 0.22);
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
}
.notice { font-size: 14px; line-height: 1.5; }
.notice code { background: rgba(148, 122, 255, 0.14); padding: 1px 6px; border-radius: 5px; color: var(--accent-hover); }

.page-head { margin-bottom: 22px; }
.page-head p { max-width: 720px; }
.page-head h1 { font-size: 31px; font-weight: 900; }

/* ---------- Flashes ---------- */
.flash {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: 12px; margin-bottom: 14px;
  font-size: 14px; backdrop-filter: blur(8px);
  animation: slideDown 0.25s ease;
}
.flash-success { background: rgba(61, 220, 151, 0.09); border: 1px solid rgba(61, 220, 151, 0.4); color: var(--green); box-shadow: 0 0 22px rgba(61, 220, 151, 0.08); }
.flash-error { background: rgba(255, 90, 122, 0.09); border: 1px solid rgba(255, 90, 122, 0.42); color: var(--red); box-shadow: 0 0 22px rgba(255, 90, 122, 0.08); }
.flash-x { background: none; border: none; color: inherit; font-size: 18px; cursor: pointer; opacity: 0.7; }
.flash-x:hover { opacity: 1; }
@keyframes slideDown { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 18px;
  font-size: 15px; font-weight: 600; line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: all 0.18s ease;
}
.btn:hover {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  box-shadow: 0 0 18px rgba(124, 92, 255, 0.22);
  text-decoration: none;
}
.btn-accent {
  position: relative;
  background: var(--grad-accent);
  border-color: transparent;
  color: #fff;
  text-shadow: 0 1px 2px rgba(30, 10, 60, 0.4);
  box-shadow: var(--glow-accent);
}
.btn-accent:hover {
  filter: brightness(1.12) saturate(1.08);
  box-shadow: 0 6px 30px rgba(164, 77, 255, 0.5);
  transform: translateY(-1px);
}
.btn-danger { border-color: rgba(255, 90, 122, 0.5); color: var(--red); background: rgba(255, 90, 122, 0.07); }
.btn-danger:hover { border-color: var(--red); box-shadow: 0 0 18px rgba(255, 90, 122, 0.25); }
.btn-sm { min-height: 32px; padding: 6px 13px; font-size: 13px; border-radius: 9px; }
.btn-block { display: flex; width: 100%; text-align: center; }
.btn[disabled] { opacity: 0.6; cursor: wait; transform: none !important; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.tab {
  padding: 8px 17px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); font-size: 14px; font-weight: 500;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
  transition: all 0.18s ease;
}
.tab:hover { color: var(--text); text-decoration: none; border-color: var(--border-strong); }
.tab.active {
  background: var(--grad-accent);
  border-color: transparent;
  color: #fff; font-weight: 700;
  box-shadow: 0 3px 18px rgba(124, 92, 255, 0.4);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 3px 11px; border-radius: 999px;
}
.badge-live { background: rgba(61, 220, 151, 0.11); color: var(--green); border: 1px solid rgba(61, 220, 151, 0.4); box-shadow: inset 0 0 12px rgba(61, 220, 151, 0.08); }
.badge-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 1.4s infinite; }
.badge-upcoming { background: rgba(90, 209, 255, 0.1); color: var(--blue); border: 1px solid rgba(90, 209, 255, 0.38); }
.badge-finished { background: rgba(154, 148, 189, 0.1); color: var(--muted); border: 1px solid rgba(154, 148, 189, 0.32); }
.badge-winner { background: rgba(255, 209, 102, 0.1); color: var(--gold); border: 1px solid rgba(255, 209, 102, 0.45); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---------- Auction grid ---------- */
.auction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 18px;
}
.auction-card {
  display: block; color: var(--text); padding: 14px;
  position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.auction-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  text-decoration: none;
  box-shadow: 0 14px 40px rgba(3, 2, 10, 0.6), 0 0 26px rgba(124, 92, 255, 0.18);
}

/* Подсветка, следующая за курсором (--mx/--my ставит app.js, только десктоп) */
.auction-card::before,
.inventory-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    340px circle at var(--mx, 50%) var(--my, 50%),
    rgba(124, 92, 255, 0.22),
    rgba(255, 78, 205, 0.07) 45%,
    transparent 72%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.auction-card:hover::before,
.inventory-item:hover::before { opacity: 1; }
.card-top { display: flex; justify-content: flex-end; margin-bottom: 8px; min-height: 22px; }

.skin-img {
  height: 170px; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(124, 92, 255, 0.16), transparent 68%),
    var(--panel-2);
  border-radius: 12px; overflow: hidden;
}
.skin-img img { max-height: 92%; max-width: 92%; object-fit: contain; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.5)); transition: transform 0.22s ease; }
.auction-card:hover .skin-img img { transform: scale(1.06) translateY(-2px); }
.skin-img.big { height: 300px; margin-bottom: 14px; background: radial-gradient(circle at 50% 45%, rgba(124, 92, 255, 0.2), rgba(255, 78, 205, 0.05) 55%, transparent 75%); }
.skin-img.small { width: 110px; height: 110px; flex-shrink: 0; }
.skin-img-placeholder { color: var(--accent-hover); font-weight: 900; font-size: 26px; opacity: 0.45; text-shadow: 0 0 18px rgba(124, 92, 255, 0.6); }

.skin-name {
  margin-top: 12px; font-size: 15px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 40px;
}
.skin-title { font-size: 24px; font-weight: 800; }
.market-ref { color: var(--muted); font-size: 12px; margin-top: 4px; }

.price-block { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.price-label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.8px; }
.price {
  font-size: 22px; font-weight: 900;
  background: linear-gradient(120deg, #ffe29a, var(--gold) 55%, #ffb84d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.meta-row {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
}
.timer { font-family: var(--mono); font-weight: 700; color: var(--green); font-size: 14px; }
.timer.ending { color: var(--red); animation: pulse 1s infinite; }
.timer.expired { color: var(--muted); animation: none; }

/* ---------- Карусель лотов (главная) ---------- */
.carousel-section { margin-bottom: 26px; }
.carousel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.carousel-head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: 0.3px; }
.carousel-arrows { display: flex; gap: 8px; }
.car-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05); color: var(--text);
  font-size: 17px; line-height: 1; cursor: pointer;
  transition: all 0.15s ease;
}
.car-btn:hover {
  border-color: var(--border-strong);
  background: var(--accent-soft);
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.28);
}
.carousel {
  display: flex; gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

.car-slide {
  flex: 0 0 232px;
  scroll-snap-align: start;
  display: flex; flex-direction: column;
  padding: 12px; margin-bottom: 0;
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.car-slide:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  text-decoration: none;
  box-shadow: 0 14px 40px rgba(3, 2, 10, 0.6), 0 0 26px rgba(124, 92, 255, 0.2);
}
.car-top { display: flex; justify-content: flex-start; min-height: 22px; margin-bottom: 6px; }
.car-img {
  height: 150px; border-radius: 11px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(124, 92, 255, 0.16), transparent 68%),
    var(--panel-2);
}
.car-img img { max-height: 90%; max-width: 88%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5)); transition: transform 0.2s ease; }
.car-slide:hover .car-img img { transform: scale(1.07) translateY(-2px); }
.car-name {
  margin-top: 10px; font-size: 14px; font-weight: 600; line-height: 1.35; min-height: 38px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.car-meta { margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.car-price {
  font-size: 16px; font-weight: 800;
  background: linear-gradient(120deg, #ffe29a, var(--gold) 55%, #ffb84d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

@media (max-width: 720px) {
  .car-slide { flex-basis: 192px; padding: 10px; }
  .car-img { height: 118px; }
  .carousel-arrows { display: none; }
  .car-name { font-size: 13px; }
}

.empty-state { text-align: center; padding: 52px 20px; color: var(--muted); font-size: 15px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.page-num { padding: 7px 13px; border: 1px solid var(--border); border-radius: 9px; color: var(--muted); background: rgba(255, 255, 255, 0.03); }
.page-num.active, .page-num:hover {
  border-color: transparent; color: #fff; text-decoration: none;
  background: var(--grad-accent); box-shadow: 0 0 14px rgba(124, 92, 255, 0.35);
}

/* ---------- Auction page ---------- */
.auction-layout { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
.rules { font-size: 14px; color: var(--muted); line-height: 1.55; }
.rules ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.rules b { color: var(--red); }
.rules h3 { margin-bottom: 8px; color: var(--text); font-size: 15px; }

.status-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.price-huge {
  font-size: 44px; font-weight: 900; line-height: 1.1;
  background: linear-gradient(120deg, #ffe29a, var(--gold) 55%, #ffb84d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 14px rgba(255, 209, 102, 0.22));
}
.timer-big {
  font-family: var(--mono);
  font-size: 36px; font-weight: 700; color: var(--green);
  text-shadow: 0 0 22px rgba(61, 220, 151, 0.35);
  margin: 10px 0 14px;
}
.timer-big.ending { color: var(--red); text-shadow: 0 0 22px rgba(255, 90, 122, 0.4); animation: pulse 1s infinite; }
.timer-big.expired { color: var(--muted); text-shadow: none; }
.stats-row { display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.stats-row b { color: var(--text); }
.start-at { margin: 10px 0 14px; font-size: 16px; }

.bid-form { display: flex; gap: 10px; }
.bid-input-wrap { position: relative; flex: 1; }
.bid-input-wrap input {
  width: 100%; padding: 13px 40px 13px 15px;
  font-size: 18px; font-weight: 800; font-family: var(--mono);
}
.bid-currency { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.bid-msg { min-height: 22px; margin-top: 10px; font-size: 14px; }
.bid-msg.show.success { color: var(--green); }
.bid-msg.show.error { color: var(--red); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.7px;
  padding: 8px 10px; border-bottom: 1px solid var(--border-strong);
}
.table td { padding: 11px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:hover { background: rgba(124, 92, 255, 0.06); }
.table tr:last-child td { border-bottom: none; }
.skin-cell { display: flex; align-items: center; gap: 10px; max-width: 340px; }
.skin-thumb { width: 42px; height: 42px; object-fit: contain; background: rgba(148, 122, 255, 0.08); border-radius: 9px; padding: 3px; border: 1px solid var(--border); }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.trade-link { word-break: break-all; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'],
input[type='url'], input[type='datetime-local'], select, textarea {
  width: 100%;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.22), 0 0 18px rgba(124, 92, 255, 0.15);
}
input::placeholder, textarea::placeholder { color: rgba(154, 148, 189, 0.55); }
select option { background: var(--panel-solid); color: var(--text); }
.form-error {
  background: rgba(255, 90, 122, 0.09); border: 1px solid rgba(255, 90, 122, 0.42); color: var(--red);
  border-radius: 11px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px;
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }

/* ---------- Auth pages ---------- */
.auth-card { max-width: 440px; margin: 34px auto; padding: 28px; position: relative; overflow: hidden; }
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 15%; right: 15%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 92, 255, 0.7), rgba(255, 78, 205, 0.5), transparent);
}
.auth-alt { margin-top: 16px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Cabinet ---------- */
.cabinet-top { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: stretch; }
.balance-card {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
  background:
    radial-gradient(320px 200px at 20% 0%, rgba(124, 92, 255, 0.16), transparent 70%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.018) 55%);
}
.balance-value {
  font-size: 33px; font-weight: 900;
  background: linear-gradient(120deg, #aef7d6, var(--green) 60%, #21c47f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 12px rgba(61, 220, 151, 0.25));
  margin: 6px 0 12px;
}
.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.inventory-item { margin-bottom: 0; padding: 12px; }
.inventory-item .skin-img { height: 120px; }

/* ---------- Промокоды ---------- */
.promo-title { margin: 22px 0 10px; font-size: 16px; }
.promo-form { display: flex; gap: 10px; }
.promo-form .promo-input {
  flex: 1; padding: 11px 14px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--inset);
  color: var(--text); text-transform: uppercase; letter-spacing: 1.5px;
  font-family: var(--mono);
}
.promo-form .promo-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.22); }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14.5px; }
.checkbox-row input { accent-color: var(--accent); width: 16px; height: 16px; }
.inv-status { margin: 10px 0; }
.withdraw-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }

/* ---------- Admin ---------- */
.admin-nav { display: flex; gap: 8px; margin-bottom: 24px; overflow-x: auto; padding-bottom: 4px; }
.admin-tab {
  white-space: nowrap; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); font-size: 14px;
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.15s ease;
}
.admin-tab.active {
  background: var(--grad-accent); color: #fff; border-color: transparent; font-weight: 700;
  box-shadow: 0 3px 16px rgba(124, 92, 255, 0.38);
}
.admin-tab:hover { color: var(--text); text-decoration: none; border-color: var(--border-strong); }
.admin-tab.active:hover { color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { text-align: left; margin-bottom: 0; padding: 16px; }
.stat b {
  display: block; font-size: 27px; margin-top: 6px;
  background: linear-gradient(120deg, #d9ccff, var(--accent-hover));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat.attention {
  border-color: rgba(255, 209, 102, 0.55);
  box-shadow: 0 0 24px rgba(255, 209, 102, 0.1);
}
.search-form { display: flex; gap: 8px; }
.search-form input { width: 260px; }

/* ---------- Skin search (admin) ---------- */
.search-results { position: relative; }
.search-results.open { display: block; }
.search-loading, .search-empty { padding: 12px; color: var(--muted); font-size: 14px; }
.search-notice {
  margin-top: 10px; padding: 10px 12px; border-radius: 11px; font-size: 13.5px;
  background: rgba(255, 209, 102, 0.08); border: 1px solid rgba(255, 209, 102, 0.4); color: var(--gold);
}
.refresh-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.skin-result {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--inset); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 11px; margin-top: 6px;
  cursor: pointer; color: var(--text); text-align: left; font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.skin-result:hover, .skin-result.selected {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(124, 92, 255, 0.2);
}
.skin-result.selected { background: rgba(124, 92, 255, 0.1); }
.skin-result img { width: 44px; height: 44px; object-fit: contain; }
.sr-name { flex: 1; }
.sr-price { color: var(--gold); white-space: nowrap; }
#selected-skin { font-size: 14px; }
.quick-amounts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---------- Ежедневный бонус ---------- */
.bonus-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 18px; align-items: start; }
.bonus-main, .bonus-side { min-width: 0; max-width: 100%; overflow-wrap: break-word; }
.bonus-lock, .bonus-won { text-align: center; padding: 26px 10px; }
.bonus-lock-icon { font-size: 44px; margin-bottom: 8px; }
.bonus-lock .btn, .bonus-won .btn { margin-top: 12px; }

.progress {
  height: 10px; border-radius: 999px; overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  margin: 14px auto 8px; max-width: 360px;
}
.progress-bar {
  height: 100%; border-radius: 999px;
  background: var(--grad-accent);
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.5);
  transition: width 0.4s ease;
}

.roulette-wrap { position: relative; margin: 16px 0 14px; max-width: 100%; }
.roulette {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(124, 92, 255, 0.08), rgba(255, 78, 205, 0.04)),
    var(--inset);
}
.roulette-track {
  display: flex; gap: 8px;
  padding: 10px 0;
  width: max-content;
  will-change: transform;
}
.rt-item {
  flex: 0 0 96px;
  height: 96px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: radial-gradient(circle at 50% 40%, rgba(124, 92, 255, 0.14), transparent 70%), var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
}
.rt-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rt-item.winner-glow {
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.45);
}
.roulette-marker {
  position: absolute; left: 50%; top: -6px; bottom: -6px; width: 2px;
  transform: translateX(-50%);
  background: var(--gold);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.8);
  z-index: 3;
}
.roulette-fade {
  position: absolute; top: 0; bottom: 0; width: 60px;
  pointer-events: none; z-index: 2;
}
.roulette-fade-l { left: 0; background: linear-gradient(90deg, #0b0917, transparent); }
.roulette-fade-r { right: 0; background: linear-gradient(270deg, #0b0917, transparent); }

.bonus-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.bonus-pool-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: radial-gradient(circle at 50% 40%, rgba(124, 92, 255, 0.13), transparent 70%), var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  padding: 5px;
}
.bonus-pool-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.bp-weight {
  position: absolute; right: 3px; bottom: 3px;
  font-size: 10px; font-weight: 800; color: var(--gold);
  background: rgba(10, 8, 20, 0.85);
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 999px; padding: 0 5px;
}

@media (max-width: 920px) {
  .bonus-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .rt-item { flex-basis: 76px; height: 76px; }
  .bonus-pool { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 7px; }
}
@media (max-width: 560px) {
  .rt-item { flex-basis: 60px; height: 60px; border-radius: 8px; padding: 4px; }
  .roulette-fade-l, .roulette-fade-r { width: 34px; }
  .bonus-pool { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
  .bp-weight { font-size: 9px; right: 2px; bottom: 2px; padding: 0 4px; }
  .bonus-lock-icon { font-size: 38px; }
  .progress { max-width: 100%; }
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  border-top: 1px solid var(--border);
  padding: 20px 0 28px;
  color: var(--muted); font-size: 13px;
  background: rgba(7, 6, 15, 0.6);
}
.site-footer a { color: var(--accent-hover); }

/* ---------- Deposit ---------- */
.deposit-card { max-width: 540px; }
.pay-providers { display: grid; gap: 10px; margin-bottom: 16px; }
.pay-provider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.pay-provider:hover { border-color: var(--border-strong); }
.pay-provider:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.2);
}
.pay-provider input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
  margin: 0;
}
.pp-body { display: flex; flex-direction: column; gap: 2px; }
.pp-title { font-weight: 600; font-size: 15px; }
.pp-desc { font-size: 12.5px; color: var(--muted); }
.payments-table { margin-top: 6px; }
.payments-table th { text-align: left; white-space: nowrap; }

/* ---------- Анимации ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.auction-grid .auction-card { animation: riseIn 0.35s ease backwards; }
.auction-grid .auction-card:nth-child(2) { animation-delay: 0.04s; }
.auction-grid .auction-card:nth-child(3) { animation-delay: 0.08s; }
.auction-grid .auction-card:nth-child(4) { animation-delay: 0.12s; }
.auction-grid .auction-card:nth-child(n+5) { animation-delay: 0.16s; }

/* ---------- Планшеты ---------- */
@media (max-width: 920px) {
  .auction-layout { grid-template-columns: 1fr; }
  .cabinet-top { grid-template-columns: 1fr; }
  .price-huge { font-size: 36px; }
  .page-head h1 { font-size: 25px; }
  .bid-form { flex-direction: column; }
  .skin-img.big { height: 260px; }
}

/* ---------- Мобильные устройства ---------- */
@media (max-width: 720px) {
  /* Таблицы скроллятся внутри карточки, а не растягивают страницу */
  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table th, .table td { white-space: nowrap; padding: 8px; }

  .bid-form .btn { width: 100%; }

  .skin-img.big { height: 230px; }
  .skin-title { font-size: 20px; }
  .timer-big { font-size: 29px; }
  h1 { font-size: 22px; }
  .card { padding: 15px; border-radius: 14px; }

  /* Инпуты 16px — иначе iOS Safari зумит страницу при фокусе */
  input[type='text'], input[type='email'], input[type='password'], input[type='number'],
  input[type='url'], input[type='datetime-local'], select, textarea {
    font-size: 16px;
  }

  .search-form { flex-wrap: wrap; }
  .search-form input { width: auto; flex: 1; min-width: 0; }

  .promo-form { flex-wrap: wrap; }
  .promo-form .promo-input { flex: 1; min-width: 0; }

  .withdraw-preview { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .container { padding: 0 12px; }
  .page { padding: 18px 12px 42px; }

  .logo { font-size: 20px; }
  .pill { font-size: 12px; padding: 2px 8px; }

  .tabs { gap: 6px; }
  .tab { padding: 7px 13px; font-size: 13px; }

  .meta-row { font-size: 12px; }
  .price { font-size: 20px; }

  .inventory-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
  .inventory-item { padding: 10px; }
  .inventory-item .skin-img { height: 96px; }

  .form-grid { grid-template-columns: 1fr; }
  .promo-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

  .btn { padding: 10px 15px; font-size: 14.5px; }
  .btn-sm { padding: 7px 11px; font-size: 12.5px; }

  .auth-card { margin: 16px auto; padding: 20px 16px; }
  .empty-state { padding: 38px 14px; }
  .admin-nav { gap: 6px; }
  .admin-tab { padding: 7px 12px; font-size: 13px; }
  .refresh-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .price-huge { font-size: 32px; }
}

@media (max-width: 380px) {
  .price-huge { font-size: 28px; }
  .timer-big { font-size: 24px; letter-spacing: -1px; }
  .skin-name { font-size: 14px; }
}
