/* O visual é silencioso (Lei 6). O céu ocupa tudo; o resto quase não existe. */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  /* Preto neutro só até o JS aplicar a cor do tema (a pele mora em tema.js). */
  background: #000;
}

#ceu {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* iOS: 100vh mente com a barra do Safari; o JS ainda fixa em px */
  cursor: grab;
  touch-action: none; /* pan/zoom são nossos, não do navegador */
}

#ceu.arrastando {
  cursor: grabbing;
}

/* --------------------------------------------- a estrela aberta (painel) */

#painel {
  position: fixed;
  top: max(26px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  pointer-events: none;
}

#painel-texto {
  margin: 0;
  max-width: 620px;
  text-align: center;
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  font-size: clamp(15px, 1.9vw, 18px);
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0.015em;
  color: rgba(228, 235, 255, 0.85);
  text-shadow: 0 1px 22px rgba(0, 0, 0, 0.7);
}

/* --------------------------------------------------------------- o ritual */

#ritual {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(15vh, calc(64px + env(safe-area-inset-bottom)));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

#ritual.trocando { opacity: 0; transition-duration: 0.45s; }

#ritual.recolhido { opacity: 0; transition-duration: 1.4s; }
#ritual.recolhido * { pointer-events: none !important; }

#ritual-rotulo {
  margin: 0;
  text-align: center;
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 300;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: rgba(226, 233, 255, 0.78);
  text-shadow: 0 1px 26px rgba(0, 0, 0, 0.65);
}

.ritual-linha {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(520px, 86vw);
  pointer-events: auto;
}

#ritual-campo {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(215, 225, 255, 0.26);
  color: rgba(238, 243, 255, 0.92);
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 17px;
  font-weight: 300;
  text-align: center;
  padding: 9px 2px;
  outline: none;
  caret-color: rgba(238, 243, 255, 0.9);
  border-radius: 0;
  transition: border-color 0.5s ease;
}

#ritual-campo:focus { border-bottom-color: rgba(215, 225, 255, 0.55); }

#ritual-enviar {
  background: transparent;
  border: 0;
  color: rgba(215, 225, 255, 0.45);
  font-size: 21px;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
  transition: color 0.4s ease;
}

#ritual-enviar:hover, #ritual-enviar:focus-visible { color: rgba(235, 241, 255, 0.85); }

#ritual-nota {
  min-height: 1.3em;
  margin: 0;
  text-align: center;
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 13.5px;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: rgba(196, 208, 240, 0.62);
}

#ritual-nota a {
  color: rgba(226, 233, 255, 0.88); /* o único caminho do passo precisa ser visível */
  text-decoration: underline;
  text-underline-offset: 3px;
  pointer-events: auto;
}

/* --------------------------------------------- ações da estrela aberta */

#painel-acoes {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 10px;
  pointer-events: auto;
}

#painel-acoes a, #painel-acoes button {
  background: transparent;
  border: 0;
  padding: 2px 2px;
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: rgba(206, 217, 246, 0.55);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.4s ease;
}

#painel-acoes a:hover, #painel-acoes button:hover,
#painel-acoes a:focus-visible, #painel-acoes button:focus-visible {
  color: rgba(235, 241, 255, 0.9);
}

#painel-nota {
  min-height: 1.2em;
  margin: 6px 0 0;
  text-align: center;
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 12.5px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: rgba(196, 208, 240, 0.6);
}

/* A pergunta-mãe, mostrada pequena durante o desdobrar. */
#ritual-origem {
  margin: 0 0 2px;
  max-width: min(520px, 86vw);
  text-align: center;
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 13px;
  font-weight: 300;
  font-style: italic;
  line-height: 1.5;
  color: rgba(196, 208, 240, 0.55);
}

/* "minha presença" — um sussurro no canto, só para quem está dentro. */
#minha-presenca {
  position: fixed;
  right: 18px;
  bottom: max(16px, env(safe-area-inset-bottom));
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 12.5px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: rgba(206, 217, 246, 0.35);
  text-decoration: none;
  transition: color 0.4s ease;
}
#minha-presenca:hover { color: rgba(235, 241, 255, 0.8); }

/* "céu daqui" — o outro sussurro de canto: o lugar de onde se olha (Lei 4). */
#ceu-daqui {
  position: fixed;
  left: 18px;
  bottom: max(16px, env(safe-area-inset-bottom));
  background: transparent;
  border: 0;
  padding: 0;
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 12.5px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: rgba(206, 217, 246, 0.35);
  cursor: pointer;
  transition: color 0.4s ease;
}
#ceu-daqui:hover { color: rgba(235, 241, 255, 0.8); }

/* ------------------------------------------------- a página da presença */

.pagina-presenca {
  overflow: auto;
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  color: rgba(220, 229, 252, 0.85);
}

.voltar-ao-ceu {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: 22px;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: rgba(206, 217, 246, 0.45);
  text-decoration: none;
  transition: color 0.4s ease;
}
.voltar-ao-ceu:hover { color: rgba(235, 241, 255, 0.85); }

#presenca {
  max-width: 560px;
  margin: 0 auto;
  padding: 16vh 24px 12vh;
}

#pergunta-atual {
  margin: 0 0 8vh;
  font-size: clamp(21px, 3vw, 27px);
  font-weight: 300;
  line-height: 1.45;
  text-align: center;
}
#pergunta-atual a { color: rgba(238, 243, 255, 0.94); text-decoration: none; }
#pergunta-atual a:hover { text-shadow: 0 0 22px rgba(180, 200, 255, 0.5); }

#presenca section { margin-bottom: 6vh; }

#presenca h2 {
  margin: 0 0 14px;
  font-size: 12.5px;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: rgba(196, 208, 240, 0.42);
}

#presenca ul { list-style: none; margin: 0; padding: 0; }

#presenca li {
  padding: 9px 0;
  border-bottom: 1px solid rgba(215, 225, 255, 0.06);
  font-size: 15.5px;
  font-weight: 300;
  line-height: 1.5;
}

#presenca li a { color: rgba(222, 230, 252, 0.82); text-decoration: none; transition: color 0.3s ease; }
#presenca li a:hover { color: rgba(240, 245, 255, 0.98); }

.marca-reconhecida { color: rgba(240, 226, 180, 0.85); }
li.reconhecida a { color: rgba(238, 232, 210, 0.9); }

#sussurro {
  margin-top: 6vh;
  text-align: center;
  font-size: 12.5px;
  font-weight: 300;
  color: rgba(240, 226, 180, 0.45);
}

#meu-lugar {
  margin-top: 8vh;
  text-align: center;
  font-size: 12.5px;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: rgba(196, 208, 240, 0.42);
}
#meu-lugar button {
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: rgba(206, 217, 246, 0.6);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
#meu-lugar button:hover { color: rgba(235, 241, 255, 0.9); }
#meu-lugar input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(215, 225, 255, 0.26);
  color: rgba(238, 243, 255, 0.9);
  font: inherit;
  text-align: center;
  padding: 4px 2px;
  outline: none;
  width: min(320px, 70vw);
}

/* --------------------------------------------------- a fila da guarda */

.pagina-guarda #fila { max-width: 640px; margin: 0 auto; padding: 12vh 24px 12vh; }

#guarda-vazia {
  text-align: center;
  font-size: 14px;
  font-weight: 300;
  color: rgba(196, 208, 240, 0.5);
}

.guarda-item {
  margin-bottom: 7vh;
  padding-bottom: 5vh;
  border-bottom: 1px solid rgba(215, 225, 255, 0.08);
}

.guarda-pergunta {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.5;
  color: rgba(238, 243, 255, 0.92);
}

.guarda-tipo {
  margin: 0 0 16px;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: rgba(240, 226, 180, 0.5);
}

.guarda-contexto {
  margin: 5px 0;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.55;
  color: rgba(206, 217, 246, 0.6);
}
.guarda-rotulo { color: rgba(196, 208, 240, 0.38); letter-spacing: 0.06em; }

.guarda-acoes { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; }
.guarda-acoes button {
  background: transparent;
  border: 0;
  padding: 2px 0;
  font: 300 13px ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 0.3s ease;
}
.guarda-acender { color: rgba(190, 225, 200, 0.65); }
.guarda-acender:hover { color: rgba(210, 245, 220, 0.95); }
.guarda-apagar { color: rgba(235, 190, 190, 0.55); }
.guarda-apagar:hover { color: rgba(250, 205, 205, 0.9); }

/* ----------------------------------------------------------------- a dica */

#dica {
  position: fixed;
  bottom: 22px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-family: ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: rgba(215, 225, 255, 0.38);
  pointer-events: none;
  user-select: none;
  opacity: 1;
  transition: opacity 2.4s ease;
}

#dica.some {
  opacity: 0;
}
