/* General body styling */
body {
  font-family: 'Inter', 'Roboto', sans-serif;
  background-color: #0F1419;
  color: #888;
  margin: 0;
  padding: 0;
}

/* General HTML styles */
html {
  font-family: 'Inter', 'Roboto', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  color: #888;
}

body.dark {
  background-color: #0F1419;
  color: #888;
}

/* Link styles - Exclude feature icons and specific elements */
a:not(.feature-icon):not(.nav-link):not(.game-link):not(.auth-link):not(.lobby-btn):not(.action-btn):not(.feature-card):not(.cta-btn) {
  color: #fff;
  text-decoration: none;
  margin: 10px;
  background: linear-gradient(to right, #4b5dff, #6b8bff, #aa64f9);
  -webkit-background-clip: text; 
  /* -webkit-text-fill-color: transparent; */
  transition: all 0.5s ease;
}

a:not(.feature-icon):not(.nav-link):not(.game-link):not(.auth-link):not(.lobby-btn):not(.action-btn):not(.feature-card):not(.cta-btn):hover {
  animation: flicker 1s infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Ensure feature icons display properly */
.feature-icon {
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: unset !important;
  color: inherit !important;
  margin: 0 !important;
  animation: none !important;
}

.feature-icon:hover {
  animation: none !important;
}

/* Container for main content */
.container {
  max-width: 800px;
  margin: 0 auto;
}

/* Section styles */
.section-container {
  background-color: rgba(255, 255, 255, 0.03); /* 5% lighter background */
  border-radius: 10px; /* Modern rounded corners */
  padding: 20px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 556px;
}

/* Countdown and prompt styles */
.countdown, .prompt {
  font-weight: bold;
  color: #fff;
}

/* Chat container styles */
.chat-container {
  background-color: #121212;
  color: white;
  border-radius: 10px;
  padding: 20px;
  margin: 20px;
  max-width: 300px;
}

.chat-messages {
  background-color: #2c2c2c;
  border-radius: 10px;
  padding: 10px;
  color: white;
  overflow-y: auto;
  height: 150px;
  margin-bottom: 20px;
}

#chatInput {
  background-color: #2c2c2c;
  border: 1px solid #444;
  border-radius: 10px;
  padding: 10px;
  color: white;
  width: 70%;
  margin-top: 20px;
  margin-bottom: 20px;
}

.send-chat-btn {
  background-color: #17a2b8;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.send-chat-btn:hover {
  background-color: #138496;
}

.send-chat-btn:focus {
  outline: none;
}

.send-chat-btn:active {
  background-color: #117a8b;
}

/* Image styles */
#enlargedImageContainer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

#imageResult img {
  max-width: 556px;
  cursor: pointer;
}

#imageGenerationForm {
  margin-bottom: 20px;
  margin-top: 20px;
}

/* Form styles */
.styled-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.styled-select,
.styled-input {
  background-color: #2c2c2c;
  color: #ffffff;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 10px;
  font-size: 16px;
}

.styled-button {
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.styled-button:hover {
  background-color: #218838;
}

.styled-button:focus {
  outline: none;
}

.styled-button:active {
  background-color: #1e7e34;
}

.error-message {
  display: none;  /* Initially hidden */
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: #b91c1c;
  background-color: #fee2e2;
  border-radius: 0.5rem;
}

/* Button styles */
.button {
  color: white;
  border: none;
  border-radius: 25px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

/* Lobby Button styles */
.start-game-btn, .leave-btn, .join-btn, .send-chat-btn {
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.start-game-btn {
  background-color: #28a745;
}

.start-game-btn:hover {
  background-color: #218838;
}

.start-game-btn:focus {
  outline: none;
}

.start-game-btn:active {
  background-color: #1e7e34;
}

.leave-btn {
  background-color: #bd215f;
}

.leave-btn:hover {
  background-color: #c82333;
}

.leave-btn:focus {
  outline: none;
}

.leave-btn:active {
  background-color: #bd215f;
}

.join-btn {
  background-color: #17a2b8;
}

.join-btn:hover {
  background-color: #138496;
}

.join-btn:focus {
  outline: none;
}

.join-btn:active {
  background-color: #117a8b;
}

/* Fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden {
  opacity: 0; /* Start hidden */
}

.fade-in {
  animation: fadeIn 1s ease-in-out forwards; /* Added forwards to retain the end state */
}

.fade-in-delayed {
  animation: fadeIn 1s ease-in-out forwards;
}

.game-container {
  background-color: rgba(255, 255, 255, 0.02); /* 4% transparency white */
  border-radius: 10px; /* Rounded corners */
  padding: 10px; /* Optional: add some padding inside the container */
  margin-bottom: 16px;
}

/* Progress bar styles */
.loading-container {
  width: 100%;
  max-width: 556px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

.progress-bar {
  width: 80%;
  background-color: #444;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.progress {
  height: 20px;
  background-color: #17a2b8;
  width: 0;
  animation: progressAnimation 2s infinite;
}

@keyframes progressAnimation {
  0% {
      width: 0;
  }
  50% {
      width: 100%;
  }
  100% {
      width: 0;
  }
}

/* Gallery styling */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Default grid layout */
  gap: 10px;
}

/* Media query for larger screens */
@media (min-width: 1200px) {
  .gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Larger thumbnails on desktop */
  }
}

/* Media query for mobile portrait mode */
@media (max-width: 600px) {
  .gallery-container {
      grid-template-columns: repeat(2, 1fr); /* Two columns on small screens */
      gap: 8px; /* Adjust gap for smaller screens */
  }
}

/* Gallery item styling */
.gallery-item {
  position: relative;
  overflow: hidden;
}

/* Image inside gallery item */
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
  object-fit: cover;
}

/* Thumbnail icons */
.thumbnail-icon {
  position: absolute;
  width: 20px !important;
  height: 20px !important;
  cursor: pointer;
  display: none !important; /* Ensure they are visible for debugging */
}

.thumbnail-download-icon {
  right: 25px;
  top: 5px;
}

.thumbnail-info-icon {
  right: 5px;
  top: 5px;
}

/* Show icons on hover */
.gallery-item:hover .thumbnail-icon {
  display: block !important;
}


/* Enlarged image container */
.enlarged-image-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.enlarged-image-wrapper {
  position: relative;
}

.enlarged-image-wrapper img {
  max-width: 100%;
  max-height: 100vh; /* Ensure the image does not exceed the viewport height */
  object-fit: contain; /* Maintain aspect ratio within the viewport */
}

.enlarged-image-icons {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none; /* Hide icons by default */
  gap: 10px;
  z-index: 1001;
}

.enlarged-icon {
  width: 25px;
  height: 25px;
  cursor: pointer;
}

.enlarged-image-wrapper:hover .enlarged-image-icons {
  display: flex; /* Show icons when hovering over the enlarged image wrapper */
}

/* Sort container styling */
.sort-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Responsive grid */
  gap: 10px;
  margin-bottom: 20px;
  align-items: center; /* Ensure vertical alignment */
}

.sort-container > div {
  display: flex;
  flex-direction: column;
}

.sort-container label {
  margin-bottom: 5px;
  font-weight: bold;
}

.sort-container select,
.sort-container input,
.sort-container button {
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #555;
  background: #444;
  color: #ddd;
  font-size: 14px;
  width: 100%; /* Make all fields take full width */
  box-sizing: border-box;
  height: 40px; /* Set a uniform height */
}

.sort-container button {
  background-color: #007bff;
  color: white;
  border: none;
  cursor: pointer;
  height: 42px; /* Slightly taller than inputs to align vertically */
  align-self: end;
  margin-top: 20px;
}

/* Mobile layout */
@media (max-width: 600px) {
  .sort-container {
    grid-template-columns: 1fr; /* Stack elements vertically on small screens */
  }
}


/* Info container styling */
.info-container {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #1a1919;
  padding: 20px;
  border-radius: 10px;
  color: #dedddd;
  z-index: 1001;
  max-width: 80%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.info-container p {
  margin: 5px 0;
}

.close-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

@media (max-width: 600px) {
  .info-container {
      max-width: 95%;
      padding: 15px;
  }
}


/* Styling for the image result container in game.html */
#imageResult {
  position: relative; /* Make the container position relative to position the icons absolutely inside it */
}

#generatedImage {
  width: 100%;
  height: auto;
}

.image-container {
  position: relative;
}

.image-icon {
  position: absolute;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: none; /* Hide icons by default */
}

.image-container:hover .image-icon {
  display: block; /* Show icons on hover */
}

.download-icon {
  top: 10px;
  right: 60px;
}

.enlarge-icon {
  top: 10px;
  right: 10px;
}

/* Additional styles */
.styled-div {
  background: linear-gradient(to bottom right, #7F00FF, #E100FF);
  padding: 20px;
  border-radius: 15px;
  color: black;
  font-family: 'Comic Sans MS', cursive, sans-serif;
  text-align: center;
}

.styled-div h1 {
  font-size: 1.5em;
  margin-bottom: 10px;
}

.styled-div .highlight {
  color: yellow;
  text-shadow: 2px 2px 4px #000000;
}

.styled-div p {
  font-size: 1.2em;
  margin: 10px 0;
}

.styled-div .small-text {
  font-size: 0.6em;
  margin-top: 20px;
}

/* Flash effect */
.flash-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
}

.flash {
  animation: flash-animation 0.5s ease-in-out forwards;
}

@keyframes flash-animation {
  0% {
      opacity: 0;
  }
  25% {
      opacity: 1;
  }
  50% {
      opacity: 0;
  }
  100% {
      opacity: 0;
  }
}

.explosion {
  position: absolute;
  pointer-events: none; /* Allow clicks to pass through */
  width: 100px;
  height: 100px;
  transform: translate(-50%, -50%);
  }

  .particle {
  transform-origin: center;
  }

  @keyframes explode {
  0% { transform: scale(1); opacity: 1; }
  100% { opacity: 0; transform: scale(0.5); }
  }  

  /* Success message styles */
.success-message {
  display: none; /* Hidden by default */
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: #155724;
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  border-radius: 0.5rem;
  animation: fadeIn 1s ease-in-out forwards;
}

/* Subtle form hover and focus enhancements */
.styled-input:hover,
.styled-select:hover,
.styled-input:focus,
.styled-select:focus {
  border-color: #888;
  background-color: #3a3a3a;
}

/* Optional: smoother input field transitions */
.styled-input,
.styled-select {
  transition: all 0.3s ease;
}

/* ===== MODERN HEADER STYLES ===== */

.modern-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Brand Section */
.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.brand-tagline {
  font-size: 0.75rem;
  color: #888;
  line-height: 1;
}

/* Navigation */
.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  color: #888;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.9rem;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.nav-link.active {
  color: #4b5dff;
  background: rgba(75, 93, 255, 0.1);
  border: 1px solid rgba(75, 93, 255, 0.2);
}

.nav-link svg {
  width: 16px;
  height: 16px;
}

/* User Section */
.header-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.auth-status-modern {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.auth-indicator.online {
  background: #28a745;
  box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.auth-indicator.offline {
  background: #6c757d;
}

.auth-text {
  font-size: 0.8rem;
  color: #888;
  font-weight: 500;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.user-profile:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.user-avatar-header {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.user-info-header {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  line-height: 1;
}

.user-status-text {
  font-size: 0.75rem;
  color: #28a745;
  line-height: 1;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  color: #888;
  transition: all 0.3s ease;
}

.user-profile:hover .user-menu-toggle {
  color: #fff;
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: rgba(28, 28, 30, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  min-width: 200px;
  z-index: 1000;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-content {
  padding: 0.5rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  color: #ccc;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0.5rem 0;
}

/* Login Section */
.login-section {
  display: flex;
  align-items: center;
}

.login-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(75, 93, 255, 0.3);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(75, 93, 255, 0.4);
}

.login-btn svg {
  width: 16px;
  height: 16px;
}

/* Responsive Header */
@media (max-width: 1024px) {
  .header-content {
    padding: 1rem 1.5rem;
  }
  
  .nav-list {
    gap: 0.25rem;
  }
  
  .nav-link {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .header-content {
    padding: 1rem;
  }
  
  .brand-text {
    display: none;
  }
  
  .nav-link span {
    display: none;
  }
  
  .nav-link {
    padding: 0.8rem;
  }
  
  .user-info-header {
    display: none;
  }
  
  .auth-status-modern {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0.8rem;
  }
  
  .nav-list {
    gap: 0.1rem;
  }
  
  .nav-link {
    padding: 0.6rem;
  }
  
  .user-dropdown {
    right: -1rem;
    left: -1rem;
    margin-top: 0.5rem;
  }
}

/* ===== NEW GAME PAGE STYLES ===== */

/* Page background with gradient */
.page-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0F1419 0%, #2C2C2E 50%, #0F1419 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  z-index: -1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Main container */
.newgame-container {
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 1rem 1rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Header section */
.newgame-header {
  text-align: center;
  margin-bottom: 2rem;
  animation: slideInDown 0.8s ease-out;
}

.user-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-label {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.2rem;
}

.username {
  font-size: 1rem;
  color: #fff;
  font-weight: 600;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 1.1rem;
  color: #888;
  margin: 0;
}

/* Form wrapper */
.form-wrapper {
  width: 100%;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: slideInUp 0.8s ease-out 0.2s both;
  flex: 1;
  margin-bottom: 1rem;
}

.modern-form {
  width: 100%;
}


/* Form field */
.form-field {
  opacity: 0;
  transform: translateY(20px);
}

.form-field.animate-in {
  animation: slideInField 0.6s ease-out forwards;
}

.form-field.error .field-input,
.form-field.error .field-select {
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.form-field.error .field-label {
  color: #ef4444;
}

/* Field label */
.field-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
}

.label-text {
  color: #fff;
}

.label-required {
  color: #ef4444;
  font-size: 1.1rem;
}

/* Input wrapper */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input {
  width: 100%;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.field-input:focus {
  outline: none;
  border-color: #4b5dff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(75, 93, 255, 0.1);
}

.field-input::placeholder {
  color: #666;
}

.input-suffix {
  position: absolute;
  right: 1rem;
  color: #888;
  font-size: 0.9rem;
  pointer-events: none;
}

.input-focus-border {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #4b5dff, #aa64f9);
  transition: width 0.3s ease;
}

.field-input:focus + .input-focus-border {
  width: 100%;
}

/* Select wrapper */
.select-wrapper {
  position: relative;
}

.field-select {
  width: 100%;
  padding: 1rem 1.2rem;
  padding-right: 3rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  appearance: none;
  cursor: pointer;
}

.field-select:focus {
  outline: none;
  border-color: #4b5dff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(75, 93, 255, 0.1);
}

.field-select option {
  background: #2C2C2E;
  color: #fff;
  padding: 0.5rem;
}

.select-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
  transition: transform 0.3s ease;
}

.field-select:focus + .select-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* Field hint */
.field-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #666;
}

/* Field error */
.field-error {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #ef4444;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.3s ease;
}

.field-error.show {
  opacity: 1;
  transform: translateY(0);
}

/* Form actions */
.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

/* Submit button */
.submit-btn {
  position: relative;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  min-width: 200px;
  box-shadow: 0 10px 30px rgba(75, 93, 255, 0.3);
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(75, 93, 255, 0.4);
}

.submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.submit-btn:disabled {
  cursor: not-allowed;
}

.submit-btn.loading {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.submit-btn.success {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.submit-btn.error {
  background: linear-gradient(135deg, #ef4444, #f87171);
}

.btn-text {
  transition: opacity 0.3s ease;
}

.btn-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-loader.active {
  opacity: 1;
}

.btn-loader.active ~ .btn-text {
  opacity: 0;
}

.loader-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn-success-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.submit-btn.success .btn-success-icon {
  opacity: 1;
}

.submit-btn.success .btn-text {
  opacity: 0;
}

/* Message container */
.message-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  margin: 0;
  box-sizing: border-box;
  min-height: 100vh;
}

.message-container.active {
  opacity: 1;
  visibility: visible;
}

.message {
  display: none;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 16px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.4s ease;
  margin: 0;
}

.message.show {
  display: flex;
  transform: scale(1);
  opacity: 1;
}

.success-message {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.message-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.success-message .message-icon {
  color: #10b981;
}

.error-message .message-icon {
  color: #ef4444;
}

.message-content {
  flex: 1;
}

.message-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.5rem 0;
}

.message-text {
  font-size: 0.95rem;
  color: #ccc;
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

.game-id {
  font-weight: 600;
  color: #4b5dff;
  background: rgba(75, 93, 255, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-family: monospace;
}

.message-actions {
  display: flex;
  gap: 0.8rem;
}

.message-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.message-btn.primary {
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  color: white;
}

.message-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(75, 93, 255, 0.3);
}

.message-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.message-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.message-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* ===== ENHANCED SUCCESS CARD STYLES ===== */

.success-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  margin: 0 auto;
  align-self: center;
}

.success-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #10b981, #34d399, #6ee7b7);
  background-size: 200% 100%;
  animation: successGradient 3s ease-in-out infinite;
}

@keyframes successGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.success-card.show {
  transform: scale(1);
  opacity: 1;
}

.success-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 2rem 2rem 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.success-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 12px;
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.success-title-section {
  flex: 1;
}

.success-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.success-subtitle {
  font-size: 1rem;
  color: #10b981;
  margin: 0;
  font-weight: 500;
}

.success-close {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.success-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.success-content {
  flex: 1;
  padding: 0 2rem 1rem 2rem;
}

.game-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.game-number-section,
.game-type-section {
  text-align: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-number-label,
.game-type-label {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.game-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: #4b5dff;
  font-family: 'Courier New', monospace;
  text-shadow: 0 0 10px rgba(75, 93, 255, 0.3);
}

.game-type {
  font-size: 1.2rem;
  font-weight: 700;
  color: #10b981;
}

.game-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.detail-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.detail-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.detail-text {
  font-size: 0.95rem;
  color: #ccc;
  font-weight: 500;
}

.detail-text span {
  color: #fff;
  font-weight: 700;
}

.invite-section {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

.invite-label {
  font-size: 1rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.invite-label::before {
  content: '🔗';
  font-size: 1.2rem;
}

.invite-link-container {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.invite-link-input {
  flex: 1;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ccc;
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
  cursor: text;
}

.invite-link-input:focus {
  outline: none;
  border-color: #4b5dff;
  background: rgba(0, 0, 0, 0.4);
}

.copy-link-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.copy-link-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(75, 93, 255, 0.4);
}

.copy-link-btn:active {
  transform: translateY(0);
}

.copy-feedback {
  font-size: 0.85rem;
  color: #10b981;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-feedback::before {
  content: '✓';
  font-weight: bold;
}

.copy-feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.copy-feedback.error {
  color: #ef4444;
}

.copy-feedback.error::before {
  content: '✗';
}

.success-actions {
  display: flex;
  gap: 1rem;
  padding: 0 2rem 2rem 2rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  justify-content: center;
  text-decoration: none;
}

.action-btn.primary {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(16, 185, 129, 0.4);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-1px);
}

.action-btn.tertiary {
  background: rgba(75, 93, 255, 0.1);
  color: #4b5dff;
  border: 1px solid rgba(75, 93, 255, 0.2);
}

.action-btn.tertiary:hover {
  background: rgba(75, 93, 255, 0.2);
  color: #aa64f9;
  transform: translateY(-1px);
}

/* Responsive design for success card */
@media (max-width: 768px) {
  .message-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }
  
  .success-card {
    max-width: none;
  }
  
  .success-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
  }
  
  .success-content {
    padding: 1.5rem;
  }
  
  .game-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .game-details {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  
  .success-actions {
    flex-direction: column;
    padding: 0 1.5rem 1.5rem 1.5rem;
  }
  
  .action-btn {
    flex: none;
  }
  
  .invite-link-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .copy-link-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .success-header {
    padding: 1rem;
  }
  
  .success-content {
    padding: 1rem;
  }
  
  .success-actions {
    padding: 0 1rem 1rem 1rem;
  }
  
  .success-title {
    font-size: 1.2rem;
  }
  
  .game-number {
    font-size: 1.5rem;
  }
  
  .detail-item {
    padding: 0.8rem;
  }
  
  .invite-section {
    padding: 1rem;
  }
}

/* Animations */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInField {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .newgame-container {
    min-height: auto;
    max-height: none;
    margin: 1rem auto;
    padding: 1rem;
    overflow-y: visible;
  }
  
  .newgame-header {
    margin-bottom: 2rem;
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  .form-wrapper {
    padding: 1.5rem;
  }
  
  
  .user-status {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
  
  .user-info {
    align-items: center;
  }
  
  .message-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }
  
  .message {
    max-width: none;
  }
  
  .message-actions {
    flex-direction: column;
  }
  
  .submit-btn {
    min-width: 180px;
    padding: 0.9rem 2rem;
  }
}

@media (max-width: 480px) {
  .game-btn {
    width: 100%;
  }
}

/* ===== AUTHENTICATION PAGE STYLES ===== */

/* Auth container */
.auth-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* Auth header */
.auth-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: slideInDown 0.8s ease-out;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  margin: 0 auto 2rem auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  font-size: 1.1rem;
  color: #888;
  margin: 0;
}

/* Auth form wrapper */
.auth-form-wrapper {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: slideInUp 0.8s ease-out 0.2s both;
}

.auth-form {
  width: 100%;
}


.auth-field.animate-in {
  animation: slideInField 0.6s ease-out forwards;
}

.auth-field.error .auth-input {
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.auth-field.error .auth-label {
  color: #ef4444;
}

/* Auth label */
.auth-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
  color: #fff;
  font-size: 0.95rem;
}

/* Auth input wrapper */
.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: #888;
  z-index: 1;
  transition: color 0.3s ease;
}

.auth-input {
  width: 100%;
  padding: 1rem 1.2rem 1rem 3rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.auth-input:focus {
  outline: none;
  border-color: #4b5dff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(75, 93, 255, 0.1);
}

.auth-input:focus + .input-focus-border {
  width: 100%;
}

.auth-input:focus ~ .input-icon {
  color: #4b5dff;
}

.auth-input::placeholder {
  color: #666;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.password-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Auth field error */
.auth-field-error {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #ef4444;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.3s ease;
}

.auth-field-error.show {
  opacity: 1;
  transform: translateY(0);
}

/* Auth field hint */
.auth-field-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #666;
}

/* Password strength indicator */
.password-strength {
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
}

.password-strength.animate-in {
  animation: slideInField 0.6s ease-out forwards;
}

.strength-label {
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 0.5rem;
}

.strength-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.strength-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 3px;
}

.strength-fill.weak {
  background: #ef4444;
}

.strength-fill.medium {
  background: #f59e0b;
}

.strength-fill.strong {
  background: #10b981;
}

.strength-fill.very-strong {
  background: #059669;
}

.strength-text {
  font-size: 0.85rem;
  color: #888;
}

/* Auth options */
.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
}

.auth-options.animate-in {
  animation: slideInField 0.6s ease-out forwards;
}

.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #ccc;
}

.auth-checkbox input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
}

.auth-checkbox input[type="checkbox"]:checked + .checkmark {
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  border-color: #4b5dff;
}

.auth-checkbox input[type="checkbox"]:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-text {
  line-height: 1.4;
}

.auth-link {
  color: #4b5dff;
  text-decoration: none;
  transition: color 0.3s ease;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
}

.auth-link:hover {
  color: #aa64f9;
  animation: none;
}

/* Auth actions */
.auth-actions {
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
}

.auth-actions.animate-in {
  animation: slideInField 0.6s ease-out forwards;
}

.auth-btn {
  position: relative;
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(75, 93, 255, 0.3);
}

.auth-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(75, 93, 255, 0.4);
}

.auth-btn:active:not(:disabled) {
  transform: translateY(0);
}

.auth-btn:disabled {
  cursor: not-allowed;
}

.auth-btn.loading {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.auth-btn.success {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.auth-btn.error {
  background: linear-gradient(135deg, #ef4444, #f87171);
}

/* Auth footer */
.auth-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-footer-text {
  color: #888;
  margin: 0;
  font-size: 0.9rem;
}

/* Auth message container */
.auth-message-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  max-width: 400px;
}

.auth-message-container.active {
  opacity: 1;
  visibility: visible;
}

.auth-message {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.4s ease;
  margin-bottom: 1rem;
}

.auth-message.show {
  transform: translateX(0);
}

.auth-message.success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.auth-message.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.auth-message .message-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.auth-message.success .message-icon {
  color: #10b981;
}

.auth-message.error .message-icon {
  color: #ef4444;
}

.auth-message .message-content {
  flex: 1;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Responsive design for auth pages */
@media (max-width: 768px) {
  .auth-container {
    padding: 1rem;
  }
  
  .auth-title {
    font-size: 2rem;
  }
  
  .auth-form-wrapper {
    padding: 1.5rem;
  }
  
  .auth-message-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
  
  .auth-options {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .auth-form-wrapper {
    padding: 1rem;
    border-radius: 16px;
  }
  
  .auth-input {
    padding: 0.8rem 1rem 0.8rem 2.8rem;
  }
  
  .auth-btn {
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
  }
  
  .checkbox-text {
    font-size: 0.85rem;
  }
  
  .field-input,
  .field-select {
    padding: 0.8rem 1rem;
  }
  
  .submit-btn {
    min-width: 160px;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
}

/* ===== IMAGE GENERATOR PAGE STYLES ===== */

/* Image generator container */
.image-generator-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Generator header */
.image-generator-header {
  text-align: center;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.6s ease;
}

.image-generator-header.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.generator-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  margin: 0 auto 2rem auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.generator-title {
  font-size: 2.8rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.generator-subtitle {
  font-size: 1.2rem;
  color: #888;
  margin: 0;
}

/* Generator form wrapper */
.generator-form-wrapper {
  width: 100%;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.generator-form-wrapper.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.generator-form {
  width: 100%;
}

/* Generator field */
.generator-field {
  margin-bottom: 2rem;
}

.generator-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
  color: #fff;
  font-size: 1rem;
}

/* Generator select */
.generator-select {
  width: 100%;
  padding: 1rem 1.2rem;
  padding-right: 3rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  appearance: none;
  cursor: pointer;
}

.generator-select:focus {
  outline: none;
  border-color: #4b5dff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(75, 93, 255, 0.1);
}

.generator-select option {
  background: #2C2C2E;
  color: #fff;
  padding: 0.5rem;
}

/* Generator textarea */
.generator-textarea {
  width: 100%;
  padding: 1rem 1.2rem 1rem 3rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

.generator-textarea:focus {
  outline: none;
  border-color: #4b5dff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(75, 93, 255, 0.1);
}

.generator-textarea::placeholder {
  color: #666;
}

/* Generator field hint */
.generator-field-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}

/* Generator actions */
.generator-actions {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* Generator button */
.generator-btn {
  position: relative;
  padding: 1.2rem 3rem;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  min-width: 220px;
  box-shadow: 0 10px 30px rgba(75, 93, 255, 0.3);
}

.generator-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(75, 93, 255, 0.4);
}

.generator-btn:active:not(:disabled) {
  transform: translateY(0);
}

.generator-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.generator-btn.loading {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.generator-btn.success {
  background: linear-gradient(135deg, #10b981, #34d399);
}

/* Loading section */
.loading-section {
  width: 100%;
  max-width: 600px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 3rem 2rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.loading-section.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.loading-content {
  text-align: center;
}

.loading-animation {
  margin-bottom: 2rem;
}

.loading-spinner-large {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #4b5dff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.loading-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.5rem 0;
}

.loading-text {
  font-size: 1rem;
  color: #888;
  margin: 0 0 2rem 0;
}

.progress-bar-modern {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4b5dff, #aa64f9);
  border-radius: 4px;
  animation: progressFlow 2s ease-in-out infinite;
}

@keyframes progressFlow {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

/* Image result section */
.image-result-section {
  width: 100%;
  max-width: 800px;
}

.result-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.result-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.result-actions {
  display: flex;
  gap: 0.8rem;
}

.result-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.result-btn.primary {
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  color: white;
}

.result-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(75, 93, 255, 0.3);
}

.result-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.result-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.result-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.image-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.3s ease;
}

.image-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.image-container img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-container:hover .image-overlay {
  opacity: 1;
}

.overlay-actions {
  display: flex;
  gap: 1rem;
}

.overlay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.overlay-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.result-description {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.description-text {
  font-size: 1rem;
  color: #ccc;
  line-height: 1.6;
  margin: 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border-left: 4px solid #4b5dff;
}

.description-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #888;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
}

/* Image modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.image-modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: rgba(28, 28, 30, 0.95);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.image-modal.show .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 2rem;
}

.enlarged-image-wrapper {
  position: relative;
  text-align: center;
  margin-bottom: 2rem;
}

.enlarged-image-wrapper img {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.modal-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-btn.primary {
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  color: white;
}

.modal-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(75, 93, 255, 0.3);
}

.modal-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Info modal */
.info-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.info-modal.show {
  opacity: 1;
  visibility: visible;
}

.info-modal-content {
  background: rgba(28, 28, 30, 0.95);
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.info-modal.show .info-modal-content {
  transform: scale(1);
}

.info-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-modal-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.info-close {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.info-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.info-modal-body {
  padding: 2rem;
  color: #ccc;
  line-height: 1.6;
  overflow-y: auto;
  max-height: 60vh;
}

/* Game info and alert sections (hidden by default) */
.game-info-section,
.game-alert-section {
  width: 100%;
  max-width: 800px;
  margin-bottom: 2rem;
}

.info-card,
.alert-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.info-title,
.alert-status {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

.info-details,
.alert-prompt {
  color: #ccc;
  margin-bottom: 1rem;
}

.alert-countdown {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffc107;
}

/* Responsive design */
@media (max-width: 1024px) {
  .result-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .modal-content {
    max-width: 95vw;
  }
}

@media (max-width: 768px) {
  .image-generator-container {
    padding: 1rem;
  }
  
  .generator-title {
    font-size: 2.2rem;
  }
  
  .generator-form-wrapper {
    padding: 1.5rem;
  }
  
  .generator-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    min-width: 180px;
  }
  
  .result-card {
    padding: 1.5rem;
  }
  
  .result-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .result-actions {
    width: 100%;
    justify-content: center;
  }
  
  .description-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .modal-actions {
    flex-direction: column;
  }
  
  .modal-btn {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .generator-form-wrapper {
    padding: 1rem;
  }
  
  .generator-btn {
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    min-width: 160px;
  }
  
  .loading-section {
    padding: 2rem 1rem;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .result-btn {
    justify-content: center;
  }
  
  .overlay-actions {
    gap: 0.5rem;
  }
  
  .overlay-btn {
    width: 40px;
    height: 40px;
  }
}

/* ===== LOBBY PAGE STYLES ===== */

/* Lobby container */
.lobby-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Lobby header */
.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.6s ease;
}

.lobby-header.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.lobby-title-section {
  flex: 1;
}

.lobby-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lobby-subtitle {
  font-size: 1.1rem;
  color: #888;
  margin: 0;
}

.lobby-actions {
  display: flex;
  gap: 1rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.action-btn.primary {
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  color: white;
  box-shadow: 0 8px 25px rgba(75, 93, 255, 0.3);
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(75, 93, 255, 0.4);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-1px);
}

/* Games section */
.games-section {
  flex: 1;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease 0.2s;
}

.games-section.animate-in {
  opacity: 1;
  transform: translateY(0);
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.games-count {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  font-size: 0.9rem;
  color: #888;
  backdrop-filter: blur(10px);
}

/* Loading state */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid #4b5dff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loading-state p {
  color: #888;
  font-size: 1.1rem;
  margin: 0;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-icon {
  color: #444;
  margin-bottom: 1.5rem;
  opacity: 0.7;
}

.empty-state h3 {
  font-size: 1.5rem;
  color: #fff;
  margin: 0 0 0.5rem 0;
}

.empty-state p {
  color: #888;
  font-size: 1rem;
  margin: 0 0 2rem 0;
}

/* Error state */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.error-icon {
  color: #ef4444;
  margin-bottom: 1.5rem;
}

.error-state h3 {
  font-size: 1.5rem;
  color: #fff;
  margin: 0 0 0.5rem 0;
}

.error-state p {
  color: #888;
  font-size: 1rem;
  margin: 0 0 2rem 0;
}

/* Games grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
  overflow: hidden !important;
}

/* Game card */
.game-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.game-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Enhanced styles for joined games */
.game-card.user-joined {
  border: 2px solid rgba(75, 93, 255, 0.4);
  background: rgba(75, 93, 255, 0.05);
  box-shadow: 0 0 20px rgba(75, 93, 255, 0.2);
}

.game-card.user-joined:hover {
  border-color: rgba(75, 93, 255, 0.6);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(75, 93, 255, 0.3);
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.game-id {
  flex: 1;
}

.game-link {
  font-size: 1.2rem;
  font-weight: 600;
  color: #4b5dff;
  text-decoration: none;
  transition: color 0.3s ease;
  margin: 0;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
}

.game-link:hover {
  color: #aa64f9;
  animation: none;
}

.game-meta {
  margin-top: 0.5rem;
}

.game-created {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
}

.game-badges {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
}

.game-type-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.game-type-badge.public {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.game-type-badge.private {
  background: rgba(108, 117, 125, 0.2);
  color: #6c757d;
  border: 1px solid rgba(108, 117, 125, 0.3);
}

.game-status-badge {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.game-status-badge.waiting {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.game-status-badge.ready {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

/* Enhanced status badge for joined games */
.game-status-badge.user-in-game {
  background: rgba(75, 93, 255, 0.3);
  color: #fff;
  border: 1px solid rgba(75, 93, 255, 0.5);
  font-weight: 700;
  animation: statusGlow 2s ease-in-out infinite;
  box-shadow: 0 0 15px rgba(75, 93, 255, 0.4);
}

@keyframes statusGlow {
  0%, 100% { 
    box-shadow: 0 0 15px rgba(75, 93, 255, 0.4);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 25px rgba(75, 93, 255, 0.6);
    transform: scale(1.05);
  }
}

.game-card-body {
  margin-bottom: 1.5rem;
}

.game-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.info-item {
  text-align: center;
}

.info-label {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.host-name {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.players-section {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 1rem;
}

.players-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.players-label {
  font-size: 0.9rem;
  color: #ccc;
  font-weight: 500;
}

.player-slots {
  display: flex;
  gap: 0.3rem;
}

.player-slot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.player-slot.filled {
  background: #4b5dff;
  box-shadow: 0 0 8px rgba(75, 93, 255, 0.5);
}

.player-slot.empty {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.players-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.player-tag {
  padding: 0.3rem 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 0.8rem;
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-tag.current-user {
  background: rgba(75, 93, 255, 0.2);
  color: #4b5dff;
  border-color: rgba(75, 93, 255, 0.3);
  font-weight: 600;
}

.no-players {
  color: #666;
  font-style: italic;
  margin: 0;
  text-align: center;
  padding: 0.5rem;
}

.game-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.game-status-text {
  flex: 1;
  font-size: 0.9rem;
  color: #888;
}

.game-status-text.countdown {
  color: #ffc107;
  font-weight: 600;
  animation: pulse 1s infinite;
}

.game-status-text.started {
  color: #28a745;
  font-weight: 600;
}

.game-status-text.error {
  color: #ef4444;
}

.game-actions {
  display: flex;
  gap: 0.8rem;
}

.game-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
  justify-content: center;
  flex: 1;
  max-width: 140px;
}

.game-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.game-btn.join-btn {
  background: linear-gradient(135deg, #17a2b8, #20c997);
  color: white;
}

.game-btn.join-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(23, 162, 184, 0.3);
}

.game-btn.leave-btn {
  background: linear-gradient(135deg, #dc3545, #e74c3c);
  color: white;
}

.game-btn.leave-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.game-btn.start-game-btn {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.game-btn.start-game-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.game-btn.lobby-btn {
  background: linear-gradient(135deg, #6f42c1, #8b5cf6);
  color: white !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  max-width: 140px;
  flex: 1;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: unset !important;
  background-clip: unset !important;
}

.game-btn.lobby-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(111, 66, 193, 0.3);
  animation: none;
  background: linear-gradient(135deg, #6f42c1, #8b5cf6);
  color: white !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: unset !important;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 0.5rem;
}

/* Connection status */
.connection-status {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 25px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  z-index: 1000;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.connection-status.connected .status-indicator {
  background: #28a745;
  box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.connection-status.disconnected .status-indicator {
  background: #dc3545;
  box-shadow: 0 0 8px rgba(220, 53, 69, 0.5);
}

.connection-status.connecting .status-indicator {
  background: #ffc107;
  box-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
  animation: pulse 1s infinite;
}

.status-text {
  color: #ccc;
  font-weight: 500;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.4s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  border-color: rgba(40, 167, 69, 0.3);
  background: rgba(40, 167, 69, 0.1);
}

.toast.error {
  border-color: rgba(220, 53, 69, 0.3);
  background: rgba(220, 53, 69, 0.1);
}

.toast.info {
  border-color: rgba(23, 162, 184, 0.3);
  background: rgba(23, 162, 184, 0.1);
}

.toast-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.toast.success .toast-icon {
  color: #28a745;
}

.toast.error .toast-icon {
  color: #dc3545;
}

.toast.info .toast-icon {
  color: #17a2b8;
}

.toast-content {
  flex: 1;
}

.toast-content p {
  margin: 0;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  margin-top: -0.2rem;
}

.toast-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Responsive design */
@media (max-width: 1200px) {
  .game-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .game-btn {
    min-width: 110px;
    max-width: 130px;
  }
}

@media (max-width: 1024px) {
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
  
  .lobby-header {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
  
  .lobby-actions {
    justify-content: center;
  }
  
  .game-actions {
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  
  .game-btn {
    min-width: 100px;
    max-width: 120px;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .lobby-container {
    padding: 1rem;
  }
  
  .lobby-title {
    font-size: 2rem;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
  }
  
  .game-info {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .game-card-footer {
    flex-direction: column;
    gap: 1rem;
  }
  
  .game-actions {
    width: 100%;
    justify-content: center;
  }
  
  .connection-status {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    justify-content: center;
  }
  
  .toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }
  
  .toast {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .lobby-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .action-btn {
    justify-content: center;
  }
  
  .game-info {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  
  .game-actions {
    flex-direction: column;
  }
  
  .game-btn {
    width: 100%;
  }
}

/* ===== SPECTACULAR GAME SHOW PROMPT STYLING ===== */

.prompt-text {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0;
  padding: 2.5rem 3rem;
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.5px;
  color: #ffffff;
  border-radius: 24px;
  position: relative;
  transform: scale(0.8);
  opacity: 0;
  animation: promptReveal 1.2s ease-out 0.3s forwards;
  text-shadow: 
    0 0 20px rgba(255, 107, 107, 0.6),
    0 0 40px rgba(78, 205, 196, 0.4),
    0 0 60px rgba(69, 183, 209, 0.3);
}

.prompt-text::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3, #54a0ff, #ff6b6b);
  background-size: 800% 800%;
  border-radius: 28px;
  z-index: -2;
  animation: borderFlow 4s ease-in-out infinite;
  filter: blur(1px);
}

.prompt-text::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 30, 0.9));
  border-radius: 24px;
  z-index: -1;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 40px rgba(75, 93, 255, 0.2);
}

/* Game show prompt reveal animation */
@keyframes promptReveal {
  0% {
    transform: scale(0.8) rotateX(-15deg);
    opacity: 0;
    filter: blur(10px);
  }
  50% {
    transform: scale(1.05) rotateX(0deg);
    opacity: 0.8;
    filter: blur(2px);
  }
  100% {
    transform: scale(1) rotateX(0deg);
    opacity: 1;
    filter: blur(0px);
  }
}

/* Animated colorful border flow */
@keyframes borderFlow {
  0%, 100% {
    background-position: 0% 50%;
  }
  25% {
    background-position: 100% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  75% {
    background-position: 0% 100%;
  }
}

/* Responsive adjustments for game show prompt */
@media (max-width: 768px) {
  .prompt-text {
    font-size: 1.8rem;
    padding: 2rem 2.5rem;
  }
}

@media (max-width: 480px) {
  .prompt-text {
    font-size: 1.5rem;
    padding: 1.5rem 2rem;
  }
}

/* ===== PROFESSIONAL GAME PAGE STYLES ===== */

/* Game page container */
.game-page-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
  gap: 2rem;
}

/* Game Alert Card - Professional Status Display */
.game-alert-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.6s ease;
}

.game-alert-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.alert-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Round Status */
.round-status-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-number-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: #4b5dff;
  cursor: pointer;
  transition: color 0.3s ease;
  text-decoration: none;
}

.game-number-link:hover {
  color: #aa64f9;
}

.round-number {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.round-status-badge,
.round-countdown-badge {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.round-status-badge.active,
.round-countdown-badge {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.round-status-badge.completed {
  background: rgba(108, 117, 125, 0.2);
  color: #6c757d;
  border: 1px solid rgba(108, 117, 125, 0.3);
}

.round-status-badge.complete {
  background: rgba(75, 93, 255, 0.2);
  color: #4b5dff;
  border: 1px solid rgba(75, 93, 255, 0.3);
}

.round-countdown {
  font-size: 1rem;
  font-weight: 600;
  color: #ffc107;
  animation: pulse 1s infinite;
}

/* Countdown Display */
.countdown-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(255, 193, 7, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.countdown-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.countdown-icon {
  color: #ffc107;
}

.countdown-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffc107;
}

/* Large Countdown Display */
.countdown-display-large {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 107, 107, 0.1));
  border-radius: 20px;
  border: 2px solid rgba(255, 193, 7, 0.3);
  animation: countdownPulse 1s ease-in-out infinite;
}

.countdown-number {
  font-size: 4rem;
  font-weight: 900;
  color: #ffc107;
  text-shadow: 0 0 20px rgba(255, 193, 7, 0.5);
  margin-bottom: 0.5rem;
}

.countdown-label {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 2px;
}

@keyframes countdownPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* Message Display */
.message-display {
  text-align: center;
  padding: 2rem;
  border-radius: 16px;
  animation: messageReveal 0.8s ease-out;
}

.message-display.go {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.2), rgba(32, 201, 151, 0.2));
  border: 2px solid rgba(40, 167, 69, 0.4);
}

.message-display.timeup {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.2), rgba(231, 76, 60, 0.2));
  border: 2px solid rgba(220, 53, 69, 0.4);
}

.message-text {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.message-display.go .message-text {
  color: #28a745;
}

.message-display.timeup .message-text {
  color: #dc3545;
}

.message-subtext {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@keyframes messageReveal {
  0% {
    opacity: 0;
    transform: scale(0.8) rotateX(-15deg);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1) rotateX(0deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateX(0deg);
  }
}

/* Timer Display */
.timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.timer-circle {
  text-align: center;
  padding: 2rem;
  border-radius: 50%;
  background: rgba(75, 93, 255, 0.1);
  border: 3px solid rgba(75, 93, 255, 0.3);
  min-width: 150px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.timer-number {
  font-size: 2.5rem;
  font-weight: 900;
  color: #4b5dff;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 15px rgba(75, 93, 255, 0.4);
}

.timer-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.timer-display.warning .timer-circle {
  border-color: rgba(255, 193, 7, 0.5);
  background: rgba(255, 193, 7, 0.1);
}

.timer-display.warning .timer-number {
  color: #ffc107;
  text-shadow: 0 0 15px rgba(255, 193, 7, 0.4);
}

.timer-display.urgent {
  animation: timerUrgent 0.5s ease-in-out infinite;
}

.timer-display.urgent .timer-circle {
  border-color: rgba(220, 53, 69, 0.6);
  background: rgba(220, 53, 69, 0.1);
}

.timer-display.urgent .timer-number {
  color: #dc3545;
  text-shadow: 0 0 15px rgba(220, 53, 69, 0.5);
}

@keyframes timerUrgent {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Game Content Grid */
.game-content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  flex: 1;
}

/* Card Base Styles */
.image-generation-card,
.voting-card,
.results-card,
.chat-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
  overflow: hidden;
}

.image-generation-card.animate-in,
.voting-card.animate-in,
.results-card.animate-in,
.chat-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.card-header .header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(75, 93, 255, 0.1);
  color: #4b5dff;
  margin-right: 1rem;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  flex: 1;
}

.card-content {
  padding: 2rem;
}

/* Image Generation Card Specific */
.image-generation-card {
  grid-column: 1;
  grid-row: 1 / 3;
}

/* Voting Card Specific */
.voting-card {
  grid-column: 1;
  grid-row: 1 / 3;
}

.voting-timer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 193, 7, 0.1);
  border-radius: 20px;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.timer-icon {
  color: #ffc107;
}

.timer-text {
  font-size: 1rem;
  font-weight: 600;
  color: #ffc107;
}

.timer-text.warning {
  color: #ff8c00;
  animation: pulse 1s infinite;
}

.timer-text.urgent {
  color: #dc3545;
  animation: pulse 0.5s infinite;
}

.voting-instructions {
  margin-bottom: 2rem;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border-left: 4px solid #4b5dff;
}

.voting-instructions p {
  margin: 0;
  color: #ccc;
  font-size: 0.95rem;
  line-height: 1.5;
}

.voting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.vote-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.vote-card:hover {
  transform: translateY(-5px);
  border-color: rgba(75, 93, 255, 0.3);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.vote-card.voted {
  border-color: rgba(40, 167, 69, 0.5);
  background: rgba(40, 167, 69, 0.1);
}

.vote-card.own-image {
  border-color: rgba(108, 117, 125, 0.3);
  background: rgba(108, 117, 125, 0.05);
  cursor: not-allowed;
}

.vote-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
}

.anonymous-label {
  font-weight: 600;
  color: #4b5dff;
  font-size: 0.9rem;
}

.own-badge {
  padding: 0.2rem 0.6rem;
  background: rgba(108, 117, 125, 0.2);
  color: #6c757d;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.vote-image-container {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.vote-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.vote-card:hover .vote-image {
  transform: scale(1.05);
}

.vote-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.vote-card:hover .vote-overlay {
  opacity: 1;
}

.vote-button {
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.vote-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(75, 93, 255, 0.4);
}

.vote-button.disabled {
  background: rgba(108, 117, 125, 0.5);
  cursor: not-allowed;
}

.vote-card-footer {
  padding: 1rem;
}

.vote-prompt {
  margin: 0 0 0.5rem 0;
  color: #ccc;
  font-size: 0.9rem;
  line-height: 1.4;
}

.vote-style {
  font-size: 0.8rem;
  color: #888;
  font-style: italic;
}

.voting-status {
  text-align: center;
}

.vote-status-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 500;
}

.vote-status-message.success {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.vote-status-message.info {
  background: rgba(23, 162, 184, 0.1);
  color: #17a2b8;
  border: 1px solid rgba(23, 162, 184, 0.3);
}

/* Results Card Specific */
.results-card {
  grid-column: 1;
  grid-row: 1 / 3;
}

.winner-announcement {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 107, 107, 0.1));
  border-radius: 16px;
  border: 2px solid rgba(255, 193, 7, 0.3);
}

.winner-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.winner-header svg {
  color: #ffc107;
}

.winner-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.winner-content {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: center;
}

.winner-image {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid rgba(255, 193, 7, 0.5);
}

.winner-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.winner-info h4 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffc107;
  margin: 0 0 0.5rem 0;
}

.winner-votes {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.5rem 0;
}

.winner-voters {
  font-size: 0.9rem;
  color: #ccc;
}

.breakdown-section,
.leaderboard-section {
  margin-bottom: 2rem;
}

.breakdown-section h4,
.leaderboard-section h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.results-list,
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-item,
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-item.winner {
  border-color: rgba(255, 193, 7, 0.3);
  background: rgba(255, 193, 7, 0.1);
}

.leaderboard-item.current-user {
  border-color: rgba(75, 93, 255, 0.3);
  background: rgba(75, 93, 255, 0.1);
}

.result-rank,
.leaderboard-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  font-weight: 600;
  font-size: 0.9rem;
}

.result-item.winner .result-rank {
  background: rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

.result-image {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
}

.result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-info,
.leaderboard-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.result-username,
.leaderboard-username {
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.2rem;
}

.result-votes,
.leaderboard-score {
  font-size: 0.9rem;
  color: #ccc;
}

.leaderboard-wins {
  font-size: 0.9rem;
  color: #888;
  font-style: italic;
}

.total-votes {
  text-align: center;
  margin-top: 1rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: #ccc;
  font-size: 0.9rem;
}

/* Chat Card Specific */
.chat-card {
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  max-height: 600px;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.status-indicator.online {
  background: #28a745;
  box-shadow: 0 0 8px rgba(40, 167, 69, 0.5);
}

.status-text {
  font-size: 0.8rem;
  color: #28a745;
  font-weight: 500;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  margin-bottom: 1rem;
  max-height: 400px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-message {
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border-left: 3px solid #4b5dff;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.message-username {
  font-weight: 600;
  color: #4b5dff;
  font-size: 0.9rem;
}

.message-timestamp {
  font-size: 0.7rem;
  color: #888;
}

.message-content {
  color: #ccc;
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

.chat-input-container {
  margin-top: auto;
}

.input-wrapper {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  color: #fff;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.chat-input:focus {
  outline: none;
  border-color: #4b5dff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(75, 93, 255, 0.1);
}

.chat-input::placeholder {
  color: #666;
}

.chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chat-send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(75, 93, 255, 0.4);
}

/* Loading Section */
.loading-section {
  text-align: center;
  padding: 3rem 2rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 2rem 0;
}

.loading-section.animate-in {
  animation: slideInUp 0.6s ease-out;
}

.loading-animation {
  margin-bottom: 2rem;
}

.loading-spinner-large {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #4b5dff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.loading-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.5rem 0;
}

.loading-text {
  font-size: 1rem;
  color: #888;
  margin: 0 0 2rem 0;
}

.progress-bar-modern {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4b5dff, #aa64f9);
  border-radius: 4px;
  animation: progressFlow 2s ease-in-out infinite;
}

@keyframes progressFlow {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

/* Image Result Container */
.image-result-container {
  margin-top: 2rem;
}

.result-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.result-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.result-actions {
  display: flex;
  gap: 0.8rem;
}

.result-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.result-btn.primary {
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  color: white;
}

.result-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(75, 93, 255, 0.3);
}

.result-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.result-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Game Info Modal Styles */
.game-modal-content {
  padding: 1rem 0;
}

.game-modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.game-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-badge.public {
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.game-badge.private {
  background: rgba(108, 117, 125, 0.2);
  color: #6c757d;
  border: 1px solid rgba(108, 117, 125, 0.3);
}

.game-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.game-modal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.modal-stat-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(75, 93, 255, 0.1);
  color: #4b5dff;
}

.modal-stat-content {
  flex: 1;
}

.modal-stat-label {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.game-modal-players {
  margin-bottom: 2rem;
}

.modal-players-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-players-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.modal-player-tag {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-player-tag.current-user {
  border-color: rgba(75, 93, 255, 0.3);
  background: rgba(75, 93, 255, 0.1);
}

.player-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.player-name {
  flex: 1;
  font-weight: 600;
  color: #fff;
}

.you-badge {
  padding: 0.2rem 0.6rem;
  background: rgba(75, 93, 255, 0.2);
  color: #4b5dff;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.game-modal-owner {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.owner-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.owner-label {
  font-size: 0.9rem;
  color: #888;
}

.owner-name {
  font-weight: 600;
  color: #fff;
}

/* Responsive Design for Game Page */
@media (max-width: 1024px) {
  .game-content-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .chat-card {
    grid-column: 1;
    grid-row: auto;
    max-height: 400px;
  }
  
  .image-generation-card,
  .voting-card,
  .results-card {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 768px) {
  .game-page-container {
    padding: 1rem;
    gap: 1.5rem;
  }
  
  .game-alert-card {
    padding: 1.5rem;
  }
  
  .round-status-content {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
  }
  
  .card-header {
    padding: 1rem 1.5rem;
  }
  
  .card-content {
    padding: 1.5rem;
  }
  
  .countdown-number {
    font-size: 3rem;
  }
  
  .message-text {
    font-size: 2.5rem;
  }
  
  .timer-circle {
    min-width: 120px;
    min-height: 120px;
    padding: 1.5rem;
  }
  
  .timer-number {
    font-size: 2rem;
  }
  
  .voting-grid {
    grid-template-columns: 1fr;
  }
  
  .winner-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .winner-image {
    width: 100px;
    height: 100px;
  }
  
  .game-modal-stats {
    grid-template-columns: 1fr;
  }
  
  .modal-players-list {
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .game-page-container {
    padding: 0.5rem;
  }
  
  .game-alert-card {
    padding: 1rem;
  }
  
  .card-header {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .card-content {
    padding: 1rem;
  }
  
  .countdown-display-large {
    padding: 2rem 1rem;
  }
  
  .countdown-number {
    font-size: 2.5rem;
  }
  
  .countdown-label {
    font-size: 1.2rem;
  }
  
  .message-text {
    font-size: 2rem;
  }
  
  .timer-circle {
    min-width: 100px;
    min-height: 100px;
    padding: 1rem;
  }
  
  .timer-number {
    font-size: 1.8rem;
  }
  
  .result-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .result-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .result-btn {
    justify-content: center;
  }
  
  .chat-messages {
    max-height: 300px;
  }
  
  .modal-player-tag {
    padding: 0.6rem 0.8rem;
  }
  
  .player-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
}
