/* Game styles for Vocab English */

/* General Game Styles */
.games-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.game-card {
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.game-image {
  height: 180px;
  overflow: hidden;
}

.game-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.game-card:hover .game-image img {
  transform: scale(1.05);
}

.card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.game-info {
  margin-bottom: 1rem;
}

.game-info h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary-color);
}

.game-info p {
  color: #6b7280;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.game-difficulty {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}

.difficulty-dot {
  width: 10px;
  height: 10px;
  background-color: var(--primary-color);
  border-radius: 50%;
}


.play-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 0;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Section Header Styles */
.section-header {
  display: flex;
}

.section-header h2 {
  font-size: 2rem;
  color: var(--primary-color);
}

.section-subtitle {
  font-size: 1.3rem;
  color: #6b7280;
  max-width: 700px;
  margin: 0 auto;
}

/* Games Benefits Section */
.games-benefits {
  margin-top: 50px;
  padding: 30px;
  background-color: #f8f9fa;
  border-radius: 15px;
}

.games-benefits h3 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 25px;
  color: var(--primary-color);
}

.benefits-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.benefit-item {
  display: flex;
  align-items: flex-start;
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.benefit-item:hover {
  transform: translateY(-5px);
}

.benefit-icon {
  width: 50px;
  height: 50px;
  min-width: 50px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-right: 15px;
}

.benefit-info h4 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--primary-color);
}

.benefit-info p {
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Game Container Styles */
.game-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.game-header {
  text-align: center;
  margin-bottom: 20px;
}

.game-header h2 {
  font-size: 2rem;
  color: var(--primary-color);
}

/* Button Styles */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-warning {
  background-color: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background-color: #e0a800;
}

.btn-outline-secondary {
  background-color: transparent;
  border: 1px solid #6c757d;
  color: #6c757d;
}

.btn-outline-secondary:hover {
  background-color: #6c757d;
  color: white;
}

/* Stats and Controls */
.game-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 10px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.9rem;
  color: #6c757d;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

/* Games Section Main Container */
.games-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Word Match Game */
.word-match-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.match-card {
  background-color: white;
  border-radius: 10px;
  padding: 1.25rem;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
  user-select: none;
}

.match-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.match-card.selected {
  background-color: var(--primary-color);
  color: white;
}

.match-card.correct {
  background-color: var(--success-color);
  color: white;
}

.match-card.incorrect {
  background-color: var(--danger-color);
  color: white;
}

.match-card.hint {
  animation: hintPulse 1.5s ease;
  box-shadow: 0 0 15px var(--info-color);
}

@keyframes hintPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(13, 202, 240, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(13, 202, 240, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(13, 202, 240, 0);
  }
}

/* Word Scramble Game */
.scramble-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
}

.scramble-word {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 5px;
  margin-bottom: 2rem;
  color: var(--primary-color);
}

.scramble-input {
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.5rem;
}

.letter-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 1.5rem 0;
}

.letter-tile {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-radius: 8px;
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  user-select: none;
}

.letter-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.letter-tile.used {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Hangman Game */
.hangman-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
}

.hangman-drawing {
  width: 250px;
  height: 250px;
  margin-bottom: 2rem;
  position: relative;
}

.hangman-word {
  display: flex;
  gap: 10px;
  margin-bottom: 2rem;
  justify-content: center;
}

.hangman-letter {
  width: 40px;
  height: 50px;
  border-bottom: 3px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
}

.hangman-keyboard {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 600px;
}

.keyboard-key {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  user-select: none;
}

.keyboard-key:hover {
  background-color: var(--primary-color);
  color: white;
}

.keyboard-key.used {
  opacity: 0.5;
  cursor: not-allowed;
}

.keyboard-key.correct {
  background-color: var(--success-color);
  color: white;
}

.keyboard-key.incorrect {
  background-color: var(--danger-color);
  color: white;
}

/* Memory Game */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 20px 0;
}

.memory-card {
  height: 120px;
  background-color: var(--primary-color);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 500;
  color: white;
  transition: transform 0.3s ease;
  transform-style: preserve-3d;
  position: relative;
}

.memory-card .front,
.memory-card .back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.memory-card .front {
  background-color: white;
  color: var(--text-color);
  transform: rotateY(180deg);
}

.memory-card .back {
  background-color: var(--primary-color);
  font-size: 2rem;
}

.memory-card.flipped {
  transform: rotateY(180deg);
}

.memory-card.matched {
  background-color: var(--success-color);
}

/* Word Search Game */
.word-search-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
}

.word-search-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  margin-bottom: 2rem;
}

.word-search-cell {
  width: 35px;
  height: 35px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  background-color: white;
  transition: all 0.2s ease;
}

.word-search-cell:hover {
  background-color: #e5e7eb;
}

.word-search-cell.selected {
  background-color: var(--primary-color);
  color: white;
}

.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  max-width: 600px;
}

.word-item {
  padding: 8px 16px;
  border-radius: 20px;
  background-color: white;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.word-item.found {
  background-color: var(--success-color);
  color: white;
  text-decoration: line-through;
}

/* Game Results Modal */
.game-results {
  text-align: center;
}

.result-score {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.result-message {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.result-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 2rem;
}

.result-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
}

.stat-label {
  color: #6b7280;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

/* Game Timer */
.game-timer {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: white;
  border-radius: 20px;
  padding: 8px 15px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Game Controls */
.game-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

/* Game Instructions */
.game-instructions {
  background-color: #f3f4f6;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.game-instructions h4 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
}

.game-instructions ol,
.game-instructions ul {
  padding-left: 1.5rem;
}

.game-instructions li {
  margin-bottom: 0.5rem;
}

/* Speed Match Game */
.speed-match-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
  position: relative;
}

.current-word {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--primary-color);
}

.meaning-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin: 1.5rem 0;
  max-width: 600px;
}

.meaning-option {
  padding: 15px 25px;
  border-radius: 10px;
  background-color: white;
  border: 2px solid #e5e7eb;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.meaning-option:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.meaning-option.correct {
  background-color: var(--success-color);
  color: white;
  border-color: var(--success-color);
}

.meaning-option.incorrect {
  background-color: var(--danger-color);
  color: white;
  border-color: var(--danger-color);
}

/* Hint Section */
.hint-section {
  margin: 15px 0;
  padding: 10px 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  text-align: center;
}

.hint-label {
  font-weight: bold;
  color: var(--primary-color);
}

.hint-text {
  font-style: italic;
}

/* Words Completed Section */
.words-completed {
  margin-top: 20px;
  width: 100%;
  max-width: 600px;
  text-align: center;
}

.words-completed h4 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.completed-words {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* Category in Hangman */
.hangman-category {
  margin-bottom: 15px;
  text-align: center;
  font-style: italic;
  color: #6c757d;
}

/* Responsive Game Styles */
@media (max-width: 768px) {
  .games-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .word-match-container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .memory-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .word-search-grid {
    grid-template-columns: repeat(8, 1fr);
  }
  
  .word-search-cell {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  
  .benefits-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 576px) {
  .memory-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .word-search-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .word-search-cell {
    width: 25px;
    height: 25px;
    font-size: 0.8rem;
  }
  
  .scramble-word {
    font-size: 2rem;
  }
  
  .letter-tile {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  .game-controls {
    flex-wrap: wrap;
  }
  
  .benefit-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .benefit-icon {
    margin-right: 0;
    margin-bottom: 15px;
  }
}
