/* Shared Theme for My Tiny Toppers - Mobile & ASD Friendly */
:root {
  --primary-blue: #93c5fd;
  --primary-green: #86efac;
  --primary-pink: #f9a8d4;
  --primary-yellow: #fde047;
  --text-dark: #1f2937;
  --text-medium: #4b5563;
  --text-light: #6b7280;
  --bg-light: #f8fafc;
  --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 10px 25px rgba(0, 0, 0, 0.15);
  --border-radius: 0.75rem;
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Arial', 'Helvetica', sans-serif;
  background: linear-gradient(to bottom right, #f0f8ff, #fffaf0);
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  color: var(--text-dark);
  min-height: 100vh;
}

/* Typography - FIXED CONSISTENT SIZES */
.mobile-title {
  font-size: 2.2rem;
  font-weight: bold;
  margin: 0;
  line-height: 1.1;
}

.mobile-subtitle {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0.5rem 0 0 0;
}

.mobile-section-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  margin-top: 0;
}

.mobile-card-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.mobile-card-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-medium);
  margin: 0;
}

.mobile-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
}

/* Header Styles - FIXED CONSISTENT SIZING */
.main-header {
  background: linear-gradient(to right, var(--primary-blue), var(--primary-green));
  text-align: center;
  box-shadow: var(--shadow-light);
  min-height: 160px;
  max-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1rem;
  overflow: hidden;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

/* Improved Mobile-Friendly Navigation */
.stage-navigation {
  margin-bottom: 2rem;
  display: flex;
  justify-content: flex-start;
}

.nav-home-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 2rem;
  transition: var(--transition);
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  font-size: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  width: fit-content;
  min-width: 140px;
}

.nav-home-button:hover,
.nav-home-button:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  border-color: white;
  outline: none;
}

.nav-icon {
  font-size: 1.3rem;
}

.nav-text {
  font-size: 1rem;
  font-weight: 600;
}

/* Hide breadcrumb elements for cleaner mobile look */
.nav-separator,
.nav-current {
  display: none;
}

/* Card Styles */
.card-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

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

.game-card, .stage-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-dark);
  box-shadow: var(--shadow-light);
  border: 3px solid transparent;
  transition: var(--transition);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.game-card:hover,
.game-card:focus,
.stage-card:hover,
.stage-card:focus {
  transform: scale(1.02);
  box-shadow: var(--shadow-medium);
  border-color: var(--text-dark);
  outline: none;
}

/* Game Area Styles */
.game-area {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  margin: 2rem auto;
  max-width: 800px;
  box-shadow: var(--shadow-light);
  text-align: center;
}

.game-button {
  background: linear-gradient(to right, var(--primary-blue), var(--primary-green));
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin: 0.5rem;
  min-width: 120px;
  min-height: 48px;
}

.game-button:hover,
.game-button:focus {
  transform: scale(1.05);
  box-shadow: var(--shadow-medium);
  outline: 3px solid var(--primary-yellow);
}

.game-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Feedback Styles */
.feedback {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin: 1rem 0;
  font-weight: 600;
  font-size: 1.125rem;
}

.feedback.correct {
  background: #dcfce7;
  color: #166534;
  border: 2px solid #22c55e;
}

.feedback.incorrect {
  background: #fef2f2;
  color: #dc2626;
  border: 2px solid #ef4444;
}

/* Footer Styles */
.main-footer {
  background: #fef3c7;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  font-weight: 500;
  font-size: 1.125rem;
}

/* Game specific styles */
.question-display {
  font-size: 3rem;
  font-weight: bold;
  margin: 2rem 0;
  color: var(--text-dark);
}

.answer-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.score-display {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  border-radius: var(--border-radius);
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 2rem;
}

.pattern-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.pattern-item {
  font-size: 3rem;
  padding: 1rem;
  border: 3px solid var(--text-light);
  border-radius: var(--border-radius);
  background: white;
  min-width: 80px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pattern-missing {
  background: #f3f4f6;
  border-style: dashed;
}

/* Number bonds specific styles */
.number-bond-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.number-bond-part {
  background: var(--primary-blue);
  color: white;
  font-size: 2rem;
  font-weight: bold;
  padding: 1rem;
  border-radius: var(--border-radius);
  min-width: 80px;
  text-align: center;
}

.number-bond-equals {
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-dark);
}

/* Match quantities specific styles */
.match-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

.match-item {
  background: white;
  border: 3px solid var(--text-light);
  border-radius: var(--border-radius);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.match-item:hover,
.match-item.selected {
  border-color: var(--primary-blue);
  background: #eff6ff;
}

.match-item.correct {
  border-color: #22c55e;
  background: #dcfce7;
}

/* Responsive Design - MOBILE OPTIMIZED */
@media (max-width: 768px) {
  .main-header {
    min-height: 140px;
    max-height: 140px;
    padding: 1.5rem 1rem;
  }
  
  .mobile-title {
    font-size: 1.8rem;
  }
  
  .mobile-subtitle {
    font-size: 0.95rem;
  }
  
  .mobile-emoji {
    font-size: 3rem;
  }
  
  /* Mobile navigation improvements */
  .stage-navigation {
    margin-bottom: 1.5rem;
    justify-content: center;
  }
  
  .nav-home-button {
    padding: 0.9rem 1.3rem;
    font-size: 0.95rem;
    border-radius: 1.8rem;
    min-width: 160px;
    justify-content: center;
  }
  
  .nav-icon {
    font-size: 1.2rem;
  }
  
  .nav-text {
    font-size: 0.95rem;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .game-card, .stage-card {
    min-height: 140px;
    padding: 1.5rem;
  }

  .question-display {
    font-size: 2.5rem;
  }

  .pattern-item {
    font-size: 2.5rem;
    min-width: 70px;
    min-height: 70px;
  }

  .number-bond-part {
    font-size: 1.5rem;
    min-width: 60px;
  }

  .match-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 20px;
  }
  
  .main-header {
    min-height: 120px;
    max-height: 120px;
    padding: 1rem 0.5rem;
  }
  
  .mobile-title {
    font-size: 1.6rem;
  }
  
  .mobile-subtitle {
    font-size: 0.85rem;
  }
  
  .mobile-emoji {
    font-size: 2.5rem;
  }
  
  .mobile-card-title {
    font-size: 1.75rem;
  }
  
  .mobile-card-label {
    font-size: 1.125rem;
  }
  
  /* Small mobile navigation */
  .nav-home-button {
    padding: 0.8rem 1.1rem;
    font-size: 0.9rem;
    min-width: 150px;
    border-radius: 1.5rem;
  }
  
  .nav-icon {
    font-size: 1.1rem;
  }
  
  .nav-text {
    font-size: 0.9rem;
  }
  
  .game-card, .stage-card {
    padding: 2rem 1.5rem;
  }

  .question-display {
    font-size: 2rem;
  }

  .pattern-item {
    font-size: 2rem;
    min-width: 60px;
    min-height: 60px;
  }
}

@media (max-width: 360px) {
  /* Extra small screens */
  .nav-home-button {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    min-width: 140px;
  }
  
  .nav-icon {
    font-size: 1rem;
  }
  
  .nav-text {
    font-size: 0.85rem;
  }
}

/* Focus indicators for accessibility */
*:focus {
  outline: 3px solid var(--primary-yellow);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --text-dark: #000000;
    --text-medium: #333333;
  }
  
  .game-card, .stage-card {
    border: 2px solid var(--text-dark);
  }
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
