/* ═══════════════════════════════════════════════════════════════════════
   ДОК ХАБА — стеклянная капсула + цветные иконки разделов (13-09)
   Слово автора 13-09: «чёрный цвет нигде не использовать», док — как у
   Apple/macOS: стеклянная капсула, разноцветные значки, мягкая цветная
   подсветка активного раздела. Прежний «цельный чернильный» активный таб
   (var(--ink)) отменён.

   Геометрия: fixed, снизу, капсула min(560px), тап-зона таба ≥44px.
   Цвет раздела задаётся через data-tab (--c / --c-soft / --c-glow).
   ПИН файла — в index.html (P.59/P.58).
   ═══════════════════════════════════════════════════════════════════════ */

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 65;
  display: flex;
  align-items: stretch;
  gap: 4px;
  width: min(560px, calc(100% - 24px));
  padding: 5px;
  background: rgba(245, 245, 247, 0.72);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.14), 0 1px 2px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
html[data-theme="dark"] .tabbar {
  background: rgba(28, 28, 30, 0.74);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tab {
  --c: #8e8e93;
  --c-soft: rgba(142, 142, 147, 0.16);
  --c-glow: rgba(142, 142, 147, 0.3);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 58px;
  padding: 8px 6px;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

/* Цвет каждого раздела (Apple system palette) */
.tab[data-tab="home"]    { --c: #0a84ff; --c-soft: rgba(10, 132, 255, 0.14); --c-glow: rgba(10, 132, 255, 0.30); }
.tab[data-tab="agents"]  { --c: #6e5cff; --c-soft: rgba(110, 92, 255, 0.14); --c-glow: rgba(110, 92, 255, 0.30); }
.tab[data-tab="games"]   { --c: #ff9f0a; --c-soft: rgba(255, 159, 10, 0.16); --c-glow: rgba(255, 159, 10, 0.30); }
.tab[data-tab="premium"] { --c: #ffb300; --c-soft: rgba(255, 179, 0, 0.16); --c-glow: rgba(255, 179, 0, 0.30); }
.tab[data-tab="earn"]    { --c: #30d158; --c-soft: rgba(48, 209, 88, 0.16);  --c-glow: rgba(48, 209, 88, 0.30); }
.tab[data-tab="profile"] { --c: #ff375f; --c-soft: rgba(255, 55, 95, 0.15);  --c-glow: rgba(255, 55, 95, 0.30); }
.tab[data-tab="search"]  { --c: #0a84ff; --c-soft: rgba(10, 132, 255, 0.14); --c-glow: rgba(10, 132, 255, 0.30); }
.tab[data-tab="wallet"]  { --c: #30d158; --c-soft: rgba(48, 209, 88, 0.16);  --c-glow: rgba(48, 209, 88, 0.30); }
.tab[data-tab="stats"]   { --c: #6e5cff; --c-soft: rgba(110, 92, 255, 0.14); --c-glow: rgba(110, 92, 255, 0.30); }
.tab[data-tab="lang"]    { --c: #30b0c7; --c-soft: rgba(48, 176, 199, 0.16); --c-glow: rgba(48, 176, 199, 0.30); }

.tab-ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--c);
  background: transparent;
  border-radius: 999px;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}
.tab-ico svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-label { color: var(--muted); letter-spacing: -0.01em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; transition: color 0.3s var(--ease); }

.tab:hover { background: var(--c-soft); }
.tab:focus { outline: none; }
.tab:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }

.tab.active {
  background: var(--c-soft);
  box-shadow: 0 8px 22px var(--c-glow);
}
.tab.active .tab-ico { background: rgba(255, 255, 255, 0.55); color: var(--c); transform: translateY(-1px); }
html[data-theme="dark"] .tab.active .tab-ico { background: rgba(255, 255, 255, 0.1); }
.tab.active .tab-label { color: var(--c); font-weight: 680; }

@media (prefers-reduced-motion: reduce) {
  .tab, .tab-ico { transition: none; }
}

/* Клавиатура открыта (фокус в поле) — панель не должна закрывать форму. */
body.keyboard-open .tabbar { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(140%); }
body.keyboard-open { padding-bottom: 0; }
