:root {
  --bg: #000;
  --fg: #fff;
  --muted: #8a8a8a;
  --line: #262626;
  --card: #0e0e0e;
  --card-hover: #1a1a1a;
  --accent: #fff;
  --accent-ink: #000;
  --gap: clamp(12px, 2.5vw, 28px);
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Palco ---------- */
.stage {
  position: fixed;
  inset: 0;
  bottom: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

/* Slide como imagem */
.slide-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.slide-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Legenda/subtítulo do slide de capa (logo) ---------- */
.cover-caption {
  position: absolute;
  left: 50%;
  top: 63%; /* logo fica no centro do palco; legenda um pouco abaixo dele */
  transform: translateX(-50%);
  z-index: 3;
  width: max-content;
  max-width: 90vw;
  text-align: center;
  color: #cfcfcf;
  font-family: "Times New Roman", Times, serif;
  font-style: italic;
  font-size: clamp(13px, 1.6vw, 18px);
  letter-spacing: 0.01em;
  line-height: 1.5;
}

/* ---------- Mídia embutida (vídeo/GIF/link) sobre o placeholder do slide ---------- */
/* A camada cobre o retângulo visível da imagem (posicionada via JS), mas não
   captura cliques: só o player/link captura, deixando as laterais navegáveis
   quando o retângulo não cobre 100% do slide. */
.media-layer {
  position: absolute;
  z-index: 6;
  pointer-events: none;
}
.media-holder {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  overflow: hidden;
}
.media-el {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.media-el.gif { object-fit: contain; }
/* Player vertical (Shorts): ocupa a altura do placeholder mantendo 9:16. */
.media-el.vertical {
  width: auto;
  height: 100%;
  aspect-ratio: 9 / 16;
  max-width: 100%;
}
/* Overlay de link externo: retângulo transparente clicável sobre a imagem. */
.media-el.link {
  background: transparent;
  cursor: pointer;
}

/* ---------- Zonas de clique para navegar ---------- */
.tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  z-index: 2;
  cursor: pointer;
  background: transparent;
  border: 0;
}
.tap-zone.left { left: 0; }
.tap-zone.right { right: 0; }

/* ---------- Painel de votação ---------- */
.vote-panel {
  position: absolute;
  left: 50%;
  bottom: clamp(12px, 3vh, 34px);
  transform: translateX(-50%);
  width: min(1120px, 94vw);
  z-index: 5;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(12px, 2vw, 20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  /* texto do painel de votação em Manrope */
  font-family: "Manrope", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

.vote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.vote-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: clamp(13px, 1.5vw, 16px);
  color: var(--fg);
}
.terr-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  background: var(--fg);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: clamp(12px, 1.4vw, 14px);
  letter-spacing: 0.01em;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.terr-name-inline {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.vote-hint {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.reactions {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
}

.reaction {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--fg);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  text-align: center;
  font-family: inherit; /* botão não herda a fonte por padrão; herda o Times do painel */
}
.reaction:hover { background: var(--card-hover); transform: translateY(-3px); }
.reaction .emoji { font-size: clamp(22px, 2.4vw, 30px); line-height: 1; }
.reaction .label { font-size: 11px; color: var(--muted); line-height: 1.15; }

.reaction.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.reaction.selected .label { color: var(--accent-ink); }

.vote-panel.voted .reaction:not(.selected) { opacity: 0.4; }
.vote-panel.voted .reaction { cursor: default; }
.vote-panel.voted .reaction:hover { transform: none; }

.vote-done {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  min-height: 14px;
}

/* ---------- Página de intro / seletor ---------- */
/* O texto de explicação da votação usa Manrope */
.doc.intro {
  font-family: "Manrope", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}
.doc.intro h1 { font-weight: 800; }
/* O parágrafo "Você vai passar..." em Times */
.doc.intro .lead {
  font-family: "Times New Roman", Times, serif;
}

/* Aviso sobre os vídeos dos sinais / PDF em anexo */
.intro-note {
  margin: 22px 0 4px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid #d8b24a;
  border-radius: 10px;
  background: rgba(216, 178, 74, 0.06);
  color: #e6e6e6;
  font-size: clamp(13px, 1.5vw, 15px);
  line-height: 1.45;
  max-width: 62ch;
}

.doc {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px);
}
.doc-inner { width: min(880px, 100%); }

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.doc h1 {
  font-size: clamp(34px, 6vw, 68px);
  line-height: 0.98;
  font-weight: 700;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}
.doc .lead {
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.5;
  color: #d6d6d6;
  max-width: 62ch;
}
.steps {
  margin: 28px 0 8px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: clamp(15px, 1.7vw, 17px);
  color: #cfcfcf;
}
.steps .num {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; color: var(--fg);
}

.legend {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.legend h2 {
  font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 14px;
}
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px 20px;
}
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.legend-item .emoji { font-size: 24px; }

.start-btn {
  margin-top: 34px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--fg);
  color: #000;
  border: 0;
  border-radius: 999px;
  padding: 14px 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.start-btn:hover { transform: translateY(-2px); }

/* ---------- Seletor de sprint ---------- */
.sprint-picker {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 640px;
}
.sprint-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  cursor: pointer;
  text-align: left;
  color: var(--fg);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.sprint-card:hover { background: var(--card-hover); transform: translateY(-3px); border-color: #3a3a3a; }
.sprint-card .sprint-name { font-size: 22px; font-weight: 700; }
.sprint-card .sprint-desc { font-size: 13px; color: var(--muted); }
.sprint-card .sprint-progress { font-size: 12px; color: var(--muted); margin-top: 6px; }

.results-link-row { margin-top: 26px; }

/* ---------- Página de resumo ---------- */
/* Alinha ao topo: a lista de territórios costuma ser mais alta que a tela.
   Com align-items:center (herdado de .doc) o topo da lista fica fora da
   área rolável e os primeiros itens somem. */
.summary { padding: clamp(24px, 5vw, 56px); align-items: flex-start; }
.summary h1 {
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.summary .sub { color: var(--muted); margin-bottom: 30px; font-size: 15px; }

.summary-section { margin-bottom: 40px; }
.summary-section-title {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 4px;
}

.terr-card {
  border-top: 1px solid var(--line);
  padding: 22px 0;
}
.terr-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.terr-name { font-size: clamp(18px, 2.4vw, 26px); font-weight: 700; }
.terr-name span { color: var(--muted); font-weight: 400; margin-right: 10px; }
.terr-total { color: var(--muted); font-size: 14px; white-space: nowrap; }

.winner-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: #141414; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; font-size: 13px; margin-left: 12px;
}

.bars { display: grid; gap: 8px; }
.bar-row {
  display: grid;
  grid-template-columns: 200px 1fr 56px;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.bar-label { display: flex; align-items: center; gap: 8px; color: #d0d0d0; }
.bar-label .emoji { font-size: 18px; }
.bar-track { background: #131313; border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { background: #fff; height: 100%; width: 0; border-radius: 6px; transition: width .5s ease; }
.bar-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-row.top .bar-fill { background: #fff; }
.bar-row.top .bar-label { color: #fff; font-weight: 600; }

.summary-actions { margin-top: 34px; display: flex; gap: 12px; flex-wrap: wrap; }
.ghost-btn {
  background: transparent; color: var(--fg);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 12px 24px; font-size: 15px; cursor: pointer;
}
.ghost-btn:hover { background: #111; }
.ghost-btn:disabled { opacity: 0.5; cursor: default; }
.ghost-btn.danger { border-color: #5a2020; color: #ff8a8a; }
.ghost-btn.danger:hover { background: #1a0d0d; border-color: #7a2a2a; }

.state-msg { color: var(--muted); font-size: 15px; padding: 40px 0; }

/* ---------- Portão de senha dos resultados ---------- */
.gate { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; align-items: flex-start; }
.pw-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--fg);
  font-size: 16px;
  padding: 14px 16px;
  outline: none;
}
.pw-input:focus { border-color: #555; }
.gate .start-btn { margin-top: 4px; }
.gate-error { color: #ff6b6b; font-size: 13px; min-height: 16px; }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(0,0,0,0.9);
  border-top: 1px solid var(--line);
  z-index: 20;
}
.nav-btn {
  background: transparent; color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px;
  width: 42px; height: 42px; font-size: 22px; line-height: 1;
  cursor: pointer; flex: 0 0 auto;
}
.nav-btn:hover:not(:disabled) { background: #141414; }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.progress { flex: 1; height: 4px; background: #1c1c1c; border-radius: 4px; overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; background: #fff; transition: width .3s ease; }
.counter { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Responsivo ---------- */
@media (max-width: 720px) {
  .reactions { grid-template-columns: repeat(5, 1fr); }
  .reaction .label { display: none; }
  .reaction .emoji { font-size: 26px; }
  .vote-head { flex-direction: column; gap: 4px; }
  .vote-hint { white-space: normal; }
  .bar-row { grid-template-columns: 40px 1fr 44px; }
  .bar-label .txt { display: none; }
}
