:root {
  --bg: #0b0f17;
  --bg2: #111724;
  --card: #151c2b;
  --card2: #1b2436;
  --line: rgba(255, 255, 255, 0.07);
  --text: #eef2fb;
  --hint: #7d8aa5;
  --accent: #3d8bff;
  --accent2: #7b5cff;
  --accent-rgb: 61, 139, 255;
  --accent2-rgb: 123, 92, 255;
  --on-accent: #fff;
  --tab-on: #fff;
  --grad-primary: linear-gradient(135deg, var(--accent), #5b6dff);
  --ton: #0098ea;
  --ok: #2fd47c;
  --warn: #ffb547;
  --danger: #ff5c6c;
  --radius: 18px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(0.2, 0.9, 0.25, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.35 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; overflow-x: hidden;
}
body::before {
  content: ''; position: fixed; inset: -20% -20% auto; height: 70vh; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 50% at 30% 30%, rgba(var(--accent-rgb), 0.16), transparent 70%),
              radial-gradient(40% 40% at 80% 20%, rgba(var(--accent2-rgb), 0.14), transparent 70%);
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: var(--text); }
h1 { font-size: 26px; margin: 0; font-weight: 800; letter-spacing: -0.4px; }
h2 { font-size: 17px; margin: 0; font-weight: 700; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }
.hint { color: var(--hint); font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Іконки (маски) ---------- */
.ic { display: inline-block; width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; flex-shrink: 0; }
.ic-target { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 1.5v4M12 18.5v4M1.5 12h4M18.5 12h4'/%3E%3C/svg%3E"); }
.ic-grid { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='7' height='7' rx='2'/%3E%3Crect x='13.5' y='3.5' width='7' height='7' rx='2'/%3E%3Crect x='3.5' y='13.5' width='7' height='7' rx='2'/%3E%3Crect x='13.5' y='13.5' width='7' height='7' rx='2'/%3E%3C/svg%3E"); }
.ic-gift { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3.5' y='9' width='17' height='11.5' rx='2'/%3E%3Cpath d='M2.5 9h19M12 9v11.5M12 9C10 4.5 6 5 6.5 7.3 6.8 8.8 9.5 9 12 9M12 9c2-4.5 6-4 5.5-1.7-.3 1.5-3 1.7-5.5 1.7'/%3E%3C/svg%3E"); }
.ic-star { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.7 5.6 6.1.8-4.5 4.2 1.1 6.1L12 16.8l-5.4 2.9 1.1-6.1-4.5-4.2 6.1-.8z'/%3E%3C/svg%3E"); }
.ic-user { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8.5' r='4'/%3E%3Cpath d='M4 20.5c1.5-4 4.5-6 8-6s6.5 2 8 6'/%3E%3C/svg%3E"); }
.ic-back { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 5-7 7 7 7'/%3E%3C/svg%3E"); }
.ic-copy { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='12' height='12' rx='3'/%3E%3Cpath d='M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2'/%3E%3C/svg%3E"); }
.ic-search { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E"); }
.ic-plus { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.ic-check { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.ic-chevron { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 5 7 7-7 7'/%3E%3C/svg%3E"); }
.ic-bell { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15zM10 20.5a2.2 2.2 0 0 0 4 0'/%3E%3C/svg%3E"); }
.ic-wallet { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='6' width='18' height='14' rx='3'/%3E%3Cpath d='M3 10h18M16 15h2M6 6l9-3 2 3'/%3E%3C/svg%3E"); }
.ic-history { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3.5 12a8.5 8.5 0 1 0 2.5-6M3.5 4v4h4M12 7.5V12l3 2'/%3E%3C/svg%3E"); }
.ic-globe { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M3.5 12h17M12 3.5c-3 3.5-3 13.5 0 17M12 3.5c3 3.5 3 13.5 0 17'/%3E%3C/svg%3E"); }
.ic-help { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.7.3-1 1-1 1.7M12 16.5v.5'/%3E%3C/svg%3E"); }
.ic-users { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='8.5' r='3.5'/%3E%3Cpath d='M2.5 19.5c1-3.5 3.5-5 6.5-5s5.5 1.5 6.5 5M16 5a3.5 3.5 0 0 1 0 7M18 14.5c2 .6 3.2 2.2 3.5 5'/%3E%3C/svg%3E"); }
.ic-trash { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4.5 7h15M10 11v6M14 11v6M6.5 7l1 12.5h9L17.5 7M9.5 7V4.5h5V7'/%3E%3C/svg%3E"); }

.ton-ico {
  display: inline-block; width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%;
  background: var(--ton) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 56'%3E%3Cpath fill='%23fff' d='M37.6 15.6H18.4c-3.5 0-5.8 3.8-4 6.9l11.8 20.5c.8 1.3 2.7 1.3 3.5 0l11.8-20.5c1.8-3.1-.4-6.9-3.9-6.9zM26.3 36.9l-2.6-5-6.2-11.1c-.4-.7.1-1.6 1-1.6h7.8zm12.2-16.1-6.2 11.1-2.6 5V19.2h7.8c.9 0 1.4.9 1 1.6z'/%3E%3C/svg%3E") center/78% no-repeat;
}
.ton-ico.sm { width: 14px; height: 14px; }
.ton-ico.lg { width: 26px; height: 26px; }

/* ---------- Сплеш ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--bg); transition: opacity 0.4s ease, visibility 0.4s; }
.splash.gone { opacity: 0; visibility: hidden; }
.splash-title { font-weight: 800; font-size: 20px; letter-spacing: 0.3px; background: linear-gradient(90deg, #8ab8ff, #b49cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.orbit { position: relative; width: 96px; height: 96px; border-radius: 50%; border: 2px dashed rgba(138, 184, 255, 0.35); animation: spin 3s linear infinite; }
.planet { position: absolute; inset: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.6); animation: spin 3s linear infinite reverse; }
.sat { position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #ffd34d; box-shadow: 0 0 14px #ffd34d; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Верхня панель ---------- */
.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 16px; background: linear-gradient(var(--bg) 60%, transparent);
}
.me { display: flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.me-text small { color: var(--hint); font-size: 12px; font-weight: 600; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2)) center/cover; color: var(--on-accent);
}
.avatar.xl { width: 84px; height: 84px; font-size: 32px; box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.35); }
.balance-pill {
  display: flex; align-items: center; gap: 7px; padding: 6px 6px 6px 10px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-weight: 700; transition: transform 0.15s var(--spring);
}
.balance-pill:active { transform: scale(0.94); }
.balance-pill .plus { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 17px; line-height: 1; }

/* ---------- Основна область ---------- */
#view { padding: 4px 16px calc(var(--tabbar-h) + var(--safe-b) + 24px); max-width: 640px; margin: 0 auto; }
.screen-enter { animation: screenIn 0.35s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } }
.stagger > * { animation: itemIn 0.45s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes itemIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

.section-head { display: flex; justify-content: space-between; align-items: center; margin: 22px 2px 10px; }
.link { color: var(--accent); font-weight: 600; font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.list { display: flex; flex-direction: column; gap: 8px; }

/* Кнопки */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 18px; border-radius: 15px; font-weight: 700; font-size: 15px; width: 100%;
  transition: transform 0.15s var(--spring), opacity 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn-primary { background: var(--grad-primary); color: var(--on-accent); box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.3); }
.btn-ton { background: var(--ton); color: #fff; box-shadow: 0 8px 24px rgba(0, 152, 234, 0.3); }
.btn-soft { background: var(--card2); color: var(--text); }
.btn-stars { background: linear-gradient(135deg, #ffb547, #ff8a3d); color: #1d1206; box-shadow: 0 8px 24px rgba(255, 152, 61, 0.3); }
.btn .disc { margin-left: 2px; padding: 2px 7px; border-radius: 8px; background: rgba(255, 255, 255, 0.22); font-size: 12px; font-weight: 800; }
.btn-danger { background: rgba(255, 92, 108, 0.12); color: var(--danger); }
.btn-sm { height: 36px; border-radius: 11px; font-size: 13px; padding: 0 14px; width: auto; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255, 255, 255, 0.35); animation: ripple 0.6s ease-out; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* Перемикач */
.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; display: inline-block; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: #2a3448; transition: background 0.25s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); transition: transform 0.35s var(--spring); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- Радар снайпера ---------- */
.radar-card {
  position: relative; overflow: hidden; border-radius: 24px; padding: 18px; border: 1px solid rgba(var(--accent-rgb), 0.25);
  background: radial-gradient(120% 100% at 100% 0%, rgba(var(--accent2-rgb), 0.25), transparent 60%), linear-gradient(160deg, #15233f, #121a2b);
}
.radar-top { display: flex; align-items: center; gap: 14px; }
.radar {
  position: relative; width: 74px; height: 74px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.15) 0 22%, transparent 23% 44%, rgba(var(--accent-rgb), 0.12) 45% 46%, transparent 47% 68%, rgba(var(--accent-rgb), 0.12) 69% 70%, transparent 71%);
  border: 1.5px solid rgba(var(--accent-rgb), 0.4);
}
.radar::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(var(--accent-rgb), 0.55), transparent 28%); opacity: 0; }
.radar .dot { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #7fffb5; box-shadow: 0 0 8px #7fffb5; opacity: 0; }
.radar .d1 { top: 22%; left: 60%; } .radar .d2 { top: 62%; left: 24%; } .radar .d3 { top: 70%; left: 66%; }
.radar-card.on .radar::before { opacity: 1; animation: spin 2.2s linear infinite; }
.radar-card.on .radar .dot { animation: blip 2.2s ease-in-out infinite; }
.radar-card.on .radar .d2 { animation-delay: 0.7s; } .radar-card.on .radar .d3 { animation-delay: 1.4s; }
@keyframes blip { 0%, 100% { opacity: 0; transform: scale(0.5); } 15% { opacity: 1; transform: scale(1.2); } 50% { opacity: 0.2; } }
.radar-title { font-size: 18px; font-weight: 800; }
.radar-sub { font-size: 13px; color: var(--hint); margin-top: 2px; }
.radar-card.on .radar-sub { color: var(--ok); }
.radar-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.rstat { background: rgba(255, 255, 255, 0.05); border-radius: 14px; padding: 10px; text-align: center; }
.rstat b { display: block; font-size: 18px; }
.rstat span { font-size: 11px; color: var(--hint); }
.warn-box { margin-top: 12px; padding: 10px 12px; border-radius: 12px; font-size: 13px; background: rgba(255, 181, 71, 0.12); color: #ffd28c; display: flex; gap: 8px; align-items: flex-start; }
.warn-box button { color: #fff; font-weight: 700; text-decoration: underline; }

/* ---------- Подарункова картка (фон-градієнт як у Telegram) ---------- */
.giftbg { position: relative; overflow: hidden; border-radius: 16px; display: grid; place-items: center; background: radial-gradient(circle at 50% 45%, var(--c1, #2a3a5c), var(--c2, #141c2c) 75%); }
.giftbg img, .giftbg .lot { width: 82%; height: 82%; object-fit: contain; position: relative; z-index: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35)); }
.giftbg .lot svg { width: 100% !important; height: 100% !important; }
.giftbg.pending img { opacity: 0; }
.giftbg img { transition: opacity 0.3s; }

/* Фільтр */
.filter {
  display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); transition: transform 0.15s var(--spring), opacity 0.25s;
}
.filter:active { transform: scale(0.985); }
.filter.off { opacity: 0.5; }
.filter .giftbg { width: 64px; height: 64px; flex-shrink: 0; }
.filter-title { font-weight: 700; font-size: 15px; }
.chips-mini { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cm { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 8px; font-size: 11.5px; font-weight: 600; background: rgba(255, 255, 255, 0.06); color: #c6d0e4; white-space: nowrap; }
.cm.price { background: rgba(0, 152, 234, 0.14); color: #63c6ff; }
.cm.notify { background: rgba(255, 181, 71, 0.14); color: var(--warn); }
.cm .dot { width: 9px; height: 9px; border-radius: 50%; }
.mk-row { display: flex; gap: 3px; }
.mk { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: #fff; }
.mk-telegram { background: linear-gradient(135deg, #37aee2, #1e96c8); }
.mk-portals { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.mk-mrkt { background: linear-gradient(135deg, #22c55e, #15803d); }
.mk-tonnel { background: linear-gradient(135deg, #f59e0b, #d97706); }
.add-filter { border: 1.5px dashed rgba(var(--accent-rgb), 0.4); background: rgba(var(--accent-rgb), 0.06); color: var(--accent); justify-content: center; font-weight: 700; padding: 16px; border-radius: var(--radius); display: flex; gap: 8px; align-items: center; transition: transform 0.15s var(--spring); }
.add-filter:active { transform: scale(0.98); }
.add-filter.locked { color: var(--hint); border-color: var(--line); background: transparent; }

/* Стрічка знахідок */
.hscroll { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; }
.hscroll::-webkit-scrollbar { display: none; }
.find { width: 136px; flex-shrink: 0; scroll-snap-align: start; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 9px; min-width: 0; }
.find .giftbg { width: 100%; aspect-ratio: 1; height: auto; border-radius: 12px; }
.find-name { font-weight: 700; font-size: 13px; margin: 7px 3px 3px; }
.find .price { padding: 0 3px; }
.find .hint { font-size: 12px; margin-top: 2px; padding: 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty { text-align: center; color: var(--hint); padding: 26px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.empty .lot-wrap { width: 110px; height: 110px; margin: 0 auto 8px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ---------- Маркет ---------- */
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; height: 44px; color: var(--hint); }
.search input { flex: 1; border: 0; background: none; outline: none; height: 100%; min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 8px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); white-space: nowrap; font-size: 13px; font-weight: 600; color: #c6d0e4; transition: all 0.2s; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 520px) { .col-grid { grid-template-columns: repeat(3, 1fr); } }
.col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 8px 10px; text-align: left; transition: transform 0.15s var(--spring); }
.col:active { transform: scale(0.97); }
.col .giftbg { aspect-ratio: 1; width: 100%; }
.col-name { font-weight: 700; font-size: 14px; margin: 8px 2px 4px; }
.col-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 0 2px; }
.price { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 14px; }
.badge-new { position: absolute; top: 8px; left: 8px; z-index: 2; font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 7px; background: var(--danger); color: #fff; }
.skel { background: linear-gradient(90deg, var(--card) 0%, var(--card2) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Сторінки (оверлеї) ---------- */
.page {
  position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow-y: auto; overscroll-behavior: contain;
  animation: pageIn 0.38s var(--ease) both; padding-bottom: calc(var(--safe-b) + 24px);
}
.page.leaving { animation: pageOut 0.28s ease both; }
@keyframes pageIn { from { transform: translateX(100%); } }
@keyframes pageOut { to { transform: translateX(100%); } }
.page-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px; background: rgba(11, 15, 23, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.page-head h2 { flex: 1; font-size: 18px; }
.back { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--card); }
.page-body { padding: 14px 16px; max-width: 640px; margin: 0 auto; }
.sticky-bottom { position: sticky; bottom: 0; z-index: 5; padding: 12px 16px calc(12px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 35%); max-width: 640px; margin: 0 auto; }

/* Колекція */
.hero { display: grid; place-items: center; margin: 4px 0 16px; }
.hero .giftbg { width: 200px; height: 200px; border-radius: 28px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4); animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.stat span { display: block; font-size: 11px; color: var(--hint); margin-bottom: 3px; }
.stat b { font-size: 15px; display: inline-flex; align-items: center; gap: 4px; }
.chg { font-size: 11px; font-weight: 700; }
.chg.up { color: #3ddc84; }
.chg.down { color: #ff6b6b; }
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; position: relative; }
.seg button { flex: 1; padding: 9px 4px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--hint); position: relative; z-index: 1; transition: color 0.25s; }
.seg button.active { color: var(--on-accent); }
.seg .seg-ind { position: absolute; top: 4px; bottom: 4px; border-radius: 10px; background: var(--accent); transition: left 0.35s var(--spring), width 0.35s var(--spring); }
.attr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.attr { position: relative; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 6px 6px 8px; text-align: center; transition: transform 0.15s var(--spring), border-color 0.2s, background 0.2s; }
.attr:active { transform: scale(0.96); }
.attr.sel { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }
.attr.sel::after { content: ''; position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center/14px no-repeat; z-index: 3; animation: pop 0.3s var(--spring); }
@keyframes pop { from { transform: scale(0); } }
.attr .giftbg { aspect-ratio: 1; width: 100%; border-radius: 12px; }
.attr .swatch { aspect-ratio: 1; width: 100%; border-radius: 12px; }
.attr .sym { aspect-ratio: 1; width: 100%; border-radius: 12px; display: grid; place-items: center; background: var(--card2); }
.attr .sym img { width: 56%; height: 56%; filter: invert(1) opacity(0.85); }
.attr-name { font-size: 12px; font-weight: 700; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attr-meta { font-size: 11px; color: var(--hint); display: flex; justify-content: center; gap: 6px; margin-top: 2px; }
.attr-meta .fl { color: #63c6ff; font-weight: 700; }

/* Редактор фільтра */
.field { margin-top: 18px; }
.field-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 700; color: var(--hint); text-transform: uppercase; letter-spacing: 0.4px; margin: 0 4px 8px; }
.field-label small { text-transform: none; letter-spacing: 0; font-weight: 600; }
.picker-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 58px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-align: left; transition: transform 0.15s var(--spring); }
.picker-btn:active { transform: scale(0.985); }
.picker-btn:disabled { opacity: 0.4; }
.picker-btn .ic-chevron { color: var(--hint); width: 18px; height: 18px; }
.thumbs { display: flex; }
.thumbs > * { width: 36px; height: 36px; border-radius: 10px; margin-right: -8px; border: 2px solid var(--card); flex-shrink: 0; }
.thumbs .giftbg img { width: 90%; height: 90%; }
.inp { width: 100%; height: 50px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); padding: 0 14px; outline: none; transition: border-color 0.2s; }
.inp:focus { border-color: var(--accent); }
.inp-wrap { position: relative; }
.inp-wrap .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 5px; color: var(--hint); font-weight: 700; pointer-events: none; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range { width: 100%; accent-color: var(--accent); margin: 10px 0 0; }
.range-val { font-size: 28px; font-weight: 800; text-align: center; }
.mk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mk-tile { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); font-weight: 700; transition: all 0.2s; }
.mk-tile .mk { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
.mk-tile.sel { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }
.mk-tile .chk { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #3a4560; transition: all 0.2s var(--spring); }
.mk-tile.sel .chk { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center/13px no-repeat; }
.stepper { display: flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; height: 50px; }
.stepper button { width: 54px; height: 100%; font-size: 22px; color: var(--accent); font-weight: 700; }
.stepper input { flex: 1; text-align: center; border: 0; background: transparent; outline: none; font-weight: 800; font-size: 17px; min-width: 0; }
.cell-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 14px; }
.cell { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); min-height: 54px; }
.cell:last-child { border-bottom: 0; }
.cell .ic { color: var(--hint); width: 22px; height: 22px; }
.lang-cur { color: var(--hint); font-weight: 600; font-size: 14px; }
.lang-list { display: flex; flex-direction: column; gap: 8px; }
.lang-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px; background: var(--card2); border: 1.5px solid transparent; text-align: left; transition: border-color 0.2s, background 0.2s, transform 0.15s var(--spring); }
.lang-opt:active { transform: scale(0.98); }
.lang-opt b { font-size: 15px; }
.lang-code { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: 0.5px; background: var(--card); color: var(--hint); transition: background 0.2s, color 0.2s; }
.lang-check { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); transform: scale(0); transition: transform 0.25s var(--spring); }
.lang-check .ic { width: 14px; height: 14px; }
.lang-opt.sel { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.lang-opt.sel .lang-code { background: var(--accent); color: var(--on-accent); }
.lang-opt.sel .lang-check { transform: scale(1); }
.sel-bar { position: sticky; top: 63px; z-index: 4; display: flex; gap: 8px; align-items: center; padding: 8px 0; background: var(--bg); }

/* ---------- Інвентар ---------- */
.inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.inv .giftbg { aspect-ratio: 1; width: 100%; }
.inv-name { font-size: 12px; font-weight: 700; margin-top: 5px; }

/* ---------- Завдання ---------- */
.level-card { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: 24px; background: linear-gradient(135deg, #2b2357, #182544); border: 1px solid rgba(var(--accent2-rgb), 0.3); }
.ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: conic-gradient(#b49cff calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0); transition: --p 1s; position: relative; }
.ring::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: #1f2448; }
.ring b { position: relative; font-size: 26px; font-weight: 800; }
.xpbar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 8px; }
.xpbar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #7b5cff, #b49cff); width: 0; transition: width 1s var(--ease); }
.task { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.task-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: var(--card2); flex-shrink: 0; }
.task.done { opacity: 0.6; }
.rewards { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.rw { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 7px; background: rgba(var(--accent2-rgb), 0.16); color: #c4b5ff; }
.rw.slot { background: rgba(47, 212, 124, 0.14); color: #7ff0b0; }
.done-mark { width: 32px; height: 32px; border-radius: 50%; background: rgba(47, 212, 124, 0.15); color: var(--ok); display: grid; place-items: center; }
.done-mark .ic { width: 18px; height: 18px; }
.ref-card { padding: 16px; border-radius: 22px; background: linear-gradient(135deg, #0f3b5a, #142744); border: 1px solid rgba(0, 152, 234, 0.3); }
.ref-link { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); font-size: 13px; }
.ref-sub { color: #9fd8ff; }
.ref-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9fd8ff; }

/* ---------- Профіль / баланс ---------- */
.profile-head { text-align: center; padding: 8px 0 4px; }
.profile-head .avatar { margin: 0 auto 10px; }
.profile-name { font-size: 22px; font-weight: 800; }
.bal-card { margin-top: 16px; padding: 18px; border-radius: 24px; background: radial-gradient(120% 120% at 0% 0%, #1d6fd6, #1546a8 50%, #2a2a8f); box-shadow: 0 16px 40px rgba(29, 111, 214, 0.3); position: relative; overflow: hidden; }
.bal-card::after { content: ''; position: absolute; width: 180px; height: 180px; right: -50px; top: -60px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); }
.bal-label { font-size: 13px; color: rgba(255, 255, 255, 0.75); }
.bal-val { display: flex; align-items: center; gap: 8px; font-size: 34px; font-weight: 800; margin-top: 4px; }
.bal-usd { font-size: 13px; color: rgba(255, 255, 255, 0.7); }
.bal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; position: relative; z-index: 1; }
.btn-white { background: #fff; color: #1546a8; }
.btn-glass { background: rgba(255, 255, 255, 0.16); color: #fff; }
.h-item { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.h-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: var(--card2); flex-shrink: 0; }
.amount { font-weight: 800; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.amount.plus { color: var(--ok); }
.status { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.st-pending { background: rgba(255, 181, 71, 0.15); color: var(--warn); }
.st-done { background: rgba(47, 212, 124, 0.15); color: var(--ok); }
.st-rejected { background: rgba(255, 92, 108, 0.15); color: var(--danger); }

/* Поповнення */
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.amount-grid button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px 0; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); font-weight: 800; transition: all 0.2s var(--spring); }
.amount-grid button.active { border-color: var(--ton); background: rgba(0, 152, 234, 0.12); transform: scale(1.03); }
.copy-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.copy-row .v { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; }
.copy-row button { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--card2); color: var(--accent); flex-shrink: 0; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--hint); font-size: 12px; font-weight: 700; margin: 22px 0 6px; text-transform: uppercase; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.note { padding: 12px; border-radius: 14px; font-size: 13px; background: rgba(var(--accent-rgb), 0.1); color: #b5d0ff; margin-top: 12px; }
.note.warn { background: rgba(255, 181, 71, 0.12); color: #ffd28c; }
.waiting { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: rgba(0, 152, 234, 0.1); margin-top: 14px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--ton); animation: spin 0.8s linear infinite; flex-shrink: 0; }
.kv { display: flex; justify-content: space-between; padding: 6px 2px; font-size: 14px; }
.kv span { color: var(--hint); }

/* ---------- Таббар ---------- */
.tabbar {
  position: fixed; left: 10px; right: 10px; bottom: calc(8px + var(--safe-b)); z-index: 20; height: var(--tabbar-h);
  display: flex; border-radius: 22px; background: rgba(21, 28, 43, 0.86); border: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); max-width: 620px; margin: 0 auto;
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--hint); font-size: 10.5px; font-weight: 600; position: relative; z-index: 1; transition: color 0.25s; }
.tab .ic { width: 23px; height: 23px; transition: transform 0.35s var(--spring); }
.tab.active { color: var(--tab-on); }
.tab.active .ic { transform: translateY(-1px) scale(1.08); }
.tab-indicator { position: absolute; top: 7px; bottom: 7px; border-radius: 16px; background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.35), rgba(var(--accent2-rgb), 0.35)); transition: left 0.4s var(--spring), width 0.4s var(--spring); }

/* ---------- Bottom sheet ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); animation: fadeIn 0.25s ease; }
.backdrop.leaving { animation: fadeOut 0.25s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 90vh; overflow-y: auto; background: var(--bg2); border-radius: 24px 24px 0 0; padding: 10px 16px calc(20px + var(--safe-b)); max-width: 640px; margin: 0 auto; animation: sheetIn 0.4s var(--ease) both; border-top: 1px solid var(--line); }
.sheet.leaving { animation: sheetOut 0.25s ease both; }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: #2f3a52; margin: 0 auto 14px; }
.sheet h2 { text-align: center; font-size: 20px; }
.sheet .lead { text-align: center; color: var(--hint); font-size: 14px; margin: 6px 0 16px; }

.toast {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 90; transform: translate(-50%, -150%);
  background: rgba(30, 38, 56, 0.97); border: 1px solid var(--line); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 600;
  max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); transition: transform 0.4s var(--spring); pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.count-up { display: inline-block; }
.credit { text-align: center; font-size: 11px; color: #4d5870; margin-top: 20px; }
.credit a { color: inherit; }

/* Вартість інвентаря */
.pf-card { padding: 16px; border-radius: 22px; background: radial-gradient(120% 120% at 0% 0%, #2b3f8f, #1c2560 55%, #241a55); border: 1px solid var(--line); }
.pf-value { display: flex; align-items: center; gap: 8px; font-size: 30px; font-weight: 800; margin-top: 4px; }
.pf-value .chg { font-size: 13px; }
.pf-row { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; color: var(--hint); }
.pf-row span { display: inline-flex; align-items: center; gap: 4px; }
.pf-row .up { color: #3ddc84; font-weight: 700; }
.pf-row .down { color: #ff6b6b; font-weight: 700; }
.inv.gone { opacity: 0.5; }

/* Таблиця лідерів */
.lb-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.lb-row.me { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.lb-rank { width: 28px; text-align: center; font-weight: 800; color: var(--hint); font-size: 15px; }
.avatar.sm { width: 36px; height: 36px; font-size: 15px; flex-shrink: 0; }

/* Промокоди */
.src-badge { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; color: #ffd28c; background: rgba(255, 181, 71, 0.14); border: 1px solid rgba(255, 181, 71, 0.3); }
.promo-inp { text-align: center; font-size: 20px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.promo-inp::placeholder { letter-spacing: 0; font-weight: 600; font-size: 15px; text-transform: none; }
.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.promo-ok { text-align: center; }
.promo-burst { font-size: 64px; animation: burst 0.6s var(--spring) both; }
@keyframes burst { from { transform: scale(0.3) rotate(-20deg); opacity: 0; } }
.promo-rw { padding: 12px 14px; border-radius: 14px; background: var(--card2); font-weight: 700; text-align: left; }
.btn s.old { opacity: 0.6; font-weight: 600; }

/* ---------- Маркет → Продажі ---------- */
.m-mode { margin-bottom: 12px; }
.sx-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sx-pick { position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 56px; padding: 8px 9px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); text-align: left; transition: transform 0.15s var(--spring), border-color 0.2s, background 0.2s; }
.sx-pick:active { transform: scale(0.97); }
.sx-pick.on { border-color: rgba(var(--accent-rgb), 0.7); background: rgba(var(--accent-rgb), 0.1); }
.sx-pick.off { opacity: 0.45; }
.sx-thumb { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; font-size: 20px; background: var(--card2); overflow: hidden; }
.sx-thumb .giftbg { width: 100%; height: 100%; border-radius: 10px; }
.sx-thumb .giftbg img { width: 90%; height: 90%; }
.sx-sw { display: block; width: 100%; height: 100%; }
.sx-sym { width: 68%; filter: invert(1); }
.sx-txt { flex: 1; min-width: 0; }
.sx-txt small { display: block; font-size: 11px; color: var(--hint); }
.sx-txt b { display: block; font-size: 14px; }
.sx-x { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 10px; color: var(--hint); background: rgba(255, 255, 255, 0.08); }
.chip-sep { width: 1px; flex-shrink: 0; margin: 6px 2px; background: var(--line); }
.chip-mk { display: inline-flex; align-items: center; gap: 6px; }
.chip-mk .mk { width: 16px; height: 16px; border-radius: 5px; font-size: 8px; }
.sx-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.sx-stats > :nth-child(-n+3) { grid-column: span 2; }
.sx-stats > :nth-child(n+4) { grid-column: span 3; }
.sx-stats .stat b { font-size: 14px; white-space: nowrap; }
.sx-head { margin-top: 18px; gap: 8px; flex-wrap: wrap; }
.sx-sort { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.sx-sort button { padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--hint); transition: all 0.2s; }
.sx-sort button.active { background: var(--accent); color: var(--on-accent); }
.sale-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-align: left; transition: transform 0.15s var(--spring); }
.sale-row:active { transform: scale(0.985); }
.sale-row .giftbg { width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0; }
.sale-main { flex: 1; min-width: 0; }
.sale-title { font-weight: 700; font-size: 14px; }
.sale-title span { color: var(--hint); font-weight: 600; }
.sale-attrs { font-size: 12px; color: var(--hint); margin-top: 3px; }
.sale-side { flex-shrink: 0; text-align: right; }
.sale-side .hint { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: 12px; margin-top: 4px; }
.sale-side .mk { width: 15px; height: 15px; border-radius: 5px; font-size: 8px; }
.sx-more { min-height: 1px; display: flex; justify-content: center; padding: 10px 0; }

/* ---------- Тема «Золото» (під аватарку Gift Snipr) ---------- */
:root[data-theme="gold"] {
  --bg: #0c0a07;
  --bg2: #15110b;
  --card: #1a150e;
  --card2: #241d13;
  --line: rgba(255, 214, 140, 0.09);
  --text: #f7efe0;
  --hint: #a08f72;
  --accent: #e9b450;
  --accent2: #b57a22;
  --accent-rgb: 233, 180, 80;
  --accent2-rgb: 181, 122, 34;
  --on-accent: #1a1206;
  --tab-on: #ffe2a0;
  --gold-hi: #ffe7a8;
  --grad-primary: linear-gradient(135deg, #ffe7a8, #e9b450 45%, #b57a22);
}
:root[data-theme="gold"] body::before {
  background: radial-gradient(50% 50% at 30% 30%, rgba(233, 180, 80, 0.13), transparent 70%),
              radial-gradient(40% 40% at 80% 20%, rgba(181, 122, 34, 0.12), transparent 70%);
}
:root[data-theme="gold"] .splash-title { background-image: linear-gradient(90deg, #ffe7a8, #e9b450); }
:root[data-theme="gold"] .orbit { border-color: rgba(233, 180, 80, 0.4); }
:root[data-theme="gold"] .sat { background: #ff5c4a; box-shadow: 0 0 14px #ff5c4a; }
:root[data-theme="gold"] .btn-primary { box-shadow: 0 8px 24px rgba(233, 180, 80, 0.25); }
:root[data-theme="gold"] .switch span { background: #3a3020; }
:root[data-theme="gold"] .switch input:checked + span { background: var(--grad-primary); }
:root[data-theme="gold"] .chip, :root[data-theme="gold"] .cm { color: #dccdb0; }
:root[data-theme="gold"] .cm { background: rgba(255, 220, 160, 0.07); }
:root[data-theme="gold"] .radar-card {
  border-color: rgba(233, 180, 80, 0.28);
  background: radial-gradient(120% 100% at 100% 0%, rgba(233, 180, 80, 0.16), transparent 60%), linear-gradient(160deg, #2a2113, #15110b);
}
:root[data-theme="gold"] .attr.sel::after { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1206' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center/14px no-repeat; }
:root[data-theme="gold"] .mk-tile.sel .chk { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1206' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center/13px no-repeat; }
:root[data-theme="gold"] .level-card { background: linear-gradient(135deg, #3a2c14, #1a150e); border-color: rgba(233, 180, 80, 0.3); }
:root[data-theme="gold"] .ring { background: conic-gradient(#e9b450 calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0); }
:root[data-theme="gold"] .ring::before { background: #2a2113; }
:root[data-theme="gold"] .xpbar i { background: linear-gradient(90deg, #b57a22, #ffe7a8); }
:root[data-theme="gold"] .rw { background: rgba(233, 180, 80, 0.14); color: #f3cf86; }
:root[data-theme="gold"] .ref-card { background: linear-gradient(135deg, #33270f, #1a150e); border-color: rgba(233, 180, 80, 0.3); }
:root[data-theme="gold"] .ref-link span, :root[data-theme="gold"] .ref-sub { color: #f3cf86; }
:root[data-theme="gold"] .ref-card .btn-ton { background: var(--grad-primary); color: var(--on-accent); box-shadow: 0 8px 24px rgba(233, 180, 80, 0.25); }
:root[data-theme="gold"] .bal-card { background: radial-gradient(120% 120% at 0% 0%, #ffe7a8, #e9b450 45%, #a86f1c); box-shadow: 0 16px 40px rgba(233, 180, 80, 0.22); color: #1a1206; }
:root[data-theme="gold"] .bal-card::after { background: rgba(255, 255, 255, 0.18); }
:root[data-theme="gold"] .bal-label, :root[data-theme="gold"] .bal-usd { color: rgba(26, 18, 6, 0.7); }
:root[data-theme="gold"] .btn-white { background: #16110a; color: #ffe2a0; }
:root[data-theme="gold"] .btn-glass { background: rgba(26, 18, 6, 0.14); color: #1a1206; }
:root[data-theme="gold"] .note { color: #f3d8a2; }
:root[data-theme="gold"] .tabbar { background: rgba(26, 21, 14, 0.88); }
:root[data-theme="gold"] .tab-indicator { background: linear-gradient(135deg, rgba(233, 180, 80, 0.3), rgba(181, 122, 34, 0.3)); }
:root[data-theme="gold"] .sheet-handle { background: #3d3222; }
:root[data-theme="gold"] .toast { background: rgba(38, 31, 20, 0.97); }

/* ---------- Вибір теми ---------- */
.theme-sw { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; position: relative; overflow: hidden; }
.theme-sw::after { content: ''; position: absolute; inset: 11px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.85); }
.theme-sw.classic { background: linear-gradient(135deg, #3d8bff, #7b5cff); }
.theme-sw.gold { background: linear-gradient(135deg, #ffe7a8, #e9b450 50%, #b57a22); }
.theme-sw.gold::after { border-color: #16110a; }
.theme-dot { width: 18px; height: 18px; border-radius: 6px; flex-shrink: 0; }
.theme-cur { display: flex; align-items: center; gap: 7px; }
.theme-cur .theme-dot::after { display: none; }
.ic-palette { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3.5a8.5 8.5 0 0 0 0 17c1.4 0 2-.8 2-1.8 0-1.4-1.3-1.7-1.3-3 0-1 .8-1.7 1.8-1.7h2.3a4 4 0 0 0 3.7-4C20.5 6.4 16.7 3.5 12 3.5z'/%3E%3Ccircle cx='7.8' cy='11' r='1.1'/%3E%3Ccircle cx='10.5' cy='7.3' r='1.1'/%3E%3Ccircle cx='15' cy='7.6' r='1.1'/%3E%3C/svg%3E"); }

/* ---------- RTL (арабська) ---------- */
[dir="rtl"] .me, [dir="rtl"] .col, [dir="rtl"] .promo-rw, [dir="rtl"] .sx-pick, [dir="rtl"] .sale-row, [dir="rtl"] .lang-opt, [dir="rtl"] .picker-btn,
[dir="rtl"] [style*="text-align:left"] { text-align: right !important; }
[dir="rtl"] .sale-side { text-align: left; }
[dir="rtl"] .sale-side .hint { justify-content: flex-start; }
[dir="rtl"] .sale-row { padding: 8px 8px 8px 12px; }
[dir="rtl"] .ic-chevron, [dir="rtl"] .ic-back { transform: scaleX(-1); }
[dir="rtl"] .switch { direction: ltr; }
[dir="rtl"] .badge-new { left: auto; right: 8px; }
[dir="rtl"] .attr.sel::after { right: auto; left: 8px; }
[dir="rtl"] .inp-wrap .suffix { right: auto; left: 14px; }
[dir="rtl"] .thumbs > * { margin-right: 0; margin-left: -8px; }
[dir="rtl"] .mk-tile .chk { margin-left: 0; margin-right: auto; }
[dir="rtl"] .btn .disc { margin-left: 0; margin-right: 2px; }
[dir="rtl"] .bal-card::after { right: auto; left: -50px; }
[dir="rtl"] .ref-link span, [dir="rtl"] .copy-row span, [dir="rtl"] .inp[inputmode], [dir="rtl"] .addr { direction: ltr; text-align: right; }

/* ---------- Питання й відповіді ---------- */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: border-color 0.2s; }
.faq-item.open { border-color: rgba(var(--accent-rgb), 0.45); }
.faq-q { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px; text-align: start; font-weight: 700; font-size: 15px; }
.faq-q .ic { width: 18px; height: 18px; color: var(--hint); transform: rotate(90deg); transition: transform 0.3s var(--spring); }
.faq-item.open .faq-q .ic { transform: rotate(-90deg); color: var(--accent); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s var(--ease); }
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a-in { overflow: hidden; padding: 0 14px; color: #c6d0e4; font-size: 14px; line-height: 1.5; }
.faq-item.open .faq-a-in { padding-bottom: 14px; }
:root[data-theme="gold"] .faq-a-in { color: #dccdb0; }
[dir="rtl"] .faq-q .ic { transform: rotate(90deg); }
