/* ============================================================
   layout — casca do app: topo, conteúdo, barra de baixo
   ============================================================ */

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

/* ---------- topo ---------- */
.topo {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: rgba(10, 14, 12, 0.86);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}

.topo-marca {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--text);
}
.topo-marca em { font-style: normal; color: var(--green); }

.topo-voltar {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 17px;
  flex: 0 0 auto;
}
.topo-voltar:active { background: var(--surface-2); }

.topo-titulo {
  font-size: 16px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.topo-acoes { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.icone-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 17px;
  transition: background 0.15s, color 0.15s;
}
.icone-btn:active, .icone-btn:hover { background: var(--surface-2); color: var(--text); }

/* ---------- conteúdo ---------- */
.conteudo {
  flex: 1;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 14px 14px calc(var(--nav-h) + 26px + env(safe-area-inset-bottom));
}
.conteudo.sem-padding { padding-left: 0; padding-right: 0; }

.secao-bloco { margin-bottom: 22px; }
.secao-bloco:last-child { margin-bottom: 0; }

.titulo-linha {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.titulo-linha h2 { font-size: 15px; letter-spacing: 0.2px; }
.titulo-linha a { font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------- barra de baixo ---------- */
.barra {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  align-items: stretch;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(10, 14, 12, 0.92);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-top: 1px solid var(--line-soft);
}

.barra-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  border: none; background: none;
  color: var(--muted);
  font-size: 10.5px; font-weight: 600;
  padding: 0;
  transition: color 0.15s;
  position: relative;
}
.barra-item .ic { font-size: 20px; line-height: 1; }
.barra-item.ativo { color: var(--green); }
.barra-item.ativo::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 2.5px; border-radius: 0 0 3px 3px;
  background: var(--green);
}

/* botão do meio: capturar */
.barra-capturar {
  flex: 0 0 auto;
  width: 62px;
  display: grid; place-items: center;
  border: none; background: none;
  padding: 0;
}
.barra-capturar .bola {
  width: 50px; height: 50px;
  border-radius: var(--r-full);
  display: grid; place-items: center;
  background: var(--bg);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s;
  margin-top: -16px;
  border: 3px solid var(--line-soft);
}
.barra-capturar .bola svg { width: 40px; height: 40px; display: block; }
.barra-capturar:active .bola { transform: scale(0.9); }

/* ---------- telas cheias (login, câmera, pokédex) ---------- */
.tela-cheia {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: var(--bg);
}

@media (min-width: 900px) {
  .conteudo { max-width: 680px; }
}
