/* Dark theme overrides for The Game */
:root {
  /* Override design system colors for dark theme */
  --color-background: #0a0a0a;
  --color-surface: #1a1a1a;
  --color-text: #ffffff;
  --color-text-secondary: #cccccc;
  --color-primary: #00ff88;
  --color-primary-hover: #00e577;
  --color-primary-active: #00cc66;
  --color-secondary: #2a2a2a;
  --color-secondary-hover: #3a3a3a;
  --color-secondary-active: #4a4a4a;
  --color-border: #333333;
  --color-btn-primary-text: #0a0a0a;
  --color-card-border: #333333;

  /* Custom colors for The Game */
  --neon-green: #00ff88;
  --electric-blue: #00aaff;
  --neon-purple: #aa00ff;
  --dark-gray: #1a1a1a;
  --darker-gray: #0a0a0a;
  --medium-gray: #2a2a2a;
  --light-gray: #4a4a4a;

  /* Glowing effects */
  --glow-green: 0 0 20px rgba(0, 255, 136, 0.3);
  --glow-blue: 0 0 20px rgba(0, 170, 255, 0.3);
  --glow-purple: 0 0 20px rgba(170, 0, 255, 0.3);
  --glow-intense: 0 0 30px rgba(0, 255, 136, 0.6), 0 0 60px rgba(0, 255, 136, 0.4);
}

/* Global styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, var(--darker-gray) 0%, var(--dark-gray) 50%, var(--darker-gray) 100%);
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  position: relative;
  min-height: 100vh;
}

/* Screen transitions */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
  padding: 2rem 0;
}

.screen.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* Hero section */
.hero-section {
  text-align: center;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  animation: pulse 4s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  background: linear-gradient(45deg, var(--neon-green), var(--electric-blue), var(--neon-purple));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease-in-out infinite;
  text-shadow: var(--glow-green);
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--color-text-secondary);
  margin-bottom: 3rem;
  position: relative;
  z-index: 2;
}

.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, var(--neon-green), transparent),
    radial-gradient(2px 2px at 40px 70px, var(--electric-blue), transparent),
    radial-gradient(1px 1px at 90px 40px, var(--neon-purple), transparent),
    radial-gradient(1px 1px at 130px 80px, var(--neon-green), transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: particleFloat 20s linear infinite;
  opacity: 0.6;
}

/* Methods grid */
.methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.method-card {
  background: var(--color-surface);
  border: 1px solid var(--color-card-border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
}

.method-card:hover {
  transform: translateY(-5px);
  border-color: var(--neon-green);
  box-shadow: var(--glow-green);
}

.method-card:hover .method-glow {
  opacity: 1;
}

.method-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.method-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.method-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.method-description {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.method-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

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

.btn--primary {
  background: var(--color-primary);
  color: var(--color-btn-primary-text);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--glow-green);
}

.btn--secondary {
  background: var(--color-secondary);
  color: var(--color-text);
}

.btn--secondary:hover {
  background: var(--color-secondary-hover);
  transform: translateY(-2px);
}

/* Stats Section */
.stats-section {
  margin-top: 4rem;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--neon-green);
  margin-bottom: 0.5rem;
}

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

/* Method content */
.method-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem 1rem;
}

.method-heading {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, var(--neon-green), var(--electric-blue));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.method-intro {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
}

/* System Alert Styles */
.system-alert {
  background: var(--color-surface);
  border: 2px solid var(--color-warning);
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  margin: 2rem auto;
  position: relative;
}

.alert-header {
  background: var(--color-warning);
  color: var(--darker-gray);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.alert-content {
  padding: 1.5rem;
}

.alert-content p {
  margin-bottom: 1rem;
}

/* Progress bar for loading */
.progress-bar {
  width: 100%;
  height: 20px;
  background: var(--medium-gray);
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0;
  border: 1px solid var(--color-border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-green), var(--electric-blue));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 10px;
  box-shadow: var(--glow-green);
}

.progress-text {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0.5rem 0;
  display: flex;
  justify-content: space-between;
}

/* Loading container */
.loading-container {
  max-width: 600px;
  margin: 3rem auto;
}

/* Memory Game */
.memory-game {
  margin: 2rem 0;
}

.game-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--medium-gray);
  border-radius: 8px;
}

.stat {
  font-weight: 600;
  color: var(--neon-green);
}

.memory-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 300px;
  margin: 2rem auto;
}

.memory-button {
  width: 100px;
  height: 100px;
  border: 3px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.memory-button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.memory-button.active {
  transform: scale(0.95);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
  filter: brightness(1.5);
}

.memory-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.game-status {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1rem 0;
  color: var(--electric-blue);
}

/* Typing Test */
.typing-test {
  margin: 2rem 0;
}

.typing-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--medium-gray);
  border-radius: 8px;
}

.text-to-type {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  font-size: 1.2rem;
  font-family: monospace;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--electric-blue);
}

.typing-input {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: monospace;
  font-size: 1rem;
  resize: vertical;
}

.typing-input:focus {
  border-color: var(--neon-green);
  box-shadow: var(--glow-green);
}

.typing-controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
}

/* Quiz Styles */
.quiz-container {
  margin: 2rem 0;
}

.quiz-progress {
  margin-bottom: 2rem;
}

.quiz-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--medium-gray);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-green), var(--electric-blue));
  width: 0%;
  transition: width 0.5s ease;
  border-radius: 4px;
}

.quiz-counter {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.quiz-question h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.quiz-options {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.quiz-option {
  background: var(--medium-gray);
  border: 2px solid var(--color-border);
  color: var(--color-text);
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.quiz-option:hover {
  border-color: var(--neon-green);
  box-shadow: var(--glow-green);
}

.quiz-option.selected {
  border-color: var(--neon-green);
  background: rgba(0, 255, 136, 0.1);
}

/* Link Builder */
.link-builder-form {
  max-width: 500px;
  margin: 0 auto;
  text-align: left;
}

.selected-method {
  margin-bottom: 2rem;
}

.method-display {
  background: var(--medium-gray);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--neon-green);
}

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

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1rem;
}

.form-control:focus {
  border-color: var(--neon-green);
  outline: none;
  box-shadow: var(--glow-green);
}

.link-display {
  display: flex;
  gap: 0.5rem;
}

.qr-section {
  margin-top: 2rem;
  text-align: center;
}

.qr-code-display {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  display: inline-block;
  margin: 1rem 0;
}

#qr-image {
  display: block;
  max-width: 200px;
  max-height: 200px;
}

/* Reveal messages */
.reveal-message {
  margin: 3rem 0;
  padding: 2rem;
  background: var(--medium-gray);
  border: 2px solid var(--neon-green);
  border-radius: 12px;
  box-shadow: var(--glow-intense);
  animation: slideUp 0.5s ease-out;
}

.reveal-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--neon-green);
  margin-bottom: 1rem;
}

.reveal-subtext {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.custom-message-container {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.1rem;
  color: var(--electric-blue);
  font-weight: 500;
}

/* Back button */
.back-btn {
  margin-top: 2rem;
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Animations */
@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

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

@keyframes particleFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100px); }
}

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

/* Responsive design */
@media (max-width: 768px) {
  .methods-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .method-card {
    padding: 1.5rem;
  }

  .hero-title {
    font-size: 3rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .memory-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-width: 250px;
  }

  .memory-button {
    width: 80px;
    height: 80px;
  }

  .typing-stats {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .typing-controls {
    flex-direction: column;
    align-items: center;
  }

  .link-display {
    flex-direction: column;
  }
}