/* =========================================================
   mobile.css — o site no celular (iPhone/Safari e Android).
   Tudo aqui só vale em ecrãs estreitos (até 760 px de largura), menos
   o botão "Mais", que no computador fica escondido.

   O que muda no celular:
   - menu em baixo com 4 abas + "Mais" (as outras abas e o perfil);
   - margens para a "barra" do iPhone (safe-area);
   - nada pode passar da largura do ecrã;
   - campos com letra de 16 px (senão o Safari dá zoom ao tocar).
   ========================================================= */

/* O botão "Mais" e a folha só existem no celular. */
.nav-mais { display: none; }

/* ---------- A folha "Mais" (abre de baixo para cima) ---------- */
.folha-mais {
  width: 100%; max-width: 520px;
  margin: auto auto 0;            /* colada ao fundo do ecrã */
  padding: 0;
  border: 0;
  border-radius: 26px 26px 0 0;
  background: var(--papel);
  color: var(--tinta);
  box-shadow: 0 -10px 40px rgb(0 0 0 / .2);
}
.folha-mais::backdrop { background: rgb(30 20 35 / .4); }
.folha-mais[open] { animation: folha-sobe 240ms var(--mola); }
@keyframes folha-sobe { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
.folha-corpo {
  display: grid; gap: 16px;
  padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
}
.folha-pega { justify-self: center; width: 44px; height: 5px; border-radius: 99px; background: var(--linha); }
.folha-abas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.folha-abas a {
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 10px 14px;
  border-radius: var(--raio-m);
  background: var(--branco);
  box-shadow: 0 0 0 1.5px var(--linha);
  color: var(--tinta); text-decoration: none;
  font-family: var(--fonte-titulo); font-weight: 600;
}
.folha-abas a svg { width: 22px; height: 22px; flex: none; color: var(--acento-tinta); }
.folha-abas a[aria-current="page"] { box-shadow: 0 0 0 2.5px var(--acento-tinta); }
.folha-perfil { justify-content: flex-start; gap: 10px; width: 100%; }
.folha-perfil svg { width: 32px; height: 32px; }
.folha-corpo .estado-sync { justify-content: center; }

@media (max-width: 760px) {
  /* ---------- Nada passa da largura do ecrã ---------- */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .tela { min-width: 0; padding: calc(18px + env(safe-area-inset-top)) 14px calc(104px + env(safe-area-inset-bottom)); }
  .hoje-grid > *, .questoes-grid > *, .pixels-grid > *, .crono-grid > *, .amigos-grid > *,
  .amigos-coluna > *, .colecao-topo > *, .mural-grid > *, .card { min-width: 0; }
  .card { padding: 22px 18px; }
  .entrada { min-height: 100dvh; padding: 56px 12px 24px; }
  .entrada-card { padding: 36px 20px 26px; }

  /* ---------- Menu de baixo: 4 abas + "Mais" ---------- */
  .sidebar {
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    gap: 0;
    overflow: visible;
  }
  /* 4 abas + "Mais": cada um com a mesma largura (1/5 do ecrã). */
  .nav { flex: 4 1 0; min-width: 0; justify-content: space-around; gap: 0; }
  .nav a:nth-child(n+5) { display: none; }
  .nav a, .nav-mais {
    flex: 1; min-width: 0;
    flex-direction: column; justify-content: center; gap: 2px;
    min-height: 54px; padding: 6px 2px;
    font-size: .72rem;
    border-radius: 16px;
  }
  .nav a span, .nav-mais span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-mais {
    flex: 1 1 0;
    display: flex; align-items: center;
    border: 0; background: transparent; color: var(--tinta);
    font-family: var(--fonte-titulo); font-weight: 500;
    cursor: pointer;
  }
  .nav-mais svg { width: 24px; height: 24px; }
  .nav-mais.ativo { background: var(--branco); box-shadow: var(--sombra-sticker); }
  .nav-mais.ativo svg { color: var(--acento-tinta); }

  /* Avisos (toast) por cima do menu de baixo. */
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

  /* ---------- Hoje ---------- */
  .hoje-topo { margin-bottom: 20px; gap: 10px; }
  .hoje-acoes { gap: 8px; width: 100%; }
  .hoje-acoes .botao { min-height: 42px; padding: 8px 14px; font-size: .92rem; }
  .hoje-acoes [data-flutuante] { display: none; }   /* janela flutuante não existe no celular */
  .relogio-card { position: relative; top: auto; }
  .anel-wrap { width: min(100%, 280px); }

  /* ---------- Objetivos: botões numa linha própria ---------- */
  .objetivo:not(.objetivo--tarefa) {
    grid-template-columns: 1fr auto;
    grid-template-areas: "corpo acoes" "controles controles";
    padding: 14px;
  }
  .objetivo:not(.objetivo--tarefa) .objetivo-corpo { grid-area: corpo; }
  .objetivo:not(.objetivo--tarefa) .objetivo-acoes { grid-area: acoes; align-self: start; }
  .objetivo:not(.objetivo--tarefa) > .objetivo-botoes,
  .objetivo:not(.objetivo--tarefa) > a.botao { grid-area: controles; justify-self: start; }
  .objetivo--tarefa { gap: 10px; padding: 12px; }
  .objetivo-form { grid-template-columns: 1fr; }

  /* ---------- Humor: calendário cabe no ecrã ---------- */
  .pixels-topo { margin-bottom: 20px; }
  .pixels-topo .botao { min-height: 42px; padding: 8px 14px; }
  .grade-mes { gap: 4px; }
  .grade-mes .pixel { min-height: 0; border-radius: 8px; }
  .pixel-dia { font-size: .9rem; }
  .pixel-nivel { right: 3px; bottom: 1px; font-size: .62rem; }
  .pixels-nav h2 { font-size: 1.2rem; }
  .pixels-legenda { font-size: .8rem; }
  .grade-ano { font-size: .7rem; }

  /* Cartão "como foi o dia?": as 5 carinhas numa linha que cabe. */
  .escala-opcoes { gap: 4px; }
  .escala-opcao span { min-height: 86px; padding: 8px 2px; gap: 4px; }
  .escala-opcao small { font-size: .68rem; }
  .escala-opcao .carinha { width: 34px; height: 34px; }
  .humor-mascote { width: 58px; height: 58px; }
  .humor-cabeca h2 { font-size: 1.3rem; }

  /* ---------- Diálogos ---------- */
  dialog.dialogo { width: calc(100vw - 16px); max-height: calc(100dvh - 24px); }
  .dialogo-corpo { padding: 24px 18px; }
  .mascotes { grid-template-columns: repeat(3, 1fr); }
  .amostras { gap: 8px; }
  .amostra span { width: 56px; height: 56px; }

  /* ---------- Coleção: stickers em 3 colunas ---------- */
  .stickers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stickers li { padding: 10px 4px 10px; }
  .sticker { width: 54px; height: 54px; }
  .stickers li .suave { font-size: .7rem; }
  .stickers li strong { font-size: .85rem; }

  /* ---------- Questões ---------- */
  .botao.grande { min-height: 96px; }

  /* ---------- Cronograma ---------- */
  .crono-grid { gap: 28px; }
  .abas button { min-width: 44px; padding: 6px 10px; }

  /* ---------- Modo foco ---------- */
  .modo-foco .tela { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .modo-foco .hoje-grid { grid-template-columns: minmax(0, 1fr); }
  .modo-foco .relogio-card { width: 100%; }
  .foco-questoes-botoes .botao { min-height: 48px; padding: 8px 10px; }

  /* ---------- Mural ---------- */
  .post { padding: 14px 12px; gap: 10px; }
  .reagir-painel { padding: 10px; min-width: 0; }
  .reagir-topo { min-width: 0; }
  .mural-postar { padding: 16px 14px 12px; }
  .cara-peca { width: 40px; height: 40px; }
}

/* Telemóveis e tablets (toque): campos com 16 px para o Safari não dar
   zoom ao tocar num campo. */
@media (hover: none) and (pointer: coarse) {
  input, select, textarea { font-size: max(16px, 1em); }
}

.folha-corpo:focus { outline: none; }
