/* QuestQuick Arena - Dark Fantasy Theme */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@300;400;500;600;700&family=Cinzel+Decorative:wght@400;700;900&display=swap');

/* CSS Custom Properties - Dark Fantasy Color Palette */
:root {
  /* Primary Palette */
  --primary: #8b5cf6;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  
  /* Background Theme */
  --bg-main: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f172a 100%);
  --bg-dark: #1a1a2e;
  --bg-darker: #16213e;
  --bg-darkest: #0f172a;
  --text-light: #e2e8f0;
  --text-muted: #94a3b8;
  
  /* Crystal Colors */
  --crystal-red: #dc2626;
  --crystal-blue: #2563eb;
  --crystal-green: #16a34a;
  --crystal-purple: #7c3aed;
  --crystal-yellow: #ca8a04;
  --crystal-pink: #ec4899;
  --crystal-cyan: #0891b2;
  --crystal-orange: #ea580c;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent) 0%, #fbbf24 100%);
  --gradient-success: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
  
  /* Magical Effects */
  --glow-primary: 0 0 20px rgba(139, 92, 246, 0.6);
  --glow-secondary: 0 0 20px rgba(6, 182, 212, 0.6);
  --glow-accent: 0 0 20px rgba(245, 158, 11, 0.6);
  
  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cinzel', serif;
  background: var(--bg-main);
  color: var(--text-light);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Floating Magical Particles Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(245, 158, 11, 0.05) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(120deg); }
  66% { transform: translateY(10px) rotate(240deg); }
}

/* Container */
.container {
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  box-sizing: border-box;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 3rem;
  background: rgba(139, 92, 246, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 
    var(--glow-primary),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.title {
  font-family: 'Cinzel Decorative', serif;
  font-size: 4rem;
  font-weight: 900;
  color: var(--text-light);
  text-shadow: 
    0 0 30px rgba(139, 92, 246, 0.8),
    0 0 60px rgba(139, 92, 246, 0.4);
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGlow 4s ease-in-out infinite alternate;
}

@keyframes titleGlow {
  from { filter: brightness(1) drop-shadow(0 0 10px rgba(139, 92, 246, 0.5)); }
  to { filter: brightness(1.2) drop-shadow(0 0 20px rgba(139, 92, 246, 0.8)); }
}

.subtitle {
  font-size: 1.3rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-weight: 400;
}

/* Player Stats */
.player-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  font-weight: 600;
  font-size: 1.1rem;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
  transition: var(--transition-smooth);
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.4);
}

.stat-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 10px currentColor);
}

/* XP Progress */
.xp-progress {
  margin: 2rem auto;
  max-width: 400px;
}

.progress-bar {
  width: 100%;
  height: 24px;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(139, 92, 246, 0.4);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: var(--glow-primary);
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Challenge Grid */
.challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Challenge Cards */
.challenge-card {
  background: rgba(139, 92, 246, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 8px 32px rgba(139, 92, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.challenge-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition-smooth);
  z-index: -1;
}

.challenge-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--primary);
  box-shadow: 
    var(--glow-primary),
    0 20px 40px rgba(139, 92, 246, 0.2);
}

.challenge-card:hover::before {
  opacity: 0.1;
}

.challenge-card:hover .challenge-icon {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 0 20px currentColor);
}

.challenge-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  transition: var(--transition-bounce);
  text-shadow: 0 0 20px currentColor;
}

.challenge-card h3 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 1.8rem;
  font-weight: 700;
}

.challenge-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.xp-reward {
  background: var(--gradient-accent);
  color: var(--bg-dark);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  display: inline-block;
  margin: 0.5rem 0;
  box-shadow: var(--glow-accent);
}

.high-score {
  color: var(--success);
  font-size: 0.95rem;
  font-style: italic;
  margin-top: 1rem;
  opacity: 0.8;
}

/* Achievements Section */
.achievements {
  background: rgba(6, 182, 212, 0.08);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(6, 182, 212, 0.2);
  padding: 2.5rem;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--glow-secondary);
}

.achievements h3 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 2rem;
  font-weight: 700;
}

.high-score-item {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.75rem 1.25rem;
  margin: 0.5rem;
  border-radius: 12px;
  display: inline-block;
  transition: var(--transition-smooth);
  font-weight: 500;
}

.high-score-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

/* Challenge Page Styles */
.challenge-header {
  background: rgba(139, 92, 246, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 2.5rem;
  border-radius: 20px;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--glow-primary);
}

.challenge-header h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.challenge-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.timer, .xp-reward {
  font-size: 1.3rem;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  border: 1px solid;
}

.timer {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

/* Game Area */
.game-area {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 20px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  min-height: 500px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.sequence-area, .question-area, .pattern-area, .spell-area {
  margin-bottom: 2rem;
  padding: 2rem;
  background: rgba(6, 182, 212, 0.05);
  border: 2px dashed rgba(6, 182, 212, 0.3);
  border-radius: 16px;
  text-align: center;
}

.input-area {
  text-align: center;
  margin-top: 2rem;
}

/* Game Buttons */
.symbol-buttons, .color-buttons, .crystal-buttons, .rune-buttons, .element-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.symbol-btn, .color-btn, .crystal-btn, .rune-btn, .element-btn {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 600;
  padding: 1rem 1.5rem;
  border: 2px solid var(--primary);
  border-radius: 16px;
  background: rgba(139, 92, 246, 0.1);
  backdrop-filter: blur(10px);
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition-bounce);
  min-width: 80px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.symbol-btn::before, .color-btn::before, .crystal-btn::before, .rune-btn::before, .element-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.symbol-btn:hover::before, .color-btn:hover::before, .crystal-btn:hover::before, .rune-btn:hover::before, .element-btn:hover::before {
  left: 100%;
}

.symbol-btn:hover, .color-btn:hover, .crystal-btn:hover, .rune-btn:hover, .element-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--glow-primary);
  border-color: var(--secondary);
}

.crystal-btn {
  border-color: var(--crystal-purple);
  background: rgba(124, 58, 237, 0.1);
}

.rune-btn {
  border-color: var(--crystal-cyan);
  background: rgba(8, 145, 178, 0.1);
}

.element-btn {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
}

/* Crystal Colors */
.color-btn.red, .rune-btn.fire, .element-btn.fire { 
  background: rgba(220, 38, 38, 0.2); 
  border-color: var(--crystal-red);
  color: var(--crystal-red);
}
.color-btn.blue, .rune-btn.water, .element-btn.water { 
  background: rgba(37, 99, 235, 0.2); 
  border-color: var(--crystal-blue);
  color: var(--crystal-blue);
}
.color-btn.green, .rune-btn.earth, .element-btn.earth { 
  background: rgba(22, 163, 74, 0.2); 
  border-color: var(--crystal-green);
  color: var(--crystal-green);
}
.color-btn.purple, .rune-btn.air, .element-btn.air { 
  background: rgba(124, 58, 237, 0.2); 
  border-color: var(--crystal-purple);
  color: var(--crystal-purple);
}
.color-btn.gold { 
  background: rgba(202, 138, 4, 0.2); 
  border-color: var(--crystal-yellow);
  color: var(--crystal-yellow);
}
.element-btn.light { 
  background: rgba(202, 138, 4, 0.2); 
  border-color: var(--crystal-yellow);
  color: var(--crystal-yellow);
}
.element-btn.shadow { 
  background: rgba(15, 23, 42, 0.8); 
  border-color: var(--bg-darker);
  color: var(--text-muted);
}

/* Action Buttons */
.action-btn, .back-btn {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 1rem 2rem;
  border: none;
  border-radius: 16px;
  background: var(--gradient-primary);
  color: white;
  cursor: pointer;
  transition: var(--transition-bounce);
  margin: 1rem;
  box-shadow: var(--glow-primary);
  position: relative;
  overflow: hidden;
}

.action-btn::before, .back-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.action-btn:hover::before, .back-btn:hover::before {
  left: 100%;
}

.action-btn:hover, .back-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    var(--glow-primary),
    0 10px 30px rgba(139, 92, 246, 0.4);
}

.back-btn {
  background: var(--gradient-accent);
  box-shadow: var(--glow-accent);
}

/* Game Elements */
#pattern-input, #rune-pattern, #spell-recipe {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  min-height: 80px;
  align-items: center;
  flex-wrap: wrap;
}

.pattern-slot, .rune-slot, .element-slot {
  width: 70px;
  height: 70px;
  border: 2px solid var(--primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: rgba(139, 92, 246, 0.05);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pattern-slot:not(:empty), .rune-slot:not(:empty), .element-slot:not(:empty) {
  box-shadow: var(--glow-primary);
  transform: scale(1.05);
}

/* Result Area */
.result-area {
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid rgba(16, 185, 129, 0.4);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
  box-shadow: var(--glow-secondary);
}

.result-area.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.xp-earned {
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
  text-shadow: var(--glow-accent);
  animation: bounce 1s ease-in-out;
}

.level-up {
  color: var(--danger);
  font-size: 1.6rem;
  font-weight: 700;
  animation: levelUpGlow 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 20%, 60%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  80% { transform: translateY(-5px); }
}

@keyframes levelUpGlow {
  0%, 100% { 
    text-shadow: 0 0 10px currentColor;
    transform: scale(1);
  }
  50% { 
    text-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
    transform: scale(1.05);
  }
}

/* Controls */
.controls {
  text-align: center;
  margin-top: 2rem;
}

/* Difficulty Selection Modal */
.difficulty-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.difficulty-modal.active {
    display: flex;
}

.difficulty-modal-content {
  background: rgba(139, 92, 246, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 24px;
  padding: 3rem;
  text-align: center;
  max-width: 600px;
  width: 90%;
  box-shadow: var(--glow-primary);
  animation: slideUp 0.4s ease-out;
}

.difficulty-modal-content h2 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2.2rem;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.difficulty-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.difficulty-btn {
  font-family: 'Cinzel', serif;
  background: rgba(139, 92, 246, 0.1);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition-bounce);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

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

.difficulty-btn:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--glow-primary);
  border-color: var(--primary);
}

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

.difficulty-btn.easy {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.difficulty-btn.easy:hover {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
  border-color: var(--success);
}

.difficulty-btn.medium {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
}

.difficulty-btn.medium:hover {
  box-shadow: var(--glow-accent);
  border-color: var(--accent);
}

.difficulty-btn.hard {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.difficulty-btn.hard:hover {
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
  border-color: var(--danger);
}

.difficulty-stars {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.difficulty-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.difficulty-items {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.difficulty-xp {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.close-modal-btn {
  font-family: 'Cinzel', serif;
  background: rgba(239, 68, 68, 0.2);
  border: 2px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  color: var(--danger);
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-top: 1rem;
}

.close-modal-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  transform: translateY(-2px);
}

/* Difficulty Indicator in Challenge */
.difficulty-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.difficulty-badge {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 1.1rem;
  border: 2px solid;
}

.difficulty-badge.easy {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--success);
  color: var(--success);
}

.difficulty-badge.medium {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent);
  color: var(--accent);
}

.difficulty-badge.hard {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: var(--danger);
}

.difficulty-items {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Updated Challenge Cards */
.difficulty-rewards {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.difficulty-rewards small {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Authentication Styles */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  margin: 2rem 0;
  padding: 1rem;
}

.auth-card.full-width {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 2rem;
    box-sizing: border-box;
}

.auth-card {
  background: rgba(139, 92, 246, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 24px;
  padding: 3rem;
  max-width: 450px;
  width: 100%;
  box-shadow: var(--glow-primary);
  animation: slideUp 0.4s ease-out;
  grid-column: 1 / -1; /* Ocupa todas as colunas do grid */
}

.auth-card h2 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 2rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.form-group input {
  width: 100%;
  padding: 1rem;
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-light);
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
  transform: translateY(-1px);
}

.form-group input:invalid {
  border-color: var(--danger);
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-links {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(139, 92, 246, 0.2);
}

.auth-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.auth-links a:hover {
  color: var(--secondary);
  text-shadow: 0 0 10px currentColor;
}

/* Flash Messages */
.flash-messages {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 2000;
  max-width: 400px;
}

.flash-message {
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px);
  animation: slideInRight 0.3s ease-out;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.flash-success {
  background: rgba(16, 185, 129, 0.9);
  border: 1px solid var(--success);
  color: white;
}

.flash-error {
  background: rgba(239, 68, 68, 0.9);
  border: 1px solid var(--danger);
  color: white;
}

.flash-info {
  background: rgba(6, 182, 212, 0.9);
  border: 1px solid var(--secondary);
  color: white;
}

.flash-message button {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  margin-left: 1rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.flash-message button:hover {
  opacity: 1;
}

/* User Info in Header */
.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  justify-content: center;
  flex-wrap: wrap;
}

.user-welcome {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  font-weight: 600;
  color: var(--success);
}

.auth-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.auth-btn {
  font-family: 'Cinzel', serif;
  padding: 0.5rem 1rem;
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.1);
  color: var(--text-light);
  text-decoration: none;
  transition: var(--transition-smooth);
  font-size: 0.9rem;
}

.auth-btn:hover {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.2);
  transform: translateY(-1px);
}

.logout-btn {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.logout-btn:hover {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.2);
}

/* Navigation Menu */
.nav-menu {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.nav-link {
  font-family: 'Cinzel', serif;
  padding: 0.75rem 1.5rem;
  border: 2px solid rgba(6, 182, 212, 0.3);
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.1);
  color: var(--secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
  font-weight: 600;
}

.nav-link:hover {
  border-color: var(--secondary);
  background: rgba(6, 182, 212, 0.2);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
  transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Rankings Page Styles */
.rankings-container {
  display: grid;
  gap: 2rem;
  margin-bottom: 3rem;
}

.ranking-section, .challenge-ranking-section {
  background: rgba(139, 92, 246, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--glow-primary);
}

.ranking-section h2, .challenge-ranking-section h3 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  text-align: center;
}

.ranking-card {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 16px;
  padding: 1.5rem;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 12px;
  transition: var(--transition-smooth);
}

.ranking-item:hover {
  background: rgba(6, 182, 212, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
}

.ranking-item.top-three {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.rank-position {
  font-size: 1.5rem;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

.player-info {
  flex: 1;
}

.player-name {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.player-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.completion-time {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

.difficulty-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.difficulty-tab {
  padding: 0.5rem 1rem;
  border: 2px solid;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-smooth);
  font-size: 0.9rem;
}

.difficulty-tab.easy {
  border-color: var(--success);
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.difficulty-tab.medium {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(245, 158, 11, 0.1);
}

.difficulty-tab.hard {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.difficulty-tab.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--primary);
  color: var(--primary);
}

.challenge-rankings {
  display: grid;
  gap: 2rem;
}

/* ===============================
   RPG NARRATIVE INTERFACE
   =============================== */

.rpg-container {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  min-height: 80vh;
  margin-top: 2rem;
}

@media (max-width: 1200px) {
  .rpg-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* RPG Main Area (Left Side) */
.rpg-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 80vh;
}

/* Scene Image */
.scene-image-container {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  height: 250px;
}

.scene-image {
  width: 100%;
  height: 100%;
  position: relative;
}

.scene-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #888;
  text-align: center;
}

.image-placeholder span {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

/* Narrative Log */
.narrative-log {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.3);
}

.log-header h3 {
  margin: 0;
  color: var(--accent-color);
}

.clear-btn {
  background: rgba(220, 53, 69, 0.2);
  color: #dc3545;
  border: 1px solid #dc3545;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-btn:hover {
  background: rgba(220, 53, 69, 0.3);
}

.log-content {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  max-height: 400px;
  scroll-behavior: smooth;
}

/* Chat Messages */
.chat-message {
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.5s ease;
}

.chat-message.narrator {
  border-left: 3px solid var(--accent-color);
  padding-left: 1rem;
}

.chat-message.player {
  border-left: 3px solid #28a745;
  padding-left: 1rem;
}

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

.message-type {
  font-weight: bold;
  font-size: 0.9rem;
}

.chat-message.narrator .message-type {
  color: var(--accent-color);
}

.chat-message.player .message-type {
  color: #28a745;
}

.message-time {
  font-size: 0.8rem;
  color: #888;
}

.message-content {
  line-height: 1.6;
  color: #e0e0e0;
}

.message-image {
  margin-top: 1rem;
  border-radius: 8px;
  overflow: hidden;
  max-width: 400px;
}

.message-image img {
  width: 100%;
  height: auto;
  display: block;
}

.dice-result {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
}

.dice-result.success {
  background: rgba(40, 167, 69, 0.2);
  border: 1px solid #28a745;
  color: #28a745;
}

.dice-result.failure {
  background: rgba(220, 53, 69, 0.2);
  border: 1px solid #dc3545;
  color: #dc3545;
}

.welcome-message {
  text-align: center;
  padding: 2rem;
  color: #888;
}

.welcome-message h4 {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

/* Player Input */
.player-input {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 1rem;
}

.input-group {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

#player-action {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.8rem;
  color: white;
  font-size: 1rem;
  resize: vertical;
  min-height: 2.5rem;
  max-height: 6rem;
  transition: all 0.3s ease;
}

#player-action:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

#send-action {
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-color), #c9a96e);
  border: none;
  border-radius: 8px;
  color: #000;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#send-action:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

#send-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#send-action.loading .btn-text {
  display: none;
}

#send-action.loading .btn-loading {
  display: inline;
}

.btn-loading {
  display: none;
}

.input-help {
  margin-top: 0.5rem;
  text-align: center;
}

.input-help small {
  color: #888;
  font-size: 0.8rem;
}

/* Character Panel (Right Side) */
.character-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: fit-content;
  position: sticky;
  top: 2rem;
}

.character-section,
.attributes-section,
.inventory-section,
.world-section {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 1rem;
}

.character-section h3,
.attributes-section h4,
.inventory-section h4,
.world-section h4 {
  margin: 0 0 1rem 0;
  color: var(--accent-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

/* Character Card */
.character-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.character-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color), #c9a96e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: #000;
}

.character-info h4 {
  margin: 0 0 0.5rem 0;
  color: white;
}

.character-level {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: #888;
}

/* Health Bar */
.health-section {
  margin-bottom: 1rem;
}

.health-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.health-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.health-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc3545, #28a745);
  transition: width 0.5s ease;
}

/* Attributes */
.attributes-grid {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.attribute-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.attr-name {
  font-size: 0.9rem;
  color: #ccc;
  flex: 1;
}

.attr-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.attr-dots {
  display: flex;
  gap: 2px;
}

.dot {
  font-size: 0.8rem;
  transition: color 0.3s ease;
}

.dot.filled {
  color: var(--accent-color);
}

.dot.empty {
  color: #333;
}

.attr-number {
  font-size: 0.8rem;
  color: #888;
  min-width: 15px;
  text-align: center;
}

/* Inventory */
.inventory-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inventory-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  color: #ccc;
  transition: all 0.3s ease;
}

.inventory-item:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.inventory-empty {
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* World State */
.world-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.world-item {
  font-size: 0.9rem;
}

.world-item strong {
  color: var(--accent-color);
  display: block;
  margin-bottom: 0.3rem;
}

.world-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.world-tag {
  background: rgba(212, 175, 55, 0.2);
  color: var(--accent-color);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

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

/* Session Controls */
.session-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-btn {
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.control-btn.danger {
  border-color: #dc3545;
  color: #dc3545;
}

.control-btn.danger:hover {
  background: rgba(220, 53, 69, 0.2);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

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

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(212, 175, 55, 0.3);
  border-top: 3px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Dice Modal */
.dice-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.dice-content {
  background: rgba(20, 20, 30, 0.95);
  border: 2px solid var(--accent-color);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.dice-content h3 {
  color: var(--accent-color);
  margin-bottom: 1.5rem;
}

.dice-animation {
  margin-bottom: 1.5rem;
}

.dice-roll {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.dice-calculation {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #ccc;
}

.dice-difficulty {
  font-size: 1rem;
  color: #888;
  margin-bottom: 1rem;
}

.dice-outcome {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.dice-outcome.success {
  color: #28a745;
}

.dice-outcome.failure {
  color: #dc3545;
}

.dice-context {
  font-style: italic;
  color: #aaa;
  margin-bottom: 1rem;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .rpg-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .character-panel {
    position: static;
  }
  
  .scene-image-container {
    height: 200px;
  }
  
  .log-content {
    max-height: 300px;
  }
  
  .input-group {
    flex-direction: column;
  }
  
  #player-action {
    min-height: 3rem;
  }
  
  .character-card {
    flex-direction: column;
    text-align: center;
  }
}

.empty-ranking, .empty-scores, .empty-history {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 2rem;
}

/* Profile Page Styles */
.profile-container {
  display: grid;
  gap: 2rem;
  margin-bottom: 3rem;
}

.profile-section {
  background: rgba(139, 92, 246, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--glow-primary);
}

.profile-section h2 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  text-align: center;
}

.profile-card {
  background: rgba(15, 23, 42, 0.6);
  border-radius: 16px;
  padding: 1.5rem;
}

.player-overview {
  display: grid;
  gap: 2rem;
}

.avatar-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.player-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  box-shadow: var(--glow-primary);
}

.player-info h3 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.join-date, .ranking-pos {
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-card.full-width {
    width: 100%;
    margin: 2rem 0;
    text-align: center;
    padding: 2rem;
    background: #fff2; /* opcional */
}

.auth-card.full-width .auth-actions {
    margin-top: 2rem;
}

.auth-card.full-width .action-btn {
    margin: 0.5rem;
}

/* Estilos para os botões de ação */
.auth-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.action-btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.high-scores-grid {
  display: grid;
  gap: 1rem;
}

.high-score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  transition: var(--transition-smooth);
}

.high-score-item:hover {
  background: rgba(16, 185, 129, 0.1);
  transform: translateY(-1px);
}

.challenge-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.challenge-icon {
  font-size: 1.5rem;
}

.challenge-name {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.score-info {
  text-align: right;
}

.best-time {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.achieved-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.recent-games-list {
  display: grid;
  gap: 0.75rem;
}

.game-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid;
  transition: var(--transition-smooth);
}

.game-item.success {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
}

.game-item.failed {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.game-item:hover {
  transform: translateY(-1px);
}

.game-details {
  flex: 1;
}

.game-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.game-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.game-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.error {
    color: #dc3545;
    font-size: 14px;
    display: block;
    margin-top: 5px;
}

.form-control.error-field {
    border-color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .title {
    font-size: 2.5rem;
  }
  
  .player-stats {
    gap: 1rem;
    flex-direction: column;
    align-items: center;
  }
  
  .stat-item {
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }
  
  .challenges-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .difficulty-modal-content {
    padding: 2rem 1rem;
    margin: 1rem;
  }
  
  .difficulty-buttons {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .difficulty-indicator {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .avatar-section {
    flex-direction: column;
    text-align: center;
  }
  
  .player-stats, .game-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .game-info {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .high-score-item, .game-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .score-info, .game-date {
    text-align: left;
  }
  
  .challenge-card {
    padding: 1.5rem;
  }
  
  .challenge-icon {
    font-size: 3rem;
  }
  
  .symbol-buttons, .color-buttons, .crystal-buttons, .rune-buttons, .element-buttons {
    gap: 0.75rem;
  }
  
  .symbol-btn, .color-btn, .crystal-btn, .rune-btn, .element-btn {
    font-size: 1.5rem;
    padding: 0.75rem 1rem;
    min-width: 60px;
    min-height: 60px;
  }
  
  .challenge-info {
    gap: 1rem;
    flex-direction: column;
    align-items: center;
  }
  
  .game-area {
    padding: 1.5rem;
  }
  
  .pattern-slot, .rune-slot, .element-slot {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

