/* ============================================================
   Escapadinha a Dois — Componentes
   Regras: cartões radius ≤16px; OU border OU glow (nunca ambos);
   sem gradient text; glass só em pills sobre fotos.
   ============================================================ */

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  transition: transform var(--dur-fast) var(--ease),
              filter var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  user-select: none;
  text-decoration: none;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--glow-accent);   /* glow, sem border */
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--surface-2); }

.btn-quiet {
  background: transparent;
  color: var(--muted);
}
.btn-quiet:hover { color: var(--ink); }

.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 13px; }
.btn-danger { background: var(--danger); color: var(--ink); box-shadow: 0 0 20px oklch(0.680 0.200 25 / 0.3); }

/* Botão de ícone quadrado */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn:active { transform: scale(0.92); }

/* ---------- Cartões ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px;
}

/* Cartão "ao vivo" — destaque por glow, sem border decorativa extra */
.card-live {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--glow-accent);
}

.card-done {
  opacity: 0.55;
}

.card-title {
  font-size: 16px;
  letter-spacing: -0.02em;
}

/* Capa de foto de paragem */
.stop-cover {
  position: relative;
  height: 150px;
  overflow: hidden;
  background: var(--surface-2);
}
.stop-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.stop-cover .sc-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, oklch(0.135 0.020 340 / 0.85), transparent 55%);
}

/* Pill de vidro sobre foto — glass com propósito */
.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: oklch(0.135 0.020 340 / 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

/* ---------- Pills de estado ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill.is-live { color: var(--accent-soft); border-color: oklch(0.650 0.250 5 / 0.55); box-shadow: var(--glow-soft); }
.pill.is-live .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse-dot 2s var(--ease) infinite; }
.pill.is-warn { color: var(--amber); border-color: oklch(0.800 0.120 75 / 0.45); }
.pill.is-warn .dot { background: var(--amber); }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.7; }
}

/* ---------- Tab bar ---------- */
#tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--shell-max);
  z-index: var(--z-tabbar);
  background: oklch(0.155 0.020 340 / 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + var(--safe-b));
  display: flex;
  justify-content: space-around;
}
.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  flex: 1;
  max-width: 84px;
}
.tab-btn svg { width: 22px; height: 22px; stroke-width: 2; }
.tab-btn:active { transform: scale(0.92); }
.tab-btn.is-active { color: var(--accent); }
.tab-btn.is-active svg { filter: drop-shadow(0 0 6px oklch(0.650 0.250 5 / 0.8)); }

/* ---------- FAB coração ---------- */
#heart-fab {
  position: fixed;
  right: max(16px, calc(50% - var(--shell-max) / 2 + 16px));
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  z-index: var(--z-fab);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-accent);
  transition: transform var(--dur-fast) var(--ease);
}
#heart-fab:active { transform: scale(0.88); }
#heart-fab svg { width: 26px; height: 26px; }

/* ---------- Anel de progresso ---------- */
.ring-wrap { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { stroke: var(--surface-2); }
.ring-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px oklch(0.650 0.250 5 / 0.7));
  transition: stroke-dashoffset var(--dur-slow) var(--ease);
}
.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
}

/* ---------- Barras de progresso / XP ---------- */
.progress {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--accent);
  box-shadow: 0 0 12px oklch(0.650 0.250 5 / 0.55);
  transition: width var(--dur-slow) var(--ease);
}
.progress.progress-amber > i { background: var(--amber); box-shadow: 0 0 12px oklch(0.800 0.120 75 / 0.45); }

/* ---------- Deck (Decidir) ---------- */
.deck-stage {
  position: relative;
  height: min(58dvh, 460px);
  margin-top: 8px;
  touch-action: pan-y;
}
.deck-card {
  position: absolute;
  inset: 0;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  will-change: transform;
  user-select: none;
  cursor: pointer;
}
.deck-card:active { cursor: grabbing; }
.deck-card .deck-img { position: absolute; inset: 0; }
.deck-card .deck-img img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.deck-card .deck-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, oklch(0.135 0.020 340 / 0.92) 8%, transparent 55%);
}
.deck-card .deck-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px;
  pointer-events: none;
}
.deck-tap-affordance {
  margin-top: 10px;
  display: flex;
  align-items: center;
}
.deck-tap-affordance .glass-pill {
  font-size: 11px;
  padding: 5px 11px;
  color: var(--ink);
  background: oklch(0.135 0.020 340 / 0.85);
  border: 1px solid oklch(0.965 0.012 340 / 0.18);
  box-shadow: 0 4px 14px oklch(0 0 0 / 0.3);
}
.deck-stamp {
  position: absolute;
  top: 18px;
  padding: 6px 14px;
  border: 3px solid currentColor;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.06em;
  opacity: 0;
  transform: rotate(-12deg) scale(1.2);
  transition: opacity var(--dur-fast), transform var(--dur-fast) var(--ease);
  pointer-events: none;
}
.deck-stamp.stamp-yes { left: 18px; color: var(--accent); text-shadow: 0 0 14px oklch(0.650 0.250 5 / 0.8); }
.deck-stamp.stamp-no { right: 18px; color: var(--faint); transform: rotate(12deg) scale(1.2); }
.deck-card[data-lean="yes"] .stamp-yes,
.deck-card[data-lean="no"] .stamp-no { opacity: 1; transform: rotate(-12deg) scale(1); }
.deck-card[data-lean="no"] .stamp-no { transform: rotate(12deg) scale(1); }

.deck-actions {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 18px;
}
.deck-action {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast);
}
.deck-action:active { transform: scale(0.88); }
.deck-action svg { width: 28px; height: 28px; }
.deck-action.action-yes { background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow-accent); }
.deck-action.action-no { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border-strong); }
.deck-action.action-yes:hover { filter: brightness(1.08); }

/* ---------- Polaroids (Memórias) ---------- */
.mem-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.polaroid {
  background: oklch(0.940 0.012 340);
  border-radius: 4px;
  padding: 7px 7px 4px;
  transform: rotate(var(--tilt, 0deg));
  transition: transform var(--dur-med) var(--ease);
}
.polaroid:hover { transform: rotate(0deg) scale(1.02); }
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2px; }
.polaroid .pol-cap {
  font-family: var(--font-display);
  color: oklch(0.300 0.020 340);
  font-size: 12px;
  line-height: 1.3;
  padding: 6px 2px 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 36px;
}

/* ---------- Badges ---------- */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.badge-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.badge-cell svg { width: 26px; height: 26px; }
.badge-cell .badge-name { font-size: 11.5px; font-weight: 700; font-family: var(--font-display); letter-spacing: -0.01em; }
.badge-cell .badge-desc { font-size: 10px; color: var(--muted); line-height: 1.35; }
.badge-cell.is-locked { opacity: 0.55; }
.badge-cell.is-locked svg { color: var(--faint); }
.badge-cell.is-unlocked {
  border-color: oklch(0.650 0.250 5 / 0.5);
  box-shadow: var(--glow-soft);
  background: oklch(0.222 0.040 350);
}
.badge-cell.is-unlocked svg { color: var(--accent); filter: drop-shadow(0 0 6px oklch(0.650 0.250 5 / 0.8)); }

/* Pop de badge desbloqueado */
.badge-pop {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  z-index: var(--z-fx);
  background: var(--surface-2);
  border: 1px solid oklch(0.650 0.250 5 / 0.55);
  border-radius: var(--r-card);
  box-shadow: var(--glow-accent);
  padding: 22px 28px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  animation: badge-pop-in 3.2s var(--ease) forwards;
}
.badge-pop svg { width: 40px; height: 40px; color: var(--accent); margin: 0 auto 8px; filter: drop-shadow(0 0 10px oklch(0.650 0.250 5 / 0.9)); }
.badge-pop .bp-title { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--accent-soft); }
.badge-pop .bp-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin-top: 2px; }

@keyframes badge-pop-in {
  0% { opacity: 0; transform: translateX(-50%) scale(0.8); }
  8% { opacity: 1; transform: translateX(-50%) scale(1.04); }
  14% { transform: translateX(-50%) scale(1); }
  84% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) scale(0.96); }
}

/* ---------- Toasts ---------- */
#toasts {
  position: fixed;
  top: calc(12px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, var(--shell-max) - 32px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  box-shadow: 0 8px 28px oklch(0.100 0.020 340 / 0.6);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
  pointer-events: auto;
  max-width: 100%;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-accent { border-color: oklch(0.650 0.250 5 / 0.55); box-shadow: var(--glow-soft); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }

/* ---------- Banner offline / geo ---------- */
.app-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
}
.app-banner.is-warn { border-color: oklch(0.800 0.120 75 / 0.4); }
.app-banner svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--amber); }

/* ---------- Modais ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: oklch(0.100 0.020 340 / 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%;
  max-width: 400px;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  padding: 20px;
  transform: translateY(14px) scale(0.98);
  transition: transform var(--dur-med) var(--ease);
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }

/* ---------- Formulários ---------- */
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.input, select.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  transition: border-color var(--dur-fast);
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); }

/* Checkbox custom (desafios, checklist) */
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--dur-fast);
  font-size: 13.5px;
}
.check:hover { background: var(--surface-2); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.check .box svg { width: 12px; height: 12px; color: var(--accent-ink); opacity: 0; transform: scale(0.4); transition: opacity var(--dur-fast), transform var(--dur-fast) var(--ease); }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); box-shadow: var(--glow-soft); }
.check input:checked + .box svg { opacity: 1; transform: scale(1); }
.check input:checked ~ .txt { color: var(--muted); text-decoration: line-through; text-decoration-color: oklch(0.650 0.250 5 / 0.6); }

/* ---------- Surpresa ---------- */
.surprise {
  border: 1px dashed oklch(0.650 0.250 5 / 0.5);
  border-radius: var(--r-card);
  padding: 14px;
  background: oklch(0.222 0.040 350 / 0.5);
}
.surprise.is-locked { background: var(--surface); border-color: var(--border-strong); }
.surprise .surprise-title {
  font-family: var(--font-display);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.surprise.is-locked .surprise-title { color: var(--muted); }
.surprise.is-unlocked .surprise-title { color: var(--accent-soft); }

/* ---------- Corações flutuantes ---------- */
#fx {
  position: fixed;
  inset: 0;
  z-index: var(--z-fx);
  pointer-events: none;
  overflow: hidden;
}
.fx-heart {
  position: absolute;
  width: 26px;
  height: 26px;
  color: var(--accent);
  filter: drop-shadow(0 0 8px oklch(0.650 0.250 5 / 0.9));
  animation: heart-rise var(--dur, 1.6s) var(--ease) forwards;
  opacity: 0;
}
@keyframes heart-rise {
  0% { opacity: 0; transform: translateY(0) scale(0.5) rotate(0deg); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-46vh) scale(1.15) rotate(var(--rot, 12deg)); }
}

/* ---------- Confete ---------- */
.confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  animation: confetti-fall var(--dur, 2.6s) var(--ease) forwards;
  opacity: 0;
}
@keyframes confetti-fall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(105dvh) translateX(var(--drift, 0px)) rotate(var(--spin, 360deg)); }
}

/* ---------- Onboarding ---------- */
#onboarding {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
#onboarding[hidden] { display: none; }
.onb-inner { width: 100%; max-width: 400px; }
.onb-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--accent);
  box-shadow: var(--glow-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.onb-logo svg { width: 40px; height: 40px; color: var(--accent-ink); }

/* Código grande da sala */
.room-code {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--accent-soft);
  text-shadow: 0 0 24px oklch(0.650 0.250 5 / 0.55);
  padding: 14px 0;
}

/* Cabeçalho de secção dentro das views */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 20px 0 10px;
}
.sec-head h2 { font-size: 18px; }
.sec-head .sec-note { font-size: 12px; color: var(--faint); }

/* Entrada escalonada em listas (melhoria sobre conteúdo já visível) */
@media (prefers-reduced-motion: no-preference) {
  .stagger > * {
    animation: rise-in var(--dur-med) var(--ease) backwards;
  }
  .stagger > *:nth-child(1) { animation-delay: 20ms; }
  .stagger > *:nth-child(2) { animation-delay: 60ms; }
  .stagger > *:nth-child(3) { animation-delay: 100ms; }
  .stagger > *:nth-child(4) { animation-delay: 140ms; }
  .stagger > *:nth-child(5) { animation-delay: 180ms; }
  .stagger > *:nth-child(n+6) { animation-delay: 220ms; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
