/* Без @import Google Fonts — на мобильном/VPN зависал весь CSS (пустой экран). */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: hidden;
  height: -webkit-fill-available;
  color-scheme: dark;
}
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-slow: 520ms;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  max-width: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-deep);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: color-mix(in srgb, var(--accent) 42%, transparent);
  color: var(--text);
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 48%, var(--border));
  background-clip: padding-box;
}
img, video, canvas, svg {
  max-width: 100%;
}
.logo-mark,
.case-crate-preview,
.roulette-item img,
.skin-card img,
.tab-ico {
  max-width: none;
}
a, button, .case-card, .mobile-tabbar a, .btn-open, .btn-ghost, .btn-steam {
  touch-action: manipulation;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Бело-синее */
:root,
[data-theme="blue"] {
  --accent: #3b82f6;
  --accent-dim: rgba(59, 130, 246, 0.22);
  --accent-glow: rgba(96, 165, 250, 0.35);
  --steam: #60a5fa;
  --bg-deep: #f3f6fb;
  --bg-panel: rgba(255, 255, 255, 0.88);
  --bg-card: #ffffff;
  --border: rgba(59, 130, 246, 0.12);
  --text: #1e293b;
  --text-muted: #64748b;
  --hero-tint: radial-gradient(ellipse 70% 50% at 70% 0%, rgba(59, 130, 246, 0.1), transparent);
  --map-overlay: linear-gradient(180deg, rgba(243, 246, 251, 0.9) 0%, rgba(243, 246, 251, 0.97) 100%);
}

/* Чёрно-белое */
[data-theme="mono"] {
  --accent: #e8e8e8;
  --accent-dim: rgba(255, 255, 255, 0.14);
  --accent-glow: rgba(255, 255, 255, 0.22);
  --steam: #d4d4d4;
  --bg-deep: #111111;
  --bg-panel: rgba(22, 22, 22, 0.94);
  --bg-card: #1a1a1a;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --hero-tint: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255, 255, 255, 0.05), transparent);
  --map-overlay: linear-gradient(180deg, rgba(17, 17, 17, 0.92) 0%, #111111 100%);
}

/* Красно-белое */
[data-theme="red"] {
  --accent: #e85d5d;
  --accent-dim: rgba(232, 93, 93, 0.2);
  --accent-glow: rgba(248, 113, 113, 0.32);
  --steam: #f87171;
  --bg-deep: #faf8f7;
  --bg-panel: rgba(255, 255, 255, 0.92);
  --bg-card: #ffffff;
  --border: rgba(232, 93, 93, 0.14);
  --text: #292524;
  --text-muted: #78716c;
  --hero-tint: radial-gradient(ellipse 70% 50% at 30% 0%, rgba(232, 93, 93, 0.09), transparent);
  --map-overlay: linear-gradient(180deg, rgba(250, 248, 247, 0.92) 0%, #faf8f7 100%);
}

/* Зелёно-чёрное */
[data-theme="green"] {
  --accent: #34d399;
  --accent-dim: rgba(52, 211, 153, 0.2);
  --accent-glow: rgba(52, 211, 153, 0.35);
  --steam: #6ee7b7;
  --bg-deep: #0a100e;
  --bg-panel: rgba(12, 20, 16, 0.92);
  --bg-card: #101a15;
  --border: rgba(52, 211, 153, 0.14);
  --text: #ecfdf5;
  --text-muted: #8fad9c;
  --hero-tint: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(52, 211, 153, 0.12), transparent);
  --map-overlay: linear-gradient(180deg, rgba(10, 16, 14, 0.9) 0%, #0a100e 100%);
}

/* Чёрно-оранжевое */
[data-theme="orange"] {
  --accent: #f4854a;
  --accent-dim: rgba(244, 133, 74, 0.26);
  --accent-glow: rgba(251, 168, 110, 0.38);
  --steam: #f5a06a;
  --bg-deep: #12100e;
  --bg-panel: rgba(28, 24, 22, 0.92);
  --bg-card: #1c1916;
  --border: rgba(244, 133, 74, 0.14);
  --text: #f7f1eb;
  --text-muted: #b5a89c;
  --hero-tint: radial-gradient(ellipse 80% 55% at 65% 10%, rgba(244, 133, 74, 0.14), transparent 55%);
  --map-overlay: linear-gradient(180deg, rgba(18, 16, 14, 0.78) 0%, rgba(18, 16, 14, 0.94) 55%, var(--bg-deep) 100%);
}

/* Тёмно-голубое */
[data-theme="cyan"] {
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.22);
  --accent-glow: rgba(103, 232, 249, 0.35);
  --steam: #67e8f9;
  --bg-deep: #071018;
  --bg-panel: rgba(10, 22, 32, 0.94);
  --bg-card: #0c1824;
  --border: rgba(34, 211, 238, 0.16);
  --text: #e8f7fb;
  --text-muted: #7fa8b8;
  --hero-tint: radial-gradient(ellipse 70% 50% at 60% 0%, rgba(34, 211, 238, 0.14), transparent);
  --map-overlay: linear-gradient(180deg, rgba(7, 16, 24, 0.86) 0%, #071018 100%);
}

/* Чёрно-золотое */
[data-theme="gold"] {
  --accent: #eab308;
  --accent-dim: rgba(234, 179, 8, 0.22);
  --accent-glow: rgba(250, 204, 21, 0.35);
  --steam: #facc15;
  --bg-deep: #120f08;
  --bg-panel: rgba(28, 24, 14, 0.94);
  --bg-card: #1c180f;
  --border: rgba(234, 179, 8, 0.16);
  --text: #f8f1d8;
  --text-muted: #b5a67a;
  --hero-tint: radial-gradient(ellipse 70% 50% at 40% 0%, rgba(234, 179, 8, 0.14), transparent);
  --map-overlay: linear-gradient(180deg, rgba(18, 15, 8, 0.88) 0%, #120f08 100%);
}

/* Тёмно-фиолетовое */
[data-theme="violet"] {
  --accent: #a78bfa;
  --accent-dim: rgba(167, 139, 250, 0.22);
  --accent-glow: rgba(196, 181, 253, 0.35);
  --steam: #c4b5fd;
  --bg-deep: #0e0a16;
  --bg-panel: rgba(22, 16, 34, 0.94);
  --bg-card: #161022;
  --border: rgba(167, 139, 250, 0.16);
  --text: #f3eefc;
  --text-muted: #9b8fb8;
  --hero-tint: radial-gradient(ellipse 70% 50% at 70% 0%, rgba(167, 139, 250, 0.16), transparent);
  --map-overlay: linear-gradient(180deg, rgba(14, 10, 22, 0.88) 0%, #0e0a16 100%);
}

/* Тёмно-розовое */
[data-theme="rose"] {
  --accent: #fb7185;
  --accent-dim: rgba(251, 113, 133, 0.22);
  --accent-glow: rgba(253, 164, 175, 0.35);
  --steam: #fda4af;
  --bg-deep: #140a0e;
  --bg-panel: rgba(30, 16, 22, 0.94);
  --bg-card: #1c1016;
  --border: rgba(251, 113, 133, 0.16);
  --text: #fff1f3;
  --text-muted: #b8979f;
  --hero-tint: radial-gradient(ellipse 70% 50% at 30% 0%, rgba(251, 113, 133, 0.14), transparent);
  --map-overlay: linear-gradient(180deg, rgba(20, 10, 14, 0.88) 0%, #140a0e 100%);
}

/* Стальное */
[data-theme="steel"] {
  --accent: #94a3b8;
  --accent-dim: rgba(148, 163, 184, 0.2);
  --accent-glow: rgba(203, 213, 225, 0.28);
  --steam: #cbd5e1;
  --bg-deep: #0b1220;
  --bg-panel: rgba(15, 23, 42, 0.94);
  --bg-card: #111827;
  --border: rgba(148, 163, 184, 0.16);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --hero-tint: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(148, 163, 184, 0.12), transparent);
  --map-overlay: linear-gradient(180deg, rgba(11, 18, 32, 0.9) 0%, #0b1220 100%);
}

/* Кислотный лайм */
[data-theme="lime"] {
  --accent: #a3e635;
  --accent-dim: rgba(163, 230, 53, 0.22);
  --accent-glow: rgba(190, 242, 100, 0.35);
  --steam: #bef264;
  --bg-deep: #0b1208;
  --bg-panel: rgba(16, 24, 12, 0.94);
  --bg-card: #121a0e;
  --border: rgba(163, 230, 53, 0.16);
  --text: #f7fee7;
  --text-muted: #9aaa7c;
  --hero-tint: radial-gradient(ellipse 70% 50% at 55% 0%, rgba(163, 230, 53, 0.14), transparent);
  --map-overlay: linear-gradient(180deg, rgba(11, 18, 8, 0.88) 0%, #0b1208 100%);
}

/* Песочный светлый */
[data-theme="sand"] {
  --accent: #d97706;
  --accent-dim: rgba(217, 119, 6, 0.18);
  --accent-glow: rgba(245, 158, 11, 0.28);
  --steam: #f59e0b;
  --bg-deep: #f7f3ea;
  --bg-panel: rgba(255, 252, 245, 0.94);
  --bg-card: #fffdf8;
  --border: rgba(217, 119, 6, 0.14);
  --text: #292524;
  --text-muted: #78716c;
  --hero-tint: radial-gradient(ellipse 70% 50% at 40% 0%, rgba(217, 119, 6, 0.08), transparent);
  --map-overlay: linear-gradient(180deg, rgba(247, 243, 234, 0.92) 0%, #f7f3ea 100%);
}

.bg-map {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    var(--map-overlay, linear-gradient(180deg, rgba(8, 10, 14, 0.85), var(--bg-deep))),
    url('https://steamcdn-a.akamaihd.net/apps/csgo/images/csgo_react/dust2_2021_1.jpg') center/cover no-repeat;
  filter: saturate(0.8) contrast(1.02);
  pointer-events: none;
  transform: scale(1.02);
}
.bg-map::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    var(--hero-tint),
    radial-gradient(ellipse 80% 55% at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%),
    radial-gradient(ellipse 90% 70% at 50% 110%, rgba(0, 0, 0, 0.35), transparent 55%);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  grid-template-areas:
    'live'
    'header'
    'theme'
    'main'
    'footer';
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.site-footer {
  grid-area: footer;
  padding: 28px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-panel) 92%, transparent);
  text-align: center;
  max-width: 100%;
}
.footer-lead {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  font-weight: 600;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-bottom: 12px;
}
.footer-links a {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }
.footer-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted);
}
.legal-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 8px 4px 40px;
}
.legal-page h1 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  line-height: 1.25;
}
.legal-page .legal-updated {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--text-muted);
}
.legal-page h2 {
  margin: 22px 0 8px;
  font-size: 1.05rem;
}
.legal-page p,
.legal-page li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.legal-page ul {
  margin: 0 0 12px;
  padding-left: 1.2em;
}
.legal-page p { margin: 0 0 10px; }
.legal-page .legal-notice {
  padding: 14px 16px;
  border-inline-start: 3px solid var(--accent);
  background: var(--bg-panel);
  border-radius: 8px;
}
.legal-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-panel);
  color: var(--text);
}
.legal-dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
.legal-dialog h2 { margin: 0 0 12px; font-size: 1.2rem; }
.legal-dialog .footer-links { justify-content: flex-start; }
.legal-dialog label { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.legal-dialog input { flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.legal-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
@media (max-width: 900px) {
  .site-footer {
    padding: 22px 14px calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

/* Mobile: одна кнопка «Интерфейс», темы открываются по клику */
.theme-bar {
  display: none;
  grid-area: theme;
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.theme-bar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    var(--bg-card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}
.theme-bar-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.theme-bar-current {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46%;
  text-align: right;
}
.theme-bar-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-top: -3px;
}
.theme-bar.is-open .theme-bar-chevron {
  transform: rotate(-135deg);
  margin-top: 3px;
  border-color: var(--accent);
}
.theme-bar.is-open .theme-bar-btn {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.theme-panel {
  margin-top: 8px;
}
.theme-panel[hidden] {
  display: none !important;
}
.theme-plashka-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.theme-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 58px;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}
.theme-chip i {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent);
}
.theme-chip span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.theme-chip[aria-current='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 8px 20px var(--accent-dim);
  color: var(--accent);
}

/* Top live bar */
.top-live {
  grid-area: live;
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.live-online {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.live-online .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}
.online-label { color: var(--text-muted); font-weight: 700; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.25); }
}
.live-feed-h {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.live-feed-track-h {
  display: flex;
  gap: 8px;
  width: max-content;
  animation: live-scroll-x 55s linear infinite;
}
.live-feed-h:hover .live-feed-track-h { animation-play-state: paused; }
@keyframes live-scroll-x {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.live-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 168px;
  padding: 5px 10px 5px 6px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.live-item .rarity-bar {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  min-height: 36px;
}
.live-item img { width: 44px; height: 32px; object-fit: contain; }
.live-item .meta { min-width: 0; }
.live-item .meta strong {
  display: block;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.live-item .meta span { font-size: 9px; color: var(--text-muted); }
.live-item .user { font-size: 9px; color: var(--accent); margin-top: 1px; }

/* Header */
.site-header {
  grid-area: header;
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  line-height: 0;
  transition: transform var(--dur-fast) var(--ease-out);
}
.logo:hover { transform: translateY(-1px); }
.logo-mark {
  display: block;
  width: auto;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 0 18px var(--accent-dim);
  transition: box-shadow var(--dur) var(--ease-soft), transform var(--dur) var(--ease-out);
}
.logo:hover .logo-mark {
  box-shadow: 0 0 26px var(--accent-glow);
  transform: scale(1.02);
}
.nav-main {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}
.nav-main a,
.nav-theme > summary {
  position: relative;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 10px;
  transition:
    color var(--dur) var(--ease-soft),
    text-shadow var(--dur) var(--ease-soft),
    background var(--dur) var(--ease-soft);
}
.nav-main a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.nav-main a.active {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}
.nav-main a::after {
  content: '';
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 4px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  border-radius: 2px;
  opacity: 0;
  transition:
    left var(--dur) var(--ease-out),
    right var(--dur) var(--ease-out),
    opacity var(--dur) var(--ease-soft);
}
.nav-main a.active::after {
  left: 20%;
  right: 20%;
  opacity: 1;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
}
#auth-slot {
  min-width: 0;
  max-width: 100%;
}
.theme-picker {
  position: relative;
  z-index: 130;
}
.nav-theme {
  display: flex;
  align-items: center;
  align-self: center;
}
.theme-picker summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.theme-picker summary::-webkit-details-marker { display: none; }
.nav-theme > summary {
  border: none;
  background: transparent;
  border-radius: 10px;
  line-height: 1.2;
}
.nav-theme[open] > summary,
.theme-picker[open] summary {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}
.theme-picker-mobile {
  display: none;
}
.theme-picker-mobile summary {
  width: 40px;
  height: 40px;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 0;
}
.theme-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  flex-shrink: 0;
}
/* display на потомке details ломает скрытие в Chromium — явно прячем */
.theme-picker:not([open]) > .theme-menu {
  display: none !important;
}
.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, calc(100vw - 24px));
  max-height: min(70vh, 420px);
  overflow: auto;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
}
.theme-picker[open] > .theme-menu {
  display: grid;
}
.theme-picker-mobile .theme-menu {
  left: auto;
  right: 0;
  transform: none;
  width: min(300px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
}
.theme-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-panel) 70%, transparent);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.theme-menu button:hover { border-color: var(--border); background: var(--accent-dim); }
.theme-menu .theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}
.theme-menu .theme-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.theme-menu .theme-meta b {
  font-size: 12px;
  font-weight: 800;
}
.theme-menu .theme-meta small {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.2;
}
.theme-menu button[aria-current="true"] {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}

.btn-steam {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(180deg, #8fd956 0%, var(--steam) 100%);
  color: #0a1208;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(122, 201, 67, 0.35);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-soft);
}
.btn-steam:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(122, 201, 67, 0.45);
}
.btn-steam:active { transform: translateY(0) scale(0.98); }
.btn-steam svg { width: 18px; height: 18px; }
.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition:
    border-color var(--dur) var(--ease-soft),
    box-shadow var(--dur) var(--ease-soft),
    transform var(--dur-fast) var(--ease-out);
}
.profile-chip:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 8px 20px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}
.profile-chip img { width: 32px; height: 32px; border-radius: 50%; }
.profile-chip .bal { font-size: 11px; color: var(--accent); font-weight: 700; }

.main-content {
  grid-area: main;
  position: relative;
  z-index: 1;
  padding: 24px 28px 48px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
  overflow-x: hidden;
  opacity: 1 !important; /* не прячем весь контент анимацией */
}
/* Без opacity:0 — на Android/WebView fill-mode both оставлял пустой экран */
.main-content.page-enter {
  animation: page-enter var(--dur-slow) var(--ease-out);
}
@keyframes page-enter {
  from {
    transform: translateY(14px);
  }
  to {
    transform: none;
  }
}

.subnav-cases {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.subnav-cases .tab {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-decoration: none;
  transition:
    color var(--dur) var(--ease-soft),
    border-color var(--dur) var(--ease-soft),
    background var(--dur) var(--ease-soft),
    box-shadow var(--dur) var(--ease-soft),
    transform var(--dur-fast) var(--ease-out);
}
.subnav-cases .tab:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transform: translateY(-1px);
}
.subnav-cases .tab.active {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: 0 0 22px var(--accent-dim);
}
.search-btn {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.45rem;
  font-weight: 400;
  margin: 28px 0 16px;
  letter-spacing: 0.1em;
}
.section-title:first-child { margin-top: 0; }

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 22px;
  align-items: stretch;
}
.case-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  min-height: 248px;
  padding: 18px 14px 16px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 42%),
    var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition:
    transform var(--dur-slow) var(--ease-spring),
    box-shadow var(--dur-slow) var(--ease-soft),
    border-color var(--dur) var(--ease-soft),
    background var(--dur) var(--ease-soft);
  overflow: hidden;
  transform: translateZ(0);
  will-change: transform;
}
.case-card::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 180deg, transparent, var(--accent-dim), transparent);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-soft);
  animation: case-spin 8s linear infinite;
  animation-play-state: paused;
}
.case-card:hover {
  transform: translateY(-8px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.38),
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
    0 0 34px var(--accent-dim);
}
.case-card:hover::before { opacity: 0.28; animation-play-state: running; }
.case-card:active {
  transform: translateY(-3px) scale(0.99);
}
@keyframes case-spin { to { transform: rotate(360deg); } }
.case-card > * { position: relative; z-index: 1; }
.case-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  background: #3b82f6;
  color: #fff;
  z-index: 2;
}
.case-visual.has-art {
  --skin-tint: #f4854a;
  /* та же нейтральная плитка, что у CSS-crate — ряд не «прыгает» */
  background: color-mix(in srgb, var(--text) 5%, transparent);
  box-shadow: none;
  overflow: hidden;
  perspective: 720px;
  border-radius: inherit;
}
.case-art-wrap {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translateY(2px);
  transform-origin: 50% 62%;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}
.case-art {
  width: auto;
  height: auto;
  max-width: 94%;
  max-height: 94%;
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.32));
  opacity: 1;
}
.case--dipper .case-art,
.case--swofly .case-art {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
}
.case-art-wrap picture {
  display: contents;
}
.case-art-shine {
  position: absolute;
  inset: 8% 12%;
  pointer-events: none;
  border-radius: 22px;
  background: linear-gradient(
    118deg,
    transparent 32%,
    rgba(255, 255, 255, 0.16) 46%,
    transparent 58%
  );
  mix-blend-mode: screen;
  transform: translateX(-70%);
  animation: case-art-gleam 5.2s ease-in-out infinite;
}
@keyframes case-art-gleam {
  0%, 58% { transform: translateX(-70%); opacity: 0; }
  66% { opacity: 0.4; }
  82%, 100% { transform: translateX(70%); opacity: 0; }
}
.case-card:hover .case-visual.has-art {
  transform: translateY(-5px) scale(1.03);
}
.case-card:hover .case-art-wrap {
  transform: translateY(-2px) scale(1.03);
}
.case-card:hover .case-art {
  filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.38));
}
.case-art-skin {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 46%;
  width: 76%;
  height: 40%;
  object-fit: contain;
  pointer-events: none;
  transform: translate(-50%, -58%);
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.4));
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.case-card:hover .case-art-skin {
  transform: translate(-50%, -64%) scale(1.04);
}
.case-visual {
  --crate-a: #2a241f;
  --crate-b: #f4854a;
  --crate-c: #1a1512;
  --crate-glow: rgba(244, 133, 74, 0.45);
  position: relative;
  flex: 0 0 168px;
  width: 186px;
  height: 168px;
  max-width: 100%;
  margin-bottom: 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* нейтральная плитка одной высоты — без цветных подложек под кейсами */
  background: color-mix(in srgb, var(--text) 5%, transparent);
  box-shadow: none;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.45s;
  overflow: hidden;
  isolation: isolate;
}
.case-card:hover .case-visual {
  transform: translateY(-5px) scale(1.045);
  box-shadow: none;
}
.case-crate {
  position: relative;
  width: 108px;
  height: 92px;
  transform-style: preserve-3d;
  /* без постоянного float — иначе карточки в ряду «прыгают» относительно has-art */
  animation: none;
}
.case-card:hover .case-crate {
  animation: crate-float 3.6s ease-in-out infinite;
}
@keyframes crate-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.case-crate-lid {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 4px;
  height: 22px;
  border-radius: 10px 10px 4px 4px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--crate-b) 78%, #fff), var(--crate-b) 55%, color-mix(in srgb, var(--crate-b) 55%, #000));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    0 4px 0 rgba(0,0,0,0.25);
  z-index: 4;
  transform-origin: top center;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.case-card:hover .case-crate-lid {
  transform: rotateX(-18deg) translateY(-2px);
}
.case-crate-lid::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 7px;
  width: 28px;
  height: 8px;
  margin-left: -14px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f6e7c8, #c4a46a);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 1px 2px rgba(0,0,0,0.35);
}
.case-crate-body {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 22px;
  bottom: 10px;
  border-radius: 8px 8px 12px 12px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--crate-a) 85%, #fff 10%), var(--crate-a) 40%, var(--crate-c));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    inset 0 0 0 2px rgba(0,0,0,0.2),
    inset 0 -18px 28px rgba(0,0,0,0.35),
    0 10px 18px rgba(0,0,0,0.35);
  overflow: hidden;
  z-index: 3;
}
.case-crate-strap {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  background: linear-gradient(180deg, #e8d5a8, #9a7b3e 45%, #6b5324);
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.35), inset -1px 0 0 rgba(0,0,0,0.35);
  opacity: 0.9;
}
.case-crate-strap-l { left: 14px; }
.case-crate-strap-r { right: 14px; }
.case-crate-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%);
  min-width: 42px;
  padding: 7px 10px;
  border-radius: 999px;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #1a120c;
  background:
    radial-gradient(circle at 30% 25%, #fff6d8, #f0c14b 45%, #b45309);
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--crate-b) 35%, transparent),
    0 6px 14px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.55);
  z-index: 5;
  line-height: 1;
  white-space: nowrap;
}
.case-crate-shine {
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.22) 48%, transparent 62%);
  transform: translateX(-60%);
  animation: crate-shine 4.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 6;
}
@keyframes crate-shine {
  0%, 55% { transform: translateX(-70%); opacity: 0; }
  65% { opacity: 1; }
  85%, 100% { transform: translateX(70%); opacity: 0; }
}
.case-crate-base {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 2px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,0.5), transparent 70%);
  z-index: 1;
}
.case-crate-preview {
  position: absolute;
  right: -2px;
  bottom: 8px;
  width: 46px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.45));
  opacity: 0.92;
  z-index: 7;
  transform: rotate(8deg);
  pointer-events: none;
}
.case-card:hover .case-crate-preview {
  transform: rotate(0deg) scale(1.08) translateY(-3px);
  transition: transform 0.35s ease;
}

.case--crimson { --crate-a: #7f1d1d; --crate-b: #fb7185; --crate-c: #450a0a; --crate-glow: rgba(251,113,133,0.4); }
.case--morph { --crate-a: #134e4a; --crate-b: #2dd4bf; --crate-c: #042f2e; --crate-glow: rgba(45,212,191,0.4); }
.case--minion { --crate-a: #854d0e; --crate-b: #facc15; --crate-c: #422006; --crate-glow: rgba(250,204,21,0.4); }
.case--rain { --crate-a: #1e3a8a; --crate-b: #38bdf8; --crate-c: #0c1a4a; --crate-glow: rgba(56,189,248,0.4); }
.case--malibu { --crate-a: #6d28d9; --crate-b: #e879f9; --crate-c: #3b0764; --crate-glow: rgba(232,121,249,0.4); }
.case--autumn { --crate-a: #9a3412; --crate-b: #fb923c; --crate-c: #431407; --crate-glow: rgba(251,146,60,0.4); }
.case--burgundy { --crate-a: #881337; --crate-b: #fb7185; --crate-c: #4c0519; --crate-glow: rgba(190,18,60,0.4); }
.case--gta { --crate-a: #0f172a; --crate-b: #34d399; --crate-c: #020617; --crate-glow: rgba(52,211,153,0.35); }
.case--dipper { --crate-a: #1e3a5f; --crate-b: #2f7cc4; --crate-c: #c62828; --crate-glow: rgba(47,124,196,0.45); }
.case--swofly { --crate-a: #111111; --crate-b: #f4f4f4; --crate-c: #7ec8e3; --crate-glow: rgba(180,210,220,0.35); }
.case--oasis { --crate-a: #b45309; --crate-b: #fde68a; --crate-c: #78350f; --crate-glow: rgba(251,191,36,0.4); }
.case--sapphire { --crate-a: #1d4ed8; --crate-b: #93c5fd; --crate-c: #1e3a8a; --crate-glow: rgba(96,165,250,0.45); }
.case--emerald { --crate-a: #047857; --crate-b: #6ee7b7; --crate-c: #064e3b; --crate-glow: rgba(52,211,153,0.4); }
.case--ruby { --crate-a: #b91c1c; --crate-b: #fca5a5; --crate-c: #7f1d1d; --crate-glow: rgba(248,113,113,0.4); }
.case--royal { --crate-a: #1c1917; --crate-b: #fbbf24; --crate-c: #0c0a09; --crate-glow: rgba(251,191,36,0.45); }
.case--ak { --crate-a: #44403c; --crate-b: #d6d3d1; --crate-c: #292524; --crate-glow: rgba(214,211,209,0.3); }
.case--awp { --crate-a: #334155; --crate-b: #94a3b8; --crate-c: #0f172a; --crate-glow: rgba(148,163,184,0.35); }
.case--knives { --crate-a: #5b21b6; --crate-b: #c4b5fd; --crate-c: #2e1065; --crate-glow: rgba(196,181,253,0.4); }
.case-name {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  margin-top: auto;
  margin-bottom: 6px;
  min-height: 1.25em;
  line-height: 1.25;
  width: 100%;
}
.case-price {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
}
.coin-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd56a, #e6a800);
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.25);
}

/* Case open page */
.case-hero {
  text-align: center;
  padding: 32px 16px 24px;
  position: relative;
}
.case-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  animation: title-glow 3s ease-in-out infinite alternate;
}
@keyframes title-glow {
  from { text-shadow: 0 0 20px var(--accent-dim); }
  to { text-shadow: 0 0 40px var(--accent-glow); }
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 20px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

.roulette-stack {
  --roulette-item-w: 140px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px auto 28px;
  max-width: 1100px;
  width: 100%;
  isolation: isolate;
}
.roulette-stack.is-multi {
  gap: 20px;
}
.roulette-stack.is-multi .roulette-wrap {
  margin: 0;
  padding: 32px 0 18px;
  flex: 0 0 auto;
  isolation: isolate;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}
.roulette-stack .lane-label {
  position: absolute;
  left: 12px;
  top: 8px;
  z-index: 4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  pointer-events: none;
}
.roulette-wrap {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 1100px;
  width: 100%;
  padding: 20px 0;
  border-radius: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  overflow: hidden;
  flex: 0 0 auto;
  contain: layout paint;
}
.roulette-wrap::before,
.roulette-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.roulette-wrap::before { left: 0; background: linear-gradient(90deg, var(--bg-panel), transparent); }
.roulette-wrap::after { right: 0; background: linear-gradient(-90deg, var(--bg-panel), transparent); }
.roulette-pointer {
  position: absolute;
  left: 50%;
  top: 8px;
  bottom: 8px;
  width: 3px;
  transform: translateX(-50%);
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  z-index: 3;
  border-radius: 2px;
}
.roulette-viewport { overflow: hidden; padding: 8px 0; }
.roulette-track {
  display: flex;
  gap: 8px;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}
.roulette-item {
  flex: 0 0 var(--roulette-item-w);
  width: var(--roulette-item-w);
  box-sizing: border-box;
  height: 120px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  overflow: hidden;
}
.roulette-item img { width: 90px; height: 68px; object-fit: contain; }
.roulette-item span {
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.case-hero-price {
  color: var(--text-muted);
  margin: 0;
  font-size: 14px;
}
.staging-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 8px 14px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #1a1208;
  background: linear-gradient(90deg, #f0b429, #ff8a3d);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}
.staging-banner b {
  font-weight: 800;
}
body.is-staging .app-shell {
  padding-top: 0;
}
.auth-wait-banner {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-panel) 94%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.auth-wait-banner b { font-size: 13px; display: block; }
.auth-wait-banner span {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  line-height: 1.35;
}
@media (min-width: 901px) {
  .auth-wait-banner {
    left: 50%;
    right: auto;
    bottom: 24px;
    width: min(560px, calc(100vw - 32px));
    transform: translateX(-50%);
  }
  .auth-wait-actions {
    flex-direction: row;
  }
}
@keyframes winner-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.open-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-bottom: 32px;
}
.btn-open {
  padding: 14px 36px;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(180deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, #000) 100%);
  color: #0a0c10;
  box-shadow: 0 8px 30px var(--accent-dim);
  transition:
    transform var(--dur) var(--ease-out),
    opacity var(--dur) var(--ease-soft),
    box-shadow var(--dur) var(--ease-soft),
    filter var(--dur) var(--ease-soft);
}
.btn-open:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-open:not(:disabled):hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 36px var(--accent-glow);
  filter: brightness(1.04);
}
.btn-ghost {
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition:
    transform var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-soft),
    background var(--dur) var(--ease-soft),
    box-shadow var(--dur) var(--ease-soft);
}
.btn-ghost:hover {
  border-color: var(--accent-dim);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}
.multiplier {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.multiplier button {
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 700;
  cursor: pointer;
}
.multiplier button.active { border-color: var(--accent); color: var(--accent); }
.open-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.btn-fast {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, transparent), color-mix(in srgb, var(--accent) 8%, transparent));
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 18px var(--accent-dim);
}
.btn-fast:disabled { opacity: 0.45; cursor: not-allowed; }
.roulette-track.is-fast {
  transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}
.roulette-stack.is-batch .roulette-wrap {
  max-width: 720px;
  margin-inline: auto;
}
.roulette-stack.is-dense {
  --roulette-item-w: 112px;
  gap: 18px;
  max-height: none;
  overflow-x: hidden;
  overflow-y: visible;
  max-width: 100%;
  padding: 4px 0 10px;
}
.roulette-stack.is-dense .roulette-wrap {
  padding: 34px 0 16px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 40%),
    var(--bg-panel);
}
.roulette-stack.is-dense .roulette-viewport {
  padding: 4px 0;
}
.roulette-stack.is-dense .roulette-item {
  height: 86px;
  padding: 6px 4px;
  border-radius: 10px;
}
.roulette-stack.is-dense .roulette-item img {
  width: 72px;
  height: 50px;
}
.roulette-stack.is-dense .roulette-item span {
  font-size: 9px;
}
.roulette-stack.is-dense .lane-label {
  top: 8px;
  font-size: 10px;
}
.roulette-stack.is-dense .roulette-pointer {
  top: 26px;
  bottom: 6px;
}
.roulette-wrap.is-spinning {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22), 0 0 22px var(--accent-dim);
}
.roulette-wrap.is-done {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
}

.contents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.skin-card {
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition:
    transform var(--dur-slow) var(--ease-spring),
    border-color var(--dur) var(--ease-soft),
    box-shadow var(--dur) var(--ease-soft);
}
.skin-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22), 0 0 22px var(--accent-dim);
}
.skin-card .img-wrap {
  position: relative;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
}
.skin-card img {
  max-width: 90%;
  max-height: 84px;
  object-fit: contain;
  transition: transform var(--dur-slow) var(--ease-spring);
}
.skin-card:hover img { transform: scale(1.06) translateY(-2px); }
.skin-card .info { padding: 10px; border-top: 1px solid var(--border); min-width: 0; }
.skin-card .info strong {
  display: block;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skin-card .info em {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skin-card .skin-price {
  display: block;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skin-card .rarity-stripe { height: 3px; }
.skin-card.is-st { border-color: rgba(207, 114, 58, 0.45); }
.st-badge {
  display: inline-block;
  padding: 1px 5px;
  margin-right: 4px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1a120c;
  background: linear-gradient(135deg, #cf723a, #f0a060);
  vertical-align: middle;
}
.skin-card .img-wrap .st-badge,
.up-item .st-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  margin: 0;
}
.up-item { position: relative; }
.roulette-item.is-st span { color: #cf723a; }

/* Profile & inventory */
.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}
.profile-main-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
@media (max-width: 800px) {
  .profile-layout { grid-template-columns: 1fr; }
}
.profile-card {
  padding: 24px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-align: center;
}
.profile-card .avatar-lg {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 3px solid var(--accent-dim);
  box-shadow: 0 0 30px var(--accent-dim);
}
.profile-card h2 { margin: 0 0 4px; font-size: 1.25rem; }
.profile-card .steam-id { font-size: 11px; color: var(--text-muted); margin-bottom: 16px; }
.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.stat-box {
  padding: 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-panel));
  border: 1px solid var(--border);
}
.stat-box b { display: block; font-size: 1.1rem; color: var(--accent); }
.stat-box span { font-size: 10px; color: var(--text-muted); }

.panel {
  padding: 20px;
  border-radius: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}
.panel h3 { margin: 0; font-size: 1rem; }
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head-inv {
  align-items: center;
  flex-wrap: wrap;
}
.panel-head-text {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.btn-sell-all {
  margin-left: auto;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 8%, transparent));
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 18px var(--accent-dim);
  transition:
    transform var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-soft),
    border-color var(--dur) var(--ease-soft),
    background var(--dur) var(--ease-soft);
}
.btn-sell-all:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px var(--accent-glow);
  border-color: var(--accent);
}
.btn-sell-all:active {
  transform: scale(0.97);
}
.panel-meta { font-size: 12px; color: var(--text-muted); }
.btn-withdraw-bot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-sizing: border-box;
}

.panel-skin-history {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 42%),
    var(--bg-card);
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}
/* История: простые блоки + margin (без gap/grid — на Android не сжимается) */
.hist-list {
  display: block !important;
  max-height: min(75vh, 780px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 2px 8px 0;
  max-width: 100%;
}
.hist-empty {
  margin: 0;
  padding: 18px 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}
.hist-list .hist-row {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 0 14px !important;
  padding: 14px 14px 14px 88px !important;
  min-height: 92px !important;
  height: auto !important;
  line-height: 1.45 !important;
  border-radius: 14px !important;
  border: 1px solid var(--border) !important;
  background: color-mix(in srgb, var(--bg-panel) 92%, transparent) !important;
  overflow: visible !important;
  transform: none !important;
  animation: none !important;
  opacity: 1 !important;
}
.hist-list .hist-thumb {
  position: absolute !important;
  left: 12px !important;
  top: 14px !important;
  width: 64px !important;
  height: 48px !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 !important;
  border-radius: 8px !important;
  background: color-mix(in srgb, var(--bg-deep) 55%, transparent) !important;
  content-visibility: visible !important;
  contain: none !important;
}
.hist-list .hist-body {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
  float: none !important;
}
.hist-list .hist-action,
.hist-list .hist-name,
.hist-list .hist-meta,
.hist-list .hist-money,
.hist-list .hist-time {
  display: block !important;
  position: static !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 0 6px !important;
  padding: 0 !important;
  float: none !important;
  clear: both !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  transform: none !important;
}
.hist-list .hist-action {
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: var(--accent) !important;
  line-height: 1.35 !important;
}
.hist-list .hist-name {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  line-height: 1.4 !important;
}
.hist-list .hist-meta {
  font-size: 13px !important;
  color: var(--text-muted) !important;
  line-height: 1.4 !important;
}
.hist-list .hist-money {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: var(--accent) !important;
  line-height: 1.35 !important;
  margin-top: 4px !important;
}
.hist-list .hist-time {
  font-size: 12px !important;
  color: var(--text-muted) !important;
  line-height: 1.35 !important;
  margin-bottom: 0 !important;
}
.hist-list .hist-upgrade_lose .hist-action,
.hist-list .hist-battle_lose .hist-action { color: #e05a5a !important; }
.hist-list .hist-upgrade_win .hist-action,
.hist-list .hist-battle_win .hist-action,
.hist-list .hist-drop .hist-action { color: #3ecf8e !important; }
.hist-list .hist-sell .hist-action { color: #f0b429 !important; }
.hist-list .hist-buy .hist-action { color: #6cb6ff !important; }
.hist-price,
.hist-gain { color: var(--accent); }

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.inv-item {
  position: relative;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-align: center;
  cursor: pointer;
  transition:
    transform var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-soft),
    box-shadow var(--dur) var(--ease-soft);
}
.inv-item:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}
.inv-item img {
  width: 100%;
  height: 72px;
  object-fit: contain;
  transition: transform var(--dur) var(--ease-spring);
}
.inv-item:hover img { transform: scale(1.05); }
.inv-item .sell {
  margin-top: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur) var(--ease-soft), color var(--dur) var(--ease-soft);
}
.inv-item .sell:hover { background: var(--accent-dim); color: var(--accent); }

.placeholder-page {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.placeholder-page h2 { color: var(--text); font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; }

.case-badge.hot { background: linear-gradient(90deg, #ff3b1f, #ff8c18); }

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--accent-dim);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 100;
  animation: toast-in 0.4s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.parody-banner {
  font-size: 10px;
  text-align: center;
  color: var(--text-muted);
  padding: 8px;
  border-top: 1px solid var(--border);
  grid-column: 1 / -1;
}
.hero-tagline {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1.35rem, 4.5vw, 2rem);
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: var(--text);
  text-shadow: 0 0 28px var(--accent-glow);
  opacity: 1;
}
.site-tagline {
  margin: 28px 0 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  animation: fade-in 0.28s ease;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  max-width: 420px;
  width: min(420px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: 28px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-align: center;
  animation: modal-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.modal img.win-skin {
  width: 200px;
  height: 150px;
  object-fit: contain;
  margin: 16px auto;
  filter: drop-shadow(0 0 20px var(--accent-glow));
  animation: winner-pulse 1s ease-in-out infinite;
}
.modal.modal-wins { max-width: min(920px, 94vw); width: min(920px, 100%); }
.modal h2 {
  margin: 0 0 8px;
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.win-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 8px;
  max-height: min(52vh, 480px);
  overflow: auto;
  padding: 4px 2px 8px;
}
.win-card {
  position: relative;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-panel));
  min-width: 0;
  overflow: hidden;
  animation: win-card-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.win-card:nth-child(1) { animation-delay: 0.04s; }
.win-card:nth-child(2) { animation-delay: 0.08s; }
.win-card:nth-child(3) { animation-delay: 0.12s; }
.win-card:nth-child(4) { animation-delay: 0.16s; }
.win-card:nth-child(5) { animation-delay: 0.2s; }
.win-card:nth-child(n + 6) { animation-delay: 0.24s; }
@keyframes win-card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.win-card p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.win-card .win-skin {
  width: 120px;
  height: 90px;
  margin: 8px auto;
}
.win-sell {
  display: block;
  width: 100%;
  margin-top: 10px;
  min-height: 40px;
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  color: #111;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff));
}
.win-sell:hover {
  filter: brightness(1.05);
}
.win-sell:disabled,
.win-card.is-sold .win-sell {
  opacity: 0.72;
  cursor: default;
  background: color-mix(in srgb, var(--bg-panel) 70%, var(--accent));
  color: var(--text);
}
.win-card.is-sold {
  opacity: 0.78;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.win-idx {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}
.win-total { margin: 14px 0 0; font-size: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.win-actions {
  flex-wrap: wrap;
}
.win-actions .btn-ghost,
.win-actions .btn-open {
  min-height: 44px;
}
.profile-bot-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.profile-bot-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 42px;
  border-radius: 10px;
  min-width: 0;
  max-width: 100%;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}
.btn-withdraw-bot {
  width: 100%;
}
.luck-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: #86efac;
}

/* Mini-games hub */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 18px;
  border-radius: 18px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 48%),
    var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition:
    transform var(--dur-slow) var(--ease-spring),
    border-color var(--dur) var(--ease-soft),
    box-shadow var(--dur) var(--ease-soft);
}
.game-tile:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 16px 36px rgba(0,0,0,0.24), 0 0 28px var(--accent-dim);
}
.game-tile .game-ico {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: transparent;
  overflow: visible;
  box-shadow: 0 8px 22px rgba(0,0,0,0.28);
  transition: transform var(--dur-slow) var(--ease-spring);
}
.game-tile:hover .game-ico { transform: translateY(-2px) scale(1.04); }
.game-tile .game-ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 18px;
}
.game-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.15;
  color: #1a1208;
  background: linear-gradient(90deg, #ffb429, #ff7a3d);
  box-shadow: 0 4px 12px rgba(255, 122, 61, 0.4);
  pointer-events: none;
  white-space: nowrap;
}
.game-tile strong { font-size: 1.05rem; }
.game-tile span { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.game-panel {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.game-panel h2 { margin: 0 0 8px; font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; }
.game-panel .hint { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.upgrade-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.15);
  overflow: hidden;
  margin: 16px 0;
}
.upgrade-bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff));
  transition: width 0.8s ease;
}
.battle-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  margin: 20px 0;
}
.battle-side {
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.06);
}
.battle-side img { width: 100px; height: 70px; object-fit: contain; }
.vs-badge {
  font-weight: 800;
  color: var(--accent);
  font-size: 1.2rem;
}

/* Crash */
.crash-panel .hint { margin: 4px 0 0; }
.crash-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.crash-hero-head h2 { margin: 0; }
.crash-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.28);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.crash-live-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #666;
}
.crash-live-pill.is-on {
  color: #ffb078;
  border-color: rgba(255,138,61,0.35);
  background: rgba(255,138,61,0.1);
}
.crash-live-pill.is-on span {
  background: #ff8a3d;
  box-shadow: 0 0 10px #ff8a3d;
  animation: crash-live-dot 1s ease infinite;
}
@keyframes crash-live-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.75); }
}
.crash-history { margin-bottom: 14px; }
.crash-hist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.crash-hist-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.crash-hist-track {
  position: relative;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background:
    linear-gradient(105deg, rgba(255,138,61,0.1), rgba(93,206,138,0.05) 45%, rgba(232,93,76,0.08)),
    rgba(0, 0, 0, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 10px 28px rgba(0,0,0,0.18);
  overflow: hidden;
}
.crash-hist-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,180,100,0.5), transparent);
}
.crash-hist-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.crash-hist-list::-webkit-scrollbar { display: none; }
.crash-chip {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
  letter-spacing: 0.02em;
  animation: crash-chip-in 0.35s ease;
}
@keyframes crash-chip-in {
  from { opacity: 0; transform: translateY(6px) scale(0.92); }
  to { opacity: 1; transform: none; }
}
.crash-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.crash-chip.is-empty { color: var(--text-muted); font-weight: 600; }
.crash-chip.is-low {
  color: #ff7b6e;
  border-color: rgba(232, 93, 76, 0.35);
  background: rgba(232, 93, 76, 0.12);
}
.crash-chip.is-mid {
  color: #ffc36b;
  border-color: rgba(255, 179, 71, 0.35);
  background: rgba(255, 179, 71, 0.12);
}
.crash-chip.is-high {
  color: #6ee0a3;
  border-color: rgba(93, 206, 138, 0.4);
  background: rgba(93, 206, 138, 0.12);
}
.crash-stage {
  position: relative;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,138,61,0.16), transparent 45%),
    radial-gradient(ellipse at 20% 80%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    linear-gradient(180deg, rgba(20,16,14,0.92), rgba(8,7,6,0.98));
  overflow: hidden;
  min-height: 300px;
  margin-bottom: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
}
.crash-stage.is-flying {
  border-color: rgba(255,138,61,0.28);
}
.crash-stage.is-win {
  border-color: rgba(93,206,138,0.35);
}
.crash-stage.is-crash {
  background:
    radial-gradient(ellipse at 50% 50%, rgba(232, 93, 76, 0.28), transparent 60%),
    linear-gradient(180deg, rgba(28,12,12,0.95), rgba(8,6,6,0.98));
  animation: crash-shake 0.45s ease;
}
@keyframes crash-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
.crash-stage-fx {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 30%, rgba(255,180,100,0.08), transparent 30%),
    radial-gradient(circle at 30% 70%, rgba(255,100,60,0.06), transparent 35%);
  pointer-events: none;
  z-index: 0;
}
.crash-stage-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 35%, transparent 78%);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
.crash-stage.is-flying .crash-stage-grid {
  animation: crash-grid-drift 8s linear infinite;
}
@keyframes crash-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 -48px, 48px 0; }
}
.crash-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  transition: opacity 0.15s ease;
}
.crash-flash.is-on { opacity: 1; animation: crash-flash-fade 0.52s ease forwards; }
.crash-flash.is-win { background: radial-gradient(circle, rgba(93,206,138,0.35), transparent 55%); }
.crash-flash.is-lose { background: radial-gradient(circle, rgba(232,93,76,0.4), transparent 55%); }
@keyframes crash-flash-fade {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}
.crash-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
  opacity: 0.78;
  position: relative;
  z-index: 1;
}
.crash-skin {
  --crash-skin-scale: 1;
  --crash-morph: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--crash-skin-scale));
  width: min(250px, 58vw);
  text-align: center;
  pointer-events: none;
  z-index: 3;
  opacity: 1;
  visibility: visible;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.crash-skin.is-ready .crash-skin-img.is-show {
  opacity: 1;
}
.crash-skin-ring {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  border: 1px solid rgba(255,138,61,0.18);
  box-shadow: 0 0 0 8px rgba(255,138,61,0.04);
  z-index: 0;
  opacity: 0.7;
}
.crash-stage.is-flying .crash-skin-ring {
  animation: crash-ring-pulse 1.8s ease-in-out infinite;
}
@keyframes crash-ring-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.35; }
  50% { transform: scale(1.08); opacity: 0.8; }
}
.crash-skin.is-morphing .crash-skin-glow {
  animation: crash-morph-flash 0.5s ease;
}
.crash-skin.is-crash {
  filter: grayscale(0.35) brightness(0.75);
  opacity: 0.55;
}
.crash-skin-glow {
  position: absolute;
  inset: 8% 6% 28%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent), transparent 72%);
  z-index: 0;
  opacity: calc(0.45 + var(--crash-morph) * 0.55);
  transform: scale(calc(0.92 + var(--crash-morph) * 0.18));
  transition: opacity 0.25s ease, transform 0.25s ease;
}
@keyframes crash-morph-flash {
  0% { filter: brightness(1); opacity: 0.5; }
  40% { filter: brightness(1.8); opacity: 1; }
  100% { filter: brightness(1); opacity: 0.7; }
}
.crash-skin-stack {
  position: relative;
  z-index: 1;
  height: 148px;
  margin: 0 auto;
}
.crash-skin-img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  max-height: 148px;
  object-fit: contain;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.55));
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) scale(0.78) rotate(-6deg);
  transition:
    opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.4s ease;
  pointer-events: none;
}
.crash-skin-img.is-show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
  z-index: 2;
}
.crash-skin-img.is-leave {
  opacity: 0;
  visibility: visible;
  transform: translate(-62%, -58%) scale(0.72) rotate(8deg);
  filter: blur(3px) brightness(1.2);
  z-index: 1;
}
.crash-skin-img.is-hide {
  opacity: 0;
  visibility: hidden;
  transform: translate(-38%, -42%) scale(0.7) rotate(-10deg);
  z-index: 0;
}
.crash-skin-meta {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  display: grid;
  gap: 2px;
  transition: opacity 0.25s ease, transform 0.35s ease;
}
.crash-skin.is-morphing .crash-skin-meta {
  opacity: 0.35;
  transform: translateY(4px);
}
.crash-skin-meta b {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.crash-skin-meta span {
  font-size: 11px;
  color: var(--accent);
  font-weight: 800;
}
.crash-mult {
  --crash-heat: 0;
  position: absolute;
  left: 50%;
  top: 11%;
  transform: translate(-50%, -50%);
  font-size: clamp(2rem, 7vw, 3.1rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, #fff calc(100% - var(--crash-heat) * 35%), #ffb347);
  text-shadow:
    0 0 calc(8px + var(--crash-heat) * 22px) rgba(255, 138, 61, calc(0.15 + var(--crash-heat) * 0.45)),
    0 8px 30px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 5;
  min-width: 4.5ch;
  text-align: center;
}
.crash-mult.is-crash { color: #e85d4c; text-shadow: 0 0 22px rgba(232,93,76,0.45), 0 8px 30px rgba(0,0,0,0.55); }
.crash-mult.is-win { color: #5dce8a; text-shadow: 0 0 22px rgba(93,206,138,0.45), 0 8px 30px rgba(0,0,0,0.55); }
.crash-mult.is-crash.is-win {
  color: #5dce8a;
  text-shadow: 0 0 18px rgba(93, 206, 138, 0.35), 0 8px 30px rgba(0, 0, 0, 0.55);
}
.crash-status {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  z-index: 5;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.crash-controls-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent),
    rgba(0,0,0,0.22);
  box-shadow: 0 12px 28px rgba(0,0,0,0.16);
}
.crash-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.crash-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.crash-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.28);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}
.crash-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.crash-quick button {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.crash-quick button:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: rgba(255,138,61,0.1);
  transform: translateY(-1px);
}
.crash-main-btn {
  min-height: 48px;
  font-size: 15px;
  letter-spacing: 0.02em;
}
#crash-action.is-cashout {
  background: linear-gradient(135deg, #2f9e6b, #5dce8a);
  color: #0b1a12;
  box-shadow: 0 10px 24px rgba(93,206,138,0.25);
}
.crash-msg {
  min-height: 1.2em;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
@media (max-width: 700px) {
  .crash-canvas { max-height: 200px; }
  .crash-stage { min-height: 280px; border-radius: 16px; }
  .crash-mult { font-size: 1.85rem; top: 10%; }
  .crash-skin { width: min(210px, 66vw); top: 52%; }
  .crash-skin-stack { height: 124px; }
  .crash-skin-img { max-height: 124px; }
  .crash-skin-ring { width: 120px; height: 120px; margin: -60px 0 0 -60px; }
  .crash-controls-grid { grid-template-columns: 1fr; }
}

/* Rewards / level cards (CS2-style) */
.rewards-hero {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}
.level-card {
  padding: 20px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.level-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.level-head b { font-size: 1.4rem; color: var(--accent); }
.xp-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.12);
  overflow: hidden;
}
.xp-track > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.reward-lock {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 13px;
}
.reward-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 20px 0;
}
@media (max-width: 700px) {
  .reward-cards { grid-template-columns: repeat(2, 1fr); }
}
.r-card {
  aspect-ratio: 3/4;
  perspective: 800px;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
}
.r-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-radius: 14px;
}
.r-card.flipped .r-card-inner { transform: rotateY(180deg); }
.r-card.locked {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.r-card.locked .r-card-inner { transform: none !important; }
.r-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  padding: 12px;
}
.r-face.back {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 35%, #111), #1a1a1a 60%),
    repeating-linear-gradient(45deg, transparent, transparent 6px, rgba(255,255,255,0.04) 6px, rgba(255,255,255,0.04) 12px);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
}
[data-theme="blue"] .r-face.back,
[data-theme="red"] .r-face.back {
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 45%, #fff), color-mix(in srgb, var(--accent) 20%, #e2e8f0));
  color: var(--accent);
}
.r-face.front {
  background: var(--bg-card);
  transform: rotateY(180deg);
  gap: 8px;
}
.r-face.front .amt {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
}
.r-face.front .lbl { font-size: 11px; color: var(--text-muted); }

.deposit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.deposit-row input {
  width: 140px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font: inherit;
}

[data-theme="blue"] .btn-open,
[data-theme="red"] .btn-open,
[data-theme="mono"] .btn-open {
  color: #fff;
}
[data-theme="mono"] .btn-open { color: #0a0a0a; }
[data-theme="blue"] .btn-steam,
[data-theme="red"] .btn-steam {
  color: #fff;
}

/* Upgrade arena (caser-style) */
.up-page { max-width: 1200px; margin: 0 auto; }
.up-center-top {
  max-width: 420px;
  margin: 0 auto 18px;
  text-align: center;
}
.up-arena {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px) 1fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .up-arena { grid-template-columns: 1fr; }
}
.up-bottom-3 {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 14px;
  align-items: start;
}
.up-panel-bet,
.up-panel-shop,
.up-panel-target {
  min-height: 280px;
}
.up-bet-banner {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.up-chip-target {
  width: 100%;
  flex-direction: column;
  text-align: center;
  padding: 14px !important;
}
.up-chip-target img {
  width: 110px !important;
  height: 82px !important;
}
.up-grid-scroll {
  max-height: min(62vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}
.up-mobile-tabs {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 12px;
}
.up-mtab {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.up-mtab.active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
@media (max-width: 900px) {
  .up-bottom-3 {
    grid-template-columns: 1fr;
  }
  .up-mobile-tabs {
    display: grid;
  }
  .up-bottom-3 > .up-panel {
    display: none;
  }
  .up-bottom-3 > .up-panel.is-active {
    display: block;
  }
  .up-grid-scroll {
    max-height: min(58vh, 480px);
  }
}

/* Upgrade win celebration */
.up-win-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.up-win-overlay.is-on {
  opacity: 1;
  pointer-events: auto;
}
.up-win-burst {
  position: absolute;
  width: 12px;
  height: 12px;
}
.up-win-spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, #fff);
  transform: rotate(var(--a)) translateY(0) scale(0.4);
  opacity: 0;
}
.up-win-overlay.is-on .up-win-spark {
  animation: up-spark-fly var(--d) ease-out forwards;
}
@keyframes up-spark-fly {
  0% { opacity: 0; transform: rotate(var(--a)) translateY(0) scale(0.3); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-140px) scale(1.1); }
}
.up-win-card {
  position: relative;
  z-index: 1;
  width: min(320px, calc(100vw - 32px));
  padding: 22px 18px 20px;
  border-radius: 22px;
  text-align: center;
  background: color-mix(in srgb, var(--bg-panel) 92%, #000);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent),
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 48px color-mix(in srgb, var(--accent) 28%, transparent);
  transform: scale(0.86) translateY(12px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.2, 1.15), opacity 0.3s ease;
}
.up-win-overlay.is-on .up-win-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.up-win-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #111;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff));
}
.up-win-card img {
  width: 150px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
  animation: up-win-bob 1.2s ease-in-out infinite;
}
@keyframes up-win-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.up-win-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
}
.up-win-card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}
.up-win-card b {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 1.15rem;
}
@media (prefers-reduced-motion: reduce) {
  .up-win-card img,
  .up-win-overlay.is-on .up-win-spark {
    animation: none !important;
  }
}
.up-slot {
  min-height: 220px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
[data-theme="blue"] .up-slot,
[data-theme="red"] .up-slot {
  background: rgba(15, 23, 42, 0.06);
}
.up-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.up-slot-head button {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.up-slot-body {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: flex-start;
  align-items: flex-start;
}
.up-empty {
  width: 100%;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  margin: auto;
  padding: 24px 8px;
}
.up-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 11px;
}
.up-chip img { width: 48px; height: 36px; object-fit: contain; }
.up-chip .rm {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}
.up-balance-box {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.up-balance-box input {
  width: 110px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font: inherit;
}
.up-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px;
}
.up-wheel {
  position: relative;
  width: 220px;
  height: 220px;
}
.up-wheel svg.up-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 12px var(--accent-dim));
}
.up-wheel .hub {
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: inset 0 0 30px var(--accent-dim);
  z-index: 2;
  pointer-events: none;
}
.up-wheel .hub b {
  font-size: 1.6rem;
  color: var(--accent);
  line-height: 1;
}
.up-wheel .hub span { font-size: 10px; color: var(--text-muted); }
.up-pointer-arm {
  position: absolute;
  inset: 0;
  z-index: 3;
  transform: rotate(0deg);
  will-change: transform;
  pointer-events: none;
}
.up-pointer-arm.spinning {
  transition: transform 5s cubic-bezier(0.15, 0.05, 0.12, 1);
}
.up-pointer-arm.spinning.is-fast {
  transition-duration: 0.75s;
  transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}
.up-go-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
}
.up-go-fast {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 55%, #111), color-mix(in srgb, var(--accent) 25%, #111)) !important;
  box-shadow: 0 0 16px var(--accent-dim);
}
.up-pointer {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 18px;
  height: 22px;
  margin-left: -9px;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}
.up-pointer::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 16px solid var(--accent);
}
.up-pointer::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.up-wheel.win-flash .hub {
  box-shadow: 0 0 40px var(--accent-glow), inset 0 0 30px var(--accent-dim);
  animation: up-win-pulse 0.6s ease-in-out 3;
}
.up-wheel.lose-flash .hub b { color: var(--text-muted); }
@keyframes up-win-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .up-pointer-arm.spinning { transition-duration: 0.01ms !important; }
}
.up-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.up-controls button {
  min-width: 52px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.up-controls button.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 16px var(--accent-dim);
}
.up-go {
  width: min(240px, 100%);
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000));
  color: #0a0c10;
  box-shadow: 0 8px 28px var(--accent-dim);
}
.up-go:disabled { opacity: 0.45; cursor: not-allowed; }
.up-stake {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.up-stake b { color: var(--accent); }

.up-recs {
  margin: 16px 0 4px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.up-recs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 12px;
}
.up-recs-head h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.up-recs-head p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.up-recs-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}
.up-rec {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.14);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  font: inherit;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.up-rec:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}
.up-rec.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}
.up-rec img {
  width: 100%;
  height: 52px;
  object-fit: contain;
}
.up-rec-mult {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.up-rec-name {
  font-size: 11px;
  font-weight: 700;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-rec-meta {
  font-size: 10px;
  color: var(--text-muted);
}
.up-filter-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.up-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.up-bottom.up-bottom-3 {
  grid-template-columns: 1fr 1.15fr 1fr;
}
.up-panel-shop {
  min-height: 0;
}
.up-bottom:not(.up-bottom-3) .up-panel-shop {
  grid-column: 1 / -1;
}
@media (max-width: 900px) {
  .up-bottom,
  .up-bottom.up-bottom-3 {
    grid-template-columns: 1fr;
  }
}
.up-panel {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 14px;
  min-height: 280px;
}
.up-panel-target {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}
.up-panel h3 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.up-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.up-filters input {
  width: 90px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}
.up-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}
.up-item {
  position: relative;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.12);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}
.up-item:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.up-item.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-dim); }
.up-item img { width: 100%; height: 56px; object-fit: contain; }
.up-item .price {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
}
.up-item .name {
  font-size: 10px;
  margin-top: 4px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-item .wear {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-item .bar { height: 3px; border-radius: 2px; margin-top: 6px; }
.up-market-item {
  padding-bottom: 40px;
}
.up-buy-btn {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  border: none;
  border-radius: 8px;
  padding: 7px 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  color: #0a0c10;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #000));
  box-shadow: 0 4px 14px var(--accent-dim);
}
.up-buy-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}
.up-buy-btn.is-disabled,
.up-buy-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-panel) 80%, #000);
  box-shadow: none;
}
.up-market-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Auth modal */
.auth-modal { text-align: left; max-width: 400px; }
.auth-modal h2 { text-align: center; margin-top: 0; font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; }
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.auth-tabs button {
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.auth-tabs button.active {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: var(--accent-dim);
}
.auth-form, .auth-tg { display: flex; flex-direction: column; gap: 10px; }
.auth-form label, .auth-tg label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.auth-form input, .auth-tg input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font: inherit;
}
.auth-err { color: #ef4444; font-size: 12px; min-height: 1em; margin: 0; }
.auth-code {
  text-align: center;
  font-size: 14px;
}
.auth-code code {
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.12em;
}
.tg-open-link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  text-decoration: none;
  box-sizing: border-box;
}
.auth-modal {
  width: min(400px, calc(100vw - 24px));
}
.auth-tg p {
  font-size: 14px;
  line-height: 1.45;
}
.auth-bot-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-card));
}
.auth-bot-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  flex: 0 0 auto;
}
.auth-bot-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.auth-bot-meta b {
  font-size: 15px;
  color: var(--text);
}
.auth-bot-meta span {
  font-size: 12px;
  color: var(--text-muted);
}
.auth-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.auth-steps li { margin-bottom: 4px; }
.auth-status {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
}
.auth-wait-bot {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.auth-wait-ico {
  font-size: 18px;
  line-height: 1.2;
}
.auth-wait-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 auto;
}
.auth-wait-actions .btn-open,
.auth-wait-actions .btn-ghost {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 11px;
}
.skin-price {
  display: block;
  margin-top: 4px;
  color: var(--accent);
  font-weight: 700;
  font-size: 11px;
}

/* Profile avatar */
.avatar-wrap {
  position: relative;
  width: 96px;
  margin: 0 auto 12px;
}
.avatar-wrap .avatar-lg { display: block; margin: 0; }
.avatar-upload {
  position: absolute;
  right: -4px;
  bottom: -4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #0a0c10;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--accent-dim);
}
.profile-id {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 8px;
}
.profile-id code {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.btn-copy {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
}
.btn-copy:hover { color: var(--accent); border-color: var(--accent-dim); }

/* Language plashka (profile) */
.lang-plashka {
  margin: 0 0 20px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    var(--bg-card);
}
.lang-plashka-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 12px;
}
.lang-plashka-head strong {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.lang-plashka-head span {
  font-size: 13px;
  color: var(--text-muted);
}
.lang-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lang-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-panel));
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  min-width: 120px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.lang-chip:hover {
  border-color: var(--accent-dim);
}
.lang-chip.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-panel));
  color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Promo plashka */
.promo-plashka {
  margin: 0 0 28px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    var(--bg-card);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.12);
  max-width: 100%;
  overflow: hidden;
}
.promo-plashka-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 12px;
  min-width: 0;
}
.promo-plashka-head strong {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.45rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.promo-plashka-head span {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
  overflow-wrap: anywhere;
}
.promo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.promo-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-panel));
  font-size: 12px;
  color: var(--text-muted);
}
.promo-chip b {
  color: var(--accent);
  margin-right: 4px;
  letter-spacing: 0.04em;
}
.promo-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}
.promo-form input {
  flex: 1 1 160px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.promo-form .btn-open {
  flex: 0 0 auto;
  min-width: 140px;
}
.promo-hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.promo-wait {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-panel));
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-sizing: border-box;
}
.flow-steps {
  margin: 14px 0 0;
  padding: 0 0 0 18px;
  text-align: left;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}
.flow-steps li { margin-bottom: 6px; }
.flow-steps b { color: var(--text); }

/* Mobile + touch-телефоны даже в режиме «версия для ПК» */
@media (max-width: 900px), ((hover: none) and (pointer: coarse)) {
  .app-shell {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  .top-live {
    padding: 6px 10px;
    gap: 10px;
  }
  .online-label { display: none; }
  .live-item .meta strong { max-width: 72px; }
  .site-header {
    padding: 8px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 60;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    /* не overflow-x:hidden — иначе появляется скролл-полоска под «Интерфейс» */
    overflow: visible !important;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
  .app-shell {
    max-width: 100%;
    overflow-x: hidden;
  }
  .logo {
    flex: 0 0 auto;
    min-width: 0;
    max-width: 38%;
  }
  .logo-mark {
    height: 32px;
    max-width: 100%;
    width: auto;
    border-radius: 8px;
  }
  .nav-main {
    display: none !important;
  }
  .header-actions {
    margin-left: auto;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    justify-content: flex-end;
    overflow: visible;
  }
  .theme-bar {
    display: block;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .theme-picker-mobile {
    display: none !important;
  }
  #auth-slot {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 42px);
    display: flex;
    justify-content: flex-end;
  }
  .profile-chip {
    padding: 3px 6px 3px 3px;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
  }
  .profile-chip img { width: 26px; height: 26px; flex-shrink: 0; }
  .profile-chip .bal { font-size: 11px; }
  .profile-chip > span {
    min-width: 0;
    overflow: hidden;
  }
  .profile-chip span span:last-child {
    display: none;
  }
  .btn-steam {
    padding: 8px 10px;
    font-size: 11px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .main-content {
    /* место под fixed mobile-tabbar, иначе нижний ряд кейсов перекрыт */
    padding: 12px 10px calc(100px + env(safe-area-inset-bottom, 0px));
  }
  .section-title {
    font-size: 1.25rem;
    margin: 14px 0 10px;
  }
  .subnav-cases {
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .subnav-cases::-webkit-scrollbar { display: none; }
  .subnav-cases .tab {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 11px;
  }
  .case-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .case-card {
    padding: 12px 8px 10px;
    border-radius: 12px;
    min-height: 196px;
  }
  .case-visual {
    flex: 0 0 118px;
    width: 100%;
    height: 118px;
  }
  .case-crate {
    width: 84px;
    height: 72px;
  }
  .case-crate-badge { font-size: 11px; min-width: 34px; padding: 5px 8px; }
  .case-crate-preview { width: 34px; height: 26px; bottom: 4px; }
  .top-live {
    max-width: 100%;
    overflow: hidden;
  }
  .live-feed-h {
    min-width: 0;
    flex: 1;
  }
  .case-name { font-size: 11px; }
  .case-price { font-size: 12px; }
  .contents-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .main-content {
    max-width: 100%;
    overflow-x: hidden;
  }
  .main-content.case-open-page {
    padding-bottom: calc(188px + env(safe-area-inset-bottom, 0px));
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
  }
  .main-content.case-open-page.is-multi-lanes {
    padding-bottom: calc(210px + env(safe-area-inset-bottom, 0px));
  }
  .main-content.case-open-page.is-spinning-open {
    overscroll-behavior-x: none;
  }
  .case-open-page .back-link {
    margin-bottom: 6px;
  }
  .case-open-page .case-hero {
    padding: 4px 0 4px;
  }
  .case-open-page .case-hero .case-visual {
    width: 88px !important;
    height: 78px !important;
    margin: 0 auto 6px !important;
    border-radius: 14px !important;
  }
  .case-open-page .case-hero .case-crate {
    width: 68px;
    height: 58px;
  }
  .case-open-page .case-hero .case-crate-preview { display: none; }
  .case-open-page .case-hero h1 {
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
    line-height: 1.15;
    animation: none;
    text-shadow: none;
  }
  .case-open-page .case-hero-price {
    font-size: 12px;
  }
  .case-open-page .roulette-stack {
    --roulette-item-w: 76px;
    margin: 6px auto 12px;
    gap: 12px;
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
    touch-action: pan-y;
  }
  .case-open-page .roulette-stack.is-multi,
  .case-open-page .roulette-stack.is-dense {
    gap: 14px;
    overflow-x: hidden;
    overflow-y: visible;
    max-height: none;
    max-width: 100%;
  }
  .case-open-page .roulette-wrap {
    border-radius: 12px;
    padding: 28px 0 12px;
    margin: 0;
    max-width: 100%;
    width: 100%;
    min-height: 96px;
    overflow: hidden;
    flex: 0 0 auto;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  .case-open-page .roulette-wrap::before,
  .case-open-page .roulette-wrap::after {
    width: 28px;
  }
  .case-open-page .roulette-viewport {
    padding: 2px 0;
    max-width: 100%;
    overflow: hidden;
  }
  .case-open-page .roulette-item {
    flex: 0 0 var(--roulette-item-w);
    width: var(--roulette-item-w);
    height: 74px;
    padding: 4px 2px;
    border-radius: 8px;
  }
  .case-open-page .roulette-item img {
    width: 54px;
    height: 40px;
  }
  .case-open-page .roulette-item span {
    font-size: 7px;
  }
  .case-open-page .roulette-stack.is-multi .roulette-wrap {
    padding: 26px 0 10px;
  }
  .case-open-page .roulette-stack.is-dense {
    --roulette-item-w: 72px;
    gap: 16px;
    max-height: none;
    overflow-x: hidden;
    max-width: 100%;
  }
  .case-open-page .roulette-stack.is-dense .roulette-wrap {
    padding: 28px 0 12px;
  }
  .case-open-page .roulette-stack.is-dense .roulette-item {
    height: 70px;
  }
  .case-open-page .roulette-stack.is-dense .roulette-item img {
    width: 50px;
    height: 36px;
  }
  .case-open-page .roulette-stack .lane-label {
    top: 6px;
    left: 8px;
    font-size: 10px;
    padding: 3px 8px;
  }
  .case-open-page .roulette-stack.is-dense .roulette-pointer {
    top: 24px;
    bottom: 4px;
  }
  .case-open-page .section-title {
    margin-top: 8px;
    font-size: 1.05rem;
  }
  .case-open-page .contents-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .case-open-page .skin-card .img-wrap img {
    max-height: 64px;
    width: auto;
    margin: 0 auto;
    display: block;
  }
  .open-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    z-index: 70;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    background: color-mix(in srgb, var(--bg-panel) 96%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.28);
  }
  .case-open-page .roulette-track {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  .open-controls .btn-open,
  .open-controls .btn-fast,
  .open-controls .btn-ghost {
    flex: 1;
    min-height: 44px;
  }
  .open-actions {
    width: 100%;
  }
  .multiplier {
    display: flex;
    justify-content: stretch;
    width: 100%;
  }
  .multiplier button {
    flex: 1;
    min-height: 40px;
    padding: 0 4px;
    font-size: 12px;
  }
  .roulette-wrap {
    border-radius: 12px;
  }
  .roulette-item {
    flex: 0 0 var(--roulette-item-w, 100px);
    width: var(--roulette-item-w, 100px);
  }
  .roulette-item img {
    width: 68px;
    height: 50px;
  }
  @media (max-width: 420px) {
    .case-open-page .roulette-stack {
      --roulette-item-w: 68px;
    }
    .case-open-page .roulette-item {
      height: 68px;
    }
    .case-open-page .roulette-item img {
      width: 48px;
      height: 34px;
    }
    .case-open-page .case-hero h1 {
      font-size: 1.05rem;
    }
  }
  .promo-form input,
  .auth-form input,
  .up-filters input,
  .up-balance-box input {
    font-size: 16px;
  }
  .games-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .game-tile {
    padding: 14px 12px;
  }
  .game-tile .game-ico {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }
  .inv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rewards-hero {
    grid-template-columns: 1fr;
  }
  .reward-cards {
    gap: 8px;
  }
  .modal {
    width: calc(100% - 20px);
    max-width: 420px;
    margin: 10px;
    max-height: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .promo-plashka {
    padding: 14px;
    margin-bottom: 18px;
  }
  .promo-form .btn-open {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }
  .up-page {
    padding-bottom: 8px;
  }
  .up-arena {
    gap: 12px;
  }
  .up-center {
    order: -1;
  }
  .up-wheel {
    width: min(220px, 70vw);
    height: min(220px, 70vw);
    margin: 0 auto;
  }
  .up-controls {
    flex-wrap: wrap;
  }
  .up-controls button,
  .up-go {
    min-height: 42px;
  }
  .up-panel {
    min-height: 0;
  }
  .up-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 280px;
  }
  .up-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .up-filters input,
  .up-filters button {
    width: 100%;
    min-height: 40px;
  }
  .profile-layout {
    gap: 14px;
  }
  .profile-card {
    padding: 18px 14px;
  }
  .profile-bot-actions {
    grid-template-columns: 1fr;
  }
  .mobile-tabbar {
    display: grid;
  }
  .theme-menu {
    grid-template-columns: 1fr 1fr;
    width: min(300px, calc(100% - 16px));
  }
  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }
  .profile-card .avatar-lg {
    width: 88px;
    height: 88px;
    object-fit: cover;
  }
  .avatar-upload {
    z-index: 2;
    -webkit-user-select: none;
    user-select: none;
  }
  /* Safari: transform-анимации дают горизонтальный скролл */
  .main-content.page-enter,
  .case-grid .case-card,
  .contents-grid .skin-card,
  .games-grid .game-tile {
    animation-name: safari-fade;
  }

  /* Mobile feel + performance */
  :root {
    --dur-fast: 140ms;
    --dur: 240ms;
    --dur-slow: 360ms;
  }
  .bg-map {
    transform: none;
    filter: saturate(0.75);
  }
  .bg-map::after {
    background:
      var(--hero-tint),
      radial-gradient(ellipse 90% 60% at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%);
  }
  .site-header,
  .mobile-tabbar,
  .top-live,
  .open-controls {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .case-card,
  .skin-card,
  .game-tile,
  .inv-item {
    will-change: auto;
  }
  .case-card::before,
  .case-art-shine,
  .case-crate-shine {
    animation: none !important;
    opacity: 0 !important;
  }
  .case-card:hover,
  .skin-card:hover,
  .game-tile:hover,
  .inv-item:hover,
  .hist-row:hover {
    transform: translateY(-2px) !important;
  }
  .case-card:hover .case-art-wrap,
  .case-card:hover .case-art-skin,
  .skin-card:hover img,
  .game-tile:hover .game-ico,
  .inv-item:hover img {
    transform: none !important;
  }
  .panel:hover,
  .game-panel:hover {
    transform: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  }
  .case-grid .case-card,
  .contents-grid .skin-card,
  .games-grid .game-tile,
  .inv-grid .inv-item {
    animation-duration: 0.28s;
    animation-delay: 0.02s !important;
  }
  .hero-tagline {
    animation-duration: 0.4s;
  }
  .inv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .inv-item {
    padding: 10px 8px;
    border-radius: 14px;
  }
  .inv-item img {
    height: 64px;
  }
  .inv-item .sell {
    min-height: 38px;
    font-size: 11px;
    border-radius: 10px;
  }
  .panel-head-inv {
    gap: 10px;
  }
  .btn-sell-all {
    width: 100%;
    margin-left: 0;
    min-height: 44px;
    justify-content: center;
    font-size: 13px;
  }
  .panel-inventory .panel-head-inv {
    flex-direction: column;
    align-items: stretch;
  }
  .toast {
    animation-duration: 0.28s;
  }
}

@keyframes safari-fade {
  from { opacity: 0.01; }
  to { opacity: 1; }
}

@media (max-width: 420px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
  .up-filters {
    grid-template-columns: 1fr;
  }
}

.mobile-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg-panel) 88%, transparent);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}
.mobile-tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 0 4px;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-height: 52px;
  border-radius: 14px;
  transition:
    color var(--dur) var(--ease-soft),
    background var(--dur) var(--ease-soft),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur) var(--ease-soft);
}
.mobile-tabbar a:active { transform: scale(0.96); }
.mobile-tabbar a.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.mobile-tabbar a span.ico {
  font-size: 16px;
  line-height: 1;
  transition: transform var(--dur) var(--ease-out);
}
.mobile-tabbar a.active span.ico,
.mobile-tabbar a.active .tab-ico {
  transform: translateY(-1px) scale(1.06);
}
.mobile-tabbar a .tab-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  transition: transform var(--dur) var(--ease-out);
}

@media (max-width: 900px), ((hover: none) and (pointer: coarse)) {
  .mobile-tabbar { display: grid; }
}

/* Прячем таббар только на реальном десктопе с мышью */
@media (min-width: 901px) and (hover: hover) and (pointer: fine) {
  .mobile-tabbar { display: none !important; }
}

@media (max-width: 420px) {
  .case-grid {
    gap: 8px;
  }
  .live-online { font-size: 10px; }
  .promo-plashka { padding: 14px; }
  .auth-modal {
    padding: 16px 14px;
  }
  .auth-code code {
    font-size: 1.25rem;
  }
  .btn-open,
  .btn-ghost,
  .btn-steam {
    min-height: 44px;
  }
  .mobile-tabbar a {
    font-size: 9px;
    min-height: 56px;
  }
}

/* Touch-friendly */
@media (hover: none) and (pointer: coarse) {
  .case-card:hover { transform: none; }
  .case-card:active { transform: scale(0.98); }
  .nav-main a,
  .mobile-tabbar a,
  .btn-open,
  .btn-ghost,
  .up-buy-btn {
    -webkit-tap-highlight-color: transparent;
  }
  .modal-overlay {
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
    align-items: flex-end;
  }
  @media (min-height: 700px) {
    .modal-overlay { align-items: center; }
  }
}

/* —— Polish: containment + motion —— */
.app-shell,
.site-header,
.top-live,
.panel,
.profile-card,
.up-slot,
.up-center,
.up-panel,
.game-panel,
.game-tile,
.hist-row,
.inv-item,
.auth-bot-card {
  min-width: 0;
  max-width: 100%;
}

.case-grid .case-card {
  /* без translateY — иначе ряд «прыгает» и карточки выглядят съехавшими */
  animation: none;
  opacity: 1;
  transform: none;
}
.contents-grid .skin-card,
.games-grid .game-tile,
.inv-grid .inv-item {
  animation: rise-in 0.5s var(--ease-out) forwards;
}
.hist-list .hist-row {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.case-grid .case-card:nth-child(1),
.contents-grid .skin-card:nth-child(1),
.games-grid .game-tile:nth-child(1) { animation-delay: 0.04s; }
.case-grid .case-card:nth-child(2),
.contents-grid .skin-card:nth-child(2),
.games-grid .game-tile:nth-child(2) { animation-delay: 0.08s; }
.case-grid .case-card:nth-child(3),
.contents-grid .skin-card:nth-child(3),
.games-grid .game-tile:nth-child(3) { animation-delay: 0.12s; }
.case-grid .case-card:nth-child(4),
.contents-grid .skin-card:nth-child(4),
.games-grid .game-tile:nth-child(4) { animation-delay: 0.16s; }
.case-grid .case-card:nth-child(5),
.contents-grid .skin-card:nth-child(5),
.games-grid .game-tile:nth-child(5) { animation-delay: 0.2s; }
.case-grid .case-card:nth-child(6),
.contents-grid .skin-card:nth-child(6),
.games-grid .game-tile:nth-child(6) { animation-delay: 0.24s; }
.case-grid .case-card:nth-child(7),
.contents-grid .skin-card:nth-child(7),
.games-grid .game-tile:nth-child(7) { animation-delay: 0.28s; }
.case-grid .case-card:nth-child(8),
.contents-grid .skin-card:nth-child(8),
.games-grid .game-tile:nth-child(8) { animation-delay: 0.32s; }
.case-grid .case-card:nth-child(n + 9),
.contents-grid .skin-card:nth-child(n + 9),
.games-grid .game-tile:nth-child(n + 9),
.inv-grid .inv-item:nth-child(n + 1),
.hist-list .hist-row:nth-child(n + 1) { animation-delay: 0.12s; }

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

.btn-open,
.btn-fast,
.up-go,
.btn-ghost,
.multiplier button,
.up-controls button {
  transition:
    transform var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-soft),
    border-color var(--dur) var(--ease-soft),
    background var(--dur) var(--ease-soft),
    opacity var(--dur) var(--ease-soft),
    filter var(--dur) var(--ease-soft);
}
.btn-open:not(:disabled):active,
.btn-fast:not(:disabled):active,
.up-go:not(:disabled):active {
  transform: scale(0.97);
}
.btn-fast:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px var(--accent-glow);
}
.multiplier button.active,
.up-controls button.active {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 6px 18px var(--accent-dim);
}

.roulette-wrap {
  contain: paint;
}
.roulette-item span,
.case-name,
.case-price,
.game-tile h3,
.game-tile p,
.profile-id,
.profile-card h2,
.up-chip,
.up-stake {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.case-name,
.game-tile h3,
.profile-card h2 {
  white-space: nowrap;
}
.game-tile p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}
.up-arena,
.up-bottom,
.profile-layout,
.profile-main-col {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.profile-card .avatar-lg {
  object-fit: cover;
  -webkit-user-drag: none;
}
.up-wheel .hub b {
  font-variant-numeric: tabular-nums;
  transition: color 0.35s ease, transform 0.35s ease;
}
.up-wheel.win-flash .hub b {
  transform: scale(1.08);
}
.hist-row {
  transition:
    transform var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-soft),
    background var(--dur) var(--ease-soft),
    box-shadow var(--dur) var(--ease-soft);
}
.hist-row:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}
@media (min-width: 901px) {
  .hist-row:hover {
    transform: translateY(-1px);
  }
}
.inv-item {
  overflow: hidden;
}
.inv-item > div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.open-controls,
.multiplier,
.open-actions {
  width: 100%;
  max-width: 100%;
}
.toast {
  max-width: min(92vw, 360px);
  word-break: break-word;
  animation: toast-in 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (max-width: 720px) {
  .main-content.page-enter {
    animation-duration: 0.32s;
  }
  .case-grid .case-card,
  .contents-grid .skin-card,
  .games-grid .game-tile {
    animation-duration: 0.36s;
  }
  .win-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    max-height: 46vh;
  }
  .modal {
    width: 100%;
    padding: 20px 16px;
  }
  .up-go-row {
    width: 100%;
  }
  .up-go,
  .up-go-fast {
    flex: 1;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .main-content.page-enter,
  .case-grid .case-card,
  .contents-grid .skin-card,
  .games-grid .game-tile,
  .inv-grid .inv-item,
  .hist-list .hist-row,
  .win-card,
  .modal,
  .hero-tagline {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* —— Feel polish —— */
.site-header {
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  transition: border-color var(--dur) var(--ease-soft), background var(--dur) var(--ease-soft);
}
.section-title {
  transition: color var(--dur) var(--ease-soft), letter-spacing var(--dur-slow) var(--ease-out);
}
.case-name,
.case-price {
  transition: color var(--dur) var(--ease-soft), transform var(--dur) var(--ease-out);
}
.case-card:hover .case-name {
  color: color-mix(in srgb, var(--accent) 55%, var(--text));
}
.case-art-wrap {
  transition: transform var(--dur-slow) var(--ease-spring);
}
.case-card:hover .case-art-wrap {
  transform: translateY(-4px) scale(1.035);
}
.case-art-skin {
  transition: transform var(--dur-slow) var(--ease-spring), filter var(--dur) var(--ease-soft);
}
.panel,
.game-panel,
.auth-bot-card {
  transition:
    border-color var(--dur) var(--ease-soft),
    box-shadow var(--dur) var(--ease-soft),
    transform var(--dur) var(--ease-out);
}
.panel:hover,
.game-panel:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}
.modal-overlay {
  animation: fade-in 0.36s var(--ease-soft);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
}
.modal {
  animation: modal-pop 0.48s var(--ease-out) both;
}
.search-btn {
  transition:
    transform var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-soft),
    color var(--dur) var(--ease-soft),
    box-shadow var(--dur) var(--ease-soft);
}
.search-btn:hover {
  transform: translateY(-1px);
  color: var(--accent);
  border-color: var(--accent-dim);
  box-shadow: 0 0 18px var(--accent-dim);
}
a:focus-visible,
button:focus-visible,
.case-card:focus-visible,
.game-tile:focus-visible,
.profile-chip:focus-visible,
.mobile-tabbar a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 3px;
}
.top-live {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.live-item {
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur) var(--ease-soft);
}
.live-item:hover {
  transform: translateY(-2px);
}

/* Страховка: карточки не остаются невидимыми после анимации */
.case-grid .case-card,
.contents-grid .skin-card,
.games-grid .game-tile {
  opacity: 1 !important;
}

/* Safari / iOS — жёсткие фиксы вылезания */
@supports (-webkit-touch-callout: none) {
  html,
  body,
  .app-shell {
    max-width: 100%;
    overflow-x: hidden !important;
  }
  .main-content,
  .theme-bar,
  .top-live,
  .roulette-stack,
  .roulette-wrap,
  .open-controls,
  .panel,
  .profile-layout {
    max-width: 100% !important;
    overflow-x: hidden;
  }
  .site-header {
    max-width: 100% !important;
    overflow: visible !important;
  }
  .main-content.page-enter,
  .case-grid .case-card,
  .contents-grid .skin-card,
  .games-grid .game-tile,
  .modal {
    -webkit-transform: translateZ(0);
    transform: none !important;
    animation: none !important;
    opacity: 1 !important;
  }
  .case-card:hover,
  .skin-card:hover,
  .inv-item:hover,
  .hist-row:hover {
    transform: none !important;
  }
  .theme-plashka-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .open-controls {
    left: 0;
    right: 0;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }
  .roulette-item span {
    font-size: 8px;
  }
}

/* —— Mobile perf: меньше blur/анимаций, меньше лагов —— */
@media (max-width: 900px), ((hover: none) and (pointer: coarse)) {
  html {
    scroll-behavior: auto;
  }
  body,
  .app-shell {
    min-height: 100dvh;
  }
  .site-header,
  .mobile-tabbar,
  .top-live,
  .modal-overlay,
  .theme-picker-mobile summary {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .site-header {
    background: color-mix(in srgb, var(--bg-panel) 96%, transparent);
  }
  .mobile-tabbar {
    background: color-mix(in srgb, var(--bg-panel) 96%, transparent);
  }
  .case-grid .case-card,
  .contents-grid .skin-card,
  .games-grid .game-tile,
  .inv-grid .inv-item,
  .hist-list .hist-row,
  .main-content.page-enter,
  .hero-tagline,
  .win-card,
  .modal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .case-card,
  .skin-card,
  .inv-item,
  .game-tile {
    /* content-visibility ломал карточки на части Android WebView */
    content-visibility: visible;
    contain: none;
  }
  .case-card:hover,
  .case-card:hover .case-art-wrap,
  .case-card:hover .case-name,
  .panel:hover,
  .game-panel:hover,
  .hist-row:hover,
  .live-item:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  .case-art-wrap,
  .case-art,
  .case-name,
  .case-price,
  .panel,
  .game-panel,
  .hist-row,
  .live-item {
    transition: none !important;
  }
  .live-feed-track-h {
    animation-duration: 70s;
    will-change: auto;
  }
  .live-online .dot {
    animation: none;
  }
  .case-art {
    image-rendering: auto;
  }
  img:not(.hist-thumb) {
    content-visibility: auto;
  }
  .hist-row img,
  .hist-thumb {
    content-visibility: visible !important;
    contain: none !important;
  }
  .roulette-wrap {
    contain: strict;
  }
  .open-controls {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .promo-plashka,
  .promo-form {
    width: 100%;
    max-width: 100%;
  }
  .promo-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .promo-form input {
    min-width: 0;
    width: 100%;
    font-size: 16px; /* iOS: без автозума */
  }
  .btn-open,
  .btn-ghost,
  .btn-steam,
  .mobile-tabbar a,
  .up-buy-btn,
  .up-go {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-feed-track-h {
    animation: none !important;
  }
}

/* —— Ничего не вылезает за рамки —— */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.app-shell,
.main-content,
.site-header,
.theme-bar,
.top-live,
.up-page,
.up-arena,
.up-bottom,
.up-recs,
.up-panel,
.up-slot,
.up-go-row,
.up-controls,
.profile-layout,
.profile-main-col,
.game-panel,
.panel,
.auth-bot-card,
.inv-grid,
.hist-list,
.contents-grid,
.case-grid,
.games-grid,
.open-controls,
.open-actions,
.multiplier,
.roulette-stack,
.roulette-wrap,
.win-grid,
.modal,
.toast,
.promo-plashka,
.promo-form,
.promo-chips,
.flow-steps {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.app-shell,
.main-content,
.theme-bar,
.top-live,
.up-page,
.up-bottom,
.roulette-stack,
.open-controls {
  overflow-x: hidden;
}
/* site-header нельзя overflow-x:hidden — иначе overflow-y становится auto и появляется полоска-скролл под «Интерфейс» */
.site-header {
  overflow: visible !important;
}
.case-card,
.skin-card,
.inv-item,
.game-tile,
.up-item,
.up-rec,
.up-chip,
.win-card,
.live-item,
.auth-modal,
.modal {
  overflow: hidden;
  max-width: 100%;
}
.hist-row {
  overflow: visible !important;
  max-width: 100%;
}
.case-name,
.case-price,
.skin-card .name,
.inv-item > div,
.game-tile h3,
.game-tile p,
.up-rec-name,
.up-rec-meta,
.promo-chip,
.profile-chip .bal,
.section-title,
.hero-tagline {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.game-tile p,
.promo-wait,
.promo-hint,
.up-market-hint,
.up-recs-head p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.case-card:hover .case-art-wrap {
  transform: translateY(-2px) scale(1.02);
}
.case-visual,
.case-art-wrap,
.case-art {
  max-width: 100%;
}
.toast {
  max-width: min(92vw, 360px);
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 900px) {
  .toast {
    left: 12px;
    right: 12px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
  }
}
.modal-overlay {
  overflow: auto;
  overscroll-behavior: contain;
}
.modal {
  width: min(100%, 520px);
  max-width: calc(100% - 24px);
}
.up-arena,
.up-bottom,
.up-recs-row {
  width: 100%;
}
.up-balance-box,
.up-filters {
  max-width: 100%;
}
.up-filters input {
  max-width: 100%;
}
@media (max-width: 900px), ((hover: none) and (pointer: coarse)) {
  .case-card:hover,
  .game-tile:hover,
  .skin-card:hover,
  .inv-item:hover {
    transform: none !important;
  }
  .case-visual.has-art,
  .case-art-wrap {
    overflow: hidden !important;
  }
  .open-controls,
  .roulette-stack,
  .roulette-wrap,
  .up-arena,
  .up-go-row {
    width: 100% !important;
    max-width: 100% !important;
    left: 0;
    right: 0;
    margin-left: 0;
    margin-right: 0;
  }
  .promo-plashka {
    padding: 14px;
  }
  .promo-wait,
  .promo-hint {
    font-size: 13px;
  }
}

/* —— Mobile comfort 169m: крупнее тапы, воздух, удобнее панели —— */
@media (max-width: 900px), ((hover: none) and (pointer: coarse)) {
  .app-shell {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  .main-content {
    padding: 14px 12px calc(100px + env(safe-area-inset-bottom, 0px));
  }
  .section-title {
    font-size: 1.32rem;
    letter-spacing: 0.02em;
    margin: 16px 0 12px;
  }
  .hero-tagline {
    font-size: 0.95rem;
    line-height: 1.45;
    margin: 4px 0 14px;
  }
  .case-grid {
    gap: 14px;
  }
  .case-card {
    padding: 14px 10px 12px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    background: color-mix(in srgb, var(--bg-panel) 92%, transparent);
  }
  .case-card:active {
    transform: scale(0.985);
  }
  .case-visual {
    height: 128px;
  }
  .case-name {
    font-size: 12px;
    margin-top: 8px;
  }
  .case-price {
    font-size: 13px;
    font-weight: 800;
    margin-top: 4px;
  }
  .subnav-cases {
    gap: 8px;
    padding: 2px 0 6px;
  }
  .subnav-cases .tab {
    padding: 10px 14px;
    font-size: 12px;
    border-radius: 999px;
    min-height: 40px;
  }
  .mobile-tabbar {
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 2px;
    border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
  }
  .mobile-tabbar a {
    margin: 0 2px;
    padding: 8px 4px 6px;
    min-height: 58px;
    font-size: 10px;
    border-radius: 16px;
    gap: 4px;
  }
  .mobile-tabbar a .tab-ico {
    width: 24px;
    height: 24px;
    border-radius: 8px;
  }
  .mobile-tabbar a span.ico {
    font-size: 18px;
  }
  .mobile-tabbar a.active {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
  }
  .open-controls {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
    border-radius: 18px 18px 0 0;
    border-top: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.22);
  }
  .open-controls .btn-open,
  .open-controls .btn-fast,
  .open-controls .btn-ghost {
    min-height: 48px;
    border-radius: 14px;
    font-size: 14px;
  }
  .toast {
    bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 13px;
  }
  .promo-plashka {
    padding: 16px;
    border-radius: 18px;
  }
  .promo-form {
    gap: 10px;
  }
  .promo-form input {
    min-height: 48px;
    border-radius: 14px;
    padding: 12px 14px;
  }
  .promo-form .btn-open {
    min-height: 48px;
    border-radius: 14px;
    padding: 0 16px;
  }
  .profile-chip {
    padding: 4px 8px 4px 4px;
    border-radius: 999px;
    gap: 8px;
  }
  .profile-chip img {
    width: 30px;
    height: 30px;
  }
  .profile-chip .bal {
    font-size: 12px;
  }
  .btn-steam {
    min-height: 42px;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
  }
  .theme-bar {
    padding: 8px max(12px, env(safe-area-inset-left)) 8px max(12px, env(safe-area-inset-right));
  }
  .theme-bar-btn {
    min-height: 42px;
    border-radius: 12px;
    padding: 8px 12px;
  }
  .panel,
  .game-panel {
    border-radius: 18px;
    padding: 14px;
  }
  .inv-item .sell,
  .btn-sell-all,
  .up-buy-btn,
  .up-go {
    min-height: 46px;
    border-radius: 12px;
  }
  .games-grid {
    gap: 12px;
  }
  .game-tile {
    padding: 16px 14px;
    border-radius: 16px;
    min-height: 108px;
  }
  .auth-modal,
  .modal {
    border-radius: 20px 20px 12px 12px;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .modal-overlay {
    align-items: flex-end;
  }
  .up-controls button,
  .up-chance-btns button,
  [data-chance],
  [data-q] {
    min-height: 42px;
    border-radius: 12px;
  }
  .hist-list .hist-row {
    padding: 14px 12px 14px 84px !important;
    min-height: 100px !important;
  }
  .back-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 2px;
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .case-grid {
    gap: 10px;
  }
  .case-visual {
    height: 112px;
  }
  .mobile-tabbar a {
    font-size: 9px;
    letter-spacing: 0.02em;
  }
  .section-title {
    font-size: 1.2rem;
  }
}

/* ===== Winter / New Year vibe (staging) ===== */
body.is-winter {
  --accent: #e8c56b;
  --accent-dim: rgba(232, 197, 107, 0.22);
  --accent-glow: rgba(168, 214, 255, 0.4);
  --bg-deep: #071018;
  --bg: #071018;
  --bg-panel: rgba(12, 24, 38, 0.9);
  --bg-card: #102033;
  --border: rgba(168, 214, 255, 0.16);
  --text: #f3f7fb;
  --text-muted: #9eb4c9;
  background:
    radial-gradient(ellipse 90% 40% at 50% -8%, rgba(90, 150, 220, 0.28), transparent 60%),
    radial-gradient(ellipse 30% 25% at 8% 20%, rgba(196, 48, 58, 0.12), transparent 70%),
    radial-gradient(ellipse 28% 22% at 94% 16%, rgba(46, 125, 80, 0.16), transparent 70%),
    #071018;
}
body.is-winter .bg-map {
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.04) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.05) 0 1px, transparent 2px),
    linear-gradient(180deg, rgba(8, 18, 32, 0.2), rgba(7, 16, 24, 0.55));
  opacity: 1;
}
body.is-winter .site-header {
  background:
    linear-gradient(180deg, rgba(18, 36, 56, 0.96), rgba(10, 22, 36, 0.92));
  border-bottom: 1px solid rgba(168, 214, 255, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), inset 0 -1px 0 rgba(232, 197, 107, 0.25);
}
body.is-winter .top-live {
  background: rgba(8, 18, 30, 0.85);
  border-bottom: 1px solid rgba(168, 214, 255, 0.1);
}
body.is-winter .logo-mark {
  box-shadow: 0 0 0 1px rgba(232, 197, 107, 0.45), 0 0 22px rgba(168, 214, 255, 0.35);
}
body.is-winter .nav-main a.active,
body.is-winter .nav-main a:hover {
  color: #f4e3b0;
}
body.is-winter .btn-open,
body.is-winter .btn-steam {
  background: linear-gradient(180deg, #f0d48a, #c9963a);
  color: #1a1206;
  box-shadow: 0 8px 20px rgba(201, 150, 58, 0.25);
}
body.is-winter .btn-ghost {
  border-color: rgba(168, 214, 255, 0.28);
  color: #d7e8f5;
}
body.is-winter .case-card,
body.is-winter .panel,
body.is-winter .game-panel,
body.is-winter .profile-card,
body.is-winter .level-card {
  background: linear-gradient(180deg, rgba(18, 36, 56, 0.92), rgba(12, 24, 38, 0.94));
  border-color: rgba(168, 214, 255, 0.14);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
body.is-winter .mobile-tabbar {
  background: rgba(8, 16, 28, 0.94);
  border-top-color: rgba(168, 214, 255, 0.16);
}
body.is-winter .site-footer {
  border-top-color: rgba(168, 214, 255, 0.12);
  color: #9eb4c9;
}
body.is-winter .staging-banner {
  background: linear-gradient(90deg, #12324f, #8d2a32 48%, #1d5c3a);
  color: #f7f3ea;
  letter-spacing: 0.03em;
}

.fd-snow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  overflow: hidden;
}
.fd-flake {
  position: absolute;
  top: -12px;
  left: var(--fd-left, 50%);
  width: var(--fd-size, 3px);
  height: var(--fd-size, 3px);
  border-radius: 50%;
  background: rgba(255, 255, 255, var(--fd-op, 0.45));
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.35);
  animation: fd-snowfall var(--fd-dur, 14s) linear var(--fd-delay, 0s) infinite;
  will-change: transform;
}
@keyframes fd-snowfall {
  0% {
    transform: translate3d(0, -5vh, 0);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--fd-drift, 12px), 105vh, 0);
    opacity: 0;
  }
}

.fd-fest-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  pointer-events: none;
  margin-right: 4px;
  opacity: 0.92;
}
.fd-fest-item {
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 22px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  animation: fd-fest-bob 3.2s ease-in-out infinite;
}
.fd-fest-item svg {
  display: block;
}
.fd-fest-item:nth-child(2) {
  animation-delay: 0.35s;
}
.fd-fest-item:nth-child(3) {
  animation-delay: 0.7s;
}
.fd-fest-item:nth-child(4) {
  animation-delay: 1.05s;
}
.fd-fest-item:nth-child(5) {
  animation-delay: 1.4s;
}
.fd-fest-item:nth-child(6) {
  animation-delay: 1.75s;
}
.fd-fest-item:nth-child(7) {
  animation-delay: 2.1s;
}
@keyframes fd-fest-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.fd-garland {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  height: 10px;
}
.fd-bulb {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
  animation: fd-twinkle 1.8s ease-in-out infinite;
}
.fd-bulb.b0 { color: #e8c56b; background: #e8c56b; }
.fd-bulb.b1 { color: #d24b4b; background: #d24b4b; animation-delay: 0.3s; }
.fd-bulb.b2 { color: #7dcea0; background: #7dcea0; animation-delay: 0.6s; }
.fd-bulb.b3 { color: #9ec9ff; background: #9ec9ff; animation-delay: 0.9s; }
@keyframes fd-twinkle {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@media (max-width: 900px) {
  .fd-fest-strip {
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    gap: 4px;
    opacity: 0.85;
  }
  .fd-fest-item {
    font-size: 16px;
  }
  .fd-fest-item svg {
    width: 22px;
    height: 22px;
  }
  .fd-fest-item:nth-child(n + 5) {
    display: none;
  }
  body.is-winter .site-header {
    padding-bottom: 28px;
  }
  .fd-snow .fd-flake:nth-child(n + 16) {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fd-flake,
  .fd-fest-item {
    animation: none !important;
  }
  .fd-snow {
    display: none;
  }
}
