/* ============ base ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* O atributo hidden precisa vencer qualquer display declarado depois.
   Sem isto, .modal-root { display: grid } anula o hidden e o overlay de
   modal (escuro + backdrop-filter) fica preso por cima do app inteiro. */
[hidden] {
  display: none !important;
}

:root {
  --bg: #000;
  --surface: #121215;
  --surface-2: #1c1c21;
  --surface-3: #26262d;
  --line: #2a2a31;
  --text: #f5f5f7;
  --muted: #9a9aa6;
  --faint: #6b6b78;
  --accent: #25f4ee; /* ciano tiktok */
  --accent-2: #fe2c55; /* rosa tiktok */
  --money: #4ade80;
  --warn: #fbbf24;
  --radius: 16px;
  --tabbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-synthesis-weight: none;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: #08080a;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}
input,
select {
  font: inherit;
  color: inherit;
}

/* ============ moldura ============ */
.device {
  height: 100%;
  display: grid;
  place-items: center;
}

.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100%;
  max-height: 932px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  overflow: hidden;
}

@media (min-width: 520px) and (min-height: 720px) {
  .device {
    padding: 24px;
  }
  .app {
    border-radius: 32px;
    box-shadow: 0 0 0 1px #26262d, 0 40px 80px -20px #000;
  }
}

/* ============ topbar ============ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  min-height: 54px;
}
.topbar:empty {
  display: none;
}
.topbar__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.topbar__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.topbar__lang {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  transition: background 0.15s;
}
.topbar__lang:active {
  background: var(--surface-3);
}
.topbar__flag {
  font-size: 15px;
  line-height: 1;
}
.topbar__code {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.topbar__balance {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--money);
  font-variant-numeric: tabular-nums;
}

/* ============ screen ============ */
.screen {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 24px;
  -webkit-overflow-scrolling: touch;
}
.screen--flush {
  padding: 0;
  overflow: hidden;
}

/* ============ tabbar ============ */
.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: #0b0b0d;
  border-top: 1px solid var(--line);
  z-index: 40;
}
.tab {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 6px 0;
  color: var(--faint);
  transition: color 0.15s;
}
.tab svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.tab span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.tab.is-active {
  color: var(--text);
}
.tab--primary .tab__badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 42%, #fff 42%, #fff 58%, var(--accent-2) 58%);
  color: #000;
}
.tab--primary .tab__badge svg {
  width: 18px;
  height: 18px;
}

/* ============ blocos genéricos ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card + .card {
  margin-top: 12px;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 22px 0 10px;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.money {
  color: var(--money);
  font-variant-numeric: tabular-nums;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.row--between {
  justify-content: space-between;
}
.grow {
  flex: 1;
  min-width: 0;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--accent-2);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.1s, opacity 0.15s;
}
.btn:active {
  transform: scale(0.985);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn--ghost {
  background: var(--surface-2);
  color: var(--text);
}
.btn--line {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn--sm {
  width: auto;
  padding: 9px 14px;
  font-size: 13px;
  border-radius: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.pill--money {
  background: rgba(74, 222, 128, 0.14);
  color: var(--money);
}
.pill--done {
  background: rgba(37, 244, 238, 0.14);
  color: var(--accent);
}
.pill--warn {
  background: rgba(251, 191, 36, 0.14);
  color: var(--warn);
}

.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--faint);
  font-size: 14px;
}

/* ============ início ============ */
.hero {
  position: relative;
  margin-top: 4px;
  padding: 22px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(150deg, #fe2c55 0%, #7c2d92 55%, #0b1120 100%);
}
.hero__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}
.hero__value {
  margin: 8px 0 2px;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.hero__note {
  font-size: 13px;
  opacity: 0.85;
}
.hero .btn {
  margin-top: 18px;
  background: #fff;
  color: #111;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}
.stat__v {
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat__l {
  margin-top: 3px;
  font-size: 10px;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.install-card {
  margin-top: 12px;
  border-color: rgba(37, 244, 238, 0.3);
  background: linear-gradient(120deg, rgba(37, 244, 238, 0.08), var(--surface) 60%);
}
.install-card__ico {
  font-size: 26px;
}
.install-card .btn--sm {
  flex: none;
}

.steps {
  display: grid;
  gap: 14px;
}
.step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
}
.step__n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 800;
}
.step__t {
  font-size: 14px;
  font-weight: 700;
}
.step__d {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.45;
}

/* ============ lista de anúncios ============ */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar {
  display: none;
}
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.chip.is-active {
  background: #fff;
  color: #000;
}

.adrow {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  margin-bottom: 8px;
}
.adrow__thumb {
  display: grid;
  place-items: center;
  width: 64px;
  height: 78px;
  border-radius: 10px;
  font-size: 26px;
}
.adrow__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.adrow__meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--faint);
}
.adrow__tags {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.adrow__go {
  color: var(--faint);
  font-size: 20px;
}

.mini-progress {
  height: 3px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 8px;
}
.mini-progress__fill {
  height: 100%;
  background: var(--accent);
}

/* ============ feed ============ */
.feed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.feed::-webkit-scrollbar {
  display: none;
}

.slide {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  display: grid;
}

.slide__creative {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.slide__creative::before,
.slide__creative::after {
  content: '';
  position: absolute;
  width: 120%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: drift 14s ease-in-out infinite alternate;
  animation-play-state: paused;
}
.slide__creative::before {
  background: var(--c1);
  top: -30%;
  left: -35%;
}
.slide__creative::after {
  background: var(--c2);
  bottom: -35%;
  right: -35%;
  animation-delay: -7s;
}
.slide.is-playing .slide__creative::before,
.slide.is-playing .slide__creative::after {
  animation-play-state: running;
}
.slide__creative {
  background: var(--c3);
}
@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(6%, 8%, 0) scale(1.15);
  }
}

.slide__glyph {
  position: relative;
  font-size: 92px;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
  transition: transform 0.4s;
}
.slide.is-playing .slide__glyph {
  animation: bob 5s ease-in-out infinite;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-14px) rotate(2deg);
  }
}

.slide__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Player do YouTube.
   O vídeo é 16:9 e o slide é vertical. Encaixamos o vídeo inteiro na largura
   (contain), centralizado — igual o Shorts faz com vídeo deitado.
   Não usar "cover" aqui: encher um slide 9:16 com um vídeo 16:9 exige ampliar
   ~2,5×, e aí o render do YouTube fica visivelmente borrado. */
.slide__yt {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.slide__yt iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 100%;
  border: 0;
  background: #000;
  pointer-events: none; /* o toque é do app, não do YouTube */
}

/* Nos slides de vídeo o fundo é liso: os borrões coloridos atrás de uma
   moldura preta pareciam defeito. */
.slide--yt .slide__creative {
  background: #08080b;
}
.slide--yt .slide__creative::before,
.slide--yt .slide__creative::after {
  opacity: 0.22;
  filter: blur(90px);
}

.slide--yt:has(iframe) .slide__glyph {
  display: none;
}

.yt-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
}

.slide__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 22%, transparent 42%, rgba(0, 0, 0, 0.82) 100%);
  pointer-events: none;
}

.slide__tag {
  position: absolute;
  top: 14px;
  left: 16px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

.slide__paused {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.slide__paused svg {
  width: 74px;
  height: 74px;
  fill: rgba(255, 255, 255, 0.85);
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6));
}
.slide.is-paused .slide__paused {
  opacity: 1;
}

/* rail lateral */
.rail {
  position: absolute;
  right: 10px;
  bottom: 120px;
  display: grid;
  gap: 18px;
  justify-items: center;
  z-index: 3;
}
.rail__btn {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.rail__btn svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}
.rail__btn span {
  font-size: 11px;
  font-weight: 700;
}
.rail__pay {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.18);
  box-shadow: inset 0 0 0 1.5px rgba(74, 222, 128, 0.7);
  color: var(--money);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* rodapé do slide */
.slide__foot {
  position: absolute;
  left: 0;
  right: 76px;
  bottom: 0;
  padding: 0 16px 14px;
  z-index: 3;
}
.slide__brand {
  font-size: 15px;
  font-weight: 800;
}
.slide__title {
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.35;
}
.slide__desc {
  margin-top: 4px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
}
.slide__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 700;
}


/* barra de progresso do slide */
.slide__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 0 12px 8px;
}
.slide__times {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 5px;
}
.slide__track {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.slide__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--money));
  transition: width 0.15s linear;
}
.slide.is-done .slide__fill {
  background: var(--money);
}

/* ============ carteira ============ */
.balance-card {
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(140deg, #0f2027 0%, #1f4037 60%, #0b1120 100%);
  border: 1px solid var(--line);
}
.balance-card__v {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 6px 0 14px;
}
.balance-card__split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.balance-card__split div span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.balance-card__split div strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.tx {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.tx:last-child {
  border-bottom: 0;
}
.tx__ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 15px;
}
.tx__t {
  font-size: 14px;
  font-weight: 600;
}
.tx__d {
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 2px;
}
.tx__v {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.tx__v small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  margin-top: 2px;
}

/* ============ saque ============ */
.field {
  margin-bottom: 14px;
}
.field__l {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 7px;
}
.field input,
.field select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  outline: none;
  font-size: 15px;
}
.field input:focus,
.field select:focus {
  border-color: var(--accent);
}
.field__hint {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--faint);
}
.field__err {
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent-2);
  font-weight: 600;
}

.methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.methods--2 {
  grid-template-columns: repeat(2, 1fr);
}
.method {
  padding: 12px 8px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}
.method small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 500;
  color: var(--faint);
}
.method.is-active {
  border-color: var(--accent);
  background: rgba(37, 244, 238, 0.08);
}

.threshold {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
  margin: 10px 0 6px;
}
.threshold__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--money));
}

/* ============ modal / toast ============ */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  animation: fade 0.18s ease;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  width: 100%;
  max-width: 340px;
  padding: 26px 22px 20px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
  animation: pop 0.24s cubic-bezier(0.2, 1.2, 0.3, 1);
}
@keyframes pop {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
}
.modal__ico {
  font-size: 46px;
}
.modal__v {
  margin: 6px 0 4px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--money);
  font-variant-numeric: tabular-nums;
}
.modal__t {
  font-size: 16px;
  font-weight: 700;
}
.modal__d {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.modal__actions {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 22px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 200;
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(28, 28, 33, 0.96);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1px var(--line);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  animation: toastIn 0.25s ease;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
