/**
 * Similar Games Section Styles
 * For embedded games showcase on homepage
 */

/* ===================================
   SIMILAR GAMES SECTION
   =================================== */
.similar-games {
  padding: var(--space-12) 0;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.05) 0%,
    rgba(236, 72, 153, 0.05) 100%
  );
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
  max-width: 1200px;
  margin: 0 auto;
}

/* Global Game Player */
.global-game-player {
  display: none;
  width: 100%;
  margin-bottom: var(--space-8);
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: slideDown 0.4s ease;
}

.global-game-player.active {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
}

.game-player-header h3 {
  margin: 0;
  font-size: var(--font-size-xl);
}

.btn-close-global-game {
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-close-global-game:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.global-game-container {
  width: 100%;
  height: 600px;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.global-game-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Game Card */
.game-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

/* Game Thumbnail */
.game-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.game-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.game-card:hover .game-thumbnail img {
  transform: scale(1.1);
}

/* Play Overlay */
.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-card:hover .play-overlay {
  opacity: 1;
}

.play-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.95);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.game-card:hover .play-icon {
  transform: scale(1.2);
}

/* Game Info */
.game-info {
  padding: var(--space-4);
}

.game-info h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
  color: var(--color-text-primary);
}

.game-info p {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-4) 0;
  line-height: 1.4;
}

.btn-play {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-play:active {
  transform: translateY(0);
}


/* Loading Spinner */
.game-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 4px solid rgba(139, 92, 246, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Tablet */
@media (max-width: 768px) {
  .games-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .global-game-container {
    height: 500px;
  }
  
  .game-player-header {
    padding: var(--space-3) var(--space-4);
  }
  
  .game-player-header h3 {
    font-size: var(--font-size-lg);
  }
}

/* Mobile */
@media (max-width: 480px) {
  .similar-games {
    padding: var(--space-8) 0;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .global-game-container {
    height: 400px;
  }
  
  .play-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  
  .btn-close-global-game {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
  }
  
  .game-player-header h3 {
    font-size: var(--font-size-base);
  }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .global-game-container {
    height: 70vh;
  }
}

