html {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

body {
  height: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Barras de rolagem discretas */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1f2937;
}

::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #4b5563 #1f2937;
}

/* Evita que elementos causem estouro horizontal */
*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video {
  max-width: 100%;
  height: auto;
}

.cartela {
  display: grid;
  grid-template-columns: repeat(5, minmax(45px, 1fr));
  gap: 6px;
  background: transparent;
  padding: 0;
  border-radius: 12px;
  max-width: 280px;
}

@media (min-width: 640px) {
  .cartela {
    grid-template-columns: repeat(5, minmax(60px, 1fr));
    gap: 8px;
    max-width: 340px;
  }
}

.cartela-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

@media (min-width: 640px) {
  .cartela-wrapper {
    padding: 20px;
  }
}

.cartela-header {
  display: grid;
  grid-template-columns: repeat(5, minmax(45px, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  max-width: 280px;
}

@media (min-width: 640px) {
  .cartela-header {
    grid-template-columns: repeat(5, minmax(60px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    max-width: 340px;
  }
}

.cartela-letra {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: clamp(20px, 5vw, 24px);
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  min-width: 45px;
  min-height: 45px;
}

@media (min-width: 640px) {
  .cartela-letra {
    min-width: 60px;
    min-height: 60px;
  }
}

@keyframes bingo-glow {
  0%, 100% { filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.3)); }
  50% { filter: drop-shadow(0 8px 20px rgba(251, 191, 36, 0.6)); }
}

.bingo-logo {
  height: 100px;
  max-width: 240px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.3));
  animation: bingo-glow 2s ease-in-out infinite;
}

.bingo-fallback {
  height: 100px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: bold;
  color: #c084fc;
  text-shadow: 0 2px 8px rgba(168, 85, 247, 0.5);
  letter-spacing: 4px;
}

.numero-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1f2937;
  color: white;
  border-radius: 8px;
  font-weight: bold;
  font-size: clamp(14px, 3vw, 18px);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #4b5563;
  min-height: 45px;
}

@media (min-width: 640px) {
  .numero-cell {
    min-height: 60px;
  }
}

.numero-cell:hover {
  transform: scale(1.05);
}

.numero-cell.marcado {
  background: #10b981;
  color: white;
  border-color: #059669;
}

.numero-cell.livre {
  background: #f97316;
  color: white;
  font-weight: bold;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-in {
  animation: slideIn 0.3s ease-out;
}

.numero-sorteio {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.numero-sorteio:disabled {
  cursor: not-allowed;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); background-color: #1f2937; }
  25% { transform: translateX(-5px); background-color: #dc2626; }
  50% { transform: translateX(5px); background-color: #dc2626; }
  75% { transform: translateX(-5px); background-color: #dc2626; }
}

#mainContent {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#adminPanel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (min-width: 768px) {
  #adminPanel {
    flex-direction: row;
    height: 100%;
  }
}

@media (max-width: 767px) {
  #adminPanel {
    min-height: 0;
    height: auto;
  }

  #adminPanel > div:first-child {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
  }

  #adminPanel > div:first-child .admin-menu-btn {
    flex: 0 0 auto;
  }

  #adminPanel > div:last-child {
    min-width: 0;
    width: 100%;
  }

  .admin-menu-content {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

#adminPanel > div:first-child {
  flex-shrink: 0;
}