/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  -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;
}

body {
  background-color: #203B8C;
  color: white;
  min-height: 100vh;
  padding-top: 70px; /* Add padding to body to account for fixed header */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  touch-action: manipulation;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 70px); /* Adjust container height */
}

/* Update header styles to match recent_games exactly */
.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;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  width: 100%;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 40px;
}

.logo-image {
  height: 40px;
  width: auto;
}

.header-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  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: all 0.3s ease;
}

.btn-back:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.btn-back i {
  font-size: 20px;
}

/* Add padding to main content to account for fixed header */
.main-content {
  padding-top: 80px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2d79f3 #1C2F6E;
}

/* Per supportare anche browser basati su WebKit (Chrome, Safari, ecc.) */
.main-content::-webkit-scrollbar {
  width: 8px;
}

.main-content::-webkit-scrollbar-track {
  background: #1C2F6E;
}

.main-content::-webkit-scrollbar-thumb {
  background-color: #2d79f3;
  border-radius: 4px;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .header-container {
    padding: 10px 15px;
  }
  
  .logo-image {
    height: 35px;
  }
  
  .main-content {
    padding-top: 70px;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 8px 12px;
  }
  
  .logo-image {
    height: 30px;
  }
  
  .btn-back {
    width: 35px;
    height: 35px;
  }
  
  .btn-back i {
    font-size: 18px;
  }
  
  .main-content {
    padding-top: 60px;
  }
}
.header-btn {
background-color: #1C2F6E;
color: white;
border: none;
border-radius: 50%;
width: 40px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
transition: background-color 0.3s;
}

.header-btn:hover {
background-color: #2d79f3;
}

/* Main content styles */
.main-content {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px 0;
}

.page-title {
font-size: 32px;
margin-bottom: 30px;
text-align: center;
}

.join-game-container {
background-color: #1C2F6E;
border-radius: 10px;
padding: 30px;
width: 100%;
max-width: 600px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.input-container {
display: flex;
flex-direction: column;
gap: 15px;
margin-bottom: 30px;
}

.input-container label {
font-size: 18px;
}

.input-container input {
padding: 12px 15px;
border-radius: 5px;
border: 1px solid #2d79f3;
background-color: rgba(255, 255, 255, 0.1);
color: white;
font-size: 16px;
}

.input-container input::placeholder {
color: rgba(255, 255, 255, 0.5);
}

.btn-primary {
background-color: #2d79f3;
color: white;
border: none;
border-radius: 5px;
padding: 12px 20px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s;
}

.btn-primary:hover {
background-color: #1a5fd0;
}

.game-info {
margin-top: 20px;
padding: 20px;
background-color: rgba(45, 121, 243, 0.1);
border-radius: 8px;
border-left: 4px solid #2d79f3;
}

.game-info h2 {
margin-bottom: 15px;
color: #ffcc00;
}

/* Updated play count info styling */
.play-count-info {
  margin: 15px 0;
  font-size: 1.1rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: rgba(45, 121, 243, 0.25);
  padding: 10px 15px;
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s ease;
}

.play-count-info:hover {
  background-color: rgba(45, 121, 243, 0.35);
  transform: translateY(-2px);
}

.play-count-value {
  font-weight: bold;
  color: #ffcc00;
  font-size: 1.4rem;
  text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
  padding: 0 5px;
  display: inline-block;
}

/* Responsive adjustments for play count */
@media (max-width: 480px) {
  .play-count-info {
    font-size: 0.95rem;
    padding: 8px 12px;
  }
  
  .play-count-value {
    font-size: 1.2rem;
  }
}

.model-info {
  margin-top: 15px;
  padding: 8px 12px;
  background-color: rgba(45, 121, 243, 0.15);
  border-radius: 6px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.model-name {
  font-weight: bold;
  color: #ffcc00;
  margin-left: 5px;
}

/* Adjust existing styles */
.categories-container {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.categories-container h3 {
margin-bottom: 10px;
}

.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;
}

.btn-start {
background-color: #ffcc00;
color: #1C2F6E;
border: none;
border-radius: 5px;
padding: 15px 25px;
font-size: 18px;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s;
width: 100%;
}

.btn-start:hover {
background-color: #e6b800;
}

.error-message {
color: #ff6b6b;
background-color: rgba(255, 107, 107, 0.1);
padding: 10px 15px;
border-radius: 5px;
margin-top: 20px;
display: none;
text-align: center;
}

/* Modal styles */
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
overflow: auto;
}

.modal-content {
background-color: #1C2F6E;
margin: 15% auto;
padding: 30px;
border-radius: 10px;
width: 80%;
max-width: 400px;
text-align: center;
}

.modal-buttons {
display: flex;
justify-content: center;
gap: 15px;
margin-top: 20px;
}

.confirm-button, .cancel-button {
padding: 10px 20px;
border-radius: 5px;
border: none;
cursor: pointer;
font-size: 16px;
}

.confirm-button {
background-color: #ff6b6b;
color: white;
}

.cancel-button {
background-color: #2d79f3;
color: white;
}

/* Responsive styles */
@media (max-width: 768px) {
.join-game-container {
    padding: 20px;
}

.page-title {
    font-size: 28px;
}
}

@media (max-width: 480px) {
.join-game-container {
    padding: 15px;
}

.page-title {
    font-size: 24px;
}

.input-container input, 
.btn-primary {
    padding: 10px;
}

.btn-start {
    padding: 12px 20px;
    font-size: 16px;
}
}

/* Aggiungi questo alla fine del file CSS */

/* Stile per il pulsante in caricamento */
.loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.loading .spinner {
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-top: -10px;
  margin-left: -10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff; 
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Stile per il pulsante in caricamento con testo */
.loading.with-text .spinner {
  left: 30%;
}

.loading.with-text {
  color: white !important;
  padding-left: 30px;
}