/* 
 * NOTA: A importação da fonte Inter foi MOVIDA para o <head> do index.html
 * com preconnect + display=swap para otimizar o LCP.
 * Não é mais necessária aqui para evitar render-blocking.
 */

#modal-overlay, #toast-container, #video-overlay, #pwa-banner {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}

#modal-overlay *, #toast-container *, #video-overlay *, #pwa-banner * {
  box-sizing: inherit;
}

/* FAB - Botão Flutuante (Estilo Ficha de Casino/App) */
#fab {
  position: fixed; bottom: 20px; right: 20px; width: 64px; height: 64px;
  background: linear-gradient(135deg, #00AFFF, #0056b3);
  border: 2px solid #11132A;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; color: #FFFFFF; font-size: 28px; cursor: move;
  box-shadow: 0 8px 25px rgba(0, 175, 255, 0.4), 0 0 15px rgba(0, 175, 255, 0.2); 
  z-index: 9999; touch-action: none; transition: transform 0.2s ease;
}
#fab:active { transform: scale(0.95); }

/* Overlay Escuro */
#modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(10, 12, 24, 0.85); /* Fundo mais escuro e imersivo */
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 10000;
}

/* Base do Modal - Estilo App Escuro */
.modal {
  background: #1A1D2E; /* Cor de fundo principal do modal */
  width: 92%; max-width: 420px; border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column; max-height: 85vh;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255,255,255,0.05);
}

.modal.closing {
  animation: modalBounceOut 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalBounceOut {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  20% { transform: translateY(-15px) scale(1); opacity: 1; }
  100% { transform: translateY(30px) scale(0.95); opacity: 0; }
}

/* Cabeçalho do Modal */
.modal-header {
  padding: 18px 20px; 
  background: #11132A;
  color: #FFFFFF; 
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 10;
}
.modal-header strong { font-size: 16px; font-weight: 700; letter-spacing: 0.3px; }
.modal-header span { color: #64748B; transition: color 0.2s; }
.modal-header span:hover { color: #00AFFF; }

.modal-content { 
  padding: 20px; overflow-y: auto; flex: 1; 
  background-color: #1A1D2E;
  color: #E2E8F0;
}

/* Lista de Loterias - Estilo Cards de Esportes */
.list-item {
  background: #23283E; padding: 16px 18px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; color: #F8FAFC; font-weight: 600;
  transition: all 0.2s ease;
}
.list-item:hover {
  transform: translateY(-2px);
  border-color: #00AFFF;
  box-shadow: 0 6px 16px rgba(0, 175, 255, 0.1);
}
.list-item span:last-child { color: #00AFFF; font-size: 22px; font-weight: 800; }

.btn-back { 
  cursor: pointer; color: #00AFFF; font-weight: 700; 
  font-size: 13px; text-transform: uppercase; letter-spacing: 1px; 
  transition: color 0.2s ease;
}
.btn-back:hover {
  color: #FFFFFF;
}

/* Filtros (Milhar, Centena, etc) - Estilo Tabs de App */
.view-modes { 
  display: flex; background: #11132A; padding: 5px; 
  border-radius: 20px; margin-bottom: 18px; 
}
.mode-btn { 
  flex: 1; font-size: 12px; font-weight: 700; padding: 10px; 
  cursor: pointer; border: none; background: transparent; 
  border-radius: 16px; color: #64748B; transition: all 0.3s; text-transform: uppercase;
}
.mode-btn.active { 
  background: #23283E; color: #00AFFF; 
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); 
}

/* Botões de Palpites - Imita Botões de Odds (Cotações) */
.palpites-grid { 
  display: grid; 
  grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); 
  gap: 8px; margin-top: 10px; 
}

.palpite-card { 
  background: #23283E; padding: 12px 4px; border-radius: 8px; 
  text-align: center; font-weight: 700; font-size: 15px; letter-spacing: 0.5px;
  color: #F8FAFC; border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer; transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center;
}
.palpite-card:hover {
  background: #2A3047;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Estado de Selecionado - Estilo Caderneta de Aposta (Bet Slip) */
.palpite-card.selected {
  background: #00AFFF !important;
  color: #000000 !important;
  border-color: #00AFFF !important;
  font-weight: 800;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 175, 255, 0.3);
}

/* Botão de Ação Principal (Copiar Palpites) */
.btn-copy {
  background: linear-gradient(135deg, #00AFFF 0%, #0066FF 100%); 
  color: #FFFFFF; border: none; padding: 16px; 
  font-size: 15px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase;
  border-radius: 12px; margin-top: 20px; width: 100%; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 175, 255, 0.3); transition: transform 0.2s, box-shadow 0.2s;
}
.btn-copy:active { transform: translateY(2px); box-shadow: 0 2px 10px rgba(0, 175, 255, 0.3); }

.selection-info {
  font-size: 11px; color: #94A3B8; text-align: center; margin-top: 16px; 
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}

.update-note {
  font-size: 11px; color: #64748B; text-align: center; margin-top: 14px; margin-bottom: 4px;
}

/* Blocos de Auditoria / Histórico de Acertos */
.auditoria-box {
  background: rgba(0, 175, 255, 0.03); border: 1px solid rgba(0, 175, 255, 0.15);
  padding: 12px; border-radius: 10px; margin-bottom: 16px;
}
.auditoria-box small {
  display: block; color: #94A3B8; font-weight: 700;
  margin-bottom: 8px; text-transform: uppercase; font-size: 10px; letter-spacing: 0.5px;
}

.auditoria-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.auditoria-cell {
  background: #00AFFF; border: none; padding: 4px 8px;
  border-radius: 6px; font-family: 'Inter', monospace; font-size: 13px;
  color: #000000; font-weight: 800; text-align: center; flex: 0 0 auto;
}

/* Toast de Confirmação (Alerta flutuante) */
#toast-container {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 10001; width: 90%; max-width: 380px; display: none;
}
.toast {
  background: #23283E; color: #F8FAFC; border-radius: 14px; padding: 20px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.5); border: 1px solid rgba(0, 175, 255, 0.3);
  position: relative; animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes slideDown { 
  from { transform: translateY(-30px); opacity: 0; } 
  to { transform: translateY(0); opacity: 1; } 
}
.toast-close {
  position: absolute; top: 12px; right: 15px; cursor: pointer;
  font-size: 22px; color: #64748B; line-height: 1; transition: color 0.2s;
}
.toast-close:hover { color: #FFFFFF; }
.toast-text { font-size: 14px; line-height: 1.5; margin-bottom: 12px; padding-right: 15px;}
.toast-link { 
  font-size: 13px; color: #00AFFF; font-weight: 700; text-decoration: none; 
  cursor: pointer; display: inline-block; transition: opacity 0.2s;
}
.toast-link:hover { opacity: 0.8; text-decoration: underline; }

/* Overlay de Vídeo */
#video-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(10, 12, 24, 0.95); backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center; z-index: 10002;
}
.video-container { 
  width: 95%; max-width: 800px; position: relative; 
  display: flex; flex-direction: column; align-items: center;
}
.video-wrapper { 
  position: relative; width: 100%; aspect-ratio: 16 / 9; 
  background: #000; border-radius: 12px; overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(0, 175, 255, 0.2);
}
.video-wrapper iframe { 
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
}
.video-close {
  position: absolute; top: -50px; right: 0; color: #FFFFFF;
  font-size: 40px; cursor: pointer; font-weight: 300;
  z-index: 10003; transition: color 0.2s;
}
.video-close:hover { color: #00AFFF; }

/* PWA Banner (App Install) */
#pwa-banner {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  width: 90%; max-width: 400px;
  background: #23283E;
  color: #FFFFFF; padding: 16px 20px; border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  z-index: 9998; display: none; flex-direction: column; gap: 12px;
  animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp {
  from { transform: translate(-50%, 100px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.pwa-text { font-size: 14px; line-height: 1.4; font-weight: 500; }
.pwa-buttons { display: flex; gap: 10px; }
.pwa-install-btn {
  flex: 2; background: #00AFFF; color: #000000; border: none;
  padding: 12px; border-radius: 10px; font-weight: 800; font-size: 13px;
  cursor: pointer; transition: transform 0.2s;
}
.pwa-install-btn:active { transform: scale(0.95); }
.pwa-later-btn {
  flex: 1; background: rgba(255, 255, 255, 0.05); color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.1); padding: 12px; border-radius: 10px;
  font-weight: 600; font-size: 13px; cursor: pointer; transition: background 0.2s;
}
.pwa-later-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* Banner Wrapper */
.banner-wrapper {
  position: relative; width: 100%; flex-shrink: 0;
}
.modal-banner {
  width: 100%; height: auto; display: block;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
.banner-close-btn {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
  background: rgba(10, 12, 24, 0.7); color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: bold; cursor: pointer; z-index: 15;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); transition: all 0.2s;
}
.banner-close-btn:hover { background: #00AFFF; color: #000; border-color: #00AFFF; transform: scale(1.1); }

/* Link Promocional Rodapé */
.promo-link {
  display: block; background-color: #11132A;
  border-top: 1px solid rgba(255,255,255,0.05); padding: 16px;
  font-size: 11px; color: #94A3B8; text-align: center;
  text-decoration: none; cursor: pointer; line-height: 1.5; flex-shrink: 0;
}
.promo-domain {
  display: block; font-weight: 800; color: #00AFFF;
  font-size: 13px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.promo-link strong {
  font-weight: 700; color: #F8FAFC;
}
.promo-link:hover, .promo-link:active, .promo-link:visited {
  text-decoration: none; color: #94A3B8;
}
