/* ============ Real Miner — стили ============ */

:root {
  --bg: #0e0b09;
  --card: rgba(38, 30, 24, 0.78);
  --card-2: rgba(62, 49, 38, 0.62);
  --border: rgba(255, 190, 120, 0.12);
  --text: #f4ede5;
  --muted: #a8998a;
  --accent: #f5a524;
  --accent-2: #ff7a1a;
  --gem: #ff4fa8; /* GEM — розовый, как иконка */
  --xp: #3ee0c1;  /* опыт — зелёно-бирюзовый */
  --gram: #2aabee; /* цвет TON — всё, что связано с GRAM */
  --danger: #ff5d5d;
  --ok: #7be38a;
  --nav-h: 78px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rubik', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

#app {
  position: relative;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(110% 55% at 50% -5%, rgba(245, 165, 36, 0.16), transparent 60%),
    radial-gradient(70% 45% at 0% 100%, rgba(62, 224, 193, 0.06), transparent 60%),
    radial-gradient(70% 45% at 100% 70%, rgba(255, 122, 26, 0.07), transparent 60%),
    linear-gradient(180deg, #19130f 0%, #0c0a08 100%);
}

.page {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
.page::-webkit-scrollbar { display: none; }

/* ---------- Заголовки ---------- */

.game-title {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  margin: 2px 0 14px;
  background: linear-gradient(180deg, #ffe2a8, var(--accent) 60%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(245, 165, 36, 0.25);
}

.title-row { position: relative; }
.test-btn {
  position: absolute; right: 0; top: 0;
  height: 32px; padding: 0 10px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--border);
  font-size: 13px; color: var(--muted);
}

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2px 0 14px;
}
.page-title { font-size: 24px; font-weight: 700; }
.page-title.center { text-align: center; margin: 2px 0 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 99px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
}
.pill .ph { width: 20px; height: 20px; border-radius: 50%; border-width: 1px; font-size: 0; }

/* ---------- Карточки ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }

.bal { display: flex; align-items: center; gap: 10px; padding: 12px; min-width: 0; }
.bal .ph { width: 42px; height: 42px; flex: none; border-radius: 50%; font-size: 9px; }
.bal-text { flex: 1; min-width: 0; }
.bal-amount { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.bal-cur { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; line-height: 1.35; }
/* «≈ X GRAM» не рвём посередине: если не помещается — целиком переносится под «GEM» */
.bal-sub { color: var(--gram); display: inline-block; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
@media (max-width: 360px) {
  .grid2 { gap: 8px; }
  .bal { gap: 7px; padding: 10px 8px; }
  .bal .ph, .bal .gram-ico { width: 32px !important; height: 32px !important; }
  .bal-amount { font-size: 17px; }
  .bal-cur { font-size: 11px; }
}

.lvl-card .lvl-label { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.lvl-card .lvl-value { font-size: 13px; color: var(--accent); margin-top: 7px; font-variant-numeric: tabular-nums; }

.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 10px rgba(245, 165, 36, 0.6);
  transition: width 0.4s ease;
}
.bar.xp > i { background: linear-gradient(90deg, #1fb89c, var(--xp)); box-shadow: 0 0 10px rgba(62, 224, 193, 0.5); }

.info-card { margin-bottom: 12px; font-size: 15px; line-height: 1.45; }
.info-card b { font-weight: 600; }

.c-accent { color: var(--accent); }
.c-gem { color: var(--gem); }
.c-xp { color: var(--xp); }
.c-gram { color: var(--gram); }
.c-muted { color: var(--muted); }

/* ---------- Картинки-заглушки ---------- */

.ph {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border-radius: 14px;
  border: 1.5px dashed rgba(245, 165, 36, 0.35);
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 8px, transparent 8px 16px);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.25;
  padding: 4px;
}
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph.has-img { border: 0; background: none; padding: 0; }
.ph.has-img .ph-label { display: none; }
.ph.contain img { object-fit: contain; }

/* ---------- Шахтёр ---------- */

.miner-frame {
  position: relative;
  width: min(74%, 290px);
  aspect-ratio: 1;
  margin: 6px auto 16px;
  border-radius: 22px;
  border: 1.5px solid rgba(245, 165, 36, 0.55);
  box-shadow: 0 0 32px rgba(245, 165, 36, 0.28), inset 0 0 28px rgba(245, 165, 36, 0.12);
  background: rgba(20, 15, 12, 0.6);
}
.miner-frame .ph { position: absolute; inset: 0; border: 0; border-radius: 22px; font-size: 14px; }
.miner-frame.locked { border-style: dashed; border-color: rgba(245, 165, 36, 0.35); box-shadow: none; }
.miner-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--muted); font-size: 16px; font-weight: 600;
}
.miner-empty svg { width: 44px; height: 44px; opacity: 0.5; }
.miner-badge {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  z-index: 2;
  padding: 5px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: rgba(14, 11, 9, 0.8); border: 1px solid var(--border);
}
.miner-badge.away { color: var(--accent); }
.miner-badge.back { color: var(--ok); }
.miner-badge.locked { color: var(--muted); }

/* ---------- Кнопки ---------- */

.btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 52px;
  border-radius: 14px;
  font-size: 16px; font-weight: 600;
  overflow: hidden;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-accent { background: linear-gradient(180deg, #ffbd45, var(--accent) 55%, #e58d0c); color: #2a1702; }
.btn-light { background: #f6efe6; color: #1c140e; }
.btn-gram { background: linear-gradient(180deg, #5cc8ff, #0098ea); color: #fff; }
.btn-free { background: linear-gradient(180deg, #8ff09c, #3fcf5a); color: #06240c; }
.btn-gem { background: linear-gradient(180deg, #6ff0d6, var(--gem)); color: #062a24; }
.btn-ghost { background: var(--card-2); border: 1px solid var(--border); color: var(--text); }
.btn[disabled], .btn.is-disabled { filter: grayscale(0.6) brightness(0.6); }
.btn-timer {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  cursor: default;
}
.btn-timer:active { transform: none; }
.btn-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(245, 165, 36, 0.16); }
.btn-timer span { position: relative; }
.mb { margin-bottom: 12px; }

.glow { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 rgba(245, 165, 36, 0); }
  50% { box-shadow: 0 0 22px rgba(245, 165, 36, 0.55); }
}
.btn-gem.glow { animation-name: glow-gem; }
.btn-gram.glow { animation-name: glow-gram; }
@keyframes glow-gram {
  0%, 100% { box-shadow: 0 0 0 rgba(0, 152, 234, 0); }
  50% { box-shadow: 0 0 22px rgba(42, 171, 238, 0.6); }
}
@keyframes glow-gem {
  0%, 100% { box-shadow: 0 0 0 rgba(62, 224, 193, 0); }
  50% { box-shadow: 0 0 22px rgba(62, 224, 193, 0.55); }
}

/* ---------- Карточка шахты ---------- */

.mine { position: relative; margin-bottom: 14px; }
.mine-head {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 34px; margin: -4px 0 10px;
}
.mine-status { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.mine-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-idle { color: var(--muted); }
.st-running { color: var(--accent); }
.st-ready { color: var(--ok); }

.mine-items { display: flex; gap: 6px; }
.item-chip {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid rgba(245, 165, 36, 0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.item-chip .ph { position: absolute; inset: 3px; border: 0; padding: 0; background: none; font-size: 17px; }
.item-chip .cnt {
  position: absolute; right: -6px; top: -6px;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 99px;
  background: var(--accent); color: #2a1702;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.item-chip.off { opacity: 0.4; }

.mine-top { display: grid; grid-template-columns: 27% 1fr; gap: 8px; align-items: center; }
.mine-left { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mine-img { width: 100%; aspect-ratio: 1; border-radius: 18px; }
.mine-name { font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; text-align: center; }
.mine-badge {
  position: absolute; left: -6px; top: -6px; z-index: 2;
  padding: 4px 8px; border-radius: 8px;
  background: linear-gradient(90deg, var(--accent-2), #ff3d6e);
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap;
  transform: rotate(-8deg);
  box-shadow: 0 4px 12px rgba(255, 61, 110, 0.35);
}
.mine-badge.free { background: linear-gradient(90deg, #2fbf4f, #7be38a); color: #06240c; box-shadow: 0 4px 12px rgba(63, 207, 90, 0.35); }

.stats { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat {
  display: flex; align-items: center; gap: 7px;
  background: var(--card-2);
  border-radius: 10px;
  padding: 8px 9px;
  font-size: 13px;
  min-width: 0;
}
.stat svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
.stat .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e3d8cc; }
.stat b { margin-left: auto; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat .cur { margin-left: 4px; }

.mine-foot { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.mine-foot .stat { padding: 11px 12px; font-size: 14px; }
.mine-foot .stat svg { width: 17px; height: 17px; }

/* ---------- Заглушки страниц ---------- */

.stub { text-align: center; padding: 34px 20px; }
.stub-ico {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 20px;
  background: var(--card-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.stub-ico svg { width: 30px; height: 30px; }
.stub-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.stub p { color: var(--muted); font-size: 14px; line-height: 1.45; }

/* ---------- Нижняя панель ---------- */

.nav {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 10;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: end;
  background: rgba(18, 14, 11, 0.92);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px;
  height: 100%; padding-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  transition: color 0.15s ease;
}
.nav-btn svg { width: 24px; height: 24px; }
.nav-btn.active { color: var(--accent); }
.nav-center .nav-orb {
  width: 60px; height: 60px;
  margin-top: -26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #ffd27a, var(--accent) 50%, #d97706);
  color: #2a1702;
  box-shadow: 0 6px 22px rgba(245, 165, 36, 0.45), 0 0 0 5px rgba(18, 14, 11, 0.92);
}
.nav-center .nav-orb svg { width: 28px; height: 28px; }
.nav-center { color: var(--text); font-weight: 600; }
.nav-center.active { color: var(--accent); }

/* ---------- Модальные окна ---------- */

.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.18s ease;
}
.overlay.center { align-items: center; padding: 16px; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: relative;
  width: 100%; max-width: 480px;
  max-height: 92dvh; overflow-y: auto;
  background: #1c1612;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up 0.22s ease;
}
.overlay.center .sheet { border-radius: 22px; border-bottom: 1px solid var(--border); max-width: 400px; padding-bottom: 20px; animation: pop 0.2s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } }
.sheet h3 { font-size: 20px; font-weight: 700; text-align: center; margin: 0 36px 12px; }
.sheet-close {
  position: absolute; right: 14px; top: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--card-2); color: #ff8a8a; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.sheet-desc { text-align: center; font-size: 15px; line-height: 1.45; margin-bottom: 18px; color: #e8ddd1; }
.sheet-note { text-align: center; font-size: 13px; color: var(--muted); margin-top: 10px; }
.sheet .btn + .btn { margin-top: 10px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row .btn + .btn { margin-top: 0; }

.field-label { font-size: 15px; margin-bottom: 44px; }
.slider-wrap { position: relative; height: 32px; margin-bottom: 6px; }
.slider-bubble {
  position: absolute; bottom: 38px;
  transform: translateX(-50%);
  padding: 4px 10px; border-radius: 10px;
  background: var(--accent); color: #2a1702;
  font-size: 14px; font-weight: 700; white-space: nowrap;
}
.slider-bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--accent); border-bottom: 0;
}
input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 32px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) 0 var(--p, 0%), #4a3f36 var(--p, 0%) 100%);
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 0;
  box-shadow: 0 0 0 4px rgba(245, 165, 36, 0.45), 0 2px 8px rgba(0, 0, 0, 0.4);
}
input[type=range]::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 0;
  box-shadow: 0 0 0 4px rgba(245, 165, 36, 0.45);
}
.slider-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 16px; padding: 0 4px; }

.summary {
  background: #120e0b;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 9px;
  font-size: 15px;
}
.summary div { display: flex; justify-content: space-between; gap: 10px; }
.summary b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Награда */
.reward-emoji { font-size: 46px; text-align: center; margin-bottom: 4px; }
.reward-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.reward-box {
  background: #120e0b; border: 1px solid var(--border); border-radius: 14px;
  padding: 12px; text-align: center;
}
.reward-box b { display: block; font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.reward-box span { font-size: 12px; color: var(--muted); }
.reward-item {
  display: flex; align-items: center; gap: 12px;
  background: #120e0b; border: 1px solid var(--border); border-radius: 14px;
  padding: 12px; margin-bottom: 10px;
}
.reward-item .big { font-size: 30px; }
.reward-item.found { border-color: rgba(245, 165, 36, 0.5); box-shadow: 0 0 18px rgba(245, 165, 36, 0.18); }
.reward-lvl { text-align: center; font-weight: 600; color: var(--accent); margin-bottom: 12px; }

.test-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.test-grid .btn { height: 46px; font-size: 14px; margin: 0 !important; }

/* ---------- Уведомления ---------- */

.toast {
  position: fixed; left: 50%; top: 16px; z-index: 100;
  transform: translate(-50%, -20px);
  max-width: calc(100% - 32px);
  padding: 11px 16px; border-radius: 14px;
  background: #2a211a; border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  font-size: 14px; font-weight: 500; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(255, 93, 93, 0.45); color: #ffb3b3; }

/* Кнопка под шахтёром — той же ширины, что и картинка */
.miner-action { width: min(74%, 290px); margin: 0 auto; }

/* ---------- Друзья ---------- */

.ref-card { margin-bottom: 12px; }
.ref-label { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.ref-link {
  background: #120e0b;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  color: #e8ddd1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 10px;
  cursor: pointer;
}
.ref-actions { display: grid; grid-template-columns: 1fr 52px; gap: 10px; }
.ref-actions .btn svg { width: 19px; height: 19px; }
.btn-square { width: 52px; padding: 0; }

.reward-card { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.reward-info { flex: 1; min-width: 0; }
.reward-info .ref-label { margin-bottom: 4px; }
.reward-sum { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.reward-sum .ph { width: 24px; height: 24px; border-radius: 50%; border-width: 1px; font-size: 0; padding: 0; }
.btn-claim { width: auto; padding: 0 22px; height: 46px; flex: none; }

.ref-how { text-align: center; font-size: 14px; color: #e3d8cc; line-height: 1.45; margin: 4px 8px 20px; }

.section-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.section-title span { font-weight: 500; margin-left: 4px; }

.friend { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; }
.avatar {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #1a120c;
}
.friend-info { flex: 1; min-width: 0; }
.friend-name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.friend-earned { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--gram); font-variant-numeric: tabular-nums; }
.friend-earned .ph { width: 20px; height: 20px; border-radius: 50%; border-width: 1px; font-size: 0; padding: 0; }

/* ---------- Баланс ---------- */

.balance-card { margin-bottom: 12px; }
.balance-sum { display: flex; align-items: center; gap: 10px; font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 2px 0 12px; }
.balance-sum .ph { width: 30px; height: 30px; border-radius: 50%; border-width: 1px; font-size: 0; padding: 0; }
.balance-sub { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); }
.balance-sub b { color: var(--text); font-weight: 600; }

.wallet-card { margin-bottom: 20px; }
.wallet-text { font-size: 15px; line-height: 1.45; text-align: center; color: #e3d8cc; margin: 4px 6px 14px; }
.ton-logo { width: 24px; height: 24px; flex: none; }
.btn .ton-logo { width: 24px; height: 24px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); border-radius: 50%; }
.wallet-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wallet-row .ton-logo { width: 40px; height: 40px; }
.wallet-info { flex: 1; min-width: 0; }
.wallet-info .ref-label { margin-bottom: 2px; }
.wallet-addr { font-size: 17px; font-weight: 600; }
.wallet-off { font-size: 13px; color: #ff9a9a; padding: 8px 4px; }
.btn-gram-outline { background: rgba(42, 171, 238, 0.1); border: 1.5px solid var(--gram); color: var(--gram); }

.tx { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; }
.tx-ico {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  background: var(--card-2);
}
.tx-ico.done { color: var(--ok); }
.tx-ico.pending { color: var(--accent); }
.tx-ico.rejected { color: var(--danger); }
.tx-info { flex: 1; min-width: 0; }
.tx-title { font-size: 16px; font-weight: 600; }
.tx-date { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tx-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tx-amount { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tx-amount.deposit { color: var(--gram); }
.tx-amount .ph { width: 18px; height: 18px; border-radius: 50%; border-width: 1px; font-size: 0; padding: 0; }
.tx-status { font-size: 12px; font-weight: 500; }
.tx-status.done { color: var(--ok); }
.tx-status.pending { color: var(--accent); }
.tx-status.rejected { color: var(--danger); }

/* Поля ввода */
.field-label.sm { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.input-wrap { position: relative; margin-bottom: 12px; }
.input {
  width: 100%; height: 52px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #120e0b;
  color: var(--text);
  font: inherit; font-size: 16px;
  outline: none;
  -moz-appearance: textfield;
  user-select: text; -webkit-user-select: text;
}
.input:focus { border-color: var(--gram); }
.input::-webkit-outer-spin-button, .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input.readonly { display: block; line-height: 50px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.input-wrap .input { padding-right: 70px; }
.input-max {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  height: 36px; padding: 0 12px; border-radius: 10px;
  background: rgba(42, 171, 238, 0.15); color: var(--gram);
  font-size: 13px; font-weight: 700;
}
.chips { display: flex; gap: 8px; margin: -2px 0 16px; }
.chip {
  flex: 1; height: 38px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
}
.chip:active { background: rgba(42, 171, 238, 0.2); }
.avail { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin: -4px 2px 16px; }
.avail b { color: var(--text); font-weight: 600; }

/* ---------- Задания ---------- */

.page-sub { text-align: center; font-size: 14px; color: var(--muted); margin: -8px 0 16px; }
.task { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 10px; }
.task-ico {
  width: 46px; height: 46px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #37bbfe, #007dbb); color: #fff;
}
.task-ico svg { width: 24px; height: 24px; margin-left: -2px; }
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.task-reward { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--gram); }
.task-reward .ph { width: 16px; height: 16px; border-radius: 50%; border-width: 1px; font-size: 0; padding: 0; }
.task-btn { width: auto; height: 40px; padding: 0 16px; font-size: 14px; border-radius: 12px; flex: none; }
.task-done {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(123, 227, 138, 0.15); color: var(--ok); font-size: 18px; font-weight: 700;
}
.task.is-done { opacity: 0.7; }

.nav-ico { position: relative; display: flex; }
.nav-badge {
  position: absolute; right: -9px; top: -6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px;
  background: #ff4d5e; color: #fff;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px rgba(18, 14, 11, 0.92);
}

/* Иконка GRAM (логотип TON, без обводки) */
.gram-ico {
  display: inline-flex; flex: none;
  border-radius: 50%;
}
.gram-ico .ton-logo { width: 100%; height: 100%; }

/* Бонус циклов от Кирки рядом с «Итоговый доход» */
.pick-bonus {
  flex: none;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(245, 165, 36, 0.18);
  color: var(--accent);
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.stat-wrap .lbl { white-space: normal; overflow: visible; line-height: 1.35; }
.stat-wrap .pick-bonus { display: inline-block; vertical-align: 1px; }

/* Бонус за цепочку заданий */
.chain { margin-bottom: 12px; border-color: rgba(245, 165, 36, 0.35); }
.chain-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.chain-title { font-size: 15px; font-weight: 700; }
.chain-count { font-size: 14px; font-weight: 700; color: var(--accent); }
.chain-reward { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.4; }
.chain-reward b { color: var(--text); font-weight: 600; }

/* ---------- Режим скидки ---------- */
.mine-badge.sale { background: linear-gradient(90deg, #ff3d3d, #ff7a1a); color: #fff; box-shadow: 0 4px 12px rgba(255, 61, 61, 0.4); }
.old-price { font-weight: 500; opacity: 0.7; margin-left: 2px; }
.sale-banner {
  margin: -4px 0 14px;
  padding: 11px 14px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 61, 61, 0.22), rgba(255, 122, 26, 0.22));
  border: 1px solid rgba(255, 90, 50, 0.45);
  text-align: center;
  font-size: 15px; font-weight: 700;
  color: #ffb08a;
}
.sale-left { margin-top: 3px; font-size: 13px; font-weight: 500; color: #ffd2bd; font-variant-numeric: tabular-nums; }

/* ---------- Загрузка ---------- */
.loading {
  min-height: 70vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  text-align: center;
}
.loading .btn { width: auto; padding: 0 28px; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid rgba(245, 165, 36, 0.2); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.blocked-ico { font-size: 54px; line-height: 1; }
