@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================
   SPYCE DESIGN SYSTEM — tokens canônicos (ver public/DESIGN.md)
   Editorial p&b · hairlines · vinho (ação) · dourado (detalhe)
   ============================================================ */
:root {
  /* Neutros — o esqueleto preto e branco */
  --paper:        #FAFAF7;
  --surface:      #FFFFFF;
  --ink:          #111110;
  --ink-2:        #4A4845;
  --ink-3:        #8A8680;
  --shell:        #0E0D0C;
  --shell-ink:    #F5F3EF;
  --shell-muted:  #8F8B84;
  --hair:         #E7E4DE;
  --hair-strong:  #D8D4CC;

  /* Acentos */
  --wine:         #6E1423;
  --wine-deep:    #55101C;
  --wine-tint:    #F7ECEE;
  --gold:         #C9A96E;
  --gold-light:   #DFC08A;
  --ok:           #2F6B44;
  --ok-bg:        #EAF2EC;
  --danger:       #A3242B;
  --danger-bg:    #F9ECEC;

  /* Tipografia */
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Forma */
  --radius:      3px;
  --radius-sm:   3px;
  --radius-lg:   4px;
  --radius-pill: 999px;

  /* Sombras: proibidas fora de overlay/modal */
  --shadow-sm: none;
  --shadow:    none;
  --shadow-md: none;
  --shadow-primary: none;
  --shadow-modal: 0 24px 64px rgba(17,17,16,.18);

  /* ---- Aliases de compatibilidade (nomes legados → DS) ---- */
  --primary:       var(--wine);
  --primary-dark:  var(--wine-deep);
  --primary-light: #8A2433;
  --primary-glow:  rgba(110,20,35,.08);
  --ink-soft:      var(--ink-2);
  --muted:         var(--ink-3);
  --bg:            var(--paper);
  --bg-alt:        #F4F3EF;
  --card:          var(--surface);
  --line:          var(--hair);
  --line-soft:     #EFEDE8;
  --success:       var(--ok);
  --success-bg:    var(--ok-bg);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* ===== Kicker — assinatura editorial do DS ===== */
.kicker {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
}
.kicker--ink { color: var(--ink-3); }

body.page-auth {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== App wrapper ===== */
.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 20px 100px;
}

/* ===== Topbar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
}

/* ===== Brand / Logo ===== */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin: 0;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
  text-decoration: none;
}
.brand span  { color: var(--primary); }
.brand-logo {
  height: 48px;
  width: auto;
  max-width: 180px;
  display: block;
  object-fit: contain;
}
.login-brand .brand-logo,
.invite-brand .brand-logo,
.onboarding-brand .brand-logo {
  height: 110px;
  max-width: 280px;
}
.auth-form[hidden] { display: none; }
.brand small {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  vertical-align: middle;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== Flame icon ===== */
.flame {
  width: 30px;
  height: 30px;
  flex: none;
  fill: var(--primary);
  filter: none;
  transform-origin: 50% 90%;
  animation: flicker 3s ease-in-out infinite;
}
.flame .flame-inner { fill: var(--gold); }
@keyframes flicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(1.04,.97) rotate(-1.5deg); }
  65% { transform: scale(.97,1.04) rotate(1deg); }
}

/* ===== Confetti canvas ===== */
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ===== Score card ===== */
.score-card {
  background: var(--shell);
  color: var(--shell-ink);
  border-radius: var(--radius);
  padding: 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 28px;
}
.score-label {
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--gold);
  font-weight: 600;
}
.score-value {
  font-family: var(--font-head);
  font-size: 58px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score-value.bump { animation: bump .4s ease; }
@keyframes bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}

/* ===== Skeleton loading ===== */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.skeleton-item {
  background: linear-gradient(90deg, var(--line) 25%, var(--line-soft) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
  height: 78px;
}
body[data-state="loading"] .task-list,
body[data-state="loading"] .redeem-list,
body[data-state="loading"] .section-title,
body[data-state="loading"] .suggest,
body[data-state="loading"] .app-footer,
body[data-state="loading"] #empty,
body[data-state="loading"] #redeemEmpty { display: none !important; }
body[data-state="loading"] .score-value {
  color: transparent;
  background: linear-gradient(90deg, rgba(255,255,255,.2) 25%, rgba(255,255,255,.45) 50%, rgba(255,255,255,.2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
  min-width: 80px;
  display: inline-block;
}
body:not([data-state="loading"]) .skeleton-list { display: none !important; }

/* ===== Task lists ===== */
.task-list, .admin-list, .redeem-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.task:hover { box-shadow: var(--shadow-md); }

.task-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.task-title {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.task-points {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.task-points.cost { color: var(--ink-soft); }

.task.done-pulse { animation: donePulse .55s ease; }
@keyframes donePulse {
  0%   { transform: scale(1); box-shadow: var(--shadow); }
  30%  { transform: scale(1.02); box-shadow: 0 0 0 3px var(--wine-tint); }
  100% { transform: scale(1); box-shadow: var(--shadow); }
}

.task-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-do {
  flex: none;
  border: none;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
  min-height: 44px;
}
.task-do:hover  { background: var(--primary-dark); box-shadow: none; }
.task-do:active { transform: scale(.96); }
.task-do:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.task-redeem { background: var(--ink); }
.task-redeem:hover { background: #000; box-shadow: none; }

.task-undo {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, transform .1s ease;
}
.task-undo:hover  { background: var(--wine-tint); border-color: var(--primary); }
.task-undo:active { transform: scale(.9); }
.task-undo:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ===== Section titles ===== */
.section-title {
  margin: 6px 0 16px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.section-title small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted);
  margin-left: 6px;
  font-size: 12px;
  opacity: .7;
}
.redeem-heading { margin-top: 36px; }

/* ===== Empty states ===== */
.empty {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  padding: 36px 16px;
}
.empty a { color: var(--primary); font-weight: 600; text-decoration: none; }
.empty a:hover { text-decoration: underline; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #fff;
  padding: 14px 16px 14px 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-modal);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  max-width: calc(100% - 40px);
  z-index: 200;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast span { font-size: 14px; font-weight: 500; }
.toast button {
  flex: none;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s;
}
.toast button:hover { background: rgba(255,255,255,.25); }

/* ===== Suggest form ===== */
.suggest {
  margin-top: 26px;
  text-align: center;
}
.suggest-toggle {
  border: 1.5px dashed var(--line);
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  min-height: 44px;
}
.suggest-toggle:hover { background: var(--card); border-color: var(--primary); }
.suggest-toggle .plus { display: inline-block; font-weight: 800; margin-right: 4px; }
.suggest-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.suggest-form input {
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  transition: border-color .15s;
}
.suggest-form input:focus { outline: none; border-color: var(--primary); background: var(--card); }
.suggest-form #suggTitle      { flex: 1 1 200px; }
.suggest-form #suggPoints     { width: 100px; }
.suggest-form #redeemSuggTitle  { flex: 1 1 200px; }
.suggest-form #redeemSuggPoints { width: 100px; }
.suggest-note {
  flex-basis: 100%;
  margin: 4px 0 0;
  color: var(--success);
  font-weight: 600;
  font-size: 14px;
}

/* ===== Sugestões unificadas ===== */
.suggest-merged { margin-top: 30px; }
.suggest-toggle-big {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.suggest-toggle-big:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.suggest-toggle-title { letter-spacing: -0.2px; }
.suggest-toggle-chevron {
  color: var(--primary);
  font-size: 15px;
  transition: transform .2s ease;
}
.suggest-toggle-big.open .suggest-toggle-chevron { transform: rotate(180deg); }
.suggest-panel {
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 18px;
  margin-top: -6px;
  background: var(--bg-alt);
  animation: contentIn .2s ease;
}
.suggest-panel[hidden] { display: none; }
.suggest-intro {
  margin: 0 0 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.6;
  text-align: center;
}
.suggest-intro strong { color: var(--primary); }
.suggest-form-block { margin-top: 0; }
.suggest-form-block + .suggest-form-block { margin-top: 14px; }
.suggest-form-label {
  flex-basis: 100%;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  text-align: left;
}

/* ===== Buttons ===== */
.btn-primary {
  border: none;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
  min-height: 44px;
}
.btn-primary:hover    { background: var(--primary-dark); box-shadow: none; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-primary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ===== Back link ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: color .15s, background .15s, border-color .15s;
  min-height: 44px;
}
.back-link:hover { color: var(--primary); background: var(--wine-tint); border-color: var(--wine); }

/* ===== User bar ===== */
.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
a.user-name:hover { color: var(--ink); }

.logout-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  min-height: 36px;
}
.logout-btn:hover { background: var(--wine-tint); color: var(--primary); border-color: var(--wine); }

/* ===== Admin footer dot ===== */
.app-footer {
  margin-top: 64px;
  padding: 28px 0 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
/* Canal de dúvidas/sugestões: só a marca do X. Uma frase por extenso no rodapé
   pesava mais que o próprio conteúdo da página — o ícone diz a mesma coisa, e o
   title/aria-label carregam o texto para quem precisa. */
.app-footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--hair);
  color: var(--ink-3);
  opacity: .7;
  transition: color .15s, border-color .15s, opacity .15s;
}
.app-footer-social svg { width: 15px; height: 15px; display: block; }
.app-footer-social:hover { color: var(--ink); border-color: var(--hair-strong); opacity: 1; }
.admin-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--line);
  display: block;
  opacity: .4;
  transition: opacity .2s ease, background .2s ease, transform .1s ease;
  -webkit-tap-highlight-color: transparent;
}
.admin-dot:hover  { opacity: 1; background: var(--primary); }
.admin-dot:active { transform: scale(.8); }

/* ===== Dashboard skeleton ===== */
body[data-state="loading"] #mainContent         { display: none !important; }
body[data-state="loading"] .skeleton-dashboard  { display: flex !important; flex-direction: column; gap: 16px; }
body:not([data-state="loading"]) .skeleton-dashboard { display: none !important; }

.sk-welcome {
  height: 60px;
  background: linear-gradient(90deg, var(--line) 25%, var(--line-soft) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
.sk-metrics { display: flex; gap: 10px; }
.sk-metric {
  flex: 1 1 0;
  height: 82px;
  background: linear-gradient(90deg, var(--line) 25%, var(--line-soft) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
.sk-weekly {
  height: 145px;
  background: linear-gradient(90deg, #ddd0d3 25%, #e8dde0 50%, #ddd0d3 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
.sk-game {
  height: 230px;
  background: linear-gradient(90deg, var(--line) 25%, var(--line-soft) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}

/* ===== Content fade-in ===== */
#mainContent { animation: contentIn .35s ease; }
@keyframes contentIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Welcome section ===== */
.welcome-section {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.welcome-text h2 {
  margin: 0 0 5px;
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.welcome-text p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* Alerta de interesses ainda não escolhidos */
.interests-alert {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  background: var(--wine-tint);
  border: 1px solid #f2d6dc;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.interests-alert[hidden] { display: none; }
.interests-alert:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.interests-alert-icon {
  flex: none;
  font-size: 22px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.interests-alert-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.interests-alert-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.interests-alert-text  { font-size: 12.5px; font-weight: 500; color: var(--ink-soft); line-height: 1.5; }
.interests-alert-text strong { color: var(--primary); font-weight: 700; }
.interests-alert-arrow {
  flex: none;
  margin-left: auto;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

/* ===== Botão "Perfil e Ajustes" (topbar) ===== */
.profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, transform .1s;
}
.profile-btn:hover  { background: var(--bg-alt); border-color: var(--ink-soft); transform: translateY(-1px); }
.profile-btn svg    { color: var(--primary); }

/* ===== Seletor de modo (Customizados x IA) ===== */
.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 14px;
  align-items: stretch;
  margin-bottom: 24px;
}
.mode-tab {
  width: 100%;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-top: 2px solid var(--hair);
  border-radius: var(--radius);
  padding: 18px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  min-height: 62px;
}
.mode-tab:hover  { color: var(--ink); border-color: var(--hair-strong); }
.mode-tab.active {
  color: var(--ink);
  border-top-color: var(--wine);
}
.mode-desc {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.5;
}
.mode-selector[hidden] { display: none; }
/* No desktop a sidebar já lista os mesmos dois destinos ("Custom Challenges" /
   "AI Challenges"). Manter as abas aqui era navegação duplicada — e com nomes
   diferentes para o mesmo lugar. Uma navegação por viewport: sidebar no
   desktop, abas no mobile (onde a sidebar não existe). */
@media (min-width: 1024px) {
  .mode-selector { display: none; }
}
.mode-panel[hidden] { display: none; }
.mode-panel { animation: contentIn .25s ease; }

/* ===== Intro guiada (sem jogo criado) =====
   Tela de entrada de quem nunca jogou. É explicação, não configuração: cada
   card conta o que o modo é, como funciona em 3 passos e o que a pessoa precisa
   ter em mãos. Um CTA vinho só (o modo recomendado); o outro é quiet, conforme
   a regra de 1 CTA vinho por vista. */
.mode-intro { margin-bottom: 24px; animation: contentIn .25s ease; }
.mode-intro[hidden] { display: none; }

.mi-head { text-align: center; margin-bottom: 22px; }
.mi-kicker {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.mi-title {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--ink);
}
.mi-sub {
  margin: 0 auto;
  max-width: 46ch;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-3);
}

.mi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.mi-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-top: 2px solid var(--hair);
  border-radius: var(--radius);
  padding: 24px 22px;
}
/* O modo recomendado se distingue pelo filete vinho no topo — não por sombra
   nem por fundo colorido. */
.mi-card--featured { border-top-color: var(--wine); }

.mi-badge {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--wine);
  background: var(--wine-tint);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  margin-bottom: 12px;
}
.mi-name {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--ink);
}
.mi-pitch {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}

.mi-steps {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--hair);
  padding-top: 18px;
}
.mi-step { display: flex; gap: 12px; align-items: flex-start; }
.mi-step-n {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hair-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
}
.mi-step-t { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }

.mi-need {
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-3);
}
.mi-need strong { color: var(--ink-2); font-weight: 600; }

/* Empurra o CTA para a base — cards de alturas diferentes alinham os botões. */
.mi-cta {
  margin-top: auto;
  width: 100%;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--wine);
  background: var(--wine);
  color: #fff;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.mi-cta:hover { background: var(--wine-deep); border-color: var(--wine-deep); }
.mi-cta--quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--hair-strong);
}
.mi-cta--quiet:hover { background: transparent; border-color: var(--ink); color: var(--ink); }

/* ===== Painel IA: gate de interesses ===== */
.ai-gate, .ai-ready {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ai-gate[hidden], .ai-ready[hidden] { display: none; }
.ai-gate-emoji, .ai-ready-emoji { font-size: 34px; line-height: 1; }
.ai-gate h3, .ai-ready h3 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.ai-gate p, .ai-ready p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 420px;
}
.ai-gate-privacy { color: var(--muted); font-size: 12.5px; }
.ai-tags-loading { font-size: 13px; color: var(--muted); font-weight: 500; }
.ai-tags-loading[hidden] { display: none; }
.ai-tags-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 6px;
}
.ai-tags-grid[hidden] { display: none; }
.ai-chip {
  padding: 9px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.ai-chip:hover { background: var(--bg-alt); transform: translateY(-1px); }
.ai-chip.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: none;
}
.ai-chip:active { transform: scale(.96); }
.ai-gate-save { width: 100%; max-width: 320px; margin-top: 6px; }
.ai-gate-save:disabled { opacity: .55; cursor: not-allowed; }
.ai-ready-soon { color: var(--primary) !important; font-weight: 700 !important; font-size: 13px !important; }
.ai-ready-soon[hidden] { display: none; }
.settings-link {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, background .15s, border-color .15s;
}
.settings-link:hover { color: var(--primary); background: var(--wine-tint); border-color: var(--wine); }

/* ===== Metrics ===== */
.metrics-row {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
.metric-card {
  flex: 1 1 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: box-shadow .2s ease;
}
.metric-card:hover { box-shadow: var(--shadow-md); }
.metric-card.metric-score {
  background: var(--shell);
  border-color: var(--shell);
}
.metric-card.metric-score .metric-value { color: var(--shell-ink); }
.metric-card.metric-score .metric-label { color: var(--gold); }
.metric-value {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.metric-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}

/* ===== Weekly challenge ===== */
.weekly-card {
  background: var(--shell);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px 22px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.weekly-card::before {
  content: '';
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: none;
  pointer-events: none;
}
.weekly-badge {
  display: inline-block;
  background: rgba(201,169,110,.14);
  border: 1px solid rgba(201,169,110,.38);
  color: var(--gold-light);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.weekly-emoji {
  font-size: 36px;
  display: block;
  margin-bottom: 10px;
}
.weekly-title {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.25;
}
.weekly-desc {
  margin: 0;
  font-size: 14px;
  color: rgba(255,255,255,.62);
  line-height: 1.6;
}

/* ===== Game section ===== */
.game-section { margin-bottom: 40px; }
.game-section-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 14px;
}

/* No game card */
.no-game-card {
  background: var(--card);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 24px 32px;
  text-align: center;
  box-shadow: var(--shadow);
}
.no-game-emoji {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}
.no-game-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
}
.no-game-card > p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.how-game-works {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
  text-align: left;
}
.how-step {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}
.how-num {
  flex: none;
  width: 28px;
  height: 28px;
  background: var(--wine);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.btn-create-game {
  width: 100%;
  background: var(--wine);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 16px 28px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition: transform .15s ease, box-shadow .15s ease;
  min-height: 52px;
}
.btn-create-game:hover  { transform: translateY(-2px); box-shadow: none; }
.btn-create-game:active { transform: scale(.97); }

/* ===== Wizard ===== */
#wizard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.wizard-progress {
  display: flex;
  align-items: center;
  padding: 22px 22px 0;
}
.wizard-dot {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  transition: background .28s, color .28s;
}
.wizard-dot.active { background: var(--primary); color: #fff; }
.wizard-dot.done   { background: #16a34a; color: #fff; }
.wizard-line {
  flex: 1;
  height: 2px;
  margin: 0 4px;
  background: var(--line);
  transition: background .28s;
}
.wizard-line.done { background: #16a34a; }
.wizard-body {
  padding: 26px 22px 22px;
  animation: slideIn .26s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.wizard-body h3 {
  margin: 0 0 6px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}
.wizard-desc {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.wizard-input {
  width: 100%;
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  margin-bottom: 22px;
  transition: border-color .15s;
}
.wizard-input:focus { outline: none; border-color: var(--primary); background: var(--card); }
.wizard-input::placeholder { font-weight: 400; color: var(--muted); }

.wizard-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.wizard-item-row {
  display: flex;
  gap: 8px;
  align-items: center;
  animation: slideIn .2s ease;
}
.wizard-item-title {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color .15s;
}
.wizard-item-title:focus { outline: none; border-color: var(--primary); background: var(--card); }
.wizard-item-points {
  width: 80px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 8px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--primary);
  text-align: center;
  transition: border-color .15s;
}
.wizard-item-points:focus { outline: none; border-color: var(--primary); background: var(--card); }
.wizard-item-del {
  flex: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}
.wizard-item-del:hover { background: var(--wine-tint); color: var(--primary); }

.btn-add-item {
  width: 100%;
  background: transparent;
  border: 1.5px dashed var(--line);
  color: var(--primary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 22px;
  transition: background .15s, border-color .15s;
}
.btn-add-item:hover { background: var(--wine-tint); border-color: var(--wine); }

.wizard-nav {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.btn-wizard-back {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, color .15s;
  min-height: 44px;
}
.btn-wizard-back:hover { background: var(--card); color: var(--ink); }
.btn-wizard-next {
  background: var(--primary);
  color: #fff;
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, transform .1s;
  min-height: 44px;
}
.btn-wizard-next:hover  { background: var(--primary-dark); }
.btn-wizard-next:active { transform: scale(.96); }
.btn-wizard-finish {
  background: var(--wine);
  color: #fff;
  border: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: none;
  transition: transform .1s, box-shadow .15s;
  min-height: 44px;
}
.btn-wizard-finish:hover  { transform: translateY(-1px); box-shadow: none; }
.btn-wizard-finish:active { transform: scale(.96); }

/* Active game header */
.game-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.game-name {
  margin: 0;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.game-edit-link {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
  display: flex;
  align-items: center;
  min-height: 36px;
}
.game-edit-link:hover { color: var(--primary); background: var(--wine-tint); border-color: var(--wine); }

/* ===== Challenges Bank ===== */
.page-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 26px;
}
.page-header .back-link { flex: none; margin-top: 2px; }
.page-header-text { min-width: 0; }
.page-title {
  margin: 0 0 4px;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.page-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* Difficulty filter */
.diff-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.diff-pill {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  min-height: 36px;
}
.diff-pill:hover { background: var(--bg-alt); }
.diff-pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.diff-pill-1.active { background: #5A6B4F; border-color: #5A6B4F; }
.diff-pill-2.active { background: #9C6B1F; border-color: #9C6B1F; }
.diff-pill-3.active { background: var(--wine); border-color: var(--wine); }

/* Language filter */
.lang-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: -8px;
  margin-bottom: 16px;
}
.lang-pill {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.lang-pill:hover { background: var(--bg-alt); }
.lang-pill.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

/* Language badge */
.lang-badge {
  flex: none;
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .4px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Challenge cards */
.challenges-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}
.challenge-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  animation: contentIn .25s ease;
  transition: box-shadow .2s ease;
}
.challenge-card:hover { box-shadow: var(--shadow-md); }
.challenge-card-custom {
  border-color: var(--hair-strong);
  background: #fef8f9;
}
.challenge-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.challenge-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  flex: 1 1 auto;
  min-width: 0;
}
.challenge-card-desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.55;
}
/* Links em descrições de desafio: clicáveis e com quebra de URLs longas. */
.desc-link { color: var(--wine); text-decoration: underline; overflow-wrap: anywhere; word-break: break-word; }
.challenge-card-desc, .aig-card-desc { overflow-wrap: anywhere; }
.challenge-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.challenge-del-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.challenge-del-btn:hover { background: var(--wine-tint); color: var(--primary); }

/* Difficulty badges */
.diff-badge {
  flex: none;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .3px;
}
.diff-badge-1 { background: #F0F2EC; color: #5A6B4F; }
.diff-badge-2 { background: #F7F0E2; color: #9C6B1F; }
.diff-badge-3 { background: var(--wine-tint); color: var(--wine); }

.btn-add-challenge {
  width: 100%;
  background: transparent;
  border: 2px dashed var(--line);
  color: var(--primary);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 16px;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 8px;
  transition: background .15s, border-color .15s;
  min-height: 52px;
}
.btn-add-challenge:hover { background: var(--wine-tint); border-color: var(--wine); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,3,6,.62);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  animation: fadeIn .2s ease;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal-overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--card);
  border-radius: 22px 22px 0 0;
  padding: 30px 24px 44px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-modal);
  animation: slideUp .26s ease;
}
@keyframes slideUp {
  from { transform: translateY(28px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.modal-header h3 {
  margin: 0;
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
}
.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--line-soft);
  color: var(--ink-soft);
  font-size: 20px;
  font-weight: 700;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--wine-tint); color: var(--primary); }
.modal-form { display: flex; flex-direction: column; gap: 6px; }
.modal-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 10px;
}
.modal-optional { font-weight: 500; color: var(--muted); }
.modal-input {
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  width: 100%;
  transition: border-color .15s;
}
.modal-input:focus { outline: none; border-color: var(--primary); background: var(--card); }
.modal-input::placeholder { color: var(--muted); }
.modal-select { cursor: pointer; appearance: auto; }

.diff-select-row {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.diff-radio { cursor: pointer; }
.diff-radio input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.diff-radio-btn {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  user-select: none;
}
.diff-radio input[type="radio"]:checked + .diff-radio-1 { background: #F0F2EC; border-color: #5A6B4F; color: #5A6B4F; }
.diff-radio input[type="radio"]:checked + .diff-radio-2 { background: #F7F0E2; border-color: #9C6B1F; color: #9C6B1F; }
.diff-radio input[type="radio"]:checked + .diff-radio-3 { background: var(--wine-tint); border-color: var(--wine); color: var(--wine); }
.diff-radio input[type="radio"]:focus-visible + .diff-radio-btn { outline: 3px solid var(--gold); outline-offset: 2px; }

.modal-error {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin: 4px 0 0;
  padding: 10px 14px;
  background: var(--wine-tint);
  border-radius: 8px;
  border: 1px solid var(--hair);
}
.modal-submit { margin-top: 16px; width: 100%; padding: 15px; font-size: 16px; }

/* Challenges nav card */
.challenges-nav-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--shell);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: none;
  transition: transform .15s, box-shadow .15s;
}
.challenges-nav-card:hover { transform: translateY(-2px); box-shadow: none; }
.challenges-nav-left { display: flex; flex-direction: column; gap: 4px; }
.challenges-nav-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.48);
}
.challenges-nav-title { font-size: 17px; font-weight: 700; }
.challenges-nav-arrow { font-size: 22px; opacity: .55; }

/* ===== Tags ===== */
.tag-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.tag-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  display: inline-block;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--paper);
  border: 1px solid var(--hair);
  color: var(--ink-2);
}
.tag-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: -8px;
  margin-bottom: 16px;
}
.tag-pill {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.tag-pill:hover { background: var(--bg-alt); }
.tag-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.modal-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.modal-tag-chip {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.modal-tag-chip:hover { background: var(--bg-alt); }
.modal-tag-chip.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* Interests chips */
.interests-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.interest-chip {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.interest-chip:hover { background: var(--bg-alt); }
.interest-chip.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.interests-saved-note {
  font-size: 12px;
  color: var(--ok);
  font-weight: 600;
  margin: 12px 0 0;
  opacity: 0;
  transition: opacity .3s;
}
.interests-saved-note.show { opacity: 1; }

/* ===== Auth pages (login / invite) ===== */
.login-wrap, .invite-wrap {
  width: 100%;
  max-width: 420px;
  padding: 32px 20px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}
.login-brand, .invite-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.login-brand .brand,
.invite-brand .brand {
  font-size: 26px;
  justify-content: center;
}
.login-tagline, .invite-tagline {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .5px;
}
.login-card, .invite-card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
}
.auth-tabs {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 3px;
}
.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  min-height: 40px;
}
.auth-tab.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: none;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-form input,
.auth-form select {
  font: inherit;
  font-size: 16px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  width: 100%;
  transition: border-color .15s;
}
.auth-form input:focus,
.auth-form select:focus { outline: none; border-color: var(--primary); background: var(--card); }
.auth-form input::placeholder { color: var(--muted); }
.auth-error {
  background: var(--wine-tint);
  color: var(--primary);
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  display: none;
  margin-bottom: 4px;
}
.auth-error.show { display: block; }
.auth-invite-error {
  background: var(--wine-tint);
  color: var(--primary);
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  display: none;
}
.auth-invite-error.show { display: block; }
.login-footer, .invite-footer {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Invite card states */
.invite-header {
  text-align: center;
  margin-bottom: 24px;
}
.invite-header .invite-emoji {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 12px;
}
.invite-header h2 {
  margin: 0 0 6px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}
.invite-header p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.invite-state {
  text-align: center;
  padding: 8px 0;
}
.invite-state .state-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 14px;
}
.invite-state h2 {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}
.invite-state p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}
.invite-state.success h2 { color: var(--success); }

/* ===== Onboarding ===== */
.onboarding-wrap {
  max-width: 540px;
  margin: 0 auto;
  padding: 36px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.onboarding-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.onboarding-brand .brand { font-size: 24px; justify-content: center; }
.onboarding-header { text-align: center; }
.onboarding-header h2 {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.onboarding-header p {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.6;
}
.onboarding-header p.onboarding-privacy-note {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.55;
}
.onboarding-privacy-note strong { color: var(--ink-soft); font-weight: 700; }
.onboarding-tags-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  min-height: 100px;
}
.tag-description-box {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 5px;
  left: 16px;
  line-height: 1.45;
  margin: 0;
  max-width: calc(100vw - 32px);
  opacity: 0;
  padding: 12px 14px;
  pointer-events: none;
  position: fixed;
  top: 16px;
  transform: translateY(-8px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
  visibility: hidden;
  width: 480px;
  box-shadow: none;
  z-index: 1000;
}
.tag-description-box.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}
.tag-description-box strong {
  font-size: 14px;
  font-weight: 800;
}
.tag-description-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.onboarding-tags-loading {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.onboarding-tags-loading[hidden] { display: none; }
.onboarding-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  animation: contentIn .3s ease;
}
.onboarding-chip {
  padding: 9px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.onboarding-chip:hover { background: var(--bg-alt); transform: translateY(-1px); }
.onboarding-chip.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: none;
}
.onboarding-chip:active { transform: scale(.96); }
.onboarding-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.btn-onboarding-continue {
  width: 100%;
  background: var(--wine);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 16px 28px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
  min-height: 52px;
}
.btn-onboarding-continue:hover  { transform: translateY(-2px); box-shadow: none; }
.btn-onboarding-continue:active { transform: scale(.97); }
.btn-onboarding-continue:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-onboarding-skip {
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  min-height: 52px;
}
.btn-onboarding-skip:hover { background: var(--card); color: var(--ink); border-color: var(--ink-soft); }

/* ===== Profile ===== */
.profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.profile-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.profile-avatar-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}
.profile-avatar {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--wine);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: none;
}
.profile-user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.profile-user-name {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-user-email {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-user-gender {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}
.profile-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.profile-section-title {
  margin: 0 0 6px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.profile-section-sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.55;
}
.profile-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  min-height: 40px;
}
.profile-interests-wrap { position: relative; }
.profile-chips-grid.blurred {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: .7;
}
.profile-interests-veil {
  position: absolute;
  inset: -6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 20px 16px;
  border-radius: var(--radius-sm);
  background: rgba(250, 248, 246, .58);
}
.profile-interests-veil[hidden] { display: none; }
.veil-lock { font-size: 26px; line-height: 1; }
.veil-text {
  margin: 0;
  max-width: 320px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.55;
}
.btn-reselect {
  border: none;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 44px;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.btn-reselect:hover  { background: var(--primary-dark); box-shadow: none; }
.btn-reselect:active { transform: scale(.97); }
.profile-chip {
  padding: 9px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.profile-chip:hover { background: var(--bg-alt); transform: translateY(-1px); }
.profile-chip.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: none;
}
.profile-chip:active { transform: scale(.96); }
.profile-chips-loading {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.profile-chips-loading[hidden] { display: none; }
.profile-save-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-save-row[hidden] { display: none; }
.btn-save-interests {
  border: none;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  min-height: 44px;
}
.btn-save-interests:hover { background: var(--primary-dark); box-shadow: none; }
.btn-save-interests:disabled { opacity: .55; cursor: not-allowed; }
.interests-saved-msg {
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
  opacity: 0;
  transition: opacity .3s;
}
.interests-saved-msg.show { opacity: 1; }

/* ===== Admin panel ===== */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 18px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.panel h2 small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--muted);
  margin-left: 6px;
  font-size: 11px;
  opacity: .7;
}
.task-form { display: flex; gap: 10px; flex-wrap: wrap; }
.task-form input,
.task-form select {
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  transition: border-color .15s;
}
.task-form input:focus,
.task-form select:focus { outline: none; border-color: var(--primary); background: var(--card); }
#titleInput        { flex: 1 1 200px; }
#pointsInput       { width: 100px; }
#redeemTitleInput  { flex: 1 1 200px; }
#redeemPointsInput { width: 100px; }
#inviteNameInput   { flex: 1 1 200px; }

.sugg-row { background: var(--wine-tint); border-color: var(--hair-strong); }
.sugg-title { border: none; background: transparent; cursor: default; }
.row-accept {
  flex: none;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.row-accept:hover { background: var(--primary-dark); }
.admin-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.admin-row.dragging { opacity: .45; }
.row-title:disabled, .row-points:disabled { opacity: .55; cursor: not-allowed; }
.row-del:disabled { opacity: .3; cursor: not-allowed; }

/* Admins do desafio */
.admin-owners {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.owners-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.owner-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 10px;
}
.owner-chip.is-admin { color: var(--primary); border-color: var(--primary); background: var(--card); }
.owner-toggle {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: transparent;
  border: 1.5px solid var(--primary);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.owner-toggle:hover:not(:disabled) { background: var(--primary); color: #fff; }
.owner-toggle:disabled { opacity: .45; cursor: not-allowed; border-color: var(--line); color: var(--muted); }
.owners-note { font-size: 12px; color: var(--muted); font-style: italic; }
.drag-handle {
  cursor: grab;
  color: var(--muted);
  font-size: 18px;
  user-select: none;
  padding: 0 2px;
  opacity: .55;
}
.row-title {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--ink);
  padding: 6px 4px;
}
.row-title:focus { outline: none; border-bottom: 2px solid var(--primary); }
.row-points {
  width: 72px;
  font: inherit;
  text-align: center;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  color: var(--primary);
  font-weight: 700;
  background: var(--bg);
  font-size: 14px;
}
.row-del {
  flex: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}
.row-del:hover { background: var(--wine-tint); color: var(--primary); }

/* Partner card */
.partner-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.partner-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--wine);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex: none;
  box-shadow: none;
}
.partner-info { display: flex; flex-direction: column; gap: 2px; }
.partner-name { font-weight: 700; font-size: 15px; }
.partner-sub  { font-size: 12px; color: var(--muted); font-weight: 500; }

/* Admin invite box */
.invite-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink);
  word-break: break-all;
  margin-bottom: 10px;
  line-height: 1.55;
}
.invite-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.invite-actions button {
  flex: 1;
  min-width: 140px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s, color .15s;
  min-height: 44px;
}
.invite-copy-btn {
  background: var(--card);
  color: var(--ink);
}
.invite-copy-btn:hover { background: var(--bg-alt); }
.invite-copy-btn.copied { color: var(--success); border-color: #a8e6b8; background: var(--success-bg); }
.invite-wa-btn {
  background: #25d366;
  color: #fff;
  border-color: #25d366 !important;
}
.invite-wa-btn:hover { background: #1db954; }
.invite-expiry {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.invite-generate-btn {
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: background .15s, box-shadow .15s;
  min-height: 48px;
}
.invite-generate-btn:hover:not(:disabled) { background: var(--primary-dark); box-shadow: none; }
.invite-generate-btn:disabled { opacity: .55; cursor: default; }

/* ===== Mobile ===== */
/* ===== Solo Banner (sem parceiro vinculado) ===== */
.solo-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--wine);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-primary);
}
.solo-banner-icon {
  font-size: 28px;
  flex: none;
  line-height: 1;
}
.solo-banner-body {
  flex: 1;
  min-width: 0;
}
.solo-banner-body strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
}
.solo-banner-body p {
  margin: 0;
  font-size: 13px;
  opacity: .82;
  line-height: 1.4;
}
.solo-banner-btn {
  flex: none;
  background: #fff;
  color: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
  transition: background .15s;
}
.solo-banner-btn:hover { background: var(--bg); }

/* Banner solo agora explica o que se perde jogando sozinho e gera o convite
   ali mesmo — vira um bloco de texto + ações, não mais uma linha com botão. */
.solo-banner { align-items: flex-start; }
.solo-invite {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.solo-banner-link {
  color: #fff;
  opacity: .8;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.solo-banner-link:hover { opacity: 1; }

.solo-invite-result {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.solo-invite-result[hidden] { display: none; }
.solo-invite-input {
  flex: 1 1 240px;
  min-width: 0;
  font: inherit;
  font-size: 12.5px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12);
  color: #fff;
}
.solo-invite-copy, .solo-invite-share {
  flex: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.45);
  background: transparent;
  color: #fff;
  transition: background .15s;
}
.solo-invite-copy:hover, .solo-invite-share:hover { background: rgba(255,255,255,.16); }
.solo-invite-share { background: #fff; color: var(--wine); border-color: #fff; }
.solo-invite-share:hover { background: rgba(255,255,255,.88); }
.solo-invite-note {
  margin: 10px 0 0;
  font-size: 12px;
  opacity: .75;
}
.solo-invite-note[hidden] { display: none; }

/* ===== Partner section (profile.html) ===== */
.partner-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.partner-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--wine);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.partner-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.partner-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.partner-gender {
  font-size: 13px;
  color: var(--muted);
}
.partner-linked-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--success);
  margin-bottom: 10px;
}

.btn-generate-invite {
  width: 100%;
  background: var(--wine);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 14px 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition: opacity .15s;
  margin-bottom: 16px;
}
.btn-generate-invite:disabled { opacity: .6; cursor: default; }

.invite-link-box { display: flex; flex-direction: column; gap: 10px; }
.invite-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.invite-link-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--bg-alt);
  min-width: 0;
  outline: none;
}
.btn-copy-link {
  flex: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn-copy-link:hover { background: var(--bg-alt); border-color: var(--primary); color: var(--primary); }
.btn-copy-link.copied { background: var(--success-bg); border-color: var(--success); color: var(--success); }

.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25d366;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .15s;
}
.btn-whatsapp:hover { opacity: .88; }
.invite-link-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.invite-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}

/* ===== Weekly Challenge ===== */

/* Override ai-ready container so it doesn't center weekly challenge content */
#aiReady {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  text-align: left;
  align-items: stretch;
}
#aiReady[hidden] { display: none; }

/* --- Empty state --- */
.wc-empty-state {
  background: var(--card);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  padding: 36px 24px 32px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.wc-empty-emoji {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 4px;
}
.wc-empty-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 600;
}
.wc-empty-desc {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 320px;
}

/* --- Duration selector --- */
.wc-duration-wrap {
  width: 100%;
  text-align: center;
}
.wc-duration-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.wc-duration-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.wc-dur-btn {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 20px;
  cursor: pointer;
  min-height: 40px;
  transition: background .14s, border-color .14s, color .14s;
}
.wc-dur-btn:hover { background: var(--bg-alt); border-color: var(--ink-soft); }
.wc-dur-btn--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: none;
}
.wc-dur-btn--active:hover { background: var(--primary-dark); }

/* Generate button */
.wc-gen-btn { width: 100%; max-width: 320px; margin-top: 6px; font-size: 16px; padding: 14px 24px; }

/* --- Active card --- */
.wc-card {
  background: var(--shell);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}
.wc-card::before {
  content: '';
  position: absolute;
  right: -36px;
  top: -36px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: none;
  pointer-events: none;
}
.wc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.wc-badge-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--gold-light);
  background: rgba(201,169,110,.14);
  border: 1px solid rgba(201,169,110,.30);
  padding: 4px 10px;
  border-radius: 20px;
}
.wc-refresh-btn {
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.80);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 36px;
  transition: background .14s, border-color .14s;
}
.wc-refresh-btn:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.40); }
.wc-refresh-btn:disabled { opacity: .5; cursor: not-allowed; }
.wc-card-title {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.25;
}
.wc-card-desc {
  margin: 0 0 18px;
  font-size: 14px;
  color: rgba(255,255,255,.62);
  line-height: 1.6;
}
.wc-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Difficulty badges (dark bg version) */
.wc-diff-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .3px;
}
.wc-diff-1 { background: rgba(34,197,94,.18); color: #86efac; }
.wc-diff-2 { background: rgba(251,146,60,.18); color: #fdba74; }
.wc-diff-3 { background: rgba(248,113,113,.18); color: #fca5a5; }

.wc-countdown-badge {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.55);
  display: flex;
  align-items: center;
  gap: 5px;
}
.wc-countdown-badge::before {
  content: '⏱';
  font-size: 13px;
  opacity: .7;
}

/* --- Expired card --- */
.wc-card--expired {
  background: var(--shell);
  box-shadow: none;
}
.wc-expired-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  padding: 4px 10px;
  border-radius: 20px;
}
.wc-expired-sub {
  margin: 0 0 6px;
  font-size: 14px;
  color: rgba(255,255,255,.50);
  line-height: 1.5;
}

/* --- History section --- */
.wc-history-heading {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.wc-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wc-hist-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wc-hist-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wc-hist-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wc-hist-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Complete / Not complete action buttons */
.wc-action-btn {
  border: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 38px;
  transition: background .14s, transform .1s, box-shadow .14s;
}
.wc-action-btn:active { transform: scale(.96); }
.wc-action-btn:disabled { opacity: .55; cursor: not-allowed; }
.wc-action-complete {
  background: var(--primary);
  color: #fff;
}
.wc-action-complete:hover { background: var(--primary-dark); box-shadow: none; }
.wc-action-notcomplete {
  background: var(--line);
  color: var(--ink-soft);
}
.wc-action-notcomplete:hover { background: #e0d8d0; }

/* Status chip */
.wc-status-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.wc-status-completed    { background: #dcfce7; color: var(--ok); }
.wc-status-not_completed { background: #f1f5f9; color: var(--muted); }

/* Feedback ask label */
.wc-feedback-ask {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* Feedback buttons */
.wc-feedback-btn {
  border: 1.5px solid var(--line);
  background: var(--card);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 36px;
  transition: background .14s, border-color .14s;
}
.wc-feedback-btn--fun:hover    { background: #f0fdf4; border-color: #86efac; color: var(--ok); }
.wc-feedback-btn--notfun:hover { background: var(--bg-alt); border-color: var(--muted); }
.wc-feedback-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Feedback badge (after saving) */
.wc-feedback-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.wc-feedback-fun    { background: #f0fdf4; color: var(--ok); border: 1px solid #bbf7d0; }
.wc-feedback-not_fun { background: #f8fafc; color: var(--muted); border: 1px solid var(--line); }

/* --- Step containers inside wcEmpty --- */
#wcModeStep, #wcDurationStep {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}
/* Expired state: stack the card + next-section blocks */
#wcExpiredState {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#wcExpiredState[hidden] { display: none; }

/* --- Mode selection cards --- */
.wc-mode-cards {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}
.wc-mode-card {
  flex: 1 1 130px;
  max-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 14px 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  text-align: center;
  transition: border-color .18s, background .18s, box-shadow .18s, transform .12s;
  font: inherit;
  color: var(--ink);
}
.wc-mode-card:hover {
  border-color: var(--primary);
  background: var(--wine-tint);
  box-shadow: none;
}
.wc-mode-card--active {
  border-color: var(--primary);
  background: var(--wine-tint);
  box-shadow: none;
  transform: translateY(-2px);
}
.wc-mode-card-icon {
  font-size: 32px;
  line-height: 1;
}
.wc-mode-card-name {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.wc-mode-card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.wc-mode-cards--compact .wc-mode-card {
  padding: 14px 12px;
  max-width: 160px;
}
.wc-mode-cards--compact .wc-mode-card-icon { font-size: 24px; }
.wc-mode-cards--compact .wc-mode-card-name { font-size: 15px; }

/* --- Back button & selected mode display --- */
.wc-back-btn {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 2px;
  margin-bottom: 4px;
  transition: color .14s;
}
.wc-back-btn:hover { color: var(--ink); }

.wc-selected-mode-display {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.wc-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.wc-mode-pill--1v1    { background: rgba(99,102,241,.1); color: #4338ca; border: 1px solid rgba(99,102,241,.25); }
.wc-mode-pill--couple { background: var(--wine-tint); color: var(--primary); border: 1px solid var(--hair-strong); }

/* --- Mode badge on active card & history --- */
.wc-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
}
.wc-mode-badge--1v1    { background: rgba(99,102,241,.18); color: #a5b4fc; }
.wc-mode-badge--couple { background: rgba(255,200,200,.18); color: #fda4af; }
.wc-mode-badge--sm { font-size: 10px; padding: 3px 8px; }

/* --- History card badges row --- */
.wc-hist-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* --- Next section (below expired card) --- */
.wc-next-section {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}
.wc-next-label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

/* ===== Recommendation cards ===== */
.wc-rec-heading {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 12px;
}
.wc-rec-error-msg {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
  text-align: center;
}
.wc-rec-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.wc-rec-card:last-child { margin-bottom: 0; }
.wc-rec-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.wc-rec-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.3;
  flex: 1;
}
.wc-rec-desc {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  line-height: 1.5;
}
.wc-rec-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.wc-rec-mode-group {
  display: flex;
  gap: 6px;
}
.wc-rec-mode-btn {
  border: 1.5px solid var(--line);
  background: var(--card);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: border-color .14s, color .14s, background .14s;
}
.wc-rec-mode-btn:hover { border-color: var(--primary); color: var(--primary); }
.wc-rec-mode-btn--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.wc-rec-dur-group {
  display: flex;
  gap: 4px;
}
.wc-rec-dur-group .wc-dur-btn {
  font-size: 11px;
  padding: 5px 10px;
  min-height: auto;
}
.wc-rec-accept-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}
.wc-rec-retry-btn {
  background: none;
  border: 1.5px solid var(--line);
  font: inherit;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: var(--radius-sm, 10px);
  cursor: pointer;
  color: var(--ink-soft);
  display: block;
  margin: 0 auto;
  transition: border-color .14s, color .14s;
}
.wc-rec-retry-btn:hover { border-color: var(--primary); color: var(--primary); }

@media (max-width: 480px) {
  .app { padding: 20px 16px 80px; }
  .brand { font-size: 17px; }
  .flame { width: 26px; height: 26px; }
  .score-card { padding: 22px 20px; }
  .score-value { font-size: 48px; }

  .task { flex-wrap: wrap; gap: 10px; }
  .task-info { flex: 1 1 100%; }
  .task-actions { width: 100%; }
  .task-do { flex: 1 1 auto; padding: 14px 16px; }
  .task-undo { width: 44px; height: 44px; }

  .suggest-form { flex-direction: column; align-items: stretch; }
  .suggest-form #suggTitle,
  .suggest-form #suggPoints,
  .suggest-form #redeemSuggTitle,
  .suggest-form #redeemSuggPoints { width: 100%; }
  .suggest-form .btn-primary { width: 100%; }

  .task-form { flex-direction: column; align-items: stretch; }
  .task-form input, .task-form select { width: 100%; }
  .task-form .btn-primary { width: 100%; }

  .admin-row { flex-wrap: wrap; }
  .sugg-row .sugg-title { flex: 1 1 100%; }
  .row-accept { flex: 1 1 auto; padding: 10px 12px; }

  .welcome-text h2 { font-size: 20px; }
  .metrics-row { gap: 8px; }
  .metric-card  { padding: 14px 8px; }
  .metric-value { font-size: 22px; }
  .weekly-card  { padding: 20px 18px; }
  .weekly-title { font-size: 18px; }
  .no-game-card { padding: 30px 18px 26px; }
  .wizard-body  { padding: 20px 18px 18px; }
  .wizard-item-row { flex-wrap: wrap; }
  .wizard-item-title  { flex: 1 1 100%; }
  .wizard-item-points { flex: 1; }
  .wizard-item-del    { flex: none; }
  .wizard-nav { flex-wrap: wrap; }
  .wizard-nav button  { flex: 1 1 auto; }

  .page-title { font-size: 19px; }
  .challenge-card-top { flex-wrap: wrap; gap: 6px; }
  .challenge-card-title { flex: 1 1 100%; }
  .modal-box { padding: 24px 18px 40px; }
  .diff-select-row { gap: 6px; }

  .login-card, .invite-card { padding: 24px 20px; }
  .onboarding-wrap { padding: 28px 16px 56px; gap: 24px; }
  .onboarding-header h2 { font-size: 22px; }
  .onboarding-tags-card { padding: 18px 14px; }
  .onboarding-chip { font-size: 13px; padding: 8px 13px; }
  .profile-avatar-card { padding: 20px 16px; gap: 14px; }
  .profile-avatar { width: 52px; height: 52px; font-size: 24px; }
  .profile-user-name { font-size: 16px; }
  .profile-section { padding: 18px 14px; }
  .profile-chip { font-size: 13px; padding: 8px 13px; }
}

/* ── Game Type Picker (Spyce DS) ── */
.gtp-header { text-align: center; margin-bottom: 24px; }
.gtp-header h3 { font-family: var(--font-head); font-size: 22px; font-weight: 600; margin: 0 0 6px; }
.gtp-header p  { color: var(--ink-3); margin: 0; font-size: 14px; }

.gtp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.gtp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 28px 18px 22px;
  cursor: pointer;
  transition: border-color .18s, transform .12s;
  font-family: inherit;
  color: inherit;
}
.gtp-card:hover {
  border-color: var(--wine);
  transform: translateY(-1px);
}

.gtp-card--individual {
  cursor: default;
}
.gtp-card--individual:not(.gtp-card--disabled):hover {
  border-color: var(--hair-strong);
}
.gtp-card--disabled {
  opacity: .45;
  filter: grayscale(.4);
  transform: none !important;
  border-color: var(--hair) !important;
  box-shadow: none !important;
}

.gtp-icon { font-size: 36px; line-height: 1; }

.gtp-card-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
}

.gtp-card-desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

.gtp-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hair);
  background: var(--paper);
  color: var(--ink-2);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.gtp-pill--private {
  border-color: var(--hair-strong);
  color: var(--wine);
}

.gtp-inner-btn {
  margin-top: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  border: none;
  background: var(--wine);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.gtp-inner-btn:hover { background: var(--wine-deep); }

.gtp-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.gtp-locked-msg { font-size: 12px; color: var(--ink-3); }
.gtp-add-partner-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--hair-strong);
  color: var(--wine);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  pointer-events: auto;
}
.gtp-add-partner-btn:hover {
  background: var(--wine);
  border-color: var(--wine);
  color: #fff;
}

.gtp-back-row { display: flex; justify-content: flex-start; }

@media (max-width: 520px) {
  .gtp-grid { grid-template-columns: 1fr; }
  .gtp-card { padding: 22px 16px 18px; }
  .gtp-icon { font-size: 32px; }
}

/* ===================================================================== */
/* Jogo de Desafios com IA (ai-game.js)                                  */
/* ===================================================================== */

.aig-banner {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

/* ===== Abas do jogo de IA: lista atual x histórico do casal ===== */
.aig-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--hair);
  margin-bottom: 18px;
  /* No mobile as três abas cabem por pouco: se um rótulo crescer, elas rolam
     dentro da própria faixa em vez de empurrar a página na horizontal. */
  overflow-x: auto;
  scrollbar-width: none;
}
.aig-tabs::-webkit-scrollbar { display: none; }
.aig-tab { white-space: nowrap; }
.aig-tabs[hidden] { display: none; }
.aig-tab {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.aig-tab:hover { color: var(--ink); }
.aig-tab.active { color: var(--ink); border-bottom-color: var(--wine); }

/* ===== Histórico do casal ===== */
.aig-hist-intro {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.aig-hist-loading, .aig-hist-empty {
  margin: 0;
  padding: 22px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-3);
}
.aig-hist-loading[hidden], .aig-hist-empty[hidden] { display: none; }

.aig-hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.aig-hist-item {
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px 16px;
}
/* Os secretos dela se distinguem por um filete vinho — sem revelar nada de
   diferente no conteúdo. */
.aig-hist-item--secret { border-left: 2px solid var(--wine); }

.aig-hist-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.aig-hist-who {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.aig-hist-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  border: 1px solid var(--hair);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
}
.aig-hist-badge--secret { color: var(--wine); border-color: var(--wine); }
.aig-hist-badge--liked  { color: var(--ok); border-color: var(--ok); }
.aig-hist-date {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-3);
}
.aig-hist-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
}
.aig-hist-title--gone { font-style: italic; color: var(--ink-3); }

/* --- Início do jogo de IA ---
   O seletor de tipo saiu: todo jogo é casal + secretos dela. O espaço virou
   explicação (.aig-how), que é o que a tela precisa fazer bem agora. */
.aig-start-title { font-family: 'Playfair Display', serif; font-size: 22px; margin: 4px 0 2px; }
.aig-start-sub   { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

/* Intro — SÓ LEITURA, agora com ícones de linha (SVG). O cuidado continua o
   mesmo da versão anterior: nada de borda de card, hover ou pílula — não pode
   parecer selecionável. Os ícones dão o resumo visual (dois anéis = casal,
   olho cortado = segredo dela, faísca = IA) e as linhas entram escalonadas
   (ver "Polimento de entrada" no fim do arquivo). */
.aig-how {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.aig-how-kicker {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.aig-how-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.aig-how-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
}
.aig-how-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--ink-2);
}
.aig-how-icon svg { width: 20px; height: 20px; }
/* O passo dela é o único acentuado — é o que diferencia este jogo. */
.aig-how-item--her .aig-how-icon {
  border-color: var(--wine);
  background: var(--wine-tint);
  color: var(--wine);
}
.aig-how-text strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 2px; }
.aig-how-item--her .aig-how-text strong { color: var(--wine); }
.aig-how-text p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* Bloco do que de fato se escolhe, separado da intro. */
.aig-setup { margin-bottom: 4px; }

.aig-cadence { margin-bottom: 18px; }
.aig-cadence-sub { margin: 4px 0 10px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }

/* Date picker do "Pick a date" */
.aig-cadence-date {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
/* display:flex acima venceria o [hidden] do UA — padrão da casa, ver .aig-overlay[hidden]. */
.aig-cadence-date[hidden] { display: none; }
.aig-date-input {
  font: inherit;
  font-size: 14px;
  padding: 8px 12px;
  min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  transition: border-color .15s;
}
.aig-date-input:focus { outline: none; border-color: var(--primary); background: var(--card); }
.aig-cadence-date-hint { font-size: 12.5px; color: var(--muted); }
.aig-cadence-label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; font-weight: 600; }
.aig-cadence-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.aig-cad-pill {
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.aig-cad-pill.active { border-color: var(--primary); background: var(--primary); color: #fff; }
/* "No deadline" some de cena quando há prêmio: prêmio sem prazo não corre
   contra nada. Desabilitar é mais honesto que aceitar e recusar no submit. */
.aig-cad-pill:disabled, .aig-cad-pill.is-disabled {
  opacity: .4;
  cursor: not-allowed;
  text-decoration: line-through;
}
.aig-start-btn { width: 100%; }
.aig-start-err { margin-top: 10px; }

/* --- Início: prêmio opcional para ela (só em couple_her) --- */
.aig-prize-setup {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  animation: contentIn .28s ease both;
}
.aig-prize-switch {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.aig-prize-switch input { margin-top: 3px; flex-shrink: 0; accent-color: var(--wine); }
.aig-prize-switch-text  { display: flex; flex-direction: column; gap: 3px; }
.aig-prize-switch-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.aig-prize-switch-desc  { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* "Por que ligar isto" — abre o bloco do prêmio com o motivo, antes da
   mecânica. Filete vinho à esquerda, sem card dentro de card. */
.aig-prize-why {
  border-left: 2px solid var(--wine);
  padding: 2px 0 2px 14px;
  margin-bottom: 16px;
}
.aig-prize-why-kicker {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.aig-prize-why-text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-2);
}
/* Data-limite inválida: o aviso vira erro de verdade, em vez de continuar
   cinza como se fosse texto de ajuda. */
.aig-prize-field-hint--err { color: var(--danger); font-weight: 600; }
.aig-prize-tip {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  font-style: italic;
}

.aig-prize-fields {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  animation: contentIn .28s ease both;
}
/* Sem isto o display:grid vence o [hidden] e os campos aparecem com o
   checkbox desligado (padrão da casa, ver .aig-overlay[hidden]). */
.aig-prize-fields[hidden] { display: none; }
.aig-prize-field { display: flex; flex-direction: column; gap: 5px; }
.aig-prize-field-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.aig-prize-field-opt {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-3);
  font-size: 11px;
}
.aig-prize-field input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  transition: border-color .15s;
}
.aig-prize-field input:focus { outline: none; border-color: var(--primary); background: var(--card); }
.aig-prize-field input::placeholder { color: var(--muted); }
.aig-prize-field-hint { font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }

/* --- Jogo ativo: barra de progresso do prêmio --- */
.aig-prize-track {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  animation: contentIn .28s ease both;
}
.aig-prize-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.aig-prize-track-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
/* O prazo mora na barra: é contra ele que o prêmio corre. */
.aig-prize-deadline {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
}

/* A fração é a informação principal — "2/4" diz o que falta; o percentual
   sozinho, não. Por isso ela é o número grande e o % é o coadjuvante. */
.aig-prize-figures {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.aig-prize-frac {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.aig-prize-frac-label {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
}
.aig-prize-pct {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  line-height: 1;
  color: var(--wine);
}

.aig-prize-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.aig-prize-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--wine), var(--gold));
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}
/* Marcas dos dois patamares; `left` vem inline (50% / 70%). */
.aig-prize-mark {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--card);
  opacity: .9;
}

.aig-prize-count {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.aig-prize-tiers {
  list-style: none;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.aig-prize-tier {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--muted);
}
/* Patamar sem prêmio é escondido via [hidden] — o flex acima não pode vencer. */
.aig-prize-tier[hidden] { display: none; }
.aig-prize-tier-pct {
  flex-shrink: 0;
  min-width: 42px;
  padding: 2px 0;
  font-weight: 700;
  font-size: 12px;
  color: var(--ink-soft);
}
.aig-prize-tier-name { flex: 1; }
.aig-prize-tier-state {
  flex-shrink: 0;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.aig-prize-tier--won { color: var(--ink); }
.aig-prize-tier--won .aig-prize-tier-pct  { color: var(--wine); }
.aig-prize-tier--won .aig-prize-tier-name { font-weight: 600; }
.aig-prize-tier--won .aig-prize-tier-state {
  border-color: transparent;
  background: var(--ok-bg);
  color: var(--ok);
}

/* --- Sugerir um desafio --- */
.aig-suggest {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  animation: contentIn .28s ease both;
}
.aig-suggest-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  margin: 0 0 4px;
  color: var(--ink);
}
.aig-suggest-desc {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.aig-suggest-input {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  min-height: 76px;
  transition: border-color .15s;
}
.aig-suggest-input:focus { outline: none; border-color: var(--primary); background: var(--card); }
.aig-suggest-input::placeholder { color: var(--muted); }
.aig-suggest-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.aig-suggest-count { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.aig-suggest-btn {
  padding: 10px 18px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.aig-suggest-btn:hover:not(:disabled) { border-color: var(--wine); color: var(--primary); }
.aig-suggest-btn:disabled { opacity: .45; cursor: not-allowed; }
.aig-suggest-msg { margin: 10px 0 0; font-size: 12.5px; color: var(--success); }
.aig-suggest-msg--err { color: var(--danger); }

/* --- Jogo ativo --- */
.aig-game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.aig-mode-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 6px 12px;
  border-radius: 999px;
}
.aig-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.aig-renew-btn, .aig-edit-btn, .aig-new-btn {
  padding: 7px 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.aig-renew-btn:not(:disabled):hover,
.aig-edit-btn:hover { border-color: var(--primary); color: var(--primary); }
.aig-renew-btn:disabled { opacity: .6; cursor: not-allowed; }
/* "Novos desafios": ação de destaque (preenchida). */
.aig-new-btn {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.aig-new-btn:not(:disabled):hover { filter: brightness(1.08); }
.aig-new-btn:disabled { opacity: .6; cursor: not-allowed; }

.aig-section { margin-bottom: 22px; }
.aig-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.aig-secret {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-alt);
  border: 1px dashed var(--line);
  padding: 2px 8px;
  border-radius: 999px;
}
.aig-cards { display: flex; flex-direction: column; gap: 12px; }
.aig-empty { color: var(--muted); font-size: 13px; font-style: italic; }

.aig-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: opacity .2s;
}
.aig-card--busy { opacity: .5; pointer-events: none; }
.aig-card--done { opacity: .55; }
.aig-card--given-up .aig-done-label { color: var(--muted); background: var(--bg-alt); }
.aig-done-label {
  margin-top: 14px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--success);
  background: var(--success-bg);
  border-radius: var(--radius-sm);
  padding: 9px;
}

.aig-renew-info {
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 14px;
  text-align: center;
}
.aig-renew-info:empty { display: none; }
.aig-expired-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border: 1px solid #f3c56b;
  border-left: 4px solid #d97706;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  color: #78350f;
}
.aig-expired-notice[hidden] { display: none; }
.aig-expired-icon { font-size: 22px; line-height: 1; }
.aig-expired-notice strong { display: block; font-size: 14px; margin-bottom: 3px; }
.aig-expired-notice p { margin: 0; font-size: 13px; line-height: 1.45; }
.aig-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.aig-card-title { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 700; color: var(--ink); margin: 0; line-height: 1.35; overflow-wrap: anywhere; }
.aig-card-desc  { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; margin: 8px 0 0; }

.aig-diff {
  flex-shrink: 0;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.aig-diff-1 { background: #F0F2EC; color: #5A6B4F; }
.aig-diff-2 { background: #F7F0E2; color: #9C6B1F; }
.aig-diff-3 { background: var(--wine-tint); color: var(--wine); }
.aig-diff-4 { background: var(--ink); color: var(--gold); }

.aig-tags-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.aig-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hair);
  background: var(--paper);
  color: var(--ink-2);
}

.aig-card-foot { display: flex; gap: 8px; margin-top: 14px; }
.aig-done-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.aig-done-btn:hover { background: var(--primary-dark); }
.aig-give-up-btn {
  padding: 10px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.aig-give-up-btn:hover { border-color: var(--danger); color: var(--danger); background: #fff5f5; }

.aig-feedback { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.aig-feedback-q { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 10px; }
.aig-feedback-q small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); margin-top: 3px; }
.aig-feedback-btns { display: flex; gap: 10px; }
.aig-like, .aig-dislike {
  flex: 1;
  padding: 9px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--line);
  background: var(--card);
  transition: all .15s;
}
.aig-like:hover    { border-color: var(--success); background: var(--success-bg); color: var(--success); }
.aig-dislike:hover { border-color: var(--muted); background: var(--bg-alt); }

/* --- Popup editar jogo --- */
.aig-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,10,15,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
/* Respeita o atributo hidden (a regra de classe acima sobrepõe o display:none do UA) */
.aig-overlay[hidden] { display: none; }
.aig-modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-modal);
}
.aig-modal-title { font-family: 'Playfair Display', serif; font-size: 20px; margin: 0 0 4px; }
.aig-modal-sub   { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.aig-modal-opt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  width: 100%;
  padding: 14px;
  margin-bottom: 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  transition: all .15s;
}
.aig-modal-opt:hover { border-color: var(--primary); background: var(--bg-alt); }
.aig-modal-opt-title { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.aig-modal-opt-desc  { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.aig-modal-danger:hover { border-color: var(--danger); background: #fef2f2; }
.aig-modal-danger .aig-modal-opt-title { color: var(--danger); }
.aig-modal-cancel {
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.aig-modal-cancel:hover { color: var(--ink); }

/* --- Toast --- */
.aig-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-modal);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 1100;
  max-width: 90%;
  text-align: center;
}
.aig-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 520px) {
  .aig-game-head { align-items: stretch; }
  .aig-cadence-date { align-items: stretch; }
  .aig-date-input { width: 100%; }
  .aig-prize-figures { flex-wrap: wrap; }
  .aig-prize-frac-label { flex: 1 1 100%; order: 3; }
  .aig-suggest-foot { flex-direction: column; align-items: stretch; }
  .aig-suggest-btn { width: 100%; }
}

/* ============================================================
   SPYCE SHELL — app shell desktop (DESIGN.md §2)
   Sidebar preta 264px + conteúdo em grid. Mobile mantém o
   compacto de coluna única; a sidebar simplesmente não existe.
   ============================================================ */
.side { display: none; }

/* Topbar mobile: fina, clara, com hairline */
.topbar { padding-bottom: 14px; border-bottom: 1px solid var(--hair); }

@media (min-width: 1024px) {
  .side {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 264px;
    background: var(--shell);
    color: var(--shell-ink);
    padding: 36px 0 24px;
    z-index: 100;
  }
  .side-logo {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 28px 26px;
    text-decoration: none;
    border-bottom: 1px solid rgba(245,243,239,.08);
  }
  .side-logo-name {
    font-family: var(--font-head);
    font-size: 27px;
    font-weight: 700;
    color: var(--shell-ink);
    line-height: 1;
  }
  .side-logo-sub {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--gold);
  }
  .side-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 18px 0;
    flex: 1;
  }
  .side-link {
    display: block;
    padding: 11px 26px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--shell-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color .15s, border-color .15s;
  }
  .side-link:hover  { color: var(--shell-ink); }
  .side-link.active {
    color: var(--shell-ink);
    border-left-color: var(--primary-light);
  }
  .side-foot {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 26px 0;
    border-top: 1px solid rgba(245,243,239,.08);
  }
  .side-user {
    font-size: 12.5px;
    color: var(--shell-muted);
  }
  .side-user strong { color: var(--shell-ink); font-weight: 600; }
  .side-logout {
    width: 100%;
    padding: 9px;
    background: transparent;
    border: 1px solid rgba(245,243,239,.18);
    border-radius: var(--radius);
    color: var(--shell-muted);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s, border-color .15s;
  }
  .side-logout:hover { color: var(--shell-ink); border-color: rgba(245,243,239,.45); }

  /* Conteúdo: sai da coluna 560px e vira área com grid */
  .topbar { display: none; }
  .app {
    margin: 0 0 0 264px;
    max-width: none;
    padding: 48px 56px 96px;
  }
  .app > * { max-width: 1120px; }

  /* Métricas em linha respirada */
  .metrics-row { gap: 16px; }
  .metric-card { padding: 22px 20px; }

  /* Seletor de modo não estica absurdo */
  .mode-selector { max-width: 720px; }

  /* Jogo custom: desafios | prêmios lado a lado */
  .game-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 32px;
    align-items: start;
  }
  .game-col { min-width: 0; }

  /* IA: cards em grid de 2 */
  .aig-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .ai-gate, .ai-ready { text-align: left; align-items: flex-start; padding: 32px; }

  /* Banco de desafios: grid editorial de 2 colunas */
  .challenges-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  /* Perfil: parceiro | interesses lado a lado */
  .profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }
  .profile-grid > * { min-width: 0; }

  /* Editar jogo: desafios | prêmios em duas colunas */
  .panels-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 32px;
    align-items: start;
  }
  .panel-col { min-width: 0; }
}

/* Telas largas: mais ar à esquerda do conteúdo */
@media (min-width: 1440px) {
  .app { padding-left: 72px; }
}

/* ============================================================
   SPYCE AUTH — split-screen editorial (DESIGN.md §2.4)
   Painel preto com statement à esquerda, formulário à direita.
   Mobile: só o formulário (hero não existe).
   ============================================================ */
.auth-hero { display: none; }

@media (min-width: 1024px) {
  body.page-auth,
  body.page-onboarding {
    display: grid;
    grid-template-columns: minmax(420px, 44%) 1fr;
    align-items: stretch;
    min-height: 100vh;
  }
  .auth-hero {
    display: block;
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--shell);
    color: var(--shell-ink);
  }
  .auth-hero-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 56px;
  }
  .auth-hero-brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--font-head);
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    color: var(--shell-ink);
  }
  .auth-hero-brand em {
    font-style: normal;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--gold);
  }
  .auth-hero-filet {
    display: block;
    width: 56px;
    height: 2px;
    background: var(--gold);
    margin-bottom: 26px;
  }
  .auth-hero-line {
    margin: 0;
    font-family: var(--font-head);
    font-size: 46px;
    font-weight: 600;
    line-height: 1.18;
    color: var(--shell-ink);
  }
  .auth-hero-sub {
    margin: 14px 0 0;
    font-size: 14px;
    color: var(--shell-muted);
    max-width: 380px;
    line-height: 1.6;
  }

  .login-wrap, .invite-wrap, .onboarding-wrap {
    margin: auto;
    width: 100%;
    padding-left: 48px;
    padding-right: 48px;
  }
  /* No split, o logo grande no topo do form é redundante com o hero */
  .login-brand .brand-logo,
  .invite-brand .brand-logo,
  .onboarding-brand .brand-logo { height: 72px; }
}

/* ============================================================
   SPYCE DASHBOARD — painel do casal no topo da home
   ============================================================ */
.dash {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.dash[hidden] { display: none; }

/* Cabeçalho preto: a "equipe" */
.dash-head {
  background: var(--shell);
  color: var(--shell-ink);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-team {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  margin: 2px 0 0;
  color: var(--shell-ink);
}
.dash-since {
  font-size: 12.5px;
  color: var(--shell-muted);
}

/* Faixa de estatísticas */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.dash-stat {
  padding: 18px 16px;
  text-align: center;
  border-right: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-stat:last-child { border-right: none; }
.dash-stat-num {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dash-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Últimas medalhas */
.dash-medals-block {
  padding: 18px 24px;
  border-top: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-medals {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.dash-medal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 76px;
  text-align: center;
}
/* Slot circular da conquista — reservado para uma arte futura (img).
   Enquanto não houver imagem, mostra o emoji. */
.dash-medal-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hair-strong);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  overflow: hidden;
}
.dash-medal-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-medal-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.25;
}
.dash-medals-empty { font-size: 13px; color: var(--ink-3); margin: 0; }

/* Dica do momento — card próprio no topo, não mais um rodapé colado ao painel
   do casal (onde era lida como instrução do jogo). */
.tip-card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  animation: contentIn .25s ease;
}
.tip-card[hidden] { display: none; }
.tip-card .kicker { display: block; margin-bottom: 8px; }
.tip-card-body {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-tip-emoji { font-size: 20px; line-height: 1; flex: none; }
.dash-tip-text {
  margin: 0;
  flex: 1;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
}
.dash-tip-refresh {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hair-strong);
  background: var(--surface);
  color: var(--wine);
  font-size: 15px;
  cursor: pointer;
  transition: transform .4s ease, background .15s, color .15s;
}
.dash-tip-refresh:hover { background: var(--wine); color: #fff; }
.dash-tip-refresh.spin { transform: rotate(360deg); }

@media (max-width: 480px) {
  .dash-team { font-size: 22px; }
  .dash-stat-num { font-size: 24px; }
  .dash-stat { padding: 14px 8px; }
}

/* ============================================================
   Polimento de entrada — aparecimento suave de componentes
   ------------------------------------------------------------
   Componentes que surgem por ação do usuário ou por carregamento
   de dados ganham uma entrada consistente (fade + leve subida),
   em vez de "pipocar". Elementos com [hidden] reproduzem a
   animação ao voltarem a display:block.

   Nota: os painéis (.mode-panel) já animam na abertura; listas
   re-renderizadas com frequência (task-list/prêmios, cards da IA)
   ficam de fora de propósito, para não piscar a cada atualização.
   As views internas abaixo só animam ao trocar de estado (o
   showView só muda display quando a view realmente muda), então
   não re-animam no polling do jogo. */

/* Views internas do "Jogo do Casal" (troca no-game / picker / jogo) */
#gameView,
#noGameState,
#gameTypePicker { animation: contentIn .3s ease; }

/* Dashboard do casal, banner "jogando solo" e card do desafio da semana */
.dash        { animation: contentIn .35s ease; }
.solo-banner { animation: contentIn .3s ease; }
.weekly-card { animation: contentIn .35s ease; }

/* Passos do "How it works" na tela de início do jogo de IA: entram um a um,
   como passos de wizard (slideIn). A view #aigStart sai de [hidden] quando
   abre, então a sequência roda a cada abertura — e nunca no polling, porque
   a tela de início não é re-renderizada. `both` segura o estado inicial
   durante o delay (sem ele, os itens atrasados piscariam visíveis antes). */
.aig-how-item { animation: slideIn .3s ease both; }
.aig-how-item:nth-child(1) { animation-delay: .05s; }
.aig-how-item:nth-child(2) { animation-delay: .16s; }
.aig-how-item:nth-child(3) { animation-delay: .27s; }

/* Overlays / modais: o fundo faz fade e o modal sobe com leve escala */
.aig-overlay { animation: fadeIn .2s ease; }
.aig-overlay .aig-modal { animation: modalPop .26s cubic-bezier(.2,.7,.3,1); }
@keyframes modalPop {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* Acessibilidade: respeita quem prefere menos movimento. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Bloco de contexto — dois usos, um estilo
   1. Contexto do primary: um desafio "secondary" nunca aparece
      sozinho, mostra o pai no topo do card (mesmo que hidden).
   2. Explicação de tag (needExplanation): descreve o que a tag
      significa. Esta é dispensável (.challenge-ctx--dismissable)
      — ver public/tag-explanation.js.
   ============================================================ */
.challenge-ctx {
  position: relative;
  border: 1px solid var(--hair-strong);
  border-left: 3px solid var(--wine);
  background: var(--wine-tint);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 12px;
}
/* Espaço para o botão de fechar não encavalar o texto. */
.challenge-ctx--dismissable { padding-right: 34px; }

.challenge-ctx-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--wine);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  opacity: .55;
  transition: opacity .15s, background-color .15s;
}
.challenge-ctx-close:hover { opacity: 1; background: rgba(110, 20, 35, .08); }
.challenge-ctx-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; opacity: 1; }
.challenge-ctx-close:disabled { opacity: .3; cursor: default; }
.challenge-ctx-label {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--wine);
  margin-bottom: 2px;
}
/* "o que é?" ao lado do nome: deixa explícito que o bloco define o termo, em
   vez de só repetir a tag. Mais leve que o nome, para não competir com ele. */
.challenge-ctx-what {
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.challenge-ctx-what::before { content: "— "; }
.challenge-ctx-title {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}
.challenge-ctx-desc {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-2);
}
