/* Global reset and base theme */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

html, body {
  height: 100%;
  font-family: Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  background-color: #203B8C;
  color: white;
}

/* Full viewport screens */
.screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.screen.active {
  display: flex;
}

/* Header styling */
/* Update the header styling to justify content differently */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: rgba(0, 0, 0, 0.2);
  flex-direction: row; /* Ensure flex direction is row */
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Align to the right */
}

.header-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Align to the left */
}

.logo-image {
  height: 40px;
  width: auto;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-back {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s, transform 0.2s;
}

.btn-back:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.btn-back svg {
  width: 24px;
  height: 24px;
}

/* Content container */
.content-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #2d79f3 #1C2F6E;
}

.page-title {
  text-align: center;
  margin-bottom: 30px;
  font-size: 28px;
  color: #ffcc00;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Games container */
.games-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* Game card */
.game-card {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 15px;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.3s;
  position: relative;
}

.game-card:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
}

.game-date {
  font-size: 14px;
  color: #ffcc00;
  margin-bottom: 10px;
}

.game-id {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.copy-id-btn {
  background: none;
  border: none;
  color: #ffcc00;
  cursor: pointer;
  padding: 3px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-id-btn svg {
  width: 16px;
  height: 16px;
}

.copy-id-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-tag {
  background-color: rgba(255, 204, 0, 0.2);
  color: #ffcc00;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 14px;
}

/* Loading spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffcc00;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* No games message */
.no-games-message {
  text-align: center;
  padding: 40px 0;
}

.create-game-btn {
  background-color: #ffcc00;
  color: #203B8C;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
  transition: background-color 0.3s, transform 0.2s;
}

.create-game-btn:hover {
  background-color: #ffd633;
  transform: translateY(-2px);
}

/* Copy toast notification */
.copy-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #ffcc00;
  color: #203B8C;
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 1000;
}

.copy-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.hidden {
  display: none;
}

/* Responsive styles */
@media (max-width: 600px) {
  .page-title {
    font-size: 24px;
    margin-bottom: 20px;
  }
  
  .game-card {
    padding: 12px;
  }
  
  .categories-list {
    gap: 8px;
  }
  
  .category-tag {
    font-size: 12px;
    padding: 4px 8px;
  }
}

@media (max-width: 400px) {
  .header-container {
    padding: 10px 15px;
  }
  
  .logo-image {
    height: 30px;
  }
  
  .btn-back {
    width: 36px;
    height: 36px;
  }
  
  .btn-back svg {
    width: 20px;
    height: 20px;
  }
  
  .content-container {
    padding: 15px;
  }
}

.play-count {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.play-count-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .play-count {
    font-size: 0.8rem;
  }
  
  .play-count-spinner {
    width: 14px;
    height: 14px;
  }
}