:root {
  --bg: #f5f7fb;
  --bg-soft: #ffffff;
  --bg-hero: linear-gradient(135deg, #ffffff 0%, #e0f2fe 45%, #fef3c7 100%);
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb; /* azul */
  --primary-soft: rgba(37, 99, 235, 0.08);
  --accent: #f97316; /* laranja */
  --accent-soft: rgba(249, 115, 22, 0.12);
  --border-soft: #e2e8f0;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
  --transition-fast: 0.16s ease-out;
}

html {
  scroll-behavior: smooth;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

/* Helpers */

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid var(--primary);
  background: #e5e7eb;
}

.brand-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.nav {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 10px;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.nav a:hover {
  background: rgba(226, 232, 240, 0.8);
  color: var(--text);
  transform: translateY(-1px);
}

/* Hero + Modalidades */

.hero {
  background: var(--bg-hero);
  padding: 40px 0 42px;
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.12);
  margin-bottom: 32px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 36px;
  align-items: center;
  margin-bottom: 32px;
}

.hero-content h1 {
  font-size: clamp(2rem, 3.1vw, 2.6rem);
  margin: 14px 0 12px;
}

.hero-subtitle {
  margin: 0 0 18px;
  color: var(--text-muted);
  max-width: 34rem;
}

.hero-slogan {
  margin-top: 16px;
  font-size: 0.9rem;
  color: #0f172a;
}

.hero-slogan span {
  color: #ea580c;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid transparent;
}

.tag-corp {
  background: var(--primary-soft);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.35);
}

.tag-fam {
  background: var(--accent-soft);
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.45);
}

.tag-game {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

/* Mascote */

.hero-mascote {
  display: flex;
  justify-content: flex-end;
}

.mascote-frame {
  width: min(280px, 80vw);
  border-radius: 32px;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.4);
}

.mascote-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Section titles */

.section-title {
  font-size: 1.4rem;
  margin: 0 0 6px;
}

.section-subtitle {
  margin: 0 0 24px;
  color: var(--text-muted);
}

/* Buttons */

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast), color var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  box-shadow: 0 16px 35px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.4);
}

.btn-ghost {
  background: #f8fafc;
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.6);
}

.btn-ghost:hover {
  background: #e2e8f0;
  color: var(--text);
}

.btn-lg {
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
}

.btn-primary:disabled,
.btn-ghost:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Mode cards */

.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.mode-card {
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: 18px 16px 14px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-card h3 {
  margin: 0;
}

.mode-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.mode-card-accent {
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: 0 18px 40px rgba(249, 115, 22, 0.25);
  background: linear-gradient(135deg, #fef9c3 0%, #fffbeb 25%, #e0f2fe 100%);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.75rem;
  color: #475569;
}

.mode-card .btn-primary {
  margin-top: auto;
}

/* Section padrão */

.section {
  padding: 56px 0 48px;
}

.section p {
  max-width: 40rem;
}

/* Footer */

.footer {
  padding: 18px 0 24px;
  border-top: 1px solid var(--border-soft);
  background: #ffffff;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* -------- MODAIS -------- */

body.no-scroll {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 40px);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(18px) scale(0.97);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease-out;
}

.modal-dialog-wide {
  max-width: 1040px;
}

.modal.is-open .modal-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(90deg, #eff6ff, #fffbeb);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #ffffff;
  font-size: 0.85rem;
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.icon-btn:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.icon-btn-ghost {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.icon-btn-ghost:hover {
  background: rgba(15, 23, 42, 0.03);
}

.modal-body {
  padding: 16px 18px 18px;
  overflow: auto;
}

.modal-description {
  margin-top: 0;
  margin-bottom: 14px;
  color: var(--text-muted);
}

/* Submodes de nomes */

.submode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.submode-tab {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #f8fafc;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  color: #475569;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast),
    transform var(--transition-fast);
}

.submode-tab.is-active {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  transform: translateY(-1px);
}

/* Form / inputs */

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 4px;
}

.form-inline input[type="text"],
.form-inline input[type="number"] {
  flex: 1 1 160px;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 9px 11px;
  font-size: 0.9rem;
  color: var(--text);
}

.form-inline input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
}

.field label {
  color: var(--text-muted);
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Extra options nomes */

.name-extra-options {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  margin-bottom: 8px;
}

#field-multi-count,
#field-group-count {
  display: none;
}

/* Lista de nomes */

.names-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 14px;
}

.names-list-container {
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 10px 10px 8px;
  max-height: 280px;
  overflow: auto;
}

.names-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.names-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.name-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px;
  border-radius: 8px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.name-item:nth-child(odd) {
  background: #eef2ff;
}

.name-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-item .remove-btn {
  margin-left: 10px;
  border-radius: 999px;
  border: none;
  padding: 4px 8px;
  font-size: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  cursor: pointer;
}

.name-item .remove-btn:hover {
  background: rgba(248, 113, 113, 0.18);
}

.names-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.winner-box {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at left, rgba(249, 115, 22, 0.18), #fff7ed);
  border: 1px solid rgba(248, 171, 59, 0.9);
}

.winner-anim {
  animation: winner-pop 0.4s ease-out;
}

.hidden {
  display: none;
}

.winner-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.winner-content {
  margin-top: 4px;
}

.winner-name {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: #c2410c;
}

/* Resultados em grupos / ordem / pares */

.group-results {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: #f9fafb;
  border: 1px solid var(--border-soft);
  font-size: 0.9rem;
}

.group-block {
  margin-bottom: 8px;
}

.group-block h4 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: #0f172a;
}

.group-block ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.group-block li {
  font-size: 0.86rem;
  color: #475569;
}

/* Número simples */

.number-raffle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 10px;
}

.number-display {
  margin-bottom: 10px;
}

.number-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.number-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 8px 14px;
  margin-left: 8px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid rgba(37, 99, 235, 0.45);
  font-size: 1.1rem;
  font-weight: 600;
  color: #1d4ed8;
}

/* Toggle modo números */

.mode-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #e5e7eb;
  margin-bottom: 10px;
}

.toggle-btn {
  border-radius: 999px;
  border: none;
  padding: 5px 10px;
  font-size: 0.8rem;
  background: transparent;
  cursor: pointer;
  color: #475569;
}

.toggle-btn.is-active {
  background: #ffffff;
  color: #1d4ed8;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

/* Histórico genérico */

.history {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-label {
  display: block;
  margin-bottom: 4px;
}

.history-list {
  min-height: 24px;
  max-height: 130px;
  overflow: auto;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 6px 8px;
}

.history-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  margin: 0 4px 4px 0;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 0.78rem;
}

.history-centered {
  margin-top: 16px;
}

/* Moeda */

.modal-centered {
  text-align: center;
}

.coin-wrapper {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.coin {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #f97316;
  background: radial-gradient(circle at top, #fed7aa, #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 40px rgba(249, 115, 22, 0.55);
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.coin span {
  font-size: 1.5rem;
  font-weight: 700;
  color: #7c2d12;
}

.coin.is-flipping {
  transform: rotateY(540deg);
}

/* Dado */

.dice-wrapper {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.dice {
  width: 110px;
  height: 110px;
  border-radius: 24px;
  background: #0f172a;
  color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 700;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.65);
  transition: transform 0.4s ease-out;
}

.dice.is-rolling {
  transform: rotateZ(12deg) scale(1.05);
}

/* Bingo */

.bingo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.bingo-current-wrapper {
  margin-bottom: 12px;
}

.bingo-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.bingo-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 3px solid rgba(37, 99, 235, 0.8);
  background: #eff6ff;
  font-size: 1.7rem;
  font-weight: 700;
  color: #1d4ed8;
}

.bingo-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr);
  gap: 16px;
}

.bingo-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  background: #f9fafb;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 8px;
  max-height: 360px;
  overflow: auto;
}

.bingo-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  padding: 4px 0;
  border-radius: 999px;
  background: #e5e7eb;
  color: #4b5563;
  border: 1px solid transparent;
}

.bingo-cell.drawn {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  border-color: #1d4ed8;
}

/* Roleta de prêmios */

.premios-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
  margin-bottom: 14px;
}

.premios-column h3 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}

textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45);
}

.premios-resultado {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border-soft);
  font-size: 0.9rem;
}

.premios-resultado p {
  margin: 0 0 4px;
}

/* Confetti */

#confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 60;
}

.confetti-piece {
  position: absolute;
  width: 7px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.9;
  animation: confetti-fall 1.2s linear forwards;
}

.confetti-color-1 {
  background: #2563eb;
}

.confetti-color-2 {
  background: #f97316;
}

.confetti-color-3 {
  background: #22c55e;
}

.confetti-color-4 {
  background: #eab308;
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, -100%, 0) rotateZ(0deg);
  }
  100% {
    transform: translate3d(0, 120vh, 0) rotateZ(360deg);
    opacity: 0;
  }
}

/* Animations */

@keyframes winner-pop {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsivo */

@media (max-width: 1024px) {
  .mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-mascote {
    justify-content: flex-start;
  }

  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .names-wrapper {
    grid-template-columns: minmax(0, 1fr);
  }

  .bingo-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .premios-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .nav {
    display: none;
  }

  .hero {
    padding-top: 28px;
  }

  .mode-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal-dialog {
    max-width: calc(100% - 16px);
    max-height: calc(100vh - 20px);
    border-radius: 20px;
  }

  .bingo-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .hero-inner {
    gap: 24px;
  }

  .hero-content h1 {
    font-size: 1.9rem;
  }
}
