:root {
  /* Opção 2 — Branco Puro & Índigo Elétrico (Light Clean) */
  --bg: #f8fafc;
  --bg-deep: #f1f5f9;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-muted: #f1f5f9;
  --shell-bg: rgba(226, 232, 240, 0.52);

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-deep: #3730a3;
  --accent-soft: #eef2ff;
  --accent-ring: rgba(79, 70, 229, 0.18);

  --blue-reveal: #3b82f6;

  --success: #059669;
  --success-soft: #ecfdf5;
  --success-border: #a7f3d0;

  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #92400e;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;

  /* Tipografia limpa moderna */
  --font-display: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Raios concêntricos */
  --radius-shell: 24px;
  --radius-card: 18px;
  --radius-md: 13px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  /* Sombras frias sutis */
  --shadow-nav: 0 10px 28px -10px rgba(15, 23, 42, 0.1), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 10px 28px -14px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-cta: 0 12px 24px -10px rgba(79, 70, 229, 0.48), 0 2px 6px -2px rgba(79, 70, 229, 0.25);
  --shadow-modal: 0 28px 64px -16px rgba(15, 23, 42, 0.24), 0 4px 16px rgba(15, 23, 42, 0.08);

  /* Curvas orgânicas */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Camadas */
  --z-bg: 0;
  --z-base: 1;
  --z-nav: 20;
  --z-toast: 40;
  --z-modal: 60;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: hidden;
}

button,
input,
textarea {
  font-family: inherit;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--text);
  color: var(--surface);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.25s var(--ease-out);
}

.skip-link:focus {
  top: 14px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
}

/* Fundo luminoso limpo */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: var(--z-bg);
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.ambient-orb-1 {
  width: 540px;
  height: 540px;
  top: -210px;
  right: -140px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.14) 0%, rgba(99, 102, 241, 0) 70%);
}

.ambient-orb-2 {
  width: 480px;
  height: 480px;
  bottom: -180px;
  left: -140px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.11) 0%, rgba(59, 130, 246, 0) 72%);
}

/* Estrutura principal */
.page {
  position: relative;
  z-index: var(--z-base);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Barra superior flutuante */
.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  padding: 14px 16px 6px;
}

.topbar {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 10px 8px 12px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-right: 4px;
}

.brand-emblem {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #6366f1 0%, var(--accent) 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 4px 12px -4px rgba(79, 70, 229, 0.55);
}

.brand-emblem svg {
  width: 18px;
  height: 18px;
}

.brand-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tabs {
  display: inline-flex;
  align-items: center;
  background: var(--surface-muted);
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 3px;
  flex-shrink: 0;
}

.tab {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  transition: color 0.22s var(--ease-out), background-color 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out), transform 0.18s var(--ease-out);
}

.tab:hover:not(.is-active) {
  color: var(--text);
}

.tab:active {
  transform: scale(0.97);
}

.tab.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.12), 0 1px 2px rgba(15, 23, 42, 0.05);
}

.tab.is-active .tab-icon {
  color: var(--accent);
}

.tab-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px var(--surface);
  flex-shrink: 0;
}

/* Container central */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  flex: 1;
}

.view,
.admin-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: viewEnter 0.24s var(--ease-out) both;
}

@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cartões com moldura suave */
.bezel-shell {
  padding: 5px;
  border-radius: var(--radius-shell);
  background: var(--shell-bg);
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px 24px 26px;
  box-shadow: var(--shadow-card);
}

/* Hero do Sorteio */
.hero-card {
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(224, 231, 255, 0.65) 0%, rgba(255, 255, 255, 0) 58%),
    var(--surface);
}

.hero-decor {
  position: absolute;
  top: -16px;
  right: -12px;
  width: 148px;
  height: 148px;
  color: var(--accent);
  pointer-events: none;
}

.hero-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.eyebrow-pill-neutral {
  background: var(--surface-muted);
  color: var(--text-soft);
}

.eyebrow-pill-success {
  background: var(--success-soft);
  color: var(--success);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.65rem, 4.2vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  text-wrap: balance;
}

.hero-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 46ch;
  text-wrap: pretty;
}

h2 {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 1.18rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

h3 {
  margin: 0 0 4px;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
}

.muted {
  color: var(--muted);
  margin: 0;
  font-size: 0.92rem;
  text-wrap: pretty;
}

.small {
  font-size: 0.84rem;
}

/* Progresso */
.progress-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.pill-metric {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.progress-hint {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 9px;
  background: var(--surface-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, #6366f1 55%, #3b82f6 100%);
  border-radius: var(--radius-pill);
  transition: width 0.55s var(--ease-out);
}

/* Skeleton de carregamento */
.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.4s ease infinite;
}

.skeleton-title {
  width: 44%;
  height: 22px;
}

.skeleton-text {
  width: 78%;
  height: 14px;
  margin-bottom: 6px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.skeleton-tile {
  height: 60px;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Cartões de estado vazio / concluído */
.state-card {
  text-align: center;
  padding: 40px 24px 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.state-emblem {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.state-emblem svg {
  width: 40px;
  height: 40px;
}

.state-emblem-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid #c7d2fe;
}

.state-emblem-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.state-text {
  margin: 8px auto 0;
  max-width: 40ch;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Cabeçalhos de seção */
.section-head {
  margin-bottom: 18px;
}

.section-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.title-with-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.title-with-badge h2 {
  margin: 0;
}

.mini-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Busca de participantes */
.search-wrap {
  position: relative;
  margin-top: 14px;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  padding-left: 40px;
}

.search-empty {
  text-align: center;
  padding: 18px 8px;
}

/* Grade de nomes clicáveis */
.name-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}

.name-btn {
  appearance: none;
  position: relative;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 15px;
  padding: 12px 13px;
  min-height: 58px;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 11px;
  transition:
    border-color 0.22s var(--ease-out),
    background-color 0.22s var(--ease-out),
    box-shadow 0.22s var(--ease-out),
    transform 0.2s var(--ease-out);
  animation: tileFadeUp 0.3s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 20ms);
}

@keyframes tileFadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.name-btn:hover {
  border-color: #a5b4fc;
  background: #f5f7ff;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -12px rgba(79, 70, 229, 0.35);
}

.name-btn:active {
  transform: scale(0.98);
}

.name-btn.is-selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px rgba(79, 70, 229, 0.65);
}

.name-avatar {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.name-btn:hover .name-avatar {
  background: #e0e7ff;
}

.name-btn.is-selected .name-avatar {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.name-label {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.name-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: border-color 0.2s var(--ease-out), background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.name-check svg {
  width: 12px;
  height: 12px;
}

.name-btn.is-selected .name-check {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--accent);
}

/* Ação principal do sorteio */
.draw-action {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.draw-privacy-note {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.draw-privacy-note svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}

/* Quem já sorteou */
.used-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-strong);
}

.used-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.used-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.used-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.used-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 5px 12px 5px 9px;
  border-radius: var(--radius-pill);
}

.used-chip-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.used-chip-icon svg {
  width: 10px;
  height: 10px;
}

/* Botões */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.93rem;
  padding: 11px 18px;
  min-height: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition:
    background-color 0.22s var(--ease-out),
    color 0.22s var(--ease-out),
    border-color 0.22s var(--ease-out),
    box-shadow 0.22s var(--ease-out),
    transform 0.18s var(--ease-out),
    opacity 0.2s var(--ease-out);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-lg {
  width: 100%;
  padding: 14px 22px;
  font-size: 0.98rem;
  min-height: 52px;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff;
  box-shadow: var(--shadow-cta);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #6366f1 0%, var(--accent) 100%);
  transform: translateY(-1px);
}

/* CTA com ícone circular aninhado */
.btn-cta {
  width: 100%;
  padding: 8px 8px 8px 24px;
  min-height: 54px;
  justify-content: space-between;
  font-size: 0.98rem;
}

.btn-cta-label {
  flex: 1;
  text-align: center;
  padding-left: 22px;
}

.btn-cta-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.26s var(--ease-spring), background-color 0.22s var(--ease-out);
}

.btn-cta:hover:not(:disabled) .btn-cta-circle {
  transform: translateX(2px) scale(1.05);
  background: rgba(255, 255, 255, 0.26);
}

.btn-secondary {
  background: var(--surface-subtle);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-muted);
  border-color: #94a3b8;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-danger:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #fca5a5;
}

.btn-danger-solid {
  background: var(--danger);
  color: #ffffff;
  box-shadow: 0 10px 22px -10px rgba(220, 38, 38, 0.55);
}

.btn-danger-solid:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-banner {
  background: var(--surface);
  color: var(--warn-text);
  border-color: var(--warn-border);
  padding: 8px 14px;
  min-height: 38px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.btn-banner:hover {
  background: #fef3c7;
}

/* Inputs */
.input,
.textarea {
  width: 100%;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 0.96rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}

.input {
  min-height: 46px;
}

.input-lg {
  min-height: 50px;
  font-size: 1rem;
}

.input::placeholder,
.textarea::placeholder {
  color: #94a3b8;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.input:disabled,
.textarea:disabled {
  background: var(--surface-subtle);
  color: var(--muted);
  cursor: not-allowed;
}

.textarea {
  resize: vertical;
  min-height: 112px;
  line-height: 1.55;
}

.input-with-action {
  position: relative;
  width: 100%;
}

.input-with-action .input {
  padding-right: 46px;
}

.input-grow {
  flex: 1;
}

.input-toggle-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.input-toggle-btn:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.input-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.inline-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 500;
  text-align: left;
}

/* Tela de bloqueio por PIN */
.lock-shell {
  max-width: 480px;
  width: 100%;
  margin: 12px auto 0;
}

.lock-card {
  text-align: center;
  padding: 36px 28px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lock-card.is-shaking {
  animation: shake 0.4s var(--ease-out);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-4px); }
  88% { transform: translateX(3px); }
}

.lock-emblem {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: var(--accent-soft);
  border: 1px solid #c7d2fe;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.lock-emblem svg {
  width: 32px;
  height: 32px;
}

.lock-desc {
  max-width: 34ch;
  margin-top: 4px;
}

.lock-form {
  width: 100%;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Banner de PIN padrão */
.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  font-size: 0.9rem;
}

.banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.banner-icon svg {
  width: 18px;
  height: 18px;
}

.banner-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.banner-body strong {
  font-size: 0.9rem;
}

.banner-body span {
  font-size: 0.85rem;
  opacity: 0.92;
}

/* Painel Admin — Resumo e barra de ferramentas */
.admin-toolbar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-heading {
  margin: 0;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-strip {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat-value-success {
  color: var(--success);
}

.stat-value-accent {
  color: var(--accent);
}

/* Avisos e formulários do admin */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--accent-soft);
  border: 1px solid #c7d2fe;
  color: var(--accent-deep);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.notice svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.form-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.draft-count {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.inline-form {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.inline-form .input {
  flex: 1;
}

/* Lista de participantes no Admin */
.participant-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.participant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}

.participant-item:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.participant-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.participant-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.participant-name {
  font-weight: 600;
  font-size: 0.94rem;
  word-break: break-word;
}

.participant-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge svg {
  width: 12px;
  height: 12px;
}

.badge-pending {
  background: var(--surface-muted);
  color: var(--muted);
}

.badge-done {
  background: var(--success-soft);
  color: var(--success);
}

.icon-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}

.icon-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.list-empty {
  text-align: center;
  padding: 28px 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.list-empty svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
  opacity: 0.75;
}

.list-empty p {
  margin: 0;
  font-size: 0.9rem;
  max-width: 36ch;
}

/* Configurações */
.setting-row {
  margin-top: 16px;
}

.setting-row:first-of-type {
  margin-top: 0;
}

.label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.label-hint {
  font-weight: 400;
  color: var(--muted);
}

.setting-note {
  margin-top: 8px;
}

.setting-note code {
  background: var(--surface-muted);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.82rem;
}

.danger-zone {
  margin-top: 24px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.danger-header {
  margin-bottom: 14px;
}

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

/* Rodapé discreto */
.footer {
  text-align: center;
  padding: 6px 16px 26px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Toast flutuante */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  width: calc(100% - 32px);
  max-width: 440px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 16px 36px -10px rgba(15, 23, 42, 0.26);
  animation: toastSlideIn 0.34s var(--ease-spring) both;
}

.toast svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.toast.is-ok {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.toast.is-ok svg {
  color: #34d399;
}

.toast.is-err {
  background: #450a0a;
  color: #fef2f2;
  border: 1px solid rgba(248, 113, 113, 0.32);
}

.toast.is-err svg {
  color: #fca5a5;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modais */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: backdropIn 0.24s var(--ease-out) both;
}

/* Fundo azul suave festivo na revelação (inspirado na referência) */
.modal-backdrop-celebrate {
  background: radial-gradient(
    circle at 50% 42%,
    rgba(219, 230, 255, 0.92) 0%,
    rgba(196, 212, 252, 0.88) 55%,
    rgba(173, 194, 248, 0.86) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.modal {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 430px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  padding: 26px 26px 24px;
  box-shadow: var(--shadow-modal);
  animation: modalPop 0.36s var(--ease-spring) both;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-emblem {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.modal-emblem.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.modal-emblem svg {
  width: 24px;
  height: 24px;
}

.modal-text {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.modal-text strong {
  color: var(--text);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions-stack {
  flex-direction: column;
}

/* Palco da Revelação com presentes acima do cartão */
.result-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  padding-top: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gift-parade {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 92%;
  max-width: 390px;
  z-index: 1;
  pointer-events: none;
  animation: giftsPop 0.58s var(--ease-spring) 0.06s both;
}

.gift-parade svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 14px rgba(59, 89, 152, 0.16));
}

@keyframes giftsPop {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(24px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.modal-result {
  width: 100%;
  max-width: 440px;
  padding: 24px 24px 24px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 24px 54px -18px rgba(30, 58, 138, 0.24), 0 2px 10px rgba(15, 23, 42, 0.06);
}

.result-top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.result-heading {
  margin: 0;
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.result-drawer {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.reveal-box {
  position: relative;
  margin: 0 0 16px;
  padding: 30px 20px;
  border-radius: 16px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  text-align: center;
  overflow: hidden;
  animation: boxReveal 0.48s var(--ease-spring) 0.1s both;
}

@keyframes boxReveal {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.reveal-name {
  position: relative;
  z-index: 1;
  font-size: clamp(2rem, 7vw, 2.65rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--blue-reveal);
  word-break: break-word;
  animation: nameReveal 0.58s var(--ease-out) 0.16s both;
}

@keyframes nameReveal {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.reveal-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(255, 255, 255, 0.72) 48%,
    transparent 76%
  );
  transform: translateX(-120%);
  animation: ticketSweep 1.2s var(--ease-out) 0.3s 1 forwards;
  pointer-events: none;
}

@keyframes ticketSweep {
  to {
    transform: translateX(120%);
  }
}

.result-warning {
  margin: 0;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.83rem;
  line-height: 1.45;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.result-warning svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Responsividade Mobile */
@media (max-width: 600px) {
  .topbar-wrap {
    padding: 10px 12px 4px;
  }

  .topbar {
    padding: 6px 7px 6px 10px;
  }

  .brand-emblem {
    width: 30px;
    height: 30px;
  }

  .brand-emblem svg {
    width: 15px;
    height: 15px;
  }

  .brand-name {
    font-size: 0.94rem;
  }

  .tab {
    padding: 7px 11px;
    font-size: 0.83rem;
    gap: 5px;
  }

  .container {
    padding: 14px 12px 32px;
  }

  .bezel-shell {
    padding: 4px;
    border-radius: 21px;
  }

  .card {
    padding: 20px 17px 22px;
    border-radius: 16px;
  }

  .hero-top {
    flex-direction: column;
    gap: 12px;
  }

  .progress-summary {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .name-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .name-btn {
    padding: 10px 10px;
    min-height: 54px;
    gap: 8px;
    font-size: 0.89rem;
  }

  .name-avatar {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-size: 0.72rem;
  }

  .name-check {
    display: none;
  }

  .name-btn.is-selected .name-check {
    display: inline-flex;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
  }

  .draw-privacy-note {
    font-size: 0.77rem;
    text-align: center;
  }

  .btn-cta-label {
    padding-left: 10px;
    font-size: 0.94rem;
  }

  .inline-form {
    flex-direction: column;
  }

  .inline-form .btn {
    width: 100%;
  }

  .banner {
    flex-wrap: wrap;
  }

  .btn-banner {
    width: 100%;
  }

  .stats-strip {
    gap: 8px;
  }

  .stat-box {
    padding: 10px;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .btn {
    flex: 1;
  }

  .danger-actions {
    flex-direction: column;
  }

  .danger-actions .btn {
    width: 100%;
  }

  .result-stage {
    padding-top: 70px;
  }

  .modal-result {
    padding: 20px 18px 20px;
  }

  .modal-backdrop:not(.modal-backdrop-celebrate) {
    align-items: flex-end;
    padding: 12px;
  }

  .modal-confirm {
    border-radius: 24px;
  }

  .modal-actions:not(.modal-actions-stack) {
    flex-direction: column-reverse;
  }

  .modal-actions:not(.modal-actions-stack) .btn {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .name-grid {
    grid-template-columns: 1fr;
  }

  .tab-icon {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
