/* Main Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
  color: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background-color: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 1rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s;
}

nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

.hero {
  text-align: center;
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0.9;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.game-card {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.game-img {
  width: 100%;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.game-content {
  padding: 1rem;
}

.game-content h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.game-content p {
  opacity: 0.8;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.btn {
  display: inline-block;
  background-color: #4CAF50;
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: #45a049;
}

footer {
  background-color: rgba(0, 0, 0, 0.2);
  text-align: center;
  padding: 1rem;
  margin-top: 3rem;
}

/* Game Screens */
.game-screen {
  display: none;
}

.game-screen h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.game-container {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: 8px;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.controls button,
.controls select {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  background-color: #4CAF50;
  color: white;
  cursor: pointer;
}

.controls select {
  background-color: #2980b9;
}

/* Word Puzzle */
#word-puzzle-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  margin: 0 auto;
  max-width: 500px;
}

.word-cell {
  background-color: white;
  color: #333;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  position: relative;
  cursor: pointer;
  border-radius: 2px;
}

.word-cell span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
}

.word-cell.highlighted {
  background-color: #ffeb3b;
}

.word-cell.found {
  background-color: #81c784;
}

#word-puzzle-words {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
}

.word-item {
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.word-item.found {
  text-decoration: line-through;
  opacity: 0.6;
}

#word-puzzle-score {
  text-align: center;
  margin-top: 2rem;
  font-size: 1.2rem;
}

/* Tic-Tac-Toe */
#tic-tac-toe-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  max-width: 300px;
  margin: 0 auto;
}

.tic-cell {
  background-color: white;
  color: #333;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  position: relative;
  cursor: pointer;
  border-radius: 2px;
}

.tic-cell span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: bold;
}

#tic-tac-toe-status {
  text-align: center;
  margin-top: 2rem;
  font-size: 1.2rem;
}

/* Bollywood Quiz */
#bollywood-quiz-question {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  text-align: center;
  font-size: 1.2rem;
}

#bollywood-quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.quiz-option {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.quiz-option:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.quiz-option.correct {
  background-color: #4CAF50;
}

.quiz-option.incorrect {
  background-color: #e74c3c;
}

#bollywood-quiz-score {
  text-align: center;
  margin-top: 2rem;
  font-size: 1.2rem;
}

/* Learn English */
#english-question-container {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

#english-question {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

#english-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

#english-explanation {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  display: none;
}

#english-score {
  text-align: center;
  margin-top: 2rem;
  font-size: 1.2rem;
}

/* Leaderboard */
#leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

#leaderboard-table th,
#leaderboard-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#leaderboard-table th {
  background-color: rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
  }
  
  nav ul {
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  nav ul li {
    margin: 0.5rem;
  }
  
  .controls {
    flex-direction: column;
    align-items: center;
  }
}

/* Visual helper classes */
.selected {
  background-color: #3498db !important;
  color: white !important;
}

.hidden {
  display: none;
}

.visible {
  display: block;
}