#app {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.view {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: calc(12px + var(--safe-top)) var(--gutter) calc(var(--tab-h) + 24px + var(--safe-bottom));
}

.page { animation: page-in 0.35s var(--ease) both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ── Açılış ── */
.boot {
  display: grid;
  place-items: center;
  gap: 18px;
  min-height: 70vh;
}
.boot-logo {
  font-family: var(--font-display);
  font-size: 44px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
}
.boot-spin {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent-2);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sol ikon çubuğu (masaüstü) ── */
.sidebar {
  display: none;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  width: var(--nav-w);
  flex: 0 0 var(--nav-w);
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 4px;
  background: linear-gradient(180deg, var(--nav-bg) 0%, var(--nav-bg2) 100%);
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.25);
  z-index: 20;
}
.sidebar .nav-sep { width: 36px; height: 1px; background: var(--line-strong); margin: 10px 0; }
.sidebar .nav-spacer { flex: 1; }

.nav-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.72);
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.nav-btn svg { width: 24px; height: 24px; }
.nav-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; transform: translateY(-1px); }
.nav-btn.active { background: #fff; color: var(--nav-bg); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }
.nav-btn .nav-tip {
  position: absolute; left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: #fff; color: var(--bg0);
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.nav-btn:hover .nav-tip { opacity: 1; transform: translateY(-50%); }

/* ── Alt sekme çubuğu (mobil) ── */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(24, 9, 44, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.tab-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  font-size: 11px; font-weight: 600;
  color: var(--muted);
  transition: color 0.2s;
}
.tab-btn svg { width: 22px; height: 22px; }
.tab-btn.active { color: #fff; }
.tab-btn.active svg { filter: drop-shadow(0 0 8px var(--accent-2)); color: var(--accent-2); }

/* ── Üst çip (bakiye + profil) ── */
.topchip {
  position: fixed;
  top: calc(10px + var(--safe-top));
  right: var(--gutter);
  z-index: 25;
  display: flex; align-items: center; gap: 6px;
}
.chip-wallet {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px 0 10px;
  border-radius: var(--radius-pill);
  background: rgba(18, 6, 32, 0.75);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(12px);
  color: #fff; font-weight: 600; font-size: 13px;
}
.chip-wallet svg { width: 16px; height: 16px; color: var(--gold); }
.chip-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-deep); color: #fff; font-weight: 700; font-size: 14px;
  border: 1px solid var(--line-strong); overflow: hidden;
}
.chip-avatar img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 900px) {
  .sidebar { display: flex; }
  .tabbar { display: none; }
  .view { padding-bottom: 48px; }
}

/* Telegram Mini App tam ekran: üstte boşluk */
body.tg .view { padding-top: calc(16px + var(--safe-top)); }
