:root {
  --brand-primary: #4f46e5;
  --brand-secondary: #7c3aed;
  --brand-accent: #14b8a6;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, rgba(79, 70, 229, 0.08), transparent 60%), #f4f6fb;
  color: #1f2933;
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

.page-wrapper {
  width: 100%;
}

.bingo-layout {
  width: 100%;
}

.bg-surface {
  background-color: transparent;
}

.card {
  border: none;
  border-radius: 1.25rem;
}

.card-body {
  padding: 2rem;
}

.globe-indicator {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--brand-primary));
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
  animation: pulse 3s ease-in-out infinite;
}
.globe-indicator.running {
  animation-duration: 1.2s;
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--brand-secondary));
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.45);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
  }
}

.result-display {
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(20, 184, 166, 0.15));
  padding: 1.5rem;
}

#currentElement {
  min-height: 300px;
}

.current-element {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.current-element__frame {
  width: min(100%, 520px);
  aspect-ratio: 16 / 9;
  min-height: 260px;
  max-height: 360px;
  border-radius: 1rem;
  background: #0f172a;
  border: 1px solid rgba(79, 70, 229, 0.15);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

.current-element__text {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--brand-primary);
}

.current-element__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b1020;
}

textarea#customEntries {
  min-height: 240px;
  resize: vertical;
}

textarea#customEntries:disabled {
  background-color: #f9fafb;
}

.draw-list {
  min-height: 140px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.draw-list .chip {
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(79, 70, 229, 0.1);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.draw-list .chip.highlight {
  background: rgba(79, 70, 229, 0.15);
  border-color: rgba(79, 70, 229, 0.3);
}

.draw-list .chip.chip--image {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 1rem;
}

.chip--image img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid rgba(79, 70, 229, 0.2);
  background: #fff;
}

.image-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.image-thumb {
  width: 72px;
  height: 72px;
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(79, 70, 229, 0.15);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  background: #fff;
  position: relative;
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-thumb__label {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
  color: #fff;
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
  text-align: center;
}

.btn-outline-primary.active,
.btn-outline-primary:focus-visible {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}
.btn-outline-primary.active {
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.25);
}

.cartela-board {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cartela-card {
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  background: #fdfdff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cartela-card.is-winner {
  border-color: rgba(20, 184, 166, 0.7);
  box-shadow: 0 14px 32px rgba(20, 184, 166, 0.25);
  transform: translateY(-2px);
}

.cartela-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cartela-card__title {
  font-weight: 700;
  color: #0f172a;
}

.cartela-card__title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.cartela-inline-input {
  max-width: 220px;
  margin-top: 0.25rem;
}

.cartela-edit-inline {
  color: #4f46e5;
  text-decoration: none;
}

.cartela-card__progress {
  color: #475467;
  font-size: 0.95rem;
}

.cartela-card__header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cartela-remove {
  padding-inline: 0.75rem;
  border-radius: 0.75rem;
}

.cartela-card__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cartela-card__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cartela-field__label {
  display: block;
  font-size: 0.8rem;
  color: #475467;
  margin-bottom: 0.2rem;
}

.cartela-card__title-input {
  font-weight: 700;
  border-radius: 0.75rem;
  border: 1px solid rgba(79, 70, 229, 0.25);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.cartela-card__title-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}

.cartela-whatsapp .form-control {
  border-top-left-radius: 0.75rem;
  border-bottom-left-radius: 0.75rem;
}

.cartela-whatsapp .btn {
  border-top-right-radius: 0.75rem;
  border-bottom-right-radius: 0.75rem;
  padding-inline: 0.95rem;
  font-weight: 700;
}

.cartela-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.65rem;
  border-radius: 0.85rem;
  border: 1px dashed rgba(79, 70, 229, 0.3);
  background: #fff;
  color: #1f2933;
  min-height: 36px;
}

.cartela-item.is-hit {
  background: rgba(20, 184, 166, 0.12);
  border-color: rgba(20, 184, 166, 0.6);
  color: #0f5132;
}

.cartela-item__mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

.cartela-item.is-hit .cartela-item__mark {
  background: var(--brand-accent);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.45);
}

.cartela-item img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid rgba(79, 70, 229, 0.3);
  background: #fff;
}

.cartela-empty {
  padding: 0.75rem 1rem;
  border: 1px dashed rgba(15, 23, 42, 0.15);
  border-radius: 0.85rem;
  background: #f8fafc;
  color: #475467;
}

.winner-alert {
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.25);
  font-weight: 700;
}

.podium {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

.podium-card {
  flex: 1 1 180px;
  min-width: 180px;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #f8fafc, #fff);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.podium-place {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.35rem;
}

.podium-place .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-weight: 800;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.85rem;
}

.podium-winners {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.podium-winners li {
  padding: 0.25rem 0.55rem;
  background: rgba(79, 70, 229, 0.08);
  color: #111827;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}

.podium-empty {
  color: #475467;
  font-size: 0.9rem;
}

@media (max-width: 767.98px) {
  .card-body {
    padding: 1.5rem;
  }

  .btn-group > .btn {
    font-size: 0.9rem;
  }

  body {
    padding: 1.5rem 1rem;
  }
}
