/* YalaBobo Games System Styles */
/* نظام الألعاب الجماعية الاحترافي */

:root {
  --game-primary: #6C5CE7;
  --game-secondary: #00CEC9;
  --game-accent: #FD79A8;
  --game-success: #00B894;
  --game-warning: #FDCA50;
  --game-error: #FF7675;
  --game-dark: #2D3436;
  --game-light: #DFE6E9;
  --game-gradient: linear-gradient(135deg, #6C5CE7 0%, #00CEC9 100%);
}

/* ========================================== */
/* Games Hub Section */
/* ========================================== */
.games-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px;
}

.games-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: rgba(45, 52, 54, 0.3);
  border-radius: 16px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.games-hub-title {
  font-size: 24px;
  font-weight: bold;
  color: white;
  font-family: var(--font-tajawal);
}

.games-stats-summary {
  display: flex;
  gap: 20px;
}

.stat-badge {
  background: rgba(108, 92, 231, 0.2);
  border: 1px solid rgba(108, 92, 231, 0.5);
  border-radius: 12px;
  padding: 8px 16px;
  color: white;
  font-family: var(--font-tajawal);
}

.stat-value {
  font-size: 20px;
  font-weight: bold;
  color: var(--game-secondary);
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* ========================================== */
/* Game Card Component */
/* ========================================== */
.game-card {
  background: rgba(45, 52, 54, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.game-card:hover {
  transform: translateY(-5px);
  border-color: var(--game-primary);
  box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
}

.game-card.featured {
  border: 2px solid var(--game-accent);
  background: rgba(108, 92, 231, 0.3);
}

.game-card.featured::before {
  content: '⭐ مميز';
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--game-accent);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  font-family: var(--font-tajawal);
}

.game-thumbnail {
  width: 100%;
  height: 160px;
  background: var(--game-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.game-icon {
  font-size: 64px;
  opacity: 0.8;
}

.game-category-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-family: var(--font-tajawal);
}

.game-info {
  padding: 20px;
}

.game-title {
  font-size: 20px;
  font-weight: bold;
  color: white;
  margin-bottom: 8px;
  font-family: var(--font-tajawal);
}

.game-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 12px;
  line-height: 1.5;
  font-family: var(--font-tajawal);
}

.game-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.game-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-tajawal);
}

.game-difficulty {
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: bold;
}

.game-difficulty.easy {
  background: rgba(0, 184, 148, 0.2);
  color: var(--game-success);
}

.game-difficulty.medium {
  background: rgba(253, 202, 80, 0.2);
  color: var(--game-warning);
}

.game-difficulty.hard {
  background: rgba(255, 118, 117, 0.2);
  color: var(--game-error);
}

.game-play-button {
  width: 100%;
  padding: 12px;
  background: var(--game-gradient);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.3s;
  font-family: var(--font-tajawal);
}

.game-play-button:hover {
  transform: scale(1.02);
  box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

/* ========================================== */
/* Game Board Interface */
/* ========================================== */
.game-board-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(45, 52, 54, 0.4);
  border-radius: 16px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.game-info-panel {
  display: flex;
  align-items: center;
  gap: 16px;
}

.game-player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(108, 92, 231, 0.2);
  padding: 8px 16px;
  border-radius: 12px;
}

.player-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--game-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.player-name {
  font-size: 14px;
  color: white;
  font-weight: bold;
  font-family: var(--font-tajawal);
}

.player-score {
  font-size: 18px;
  color: var(--game-secondary);
  font-weight: bold;
}

.game-timer {
  font-size: 24px;
  color: var(--game-accent);
  font-weight: bold;
  font-family: monospace;
}

.game-status {
  display: flex;
  gap: 12px;
}

.game-turn-indicator {
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: bold;
  font-family: var(--font-tajawal);
}

.game-turn-indicator.active {
  background: var(--game-success);
  color: white;
  animation: pulse 2s infinite;
}

.game-turn-indicator.inactive {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.game-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.game-controls {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(45, 52, 54, 0.4);
  border-radius: 16px;
  margin-top: 20px;
  backdrop-filter: blur(10px);
}

.game-control-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-tajawal);
}

.game-control-btn.primary {
  background: var(--game-primary);
  color: white;
}

.game-control-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.game-control-btn.danger {
  background: var(--game-error);
  color: white;
}

.game-control-btn:hover {
  transform: scale(1.02);
}

/* ========================================== */
/* Tic Tac Toe Specific Styles */
/* ========================================== */
.tictactoe-board {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 16px;
}

.tictactoe-cell {
  width: 100px;
  height: 100px;
  background: rgba(45, 52, 54, 0.6);
  border: none;
  border-radius: 12px;
  font-size: 48px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tictactoe-cell:hover:not(.disabled) {
  background: rgba(108, 92, 231, 0.3);
  transform: scale(1.05);
}

.tictactoe-cell.disabled {
  cursor: not-allowed;
}

.tictactoe-cell.x {
  color: var(--game-primary);
}

.tictactoe-cell.o {
  color: var(--game-secondary);
}

.tictactoe-cell.winner {
  background: var(--game-success);
  animation: winner-cell 0.5s ease;
}

@keyframes winner-cell {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ========================================== */
/* Number Guess Game Styles */
/* ========================================== */
.number-guess-container {
  text-align: center;
  padding: 40px;
}

.number-range-display {
  font-size: 24px;
  color: white;
  margin-bottom: 20px;
  font-family: var(--font-tajawal);
}

.guess-input-container {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.guess-input {
  flex: 1;
  padding: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(45, 52, 54, 0.6);
  color: white;
  font-size: 24px;
  text-align: center;
  font-family: monospace;
}

.guess-input:focus {
  outline: none;
  border-color: var(--game-primary);
}

.guess-submit-btn {
  padding: 16px 32px;
  background: var(--game-primary);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  font-family: var(--font-tajawal);
}

.guess-history {
  margin-top: 30px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.guess-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(45, 52, 54, 0.4);
  border-radius: 8px;
  margin-bottom: 8px;
  font-family: var(--font-tajawal);
}

.guess-value {
  font-size: 20px;
  font-weight: bold;
  color: white;
}

.guess-hint {
  font-size: 14px;
  color: var(--game-secondary);
}

.hint-higher {
  color: var(--game-success);
}

.hint-lower {
  color: var(--game-error);
}

.hint-correct {
  color: var(--game-accent);
  font-weight: bold;
}

/* ========================================== */
/* Quick Quiz Game Styles */
/* ========================================== */
.quiz-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.question-card {
  background: rgba(45, 52, 54, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.question-text {
  font-size: 20px;
  color: white;
  margin-bottom: 24px;
  line-height: 1.6;
  font-family: var(--font-tajawal);
}

.question-timer {
  font-size: 48px;
  font-weight: bold;
  color: var(--game-accent);
  text-align: center;
  margin-bottom: 20px;
  font-family: monospace;
}

.question-timer.warning {
  color: var(--game-error);
  animation: pulse 1s infinite;
}

.answers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.answer-button {
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-tajawal);
  text-align: center;
}

.answer-button:hover {
  background: rgba(108, 92, 231, 0.3);
  border-color: var(--game-primary);
  transform: translateY(-2px);
}

.answer-button.correct {
  background: var(--game-success);
  border-color: var(--game-success);
}

.answer-button.incorrect {
  background: var(--game-error);
  border-color: var(--game-error);
}

.answer-button.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.quiz-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(45, 52, 54, 0.4);
  border-radius: 12px;
  margin-bottom: 20px;
}

.quiz-progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin: 0 16px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--game-gradient);
  border-radius: 4px;
  transition: width 0.3s;
}

.quiz-score {
  font-size: 18px;
  color: var(--game-secondary);
  font-weight: bold;
  font-family: var(--font-tajawal);
}

/* ========================================== */
/* Challenges Panel */
/* ========================================== */
.challenges-panel {
  background: rgba(45, 52, 54, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.challenges-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.challenges-title {
  font-size: 18px;
  color: white;
  font-weight: bold;
  font-family: var(--font-tajawal);
}

.challenges-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.challenge-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.challenge-info {
  flex: 1;
}

.challenge-game-name {
  font-size: 16px;
  color: white;
  font-weight: bold;
  margin-bottom: 4px;
  font-family: var(--font-tajawal);
}

.challenge-opponent {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-tajawal);
}

.challenge-actions {
  display: flex;
  gap: 8px;
}

.challenge-action-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-tajawal);
}

.challenge-action-btn.accept {
  background: var(--game-success);
  color: white;
}

.challenge-action-btn.reject {
  background: var(--game-error);
  color: white;
}

.challenge-action-btn.view {
  background: var(--game-primary);
  color: white;
}

/* ========================================== */
/* Leaderboard Styles */
/* ========================================== */
.leaderboard-container {
  background: rgba(45, 52, 54, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.leaderboard-title {
  font-size: 18px;
  color: white;
  font-weight: bold;
  font-family: var(--font-tajawal);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: all 0.3s;
}

.leaderboard-item:hover {
  background: rgba(108, 92, 231, 0.2);
}

.leaderboard-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
}

.leaderboard-rank.gold {
  background: linear-gradient(135deg, #FFD700, #FFA500);
}

.leaderboard-rank.silver {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
}

.leaderboard-rank.bronze {
  background: linear-gradient(135deg, #CD7F32, #A0522D);
}

.leaderboard-rank.normal {
  background: rgba(255, 255, 255, 0.2);
}

.leaderboard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.leaderboard-info {
  flex: 1;
}

.leaderboard-name {
  font-size: 14px;
  color: white;
  font-weight: bold;
  font-family: var(--font-tajawal);
}

.leaderboard-score {
  font-size: 18px;
  color: var(--game-secondary);
  font-weight: bold;
}

/* ========================================== */
/* Responsive Design */
/* ========================================== */
@media (max-width: 768px) {
  .games-hub {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  
  .games-hub-header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .games-stats-summary {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .tictactoe-board {
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
  }
  
  .tictactoe-cell {
    width: 80px;
    height: 80px;
    font-size: 36px;
  }
  
  .answers-grid {
    grid-template-columns: 1fr;
  }
  
  .game-controls {
    flex-direction: column;
  }
  
  .challenge-card {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .challenge-actions {
    width: 100%;
    justify-content: center;
  }
}