/* Vila Mini · página «brevemente» (ecrã único, sem scroll) */

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--creme);
  color: var(--tinta);
  font-family: var(--font-texto);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; }

/* ---------- Topo ---------- */

.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) var(--gutter) 0;
}

.marca { display: block; border-radius: 12px; }
.marca:focus-visible { outline: 3px solid var(--mostarda); outline-offset: 6px; }

.logo {
  display: block;
  height: clamp(52px, 9svh, 76px);
  width: auto;
  overflow: visible;
}

.peca {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: cair-logo .6s cubic-bezier(.3, .7, .4, 1) both;
  animation-delay: calc(.15s + var(--i) * .06s);
}
@keyframes cair-logo {
  0%   { transform: translateY(-420px); }
  55%  { transform: translateY(0) scale(1.1, .88); }
  75%  { transform: translateY(-10px) scale(.97, 1.03); }
  100% { transform: none; }
}

/* «brevemente» como no Post 3: minúsculas, sublinhado mostarda */
.selo {
  position: relative;
  margin: 0;
  padding-bottom: 7px;
  color: var(--tinta-suave);
  font-family: var(--font-titulo);
  font-weight: 600;
  font-size: clamp(1.05rem, 3.4vw, 1.3rem);
  letter-spacing: .01em;
  animation: surgir .5s ease-out 1s both;
}
.selo::after {
  content: "";
  position: absolute;
  left: -6%; right: -6%; bottom: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--mostarda);
  transform-origin: center;
  animation: crescer .5s ease-out 1.3s both;
}

/* ---------- Centro ---------- */

.centro {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(4px, 2svh, 24px) var(--gutter) 0;
  text-align: center;
}

.titulo {
  margin: 0;
  font-family: var(--font-titulo);
  font-weight: 600;
  font-size: clamp(1.7rem, min(7vw, 6.4svh), 3.7rem);
  line-height: 1.06;
  letter-spacing: -.01em;
  animation: surgir .7s ease-out .5s both;
}
.titulo span { display: block; color: var(--terracota-escuro); }

.estado {
  margin: clamp(6px, 1.4svh, 14px) 0 0;
  font-family: var(--font-titulo);
  font-weight: 500;
  font-size: clamp(1rem, min(3.4vw, 2.6svh), 1.3rem);
  color: var(--tinta-suave);
  animation: surgir .6s ease-out .8s both;
}

.dica,
.segredo {
  margin: clamp(6px, 1.4svh, 12px) 0 0;
  font-size: clamp(.9rem, 2.6vw, 1rem);
  color: var(--tinta-suave);
}

.dica {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  opacity: 0;
  transition: opacity .5s ease;
}
.dica.visivel { opacity: 1; }
.dica-bloco {
  width: 14px; height: 14px;
  border: 2px dashed var(--terracota-escuro);
  border-radius: 4px;
  animation: saltar 1.4s ease-in-out infinite;
}
@keyframes saltar {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-6px); }
}

.segredo { display: none; }
.segredo a {
  color: var(--terracota-escuro);
  font-weight: 700;
  text-underline-offset: 3px;
}

body.fim .dica { display: none; }
body.fim .segredo { display: block; animation: surgir .6s ease-out both; }

/* ---------- Palco: a vila ---------- */

.palco {
  all: unset;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1180px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: clamp(8px, 2svh, 20px);
  cursor: pointer;
  touch-action: manipulation;
}
.palco:focus-visible .chao { stroke: var(--mostarda); stroke-width: 4; }
body.fim .palco { cursor: default; }

.cena {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chao {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: crescer .8s cubic-bezier(.3, .7, .4, 1) .3s both;
}
@keyframes crescer {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.bloco,
.casa {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.silhueta {
  opacity: .4;
  transition: opacity .5s ease;
}
.silhueta > * {
  fill: none;
  stroke: var(--tinta-suave);
  stroke-width: 2;
  stroke-dasharray: 7 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.silhueta.feita { opacity: 0; }

.fantasma {
  fill: color-mix(in srgb, var(--terracota) 12%, transparent);
  stroke: var(--terracota-escuro);
  stroke-width: 2.5;
  stroke-dasharray: 8 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: respirar 1.8s ease-in-out infinite;
}
.fantasma.chamar { animation: respirar 1.8s ease-in-out infinite, chamar .9s ease-in-out infinite; }
@keyframes respirar {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}
@keyframes chamar {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-10px); }
}

.pisca {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation:
    aparecer .35s cubic-bezier(.3, 1.6, .5, 1) both,
    piscar 4.8s ease-in-out 1s infinite;
}
.pisca:nth-of-type(2n) { animation-delay: 0s, 1.6s; }
.pupila { transition: transform .3s ease-out; }
@keyframes aparecer {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
@keyframes piscar {
  0%, 93%, 100% { transform: scaleY(1); }
  96%           { transform: scaleY(.1); }
}

/* Casa mistério */
.misterio-contorno {
  fill: none;
  stroke: var(--tinta-suave);
  stroke-width: 3;
  stroke-dasharray: 10 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.misterio-pergunta {
  font-family: var(--font-titulo);
  font-weight: 600;
  font-size: 44px;
  fill: var(--tinta-suave);
  text-anchor: middle;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: balancar 3s ease-in-out infinite;
}
@keyframes balancar {
  0%, 100% { transform: rotate(-6deg); }
  50%      { transform: rotate(6deg); }
}
.misterio-porta { opacity: 0; transition: opacity .8s ease; }
.misterio-luz {
  opacity: 0;
  transition: opacity 1.2s ease;
}
body.fim .misterio-pergunta { opacity: 0; transition: opacity .4s ease; }
body.fim .misterio-porta { opacity: 1; }
body.fim .misterio-luz { opacity: 1; animation: brilhar 2.4s ease-in-out infinite; }
@keyframes brilhar {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; }
}

/* ---------- Rodapé ---------- */

.rodape {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "local prog redes";
  align-items: center;
  gap: 12px;
  padding: 0 var(--gutter) max(16px, env(safe-area-inset-bottom));
  font-family: var(--font-titulo);
  font-weight: 500;
  color: var(--tinta-suave);
  animation: surgir .6s ease-out 1.2s both;
}

.local { grid-area: local; margin: 0; font-size: .98rem; }

.progresso {
  grid-area: prog;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.progresso li {
  width: 12px; height: 12px;
  border: 1.5px dashed var(--tinta-suave);
  border-radius: 3px;
  opacity: .55;
  transition: background-color .3s ease, border-color .3s ease, opacity .3s ease, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.progresso li.cheio {
  border: 0;
  opacity: 1;
  transform: scale(1.12);
}

.fim-acoes { grid-area: prog; display: none; }
.recomecar {
  padding: 8px 18px;
  background: none;
  border: 2px solid var(--terracota-escuro);
  border-radius: var(--raio);
  color: var(--terracota-escuro);
  font-family: var(--font-titulo);
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.recomecar:hover { background: var(--terracota-escuro); color: var(--creme); }
.recomecar:focus-visible { outline: 3px solid var(--mostarda); outline-offset: 3px; }
body.fim .progresso { display: none; }
body.fim .fim-acoes { display: block; animation: surgir .5s ease-out .4s both; }

.redes {
  grid-area: redes;
  justify-self: end;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.redes a {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 2px solid var(--terracota-escuro);
  border-radius: 50%;
  color: var(--terracota-escuro);
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
.redes a:hover { background: var(--terracota-escuro); color: var(--creme); transform: translateY(-2px); }
.redes a:focus-visible { outline: 3px solid var(--mostarda); outline-offset: 3px; }
.redes svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.redes svg .cheio { fill: currentColor; stroke: none; }

@keyframes surgir {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Telemóvel ---------- */

@media (max-width: 640px) {
  .rodape {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "prog prog"
      "local redes";
    row-gap: 10px;
  }
  .local { font-size: .9rem; }
  .progresso { gap: 4px; }
}

/* ---------- Movimento reduzido ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition: none !important;
  }
}
