:root {
  --red: #d90f14;
  --red-dark: #9e0a0e;
  --green: #1b7f3b;
  --green-dark: #0b4a21;
  --white: #ffffff;
  --cream: #fff7ea;
  --ink: #2b1a14;
}

* {
  box-sizing: border-box;
}

/* 1rem = 16px em 1920x1080 e escala com a tela (TVs 4K, ultrawide etc.); tudo abaixo usa rem. */
html {
  font-size: min(calc(100vw / 120), calc(100vh / 67.5));
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Inter", sans-serif;
  background: var(--cream);
  color: var(--ink);
}

html:fullscreen {
  cursor: none;
}

h1,
h2 {
  font-family: "Alfa Slab One", "Rockwell", Georgia, serif;
  font-weight: 400;
}

/* ---------- Telas (uma por vez, em tela cheia) ---------- */

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 3rem;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease, visibility 0s;
}

/* ---------- Tela do cronômetro ---------- */

.countdown-screen {
  background:
    repeating-linear-gradient(0deg, rgba(217, 15, 20, 0.05) 0 2.25rem, transparent 2.25rem 4.5rem),
    repeating-linear-gradient(90deg, rgba(217, 15, 20, 0.05) 0 2.25rem, transparent 2.25rem 4.5rem),
    radial-gradient(circle at 50% 30%, #ffffff 0%, var(--cream) 70%);
}

.logo-main {
  position: relative;
  width: 15rem;
  aspect-ratio: 1;
  margin-bottom: 0.75rem;
  overflow: hidden;
  border-radius: 50%;
  background: var(--white);
  border: 0.35rem solid var(--green);
  box-shadow: 0 0.5rem 0 var(--green-dark), 0 0.75rem 1.4rem rgba(0, 0, 0, 0.25);
}

/* O PNG tem margem branca grande; amplia para o emblema preencher o selo. */
.logo-main img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 170%;
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%);
}

.eyebrow {
  margin: 0 0 0.8rem;
  padding: 0.5rem 1.9rem;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--red);
  font-size: 9rem;
  line-height: 1.05;
  text-shadow: 0.2rem 0.2rem 0 rgba(0, 0, 0, 0.12);
}

.timer {
  display: grid;
  grid-template-columns: repeat(4, 24rem);
  gap: 2rem;
  margin: 2.5rem 0 2.8rem;
}

.time-box {
  display: grid;
  place-items: center;
  padding: 2rem 0.75rem 1.4rem;
  border-radius: 1.4rem;
  background: var(--white);
  border: 0.3rem solid var(--red);
  box-shadow: 0 0.5rem 0 var(--red-dark);
}

.time-box span {
  color: var(--red);
  font-family: "Alfa Slab One", Georgia, serif;
  font-size: 7rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.time-box label {
  margin-top: 1rem;
  padding: 0.35rem 1.3rem;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.date-range div {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 3.6rem;
  border-radius: 1rem;
  background: var(--green);
  border: 0.2rem dashed var(--white);
  outline: 0.2rem solid var(--green);
  color: var(--white);
}

.date-range span {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.9;
}

.date-range strong {
  font-family: "Alfa Slab One", Georgia, serif;
  font-size: 3.6rem;
  font-weight: 400;
}

/* ---------- Propagandas em tela cheia ---------- */

.ad-screen {
  overflow: hidden;
  padding: 0;
  background-size: 200% 200%;
  color: var(--white);
}

.ad-1 {
  --tag-fg: var(--red);
  background-image: linear-gradient(135deg, #8a0a0d, #d90f14, #ff4a3d, #8a0a0d);
}

.ad-2 {
  --tag-fg: var(--green);
  background-image: linear-gradient(135deg, #0b4a21, #1b7f3b, #3fb862, #0b4a21);
}

.ad-3 {
  --tag-fg: var(--red);
  background-image: linear-gradient(135deg, #1b7f3b, #0b4a21, #9e0a0e, #1b7f3b);
}

.ad-screen.active {
  animation: gradient-pan 8s ease-in-out infinite alternate;
}

/* Vídeo real (videos/propaganda-N.mp4): ocupa a tela toda sem cortar; se faltar o arquivo, some e fica a animação. */
.ad-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ad-video.failed {
  display: none;
}

.ad-screen.has-video .ad-content,
.ad-screen.has-video .ad-fx {
  display: none;
}

.ad-fx {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.ad-fx span {
  position: absolute;
  bottom: -8rem;
  font-size: 7rem;
  opacity: 0;
}

.ad-fx span:nth-child(1) { left: 6%; animation-delay: 0s; }
.ad-fx span:nth-child(2) { left: 22%; animation-delay: 1.6s; }
.ad-fx span:nth-child(3) { left: 40%; animation-delay: 0.8s; }
.ad-fx span:nth-child(4) { left: 58%; animation-delay: 2.4s; }
.ad-fx span:nth-child(5) { left: 74%; animation-delay: 1.2s; }
.ad-fx span:nth-child(6) { left: 90%; animation-delay: 2s; }

.screen.active .ad-fx span {
  animation-name: float-up;
  animation-duration: 7s;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}

.ad-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  height: 100%;
  padding: 10rem 8% 4rem;
  text-shadow: 0 0.25rem 1.4rem rgba(0, 0, 0, 0.5);
}

.screen.active .ad-content > * {
  animation: slide-up 0.9s ease-out both;
}

.screen.active .ad-content > :nth-child(2) {
  animation-delay: 0.25s;
}

.screen.active .ad-content > :nth-child(3) {
  animation-delay: 0.5s;
}

/* Barra de progresso vermelha (por cima do vídeo) */
.ad-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  width: 100%;
  height: 0.7rem;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
}

.screen.active .ad-progress {
  animation: progress var(--phase-ms, 30000ms) linear forwards;
}

@keyframes gradient-pan {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

@keyframes float-up {
  0% { transform: translateY(0) rotate(-8deg); opacity: 0; }
  15% { opacity: 0.9; }
  100% { transform: translateY(-115vh) rotate(18deg); opacity: 0.9; }
}

@keyframes slide-up {
  from { transform: translateY(2.5rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes progress {
  to { transform: scaleX(1); }
}

.promo-tag {
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  background: var(--white);
  color: var(--tag-fg, var(--red));
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: none;
  box-shadow: 0 0.3rem 0 rgba(0, 0, 0, 0.25);
}

.ad-screen h2 {
  margin: 0;
  max-width: 90rem;
  font-size: 8rem;
  line-height: 1.08;
}

.ad-screen p {
  margin: 0;
  max-width: 70rem;
  font-size: 3rem;
  font-weight: 500;
  line-height: 1.4;
}

/* ---------- Logo e cronômetro pequenos (só durante as propagandas) ---------- */

.logo-badge {
  position: fixed;
  top: 1.5rem;
  left: 2rem;
  z-index: 10;
  width: 8rem;
  height: 8rem;
  overflow: hidden;
  border-radius: 50%;
  background: var(--white);
  border: 0.35rem solid var(--green);
  box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.8s ease;
}

.logo-badge img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 11.6rem;
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%);
}

.mini-countdown {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  z-index: 10;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  background: var(--white);
  border: 0.3rem solid var(--red);
  box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity 0.8s ease;
}

body[data-mode="ad"] .mini-countdown,
body[data-mode="ad"] .logo-badge {
  opacity: 1;
}

.mini-label {
  color: var(--green);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mini-unit {
  font-weight: 700;
}

.mini-unit b {
  color: var(--red);
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
}
