/* ===== PAGE-SPECIFIC STYLES ===== */

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

.gaming-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, rgba(15, 20, 25, 0.98), rgba(30, 35, 45, 0.98));
  backdrop-filter: blur(20px);
  border-bottom: 2px solid rgba(75, 93, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

/* Gaming Brand */
.brand {
  align-items: center;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.brand:hover {
  color: #4b5dff;
  transform: scale(1.05);
}

.brand-name {
  font-weight: 800;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Modern Gaming Navigation */
.gaming-nav {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
  max-width: 300px;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #ccc;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.3s ease;
  min-width: 60px;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(75, 93, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.nav-btn:hover::before {
  left: 100%;
}

.nav-btn:hover {
  color: #fff;
  background: rgba(75, 93, 255, 0.2);
  border-color: rgba(75, 93, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(75, 93, 255, 0.3);
}

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

.nav-icon {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 4px rgba(75, 93, 255, 0.3));
}

.nav-text {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* User Section */
.auth-section {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* User Dropdown */
.user-dropdown-container {
  position: relative;
}

.user-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: transparent !important;
  border: none !important;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.user-dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.user-dropdown-trigger.active {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-dropdown-trigger.active:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(75, 93, 255, 0.3);
}

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

.user-avatar,
.user-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

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

.dropdown-arrow {
  color: #888;
  transition: transform 0.3s ease;
}

.user-dropdown-trigger:hover .dropdown-arrow {
  color: #4b5dff;
  transform: rotate(180deg);
}

/* Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 160px;
  background: rgba(20, 25, 35, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(75, 93, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  max-width: calc(100vw - 2rem);
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover:not(.disabled) {
  background: rgba(75, 93, 255, 0.2);
  color: #4b5dff;
}

.dropdown-item.disabled {
  color: #666;
  cursor: not-allowed;
  opacity: 0.5;
}

.dropdown-icon {
  font-size: 1rem;
  width: 16px;
  text-align: center;
}

.dropdown-text {
  flex: 1;
}

/* Mobile Navigation Section in Dropdown */
.dropdown-nav-section {
  display: none;
}

.dropdown-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-nav-item:hover {
  background: rgba(75, 93, 255, 0.2);
  color: #4b5dff;
}

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

/* Show navigation in dropdown for all screen sizes */
.dropdown-nav-section.mobile-only {
  display: block;
}

/* Login Section */
.login-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.login-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  color: white;
  text-decoration: none;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  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);
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
  .header-container {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }
  
  .brand {
    font-size: 0.9rem;
  }
  
  .brand-name {
    font-size: 0.9rem;
  }
  
  .gaming-nav {
    display: none;
  }
  
  .username {
    display: none;
  }
  
  .user-dropdown-menu {
    right: 0;
    left: auto;
    min-width: 200px;
    max-width: calc(100vw - 1rem);
    margin-right: 0.5rem;
  }
  
  /* Show navigation section on mobile */
  .dropdown-nav-section.mobile-only {
    display: block;
  }
  
  /* Ensure dropdown doesn't extend beyond viewport */
  .user-dropdown-container {
    position: relative;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0.5rem;
  }
  
  .brand {
    font-size: 0.7rem;
  }
  
  .brand-name {
    font-size: 0.7rem;
  }
  
  .login-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
  
  .user-dropdown-menu {
    right: 0;
    left: auto;
    min-width: 180px;
    max-width: calc(100vw - 1rem);
    margin-right: 0.25rem;
    position: absolute;
    z-index: 1000;
  }
  
  /* Adjust dropdown items for mobile */
  .dropdown-item,
  .dropdown-nav-item {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Ensure proper spacing for mobile navigation */
  .dropdown-nav-section.mobile-only {
    padding-bottom: 0.5rem;
  }
  
  /* Ensure dropdown container doesn't interfere */
  .user-dropdown-container {
    position: relative;
    z-index: 1000;
  }
}

/* Ensure main content doesn't have excessive margins on mobile */
@media (max-width: 768px) {
  .page-background,
  .newgame-container,
  .user-container {
    margin: 0;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (max-width: 480px) {
  /* Further reduce margins on very small screens */
  .page-background,
  .newgame-container,
  .user-container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  /* Ensure header doesn't cause horizontal scroll but doesn't break dropdown */
  .header-container {
    max-width: 100%;
    overflow: visible;
  }
  
  /* Ensure auth section doesn't clip dropdown */
  .auth-section {
    overflow: visible;
    position: relative;
    z-index: 1000;
  }
}

/* ===== 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;
}

/* Responsive design for new game page */
@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%;
  }
}

/* ===== USER PROFILE PAGE STYLES ===== */

.user-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* User Profile Section */
.user-profile-section {
  width: 100%;
  animation: slideInUp 0.8s ease-out;
}

.user-profile-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 25px 50px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
}

.user-profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4b5dff, #aa64f9, #10b981);
  background-size: 200% 100%;
  animation: profileGradient 3s ease-in-out infinite;
}

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

.profile-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  padding: 2rem;
  align-items: center;
}

/* Avatar Section */
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.profile-avatar-container {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(75, 93, 255, 0.3);
  box-shadow: 0 10px 30px rgba(75, 93, 255, 0.2);
  transition: all 0.3s ease;
}

.profile-avatar-container:hover {
  transform: scale(1.05);
  border-color: rgba(75, 93, 255, 0.5);
  box-shadow: 0 15px 40px rgba(75, 93, 255, 0.3);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4b5dff, #aa64f9);
  color: white;
}

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

.avatar-rarity {
  font-size: 0.8rem;
  color: #10b981;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.avatar-code {
  font-size: 0.9rem;
  color: #888;
  font-family: 'Courier New', monospace;
}

/* Profile Info Section */
.profile-info-section {
  flex: 1;
}

.profile-title-section {
  margin-bottom: 1.5rem;
}

.profile-username {
  font-size: 2.2rem;
  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;
}

.profile-subtitle {
  font-size: 1rem;
  color: #888;
  margin: 0;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

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

.stat-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

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

.stat-content {
  display: flex;
  flex-direction: column;
}

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

.stat-value {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 600;
}

/* Profile Actions */
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Gallery Section */
.gallery-section {
  animation: slideInUp 0.8s ease-out 0.2s both;
}

.gallery-header {
  text-align: center;
  margin-bottom: 2rem;
}

.gallery-title {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem 0;
}

.gallery-subtitle {
  font-size: 1rem;
  color: #888;
  margin: 0;
}

.gallery-controls {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Action buttons matching newgame.html style */
.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  justify-content: center;
}

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

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 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);
}

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

.action-btn.tertiary {
  background: rgba(255, 255, 255, 0.05);
  color: #888;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.action-btn.tertiary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
}

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

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

/* Try Again Button Styling */
.result-btn.try-again {
  background: rgba(255, 165, 0, 0.1);
  color: #ffa500;
  border: 1px solid rgba(255, 165, 0, 0.3);
}

.result-btn.try-again:hover {
  background: rgba(255, 165, 0, 0.2);
  border-color: rgba(255, 165, 0, 0.5);
  transform: translateY(-1px);
}

/* UI State Management */
.image-generator-container.ui-state-loading .style-toggle-btn,
.image-generator-container.ui-state-result .style-toggle-btn {
  display: none !important;
}

.image-generator-container.ui-state-loading .generator-field:nth-child(2),
.image-generator-container.ui-state-result .generator-field:nth-child(2) {
  display: none !important;
}

.image-generator-container.ui-state-loading .generator-actions,
.image-generator-container.ui-state-result .generator-actions {
  display: none !important;
}

/* Timer Container Styles */
.timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.timer-display {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  transition: color 0.3s ease;
  text-shadow: 0 0 10px currentColor;
}

.timer-display.timer-green {
  color: #10b981;
}

.timer-display.timer-yellow {
  color: #f59e0b;
}

.timer-display.timer-red {
  color: #ef4444;
}

.timer-message {
  font-size: 0.9rem;
  color: #ef4444;
  font-weight: 500;
  text-align: center;
  min-height: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timer-message:not(:empty) {
  opacity: 1;
}

/* Responsive Design for User Profile */
@media (max-width: 1024px) {
  .profile-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }
  
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .user-container {
    padding: 1rem;
    gap: 1.5rem;
  }
  
  .profile-header {
    padding: 1.5rem;
  }
  
  .profile-avatar-container {
    width: 100px;
    height: 100px;
  }
  
  .profile-username {
    font-size: 1.8rem;
  }
  
  .profile-stats-grid {
    gap: 0.8rem;
  }
  
  .stat-item {
    padding: 0.8rem;
  }
  
  .gallery-controls {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .profile-header {
    padding: 1rem;
  }
  
  .profile-avatar-container {
    width: 80px;
    height: 80px;
  }
  
  .profile-username {
    font-size: 1.5rem;
  }
  
  .stat-item {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .action-btn {
    padding: 0.7rem 1.2rem;
    font-size: 0.85rem;
  }
}

/* ===== VISUAL STYLE SELECTOR STYLES ===== */

/* Selected Style Preview (Always Visible) */
.selected-style-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.selected-style-preview:hover {
  border-color: rgba(75, 93, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.selected-style-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.selected-style-image-container {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.selected-style-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-style-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.selected-style-label {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.selected-style-name {
  font-size: 1rem;
  color: #fff;
  font-weight: 600;
}

.style-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(75, 93, 255, 0.1);
  border: 1px solid rgba(75, 93, 255, 0.3);
  border-radius: 8px;
  color: #4b5dff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.style-toggle-btn:hover {
  background: rgba(75, 93, 255, 0.2);
  border-color: rgba(75, 93, 255, 0.5);
  transform: translateY(-1px);
}

.toggle-icon {
  transition: transform 0.3s ease;
}

.toggle-icon.rotated {
  transform: rotate(180deg);
}

/* Collapsible Style Selector Container */
.style-selector-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease, overflow 0s ease 0.4s;
  opacity: 0;
  margin-bottom: 0;
  position: relative;
  z-index: 50;
}

.style-selector-container.expanded {
  max-height: none; /* Allow natural height expansion */
  overflow: visible;
  transition: max-height 0.4s ease, opacity 0.3s ease, overflow 0s ease 0s;
  opacity: 1;
  margin-bottom: 1rem;
  z-index: 50;
}

.style-selector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding-top: 1rem;
}

.style-option {
  position: relative;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
}

.style-option:hover {
  transform: translateY(-2px);
  border-color: rgba(75, 93, 255, 0.3);
  box-shadow: 0 8px 25px rgba(75, 93, 255, 0.2);
}

.style-option.selected {
  border-color: #4b5dff;
  background: rgba(75, 93, 255, 0.1);
  box-shadow: 0 8px 25px rgba(75, 93, 255, 0.3);
}

.style-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

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

.style-option:hover .style-image {
  transform: scale(1.05);
}

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

.style-option.selected .style-overlay {
  opacity: 1;
}

.style-checkmark {
  width: 32px;
  height: 32px;
  background: #4b5dff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.style-option.selected .style-checkmark {
  transform: scale(1);
}

.style-label {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: #ccc;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

.style-option.selected .style-label {
  color: #4b5dff;
  font-weight: 600;
}

.style-option:hover .style-label {
  color: #fff;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
  .style-selector-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
  }
  
  .style-option {
    padding: 0.4rem;
  }
  
  .style-label {
    font-size: 0.75rem;
  }
  
  .style-checkmark {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .style-selector-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
  
  .style-option {
    padding: 0.3rem;
  }
  
  .style-label {
    font-size: 0.7rem;
  }
  
  .style-checkmark {
    width: 24px;
    height: 24px;
  }
}

/* Animation for style options loading */
.style-option {
  opacity: 0;
  transform: translateY(20px);
  animation: styleOptionFadeIn 0.5s ease-out forwards;
}

.style-option:nth-child(1) { animation-delay: 0.1s; }
.style-option:nth-child(2) { animation-delay: 0.15s; }
.style-option:nth-child(3) { animation-delay: 0.2s; }
.style-option:nth-child(4) { animation-delay: 0.25s; }
.style-option:nth-child(5) { animation-delay: 0.3s; }
.style-option:nth-child(6) { animation-delay: 0.35s; }
.style-option:nth-child(7) { animation-delay: 0.4s; }
.style-option:nth-child(8) { animation-delay: 0.45s; }
.style-option:nth-child(9) { animation-delay: 0.5s; }
.style-option:nth-child(10) { animation-delay: 0.55s; }
.style-option:nth-child(11) { animation-delay: 0.6s; }
.style-option:nth-child(12) { animation-delay: 0.65s; }
.style-option:nth-child(13) { animation-delay: 0.7s; }
.style-option:nth-child(14) { animation-delay: 0.75s; }
.style-option:nth-child(15) { animation-delay: 0.8s; }
.style-option:nth-child(16) { animation-delay: 0.85s; }
.style-option:nth-child(17) { animation-delay: 0.9s; }
.style-option:nth-child(18) { animation-delay: 0.95s; }
.style-option:nth-child(19) { animation-delay: 1s; }
.style-option:nth-child(20) { animation-delay: 1.05s; }

@keyframes styleOptionFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
