/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #ffffff;
  min-height: 100vh;
  color: #0e1e3d;
}

/* ================================================================
   SISTEMA DE ECRÃS
   ================================================================ */
.screen { display: none; width: 100%; min-height: 100dvh; }
.screen.active { display: block; }

/* ================================================================
   PAGE WRAP  (fundo branco, centrado, máx 480px)
   ================================================================ */
.page-wrap {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

/* ================================================================
   BARRA DE TOPO  (ecrãs 1 e 2)
   ================================================================ */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  border-bottom: 1.5px solid #eaedf5;
  background: #fff;
  flex-shrink: 0;
}

.top-bar__logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #0d1b37;
}

/* ================================================================
   ECRÃ 1 · FORMULÁRIO
   ================================================================ */
.form-body {
  flex: 1;
  padding: 46px 28px 40px;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.form-title {
  font-size: 30px;
  font-weight: 900;
  color: #0e1e3d;
  line-height: 1.08;
  margin-bottom: 14px;
  text-align: center;
}

.form-sub {
  font-size: 14px;
  color: #5a6a8e;
  line-height: 1.55;
  text-align: center;
  margin-bottom: 34px;
  padding: 0 4px;
}

.form-sub strong { font-weight: 700; color: #1a5ad8; }

.f-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #2e3d5c;
  margin-bottom: 8px;
  margin-top: 4px;
}

.f-input {
  width: 100%;
  height: 52px;
  border: 1.5px solid #dde1ec;
  border-radius: 14px;
  background: #f3f4f9;
  padding: 0 16px;
  font-size: 15px;
  color: #2e3d5c;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, background .2s;
  margin-bottom: 20px;
  appearance: none;
  -webkit-appearance: none;
}

.f-input:focus { border-color: #5a7bff; background: #fff; }
.f-input::placeholder { color: #b0b8cc; }

.f-at-wrap { position: relative; margin-bottom: 24px; }

.f-at {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: #8a94aa;
  pointer-events: none;
  user-select: none;
}

.f-input--at { padding-left: 32px; margin-bottom: 0; }

/* botão verificar conta */
.btn-verify {
  width: 100%;
  height: 54px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: not-allowed;
  background: #d8dae5;
  color: #b4b8c8;
  letter-spacing: 0.1px;
  transition: background .2s, color .2s, transform .1s, box-shadow .2s;
  margin-top: 2px;
}

.btn-verify.enabled {
  background: #3d6fff;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(61,111,255,.35);
}

.btn-verify.enabled:hover  { background: #2d5fee; }
.btn-verify.enabled:active { transform: scale(.98); }

.form-privacy {
  font-size: 12px;
  color: #9ba4be;
  text-align: center;
  line-height: 1.55;
  margin-top: 16px;
  padding: 0 8px;
}

/* ================================================================
   ECRÃ 2 · A VERIFICAR
   ================================================================ */
.verify-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 32px 40px;
  background: #fff;
}

.verify-title {
  font-size: 26px;
  font-weight: 800;
  color: #0e1e3d;
  text-align: center;
  margin-bottom: 8px;
}

.verify-sub {
  font-size: 14px;
  color: #6070a0;
  margin-bottom: 0;
  padding-bottom: 44px;
  text-align: center;
  line-height: 1.45;
  max-width: 320px;
}

/* padding em vez de só margin-bottom evita colapso com a barra e garante espaço visível */
.bar-track {
  width: 100%;
  height: 7px;
  background: #eaecf5;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0;
}

.bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22d3ee 0%, #ec4899 100%);
  border-radius: 999px;
  transition: width .9s cubic-bezier(.4,0,.2,1);
}

.bar-pct {
  font-size: 13px;
  color: #9ba4be;
  margin-top: 14px;
  margin-bottom: 32px;
  text-align: center;
}

.step-list {
  list-style: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #a8b0c8;
  transition: color .3s;
}

.step-dot {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e8eaf3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  font-weight: 700;
  transition: background .4s;
}

.step.done .step-dot        { background: #22c55e; }
.step.done .step-dot::after { content: '✓'; }
.step.done                  { color: #0e1e3d; }
.step.done .step-text       { font-weight: 700; }

/* ================================================================
   MODAL · 18+  (centrado verticalmente)
   ================================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.78);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
  animation: popIn .38s cubic-bezier(.175,.885,.32,1.275);
}

@keyframes popIn {
  from { transform: scale(.8); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

.modal-illo {
  padding: 26px 20px 0;
  text-align: center;
}

.modal-illo img {
  height: 88px;
  object-fit: contain;
}

.modal-title {
  font-size: 19px;
  font-weight: 900;
  color: #0e1e3d;
  text-align: center;
  line-height: 1.25;
  padding: 14px 26px 0;
}

.modal-body {
  font-size: 13.5px;
  color: #5a6a8e;
  text-align: center;
  line-height: 1.6;
  padding: 10px 22px 0;
}

.modal-terms {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #e82060;
  text-decoration: none;
  padding: 14px 0 18px;
  transition: opacity .15s;
}

.modal-terms:hover { opacity: .78; }

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1.5px solid #eaedf5;
}

.modal-btn {
  height: 58px;
  border: none;
  background: transparent;
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 600;
  transition: background .15s;
}

.modal-btn:active { background: #f4f5f9; }
.modal-btn--cancel { color: #5a6a8e; }
.modal-btn--agree  { color: #0e1e3d; font-weight: 800; border-left: 1.5px solid #eaedf5; }

/* ================================================================
   ECRÃ 3 · GIRO PREMIADO (roleta)
   ================================================================ */
.wheel-page {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background: linear-gradient(180deg,
    #c4f070  0%,
    #65cb30 13%,
    #3cac1a 40%,
    #2a881a 68%,
    #1c6312 100%
  );
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* cabeçalho da roleta */
.w-header {
  display: flex;
  align-items: center;
  padding: 12px 12px 8px;
  position: relative;
  flex-shrink: 0;
}

.w-nav-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.28);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.w-title {
  flex: 1;
  text-align: center;
  font-size: 19px;
  font-weight: 900;
  color: #f9e840;
  letter-spacing: 1.2px;
  text-shadow: 0 1px 5px rgba(0,0,0,.35);
}

@keyframes coinBob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

.coin-hdr {
  position: absolute;
  width: 28px;
  height: 28px;
  top: 10px;
  object-fit: contain;
  pointer-events: none;
  animation: coinBob 2.2s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}
.coin-hdr--l { left: 50px; animation-delay: 0s; }
.coin-hdr--r { right: 50px; animation-delay: 1.1s; }

/* cartão de saldo */
.w-wallet {
  margin: 6px 12px 0;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.w-wallet__left { display: flex; align-items: center; gap: 10px; }

.w-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.w-wallet__label  { font-size: 11px; color: rgba(255,255,255,.82); margin-bottom: 1px; }
.w-wallet__amount { font-size: 22px; font-weight: 900; color: #fff; }

.btn-sacar {
  background: #fff;
  color: #1a3010;
  border: none;
  border-radius: 999px;
  padding: 8px 22px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-sacar:hover { opacity: .88; }

/* timer */
.w-expire {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 15px 2px;
  font-size: 12px;
  color: rgba(255,255,255,.78);
}

.w-ver-mais { color: rgba(255,255,255,.78); text-decoration: none; font-size: 12px; }

/* badge de giros */
.w-badge {
  display: block;
  width: fit-content;
  margin: 8px auto 4px;
  background: rgba(218,255,194,.55);
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px;
  padding: 5px 18px;
  font-size: 13px;
  font-weight: 700;
  color: #1a4010;
}

/* área da roleta */
.w-wheel-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 8px 4px;
}

.w-pointer {
  color: #e83680;
  font-size: 26px;
  line-height: 1;
  margin-bottom: -4px;
  z-index: 5;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
}

.w-canvas-wrap {
  position: relative;
  width: 300px;
  height: 300px;
}

#wheelCanvas {
  width: 300px;
  height: 300px;
  display: block;
  border-radius: 50%;
  /* nitidez: resolução interna vem do devicePixelRatio em app.js */
}

/* ── Balão de fala "Toque em Girar" ── */
.w-tap-hint {
  position: absolute;
  /* fica logo acima do botão central (150px do topo − metade do botão 82px − gap) */
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #1a2810;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
  pointer-events: none;
  z-index: 9;
  animation: hintBounce 1.8s ease-in-out infinite;
}

/* triângulo apontando para baixo em direção ao botão */
.w-tap-hint::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left:  8px solid transparent;
  border-right: 8px solid transparent;
  border-top:   8px solid #ffffff;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.08));
}

@keyframes hintBounce {
  0%, 100% { transform: translateX(-50%) translateY(0);    }
  50%       { transform: translateX(-50%) translateY(-5px); }
}

/* botão central rosa */
.w-center-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f9a8d4 5%, #db2777 75%);
  border: 6px solid #c8920e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,.32), inset 0 2px 4px rgba(255,255,255,.25);
  z-index: 10;
  transition: transform .12s;
  user-select: none;
}

.w-center-btn.disabled { opacity: .5; cursor: not-allowed; }
.w-center-btn:not(.disabled):active { transform: scale(.94); }

.w-center-num { font-size: 26px; font-weight: 900; color: #fff; line-height: 1; }
.w-center-lbl { font-size: 11px; font-weight: 600; color: rgba(255,255,255,.9); }

/* moedas P decorativas (imagem) */
.pc {
  position: absolute;
  width: 42px;
  height: 42px;
  object-fit: contain;
  pointer-events: none;
  animation: coinBob 2.4s ease-in-out infinite;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,.25));
}
.pc--l1 { left: 0;    top: 44px;  animation-delay: 0s; }
.pc--r1 { right: 0;  top: 44px;  animation-delay: 0.6s; }
.pc--l2 { left: -4px; top: 150px; animation-delay: 1.2s; }
.pc--r2 { right: -4px; top: 150px; animation-delay: 1.8s; }

/* como funciona */
.w-how {
  background: #f6f8f2;
  border-radius: 20px 20px 0 0;
  margin-top: 12px;
  padding: 18px 20px 0;
  flex: 1;
}

.w-how__title {
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  color: #1a2a10;
  margin-bottom: 4px;
}

.w-how__sub {
  font-size: 12px;
  color: #7a8870;
  text-align: center;
  margin-bottom: 16px;
}

.w-how__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.w-how__list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.how-n {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e4f0d8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #2d5e10;
  margin-top: 1px;
}

.w-how__list li div { display: flex; flex-direction: column; gap: 2px; }

.w-how__list li strong {
  font-size: 14px;
  font-weight: 700;
  color: #1a2810;
  display: block;
}

.w-how__list li span {
  font-size: 12.5px;
  color: #3a4830;
  line-height: 1.5;
}

/* rodapé */
.w-footer {
  text-align: center;
  padding: 20px 20px 26px;
  font-size: 11px;
  color: #8a9880;
}

/* ================================================================
   OVERLAY DA PROMOÇÃO
   ================================================================ */
.promo-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.54);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.promo-sticker {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popIn .44s cubic-bezier(.175,.885,.32,1.275);
  padding: 0 16px;
}

.promo-full-img {
  width: 100%;
  max-width: 340px;
  height: auto;
  border-radius: 18px;
}

.promo-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px 30px;
  background: #fff;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
}

.btn-continue {
  width: 100%;
  height: 54px;
  border: 1.5px solid #d0d6e8;
  border-radius: 14px;
  background: #fff;
  font-size: 16px;
  font-weight: 700;
  color: #1a2a44;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}

.btn-continue:hover { background: #f5f6fa; }

/* ================================================================
   POPUPS DE RESULTADO DE GIRO
   ================================================================ */
.spin-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.spin-popup.hidden { display: none; }

.spin-popup__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 340px;
  width: 100%;
  animation: popIn .45s cubic-bezier(.175,.885,.32,1.275);
}

.spin-popup__emoji {
  font-size: 68px;
  margin-bottom: 16px;
  line-height: 1;
}

.spin-popup__title {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.2;
}

.spin-popup__text {
  font-size: 15px;
  color: rgba(255,255,255,.88);
  line-height: 1.6;
  margin-bottom: 28px;
  padding: 0 8px;
}

.spin-popup__hl {
  font-weight: 900;
  color: #f9d048;
}

.spin-popup__win-header {
  font-size: 21px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.2;
}

.spin-popup__win-sub {
  font-size: 14px;
  color: rgba(255,255,255,.8);
  margin-bottom: 8px;
  line-height: 1.4;
}

.spin-popup__char {
  width: 200px;
  height: auto;
  object-fit: contain;
  margin: 6px 0 10px;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.4));
}

.spin-popup__prize {
  font-size: 60px;
  font-weight: 900;
  color: #f9d048;
  line-height: 1;
  margin: 4px 0 22px;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.spin-popup__prize--gold { color: #f9d048; }

.spin-popup__total {
  font-size: 14px;
  color: rgba(255,255,255,.85);
  font-weight: 600;
  margin-bottom: 6px;
}

.spin-popup__msg {
  font-size: 13px;
  color: rgba(255,255,255,.72);
  line-height: 1.5;
  margin-bottom: 20px;
  padding: 0 8px;
}

.spin-popup__btn {
  width: 100%;
  max-width: 280px;
  height: 54px;
  border: none;
  border-radius: 999px;
  background: #e83680;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  margin-bottom: 18px;
  box-shadow: 0 4px 24px rgba(232,54,128,.45);
  transition: transform .12s, box-shadow .12s;
}

.spin-popup__btn:hover  { transform: translateY(-1px); box-shadow: 0 6px 28px rgba(232,54,128,.55); }
.spin-popup__btn:active { transform: scale(.97); }
.spin-popup__btn--resgatar { background: #e83680; }

.spin-popup__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.38);
  background: transparent;
  color: rgba(255,255,255,.7);
  font-size: 16px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.spin-popup__close:hover {
  border-color: rgba(255,255,255,.8);
  color: #fff;
}

/* ================================================================
   DESKTOP  (> 480 px) — sem moldura, conteúdo centrado
   ================================================================ */
@media (min-width: 481px) {
  body {
    background: #f0f2f5;
  }

  /* ecrãs 1 e 2 */
  .page-wrap {
    max-width: 480px;
    min-height: 100vh;
    border-left:  1px solid #eaedf5;
    border-right: 1px solid #eaedf5;
  }

  /* ecrã da roleta (sem moldura, só max-width) */
  .wheel-page {
    max-width: 480px;
    min-height: 100vh;
    border-left:  1px solid rgba(0,80,0,.15);
    border-right: 1px solid rgba(0,80,0,.15);
  }

  .modal-card          { max-width: 400px; }
  .spin-popup__content { max-width: 380px; }
}
