/* Games listing styles */
body {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #dbeafe 100%);
  background-attachment: fixed;
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.games-container {
  max-width: 1200px;
  margin: 48px auto;
  padding: 40px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
  position: relative;
  z-index: 1;
}

.games-container h1 {
  margin-bottom: 12px;
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.games-container .lead {
  color: #475569;
  margin-bottom: 32px;
  font-size: 1.1rem;
  line-height: 1.6;
}

.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.tab {
  padding: 12px 24px;
  border-radius: 12px;
  border: 2px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.8);
  color: #475569;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tab:hover::before {
  opacity: 1;
}

.tab:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.5);
  color: #3b82f6;
}

.tab.active {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(96, 165, 250, 0.4);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.game-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  text-decoration: none;
  color: #0f172a;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.game-card:hover::before {
  opacity: 1;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

.thumb {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e293b, #334155);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.snake-thumb {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 3px solid rgba(16, 185, 129, 0.3);
}

.snake-thumb::before {
  content: '🐍';
}

.rps-thumb {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: 3px solid rgba(245, 158, 11, 0.3);
}

.rps-thumb::before {
  content: '✊';
}

.meta {
  flex: 1;
  position: relative;
  z-index: 1;
}

.meta h3 {
  margin: 0 0 8px 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
}

.meta p {
  margin: 0;
  color: #475569;
  line-height: 1.5;
  font-size: 0.95rem;
}

.note {
  text-align: center;
  color: #64748b;
  font-style: italic;
  margin-top: 40px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
}

.game-card.hidden{display:none}

/* modal for embedded game */
.game-modal {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 10010;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.game-modal.show {
  opacity: 1;
  pointer-events: auto;
}

.game-modal-inner {
  width: 90vw;
  height: 90vh;
  max-width: 1400px;
  max-height: 900px;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.game-close {
  position: absolute;
  right: 16px;
  top: 16px;
  background: rgba(239, 68, 68, 0.9);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 10px;
  transition: all 0.3s ease;
  z-index: 10;
  font-weight: bold;
}

.game-close:hover {
  background: rgba(239, 68, 68, 1);
  transform: scale(1.1);
}

.game-modal iframe {
  flex: 1;
  border-radius: 12px;
  margin: 24px;
  width: calc(100% - 48px);
  height: calc(100% - 96px);
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.game-actions {
  padding: 16px 24px;
  text-align: right;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0 0 20px 20px;
}

.game-actions a {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: inline-block;
}

.game-actions a:hover {
  background: rgba(96, 165, 250, 0.1);
  color: #93c5fd;
}

/* Home button styling */
#home-button {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 1000;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  color: #475569;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#home-button:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateX(-4px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

/* Responsive design */
@media (max-width: 768px) {
  .games-container {
    margin: 24px 16px;
    padding: 24px;
  }

  .games-container h1 {
    font-size: 2rem;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .game-card {
    padding: 16px;
  }

  .thumb {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }

  .meta h3 {
    font-size: 1.1rem;
  }

  .meta p {
    font-size: 0.9rem;
  }

  #home-button {
    top: 16px;
    left: 16px;
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .game-modal-inner {
    width: 95vw;
    height: 95vh;
  }

  .game-modal iframe {
    margin: 16px;
    width: calc(100% - 32px);
    height: calc(100% - 64px);
  }
}
