/* ============================================================
   TARDEZINHA — estilos
   ============================================================ */
:root {
  --laranja: #FF7A1C;
  --laranja-escuro: #E85D0C;
  --magenta: #E6207C;
  --plum: #8C2A6B;
  --plum-escuro: #5A1A47;
  --amarelo: #FFD12E;
  --azul: #2458E8;
  --teal: #22C9B6;
  --creme: #FFF4E6;
  --branco: #FFFFFF;
  --sombra: 0 10px 30px rgba(90, 26, 71, .35);
  --raio: 22px;
  --fonte-display: 'Lilita One', 'Arial Black', sans-serif;
  --fonte-texto: 'Nunito', system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--fonte-texto);
  color: var(--plum-escuro);
  background: #FF7A1C url('../assets/bg-vertical.jpg') center / cover fixed no-repeat;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img, video, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- Telas ---------- */
.tela {
  position: fixed; inset: 0;
  display: none;
  overflow: hidden;
}
.tela.ativa { display: block; animation: aparecer .4s ease both; }
@keyframes aparecer { from { opacity: 0 } to { opacity: 1 } }
.tela-escura { background: #000; }
.tela-app { overflow-y: auto; -webkit-overflow-scrolling: touch; display: none; flex-direction: column; }
.tela-app.ativa { display: flex; }

.video-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-contain { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font-family: var(--fonte-display);
  font-size: 1.15rem; letter-spacing: .02em;
  color: var(--branco);
  background: var(--magenta);
  padding: .8em 1.6em;
  border-radius: 999px;
  box-shadow: 0 0 0 4px var(--branco), 0 8px 20px rgba(90, 26, 71, .35);
  text-decoration: none;
  transition: transform .15s ease, filter .15s ease;
  user-select: none;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; filter: grayscale(.4); pointer-events: none; }
.btn-grande { font-size: 1.45rem; padding: .9em 2em; }
.btn-mini { font-size: .95rem; padding: .5em 1.1em; box-shadow: 0 0 0 3px var(--branco), 0 4px 12px rgba(90,26,71,.3); }
.btn-fantasma { background: var(--plum); }

/* ---------- Splash ---------- */
#tela-splash { background: var(--laranja); }
.splash-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px) saturate(1.2); transform: scale(1.1); }
.splash-veu { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(90,26,71,.15), rgba(90,26,71,.55)); }
.splash-conteudo {
  position: relative; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  padding: 24px;
}
.splash-logo-band {
  width: min(92vw, 560px);
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: 0 0 0 6px var(--branco), var(--sombra);
  animation: flutuar 3.2s ease-in-out infinite;
}
@keyframes flutuar { 0%,100% { transform: translateY(0) rotate(-.5deg) } 50% { transform: translateY(-8px) rotate(.5deg) } }
.splash-dica { color: var(--branco); font-weight: 700; opacity: .85; margin: 0; }

/* ---------- Intro ---------- */
#tela-intro { background: var(--laranja); }

/* ---------- CEO ---------- */
.ceo-barra { position: absolute; left: 0; right: 0; bottom: calc(56px + var(--safe-bottom)); height: 6px; background: rgba(255,255,255,.2); }
#ceo-progresso { height: 100%; width: 0%; background: linear-gradient(90deg, var(--amarelo), var(--magenta)); transition: width .25s linear; }
.ceo-rodape {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 18px calc(14px + var(--safe-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: #fff; font-weight: 700; font-size: .95rem;
  background: linear-gradient(0deg, rgba(0,0,0,.7), transparent);
}
.ceo-erro {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  color: #fff; font-weight: 700; background: rgba(0,0,0,.75); text-align: center; padding: 24px;
}

/* ---------- Topo / app ---------- */
.topo {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: calc(10px + var(--safe-top)) 14px 10px;
  background: rgba(255, 244, 230, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(90,26,71,.18);
}
.topo h2 { font-family: var(--fonte-display); font-weight: 400; font-size: 1.5rem; margin: 0; color: var(--plum); flex: 1; text-align: center; }
.topo-logo { height: 64px; border-radius: 14px; box-shadow: 0 0 0 3px #fff, 0 4px 10px rgba(90,26,71,.2); }
.topo-com-voltar { justify-content: space-between; }
.btn-voltar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--plum); color: #fff; font-size: 1.8rem; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 0 0 3px #fff;
}
.passo { font-family: var(--fonte-display); color: var(--plum); font-size: 1.1rem; min-width: 42px; text-align: right; }

.titulo { font-family: var(--fonte-display); font-weight: 400; font-size: 2.1rem; margin: 0; color: var(--branco); text-shadow: 0 3px 0 var(--plum), 0 8px 22px rgba(90,26,71,.5); text-align: center; letter-spacing: .01em; }
.sub { color: var(--plum-escuro); font-weight: 700; margin: 6px 0 0; text-align: center; }
.sub.centro { padding: 16px 20px 4px; }

/* ---------- Hub ---------- */
.hub { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 28px 20px calc(28px + var(--safe-bottom)); }
.hub .sub { color: #fff; text-shadow: 0 2px 8px rgba(90,26,71,.6); }
.hub-cards { display: grid; grid-template-columns: 1fr; gap: 18px; width: min(100%, 520px); }
@media (min-width: 640px) { .hub-cards { grid-template-columns: 1fr 1fr; } }
.hub-card {
  background: var(--creme); border-radius: var(--raio); padding: 26px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  box-shadow: 0 0 0 5px #fff, var(--sombra);
  transition: transform .15s ease;
}
.hub-card:active { transform: scale(.97); }
.hub-emoji { font-size: 3rem; line-height: 1; }
.hub-nome { font-family: var(--fonte-display); font-size: 2rem; color: var(--magenta); }
.hub-desc { font-weight: 700; color: var(--plum-escuro); font-size: .98rem; }
.hub-rodape { color: #fff; font-weight: 800; opacity: .9; font-size: .85rem; margin: 0; text-shadow: 0 2px 6px rgba(90,26,71,.6); }

/* ---------- Filtros ---------- */
.filtros { display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px 4px; scrollbar-width: none; }
.filtros::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; font-weight: 800; font-size: .9rem; color: var(--plum); background: rgba(255,255,255,.85); padding: 7px 14px; border-radius: 999px; box-shadow: 0 2px 8px rgba(90,26,71,.2); }
.chip.ativo { background: var(--magenta); color: #fff; }

/* ---------- Grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 10px 10px calc(110px + var(--safe-bottom));
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 14px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(6, 1fr); max-width: 1280px; margin: 0 auto; width: 100%; } }
.item {
  position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.35);
  cursor: pointer;
}
.item img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s ease; }
.item img.ok { opacity: 1; }
.item .badge { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: .75rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.item .marca {
  position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.85); border: 2px solid #fff; display: none; place-items: center;
  font-family: var(--fonte-display); color: #fff; font-size: .95rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.grid.selecionando .item .marca, .grid-reels .item .marca { display: grid; }
.item.sel { outline: 4px solid var(--amarelo); outline-offset: -4px; }
.item.sel .marca { background: var(--magenta); }
.item.sel img { transform: scale(.94); transition: transform .15s; }
.vazio { padding: 60px 20px; text-align: center; color: #fff; font-weight: 800; text-shadow: 0 2px 6px rgba(90,26,71,.5); }

/* ---------- Barra de seleção ---------- */
.barra-selecao {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px calc(14px + var(--safe-bottom));
  background: rgba(255,244,230,.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -4px 18px rgba(90,26,71,.2);
  font-family: var(--fonte-display); color: var(--plum); font-size: 1.05rem;
}
.barra-selecao .btn { font-size: 1rem; padding: .65em 1.3em; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.94); display: flex; flex-direction: column; }
.lb-midia { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 8px; }
.lb-midia img, .lb-midia video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lb-fechar { position: absolute; top: calc(10px + var(--safe-top)); right: 12px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 1.3rem; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 46px; height: 64px; color: #fff; font-size: 2.6rem; background: rgba(255,255,255,.08); border-radius: 12px; }
.lb-ant { left: 6px; } .lb-prox { right: 6px; }
.lb-acoes { display: flex; gap: 10px; justify-content: center; padding: 12px 16px calc(16px + var(--safe-bottom)); }

/* ---------- Reels: modelos ---------- */
.reels-passo { flex: 1; display: flex; flex-direction: column; }
.modelos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 14px 14px calc(30px + var(--safe-bottom)); }
@media (min-width: 720px) { .modelos { grid-template-columns: repeat(3, 1fr); max-width: 900px; margin: 0 auto; width: 100%; } }
.modelo {
  background: var(--creme); border-radius: 18px; overflow: hidden; text-align: left;
  box-shadow: 0 0 0 4px #fff, 0 8px 22px rgba(90,26,71,.28);
  display: flex; flex-direction: column;
  transition: transform .15s ease;
}
.modelo:active { transform: scale(.97); }
.modelo canvas { width: 100%; aspect-ratio: 9/16; object-fit: cover; background: var(--plum); }
.modelo-info { padding: 10px 12px 12px; }
.modelo-nome { font-family: var(--fonte-display); color: var(--magenta); font-size: 1.2rem; }
.modelo-qtd { display: inline-block; font-family: var(--fonte-display); font-size: .8rem; color: #fff; background: var(--plum); padding: 2px 10px; border-radius: 999px; margin: 4px 0 2px; }
.modelo-desc { font-size: .82rem; font-weight: 700; color: var(--plum-escuro); margin-top: 2px; }

/* ---------- Reels: músicas ---------- */
.musicas-wrap .sub { color: #fff; text-shadow: 0 2px 6px rgba(90,26,71,.6); padding-bottom: 0; }
.musicas { justify-content: center; flex-wrap: wrap; padding: 10px 14px 0; }
.musicas .chip { display: inline-flex; align-items: center; gap: 6px; }
.musicas .chip small { opacity: .7; font-weight: 700; }

/* ---------- Reels: preview ---------- */
.preview-wrap {
  position: relative; margin: 14px auto 0;
  height: min(68vh, 760px); aspect-ratio: 9/16;
  border-radius: 18px; overflow: hidden; background: #000;
  box-shadow: 0 0 0 5px #fff, var(--sombra);
}
#preview-canvas { width: 100%; height: 100%; }
.preview-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 3.2rem; background: rgba(0,0,0,.25);
}
.preview-play.oculto { opacity: 0; }
.preview-acoes { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 18px 16px calc(24px + var(--safe-bottom)); }
.progresso { padding: 0 24px 30px; max-width: 520px; margin: 0 auto; width: 100%; text-align: center; color: #fff; font-weight: 800; text-shadow: 0 2px 6px rgba(90,26,71,.6); }
.progresso-barra { height: 14px; border-radius: 999px; background: rgba(255,255,255,.35); overflow: hidden; box-shadow: inset 0 2px 6px rgba(0,0,0,.2); }
#reels-progresso-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--amarelo), var(--magenta)); transition: width .2s; }
.pronto { padding: 10px 16px calc(30px + var(--safe-bottom)); text-align: center; color: #fff; font-family: var(--fonte-display); font-size: 1.5rem; text-shadow: 0 2px 0 var(--plum); }
.resultado { margin: 10px auto 0; height: min(60vh, 640px); aspect-ratio: 9/16; border-radius: 16px; background: #000; box-shadow: 0 0 0 5px #fff, var(--sombra); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-bottom)); transform: translateX(-50%);
  z-index: 100; background: var(--plum-escuro); color: #fff; font-weight: 800; padding: 12px 18px; border-radius: 14px;
  box-shadow: var(--sombra); max-width: 90vw; text-align: center; animation: aparecer .2s ease;
}
