/* Game Modal Styles */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
  border-radius: 12px 12px 0 0;
}

.modal-header h2 {
  margin: 0;
  color: #333;
  font-family: 'Playfair Display', serif;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.close-btn:hover {
  background: #e9ecef;
  color: #333;
}

.modal-body {
  padding: 2rem;
}

/* Game Interface Styles */
.game-interface {
  text-align: center;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.game-header > div {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Flashcards Game Styles */
.flashcard-display {
  background: linear-gradient(135deg, var(--accent-color), #479c87);
  color: white;
  padding: 3rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.word-display {
  font-size: 2.5rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  margin-bottom: 1rem;
}

.timer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.8);
  width: 100%;
  transition: width 5s linear;
}

.answer-input {
  margin-bottom: 2rem;
}

.answer-input input {
  padding: 1rem;
  font-size: 1.2rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  width: 200px;
  margin-right: 1rem;
  text-align: center;
}

.answer-input button {
  padding: 1rem 2rem;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.answer-input button:hover {
  background: #479c87;
}

/* Memory Game Styles */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 2rem 0;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.memory-card {
  aspect-ratio: 1;
  position: relative;
  cursor: pointer;
  perspective: 1000px;
}

.memory-card .card-front,
.memory-card .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.2rem;
  transition: transform 0.6s;
  border: 2px solid #ddd;
}

.memory-card .card-front {
  background: var(--accent-color);
  color: white;
  transform: rotateY(0deg);
}

.memory-card .card-back {
  background: white;
  color: #333;
  transform: rotateY(-180deg);
}

.memory-card.flipped .card-front {
  transform: rotateY(180deg);
}

.memory-card.flipped .card-back {
  transform: rotateY(0deg);
}

.memory-card.matched .card-front,
.memory-card.matched .card-back {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

/* Speed Challenge Styles */
.speed-challenge {
  margin: 2rem 0;
}

.speed-challenge .word-display {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px solid #e9ecef;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.option-btn {
  padding: 1rem;
  background: white;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.option-btn:hover {
  background: var(--accent-color);
  color: white;
}

/* Game Results */
.game-result {
  margin: 2rem 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.game-result h3 {
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 1rem;
  }
  
  .memory-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 300px;
  }
  
  .options {
    grid-template-columns: 1fr;
  }
  
  .word-display {
    font-size: 2rem !important;
  }
  
  .game-header {
    flex-direction: column;
    gap: 0.5rem;
  }
}