/* ================= BASE ================= */
:root {
  --preto: #000;
  --fundo: #121212;
  --cartao: #1f1f1f;
  --cartao-claro: #2a2a2a;
  --texto: #fff;
  --texto-2: #b3b3b3;
  --verde: #1ed760;
  --azul: #4a9fd8;
  --rosa: #f774c4;
  --amarelo: #ffd200;
  --raio: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  background: var(--preto);
  color: var(--texto);
  font-family: 'Figtree', -apple-system, sans-serif;
  overscroll-behavior-y: none;
}

body { max-width: 480px; margin: 0 auto; min-height: 100dvh; }

.tela { display: none; min-height: 100dvh; }
.tela.ativa { display: block; }

button { font-family: inherit; border: none; cursor: pointer; transition: transform .15s ease, filter .15s ease; }
button:active { transform: scale(.93); filter: brightness(.92); }

/* ---- transições de tela ---- */
@keyframes telaEntra { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes telaSai   { to { opacity: 0; transform: scale(.96); } }
#tela-home.ativa { animation: telaEntra .55s ease both; }
#tela-intro.saindo { animation: telaSai .32s ease both; }

/* ---- revelar cartões ao rolar ---- */
.revelar { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s ease; }
.revelar.visivel { opacity: 1; transform: none; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.4); } 70% { transform: scale(1.1); } 100% { opacity: 1; transform: scale(1); } }

/* ================= TELA INTRO ================= */
#tela-intro {
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 12px 0;
}
#tela-intro.ativa { display: flex; }

.intro-topo { display: flex; justify-content: center; padding: 4px 0 14px; }

.pill-wrapped {
  background: var(--verde);
  color: #000;
  font-weight: 800;
  font-size: 14px;
  padding: 8px 22px;
  border-radius: 999px;
}

.intro-card {
  flex: 1;
  background: var(--fundo);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  animation: surgir .8s ease both;
}

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

#intro-titulo { font-size: 34px; font-weight: 900; line-height: 1.2; min-height: 2.4em; }
#intro-titulo .destaque { color: var(--verde); }

/* cursor de digitação */
@keyframes piscar { 0%, 45% { opacity: 1; } 50%, 100% { opacity: 0; } }
.cursor {
  display: inline-block;
  width: 4px;
  height: .95em;
  margin-left: 4px;
  vertical-align: -0.08em;
  border-radius: 2px;
  background: var(--verde);
  animation: piscar 1s infinite;
}

/* equalizer estilo Spotify */
.equalizer { display: flex; gap: 5px; height: 28px; align-items: flex-end; margin-bottom: 22px; }
.equalizer i { width: 6px; border-radius: 3px; background: var(--verde); animation: eq 1.1s ease-in-out infinite; }
.equalizer i:nth-child(1) { animation-delay: 0s; }
.equalizer i:nth-child(2) { animation-delay: .25s; }
.equalizer i:nth-child(3) { animation-delay: .5s; }
.equalizer i:nth-child(4) { animation-delay: .15s; }
.equalizer i:nth-child(5) { animation-delay: .4s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

/* subtítulo e botão só aparecem depois que terminar de digitar */
.intro-sub { color: var(--texto-2); font-size: 16px; margin: 18px 0 34px; line-height: 1.5; }
#tela-intro .intro-sub, #tela-intro .btn-verde { opacity: 0; }
#tela-intro.digitou .intro-sub { animation: fadeUp .6s ease both; }
#tela-intro.digitou .btn-verde { animation: popIn .55s .35s ease both; }

.btn-verde {
  background: var(--verde);
  color: #000;
  font-size: 17px;
  font-weight: 800;
  padding: 16px 40px;
  border-radius: 999px;
  transition: transform .15s;
}
.btn-verde:active { transform: scale(.95); }

.fake-nav {
  display: flex;
  justify-content: space-around;
  padding: 14px 0 26px;
  background: #0a0a0a;
  margin: 12px -12px 0;
}
.fake-nav-item { color: var(--texto-2); font-size: 11px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.fake-nav-item.ativo { color: #fff; }
.fnav-ico { font-size: 20px; }

/* ================= HOME ================= */
#tela-home {
  background: linear-gradient(180deg, #2b5876 0%, #1c3a52 28%, var(--fundo) 60%);
  padding: 14px 16px 0;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
}
.hh-titulo { font-weight: 700; font-size: 15px; }
.hh-seta, .hh-mais { color: #fff; font-size: 20px; opacity: .9; }

/* ---- Player ---- */
.capa-wrap { border-radius: 10px; overflow: hidden; box-shadow: 0 18px 50px rgba(0,0,0,.55); }

.capa {
  width: 100%;
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  transition: opacity .35s;
}
.capa.placeholder { background: linear-gradient(135deg, #355c7d, #6c5b7b, #c06c84); }

/* capa "respira" enquanto a música toca */
@keyframes respirar { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.018); } }
.capa.tocando { animation: respirar 5s ease-in-out infinite; }

.player-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}
.player-info h2 { font-size: 24px; font-weight: 800; }
.player-info p { color: var(--texto-2); font-size: 15px; margin-top: 2px; }

.check {
  background: var(--azul);
  color: #fff;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}

.progresso { margin-top: 14px; }
.barra { position: relative; height: 4px; background: rgba(255,255,255,.25); border-radius: 2px; }
.barra-fill { height: 100%; width: 0%; background: #fff; border-radius: 2px; }
.barra-dot {
  position: absolute; top: 50%; left: 0%;
  width: 12px; height: 12px;
  background: #fff; border-radius: 50%;
  transform: translate(-50%, -50%);
}
.tempos { display: flex; justify-content: space-between; color: var(--texto-2); font-size: 12px; margin-top: 6px; }

.controles {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 4px 26px;
}
.ctrl-ico { font-size: 22px; opacity: .85; cursor: pointer; user-select: none; }
.ctrl-ico.grande { font-size: 30px; }

.btn-play {
  background: #fff;
  color: #000;
  width: 64px; height: 64px;
  border-radius: 50%;
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.btn-play:active { transform: scale(.92); }

/* ---- Cartões ---- */
.cartao {
  background: var(--cartao);
  border-radius: var(--raio);
  padding: 18px;
  margin-bottom: 16px;
}

.cartao-titulo { font-size: 19px; font-weight: 800; margin-bottom: 14px; }
.cartao-rotulo { font-size: 17px; font-weight: 800; margin-bottom: 10px; }

.cartao-foto-wrap { position: relative; border-radius: 10px; overflow: hidden; margin: -18px -18px 16px; }
.cartao-foto {
  width: 100%; aspect-ratio: 16/10;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; font-size: 56px;
}
.cartao-foto.placeholder { background: linear-gradient(135deg, #c06c84, #f67280, #f8b195); }
.cartao-foto-label {
  position: absolute; left: 16px; bottom: 12px;
  font-weight: 800; font-size: 18px;
  text-shadow: 0 2px 8px rgba(0,0,0,.7);
}

.sobre-nomes { font-size: 24px; font-weight: 800; }
.sobre-desde { color: var(--texto-2); font-size: 14px; margin: 2px 0 16px; }

.contador { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  background: var(--cartao-claro);
  border-radius: 10px;
  padding: 14px 6px;
  text-align: center;
}
.tile b { font-size: 26px; font-weight: 900; display: block; font-variant-numeric: tabular-nums; }
.tile span { color: var(--texto-2); font-size: 12px; }

/* ---- Mensagem especial ---- */
.cartao-azul { background: linear-gradient(135deg, #4a9fd8, #3b7fb5); }

.msg-preview {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
  max-height: 120px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent);
  mask-image: linear-gradient(180deg, #000 40%, transparent);
  margin-bottom: 14px;
  white-space: pre-line;
}

.btn-branco {
  background: #fff;
  color: #111;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 999px;
}

/* ---- Galerias (destaques estilo Instagram) ---- */
.galerias {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 6px;
  scrollbar-width: none;
}
.galerias::-webkit-scrollbar { display: none; }

.destaque-item {
  flex: 0 0 auto;
  width: 82px;
  text-align: center;
  cursor: pointer;
}
.destaque-item:active { transform: scale(.95); }

.destaque-circulo {
  width: 82px; height: 82px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(#f09433, #e6683c, #dc2743, #cc2366, #bc1888, #f09433);
}
.destaque-foto {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 3px solid var(--cartao);
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-sizing: border-box;
}
.destaque-foto.placeholder { background: linear-gradient(160deg, #355c7d, #6c5b7b); }

.destaque-item span {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

/* ---- Conquistas ---- */
.conquistas-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.conquistas-head .cartao-titulo { margin: 0; }
.pill-cinza { background: var(--cartao-claro); color: var(--texto-2); font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; }

.conquistas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge.pop { animation: popIn .45s ease both; }
.badge {
  aspect-ratio: 1;
  border-radius: 12px;
  background: var(--cartao-claro);
  border: 1.5px solid #6c5ce7;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  font-size: 26px;
  text-align: center;
}
.badge small { font-size: 9px; color: var(--texto-2); font-weight: 600; padding: 0 4px; line-height: 1.15; }
.badge.off { border-color: #333; filter: grayscale(1); opacity: .45; }
.badge.destaque { border-color: var(--amarelo); }

/* ---- Banner retrospectiva ---- */
.banner-retro {
  position: relative;
  overflow: hidden;
  background: #0d0d0d;
  border-radius: var(--raio);
  text-align: center;
  padding: 80px 20px;
  margin-bottom: 16px;
  cursor: pointer;
}
.banner-retro h3 { font-size: 30px; font-weight: 900; position: relative; z-index: 1; }
.banner-retro p { color: var(--texto-2); font-size: 16px; margin: 6px 0 24px; position: relative; z-index: 1; }

.btn-azul {
  background: var(--azul);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  padding: 14px 36px;
  border-radius: 999px;
  position: relative; z-index: 1;
}

.blob {
  position: absolute;
  width: 130%;
  height: 90px;
  background: linear-gradient(90deg, #ff2e63, #ff5e9c, #d62fbb);
  filter: blur(2px);
  border-radius: 50%;
  opacity: .9;
  animation: ondular 7s ease-in-out infinite alternate;
}
.blob-1 { top: -10px; left: -20%; transform: rotate(-7deg); }
.blob-2 { bottom: -10px; right: -20%; transform: rotate(6deg); animation-delay: -3s; }

@keyframes ondular {
  from { transform: translateX(-12px) rotate(-7deg) scaleY(1); }
  to   { transform: translateX(12px) rotate(-4deg) scaleY(1.3); }
}

.home-footer { text-align: center; color: var(--texto-2); font-size: 12px; padding: 8px 0 30px; }

/* ================= OVERLAYS ================= */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.overlay.ativa { display: flex; }

.carta, .galeria-view {
  position: relative;
  background: var(--fundo);
  width: 100%;
  max-width: 480px;
  max-height: 88dvh;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 34px;
  overflow-y: auto;
  animation: subir .35s ease both;
}

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

.carta h3, .galeria-view h3 { font-size: 22px; font-weight: 800; margin-bottom: 16px; }

.carta-texto {
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.75;
  white-space: pre-line;
  color: #e9e9e9;
  background: var(--cartao);
  border-radius: 12px;
  padding: 22px;
}

.fechar {
  position: absolute; top: 16px; right: 16px;
  background: var(--cartao-claro);
  color: #fff;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 15px;
  z-index: 2;
}

.galeria-fotos { display: flex; flex-direction: column; gap: 16px; }
.gfoto { border-radius: 12px; overflow: hidden; background: var(--cartao); }
.gfoto .img {
  width: 100%; aspect-ratio: 4/5;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; font-size: 64px;
}
.gfoto .img.placeholder { background: linear-gradient(135deg, #2b5876, #4e4376); }
.gfoto p { padding: 12px 14px; color: var(--texto-2); font-size: 14px; }

/* ================= STORIES ================= */
.tela-stories {
  position: fixed; inset: 0;
  z-index: 100;
  background: #000;
  max-width: 480px;
  margin: 0 auto;
}

.stories-progresso {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  display: flex; gap: 5px;
  z-index: 10;
}
.seg { flex: 1; height: 3px; background: rgba(255,255,255,.3); border-radius: 2px; overflow: hidden; }
.seg i { display: block; height: 100%; width: 0%; background: #fff; border-radius: 2px; }
.seg.feito i { width: 100%; }
.seg.atual i { animation: encherSeg linear forwards; }
@keyframes encherSeg { from { width: 0%; } to { width: 100%; } }

.stories-fechar {
  position: absolute; top: 26px; right: 14px;
  z-index: 12;
  background: rgba(255,255,255,.15);
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 14px;
}

.stories-toque { position: absolute; inset: 0; display: flex; z-index: 8; }
.toque-area { flex: 1; }

@keyframes storyIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.story-conteudo {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 28px;
  overflow: hidden;
  animation: storyIn .4s ease both;
}

/* fundos animados dos stories */
.story-zigzag::before, .story-zigzag::after {
  content: "";
  position: absolute; left: 0; right: 0;
  height: 26%;
  background:
    repeating-linear-gradient(90deg, var(--story-cor, #ffd200) 0 26px, transparent 26px 52px);
  opacity: .92;
}
.story-zigzag::before { top: 0; clip-path: polygon(0 0, 100% 0, 100% 22%, 0 100%); }
.story-zigzag::after { bottom: 0; clip-path: polygon(0 78%, 100% 0, 100% 100%, 0 100%); }

.story-num { font-size: 64px; font-weight: 900; font-variant-numeric: tabular-nums; z-index: 1; }
.story-label { font-size: 20px; font-weight: 700; margin-bottom: 10px; z-index: 1; }
.story-sub { font-size: 15px; color: #ddd; margin-top: 18px; z-index: 1; }

.story-titulo-grande { font-size: 46px; font-weight: 900; line-height: 1.1; z-index: 1; animation: zoomIn .7s ease both; }
.story-pre { font-size: 18px; font-weight: 700; color: #eee; margin-bottom: 8px; z-index: 1; animation: surgir .6s ease both; }

@keyframes zoomIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }

/* timeline jornada */
.story-jornada {
  justify-content: flex-start;
  overflow-y: auto;
  background:
    radial-gradient(circle at 18% 28%, rgba(247,116,196,.16), transparent 42%),
    radial-gradient(circle at 82% 70%, rgba(108,92,231,.16), transparent 42%),
    #0c0a10;
}
.story-jornada h2 { font-size: 34px; font-weight: 900; margin-top: 20px; }
.story-jornada .sub { color: var(--texto-2); margin: 6px 0 26px; }

.momento {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  margin-bottom: 34px;
  text-align: left;
  animation: fadeUp .55s ease both;
}
.momento:nth-child(even) { flex-direction: row-reverse; text-align: right; }

.polaroid {
  background: #fdfdf6;
  padding: 8px 8px 10px;
  border-radius: 4px;
  transform: rotate(-3deg);
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  width: 46%;
  flex-shrink: 0;
}
.momento:nth-child(even) .polaroid { transform: rotate(3deg); }
.polaroid .img {
  width: 100%; aspect-ratio: 1;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  background-color: #ccc;
}
.polaroid p { font-family: 'Caveat', cursive; color: #222; font-size: 16px; text-align: center; margin-top: 6px; line-height: 1.1; }

.momento-txt b { color: var(--rosa); font-size: 17px; display: block; margin-bottom: 4px; }
.momento-txt span { font-size: 14.5px; line-height: 1.4; color: #eee; }

/* foto favorita */
.story-foto-fav .fav-img {
  width: 78%; aspect-ratio: 4/5;
  background-size: cover; background-position: center;
  background-color: #222;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; font-size: 70px;
  z-index: 1;
  animation: zoomIn .8s ease both;
}
.story-foto-fav .frase {
  font-family: 'Caveat', cursive;
  font-size: 28px;
  margin-top: 26px;
  z-index: 1;
}

/* final */
.story-final h2 { font-size: 42px; font-weight: 900; z-index: 1; }
.story-final p { font-size: 18px; line-height: 1.55; margin-top: 18px; color: #eee; z-index: 1; }
.story-final .assin { font-family: 'Caveat', cursive; font-size: 26px; margin-top: 26px; color: var(--rosa); }
.story-final .btn-verde { margin-top: 34px; z-index: 1; }

/* story de galeria (foto em tela cheia, estilo Instagram) */
.story-gfoto { padding: 0; }
.gfoto-blur {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(.55);
  transform: scale(1.15);
}
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.06); } }
.gfoto-bg {
  position: absolute; inset: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 80px;
  animation: kenburns 5.5s ease-out both;
}
.gfoto-bg.placeholder, .gfoto-blur.placeholder { background: linear-gradient(160deg, #355c7d, #6c5b7b); }
.story-gfoto::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 32%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.8));
  pointer-events: none;
}
@keyframes legendaSobe { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.gfoto-titulo {
  position: absolute;
  top: 30px; left: 16px;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0,0,0,.8);
  z-index: 2;
  animation: legendaSobe .4s ease both;
}
.gfoto-legenda {
  position: absolute;
  bottom: 44px; left: 24px; right: 24px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 2px 10px rgba(0,0,0,.85);
  z-index: 2;
  animation: legendaSobe .5s .12s ease both;
}

/* corações flutuando */
.coracao {
  position: absolute;
  bottom: -40px;
  font-size: 22px;
  animation: flutuar linear infinite;
  z-index: 0;
}
@keyframes flutuar {
  from { transform: translateY(0) rotate(0); opacity: .9; }
  to   { transform: translateY(-110dvh) rotate(30deg); opacity: 0; }
}

/* cores dos stories de stats */
.cor-amarelo { --story-cor: #ffd200; }
.cor-verde   { --story-cor: #1ed760; }
.cor-rosa    { --story-cor: #f774c4; }
.cor-azul    { --story-cor: #4aa8ff; }
