/* NO PONTO — tela unica, uma mao, sem scroll. */

:root {
  --fundo: #0b0e17;
  --tinta: #f2f5ff;
  --apagado: #8792ad;
  --acento: #00e5b0;
  --perigo: #ff3b5c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* A REGRA QUE SEGURA O LAYOUT INTEIRO.
   Um celular Android reporta entre ~330 e ~500 px CSS de largura dependendo do
   modelo e da opcao "Tamanho da tela" das configuracoes. Como o anel e
   desenhado proporcional a tela e o resto da interface e medido em rem, uma
   raiz fixa em 16px faz textos e botoes encolherem em relacao a tela nos
   aparelhos que reportam mais largura -- foi o bug de "num celular ficou tudo
   pequeno". Amarrando a raiz ao MENOR lado da tela (igual o anel faz), tudo
   acompanha junto -- e em paisagem a altura passa a mandar, senao os botoes
   nao cabem. */
html { font-size: clamp(14px, min(4.4vw, 4.7vh), 23px); }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--fundo);
  color: var(--tinta);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* nada de selecao, zoom por duplo toque ou realce de toque: isso e um jogo */
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

#tela {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- overlays ---------- */

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: max(0.8rem, env(safe-area-inset-top)) 1rem
           max(0.8rem, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 50%, rgba(11, 14, 23, 0.55), rgba(11, 14, 23, 0.93));
  animation: surgir 0.22s ease-out;
  /* o toque atravessa o overlay e chega no jogo; so botao intercepta */
  pointer-events: none;
}

.overlay button { pointer-events: auto; }

.overlay.oculto { display: none; }

/* Texto em cima, chamada e botoes embaixo: o meio da tela fica livre para o
   anel aparecer por tras, e o que e clicavel cai sob o polegar. */
.pilha { justify-content: space-between; }

.topo, .base {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: min(100%, 24rem);
}

.topo { padding-top: 4vh; }
.base { padding-bottom: 3vh; }

@keyframes surgir {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.titulo {
  font-size: 3.5rem;
  line-height: 0.88;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.dica, .chamada, .recorde, .rotulo, .detalhe {
  color: var(--apagado);
  font-size: 1rem;
  line-height: 1.45;
}

.chamada {
  color: var(--acento);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  animation: pulsar 1.6s ease-in-out infinite;
}

@keyframes pulsar {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 1; }
}

.rotulo {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 800;
}

.pontos {
  font-size: 6.8rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

/* ---------- botoes ---------- */

.botoes { gap: 0.6rem; }

.botao {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  /* min-height garante alvo de toque confortavel mesmo com fonte pequena */
  min-height: 3.4rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid rgba(242, 245, 255, 0.16);
  border-radius: 0.9rem;
  background: rgba(11, 14, 23, 0.6);
  color: var(--tinta);
  cursor: pointer;
  transition: transform 0.08s ease, opacity 0.15s ease;
}

.botao:active { transform: scale(0.97); }

.botao.primario {
  background: var(--acento);
  border-color: var(--acento);
  color: #04180f;
}

/* Botao de instalar: presente, mas nao disputa atencao com "jogar de novo" */
.botao.discreto {
  min-height: 2.9rem;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: var(--apagado);
  background: transparent;
}

.canto {
  position: fixed;
  top: max(0.6rem, env(safe-area-inset-top));
  right: max(0.6rem, env(safe-area-inset-right));
  z-index: 5;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  min-width: 3rem;
  min-height: 2.6rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: var(--apagado);
  cursor: pointer;
}

.canto[data-mudo="sim"] { text-decoration: line-through; opacity: 0.55; }

#ajuda-instalar .dica { text-align: left; line-height: 1.9; }
#ajuda-instalar strong { color: var(--tinta); font-weight: 700; }

/* Tela baixa (paisagem, ou celular curto): o titulo e o placar gigante nao
   cabem junto com os botoes. Encolher o que e enfeite, nunca o alvo de toque. */
@media (max-height: 560px) {
  .titulo { font-size: 2.4rem; }
  .pontos { font-size: 3.6rem; }
  .topo { padding-top: 1vh; }
  .base { padding-bottom: 1vh; }
  .dica { display: none; }
  .botao { min-height: 2.9rem; padding: 0.6rem 1rem; }
  .botoes { gap: 0.45rem; }
}

/* Reduzir movimento: mantem o jogo jogavel, corta o que so enfeita. */
@media (prefers-reduced-motion: reduce) {
  .overlay, .chamada { animation: none; }
}
