/* Хомяк Комбат — стили */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #1c1626;
  --bg2: #251d33;
  --card: #322847;
  --card-hi: #3d3157;
  --ink: #f4eee2;
  --dim: #a99ec4;
  --gold: #ffcc4d;
  --gold-hi: #ffe08a;
  --energy: #57c7ff;
  --red: #ff5d73;
  --green: #6fe3a5;
}

html, body { height: 100%; }

body {
  font-family: 'Baloo 2', system-ui, sans-serif;
  background: radial-gradient(120% 90% at 50% 0%, var(--bg2), var(--bg) 70%);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ── HUD ─────────────────────────────── */
.hud {
  text-align: center;
  padding: 14px 10px 8px;
}
.balance {
  font-size: 42px;
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  line-height: 1;
}
.pph {
  margin-top: 4px;
  font-size: 14px;
  color: var(--dim);
  font-weight: 700;
}
.pph b { color: var(--green); }

/* ── Лига ────────────────────────────── */
.league { padding: 0 16px 10px; }
.league-row {
  display: flex; justify-content: space-between;
  font-size: 12.5px; font-weight: 700;
  margin-bottom: 4px; color: var(--dim);
}
.league-name { color: var(--gold-hi); }
.league-bar {
  height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.league-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #b98a2f, var(--gold), var(--gold-hi));
  border-radius: 999px;
  transition: width 0.3s;
}

main { flex: 1; overflow: hidden; position: relative; }
.screen {
  position: absolute; inset: 0;
  overflow-y: auto;
  padding: 8px 16px 20px;
  display: flex; flex-direction: column; align-items: center;
}
.screen.hidden { display: none; }
/* фикс: без этого вкладки/блоки сплющивались, когда контент не влезал
   (flex-shrink по умолчанию 1 + overflow => min-height: 0) */
.screen > * { flex-shrink: 0; }

/* ── Тап-экран ───────────────────────── */
.hamster {
  width: min(58vw, 260px);
  height: min(58vw, 260px);
  margin-top: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #4a3c68, var(--card) 70%);
  box-shadow: 0 0 0 10px rgba(255, 204, 77, 0.06), 0 14px 50px rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.08s;
}
.hamster:active { transform: scale(0.93); }
.hamster-face { font-size: min(36vw, 150px); line-height: 1; }

.tap-hint { margin-top: 14px; font-size: 14px; color: var(--dim); font-weight: 700; }

.energy { margin-top: auto; width: 100%; max-width: 340px; padding-bottom: 8px; }
.energy-row { font-size: 13px; font-weight: 700; color: var(--dim); margin-bottom: 4px; text-align: left; }
.energy-bar {
  height: 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.energy-bar i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #2d8ec4, var(--energy));
  transition: width 0.2s;
}

/* летящие +N */
.fly {
  position: fixed;
  font-weight: 800;
  font-size: 22px;
  color: var(--gold-hi);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  animation: flyup 0.8s forwards;
  z-index: 40;
}
@keyframes flyup {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-90px) scale(1.5); }
}

/* ── Майн ────────────────────────────── */
.cat-tabs {
  display: flex; gap: 8px;
  overflow-x: auto;
  width: 100%;
  padding: 4px 0 10px;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  font-family: inherit;
  font-weight: 700; font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  white-space: nowrap;
}
.cat-tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #4a3410;
}
/* узкие экраны: чипсы компактнее, чтобы меньше скроллились */
@media (max-width: 350px) {
  .cat-tab { padding: 7px 10px; font-size: 12px; }
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 520px;
}
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.12s, border-color 0.12s;
  position: relative;
}
.card:hover { transform: translateY(-2px); }
.card.owned { border-color: rgba(111, 227, 165, 0.5); }
.card.locked { opacity: 0.45; }
.card.combo { outline: 2px dashed var(--gold); outline-offset: 2px; }
.card-icon { font-size: 30px; margin-bottom: 6px; }
.card-name { font-weight: 700; font-size: 13.5px; line-height: 1.15; }
.card-profit { font-size: 12px; color: var(--green); font-weight: 700; margin-top: 3px; }
.card-lvl { font-size: 11px; color: var(--dim); margin-top: 2px; }
.card .cost {
  margin-top: 7px;
  font-size: 13px; font-weight: 800;
  color: var(--gold);
}
.card .cost.cheap { color: #ffdf9e; }

/* ── Бусты ───────────────────────────── */
.sec-title {
  font-size: 16px; font-weight: 800;
  color: var(--gold-hi);
  margin: 12px 0 8px;
  width: 100%; max-width: 520px;
}
.rows { width: 100%; max-width: 520px; }
.row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
}
.row-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.row-body { flex: 1; min-width: 0; }
.row-name { font-weight: 700; font-size: 14px; }
.row-desc { font-size: 12px; color: var(--dim); line-height: 1.25; }
.row-btn {
  font-family: inherit;
  font-weight: 800; font-size: 13px;
  border: none; border-radius: 999px;
  padding: 9px 16px;
  background: var(--gold);
  color: #4a3410;
  cursor: pointer;
  box-shadow: 0 3px 0 #a8842e;
  white-space: nowrap;
}
.row-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #a8842e; }
.row-btn:disabled {
  background: #4c4162;
  color: #7d7195;
  box-shadow: 0 3px 0 #372e4a;
  cursor: default;
}

.tiny-note {
  font-size: 11px;
  color: var(--dim);
  opacity: 0.8;
  text-align: center;
  margin-top: 12px;
}

/* ── Нижняя навигация ────────────────── */
.bottomnav {
  display: flex;
  background: rgba(20, 15, 30, 0.9);
  border-top: 2px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  z-index: 5;
}
.navbtn {
  flex: 1;
  padding: 9px 4px 8px;
  font-family: inherit;
  background: none; border: none;
  color: var(--dim);
  font-size: 22px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.navbtn span { font-size: 11px; font-weight: 700; }
.navbtn.active { color: var(--gold); }

/* ── Модал / тост ────────────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(10, 7, 16, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--bg2);
  border: 2px solid rgba(255, 204, 77, 0.25);
  border-radius: 24px;
  padding: 26px 30px;
  text-align: center;
  max-width: 320px;
  animation: pop 0.25s;
}
@keyframes pop {
  from { transform: scale(0.85); opacity: 0; }
}
.modal-icon { font-size: 46px; margin-bottom: 8px; }
.modal-title { font-weight: 800; font-size: 19px; margin-bottom: 6px; }
.modal-text { font-size: 14px; color: var(--dim); margin-bottom: 16px; line-height: 1.4; }
.modal-scroll {
  max-height: 46vh;
  overflow-y: auto;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.5;
  text-align: left;
  margin-bottom: 16px;
  width: 100%;
}
.modal-scroll b { color: var(--ink); }
.modal-scroll p { margin-bottom: 8px; }
.btn-primary {
  font-family: inherit;
  font-weight: 800; font-size: 16px;
  border: none; border-radius: 999px;
  padding: 12px 34px;
  background: var(--gold);
  color: #4a3410;
  cursor: pointer;
  box-shadow: 0 4px 0 #a8842e;
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #a8842e; }

.toast {
  position: fixed;
  top: 76px; left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 204, 77, 0.95);
  color: #4a3410;
  font-weight: 800;
  font-size: 13px;
  border-radius: 999px;
  padding: 10px 18px;
  z-index: 60;
  animation: pop 0.2s;
  max-width: 86vw;
  text-align: center;
}
.toast.hidden { display: none; }

/* ── VPN-баннер ──────────────────────── */
.vpn-ad {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 12px 0;
  padding: 10px 12px;
  background: linear-gradient(120deg, #322847, #3d3157);
  border: 1px solid #57c7ff44;
  border-radius: 14px;
}
.vpn-ad-emoji { font-size: 22px; }
.vpn-ad-text { flex: 1; line-height: 1.2; }
.vpn-ad-text b { font-size: 14px; color: var(--gold-hi); display: block; }
.vpn-ad-text small { font-size: 11.5px; color: var(--dim); }
.vpn-ad-btn {
  background: linear-gradient(135deg, #57c7ff, #6fe3a5);
  color: #16202b; font-weight: 800; font-size: 13px;
  border: none; border-radius: 999px;
  padding: 8px 14px; cursor: pointer;
  font-family: inherit;
}

/* ── ТГ-приветствие ───────────────────── */
.tg-hello {
  font-size: 15px;
  color: var(--dim, #a08fb8);
  margin-bottom: 2px;
  font-weight: 700;
}

/* ── Профиль-чип в шапке ──────────────── */
.me-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 6px;
  width: fit-content;
  padding: 5px 14px 5px 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 204, 77, 0.22);
  border-radius: 999px;
}
.me-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--card);
}
.me-chip span {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me-chip .me-no-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

/* ── Гейт входа (неклозабельный) ──────── */
.modal.gate { z-index: 90; background: rgba(13, 9, 20, 0.92); }
.gate-avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  box-shadow: 0 0 0 4px rgba(255, 204, 77, 0.25), 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: gate-float 3s ease-in-out infinite;
  overflow: hidden;
}
.gate-avatar img { width: 100%; height: 100%; object-fit: cover; }
@keyframes gate-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.btn-tg {
  background: linear-gradient(135deg, #37aee2, #2b8fd0);
  color: #fff;
  box-shadow: 0 4px 0 #1e6ea3;
  width: 100%;
}
.btn-tg:active { box-shadow: 0 2px 0 #1e6ea3; }
.gate-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--dim);
  font-weight: 700;
}
.gate-cmd-box { margin-top: 14px; }
.gate-cmd-label { font-size: 11px; color: var(--dim); margin-bottom: 6px; }
.gate-cmd {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  color: #e8ddc8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
  word-break: break-all;
  cursor: pointer;
  user-select: all;
}
.gate-cmd:active { opacity: 0.7; }

/* ── Строка профиля в бустах ──────────── */
.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
}
.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg2);
  flex-shrink: 0;
}
.profile-name { font-weight: 800; font-size: 15px; }
.profile-username { font-size: 12.5px; color: var(--dim); font-weight: 700; }
.profile-hint { font-size: 11px; color: var(--dim); opacity: 0.85; margin-top: 2px; }

/* ── Листинг ─────────────────────────── */
.listing-hero {
  width: 100%;
  max-width: 520px;
  margin: 0 auto 14px;
  padding: 18px 16px 14px;
  background: linear-gradient(160deg, #2d2440, #3a2b52);
  border: 1px solid #d4af3744;
  border-radius: 16px;
  text-align: center;
}
.listing-emoji { font-size: 42px; line-height: 1; }
.listing-name {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--gold-hi, #f5d66b);
  margin: 6px 0 2px;
}
.listing-date { font-size: 12px; color: var(--dim, #a08fb8); font-weight: 700; }
.listing-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 12px 0 4px;
}
.listing-progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b98a2f, var(--gold, #d4af37), var(--gold-hi, #f5d66b));
  border-radius: 999px;
  transition: width 0.4s;
}
.listing-pct { font-size: 13px; font-weight: 800; color: var(--green, #6fe3a5); }
.listing-goal { font-size: 11.5px; color: var(--dim, #a08fb8); margin-top: 2px; }
.listing-price {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 800;
  color: #6fe3a5;
  background: rgba(111, 227, 165, 0.1);
  border: 1px solid rgba(111, 227, 165, 0.25);
  border-radius: 999px;
  padding: 6px 12px;
  display: inline-block;
}
.listing-price small { font-size: 10.5px; color: var(--dim, #a08fb8); font-weight: 600; }
.portfolio-hero {
  width: 100%;
  max-width: 520px;
  margin: 0 auto 14px;
  padding: 14px 16px;
  background: linear-gradient(160deg, #243044, #2b3a52);
  border: 1px solid #6fe3a544;
  border-radius: 16px;
  text-align: center;
}
.portfolio-coins {
  font-size: 24px;
  font-weight: 900;
  color: #f5d66b;
}
.portfolio-coins small { font-size: 13px; color: var(--dim, #a08fb8); font-weight: 700; }
.portfolio-rub { font-size: 13px; font-weight: 700; color: #6fe3a5; margin-top: 3px; }
.portfolio-note { font-size: 11px; color: var(--dim, #a08fb8); margin-top: 4px; }
.listing-step-done { text-decoration: line-through; opacity: 0.55; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* планшет/ПК: центрируем в «телефон» */
@media (min-width: 760px) {
  body {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.5);
    min-height: 100vh;
  }
  .hamster { width: 240px; height: 240px; }
  .hamster-face { font-size: 130px; }
}

/* ── Баннер техработ ─────────────────────────────── */
#maint-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2000;
  background: linear-gradient(90deg, #b8860b, #ffd54a, #b8860b);
  color: #241d38;
  font-weight: 800;
  text-align: center;
  padding: 6px 12px;
  font-size: 13px;
  box-shadow: 0 2px 12px rgba(0,0,0,.45);
}
