:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --accent: #ec4899;
  --dark: #1e293b;
  --gray: #94a3b8;
  --card-bg: rgba(255, 255, 255, 0.92);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.12);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --bg-color: #f0f4ff;
  --text-color: #1e293b;
  --option-bg: white;
  --option-border: #e2e8f0;
  --card-border: rgba(255, 255, 255, 0.3);
}

.theme-dark {
  --bg-color: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.95);
  --text-color: #f1f5f9;
  --option-bg: #1e293b;
  --option-border: #334155;
  --card-border: rgba(255, 255, 255, 0.1);
  --gray: #94a3b8;
}

.theme-high-contrast {
  --bg-color: #000000;
  --card-bg: #ffffff;
  --text-color: #000000;
  --option-bg: #ffffff;
  --option-border: #000000;
  --card-border: #000000;
  --primary: #0000ff;
  --primary-dark: #0000cc;
  --secondary: #000000;
  --accent: #0000ff;
  --gray: #555555;
}

.theme-minimal {
  --bg-color: #ffffff;
  --card-bg: #ffffff;
  --text-color: #111827;
  --option-bg: #f8f9fa;
  --option-border: #dee2e6;
  --card-border: #e9ecef;
  --primary: #495057;
  --primary-dark: #343a40;
  --secondary: #6c757d;
  --accent: #495057;
  --shadow-lg: 0 2px 10px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "DM Sans", sans-serif;
}

body {
  min-height: 100vh;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-color) 0%, #fdf2f8 100%);
  color: var(--text-color);
  overflow-x: hidden;
}

.reduced-motion *,
.reduced-motion *::before,
.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
}

ul,
li {
  list-style-type: none;
}

.app-container {
  width: 100%;
  min-width: 0;
  max-width: 900px;
  margin: auto;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

.app-header {
  position: relative;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  font-size: 28px;
  backdrop-filter: blur(10px);
}

.logo-text h1 {
  font-family: "Syne", sans-serif;
  font-size: 24px;
  font-weight: 800;
}

.logo-text p {
  font-size: 13px;
  opacity: 0.9;
}

.stats {
  display: flex;
  gap: 24px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.theme-toggle,
.settings-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover,
.settings-btn:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.3);
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
}

.stat-label {
  font-size: 12px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 32px;
  z-index: 1000;
  width: 300px;
  padding: 24px;
  border: 1px solid var(--option-border);
  border-radius: var(--radius-md);
  display: none;
  background: white;
  box-shadow: var(--shadow-lg);
  color: var(--dark);
}

.settings-panel.show {
  display: block;
}

.settings-title {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dark);
  font-size: 18px;
  font-weight: 700;
}

.settings-group {
  margin-bottom: 24px;
}

.settings-group:last-child {
  margin-bottom: 0;
}

.settings-group-title {
  margin-bottom: 12px;
  color: var(--gray);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.theme-option {
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-sm);
  color: #333333;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
}

.theme-option:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.theme-option.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  color: var(--primary);
}

.timer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timer-option {
  padding: 8px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 20px;
  background: #f1f5f9;
  color: #333333;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.timer-option:hover {
  background: #e2e8f0;
}

.timer-option.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.setting-label {
  color: var(--dark);
  font-size: 14px;
}

.switch {
  position: relative;
  width: 50px;
  height: 24px;
  display: inline-block;
  flex-shrink: 0;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background-color: #cbd5e1;
  cursor: pointer;
  transition: 0.3s;
}

.slider::before {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: white;
  transition: 0.3s;
}

.switch input:checked + .slider {
  background-color: var(--primary);
}

.switch input:checked + .slider::before {
  transform: translateX(26px);
}

.quick-start-btn {
  width: 100%;
}

.main-content {
  min-width: 0;
  padding: 32px;
}

.welcome-screen {
  animation: fadeIn 0.6s ease;
}

.welcome-header {
  margin-bottom: 40px;
  text-align: center;
}

.welcome-icon {
  margin-bottom: 20px;
  color: var(--primary);
  font-size: 64px;
}

.welcome-title {
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  background-clip: text;
  color: transparent;
  font-family: "Syne", sans-serif;
  font-size: 36px;
  font-weight: 800;
  overflow-wrap: anywhere;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-description {
  max-width: 500px;
  margin: 0 auto;
  color: var(--gray);
  font-size: 16px;
  line-height: 1.6;
}

.config-section {
  margin-bottom: 32px;
}

.config-label {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.config-label i {
  color: var(--primary);
  font-size: 14px;
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.difficulty-card {
  position: relative;
  overflow: hidden;
  padding: 18px 14px;
  border: 2px solid var(--option-border);
  border-radius: var(--radius-md);
  background: var(--option-bg);
  cursor: pointer;
  text-align: center;
  transition: all 0.25s ease;
}

.difficulty-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--diff-color, #e2e8f0);
  transition: all 0.25s;
}

.difficulty-card:hover {
  transform: translateY(-3px);
  border-color: var(--diff-color, var(--primary));
  box-shadow: var(--shadow-md);
}

.difficulty-card.active {
  border-color: var(--diff-color, var(--primary));
  background: var(--diff-bg, rgba(99, 102, 241, 0.05));
}

.difficulty-card.active::before {
  height: 4px;
}

.diff-easy {
  --diff-color: #10b981;
  --diff-bg: rgba(16, 185, 129, 0.06);
}

.diff-medium {
  --diff-color: #f59e0b;
  --diff-bg: rgba(245, 158, 11, 0.06);
}

.diff-hard {
  --diff-color: #ef4444;
  --diff-bg: rgba(239, 68, 68, 0.06);
}

.diff-icon {
  margin-bottom: 8px;
  font-size: 28px;
}

.diff-name {
  margin-bottom: 4px;
  color: var(--text-color);
  font-size: 15px;
  font-weight: 700;
}

.diff-desc {
  color: var(--gray);
  font-size: 12px;
}

.diff-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
}

.diff-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
}

.diff-easy .diff-dot.filled {
  background: #10b981;
}

.diff-medium .diff-dot.filled {
  background: #f59e0b;
}

.diff-hard .diff-dot.filled {
  background: #ef4444;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 36px;
}

.category-card {
  position: relative;
  padding: 14px 8px;
  border: 2px solid var(--option-border);
  border-radius: var(--radius-sm);
  background: var(--option-bg);
  cursor: pointer;
  text-align: center;
  transition: all 0.22s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.category-card.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.07);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.category-card .cat-icon {
  display: block;
  margin-bottom: 6px;
  font-size: 24px;
}

.category-card .cat-name {
  color: var(--text-color);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.active-check {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-size: 10px;
}

.category-card.active .active-check {
  display: flex;
}

.config-summary {
  margin-bottom: 24px;
  padding: 14px 20px;
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(99, 102, 241, 0.06);
  color: var(--gray);
  font-size: 14px;
}

.config-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.config-summary .chip {
  padding: 4px 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: white;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.shortcut-hint {
  margin-top: 20px;
  display: none;
  color: var(--gray);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.shortcut-hint.show {
  display: block;
}

kbd {
  padding: 2px 6px;
  border: 1px solid var(--option-border);
  border-radius: 6px;
  background: var(--option-bg);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.start-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.btn {
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary {
  flex: 1;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  border: 2px solid var(--option-border);
  background: var(--option-bg);
  color: var(--text-color);
}

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

.quiz-screen {
  display: none;
}

.loading-screen,
.error-screen {
  display: none;
  padding: 60px 20px;
  text-align: center;
  animation: fadeIn 0.6s ease;
}

.loading-spinner {
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  border: 5px solid rgba(99, 102, 241, 0.14);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loading-text {
  margin-bottom: 8px;
  color: var(--text-color);
  font-family: "Syne", sans-serif;
  font-size: 28px;
  font-weight: 800;
}

.loading-detail,
#error-message {
  max-width: 440px;
  margin: 0 auto;
  color: var(--gray);
  line-height: 1.6;
}

.error-panel {
  max-width: 460px;
  margin: 0 auto;
  padding: 28px;
  border: 1px solid rgba(239, 68, 68, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(239, 68, 68, 0.06);
}

.error-icon {
  margin-bottom: 16px;
  color: #ef4444;
  font-size: 48px;
}

.error-panel h2 {
  margin-bottom: 10px;
  color: var(--text-color);
  font-family: "Syne", sans-serif;
}

.error-panel .btn {
  width: 100%;
  margin-top: 16px;
}

.results-screen {
  display: none;
  animation: fadeIn 0.6s ease;
}

.progress-container {
  margin-bottom: 32px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.progress-text {
  color: var(--gray);
  font-size: 14px;
  font-weight: 500;
}

.progress-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(99, 102, 241, 0.1);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.4s ease;
}

.question-container {
  margin-bottom: 28px;
}

.question-header {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.question-number {
  color: var(--primary);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.question-category-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.timer-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.timer,
.question-stats {
  padding: 8px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.timer.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.timer.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.question-stats {
  display: none;
}

.question-stats.show {
  display: inline-flex;
}

.question-text {
  margin-bottom: 24px;
  color: var(--text-color);
  font-family: "Syne", sans-serif;
  font-size: 30px;
  line-height: 1.25;
}

.options-container {
  display: grid;
  gap: 14px;
}

.option {
  min-height: 62px;
  padding: 14px 16px;
  border: 2px solid var(--option-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--option-bg);
  cursor: pointer;
  transition: all 0.2s ease;
}

.option:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.option.disabled {
  cursor: default;
}

.option.disabled:hover {
  transform: none;
  box-shadow: none;
}

.option-letter {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
  font-weight: 800;
}

.option-text {
  color: var(--text-color);
  font-weight: 600;
  line-height: 1.4;
}

.option.correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

.option.correct .option-letter {
  background: #10b981;
  color: white;
}

.option.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.option.wrong .option-letter {
  background: #ef4444;
  color: white;
}

.explanation-container {
  display: none;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.06);
}

.explanation-title {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.explanation-text {
  color: var(--text-color);
  line-height: 1.5;
}

.action-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.results-header {
  margin-bottom: 28px;
  text-align: center;
}

.results-icon {
  margin-bottom: 18px;
  color: var(--primary);
  font-size: 64px;
}

.results-title {
  margin-bottom: 8px;
  font-family: "Syne", sans-serif;
  font-size: 36px;
}

.results-subtitle {
  color: var(--gray);
}

.score-display {
  margin-bottom: 28px;
  padding: 28px;
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-lg);
  background: rgba(99, 102, 241, 0.06);
  text-align: center;
}

.score-value {
  display: block;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  background-clip: text;
  color: transparent;
  font-family: "Syne", sans-serif;
  font-size: 58px;
  font-weight: 800;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.score-label {
  margin-bottom: 10px;
  color: var(--gray);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.performance-message {
  color: var(--text-color);
  font-weight: 700;
}

.time-used {
  margin-top: 8px;
  color: var(--gray);
  font-size: 14px;
}

.results-actions {
  display: flex;
  gap: 14px;
  margin-bottom: 30px;
}

.review-section {
  padding-top: 28px;
  border-top: 1px solid var(--option-border);
}

.review-title {
  margin-bottom: 16px;
  color: var(--text-color);
  font-size: 20px;
}

.review-items {
  display: grid;
  gap: 12px;
}

.review-item {
  padding: 16px;
  border: 1px solid var(--option-border);
  border-radius: var(--radius-md);
  background: var(--option-bg);
}

.review-item.correct {
  border-color: rgba(16, 185, 129, 0.35);
}

.review-item.incorrect {
  border-color: rgba(239, 68, 68, 0.35);
}

.review-question {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text-color);
  font-weight: 700;
  line-height: 1.45;
}

.review-status {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-size: 13px;
  font-weight: 800;
}

.review-status.correct {
  background: #10b981;
}

.review-status.incorrect {
  background: #ef4444;
}

.review-answer {
  padding-left: 34px;
  color: var(--gray);
  font-size: 14px;
  line-height: 1.5;
}

.user-answer {
  color: #ef4444;
  font-weight: 700;
}

.correct-answer {
  color: #10b981;
  font-weight: 700;
}

.accessibility-notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  z-index: 1500;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  display: none;
  transform: translateX(-50%);
  background: var(--dark);
  box-shadow: var(--shadow-md);
  color: white;
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  padding: 20px;
  display: none;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.7);
}

.popup-overlay.active {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.popup-content {
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease;
  display: flex;
  flex-direction: column;
}

.popup-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(99, 102, 241, 0.7) rgba(99, 102, 241, 0.12);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.popup-body::-webkit-scrollbar {
  width: 10px;
}

.popup-body::-webkit-scrollbar-track {
  background: rgba(99, 102, 241, 0.08);
  border-radius: 999px;
  margin: 14px 8px;
}

.popup-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border: 2px solid #f9fafb;
  border-radius: 999px;
}

.popup-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--secondary), var(--primary));
}

.popup-header {
  padding: 30px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  color: white;
  text-align: center;
}

.popup-header h2 {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-size: 2.2rem;
}

.popup-subtitle {
  font-size: 1.2rem;
  font-weight: 300;
  opacity: 0.9;
}

.popup-section {
  padding: 25px 30px;
  border-bottom: 1px solid #e5e7eb;
}

.popup-section:last-child {
  border-bottom: none;
}

.popup-section h3 {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dark);
  font-size: 1.3rem;
}

.popup-section p {
  margin-bottom: 10px;
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.6;
}

.popup-section ul {
  margin: 10px 0;
  padding-left: 20px;
  list-style: disc;
}

.popup-section li {
  margin-bottom: 8px;
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.5;
  list-style: disc;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.tech-tag {
  padding: 8px 16px;
  border-radius: 50px;
  background: linear-gradient(to right, var(--primary-dark), var(--primary));
  color: white;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.2);
  font-size: 0.9rem;
  font-weight: 600;
}

.highlight-box {
  margin-top: 10px;
  padding: 20px;
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    rgba(124, 58, 237, 0.05) 0%,
    rgba(124, 58, 237, 0.1) 100%
  );
}

.close-popup-btn {
  margin: 30px auto;
  padding: 15px 30px;
  border: none;
  border-radius: 50px;
  display: block;
  background: linear-gradient(to right, var(--secondary), var(--primary-dark));
  color: white;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.close-popup-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

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

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

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

@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  .app-container {
    max-width: calc(100vw - 24px);
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    overflow: hidden;
  }

  .stats {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-item,
  .logo,
  .logo-text {
    min-width: 0;
  }

  .logo-text h1 {
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  .header-controls {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-label {
    font-size: 10px;
  }

  .settings-panel {
    right: 16px;
    left: 16px;
    width: auto;
  }

  .main-content {
    padding: 24px;
  }

  .welcome-title {
    font-size: clamp(1.85rem, 9vw, 34px);
    line-height: 1.12;
  }

  .welcome-description {
    overflow-wrap: anywhere;
  }

  .difficulty-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .start-area {
    flex-direction: column;
  }

  .question-text {
    font-size: 24px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .results-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
