/* Estrelas — palco de missões. Visual original inspirado na energia de palco
   (navy, magenta, roxo de trança, ouro). Nenhum asset oficial. */

:root {
  --bg: #07060e;
  --bg-2: #100b1c;
  --purple: #9b5cff;
  --purple-soft: #c9a0ff;
  --gold: #ffd24a;
  --gold-deep: #f4c430;
  --magenta: #ff2d8a;
  --cyan: #5ce1ff;
  --text: #f7f1ff;
  --muted: #b7a8cc;
  --card: rgba(18, 14, 32, 0.78);
  --stroke: rgba(201, 160, 255, 0.22);
  --danger: #ff6b9d;
  --ok: #7dffc3;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --tap: 52px;
  --pad: 22px;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 55% 38% at 18% -4%, rgba(155, 92, 255, 0.42), transparent 58%),
    radial-gradient(ellipse 50% 34% at 86% -6%, rgba(255, 45, 138, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 108%, rgba(244, 196, 48, 0.08), transparent 60%),
    var(--bg);
  overflow: hidden;
}

.honmoon {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 72px;
  pointer-events: none;
  z-index: 40;
}
.honmoon svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 10px rgba(92, 225, 255, 0.45))
          drop-shadow(0 6px 18px rgba(255, 210, 74, 0.28));
}

.stage-grain {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

#app {
  position: relative;
  z-index: 2;
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(7,6,14,0.2), rgba(7,6,14,0.72) 28%, #0a0814 100%);
}

@media (min-width: 560px) {
  body {
    overflow: auto;
    padding: 28px 16px;
  }
  #app {
    height: min(920px, calc(100dvh - 56px));
    max-height: calc(100dvh - 56px);
    min-height: 0;
    margin: 0 auto;
    border-radius: 36px;
    border: 1px solid var(--stroke);
    box-shadow:
      0 0 0 1px rgba(255, 210, 74, 0.06),
      0 0 80px rgba(155, 92, 255, 0.28),
      0 30px 80px rgba(0, 0, 0, 0.55);
  }
}

/* Header */
.topbar {
  flex-shrink: 0;
  padding: 32px 22px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--purple-soft);
  text-transform: uppercase;
}
.hello {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.2;
}
.hello span { color: var(--gold); }
.leader-btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(155, 92, 255, 0.12);
  color: var(--purple-soft);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}
.leader-btn:active { transform: scale(0.97); }

.wallet-strip {
  flex-shrink: 0;
  margin: 8px 22px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 10px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 12px 10px 10px;
  text-align: center;
  backdrop-filter: blur(10px);
}
.stat .lbl {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.stat .val {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--gold);
  margin-top: 2px;
}
.stat.disponivel {
  border-color: rgba(255, 210, 74, 0.45);
  box-shadow: 0 0 24px rgba(255, 210, 74, 0.12);
}
.stat.disponivel .val { font-size: 1.35rem; }
.stat.reservado .val { color: var(--purple-soft); }

.view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 8px 22px 28px;
  -webkit-overflow-scrolling: touch;
}

h2.section {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 18px 2px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--magenta);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.muted { color: var(--muted); }
.tiny { font-size: 0.82rem; line-height: 1.4; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card.aprovada {
  border-color: rgba(255, 180, 220, 0.55);
  box-shadow: 0 0 28px rgba(255, 45, 138, 0.18), 0 0 48px rgba(201, 160, 255, 0.12);
}
.card.aprovada::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255,160,210,0.16) 45%, transparent 70%);
  background-size: 220% 100%;
  animation: shimmer 3.2s ease-in-out infinite;
  pointer-events: none;
}
.card.aguardando {
  border-color: rgba(255, 45, 138, 0.5);
  animation: pulse-border 1.8s ease-in-out infinite;
}
.card.locked {
  opacity: 0.55;
  filter: grayscale(0.25);
}
@keyframes shimmer {
  0% { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 45, 138, 0.25); }
  50% { box-shadow: 0 0 22px 2px rgba(255, 45, 138, 0.28); }
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.points-pill {
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffe58a, var(--gold-deep));
  color: #2a1a00;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(255, 210, 74, 0.28);
}
.card h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 800;
}
.card p { margin: 0 0 14px; color: var(--muted); font-size: 0.98rem; line-height: 1.45; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.status-chip.pendente { background: rgba(155,92,255,.18); color: var(--purple-soft); }
.status-chip.aguardando { background: rgba(255,45,138,.18); color: #ffb3d4; }
.status-chip.aprovada { background: rgba(125,255,195,.12); color: var(--ok); }
.status-chip.bloqueada { background: rgba(255,255,255,.06); color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  width: 100%;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  color: white;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-magenta {
  background: linear-gradient(180deg, #ff4ea0, var(--magenta));
  box-shadow: 0 10px 24px rgba(255, 45, 138, 0.32);
}
.btn-gold {
  background: linear-gradient(180deg, #ffe58a, var(--gold-deep));
  color: #2a1a00;
  box-shadow: 0 10px 24px rgba(255, 210, 74, 0.28);
}
.btn-purple {
  background: linear-gradient(180deg, #b57aff, var(--purple));
  box-shadow: 0 10px 24px rgba(155, 92, 255, 0.32);
}
.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--stroke);
  color: var(--purple-soft);
}
.btn-danger {
  background: transparent;
  border: 1.5px solid rgba(255, 45, 138, 0.45);
  color: #ffb3d4;
}
.btn-ok {
  background: linear-gradient(180deg, #8a7dff, #3ec7c9);
  box-shadow: 0 10px 24px rgba(92, 225, 255, 0.2);
}
.btn:disabled, .btn.disabled {
  cursor: not-allowed;
  background: #2a2438;
  color: #7a718c;
  box-shadow: none;
  border: 1px dashed rgba(255,255,255,.12);
}
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-sm { min-height: 46px; font-size: 0.9rem; border-radius: 14px; }
.icon-btn {
  min-width: 46px; min-height: 46px;
  border-radius: 14px; border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04); color: var(--text);
  font-size: 1.1rem; cursor: pointer;
}

/* Bottom nav */
.nav {
  flex-shrink: 0;
  position: relative;
  bottom: auto;
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
  background: rgba(10, 8, 20, 0.96);
  border-top: 1px solid rgba(201,160,255,0.12);
  z-index: 5;
}
.nav.parent {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 10px 8px calc(14px + env(safe-area-inset-bottom));
}
.nav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.78rem;
  min-height: 62px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
}
.nav.parent .nav-btn { font-size: 0.68rem; min-height: 60px; }
.nav-btn .ico { font-size: 1.25rem; line-height: 1; }
.nav-btn.active {
  color: var(--gold);
  background: rgba(155, 92, 255, 0.16);
}
.nav-btn .dot {
  position: absolute;
  margin-left: 18px;
  margin-top: -28px;
  width: 9px; height: 9px;
  background: var(--magenta);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--magenta);
}

/* Store */
.reward-emoji {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,.35));
}
.reward-img {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--stroke);
}
.lock-hint {
  margin-top: 4px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffb3d4;
}

/* Statement */
.ledger {
  list-style: none;
  margin: 0; padding: 0;
}
.ledger li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ledger .when { color: var(--muted); font-size: 0.75rem; }
.ledger .amt { font-weight: 800; font-family: var(--font-display); }
.ledger .amt.plus { color: var(--gold); }
.ledger .amt.minus { color: var(--magenta); }
.ledger .amt.hold { color: var(--purple-soft); }
.ledger li.cancelada { opacity: 0.55; }
.ledger li.cancelada .tit { text-decoration: line-through; }

/* PIN */
.pin-wrap {
  padding: 24px 20px 40px;
  text-align: center;
}
.pin-wrap h2 {
  font-family: var(--font-display);
  margin: 8px 0 6px;
}
.pin-slots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 8px;
}
.pin-slot {
  width: 52px; height: 58px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(18,14,32,0.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  color: var(--gold);
}
.pin-slot.filled { border-color: var(--purple); box-shadow: 0 0 16px rgba(155,92,255,.3); }
.pin-hint { font-size: 0.78rem; color: var(--muted); margin-bottom: 16px; }
.pin-error { color: var(--danger); font-weight: 800; min-height: 1.2em; }
.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}
.pad button {
  min-height: 64px;
  border-radius: 20px;
  border: 1px solid var(--stroke);
  background: rgba(155, 92, 255, 0.12);
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-display);
  cursor: pointer;
}
.pad button:active { background: rgba(255, 45, 138, 0.25); }

/* Forms */
label.fld { display: block; margin: 0 0 12px; font-size: 0.8rem; font-weight: 800; color: var(--muted); }
input, textarea, select {
  width: 100%;
  margin-top: 6px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(7,6,14,0.7);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 12px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--purple); }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.emoji-grid button {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.05);
  font-size: 1.2rem;
  cursor: pointer;
}
.emoji-grid button.sel {
  border-color: var(--gold);
  background: rgba(255, 210, 74, 0.15);
}

.steps {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  counter-reset: passo;
}
.steps li {
  position: relative;
  padding: 8px 8px 8px 42px;
  margin-bottom: 6px;
  background: rgba(155,92,255,0.08);
  border-radius: 14px;
  font-size: 0.95rem;
}
.steps li::before {
  counter-increment: passo;
  content: counter(passo);
  position: absolute;
  left: 8px; top: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--purple);
  color: white;
  font-weight: 800;
  font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
}
.criteria {
  border-left: 3px solid var(--gold);
  padding: 8px 12px;
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.9rem;
  background: rgba(255, 210, 74, 0.06);
  border-radius: 0 12px 12px 0;
}

/* Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 3, 10, 0.72);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: min(440px, 100%);
  max-height: 92dvh;
  overflow: auto;
  background: #120e1e;
  border: 1px solid var(--stroke);
  border-radius: 28px 28px 0 0;
  padding: 18px 18px 28px;
  box-shadow: 0 -20px 80px rgba(155, 92, 255, 0.2);
}
.sheet h3 {
  font-family: var(--font-display);
  margin: 0 0 12px;
  font-size: 1.2rem;
}
@media (min-width: 540px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 24px; max-height: 86vh; }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 60;
  background: linear-gradient(180deg, #2a1650, #160e28);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(255, 210, 74, 0.25);
  white-space: nowrap;
  animation: pop 0.25s ease-out;
}
@keyframes pop { from { transform: translateX(-50%) scale(0.9); opacity: 0; } }

.empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--muted);
}
.empty .big { font-size: 2.4rem; display: block; margin-bottom: 8px; }

.reject-box {
  background: rgba(255, 45, 138, 0.1);
  border: 1px solid rgba(255, 45, 138, 0.3);
  color: #ffb3d4;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.88rem;
  margin-bottom: 10px;
}

.credit {
  font-size: 0.7rem;
  color: #6e6280;
  text-align: center;
  margin-top: 24px;
  line-height: 1.4;
}

.fila-item { }
.fila-item .meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; }

.parent-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
