 :root {
     --primary-color: #6366f1;
     --primary-hover: #4f46e5;
     --secondary-color: #f59e0b;
     --correct-color: #10b981;
     --incorrect-color: #ef4444;
     --light-bg: #f9fafb;
     --dark-text: #1f2937;
     --card-bg: #ffffff;
     --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
     --border-radius: 12px;
     --transition: all 0.3s ease;
 }

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

 body {
     font-family: 'Nunito', sans-serif;
     background-color: var(--light-bg);
     color: var(--dark-text);
     min-height: 100vh;
     line-height: 1.6;
 }

 .container {
     width: 100%;
     max-width: 1200px;
     margin: 0 auto;
     padding: 1rem;
 }

 .screen {
     display: none;
     opacity: 0;
     transform: translateY(20px);
     transition: opacity 0.5s ease, transform 0.5s ease;
 }

 .screen.active {
     display: block;
     opacity: 1;
     transform: translateY(0);
 }

 /* Header Styles */
 .app-header {
     text-align: center;
     padding: 2rem 0;
 }

 .app-title {
     font-size: 2.5rem;
     font-weight: 800;
     color: var(--primary-color);
     margin-bottom: 0.5rem;
 }

 .app-tagline {
     font-size: 1.2rem;
     color: var(--dark-text);
     opacity: 0.8;
 }

 .app-logo {
     width: 120px;
     height: 120px;
     margin-bottom: 1rem;
 }

 /* Home Screen Styles */
 .category-grid {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
     gap: 1rem;
     margin: 2rem 0;
 }

 .category-btn {
     background-color: var(--card-bg);
     border: 2px solid transparent;
     border-radius: var(--border-radius);
     padding: 1rem;
     text-align: center;
     box-shadow: var(--shadow);
     transition: var(--transition);
     cursor: pointer;
     height: 100%;
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
 }

 .category-btn:hover {
     transform: translateY(-4px);
     box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
 }

 .category-btn.selected {
     border-color: var(--primary-color);
     background-color: rgba(99, 102, 241, 0.1);
 }

 .category-icon {
     font-size: 1.8rem;
     margin-bottom: 0.75rem;
     color: var(--primary-color);
 }

 .category-name {
     font-weight: 600;
     font-size: 0.9rem;
 }

 .region-selector {
     margin: 2rem 0;
 }

 .region-title {
     font-size: 1.2rem;
     font-weight: 700;
     margin-bottom: 1rem;
     text-align: center;
 }

 .region-grid {
     display: grid;
     grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
     gap: 1rem;
 }

 .start-quiz-container {
     text-align: center;
     /* margin: 2rem 0; */
 }

 .start-quiz-btn {
     background-color: var(--primary-color);
     color: white;
     border: none;
     border-radius: var(--border-radius);
     padding: 0.75rem 2rem;
     font-size: 1.2rem;
     font-weight: 700;
     cursor: pointer;
     transition: var(--transition);
     box-shadow: var(--shadow);
 }

 .start-quiz-btn:hover:not(:disabled) {
     background-color: var(--primary-hover);
     transform: translateY(-2px);
 }

 .start-quiz-btn:disabled {
     background-color: #cbd5e1;
     cursor: not-allowed;
 }

 /* Quiz Screen Styles */
 .quiz-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-bottom: 1.5rem;
 }

 .quiz-score {
     font-weight: 700;
     font-size: 1.2rem;
     color: var(--primary-color);
 }

 .quiz-progress {
     font-weight: 600;
     font-size: 1.1rem;
 }

 .timer-container {
     width: 100%;
     height: 10px;
     background-color: #e5e7eb;
     border-radius: 5px;
     margin-bottom: 2rem;
     overflow: hidden;
 }

 .timer-bar {
     height: 100%;
     background-color: var(--secondary-color);
     width: 100%;
     transition: width linear;
 }

 .quiz-card {
     background-color: var(--card-bg);
     border-radius: var(--border-radius);
     box-shadow: var(--shadow);
     padding: 2rem;
     margin-bottom: 2rem;
 }

 .question-text {
     font-size: 1.3rem;
     font-weight: 700;
     margin-bottom: 1.5rem;
 }

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

 .option-btn {
     background-color: var(--light-bg);
     border: 1px solid #e5e7eb;
     border-radius: var(--border-radius);
     padding: 1rem;
     text-align: left;
     font-size: 1rem;
     cursor: pointer;
     transition: var(--transition);
     display: flex;
     align-items: center;
 }

 .option-btn:hover {
     background-color: #f3f4f6;
     transform: translateY(-2px);
 }

 .option-label {
     display: inline-block;
     width: 24px;
     height: 24px;
     background-color: var(--primary-color);
     color: white;
     border-radius: 50%;
     text-align: center;
     line-height: 24px;
     margin-right: 10px;
     font-weight: 600;
 }

 .option-text {
     flex: 1;
 }

 .option-btn.correct {
     background-color: rgba(16, 185, 129, 0.2);
     border-color: var(--correct-color);
 }

 .option-btn.incorrect {
     background-color: rgba(239, 68, 68, 0.2);
     border-color: var(--incorrect-color);
 }

 /* Results Screen Styles */
 .results-card {
     background-color: var(--card-bg);
     border-radius: var(--border-radius);
     box-shadow: var(--shadow);
     padding: 2rem;
     text-align: center;
     max-width: 600px;
     margin: 0 auto;
 }

 .results-header {
     margin-bottom: 2rem;
 }

 .results-title {
     font-size: 2rem;
     font-weight: 800;
     color: var(--primary-color);
     margin-bottom: 0.5rem;
 }

 .results-score {
     font-size: 3rem;
     font-weight: 800;
     color: var(--secondary-color);
     margin: 1rem 0;
 }

 .results-percentage {
     font-size: 1.5rem;
     margin-bottom: 1rem;
 }

 .results-message {
     font-size: 1.2rem;
     font-weight: 700;
     margin-bottom: 2rem;
 }

 .results-actions {
     display: flex;
     gap: 1rem;
     justify-content: center;
     flex-wrap: wrap;
 }

 .play-again-btn,
 .new-category-btn {
     padding: 0.75rem 1.5rem;
     border-radius: var(--border-radius);
     font-weight: 600;
     cursor: pointer;
     transition: var(--transition);
 }

 .play-again-btn {
     background-color: var(--primary-color);
     color: white;
     border: none;
 }

 .play-again-btn:hover {
     background-color: var(--primary-hover);
 }

 .new-category-btn {
     background-color: var(--light-bg);
     color: var(--dark-text);
     border: 1px solid #e5e7eb;
 }

 .new-category-btn:hover {
     background-color: #f3f4f6;
 }

 /* Responsive adjustments */
 @media (max-width: 768px) {

     .category-grid,
     .region-grid {
         grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
         gap: 0.75rem;
     }

     .app-title {
         font-size: 2rem;
     }

     .quiz-card,
     .results-card {
         padding: 1.5rem;
         margin: 1rem 0;
     }

     .question-text {
         font-size: 1.1rem;
         line-height: 1.5;
     }

     .results-actions {
         flex-direction: column;
         gap: 0.75rem;
     }
     
     .container {
         padding: 0.75rem;
     }
     
     /* Better button spacing on tablets */
     .option-btn {
         margin: 0.4rem 0;
         padding: 1rem;
         min-height: 48px; /* Accessibility touch target */
     }
 }

 @media (max-width: 480px) {

     .category-grid,
     .region-grid {
         grid-template-columns: repeat(2, 1fr);
         gap: 0.5rem;
     }

     .app-logo {
         width: 80px;
         height: 80px;
     }

     .app-title {
         font-size: 1.75rem;
     }

     .option-btn {
         padding: 0.85rem;
         font-size: 0.95rem;
         margin: 0.3rem 0;
         min-height: 44px; /* Minimum touch target for mobile */
     }
     
     .container {
         padding: 0.5rem;
     }
     
     .quiz-card,
     .results-card {
         padding: 1.2rem;
         margin: 0.5rem 0;
     }
     
     .question-text {
         font-size: 1rem;
     }
     
     .category-btn {
         padding: 0.75rem;
         min-height: 100px;
     }
     
     .category-icon {
         font-size: 1.5rem;
         margin-bottom: 0.5rem;
     }
     
     .category-name {
         font-size: 0.85rem;
         line-height: 1.2;
     }
 }

 /* Extra small devices */
 @media (max-width: 360px) {
     .category-grid {
         grid-template-columns: 1fr 1fr;
         gap: 0.4rem;
     }
     
     .category-btn {
         padding: 0.6rem;
         min-height: 90px;
     }
     
     .category-icon {
         font-size: 1.3rem;
     }
     
     .category-name {
         font-size: 0.8rem;
     }
     
     .container {
         padding: 0.4rem;
     }
     
     .quiz-card,
     .results-card {
         padding: 1rem;
     }
 }

 /* Touch device optimizations */
 @media (hover: none) and (pointer: coarse) {
     .category-btn:hover {
         transform: none;
     }
     
     .category-btn:active {
         transform: scale(0.95);
         transition: transform 0.1s ease;
     }
     
     .option-btn:hover {
         background-color: var(--primary-color);
         color: white;
     }
     
     .option-btn:active {
         transform: scale(0.98);
     }
 }

 /* Welcome Modal Styles */


 /* Hidden by default */
 .welcome-modal {
     display: none;
     position: fixed;
     z-index: 9999;
     inset: 0;
     background: rgba(0, 0, 0, 0.4);
     justify-content: center;
     align-items: center;
     animation: fadeIn 0.3s ease;
 }

 /* Inner content */
 .welcome-content {
     background: #fff;
     padding: 2rem 3rem;
     border-radius: 16px;
     box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
     text-align: center;
     font-family: 'Nunito', sans-serif;
     animation: popUp 0.3s ease;
 }

 .welcome-content h2 {
     color: #333;
     margin-bottom: 0.5rem;
 }

 .welcome-content p {
     color: #666;
 }

 /* Show modal */
 .welcome-modal.show {
     display: flex;
 }

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

     to {
         opacity: 1;
     }
 }

 @keyframes popUp {
     from {
         transform: scale(0.8);
         opacity: 0;
     }

     to {
         transform: scale(1);
         opacity: 1;
     }
 }

 /* Back Button Styles */
 .back-container {
     display: flex;
     justify-content: flex-start;
     margin: 10px 0 15px 10px;
 }

 .back-btn {
     background: #f3f3f3;
     color: #333;
     border: 1px solid #ddd;
     border-radius: 8px;
     padding: 8px 14px;
     font-size: 0.95rem;
     font-weight: 600;
     cursor: pointer;
     transition: all 0.2s ease;
 }

 .back-btn:hover {
     background: #eaeaea;
     transform: translateY(-1px);
 }
 /* Welcome Modal Styles */


 