:root {
  --bg: #130E30;
  --card: #FFFFFF;
  --ink: #1B1730;
  --ink-soft: #6A6484;
  --tab: rgba(255, 255, 255, 0.15);
  --accent: #8B5CF6;
  --accent-dark: #6D3FE0;
  --acc-rgb: 139 92 246;
  --green: #16A34A;
  --radius: 16px;
  --chrome: #FFFFFF;
  --chrome-ink: #10101C;
  --bar: rgba(24, 18, 52, 0.92);
  --panel: #221B4D;
}

/* ================= Темы оформления ================= */
html[data-theme="ocean"], body[data-theme="ocean"] { --bg: #0A1628; --accent: #2E9BFF; --accent-dark: #1668DC; --acc-rgb: 46 155 255; --chrome: #0C1E38; --chrome-ink: #FFFFFF; --bar: rgba(9, 22, 42, 0.94); --panel: #0B1A30; }
html[data-theme="emerald"], body[data-theme="emerald"] { --bg: #071A14; --accent: #10B981; --accent-dark: #047857; --acc-rgb: 16 185 129; --chrome: #08231A; --chrome-ink: #FFFFFF; --bar: rgba(6, 25, 19, 0.94); --panel: #06231A; }
html[data-theme="crimson"], body[data-theme="crimson"] { --bg: #1C0A10; --accent: #F43F5E; --accent-dark: #BE123C; --acc-rgb: 244 63 94; --chrome: #2A0E15; --chrome-ink: #FFFFFF; --bar: rgba(30, 10, 16, 0.94); --panel: #250C13; }
html[data-theme="amber"], body[data-theme="amber"] { --bg: #1A1008; --accent: #F59E0B; --accent-dark: #B45309; --acc-rgb: 245 158 11; --chrome: #2A1A06; --chrome-ink: #FFFFFF; --bar: rgba(28, 18, 8, 0.94); --panel: #241505; }
.theme-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-sw { position: relative; flex: 0 0 auto; width: 46px; height: 46px; aspect-ratio: 1; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0; appearance: none; -webkit-appearance: none; background-size: cover; }
.theme-sw.is-active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.theme-sw.is-active::after { content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 900; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55); }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
button, input { font-family: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

html, body {
  height: 100%;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  overscroll-behavior: none;
}

body.lock { overflow: hidden; }

#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ---------- Header (базовая разметка: белая шапка по макету) ---------- */
#app-header {
  position: relative;
  z-index: 5;
  background: var(--chrome);
  color: var(--chrome-ink);
  height: 44px;
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}
.brand {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand .ver {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 7px;
}
.balance-chip {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg);
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Демо-баннер ---------- */
.demo-banner {
  background: #F59E0B;
  color: #3A2200;
  font-size: 11px;
  text-align: center;
  padding: 4px 8px;
  flex: 0 0 auto;
}
.hidden { display: none !important; }

/* ---------- Контент ---------- */
.screen {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px 24px;
  -webkit-overflow-scrolling: touch;
}
.screen::-webkit-scrollbar { display: none; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

/* ---------- Кнопки ---------- */
.btn {
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  padding: 13px 18px;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  width: 100%;
  box-shadow: 0 8px 18px rgba(var(--acc-rgb), 0.35);
}
.btn-ghost {
  background: #F0EEF7;
  color: var(--ink);
  width: 100%;
}
.btn-danger {
  background: linear-gradient(135deg, #e0483f, #b2252b);
  color: #fff;
  width: 100%;
  box-shadow: 0 8px 18px rgba(178, 37, 43, 0.35);
}
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ================= Профиль ================= */
.profile-top {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}
.avatar {
  position: relative;
  flex: 0 0 auto;
  width: 104px;
  height: 160px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 34px;
  text-transform: uppercase;
  overflow: hidden;
}
.avatar .av-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 34px;
  text-transform: uppercase;
}
.avatar img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.avatar-edit {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}
.avatar-edit .chip {
  cursor: pointer;
}
.upload-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.upload-chip input[type="file"] { display: none; }
.avatar-hint {
  font-size: 12px;
  color: var(--ink-soft, #8b86a3);
  margin: 8px 0 12px;
  line-height: 1.4;
}

.profile-card {
  flex: 1 1 auto;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.p-name {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-username {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p-id {
  font-size: 10px;
  color: #B9B4CC;
  letter-spacing: 0.5px;
}
.p-steam {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-top: 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
}
.p-steam:hover { text-decoration: underline; }
.p-balance { margin-top: auto; }
.p-balance .cap {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--ink-soft);
}
.p-balance .val {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}

.profile-stats {
  padding: 16px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat {
  border-radius: 12px;
  background: #F6F5FA;
  padding: 10px 12px;
  min-width: 0;
}
.stat .val { font-size: 16px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.stat .cap {
  font-size: 10px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
}
.stat-big { grid-column: 1 / -1; }
.stat-big .val { font-size: 26px; }

.rarest {
  grid-column: 1 / -1;
  background: #FFF7E6;
  border: 1px solid #F3D9A4;
}
.rarest .val { color: #B26A00; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rarest .cap { color: #B26A00; }

.profile-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.profile-actions .btn { flex: 1 1 140px; }

/* ================= Кейсы ================= */
.case-big {
  padding: 18px;
  text-align: center;
}
.case-big .case-img-wrap {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, #3a2a6e, #130E30);
  padding: 12px;
  margin-bottom: 14px;
  overflow: hidden;
}
.case-big img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.case-img-wrap img.hide { display: none; }
.case-img-wrap img:not(.hide) ~ .case-stub-ico,
.case-img-wrap img:not(.hide) ~ .case-stub-t { display: none; }
.case-stub {
  flex-direction: column;
  gap: 8px;
  border: 1.5px dashed rgba(207, 198, 239, 0.35);
  color: #cfc6ef;
}
.case-stub-ico {
  font-size: 40px;
  font-weight: 900;
  opacity: 0.85;
  line-height: 1;
}
.case-stub-t {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.7;
}
.case-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 6px;
}
.case-desc {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.case-price {
  display: inline-block;
  background: var(--bg);
  color: #fff;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  padding: 5px 14px;
  margin-bottom: 16px;
}

.case-strip {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.case-strip::-webkit-scrollbar { display: none; }
.case-chip {
  flex: 0 0 auto;
  width: 92px;
  background: var(--card);
  border-radius: 14px;
  padding: 8px;
  text-align: center;
  border: 2px solid transparent;
  cursor: pointer;
}
.case-chip.is-active { border-color: var(--accent); }
.case-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.case-chip img {
  width: 100%;
  height: 54px;
  object-fit: contain;
  margin-bottom: 6px;
}
.case-chip .nm {
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.case-chip .pr {
  font-size: 10px;
  font-weight: 800;
}

/* ================= Игра ================= */
.game-stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.game-card {
  padding: 18px;
  text-align: center;
}
.game-img {
  height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, #3a2a6e, #130E30);
  margin-bottom: 14px;
  overflow: hidden;
}
.game-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.game-img.rolling img { animation: shake 0.12s infinite linear; }
@keyframes shake {
  0% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-14px, 5px) scale(1.05); }
  50% { transform: translate(10px, -8px) scale(1.02); }
  75% { transform: translate(-8px, -10px) scale(1.06); }
  100% { transform: translate(0, 0) scale(1); }
}

.reveal {
  animation: pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.game-result { padding: 18px; text-align: center; }
.soon-ico {
  color: #fff;
  background: radial-gradient(circle at 50% 35%, #3a2a6e, #130E30);
  width: 120px;
  height: 120px;
  margin: 8px auto 18px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-ico 2.2s ease-in-out infinite;
}
.soon-ico svg { width: 64px; height: 64px; }
@keyframes pulse-ico {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.85; }
}
.soon-title {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--accent);
}
.soon-sub {
  margin: 12px 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}
.result-name {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 10px;
}
.result-rarity {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 999px;
  padding: 4px 12px;
  margin: 10px auto 6px;
  color: #fff;
}
.result-price {
  font-size: 22px;
  font-weight: 800;
  margin: 8px 0 16px;
}
.game-actions { display: flex; flex-direction: column; gap: 10px; }

.spinner {
  width: 40px;
  height: 40px;
  margin: 40px auto;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= Инвентарь ================= */
.inv-summary {
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.inv-summary .val { font-size: 18px; font-weight: 800; }
.inv-summary .cap {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 2px;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1.5px solid #E5DFF5;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  background: #F4F1FB;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.inv-controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.inv-controls .filters { margin-bottom: 0; }
.inv-filter-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.inv-filter-btn .inv-filter-name { flex: 1; text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; }
.pick-row .rdot { width: 16px; height: 16px; }
.inv-media {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #F0EEF7;
  overflow: hidden;
}
.inv-media .tile {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.inv-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
.inv-media img.hide { display: none; }
.inv-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  grid-template-areas: "detail" "list";
  align-items: start;
}
.inv-main { grid-area: list; min-width: 0; }
.inv-side { grid-area: detail; min-width: 0; }
@media (min-width: 900px) {
  body.up-wide .inv-layout { grid-template-columns: 1fr 300px; grid-template-areas: "list detail"; }
  body.up-wide .inv-detail { position: sticky; top: 12px; }
}

/* квадратная сетка слотов в духе Steam */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.inv-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1.5px solid color-mix(in srgb, var(--rc) 55%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 16%, transparent), rgba(0, 0, 0, 0.35));
  color: #fff;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.inv-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--rc) 30%, transparent);
}
.inv-tile.is-sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(var(--acc-rgb), 0.35);
}
.inv-tile .tile {
  position: absolute;
  inset: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
}
.inv-tile img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.inv-tile img.hide { display: none; }
.inv-tile .t-count {
  position: absolute;
  z-index: 2;
  top: 6px;
  right: 6px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.6);
  padding: 1px 6px;
  border-radius: 999px;
}
.inv-tile .t-price {
  position: absolute;
  z-index: 2;
  left: 6px;
  right: 6px;
  bottom: 5px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* панель деталей справа как в Steam */
.inv-detail {
  position: relative;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--rc, #8B5CF6) 45%, transparent);
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--rc, #8B5CF6) 22%, transparent), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  padding: 16px;
  text-align: center;
}
.inv-detail-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  padding: 26px 14px;
}
.inv-detail-empty .t { font-size: 14px; font-weight: 800; color: rgba(255, 255, 255, 0.7); margin-bottom: 6px; }
.inv-detail-empty .s { font-size: 12px; }
.inv-d-media {
  position: relative;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-d-media .tile {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
}
.inv-d-media img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 0 26px color-mix(in srgb, var(--rc) 65%, transparent));
}
.inv-d-media img.hide { display: none; }
.inv-d-name { font-size: 17px; font-weight: 900; color: #fff; margin-top: 10px; line-height: 1.25; }
.inv-d-rarity {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid;
  border-radius: 999px;
  padding: 4px 12px;
  margin-top: 8px;
}
.inv-d-meta { font-size: 12px; color: rgba(255, 255, 255, 0.55); margin-top: 8px; }
.inv-d-price { font-size: 22px; font-weight: 900; margin-top: 6px; }
.inv-d-sub { font-size: 12px; color: rgba(255, 255, 255, 0.55); margin-top: 2px; }
.empty {
  text-align: center;
  color: #fff;
  padding: 60px 20px;
  opacity: 0.85;
}
.empty .t { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.empty .s { font-size: 12px; opacity: 0.75; }

/* ================= Профиль: тёмный стиль сайта ================= */
.profile-dark .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.profile-dark .profile-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 3px solid var(--accent);
  background:
    radial-gradient(110% 130% at 100% 0%, rgba(var(--acc-rgb), 0.2), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}
.profile-dark .p-name { color: #fff; }
.profile-dark .p-username { color: rgba(255, 255, 255, 0.6); }
.profile-dark .p-id { color: rgba(255, 255, 255, 0.4); }
.profile-dark .p-steam { color: var(--accent); }
.profile-dark .p-balance .cap { color: rgba(255, 255, 255, 0.5); }
.profile-dark .p-balance .val { color: #fff; }
.profile-dark .p-div { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 8px 0; }
.profile-dark .p-role {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}
.profile-dark .chip {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #cfd0d3;
}
.profile-dark .chip:hover { border-color: var(--accent); color: #fff; }
.profile-dark .chip.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(var(--acc-rgb), 0.35);
}
.profile-dark .avatar-hint { color: rgba(255, 255, 255, 0.5); }
.profile-dark .stat { background: rgba(255, 255, 255, 0.045); }
.profile-dark .stat .val { color: #fff; }
.profile-dark .stat .cap { color: rgba(255, 255, 255, 0.5); }
.profile-dark .rarest { background: rgba(228, 174, 57, 0.1); border-color: rgba(228, 174, 57, 0.35); }
.profile-dark .rarest .val, .profile-dark .rarest .cap { color: #E4AE39; }
.profile-dark .settings-title { color: #fff; }
.profile-dark .set-row { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.profile-dark .top-row { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.profile-dark .set-name { color: #fff; }
.profile-dark .set-desc { color: rgba(255, 255, 255, 0.5); }
.profile-dark .set-chev { color: rgba(255, 255, 255, 0.4); }
.profile-dark .load-slot:hover { background: rgba(255, 255, 255, 0.05); }
.profile-dark .load-slot:hover .set-chev { color: var(--accent); }
.profile-dark .set-ico { background: rgba(var(--acc-rgb), 0.16); color: var(--accent); }
.profile-dark .set-chips { background: rgba(255, 255, 255, 0.06); }
.profile-dark .set-divider { background: rgba(255, 255, 255, 0.08); }
.profile-dark .anim-chip { border-color: rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.06); color: #cfd0d3; }
.profile-dark .anim-chip:hover { border-color: var(--accent); color: #fff; }
.profile-dark .anim-chip.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(120, 90, 255, 0.35);
}
.profile-dark .btn-ghost { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* ================= Нижние табы ================= */
#tabbar {
  flex: 0 0 84px;
  height: 84px;
  background: var(--tab);
  backdrop-filter: blur(10px);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.tab.is-active { color: #FFFFFF; }
.tab:hover { color: #FFFFFF; }
.tab-ico { width: 24px; height: 24px; display: block; }
.tab-ico svg { width: 100%; height: 100%; display: block; }
.tab-label { font-size: 10px; font-weight: 700; letter-spacing: 0.4px; }

/* ================= Тосты ================= */
#toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%) translateY(20px);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.ok { background: #123B2A; color: #C9F5DD; }
#toast.err { background: #3D1420; color: #FFB4B4; }

/* ---------- Кейс: анимация открытия и результат ---------- */
.case-cooldown {
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  margin: 2px 0 14px;
}
.case-cooldown:empty { display: none; }
button:disabled {
  opacity: 0.55;
  cursor: default;
}

.roll-stage {
  position: relative;
  height: 250px;
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: 18px;
  background:
    radial-gradient(130% 130% at 50% -20%, rgba(120, 90, 255, 0.28), transparent 55%),
    linear-gradient(180deg, #151228, #0b0a14);
}
.roll-case {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 122px;
  height: 122px;
  transform: translate(-50%, -50%);
  z-index: 2;
  filter: drop-shadow(0 18px 42px rgba(120, 90, 255, 0.5));
  animation: case-open-spin 1.0s cubic-bezier(0.55, 0.06, 0.68, 0.19) both;
}
.roll-case img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.roll-case.done {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  transition: opacity 0.28s, transform 0.28s;
}
@keyframes case-open-spin {
  0%   { transform: translate(-50%, -50%) scale(0.65) rotate(0deg); }
  55%  { transform: translate(-50%, -50%) scale(1.15) rotate(1440deg); }
  100% { transform: translate(-50%, -50%) scale(1) rotate(1620deg); }
}

/* ---------- Выбор режима игры ---------- */
.game-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 640px; margin: 0 auto; }
.game-mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 24px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.game-mode-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 12px 30px rgba(var(--acc-rgb), 0.25); }
.game-mode-card:active { transform: scale(0.98); }
.gm-tile {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 8px 22px rgba(var(--acc-rgb), 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.gm-tile.gm-alt { background: linear-gradient(135deg, #4B69FF, #8847FF); box-shadow: 0 8px 22px rgba(75, 105, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.gm-tile svg { width: 28px; height: 28px; display: block; }
.gm-title { font-size: 17px; font-weight: 900; letter-spacing: 1px; font-family: "Exo 2", -apple-system, "Segoe UI", sans-serif; }
.gm-desc { font-size: 12px; color: rgba(255, 255, 255, 0.55); text-align: center; line-height: 1.4; overflow-wrap: break-word; max-width: 100%; }

/* ---------- Контракт обмена (как в CS2) ---------- */
.craft-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 12px 0 4px; }
.craft-slot {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1.5px dashed #D8D2EA;
  background: #F7F4FF;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.craft-slot .num { color: #B9B4CC; font-weight: 800; font-size: 14px; }
.craft-slot.filled { border-style: solid; background: #fff; cursor: pointer; transition: transform 0.12s ease; }
.craft-slot.filled:hover { transform: scale(1.04); }
.craft-slot.filled img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.craft-slots.is-drag { outline: 2px dashed var(--accent); outline-offset: 3px; border-radius: 14px; }
.craft-item[draggable="true"], .craft-slot.filled[draggable="true"] { cursor: grab; }
/* призрак перетаскивания пальцем */
.craft-ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(20, 12, 40, 0.95);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  color: #fff;
  z-index: 99;
  pointer-events: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

/* ---------- Контракт обмена: тёмный стиль сайта ---------- */
.contract .craft-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #fff;
}
.contract .craft-title { color: #fff; }
.contract .craft-desc { color: rgba(255, 255, 255, 0.55); }
.contract .craft-hint { color: rgba(255, 255, 255, 0.45); }
.contract .craft-pick { color: #fff; }
.contract .craft-out { color: rgba(255, 255, 255, 0.55); }
.contract .craft-slot {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.18);
}
.contract .craft-slot .num { color: rgba(255, 255, 255, 0.35); }
.contract .craft-slot.filled { background: rgba(0, 0, 0, 0.55); }
.contract .craft-item {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.09);
}
.contract .craft-item:hover { border-color: var(--accent); }
.contract .craft-item.is-pick {
  border-color: var(--accent);
  background: linear-gradient(93deg, rgba(var(--acc-rgb), 0.28), rgba(var(--acc-rgb), 0.45), rgba(var(--acc-rgb), 0.28));
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(var(--acc-rgb), 0.28);
}
.contract .craft-item .inv-media { background: rgba(0, 0, 0, 0.4); }
.contract .craft-info .n { color: #fff; }
.contract .craft-info .p { color: rgba(255, 255, 255, 0.55); }
.contract .craft-list { scrollbar-width: thin; scrollbar-color: rgba(var(--acc-rgb), 0.45) transparent; }
.contract .craft-list::-webkit-scrollbar { width: 5px; }
.contract .craft-list::-webkit-scrollbar-thumb { background: rgba(var(--acc-rgb), 0.45); border-radius: 4px; }
.contract .craft-list::-webkit-scrollbar-track { background: transparent; }
.craft-out { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 2px; font-size: 13px; color: var(--ink-soft); }
.craft-out b { font-size: 14px; }

/* ---------- Крафт ---------- */
.craft-wrap { display: flex; flex-direction: column; gap: 10px; min-height: 100%; }
.craft-card { padding: 18px; }
.craft-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.craft-title { font-size: 18px; font-weight: 800; color: var(--ink); }
.craft-back { width: auto; padding: 8px 12px; font-size: 13px; font-weight: 700; }
.craft-desc { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; line-height: 1.45; }
.craft-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; max-height: 44vh; overflow-y: auto; }
.craft-bar { position: sticky; bottom: 0; z-index: 6; }
.craft-bar .btn-primary { margin: 0; }
.craft-recipe {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 6px 0 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1.5px dashed var(--accent-dark);
  background: #F7F4FF;
}
.cr-left { display: flex; flex-direction: column; gap: 3px; align-items: center; text-align: center; }
.cr-cap { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.cr-big { font-size: 14px; font-weight: 800; color: var(--ink); }
.cr-big b { color: var(--ink); }
.cr-right .cr-big b { color: inherit; }
.cr-arrow { font-size: 20px; font-weight: 900; color: var(--accent); }
.craft-example {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 2px 0 12px;
}
.craft-ex-ico {
  position: relative;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid #ECE9F4;
  background: #fff;
}
.craft-ex-ico img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.craft-ex-ico .tile { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; color: #fff; }
.craft-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border-radius: 14px;
  border: 1.5px solid #ECE9F4;
  background: #F9F8FC;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.craft-item.is-pick {
  border-color: var(--accent);
  background: #F1ECFF;
  box-shadow: 0 0 0 1px var(--accent);
}
.craft-item:hover { border-color: var(--accent); }
.craft-item .inv-media { position: relative; width: 58px; height: 58px; flex: 0 0 58px; }
.craft-item .inv-media img { width: 100%; height: 100%; object-fit: contain; }
.craft-cnt {
  position: absolute;
  right: -4px;
  bottom: -4px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
}
.craft-sel {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(255, 255, 255, 0.25);
  pointer-events: none;
}
.craft-item .craft-sel { width: 24px; height: 24px; font-size: 13px; }
.pick-row .craft-sel { position: static; transform: none; width: 24px; height: 24px; font-size: 12px; margin-left: auto; flex: 0 0 auto; }
.craft-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.craft-info .n { font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.craft-info .p { font-size: 12px; color: var(--ink-soft); }
.craft-pick { margin: 14px 0 10px; font-size: 14px; color: var(--ink); text-align: center; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.craft-pick b { color: var(--accent); }
.craft-autofill { width: auto; padding: 6px 12px; font-size: 12px; }
.craft-hint { margin: 12px 0 0; font-size: 12px; color: var(--ink-soft); text-align: center; }
.craft-item.is-dim { opacity: 0.45; filter: grayscale(0.9); }
.craft-item.is-dim .craft-info .n { text-decoration: line-through; }

.settings-card { padding: 16px; margin-bottom: 14px; }
.settings-title { font-size: 16px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.reg-edit { padding: 7px 12px; font-size: 12px; flex: 0 0 auto; border-radius: 999px !important; }
.set-chips {
  flex-shrink: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  background: #F4F1FB;
  border-radius: 999px;
  padding: 4px;
}
.set-chips.anim-chips {
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 6px;
  border-radius: 16px;
}
/* превью анимации в профиле */
.anim-preview { margin-top: 12px; }
.anim-preview .case-title:empty,
.anim-preview .case-desc:empty { display: none; }
/* строка с чипами анимации — всегда в два этажа: подпись сверху, чипы снизу */
.set-row-chips { flex-wrap: wrap; row-gap: 8px; }
.set-row-chips .set-chips { flex: 1 1 100%; justify-content: flex-start; }
.set-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
}
.set-divider {
  height: 1px;
  background: var(--bg2, #F0ECF9);
  margin: 0 2px;
}
.set-ico {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #F1ECFF, #E4DAFF);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.set-ico svg { width: 20px; height: 20px; }
.set-info { flex: 1; min-width: 0; }
.set-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.set-desc {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.set-chev {
  flex: 0 0 auto;
  color: #C9C3DC;
  display: flex;
  align-items: center;
}
.set-chev svg { width: 16px; height: 16px; }
.load-slot {
  border-radius: 12px;
  margin: 0 -2px;
  cursor: pointer;
  transition: background 0.15s;
}
.load-slot:hover { background: var(--bg2, #F7F4FF); }
.load-ico { overflow: hidden; }
.load-ico img { width: 100%; height: 100%; object-fit: cover; }
.load-slot:hover .set-chev { color: var(--accent); }
.set-chips .anim-chip {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
}
.set-chips .anim-chip.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(120, 90, 255, 0.35);
}

/* ---------- Регистрация ---------- */
.reg-card { padding: 22px 18px; text-align: center; }
.reg-logo { font-size: 22px; font-weight: 900; letter-spacing: 0.04em; color: var(--ink); }
.reg-logo span { color: var(--accent); }
.reg-title { font-size: 19px; font-weight: 800; color: var(--ink); margin-top: 10px; }
.reg-sub { font-size: 13px; color: var(--ink-soft); margin: 6px 0 18px; line-height: 1.45; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; text-align: left; }
.field-cap { font-size: 12px; font-weight: 700; color: var(--ink); }
.field-hint { font-size: 11px; color: var(--ink-soft); }
.input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #E5DFF5;
  border-radius: 12px;
  background: #F7F4FF;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--acc-rgb), 0.15); }
.reg-do { width: 100%; margin-top: 4px; }
.anim-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.anim-chip {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(27, 23, 48, 0.14);
  background: #F0EEF7;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.anim-chip:hover { border-color: var(--accent); }
.anim-chip.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(120, 90, 255, 0.35);
}

/* --- Карточка (card) --- */
.card3d-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 600px;
}
.card3d {
  position: relative;
  width: 130px;
  height: 170px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  border: 1.5px solid var(--rc);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 30px color-mix(in srgb, var(--rc) 55%, transparent);
  transform: translateY(-46px) rotateY(78deg) scale(0.55);
  opacity: 0;
}
.roll-stage.show .card3d { animation: card-in .95s cubic-bezier(.2, .9, .3, 1.22) forwards; }
@keyframes card-in {
  0% { opacity: 0; transform: translateY(-46px) rotateY(78deg) scale(0.55); }
  60% { opacity: 1; transform: translateY(6px) rotateY(-8deg) scale(1.04); }
  100% { opacity: 1; transform: translateY(0) rotateY(0) scale(1); }
}
.card3d.lift { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 44px color-mix(in srgb, var(--rc) 75%, transparent); }
.card-face {
  position: absolute;
  inset: 8px;
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 50% 0%, rgba(255, 255, 255, 0.1), transparent 60%);
}
.card-face img { width: 100%; height: 100%; object-fit: contain; }
.card-shine { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; pointer-events: none; }
.card-shine::before {
  content: "";
  position: absolute;
  top: -60%;
  bottom: -60%;
  left: -20%;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-220%) rotate(18deg);
}
.card3d.lift .card-shine::before { animation: card-shine .8s ease-in-out 1.1s; }
@keyframes card-shine {
  0% { transform: translateX(-220%) rotate(18deg); }
  100% { transform: translateX(480%) rotate(18deg); }
}
.card-glow {
  position: absolute;
  inset: -14px;
  border-radius: 20px;
  background: radial-gradient(circle, color-mix(in srgb, var(--rc) 40%, transparent), transparent 70%);
  opacity: 0;
  pointer-events: none;
}
.card3d.lift .card-glow { animation: card-glow 1.6s ease-in-out infinite; }
@keyframes card-glow {
  0%, 100% { opacity: 0.35; transform: scale(0.98); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

/* --- Луч (beam) --- */
.beam-floor {
  position: absolute;
  left: 50%;
  bottom: 44px;
  width: 190px;
  height: 34px;
  margin-left: -95px;
  border-radius: 50%;
  background: radial-gradient(ellipse, var(--rc), transparent 70%);
  opacity: 0;
  z-index: 1;
}
.beam-ray {
  position: absolute;
  left: 50%;
  bottom: 44px;
  width: 14px;
  height: 150px;
  margin-left: -7px;
  z-index: 1;
  border-radius: 8px;
  background: linear-gradient(to top, var(--rc), transparent);
  opacity: 0;
  transform-origin: bottom;
  transform: scaleY(0);
}
.beam-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  z-index: 2;
  border-radius: 50%;
  border: 2px solid var(--rc);
  opacity: 0;
}
.roll-stage.show .beam-floor { animation: beam-floor .7s ease-out 0.05s forwards; }
.roll-stage.show .beam-ray { animation: beam-ray 1.05s cubic-bezier(.25, .9, .35, 1) forwards; }
.roll-stage.show .beam-ring { animation: beam-ring 1.3s ease-out forwards; }
@keyframes beam-floor {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 0.85; transform: scale(1); }
}
@keyframes beam-ray {
  0% { opacity: 0; transform: scaleY(0.1); }
  40% { opacity: 0.9; }
  100% { opacity: 0; transform: scaleY(1); }
}
@keyframes beam-ring {
  0% { opacity: 0; transform: scale(0.3); }
  30% { opacity: 0.9; }
  100% { opacity: 0; transform: scale(2.4); }
}
.beam-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  z-index: 3;
  opacity: 0;
  transform: translateY(90px) scale(0.4);
}
.roll-stage.show .beam-item { animation: beam-in 1.05s cubic-bezier(.2, .95, .3, 1.25) forwards; }
@keyframes beam-in {
  0% { opacity: 0; transform: translateY(90px) scale(0.4); }
  60% { opacity: 1; transform: translateY(-10px) scale(1.1); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.beam-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 24px var(--rc)) drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55));
}

/* --- Рулетка (лента скинов с указателем) --- */
.reel-mask {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}
.reel-mask::before,
.reel-mask::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 64px;
  z-index: 4;
}
.reel-mask::before { left: 0; background: linear-gradient(to right, rgba(11, 10, 20, 0.95), transparent); }
.reel-mask::after { right: 0; background: linear-gradient(to left, rgba(11, 10, 20, 0.95), transparent); }
.reel-pointer {
  position: absolute;
  left: 50%;
  top: 12px;
  bottom: 12px;
  width: 3px;
  margin-left: -1.5px;
  z-index: 5;
  background: linear-gradient(to bottom, var(--accent), var(--accent-dark));
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(var(--acc-rgb), 0.9);
  opacity: 0;
}
.reel-pointer::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  margin-left: -7px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid var(--accent);
}
.roll-stage.show .reel-pointer { opacity: 1; transition: opacity 0.3s; }
.reel-strip {
  position: absolute;
  top: 50%;
  left: 0;
  margin-top: -55px;
  display: flex;
  gap: 8px;
  will-change: transform;
}
.reel-strip.blur { filter: blur(3px); }
.reel-cell {
  position: relative;
  flex: 0 0 84px;
  width: 84px;
  height: 110px;
  border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--rc) 45%, transparent);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.reel-cell .tile {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.92);
}
.reel-cell img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}
.reel-cell img.hide { display: none; }
.reel-cell .tile {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.92);
}
.reel-cell.is-win {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent), 0 0 30px color-mix(in srgb, var(--rc) 70%, transparent);
}

/* --- Монетка (флип и появление скина) --- */
.coin-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 600px;
}
.coin {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #C4B0FF, var(--accent) 45%, var(--accent-dark) 100%);
  border: 4px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 40px rgba(var(--acc-rgb), 0.55), inset 0 2px 8px rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform-style: preserve-3d;
}
.roll-stage.show .coin { opacity: 1; animation: coin-flip 0.55s linear 3; }
@keyframes coin-flip {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}
.coin-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  z-index: 3;
  opacity: 0;
  transform: scale(0.3);
}
.coin-item.show {
  opacity: 1;
  transform: scale(1);
  transition: transform 0.45s cubic-bezier(0.2, 1.5, 0.4, 1), opacity 0.3s;
}
.coin-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 26px var(--rc)) drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55));
}

/* --- Кольца (ударные волны + вспышка) --- */
.rings { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.rings i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  border: 3px solid var(--rc);
  opacity: 0;
}
.roll-stage.show .rings i:nth-child(1) { animation: ring-wave 1.1s ease-out 0.05s both; }
.roll-stage.show .rings i:nth-child(2) { animation: ring-wave 1.1s ease-out 0.25s both; }
.roll-stage.show .rings i:nth-child(3) { animation: ring-wave 1.1s ease-out 0.45s both; }
@keyframes ring-wave {
  0% { opacity: 0.9; transform: scale(0.3); }
  100% { opacity: 0; transform: scale(2.4); }
}
.rings-flash {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, color-mix(in srgb, var(--rc) 45%, transparent) 45%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}
.roll-stage.show .rings-flash { animation: rings-flash 0.8s ease-out 0.5s both; }
@keyframes rings-flash {
  0% { opacity: 0; }
  25% { opacity: 0.9; }
  100% { opacity: 0; }
}
.rings-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  z-index: 3;
  opacity: 0;
  transform: translateY(50px) scale(0.6);
}
.roll-stage.show .rings-item { animation: rings-in 0.7s cubic-bezier(0.2, 1.3, 0.4, 1) 0.7s forwards; }
@keyframes rings-in {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.rings-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 26px var(--rc)) drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55));
}

/* --- Вихрь (вращающиеся лучи + проявление) --- */
.storm {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  z-index: 1;
  border-radius: 50%;
  background: repeating-conic-gradient(color-mix(in srgb, var(--rc) 50%, transparent) 0 10deg, transparent 10deg 24deg);
  -webkit-mask-image: radial-gradient(circle, transparent 18%, #000 45%, transparent 72%);
  mask-image: radial-gradient(circle, transparent 18%, #000 45%, transparent 72%);
  opacity: 0;
  pointer-events: none;
}
.roll-stage.show .storm { animation: storm-spin 1.7s ease-out forwards; }
@keyframes storm-spin {
  0% { opacity: 0; transform: rotate(0deg) scale(0.6); }
  25% { opacity: 0.9; }
  80% { opacity: 0.7; }
  100% { opacity: 0; transform: rotate(540deg) scale(1.15); }
}
.storm-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  z-index: 3;
  opacity: 0;
  transform: scale(0.7);
  filter: blur(14px) brightness(2);
}
.roll-stage.show .storm-item { animation: storm-in 0.8s ease-out 0.85s forwards; }
@keyframes storm-in {
  to { opacity: 1; transform: scale(1); filter: blur(0) brightness(1); }
}
.storm-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 26px var(--rc)) drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55));
}

.card.result { text-align: center; }
.rarity-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #F5F3FF;
  padding: 4px 10px;
  border-radius: 999px;
}
.result-img {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 10px auto 6px;
  overflow: hidden;
  border-radius: 16px;
  background: #eee9f8;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-img img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.result-img img.hide { display: none; }
.result-img .tile {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
}
.result-meta {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.result-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}
/* ================= VacNet Web: доп. экраны ================= */
.codes-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F9F8FC;
  border: 1.5px solid #ECE9F4;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13px;
  flex-wrap: wrap;
  row-gap: 6px;
}
.code-row code {
  font-weight: 800;
  background: #F0EEF7;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
}
.code-status { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; }
.code-count { font-weight: 800; }
.code-del {
  width: auto;
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 8px;
  flex: 0 0 auto;
}
.admin-title { font-size: 13px; font-weight: 800; margin: 14px 0 8px; color: #fff; }
.admin-title:first-child { margin-top: 0; }
.admin-row { display: flex; gap: 8px; margin-bottom: 10px; }
.admin-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-stats .stat:last-child { grid-column: 1 / -1; }
.admin-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 50%), #E5DFF5 var(--fill, 50%));
  outline: none;
  margin: 8px 0 6px;
  cursor: pointer;
}
.admin-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(var(--acc-rgb), 0.35);
  cursor: pointer;
}
.admin-range::-moz-range-track { height: 6px; border-radius: 999px; background: #E5DFF5; }
.admin-range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
.admin-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  cursor: pointer;
}

.top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-bottom: 1px solid #F0ECF9;
  font-size: 14px;
}
.top-row:last-child { border-bottom: none; }
.top-row.is-you { background: #F1ECFF; border-radius: 10px; padding: 11px 10px; margin-top: 6px; }
.top-pos { flex: 0 0 24px; font-weight: 800; color: var(--accent); }
.top-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.top-bal { font-weight: 800; }

/* ================= Админ кейс (результат) ================= */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 16px;
}
.admin-cell {
  border: 1.5px solid #ECE9F4;
  border-radius: 12px;
  padding: 8px;
  background: #F9F8FC;
  text-align: center;
  min-width: 0;
}
.admin-media {
  position: relative;
  width: 100%;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: #EFEBF8;
  display: flex;
  align-items: center;
  justify-content: center;
}
.admin-media img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
.admin-media img.hide { display: none; }
.admin-media .tile {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
}
.admin-name {
  font-size: 11px;
  font-weight: 700;
  margin: 6px 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-price { font-size: 12px; font-weight: 800; }

/* ================= Апгрейд (старые стили удалены — актуальные ниже) ================= */
.up-chance-sub { font-size: 12px; }

/* лучи победы (ключевые кадры используются классом .up-burst) */
@keyframes pulse-rays {
  0% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  50% { opacity: 0.8; }
  100% { opacity: 0; transform: scale(1.6) rotate(70deg); }
}

/* =====================================================================
   UPGRADE SKINS — единое оформление с приложением (тёмный фиолетовый)
   ===================================================================== */
body.up-wide #app { max-width: 1180px; }
body.up-wide #tabbar { max-width: 460px; margin: 0 auto; width: 100%; }

.up-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "inv" "zone" "targets";
  gap: 14px;
  align-items: start;
}
.up-col-inv { grid-area: inv; }
.up-col-main { grid-area: zone; }
.up-col-target { grid-area: targets; }

.up-col {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 12px;
  min-width: 0;
}
.up-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 800;
  margin-bottom: 10px;
}
.up-col-head b { color: var(--accent); }

/* панель инструментов списка */
.up-tools { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.up-search {
  width: 100%;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.up-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--acc-rgb), 0.16); }
.up-search::placeholder { color: rgba(255, 255, 255, 0.35); }
.up-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.up-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #cfd0d3;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.up-chip:hover { border-color: var(--accent); color: #fff; }
.up-chip.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(var(--acc-rgb), 0.35);
}
.up-chip[disabled] { opacity: 0.45; cursor: default; }
.up-chip[disabled]:hover { border-color: rgba(255, 255, 255, 0.1); color: #cfd0d3; }
.up-sorts { display: flex; gap: 6px; }

/* свечение по редкости */
.up-item-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 55%, transparent),
    inset 0 0 14px color-mix(in srgb, var(--rc) 30%, transparent);
}

/* сетка ставок (инвентарь, как у upgrader — квадратные карточки) */
.up-item-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--acc-rgb), 0.45) transparent;
}
/* карточки скинов: ставки и цели — единый вид */
.up-item,
.up-target {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  text-align: center;
  color: #fff;
  transition: all 0.15s ease;
}
.up-item:hover,
.up-target:hover {
  border-color: color-mix(in srgb, var(--rc) 60%, transparent);
  transform: translateY(-1px);
}
.up-item.is-pick,
.up-target.is-pick {
  border-color: var(--accent);
  background: linear-gradient(93deg, rgba(var(--acc-rgb), 0.28), rgba(var(--acc-rgb), 0.45), rgba(var(--acc-rgb), 0.28));
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(var(--acc-rgb), 0.28);
}
.up-item-media,
.up-target-media {
  position: relative;
  aspect-ratio: 1;
  border-radius: 9px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
}
.up-item-media img,
.up-target-media img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.up-item-media img.hide,
.up-target-media img.hide { display: none; }
.up-item-media .tile,
.up-target-media .tile {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
}
.up-item-price,
.up-target-price {
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 2;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}
.up-item-float {
  position: absolute;
  right: 4px;
  top: 4px;
  z-index: 2;
  font-size: 8.5px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(0, 0, 0, 0.55);
  padding: 1px 4px;
  border-radius: 6px;
}
.up-item-name,
.up-target-name {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  min-height: 27px;
  color: #fff;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* полка целей */
.up-target-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--acc-rgb), 0.45) transparent;
}

/* центральная зона */
.up-col-main .up-zone { display: flex; flex-direction: column; gap: 12px; }
.up-compare { display: flex; align-items: center; gap: 10px; }
.up-slot {
  position: relative;
  flex: 1;
  align-self: stretch;
  min-width: 0;
  min-height: 150px;
  text-align: center;
  padding: 12px 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.up-slot.is-empty { border-style: dashed; opacity: 0.55; }
.up-slot-ph { color: rgba(255, 255, 255, 0.45); font-size: 11.5px; letter-spacing: 0.3px; }
.up-slot-media {
  position: relative;
  height: 84px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.up-slot-media img {
  position: relative;
  z-index: 1;
  max-height: 82px;
  max-width: 92%;
  object-fit: contain;
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--rc) 55%, transparent));
}
.up-slot-name {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  min-height: 27px;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.up-slot-cap {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}
.up-slot-price { font-size: 12px; font-weight: 800; margin-top: 3px; color: #fff; }
.up-vs { display: flex; align-items: center; justify-content: center; }

/* круглый шанс (как у upgrader: кольцо + стрелка + проценты в центре) */
.up-gauge { position: relative; width: 126px; height: 126px; flex: 0 0 126px; }
.up-gauge-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ug-bg { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 9; }
.ug-val {
  fill: none;
  stroke: url(#ugGrad);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s cubic-bezier(0.3, 0.7, 0.3, 1);
}
.up-gauge-arrow {
  position: absolute;
  left: 50%;
  top: 10%;
  z-index: 6;
  width: 24px;
  height: 32px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 0 7px rgba(var(--acc-rgb), 0.65));
}
.up-gauge-arrow-svg { display: block; width: 100%; height: 100%; }
.up-gauge:not(.up-gauge-big) .up-gauge-arrow { width: 18px; height: 24px; top: 11%; }
.up-gauge-inner {
  position: absolute;
  inset: 27px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: #1B1638;
  border: 1px solid rgba(var(--acc-rgb), 0.28);
  border-radius: 50%;
}
.up-gauge-inner b { font-size: 18px; font-weight: 900; color: var(--accent); line-height: 1; }
.up-gauge-inner span { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255, 255, 255, 0.5); }
.up-chance-sub { text-align: center; font-size: 12px; color: rgba(255, 255, 255, 0.55); }
.up-chance-sub b { color: var(--accent); font-size: 13px; }

/* игровой шрифт для ключевых цифр и заголовков апгрейда */
.up-gauge-inner b,
.up-go,
.ur-badge,
.ur-title,
.ur-price,
.up-roll-label,
.up-col-head b {
  font-family: "Exo 2", -apple-system, "Segoe UI", sans-serif;
}

/* анимация результата — круг шанса */
.up-gauge.up-gauge-big {
  position: relative;
  width: 280px;
  height: 280px;
  flex: 0 0 auto;
  margin: 0 auto;
}
.up-gauge-big .up-gauge-inner {
  inset: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #2A2159, #191238);
  border: 2px solid rgba(var(--acc-rgb), 0.45);
  box-shadow: 0 0 34px rgba(var(--acc-rgb), 0.2), inset 0 0 26px rgba(0, 0, 0, 0.6);
}
.up-gauge-big .up-gauge-inner b { font-size: 30px; }
.up-gauge-big .up-gauge-inner span { font-size: 10px; }
.up-gauge-needle {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  transform: rotate(0deg);
  will-change: transform;
}
.ug-val.is-win {
  stroke: #24D17A;
  filter: drop-shadow(0 0 10px rgba(36, 209, 122, 0.85));
}
.ug-val.is-lose {
  stroke: #E64E4C;
  filter: drop-shadow(0 0 10px rgba(230, 78, 76, 0.7));
}
@keyframes up-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
.roll-stage.is-fail .up-gauge { animation: up-shake 0.55s ease-in-out; }

/* основная кнопка UPGRADE */
.up-go {
  width: 100%;
  font-size: 15px;
  letter-spacing: 4px;
  padding: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 10px 26px rgba(var(--acc-rgb), 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.up-go:hover { filter: brightness(1.07); }
.up-go[disabled] { background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.35); box-shadow: none; }

/* статистика / история */
.up-hist { margin-top: 14px; }
.up-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
}
.up-panel-title {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
  margin: 12px 0 8px;
}
.up-panel-title:first-child { margin-top: 0; }
.up-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
}
.up-panel-head .up-panel-title { margin: 0; }
.up-collapse {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, transform 0.2s;
}
.up-panel-head:hover .up-collapse { border-color: var(--accent); color: #fff; }
.up-stats-body { overflow: hidden; max-height: 1600px; margin-top: 8px; opacity: 1; transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.2s ease; }
.up-stats-body.is-closed { max-height: 0; margin-top: 0; opacity: 0; }
.up-stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.up-stat { text-align: center; padding: 9px 2px; border-radius: 10px; background: rgba(255, 255, 255, 0.045); min-width: 0; }
.up-stat b { display: block; font-size: 13px; color: #fff; }
.up-stat span { font-size: 9.5px; color: rgba(255, 255, 255, 0.5); }
.c-ok, .ok { color: #24D17A !important; }
.c-bad, .bad { color: #E64E4C !important; }
.c-acc, .acc { color: var(--accent) !important; }
.up-win-strip { display: flex; gap: 8px; overflow-x: auto; padding: 2px; }
.up-win {
  position: relative;
  flex: 0 0 58px;
  height: 58px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--rc) 25%, transparent);
}
.up-win img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.up-win img.hide { display: none; }
.up-history-list { display: flex; flex-direction: column; gap: 6px; }
.up-hrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}
.up-hrow.is-win { border-left: 2px solid #24D17A; }
.up-hrow.is-lose { border-left: 2px solid #E64E4C; }
.up-hmark { font-weight: 900; font-size: 13px; flex: 0 0 12px; }
.up-htext { flex: 1; min-width: 0; }
.up-htext b { display: block; font-size: 11.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-hsub { font-size: 10px; color: rgba(255, 255, 255, 0.45); }
.up-hdelta { font-size: 11px; font-weight: 800; }
.up-empty { color: rgba(255, 255, 255, 0.35); font-size: 12px; padding: 18px 6px; text-align: center; }

/* этап анимации */
.up-roll-card {
  padding: 16px;
  background: linear-gradient(180deg, #241B4E, #171232);
  border-radius: 18px;
  border: 1px solid rgba(var(--acc-rgb), 0.28);
  text-align: center;
}
.up-roll-stage { position: relative; overflow: hidden; min-height: 300px; display: flex; align-items: center; justify-content: center; }
.up-roll-label { text-align: center; font-weight: 900; letter-spacing: 3px; color: var(--accent); margin-bottom: 10px; font-size: 14px; }
.up-roll-desc { text-align: center; color: rgba(255, 255, 255, 0.6); margin-top: 10px; font-size: 13px; min-height: 18px; }

/* вспышка/лучи при победе */
.up-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 320px;
  height: 320px;
  margin: -160px 0 0 -160px;
  background: repeating-conic-gradient(color-mix(in srgb, var(--rc) 55%, transparent) 0 12deg, transparent 12deg 26deg);
  border-radius: 50%;
  animation: pulse-rays 0.7s ease-out forwards;
  pointer-events: none;
  z-index: 6;
}
.up-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  animation: ur-flash 0.55s ease-out 0.1s;
  pointer-events: none;
  z-index: 7;
}
@keyframes ur-flash { 0% { opacity: 0; } 15% { opacity: 0.75; } 100% { opacity: 0; } }

/* (анимации Рулетка/Колесо/Шкала/Загадка удалены — крутится только круг шанса) */

/* конфетти */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.cf {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  animation: cf-fall var(--d) linear var(--dl) forwards;
  opacity: 0.95;
}
@keyframes cf-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(var(--r)); opacity: 0; }
}

/* экраны результата */
.up-result {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 26px 18px;
  border-radius: 18px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent);
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--rc) 26%, transparent), transparent 55%),
    linear-gradient(180deg, #241B4E, #171232);
}
.ur-badge {
  font-weight: 900;
  letter-spacing: 3px;
  color: #24D17A;
  font-size: 15px;
  text-shadow: 0 0 18px rgba(36, 209, 122, 0.6);
}
.ur-badge.is-fail { color: #E64E4C; text-shadow: 0 0 18px rgba(230, 78, 76, 0.6); }
.ur-title { font-size: 20px; font-weight: 900; color: #fff; max-width: 100%; line-height: 1.25; }
.ur-rarity { font-size: 12px; font-weight: 800; letter-spacing: 1px; }
.ur-media {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ur-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 26px color-mix(in srgb, var(--rc) 65%, transparent));
  animation: ur-pop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.ur-media img.hide { display: none; }
@keyframes ur-pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ur-meta { font-size: 12px; color: rgba(255, 255, 255, 0.55); line-height: 1.6; }
.ur-price { font-size: 22px; font-weight: 900; }
.ur-price.lose { color: #E64E4C; }
.ur-btn {
  margin-top: 10px;
  letter-spacing: 2px;
  min-width: 180px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 10px 26px rgba(var(--acc-rgb), 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.ur-btn:hover { filter: brightness(1.07); }
.up-result-lose { border-color: rgba(230, 78, 76, 0.5); }
.up-result-lose .ur-btn {
  background: rgba(230, 78, 76, 0.12);
  color: #FF6B68;
  border: 1px solid rgba(230, 78, 76, 0.4);
  box-shadow: none;
}
.up-result-lose .ur-btn:hover { background: rgba(230, 78, 76, 0.22); }
.up-result-lose .ur-media.is-lost { filter: grayscale(0.45) brightness(0.75); }
.roll-stage.is-fail { filter: saturate(0.5); }

/* горячая лента дропа: стоит на месте, новые слева */
.up-feed {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  margin-bottom: 14px;
  scrollbar-width: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x pan-y;
}
.up-feed::-webkit-scrollbar { display: none; }
.up-feed img { -webkit-user-drag: none; }
.up-feed-track {
  display: flex;
  width: max-content;
}
.up-feed-item {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px 6px 6px;
  margin-right: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}
.up-feed-item:last-child { margin-right: 0; }
.up-feed-item.fresh { animation: feed-in 0.45s cubic-bezier(0.2, 1.2, 0.4, 1); }
@keyframes feed-in {
  from { opacity: 0; transform: translateX(-16px) scale(0.92); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
.up-feed-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}
.up-feed-item .fm { font-weight: 900; }
.up-feed-item .fimg {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.35);
  flex: 0 0 auto;
}
.up-feed-item .fn { color: rgba(255, 255, 255, 0.6); font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.up-feed-item .fi { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.up-feed-item .fp { color: var(--rc); }

/* узкие — компактная расстановка слотов и шанса */
@media (max-width: 520px) {
  .up-compare { flex-wrap: wrap; row-gap: 4px; }
  .up-slot { flex: 1 1 44%; }
  .up-vs { order: 3; width: 100%; margin-top: 6px; }
  .up-gauge { width: 112px; height: 112px; flex: 0 0 112px; margin-top: 4px; }
  .up-gauge-inner { inset: 24px; }
  .up-gauge-inner b { font-size: 15px; }
  .up-gauge-inner span { font-size: 8px; }
  .up-stat b { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .up-stat span { font-size: 8.5px; }
  .up-roll-label { font-size: 12px; letter-spacing: 2px; }
}

/* широкие экраны — цели справа */
@media (min-width: 900px) {


body.up-wide .up-layout {
    grid-template-columns: 340px 1fr 340px;
    grid-template-areas: "inv zone targets";
  }
  .up-target-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 56vh;
  }
  .up-item-list { max-height: 56vh; }
  .up-result { min-height: 560px; }
  .up-slot { min-height: 190px; }
  .up-slot-media { height: 120px; }
  .up-slot-media img { max-height: 118px; }
  .up-gauge { width: 140px; height: 140px; flex: 0 0 140px; }
  .up-gauge-inner b { font-size: 22px; }
  .up-gauge.up-gauge-big { width: 340px; height: 340px; flex: 0 0 auto; }
  .up-gauge-big .up-gauge-inner { inset: 90px; }
  .up-gauge-big .up-gauge-inner b { font-size: 36px; }
}

/* =====================================================================
   ЕДИНЫЙ ТЁМНЫЙ СТИЛЬ САЙТА — все светлые экраны под одну тему
   ===================================================================== */
/* шапка */
#app-header { background: var(--chrome); color: var(--chrome-ink); }
.balance-chip { background: var(--bg); color: #fff; }

/* нижняя панель — плавающая пилюля с анимацией */
#tabbar {
  flex: 0 0 auto;
  height: auto;
  display: flex;
  gap: 4px;
  margin: 8px 16px calc(12px + env(safe-area-inset-bottom));
  padding: 6px;
  background: var(--bar);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
body.up-wide #tabbar { max-width: 460px; margin: 8px auto calc(12px + env(safe-area-inset-bottom)); width: 100%; }
.tab {
  padding: 8px 0 7px;
  border-radius: 16px;
  transition: color 0.2s ease, background 0.25s ease, box-shadow 0.25s ease, transform 0.12s ease;
}
.tab:active { transform: scale(0.93); }
.tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 6px 18px rgba(var(--acc-rgb), 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.tab.is-active .tab-ico { animation: tab-pop 0.38s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes tab-pop {
  0% { transform: scale(0.5); }
  55% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.tab-ico { width: 23px; height: 23px; }

/* базовые поверхности */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #fff;
}
.btn-ghost { background: rgba(255, 255, 255, 0.1); color: #fff; }
.chip {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #cfd0d3;
}
.chip:hover { border-color: var(--accent); color: #fff; }
.chip.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(var(--acc-rgb), 0.35);
}
.input {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}
.input::placeholder { color: rgba(255, 255, 255, 0.35); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--acc-rgb), 0.16); }
.field-cap { color: #fff; }
.field-hint { color: rgba(255, 255, 255, 0.5); }

/* вход */
.reg-logo { color: #fff; }
.reg-title { color: #fff; }
.reg-sub { color: rgba(255, 255, 255, 0.6); }

/* тост */
#toast {
  background: rgba(28, 20, 58, 0.96);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* инвентарь */
.inv-summary .val { color: #fff; }
.inv-summary .cap { color: rgba(255, 255, 255, 0.5); }
.inv-item {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.inv-item .nm { color: #fff; }
.inv-item .meta { color: rgba(255, 255, 255, 0.55); }
.inv-item .sub .pr { color: #fff; }
.inv-item .sub .x { color: rgba(255, 255, 255, 0.5); }
.inv-media { background: rgba(0, 0, 0, 0.4); }

/* статистика и строки */
.stat { background: rgba(255, 255, 255, 0.045); }
.stat .val { color: #fff; }
.stat .cap { color: rgba(255, 255, 255, 0.5); }
.rarest { background: rgba(228, 174, 57, 0.1); border-color: rgba(228, 174, 57, 0.35); }
.rarest .val, .rarest .cap { color: #E4AE39; }
.set-row { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.set-name { color: #fff; }
.set-desc { color: rgba(255, 255, 255, 0.5); }
.set-chev { color: rgba(255, 255, 255, 0.4); }
.load-slot:hover { background: rgba(255, 255, 255, 0.05); }
.load-slot:hover .set-chev { color: var(--accent); }
.set-ico { background: rgba(var(--acc-rgb), 0.16); color: var(--accent); }
.set-chips { background: rgba(255, 255, 255, 0.06); }
.set-divider { background: rgba(255, 255, 255, 0.08); }
.settings-title { color: #fff; }

/* кейс */
.case-title { color: #fff; }
.case-desc { color: rgba(255, 255, 255, 0.6); }
.case-cooldown { color: rgba(255, 255, 255, 0.6); }
.case-chip { background: rgba(0, 0, 0, 0.35); border-color: rgba(255, 255, 255, 0.09); }
.case-chip .nm { color: rgba(255, 255, 255, 0.65); }
.case-chip .pr { color: #fff; }
.case-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.case-stub { border-color: rgba(255, 255, 255, 0.25); color: rgba(255, 255, 255, 0.6); }
.rarity-badge {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.result-img { background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(255, 255, 255, 0.08); }
.result-meta { color: rgba(255, 255, 255, 0.55); }
.admin-cell {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.35);
}
.admin-media { background: rgba(0, 0, 0, 0.4); }
.admin-name { color: #fff; }

/* крафт / коды / топ / админка */
.craft-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.craft-title { color: #fff; }
.craft-desc { color: rgba(255, 255, 255, 0.55); }
.craft-hint { color: rgba(255, 255, 255, 0.45); }
.craft-pick { color: #fff; }
.craft-out { color: rgba(255, 255, 255, 0.55); }
.craft-item {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.09);
}
.craft-item:hover { border-color: var(--accent); }
.craft-item.is-pick {
  border-color: var(--accent);
  background: linear-gradient(93deg, rgba(var(--acc-rgb), 0.28), rgba(var(--acc-rgb), 0.45), rgba(var(--acc-rgb), 0.28));
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px rgba(var(--acc-rgb), 0.28);
}
.craft-info .n { color: #fff; }
.craft-info .p { color: rgba(255, 255, 255, 0.55); }
.code-row { background: rgba(0, 0, 0, 0.35); border-color: rgba(255, 255, 255, 0.09); color: #fff; }
.code-row code { background: rgba(255, 255, 255, 0.08); color: #fff; }
.code-status { color: rgba(255, 255, 255, 0.55); }
.top-row { border-bottom: 1px solid rgba(255, 255, 255, 0.08); color: #fff; }
.top-row.is-you { background: rgba(var(--acc-rgb), 0.16); }
.top-bal { color: #fff; }
.admin-stats .stat:last-child { grid-column: 1 / -1; }

/* ================= Настройки профиля ================= */
.p-flag { width: 22px; height: 16px; object-fit: cover; border-radius: 3px; vertical-align: -2px; margin-left: 4px; }
.tz-select { max-width: 190px; margin-left: auto; flex: 0 0 auto; }
.flag-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.flag-btn { width: 46px; height: 34px; border-radius: 8px; border: 2px solid transparent; background: rgba(255,255,255,.08); color: #fff; font-weight: 800; cursor: pointer; overflow: hidden; padding: 0; display: flex; align-items: center; justify-content: center; }
.flag-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flag-btn.is-active { border-color: var(--accent); }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.av-tile { position: relative; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: rgba(255,255,255,.06); }
.av-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-tile.is-active { border-color: var(--accent); }
.av-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.avatar .av-frame { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }

/* ================= Модалка выбора флага ================= */
.modal-ov { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal-ov[hidden] { display: none !important; }
.modal-panel { width: 100%; max-width: 480px; max-height: 70vh; overflow-y: auto; background: var(--panel); color: #fff; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.flag-pick { width: 100%; display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 10px 12px; color: #fff; cursor: pointer; font-size: 14px; }
.flag-pick img { width: 34px; height: 25px; object-fit: cover; border-radius: 4px; }
.flag-pick .flag-cur { width: 34px; height: 25px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; }
.flag-pick .set-ico { flex: 0 0 40px; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-row { width: 100%; display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.05); border: 1px solid transparent; border-radius: 12px; padding: 10px 12px; color: #fff; cursor: pointer; font-size: 14px; text-align: left; }
.pick-row.is-active { border-color: var(--accent); background: rgba(var(--acc-rgb),.14); }
.pick-row .pick-name { flex: 1; font-weight: 700; }
.pick-row .flag-cur { width: 34px; height: 25px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; }
.flag-pick-none { width: 34px; text-align: center; font-weight: 800; opacity: .6; }
.flag-pick-cap { flex: 1; text-align: left; }
.tos-box { max-height: 38vh; overflow-y: auto; text-align: left; margin: 0 0 14px; padding: 12px; background: rgba(0,0,0,.25); border-radius: 12px; font-size: 13px; line-height: 1.5; display: flex; flex-direction: column; gap: 10px; }
.tos-item { display: flex; gap: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 10px 12px; }
.tos-num { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-dark, #5B3DF5)); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tos-text b { display: block; margin-bottom: 2px; }
.tos-text p { margin: 0; opacity: .85; }
.count-pill { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-dark, #5B3DF5)); color: #fff; font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* ================= Таймер кулдауна кейса ================= */
.cd-timer { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px 14px; margin: 6px 0 12px; border-radius: 16px; background: rgba(var(--acc-rgb),.10); overflow: hidden; }
.cd-ring { position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent 0 70%, rgba(var(--acc-rgb),.55) 85%, rgba(196,176,255,.9) 100%); animation: cd-spin 4s linear infinite; }
.cd-timer::after { content: ""; position: absolute; inset: 2px; border-radius: 14px; background: #1D1544; }
.cd-cap, .cd-digits { position: relative; z-index: 1; }
.cd-cap { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: rgba(255,255,255,.65); }
.cd-digits { display: flex; align-items: baseline; gap: 4px; font-size: 44px; font-weight: 900; font-variant-numeric: tabular-nums; background: linear-gradient(180deg,#fff,#C4B0FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cd-digits.tick span { animation: cd-tick .45s ease; display: inline-block; }
.cd-sep { opacity: .6; animation: cd-blink 1s steps(2) infinite; }
@keyframes cd-spin { to { transform: rotate(360deg); } }
@keyframes cd-blink { 50% { opacity: .15; } }
@keyframes cd-tick { 0% { transform: translateY(-6px); opacity: .4; } 100% { transform: none; opacity: 1; } }
.verified { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #2E9BFF; color: #fff; font-size: 13px; font-weight: 800; vertical-align: 1px; margin-left: 2px; }
.verified-sm { width: 16px; height: 16px; font-size: 10px; }
.friend-av { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; }
.friend-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.friend-row .top-name { flex: 1; }
.freq-btns { display: flex; gap: 6px; margin-left: auto; }
.friend-actions { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.anim-btn { width: auto; height: auto; padding: 10px 14px; font-size: 13px; }

/* ================= Сворачивающиеся блоки настроек ================= */
.coll-head { width: 100%; display: flex; align-items: center; gap: 12px; background: none; border: none; color: #fff; padding: 12px 10px; cursor: pointer; text-align: left; font: inherit; border-radius: 12px; }
.coll-head .set-chev { transition: transform 0.2s ease; }
.coll-head.is-open .set-chev { transform: rotate(90deg); }
.coll-body.is-closed { display: none; }
.coll-body { padding-bottom: 4px; }
