/* Responsividade do footer */
@media (max-width: 600px) {
  footer .flex-shrink-0 {
    display: none !important;
  }
  footer .text-left {
    font-size: 0.8rem;
  }
}

/* CSS para garantir que o header fique fixo sem movimentos */
header {
  transform: none !important;
  position: sticky !important;
  top: 0 !important;
  will-change: auto !important;
}

@import url('https://fonts.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

body {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  background: linear-gradient(to bottom right, #312e81, #581c87, #0f172a);
  color: #fff;
  min-height: 100vh;
  display: flex; /* ← Nova linha */
  flex-direction: column; /* ← Nova linha */
}

.player-header {
  text-align: center;
  margin-bottom: 5px;
  padding: 10px 0 0 0;
}

.player-header h1 {
  font-size: 2rem;
  /* margin-bottom: 5px; */
  color: #fff;
}

.player-header p {
  color: #a78bfa;
  margin: 0;
}

.game-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-wrapper {
  width: 100%;
  max-width: 800px;
  position: relative;
  margin-bottom: 15px;
  aspect-ratio: 16 / 9;
  min-height: 320px; /* fallback para navegadores que não suportam aspect-ratio */
}

iframe {
  width: 100%;
  height: 100%;
  min-height: 240px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: block;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  /* margin-top: 5px; */
}

.control-button {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  transition: background 0.2s;
}

.control-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

#game-description {
  max-width: 800px;
  text-align: justify;
  margin-top: 5px;
  font-size: 1rem;
  line-height: 1.5;
  color: #ddd;
}

.game-layout {
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  gap: 20px;
  margin-bottom: 20px;
}

/* Estilos para conteúdo editorial */
.game-info {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 10px;
}

.section-title {
  color: #fff;
  font-size: 1.05rem;
  margin: 6px 0 8px 0;
  padding-left: 10px;
  border-left: 4px solid #9f7aea;
}

.game-desc {
  color: #ddd;
  margin: 6px 0 0 0;
  line-height: 1.5;
}

.game-info ul {
  margin: 6px 0 0 20px;
  color: #ddd;
}

.game-info ul li { margin-bottom: 6px; }

.game-info ul li::marker { color: #c7b8ff; }

.meta p { color: #ddd; }

.meta .badge {
  display: inline-block;
  background: rgba(159,122,234,0.12);
  color: #e9d8ff;
  padding: 4px 8px;
  border-radius: 999px;
  margin-left: 8px;
  font-size: 0.95rem;
}

a.game-link { color: #9f7aea; text-decoration: underline; }

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Propaganda no topo */
.top-ad {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 10;
}

.ad-banner {
  width: 728px;
  height: 90px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-layout {
  padding: 2rem 0;
  position: relative;
  flex: 1; /* ← Expandir para ocupar espaço disponível */
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  gap: 2rem;
  width: 100%;
  position: relative;
  flex: 1; /* ← Expandir conteúdo */
}

footer {
  margin-top: auto; /* ← Empurra para o final */
  width: 100%;
}

/* Anúncios laterais */
.left-ad, .right-ad {
  position: sticky;
  top: 100px;
  height: fit-content;
  z-index: 20;
}

.ad-box {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 600px;
  width: 160px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  margin: 0 auto;
}

/* Ajuste específico para a propaganda esquerda */
.left-ad .ad-box {
  margin-left: 0;
  margin-right: auto;
}

/* Ajuste específico para a propaganda direita */
.right-ad .ad-box {
  margin-left: auto;
  margin-right: 0;
}

/* Conteúdo principal */
.main-content {
  width: 100%;
  position: relative;
  z-index: 5;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* Estilização do grid de jogos */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
  width: 100%;
  height: auto;
  margin: 0 auto;
  max-width: 1000px;
  padding: 0 0.5rem;
  box-sizing: border-box;
}

.game-card {
  background: #1f2937;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
  position: relative;
  cursor: pointer;
}

.loading-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 0.5rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid #a78bfa;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

.loading-indicator p {
  color: white;
  margin: 0;
  font-size: 0.9rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.game-card:hover {
  transform: scale(1.03);
}

/* Melhorar interações touch para dispositivos móveis */
@media (hover: none) and (pointer: coarse) {
  /* .game-card:hover {
    transform: none;
  } */
  
  .game-card:active {
    transform: scale(0.98);
    transition: transform 0.1s;
  }
  
  .game-card:hover .overlay {
    opacity: 1;
  }
}

.game-card img {
  width: 100%;
  height: 200px;
  /* object-fit: cover; */
  transition: transform 0.3s;
  max-width: 100%;
  display: block;
}

.game-card:hover img {
  transform: scale(1.1);
}

.game-card .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.game-card:hover .overlay {
  opacity: 1;
}

.game-card .content {
  padding: 0.75rem;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.game-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card p {
  font-size: 0.75rem;
  color: #a78bfa;
  margin: 0.25rem 0 0 0;
}

/* Responsividade */
@media (max-width: 1200px) and (min-width: 769px) {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
  }
  
  .game-card img {
    height: 180px;
  }
}

@media (max-width: 1200px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Ajuste equivalente para a página/player embutido que usa .game-layout */
  .game-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .ad-sidebar, .left-ad, .right-ad {
    display: none;
  }
  
  .top-ad {
    padding: 0.5rem 0;
  }
  
  .ad-banner {
    width: 100%;
    max-width: 728px;
    height: 90px;
  }
  
  .main-content {
    padding: 0 1rem;
  }
  
  .content-wrapper::before,
  .content-wrapper::after {
    display: none;
  }
  
  .game-grid {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    padding: 0 0.5rem;
  }
  
  .game-card img {
    height: 140px;
    /* object-fit: cover; */
  }
  
  .game-card h3 {
    font-size: 0.95rem;
  }
  
  .game-card p {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0;
  }

  .main-content {
    padding: 0 0.5rem;
  }
  
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    padding: 0 0.25rem;
  }
  
  .game-card {
    border-radius: 0.75rem;
  }
  
  .game-card img {
    height: 120px;
    /* object-fit: cover; */
  }
  
  .game-card .content {
    padding: 0.5rem;
  }
  
  .game-card h3 {
    font-size: 0.85rem;
    line-height: 1.2;
    margin-bottom: 0.15rem;
  }
  
  .game-card p {
    font-size: 0.7rem;
    margin: 0;
  }
  
  .top-ad {
    padding: 0.5rem;
  }
  
  .ad-banner {
    height: 70px;
    font-size: 0.8rem;
  }

  /* Tornar o player mais compacto em telas pequenas */
  .game-wrapper {
    aspect-ratio: 4 / 3;
    min-height: 220px;
  }

  iframe { min-height: 200px; }
}

/* Dispositivos muito pequenos (menos de 360px) */
@media (max-width: 360px) {
  .main-content {
    padding: 0 0.25rem;
  }
  
  .game-grid {
    gap: 0.5rem;
    padding: 0;
  }
  
  .game-card img {
    height: 100px;
  }
  
  .game-card .content {
    padding: 0.4rem;
  }
  
  .game-card h3 {
    font-size: 0.8rem;
  }
  
  .game-card p {
    font-size: 0.65rem;
  }
  
  .game-wrapper {
    min-height: 180px;
  }
  
  iframe { 
    min-height: 160px;
  }
}