/* Game History Component Styles */
.gameHistory {
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.gameHistoryHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.gameHistoryHeader h3 {
  color: white;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.totalGames {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* Loading States */
.gameHistoryLoading,
.gameHistoryEmpty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.loadingSpinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.gameHistoryLoading p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.emptyState {
  color: rgba(255, 255, 255, 0.6);
}

.emptyIcon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.emptyState h3 {
  color: white;
  margin: 0 0 8px 0;
  font-size: 1.2rem;
}

.emptyState p {
  margin: 0;
  font-size: 0.9rem;
}

/* Games List */
.gamesList {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.gameItem {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  max-width: 800px;
  min-width: 400px;
  margin: 0 auto;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.gameItem::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4CAF50, #2196F3, #9C27B0, #FF5722);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.gameItem:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

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

.gameType {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gameTypeIcon {
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.gameTypeLabel {
  color: white;
  font-weight: 600;
  font-size: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.gameDate {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

/* Game Stats */
.gameStats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.statItem {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.statLabel {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.statValue {
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.statPercentage {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  font-size: 0.9rem;
  margin-left: 4px;
}

/* Game Details */
.gameDetails {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.detailItem {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detailLabel {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detailValue {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  font-weight: 500;
}

.gameArrow {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.4rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.gameItem:hover .gameArrow {
  transform: translateY(-50%) translateX(8px) scale(1.2);
  color: rgba(255, 255, 255, 0.9);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
}

.paginationBtn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.paginationBtn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.paginationBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.paginationInfo {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  margin: 0 8px;
}

/* Historical Game View */
.historicalGameView {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  opacity: 1;
  transform: scale(1);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.historicalGameView.entering {
  animation: fadeInGameView 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  opacity: 0;
  transform: scale(0.95);
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
}

.historicalGameView.exiting {
  opacity: 0;
  transform: scale(0.95);
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
}

@keyframes fadeInGameView {
  0% {
    opacity: 0;
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
  }
  50% {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
  }
}

.historicalGameHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.backButtonHeader,
.backButton {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.backButtonHeader:hover,
.backButton:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.gameInfoHeader {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.gameInfoHeader .gameType {
  color: white;
  font-weight: 500;
}

.gameInfoHeader .gameDate {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

/* Loading and Error States for Historical View */
.historicalGameLoading,
.historicalGameError {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 400px;
  padding: 40px;
}

.loadingContainer,
.errorContainer {
  text-align: center;
  color: white;
}

.loadingContainer h3,
.errorContainer h3 {
  margin: 16px 0 8px 0;
  font-size: 1.2rem;
}

.loadingContainer p,
.errorContainer p {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .gameHistory {
    padding: 16px;
  }

  .gameItem {
    padding: 16px;
    min-width: unset;
    max-width: 100%;
    width: 100%;
  }

  .gameStats {
    grid-template-columns: repeat(2, 1fr);
  }

  .gameDetails {
    grid-template-columns: repeat(2, 1fr);
  }

  .gameHeader {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .historicalGameHeader {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .gameInfoHeader {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .gameHistory {
    padding: 12px;
  }

  .gameItem {
    padding: 16px;
    min-width: unset;
    max-width: 100%;
    width: 100%;
  }

  .gameStats {
    grid-template-columns: 1fr;
  }

  .gameDetails {
    grid-template-columns: 1fr;
  }

  .pagination {
    flex-direction: column;
    gap: 12px;
  }

  .paginationInfo {
    order: -1;
  }
}