/* Abertura da Campanha: o Kaco dorme, sonha e acorda no trem.
   As cores e as letras são as do Expresso do Pampa (chegada-vagao.css), pra emenda não parecer outro jogo. */
:root {
  --verde-noite: #15251f;
  --verde-bilhete: #193c32;
  --creme: #fff4de;
  --creme-texto: #f9edcf;
  --dourado: #e5bd71;
  --dourado-claro: #f7d68f;
  --dourado-escuro: #c98a2b;
  --tempo-da-troca: 1.2s;
  --tempo-das-nuvens: 1.6s;
  color-scheme: dark;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--creme-texto);
  background: var(--verde-noite);
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: var(--verde-noite); }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 4px solid var(--dourado); outline-offset: 6px; }

/* O botão gigante: o Pedro ainda não lê, então ele chama pelo tamanho, pela cor e pelo brilho. */
.campanha {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 22%, #ffffffcc 0 1px, transparent 2px),
    radial-gradient(circle at 72% 14%, #ffffffaa 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 84% 62%, #ffffff99 0 1px, transparent 2px),
    radial-gradient(circle at 30% 78%, #ffffff88 0 1px, transparent 2px),
    radial-gradient(ellipse at 50% 120%, #2f6650 0%, var(--verde-bilhete) 45%, var(--verde-noite) 100%);
}
.campanha-botao {
  min-width: min(78vw, 560px);
  min-height: min(34vw, 190px);
  padding: 0 48px;
  border: 4px solid var(--creme);
  border-radius: 48px;
  background: linear-gradient(180deg, var(--dourado-claro), var(--dourado-escuro));
  color: var(--verde-bilhete);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(40px, 9vw, 84px);
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 10px 0 #8a5a17, 0 0 0 0 #f7d68f99;
  animation: campanha-chamando 1.8s ease-in-out infinite;
}
.campanha-botao:active { transform: translateY(6px); box-shadow: 0 4px 0 #8a5a17; }
@keyframes campanha-chamando {
  0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 10px 0 #8a5a17, 0 0 0 0 #f7d68f99; }
  50% { transform: translateY(-6px) scale(1.04); box-shadow: 0 16px 0 #8a5a17, 0 0 0 28px #f7d68f00; }
}

/* O filme: duas camadas de cena que se revezam, pra uma tela aparecer por cima da outra. */
.abertura-filme { position: fixed; inset: 0; background: #000; }
.abertura-cena {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity var(--tempo-da-troca) ease;
}
.abertura-cena.is-visivel { opacity: 1; }
.abertura-cena-fundo,
.abertura-cena-imagem {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.abertura-cena-fundo { filter: blur(28px) brightness(.65); transform: scale(1.15); }
.abertura-cena.is-visivel .abertura-cena-imagem { animation: cena-aproximando 18s linear forwards; }
.abertura-cena.is-visivel[data-sonho] .abertura-cena-imagem { animation: cena-flutuando 9s ease-in-out infinite; }
@keyframes cena-aproximando {
  from { transform: scale(1); }
  to { transform: scale(1.09); }
}
@keyframes cena-flutuando {
  0%, 100% { transform: scale(1.03) translateY(0); }
  50% { transform: scale(1.06) translateY(-1.2%); }
}

/* O vídeo da abertura (montado no After em 29/10/2026) cobre o filme inteiro, por cima das camadas de
   cena, que só aparecem se ele não carregar. */
.abertura-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.abertura-video[hidden] { display: none; }

/* A fala do narrador escrita embaixo, pequena: quem conta é a voz, a legenda é pra quem está junto. */
.abertura-legenda {
  position: absolute;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: min(860px, calc(100% - 32px));
  margin: 0;
  padding: 12px 22px;
  border: 1px solid #e7ce9d55;
  border-radius: 14px;
  background: #15382ee0;
  color: var(--creme);
  font-family: Georgia, serif;
  font-size: clamp(16px, 2.3vw, 24px);
  line-height: 1.4;
  text-align: center;
  transition: opacity .5s ease;
}
.abertura-legenda:empty { opacity: 0; }

/* A passagem do sonho: nuvens brancas e lilases crescem até cobrir a tela e depois se abrem. */
.sonho-nuvens {
  position: fixed;
  inset: -25%;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.6) rotate(-4deg);
  background:
    radial-gradient(circle at 22% 30%, #fff 0 13%, transparent 22%),
    radial-gradient(circle at 48% 22%, #fdf8ff 0 15%, transparent 25%),
    radial-gradient(circle at 76% 32%, #fff 0 12%, transparent 21%),
    radial-gradient(circle at 30% 64%, #f3ecff 0 14%, transparent 24%),
    radial-gradient(circle at 62% 70%, #fff 0 16%, transparent 26%),
    radial-gradient(circle at 86% 66%, #f7f1ff 0 11%, transparent 20%),
    radial-gradient(circle at 50% 48%, #ffffff 0 24%, #efe6ffee 40%, #d9ccf5cc 70%, #b9a8e6aa 100%);
  filter: blur(14px);
  transition: opacity var(--tempo-das-nuvens) ease, transform var(--tempo-das-nuvens) ease;
}
.sonho-nuvens.is-cobrindo { opacity: 1; transform: scale(1) rotate(0deg); }

.abertura-pular {
  position: fixed;
  z-index: 6;
  right: max(18px, env(safe-area-inset-right));
  top: max(18px, env(safe-area-inset-top));
  min-height: 60px;
  padding: 0 26px;
  border: 2px solid var(--creme);
  border-radius: 30px;
  background: #193c32d9;
  color: var(--creme);
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 4px 20px #0006;
}
.abertura-pular::after { content: ' \25B6\25B6'; font-size: 14px; letter-spacing: -2px; }
.abertura-pular:hover { background: #2d6650; }

/* Celular em pé: a tela 16:9 parada aparece inteira no meio, com ela mesma desfocada atrás. O vídeo
   não: ele enche a tela e corta os lados (pedido dele, 29/10/2026: "pegar a tela toda cortando dos lados"). */
@media (orientation: portrait) {
  .abertura-cena-imagem { object-fit: contain; }
}

/* Quem pediu menos movimento vê as telas paradas e as trocas mais curtas. */
@media (prefers-reduced-motion: reduce) {
  :root { --tempo-da-troca: .4s; --tempo-das-nuvens: .6s; }
  .campanha-botao,
  .abertura-cena.is-visivel .abertura-cena-imagem,
  .abertura-cena.is-visivel[data-sonho] .abertura-cena-imagem { animation: none; }
  .sonho-nuvens { transform: none; }
}
