/* Design System - Elegant Memory Game */
:root {
  /* Color Palette - Sophisticated & Mature */
  --primary-dark: #2c3e50;
  --primary-medium: #34495e;
  --primary-light: #ecf0f1;
  --accent-gold: #d4af37;
  --accent-warm: #c0392b;
  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --text-light: #ffffff;
  --background-overlay: rgba(44, 62, 80, 0.85);
  --card-background: rgba(255, 255, 255, 0.95);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.15);
  --shadow-medium: 0 15px 40px rgba(0, 0, 0, 0.2);
  --border-radius: 12px;
  --border-radius-large: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--background-overlay), var(--background-overlay)),
              url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80') center/cover no-repeat fixed;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 20px 80px 20px; /* Added bottom padding for footer */
  line-height: 1.6;
  color: var(--text-primary);
}

/* Typography Scale */
.text-display {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
}

.text-heading {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
}

.text-body {
  font-size: clamp(1rem, 2vw, 1.125rem);
  font-weight: 400;
  line-height: 1.6;
}

.text-caption {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

/* Main Container */
.game-container {
  background: var(--card-background);
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-medium);
  padding: clamp(2rem, 5vw, 3rem);
  max-width: 700px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.game-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-warm), var(--accent-gold));
  border-radius: var(--border-radius-large) var(--border-radius-large) 0 0;
}

/* Step Management */
.step {
  display: none;
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.step.active {
  display: block;
}

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

/* Question Styling */
.question {
  color: var(--text-primary);
  margin-bottom: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.question.intro {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Options Container */
.options {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Button System */
.option-btn {
  background: var(--card-background);
  border: 2px solid #e1e8ed;
  border-radius: var(--border-radius);
  padding: 1.25rem 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-weight: 500;
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.option-btn:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

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

.option-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-gold);
  transform: scaleY(0);
  transition: transform 0.3s ease;
  transform-origin: bottom;
}

.option-btn:hover::before {
  transform: scaleY(1);
}

/* Primary Button */
.restart-btn {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-medium) 100%);
  color: var(--text-light);
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 2rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.restart-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;
}

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

/* Summary Card */
.summary {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  padding: 2rem;
  border-radius: var(--border-radius);
  border: 2px solid #e9ecef;
  margin-bottom: 2rem;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.summary::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 4rem;
  color: var(--accent-gold);
  font-family: Georgia, serif;
  opacity: 0.3;
}

.summary::after {
  content: '"';
  position: absolute;
  bottom: -30px;
  right: 20px;
  font-size: 4rem;
  color: var(--accent-gold);
  font-family: Georgia, serif;
  opacity: 0.3;
}

/* Signature */
.signature {
  margin-top: 1.5rem;
  color: var(--text-secondary);
  font-style: italic;
  border-top: 1px solid #e9ecef;
  padding-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .game-container {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .options {
    gap: 0.75rem;
  }
  
  .option-btn {
    padding: 1rem;
  }
  
  .summary {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  .game-container {
    padding: 1.25rem;
    margin: 0.5rem;
  }
  
  .option-btn {
    padding: 0.875rem;
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent-gold);
  animation: spin 1s ease-in-out infinite;
}

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

/* Focus States for Accessibility */
.option-btn:focus,
.restart-btn:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --card-background: #ffffff;
    --text-primary: #000000;
    --border-color: #000000;
  }
  
  .option-btn {
    border-color: var(--text-primary);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Site Footer */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.site-footer p {
    margin: 0;
    line-height: 1.4;
}

.site-footer a {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: var(--accent-warm);
    text-decoration: underline;
}

/* Responsive footer for mobile */
@media (max-width: 768px) {
    .site-footer {
        padding: 10px 15px;
        font-size: 0.7rem; /* Smaller font size for mobile */
    }
    .site-footer p {
        line-height: 1.5;
    }
}

/* Print Styles */
@media print {
  body {
    background: white;
    padding-bottom: 20px;
  }
  
  .game-container {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .option-btn,
  .restart-btn {
    border: 1px solid #000;
    background: white;
    color: black;
  }
  
  footer {
    display: none;
  }
}