/* Дүкен, жүрекше, дос шақыру. style.css-тен кейін қосылады. */

/* ---------- Мәзір сыймай қалмауы үшін ---------- */
/* .screen — fixed flex бағаны. Мазмұн ұзарса карточкалар қысылып, батырма кесіліп қалатын.
   Енді: карточкалар қысылмайды, ал экран сыймаса төмен қарай айналады. */
#menu.active,
#shop.active,
#refs.active {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--safe-b) + 28px);
}
#menu.active > *,
#shop.active > *,
#refs.active > * { flex: none; }

/* Мәзірді шағындау, барлығы бір экранға сыйсын */
#menu h1 { margin: 16px 0 10px 4px; font-size: 34px; }
#menu .card { padding: 18px 18px 18px; border-radius: 24px; }
#menu .card h2 { font-size: 26px; margin-bottom: 4px; }
#menu .card p { font-size: 14px; margin-bottom: 12px; }
#menu .batl { height: 52px; font-size: 18px; }
#menu .friend-card { margin-top: 10px; }

/* ---------- Жүрекше ---------- */
.coin {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex: none;
  font-size: 15px; line-height: 1; font-style: normal;
}
.coin::before { content: '❤️'; }
.coinbtn {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  border: 1px solid rgba(255, 211, 106, .3); border-radius: 20px; padding: 8px 14px;
  background: linear-gradient(180deg, rgba(255,211,106,.16), rgba(255,211,106,.05)), #1a1826;
  color: #f2c158; font-weight: 800; font-size: 16px;
  box-shadow: 0 0 14px rgba(255,190,70,.12);
}

/* ---------- Мәзірдегі екі тақтайша ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 0; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  min-height: 96px; padding: 14px; border-radius: 22px; text-align: left; color: #f0e5d2;
  background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02)), #171526;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255,255,255,.08);
  transition: transform .15s, box-shadow .2s;
}
.tile:active { transform: scale(.97); box-shadow: 0 6px 16px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.08); }
.tile .tic { font-size: 26px; line-height: 1; }
.tile b { display: block; font-size: 19px; font-weight: 800; }
.tile small { color: #a0a0a0; font-size: 13px; }
.tile small.rw { color: #f2b632; font-weight: 800; }

/* ---------- Дүкен ---------- */
.sbar { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.sbar h1 { margin: 0; font-size: 26px; }
.sback { width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(160deg, rgba(255,255,255,.1), rgba(255,255,255,.02)), #1a1826; border: 1px solid rgba(255,255,255,.1); color: #f0e5d2; font-size: 24px; }

.stabs { display: flex; padding: 4px; margin-bottom: 12px; border-radius: 14px; background: #141220; border: 1px solid rgba(255,255,255,.06); }
.stabs button { flex: 1; padding: 11px; border-radius: 11px; background: transparent; color: #a0a0a0; font-weight: 800; font-size: 15px; transition: background .2s, color .2s; }
.stabs button.on { background: linear-gradient(180deg, #f3f0ea, #ddd6ca); color: #151515; }

.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.sitem {
  display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.01)), #171526;
  box-shadow: 0 10px 22px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.07);
  transition: transform .15s, border-color .2s, box-shadow .2s;
}
.sitem:active { transform: scale(.98); }
.sitem.sel { border-color: #f2b632; box-shadow: 0 0 0 1px #f2b632, 0 0 20px rgba(242, 182, 50, .35), inset 0 1px 0 rgba(255,255,255,.1); }
.sitem h3 { margin: 0; font-size: 15px; font-weight: 800; color: #f0e5d2; }
.sitem .rar { margin-top: -6px; font-size: 12px; color: #a0a0a0; font-weight: 700; }
.sitem .rar.r1 { color: #6fb4ff; } .sitem .rar.r2 { color: #c58bff; } .sitem .rar.r3 { color: #f2b632; }
.spv { aspect-ratio: 1; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.tb { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; height: 100%; }
.tp { display: flex; align-items: center; justify-content: center; gap: 10px; height: 100%; background: #0f0d18; }
.tp b { display: block; position: relative; width: 34%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 3px 0 rgba(0, 0, 0, .28), 0 5px 8px rgba(0, 0, 0, .3); }
.tp b::after { content: ""; position: absolute; inset: 18%; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .13), inset 0 2px 3px rgba(255, 255, 255, .25); }

.sbuy { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 12px; background: linear-gradient(180deg, #ffd36a, #f2a93b); color: #3a2808; font-weight: 800; font-size: 15px; transition: transform .12s; }
.sbuy:active { transform: scale(.96); }
.sbuy.use { background: linear-gradient(180deg, #3fc770, #2d9150); color: #fff; }
.sbuy.on { background: rgba(255, 255, 255, .13); color: #f0e5d2; }
.sbuy.no { opacity: .5; }

/* style.css-те .batl үшін !important бар, сондықтан осында да !important */
.batl.gold { background: #f2b632 !important; color: #3a2808 !important; letter-spacing: .5px; font-size: 16px; }

/* ---------- Достарды шақыру ---------- */
#refs .batl { letter-spacing: .5px; font-size: 16px; height: 50px; }
#refs .card { padding: 18px; }
#refs .card h2 { font-size: 26px; }
#refs .card p { font-size: 14px; }
.reflink {
  width: 100%; margin: 0 0 12px; padding: 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px;
  background: #151320; color: #f0e5d2; font-size: 13px; outline: none;
  -webkit-user-select: text; user-select: text; position: relative; z-index: 1;
}
.refbtns { display: flex; flex-direction: column; gap: 8px; }
.refcount { display: flex; flex-direction: column; align-items: center; margin: 14px 0 10px; color: #a0a0a0; }
.refcount b { font-family: var(--font-display); font-size: 52px; line-height: 1; font-weight: 800; color: #f2b632; }
.reflist { display: flex; flex-direction: column; gap: 8px; }
.reflist .empty { margin: 0; text-align: center; color: #a0a0a0; }
.rrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.01)), #171526; border: 1px solid rgba(255,255,255,.08); color: #f0e5d2; }
.rrow .ava { width: 38px; height: 38px; font-size: 16px; }
.rrow b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .rw { color: #f2b632; font-weight: 800; }

/* ---------- Хабарлама ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 24px); z-index: 50;
  transform: translate(-50%, 30px); max-width: 90%; padding: 11px 18px; border-radius: 14px;
  background: #eee; color: #151515; font-weight: 700; text-align: center;
  opacity: 0; pointer-events: none; transition: .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Жаңа тастар: Stars, бөлім тақырыптары, белгілер ---------- */
.sbuy.star { background: linear-gradient(135deg, #3b82f6, #7c5cff); color: #fff; }
.ssec { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 8px 2px 0; font-weight: 800; font-size: 16px; color: #f0e5d2; }
.ssec small { color: #a0a0a0; font-weight: 600; font-size: 12px; }
.sitem .rar.rg { color: #ff8fc0; }
.sitem .rar.rb { color: #9fb3c8; }
.tp b[data-em]::before {
  content: attr(data-em); position: absolute; inset: 0; display: grid; place-items: center; z-index: 1;
  font-size: clamp(13px, 4.6vw, 22px); line-height: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4));
}

/* ---------- Реалистік тастар: дүкендегі превью ---------- */
.tp.wood { background: #b98a5a linear-gradient(180deg, rgba(255, 236, 200, .25), rgba(0, 0, 0, .25)); }
.tp b.rp { background: radial-gradient(circle at 38% 28%, var(--wa), var(--wb) 80%); box-shadow: 0 4px 5px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .5), inset 0 -2px 3px rgba(0, 0, 0, .4), inset 0 2px 2px rgba(255, 255, 255, .55); }
.tp b.rp::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(circle at 40% 32%, var(--wc), var(--wd)); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .5); }
.tp b.rp::after { inset: 33%; background: radial-gradient(circle at 40% 32%, var(--wc), var(--wd)); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3), 0 1px 0 rgba(255, 255, 255, .45); }
.tp b.rp.k { background: radial-gradient(circle at 38% 28%, var(--ka), var(--kb) 80%); }
.tp b.rp.k::before, .tp b.rp.k::after { background: radial-gradient(circle at 40% 32%, var(--kc), var(--kd)); }
