/* shell.css — каркас: верхняя панель, вкладки, нижняя панель, шиты, тосты */
#shell { position: absolute; inset: 0; display: flex; flex-direction: column; z-index: 5; }
#topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + var(--safe-top)) 14px 8px; flex: none;
}
.tb-user { display: flex; align-items: center; gap: 10px; text-align: left; min-width: 0; flex: 1; }
.tb-lv { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 150px; }
.tb-lv b { font-size: 15px; font-weight: 900; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-lv i { font-style: normal; font-size: 11px; color: var(--muted); line-height: 1; }
.tb-xp { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; width: 110px; }
.tb-xp span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #5aa8ff, #22d3ee); transition: width 0.6s ease; }
.lvl-badge {
  position: absolute; right: -4px; bottom: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  background: linear-gradient(180deg, #ffe27a, #f5b301); color: #4a3000; font-size: 12px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--card); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}
.tb-av { position: relative; flex: none; }
.coins-pill {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 20px; background: var(--card);
  box-shadow: var(--shadow); font-size: 16px; font-weight: 900; flex: none; font-variant-numeric: tabular-nums;
}
.coins-pill svg { width: 24px; height: 24px; }
.coins-pill.bump { animation: bump 0.4s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }

#views { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 16px 24px; display: none; -webkit-overflow-scrolling: touch; }
.view.on { display: block; animation: viewIn 0.22s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view-title { font-size: 26px; font-weight: 900; margin: 4px 2px 12px; }

#tabbar {
  display: flex; flex: none; background: var(--bar); border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + var(--safe-bottom)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: var(--muted); font-size: 11px; font-weight: 800; position: relative; transition: color 0.15s; }
.tab svg { width: 26px; height: 26px; transition: transform 0.2s; }
.tab.on { color: var(--brand); }
.tab.on svg { transform: translateY(-2px) scale(1.1); }
.tab .dot { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* слой для шитов, модалок и тостов */
#layer { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.backdrop { position: absolute; inset: 0; background: var(--overlay); pointer-events: auto; animation: fadeIn 0.2s both; display: flex; align-items: flex-end; justify-content: center; }
.backdrop.center { align-items: center; padding: 20px; }
.sheet {
  width: min(520px, 100%); max-height: 88%; overflow-y: auto; background: var(--card); border-radius: 26px 26px 0 0;
  padding: 10px 16px calc(18px + var(--safe-bottom)); animation: sheetUp 0.28s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-x { position: absolute; top: 10px; right: 14px; width: 32px; height: 32px; border-radius: 50%; background: var(--card2); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.sheet-x svg { width: 18px; height: 18px; }
.toasts { position: absolute; top: calc(8px + var(--safe-top)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 40; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; width: min(360px, calc(100% - 24px)); padding: 10px 14px; border-radius: 18px;
  background: var(--card); box-shadow: 0 10px 28px rgba(10, 30, 70, 0.3); border: 2px solid var(--gold); animation: toastIn 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.toast.out { animation: toastOut 0.3s ease both; }
.toast .ic { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(180deg, #ffe27a, #f5b301); display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.toast b { display: block; font-size: 15px; font-weight: 900; }
.toast span { font-size: 12px; color: var(--muted); }
@keyframes toastIn { from { transform: translateY(-80px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-60px); opacity: 0; } }

/* аватар */
.avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; overflow: hidden; flex: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
