/* ============================================================
   ZÉ APOSTAS · USER / CONTA E GAMIFICAÇÃO
   CSS filho da página de usuário.
   Regra: app.css é o pai; aqui ficam só composição, ajustes
   específicos da conta, gamificação, ZET, sheets e apoio.
   ============================================================ */

/* ------------------------------------------------------------
   1) SHELL DA PÁGINA
   Mantém o espaçamento da tela de usuário sem redefinir o app.
   ------------------------------------------------------------ */
.za-user-page,
.za-user-page-shell,
.za-user-shell{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-width:0;
  max-width:100%;
}

.za-user-shell{
  padding-bottom:110px;
}

.za-user-panel-premium{
  min-width:0;
  max-width:100%;
  padding:16px;
  border-radius:26px;
  border:1px solid var(--za-line);
  background:linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.030));
  box-shadow:var(--za-shadow-soft);
  overflow:hidden;
}

.za-user-journey-card{
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.10), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.060), rgba(255,255,255,.030));
}

.za-panel-head,
.za-user-account-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  min-width:0;
  max-width:100%;
  margin-bottom:12px;
}

.za-panel-head > div,
.za-user-account-head > div{
  min-width:0;
  flex:1 1 auto;
}

.za-panel-head--lean{
  margin-bottom:10px;
}

.za-panel-head--lean .za-tip-kicker{
  margin-bottom:7px;
}

.za-user-account-head{
  align-items:center;
  margin-bottom:14px;
}

.za-user-account-head .za-tip-kicker{
  margin:0;
}

/*
.za-user-section-copy,
.za-user-profile-text,
.za-list-card-desc,
.za-user-foot-note{
  margin:0;
  color:var(--za-text-soft);
  font-size:13px;
  line-height:1.45;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}

*/

/* protege textos narrativos herdados do design system */
.za-user-panel-premium .za-tip-card__narrative,
.za-user-panel-premium .za-tip-card__narrative-line{
  min-width:0;
  max-width:100%;
}

.za-user-panel-premium .za-tip-card__narrative-line{
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* ------------------------------------------------------------
   2) BADGE DO PLANO
   Usado no topo da conta. JS pode alternar .is-premium.
   ------------------------------------------------------------ */
.za-user-plan-badge,
.za-user-plan-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:7px 11px;
  border-radius:999px;
  border:1px solid rgba(56,189,248,.24);
  background:rgba(56,189,248,.10);
  color:#7dd3fc;
  font-size:11px;
  line-height:1;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  white-space:nowrap;
}

.za-user-plan-badge.is-premium,
.za-user-plan-pill.is-premium{
  border-color:rgba(250,204,21,.36);
  background:rgba(250,204,21,.13);
  color:#facc15;
}

.za-user-plan-pill{
  min-height:32px;
  color:var(--za-text-soft);
  letter-spacing:0;
  text-transform:none;
}

.za-user-plan-pill strong{
  margin-left:4px;
  color:#38bdf8;
  font-weight:900;
}

/* ------------------------------------------------------------
   3) CARDS DA JORNADA: ZET / NÍVEL / RANK
   Mantém 3 colunas no mobile e corrige respiro interno.
   ------------------------------------------------------------ */
.za-user-stat-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
  min-width:0;
  max-width:100%;
}

.za-user-stat-grid--journey,
.za-user-stat-grid.za-user-stat-grid--journey{
  grid-template-columns:repeat(3, minmax(0, 1fr));
}

.za-user-stat-card{
  min-width:0;
  padding:12px 8px;
  border-radius:18px;
  border:1px solid var(--za-line);
  background:rgba(255,255,255,.04);
  box-shadow:var(--za-shadow-soft);
  text-align:center;
  color:var(--za-text);
}

.za-user-stat-card--compact{
  min-height:104px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
}

.za-user-stat-card--button{
  text-decoration:none;
  cursor:pointer;
  transition:transform .12s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
  touch-action:manipulation;
}

.za-user-stat-card--button:active{
  transform:translateY(1px) scale(.992);
}

.za-user-stat-card--button:focus-visible{
  outline:2px solid rgba(56,189,248,.55);
  outline-offset:3px;
}

.za-user-stat-card--button:hover{
  border-color:rgba(56,189,248,.22);
  background:rgba(56,189,248,.055);
}

.za-user-stat-icon{
  font-size:18px;
  line-height:1;
  margin:0 0 3px;
}

.za-user-stat-label{
  color:var(--za-muted);
  font-size:10px;
  line-height:1;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}

.za-user-stat-value{
  color:var(--za-text);
  font-size:15px;
  line-height:1.1;
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}

.za-user-level-progress{
  width:100%;
  max-width:82px;
  height:6px;
  margin:2px auto 4px;
  overflow:hidden;
  border-radius:999px;
  background:rgba(255,255,255,.10);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);
}

.za-user-level-progress span,
#za-gm-level-progress-bar{
  display:block;
  width:18%;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(56,189,248,.95), rgba(250,204,21,.88));
  box-shadow:0 0 14px rgba(56,189,248,.22);
  transition:width .4s ease;
}

.za-user-stat-note{
  min-height:22px;
  margin:0;
  color:var(--za-muted);
  font-size:10px;
  line-height:1.18;
}

/* ------------------------------------------------------------
   4) LISTAS DINÂMICAS: MISSÕES / RANK / HISTÓRICO
   Estrutura consumida pelo user.js sem mudar HTML ou lógica.
   ------------------------------------------------------------ */
.za-list-premium{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
  min-width:0;
  max-width:100%;
}

.za-list-card-premium{
  min-width:0;
  max-width:100%;
  padding:14px;
  border-radius:22px;
  border:1px solid var(--za-line);
  background:rgba(255,255,255,.04);
  box-shadow:var(--za-shadow-soft);
}

.za-list-card-premium.is-priority{
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.08), transparent 26%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.030));
}

.za-list-card-premium.is-complete{
  opacity:.88;
}

.za-list-card-title{
  min-width:0;
  max-width:100%;
  margin:0 0 6px;
  color:var(--za-text);
  font-size:16px;
  line-height:1.22;
  font-weight:900;
}

.za-mission-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
  min-width:0;
  max-width:100%;
}

.za-mission-chip{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  max-width:100%;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--za-line);
  background:rgba(255,255,255,.05);
  color:var(--za-text-soft);
  font-size:12px;
  font-weight:800;
}

.za-mission-chip.is-active{
  color:#38bdf8;
  border-color:rgba(56,189,248,.18);
  background:rgba(56,189,248,.08);
}

.za-mission-chip.is-done{
  color:#86efac;
  border-color:rgba(134,239,172,.18);
  background:rgba(34,197,94,.08);
}

.za-empty-card{
  min-width:0;
  max-width:100%;
  padding:18px;
  border-radius:24px;
  border:1px dashed rgba(255,255,255,.12);
  background:rgba(255,255,255,.02);
  color:var(--za-text-soft);
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.za-user-back-btn{
  width:fit-content;
  align-self:flex-start;
  margin-bottom:12px;
}

/* ------------------------------------------------------------
   5) USE SEUS ZETS / RESGATE PREMIUM
   Mantém cards de resgate em grid simples e premium.
   ------------------------------------------------------------ */
.za-user-zet-panel .za-panel-head{
  align-items:flex-start;
}

.za-user-zet-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.za-user-zet-list .za-list-card-premium.is-priority{
  border-color:rgba(56,189,248,.20);
  background:linear-gradient(180deg, rgba(56,189,248,.10), rgba(255,255,255,.035));
}

.za-zet-plan-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.za-zet-plan-card{
  width:100%;
  min-width:0;
  min-height:142px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:14px;
  border-radius:22px;
  border:1px solid var(--za-line);
  background:rgba(255,255,255,.045);
  color:var(--za-text);
  box-shadow:var(--za-shadow-soft);
  text-align:center;
  cursor:pointer;
  transition:transform .14s ease, border-color .14s ease, background .14s ease, opacity .14s ease;
}

.za-zet-plan-card:active{
  transform:translateY(1px);
}

.za-zet-plan-card:focus-visible{
  outline:2px solid rgba(56,189,248,.55);
  outline-offset:3px;
}

.za-zet-plan-card.is-active{
  border-color:rgba(250,204,21,.54);
  background:
    radial-gradient(circle at top right, rgba(250,204,21,.16), transparent 34%),
    rgba(255,255,255,.045);
}

.za-zet-plan-card.is-disabled{
  opacity:.78;
  cursor:not-allowed;
}

.za-zet-plan-title{
  display:block;
  color:var(--za-text);
  font-size:13px;
  line-height:1.2;
  font-weight:850;
}

.za-zet-plan-cost{
  display:block;
  color:#facc15;
  font-size:18px;
  line-height:1.05;
  font-weight:900;
}

.za-zet-plan-note{
  display:block;
  color:var(--za-text-soft);
  font-size:12px;
  line-height:1.3;
  font-weight:650;
}

/* ------------------------------------------------------------
   6) PROJETO / APOIO
   Bloco informativo da conta, sem alterar links ou ações.
   ------------------------------------------------------------ */
.za-support-panel{
  overflow:hidden;
}

.za-project-support-card{
  display:grid;
  gap:14px;
  padding:14px;
  border-radius:22px;
  border:1px solid var(--za-line);
  background:rgba(255,255,255,.04);
  box-shadow:var(--za-shadow-soft);
}

.za-project-support-card.is-supporter{
  background:
    radial-gradient(circle at top right, rgba(34,197,94,.12), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.030));
}

.za-project-support-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.za-project-support-card .za-list-card-title{
  margin-top:4px;
}

.za-support-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--za-line);
  background:rgba(255,255,255,.05);
  color:var(--za-text-soft);
  font-size:12px;
  font-weight:800;
  text-align:center;
  white-space:nowrap;
}

.za-support-badge.is-active{
  color:#bbf7d0;
  border-color:rgba(34,197,94,.24);
  background:rgba(34,197,94,.12);
}

.za-support-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.za-support-actions .za-btn{
  flex:1 1 0;
  justify-content:center;
}

/* ------------------------------------------------------------
   7) BOTTOM SHEET DA CONTA
   Detalhes de histórico, missões e rank acionados pelos cards.
   ------------------------------------------------------------ */
body.za-user-sheet-open{
  overflow:hidden;
}

.za-user-sheet{
  position:fixed;
  inset:0;
  z-index:9999;
  pointer-events:none;
  opacity:0;
  transition:opacity .18s ease;
}

.za-user-sheet.is-open{
  pointer-events:auto;
  opacity:1;
}

.za-user-sheet__backdrop{
  position:absolute;
  inset:0;
  border:0;
  padding:0;
  background:rgba(2,6,23,.72);
  backdrop-filter:blur(10px);
  cursor:pointer;
}

.za-user-sheet__panel{
  position:absolute;
  left:50%;
  right:auto;
  bottom:0;
  width:min(100%, 520px);
  max-height:min(82vh, 720px);
  display:flex;
  flex-direction:column;
  padding:10px 16px calc(18px + env(safe-area-inset-bottom));
  border:1px solid var(--za-line);
  border-radius:28px 28px 0 0;
  background:linear-gradient(180deg, rgba(15,23,42,.98), rgba(2,6,23,.98));
  box-shadow:0 -20px 44px rgba(0,0,0,.45);
  transform:translate(-50%, 105%);
  transition:transform .22s ease;
}

.za-user-sheet.is-open .za-user-sheet__panel{
  transform:translate(-50%, 0);
}

.za-user-sheet__handle{
  width:42px;
  height:4px;
  margin:0 auto 12px;
  border-radius:999px;
  background:rgba(255,255,255,.22);
}

.za-user-sheet__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding-bottom:12px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.za-user-sheet__title{
  margin:4px 0 0;
  color:var(--za-text);
  font-size:18px;
  line-height:1.2;
}

.za-user-sheet__close{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border-radius:14px;
  border:1px solid var(--za-line);
  background:rgba(255,255,255,.05);
  color:var(--za-text);
  font-size:24px;
  line-height:1;
  cursor:pointer;
}

.za-user-sheet__body{
  min-height:0;
  overflow:auto;
  padding-top:14px;
  -webkit-overflow-scrolling:touch;
}

.za-user-sheet__body[hidden]{
  display:none !important;
}

.za-user-sheet .za-list-premium{
  padding-bottom:4px;
}

/* ------------------------------------------------------------
   8) COMPATIBILIDADE: BLOCOS ABOUT/APOIO
   Mantidos porque este CSS pode ser reaproveitado em telas de projeto.
   ------------------------------------------------------------ */
.za-about-shell{
  display:flex;
  flex-direction:column;
  gap:18px;
  padding-bottom:110px;
}

.za-about-panel{
  padding:16px;
  border-radius:26px;
  border:1px solid var(--za-line);
  background:linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.030));
  box-shadow:var(--za-shadow-soft);
}

.za-about-title{
  margin:0 0 10px;
  color:var(--za-text);
  font-size:18px;
  font-weight:900;
}

.za-about-text{
  margin:0;
  color:var(--za-text-soft);
  font-size:14px;
  line-height:1.55;
}

.za-about-stack{
  display:grid;
  gap:12px;
}

.za-about-callout{
  padding:14px;
  border-radius:20px;
  border:1px solid var(--za-line);
  background:rgba(255,255,255,.04);
  box-shadow:var(--za-shadow-soft);
}

.za-about-pix-box{
  margin-top:12px;
  padding:12px;
  border-radius:16px;
  border:1px dashed rgba(255,255,255,.16);
  background:rgba(2,6,23,.58);
  color:var(--za-text);
  font-size:13px;
  line-height:1.5;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.za-about-supporter-line{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:12px;
}

/* ------------------------------------------------------------
   9) RESPONSIVIDADE
   Ajuste fino para Telegram/mobile sem trocar estrutura.
   ------------------------------------------------------------ */
@media (max-width:768px){
  .za-user-page,
  .za-user-page-shell,
  .za-user-shell{
    gap:12px;
  }

  .za-project-support-top,
  .za-about-supporter-line{
    flex-direction:column;
    align-items:flex-start;
  }

  .za-support-actions{
    flex-direction:column;
  }

  .za-support-actions .za-btn{
    width:100%;
  }

  .za-support-badge{
    white-space:normal;
  }
}

@media (max-width:520px){
  .za-user-sheet__panel{
    width:100%;
    max-height:84vh;
    border-radius:24px 24px 0 0;
  }
}

@media (max-width:420px){
  .za-user-panel-premium{
    padding:14px;
    border-radius:24px;
  }

  .za-user-account-head{
    margin-bottom:12px;
  }

  .za-user-stat-grid,
  .za-user-stat-grid--journey,
  .za-user-stat-grid.za-user-stat-grid--journey{
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:7px;
  }

  .za-user-stat-card{
    padding:11px 6px;
    border-radius:16px;
  }

  .za-user-stat-card--compact{
    min-height:100px;
  }

  .za-user-stat-icon{
    font-size:17px;
  }

  .za-user-stat-label{
    font-size:10px;
    letter-spacing:.04em;
  }

  .za-user-stat-value{
    font-size:14px;
  }

  .za-user-stat-note{
    font-size:10px;
  }

  .za-zet-plan-grid{
    gap:8px;
  }

  .za-zet-plan-card{
    min-height:136px;
    padding:12px;
    border-radius:20px;
  }

  .za-zet-plan-cost{
    font-size:16px;
  }
}

@media (prefers-reduced-motion: reduce){
  .za-user-stat-card--button,
  .za-zet-plan-card,
  .za-user-sheet,
  .za-user-sheet__panel{
    transition:none !important;
  }
}
