/* Cartela Surpresa — componentes (CSS puro, compatível com Tailwind via CDN) */
:root {
  --brand: #7c3aed;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, white);
  --brand-dark: color-mix(in srgb, var(--brand) 80%, black);
}

body { -webkit-tap-highlight-color: transparent; }

.card { background: #fff; border-radius: 1.5rem; box-shadow: 0 1px 2px rgb(15 23 42 / .04), 0 0 0 1px rgb(241 245 249); }

/* Botões */
.btn-primary, .btn-secondary, .btn-brand, .btn-whatsapp {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .75rem 1.25rem; border-radius: 1rem;
  font-weight: 800; line-height: 1.2; text-align: center; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, opacity .15s;
  user-select: none;
}
.btn-primary { background: linear-gradient(135deg, #7c3aed, #c026d3); color: #fff; box-shadow: 0 8px 20px -8px rgb(124 58 237 / .6); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgb(124 58 237 / .7); }
.btn-secondary { background: #fff; color: #334155; box-shadow: inset 0 0 0 2px #e2e8f0; }
.btn-secondary:hover { background: #f8fafc; }
.btn-brand { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-brand:hover { background: var(--brand-dark); }
.btn-whatsapp { background: #22c55e; color: #fff; }
.btn-whatsapp:hover { background: #16a34a; }
.btn-primary:active, .btn-brand:active, .btn-whatsapp:active, .btn-secondary:active { transform: scale(.98); }
button:disabled, .btn-primary[disabled], .btn-brand[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-xs { display: inline-flex; align-items: center; justify-content: center; padding: .4rem .7rem; border-radius: .7rem; font-size: .75rem; font-weight: 800; white-space: nowrap; cursor: pointer; }
.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading::after { content: ""; position: absolute; width: 1.25rem; height: 1.25rem; border: 3px solid rgb(255 255 255 / .5); border-top-color: #fff; border-radius: 999px; animation: spin .7s linear infinite; }

/* Formulários */
.label { display: block; margin-bottom: .35rem; font-size: .875rem; font-weight: 800; color: #334155; }
.input { display: block; width: 100%; min-height: 3rem; padding: .7rem 1rem; border-radius: 1rem; border: 2px solid #e2e8f0; background: #fff; font-size: 1rem; color: #0f172a; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 4px rgb(139 92 246 / .15); }
textarea.input { min-height: 6rem; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .15rem .6rem; font-size: .72rem; font-weight: 800; white-space: nowrap; }

/* Tabelas */
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th { padding: .75rem; text-align: left; font-size: .7rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; border-bottom: 1px solid #f1f5f9; white-space: nowrap; }
.table td { padding: .75rem; border-bottom: 1px solid #f8fafc; vertical-align: middle; }
.table tbody tr:hover { background: #fafaff; }

/* Cartela */
.cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
  min-height: 4.25rem; padding: .35rem .2rem; border-radius: 1rem; border: 2px solid transparent;
  text-align: center; transition: transform .12s ease, box-shadow .12s ease;
}
.cell-label { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .62rem; font-weight: 800; }
.cell-available { background: var(--brand-soft); color: var(--brand-dark); border-color: color-mix(in srgb, var(--brand) 35%, white); cursor: pointer; }
.cell-available:not([disabled]):hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 8px 16px -8px var(--brand); background: var(--brand); color: #fff; }
.cell-held { background: #f1f5f9; color: #94a3b8; border-style: dashed; border-color: #cbd5e1; animation: pulse 1.6s ease-in-out infinite; }
.cell-reserved { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.cell-confirmed { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.cell-canceled { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; text-decoration: line-through; }
.cell-mine { box-shadow: 0 0 0 3px var(--brand); }
.legend { display: inline-block; width: .9rem; height: .9rem; border-radius: .3rem; border-width: 2px; border-style: solid; }

.brand-text { color: var(--brand); }
.brand-bg { background: var(--brand); }
.brand-border { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.brand-gradient { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #ec4899)); color: #fff; }

/* Filtros */
.filter-chip { padding: .4rem .8rem; border-radius: 999px; font-size: .78rem; font-weight: 800; background: #f1f5f9; color: #475569; cursor: pointer; }
.filter-chip.is-active { background: #7c3aed; color: #fff; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgb(15 23 42 / .55); backdrop-filter: blur(2px); animation: fade .2s ease; }
.modal-panel {
  position: relative; width: 100%; max-width: 28rem; max-height: 92vh; overflow-y: auto;
  padding: 2rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom)); background: #fff;
  border-radius: 1.75rem 1.75rem 0 0; animation: slide-up .28s cubic-bezier(.2, .9, .3, 1.2);
}
@media (min-width: 640px) {
  .modal { align-items: center; }
  .modal-panel { border-radius: 1.75rem; padding-bottom: 1.75rem; }
}

.reveal-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 11rem; height: 11rem; border-radius: 2rem; color: #fff;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #ec4899));
  box-shadow: 0 20px 40px -15px var(--brand);
  animation: flip-in .7s cubic-bezier(.2, .9, .3, 1.3);
}
.gift-wiggle { animation: wiggle 1.4s ease-in-out infinite; }
.gift-shake { animation: shake .5s ease-in-out infinite; }

.confetti { position: relative; overflow: hidden; }
.confetti::before {
  content: "🎉 ✨ 🎊 💜 ✨ 🎉 🎊 ✨"; position: absolute; inset: 0; font-size: 1.5rem; letter-spacing: 1.5rem;
  opacity: .25; white-space: nowrap; animation: drift 6s linear infinite;
}

.toast { position: fixed; left: 50%; bottom: 6rem; z-index: 60; transform: translateX(-50%); padding: .7rem 1.1rem; border-radius: 999px; background: #0f172a; color: #fff; font-weight: 800; font-size: .875rem; box-shadow: 0 10px 30px -10px rgb(0 0 0 / .5); animation: slide-up .25s ease; }

/* Conteúdo do blog */
.prose-content { font-size: 1.05rem; line-height: 1.75; color: #334155; }
.prose-content h2 { margin: 2rem 0 .75rem; font-size: 1.4rem; font-weight: 900; color: #0f172a; }
.prose-content h3 { margin: 1.5rem 0 .5rem; font-size: 1.15rem; font-weight: 800; color: #0f172a; }
.prose-content p { margin: 0 0 1rem; }
.prose-content ul { margin: 0 0 1rem; padding-left: 1.25rem; list-style: disc; }
.prose-content ol { margin: 0 0 1rem; padding-left: 1.4rem; list-style: decimal; }
.prose-content li { margin: .35rem 0; }
.prose-content code { padding: .1rem .35rem; border-radius: .375rem; background: #f1f5f9; font-size: .9em; color: #6d28d9; }
.prose-content pre { margin: 0 0 1rem; padding: .85rem 1rem; overflow-x: auto; border-radius: .75rem; background: #0f172a; }
.prose-content pre code { padding: 0; background: none; color: #e2e8f0; font-size: .85rem; }
html.dark .prose-content code { background: #1e293b; color: #c4b5fd; }
.prose-content strong { color: #0f172a; font-weight: 800; }
.prose-content a { color: #7c3aed; font-weight: 700; text-decoration: underline; }
.prose-content > :first-child { margin-top: 0; }

/* Tema: ícone do botão */
.theme-icon-light { display: none; }
html.dark .theme-icon-light { display: inline; }
html.dark .theme-icon-dark { display: none; }

/* ============================================================ Modo escuro
   Sobrescreve as utilidades claras mais usadas nas views, sem precisar
   duplicar classes "dark:" em todos os templates. */
html.dark body { background: #0b1020 !important; color: #cbd5e1; }
html.dark .card { background: #131a2e; box-shadow: 0 0 0 1px #1e293b; }
html.dark .bg-white, html.dark .bg-white\/80, html.dark .bg-white\/95 { background-color: rgb(19 26 46 / .92) !important; }
html.dark .bg-slate-50 { background-color: #0f1628 !important; }
html.dark .bg-slate-100 { background-color: #1e293b !important; }
html.dark .bg-slate-200 { background-color: #334155 !important; }
html.dark .bg-violet-50, html.dark .bg-violet-100 { background-color: rgb(124 58 237 / .18) !important; }
html.dark .bg-emerald-50, html.dark .bg-emerald-100 { background-color: rgb(16 185 129 / .16) !important; }
html.dark .bg-amber-50, html.dark .bg-amber-100 { background-color: rgb(245 158 11 / .16) !important; }
html.dark .bg-rose-50, html.dark .bg-rose-100 { background-color: rgb(244 63 94 / .16) !important; }
html.dark .bg-sky-50, html.dark .bg-sky-100 { background-color: rgb(14 165 233 / .16) !important; }
html.dark .text-slate-900, html.dark .text-slate-800 { color: #f1f5f9 !important; }
html.dark .text-slate-700, html.dark .text-slate-600 { color: #cbd5e1 !important; }
html.dark .text-slate-500 { color: #94a3b8 !important; }
html.dark .text-violet-700, html.dark .text-violet-800, html.dark .text-violet-900 { color: #c4b5fd !important; }
html.dark .text-emerald-700, html.dark .text-emerald-800 { color: #6ee7b7 !important; }
html.dark .text-amber-700, html.dark .text-amber-800, html.dark .text-amber-900 { color: #fcd34d !important; }
html.dark .text-rose-700, html.dark .text-rose-800 { color: #fda4af !important; }
html.dark .text-sky-700, html.dark .text-sky-800 { color: #7dd3fc !important; }
html.dark .border-violet-100, html.dark .border-slate-200, html.dark .border-b, html.dark .border-t { border-color: #1e293b !important; }
html.dark .border-amber-200 { border-color: rgb(245 158 11 / .35) !important; }
html.dark .ring-slate-100 { --tw-ring-color: #1e293b !important; }
html.dark .hover\:bg-slate-100:hover { background-color: #1e293b !important; }
html.dark .from-violet-50 { --tw-gradient-from: #0b1020 !important; }
html.dark .via-white { --tw-gradient-stops: var(--tw-gradient-from), #0b1020, var(--tw-gradient-to) !important; }
html.dark .to-emerald-50\/40 { --tw-gradient-to: #0b1020 !important; }

html.dark .input { background: #0f1628; border-color: #334155; color: #f1f5f9; }
html.dark .input::placeholder { color: #64748b; }
html.dark .label { color: #e2e8f0; }
html.dark .btn-secondary { background: #131a2e; color: #e2e8f0; box-shadow: inset 0 0 0 2px #334155; }
html.dark .btn-secondary:hover { background: #1e293b; }
html.dark .table th { border-color: #1e293b; color: #64748b; }
html.dark .table td { border-color: #172036; }
html.dark .table tbody tr:hover { background: #172036; }
html.dark .filter-chip { background: #1e293b; color: #cbd5e1; }
html.dark .filter-chip.is-active { background: #7c3aed; color: #fff; }
html.dark .modal-panel { background: #131a2e; }
html.dark .toast { background: #f1f5f9; color: #0f172a; }
html.dark .prose-content { color: #cbd5e1; }
html.dark .prose-content h2, html.dark .prose-content h3, html.dark .prose-content strong { color: #f8fafc; }
html.dark .prose-content a { color: #c4b5fd; }

html.dark .cell-available { background: color-mix(in srgb, var(--brand) 22%, #0f1628); color: color-mix(in srgb, var(--brand) 40%, white); border-color: color-mix(in srgb, var(--brand) 45%, #0f1628); }
html.dark .cell-held { background: #1e293b; color: #64748b; border-color: #334155; }
html.dark .cell-reserved { background: rgb(245 158 11 / .18); color: #fcd34d; border-color: rgb(245 158 11 / .35); }
html.dark .cell-confirmed { background: rgb(16 185 129 / .18); color: #6ee7b7; border-color: rgb(16 185 129 / .35); }
html.dark .cell-canceled { background: #172036; color: #475569; border-color: #1e293b; }
html.dark .brand-border { background: color-mix(in srgb, var(--brand) 15%, #0f1628); color: color-mix(in srgb, var(--brand) 40%, white); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-6px) rotate(-10deg); } 75% { transform: translateX(6px) rotate(10deg); } }
@keyframes flip-in { 0% { transform: perspective(600px) rotateY(90deg) scale(.6); opacity: 0; } 100% { transform: perspective(600px) rotateY(0) scale(1); opacity: 1; } }
@keyframes drift { from { transform: translateX(-30%); } to { transform: translateX(0); } }

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