/* ===========================================
   Super Maths Hero - Components CSS
   Buttons, Cards, Modals, Forms, Badges
   =========================================== */

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-family);
  font-size: var(--font-size-lg);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: var(--border-comic);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-comic);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-comic-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Button Variants */
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-text);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-dark);
}

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

.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-secondary-dark);
}

.btn-hero {
  background-color: var(--color-hero-blue);
  color: var(--color-text-white);
}

.btn-hero:hover:not(:disabled) {
  background-color: var(--color-hero-blue-dark);
}

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

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

.btn-outline {
  background-color: transparent;
  border: var(--border-comic);
  color: var(--color-text);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--color-bg-dark);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-md);
}

.btn-lg {
  padding: var(--space-lg) var(--space-xl);
  font-size: var(--font-size-xl);
}

.btn-xl {
  padding: var(--space-xl) var(--space-xxl);
  font-size: var(--font-size-xxl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic-lg);
}

.btn-xl:active {
  box-shadow: var(--shadow-comic);
}

/* Icon Button */
.btn-icon {
  padding: var(--space-md);
  border-radius: var(--radius-round);
  width: 56px;
  height: 56px;
}

.btn-icon.btn-sm {
  width: 40px;
  height: 40px;
  padding: var(--space-sm);
}

/* Full Width Button */
.btn-block {
  width: 100%;
}

/* ===== Cards ===== */
.card {
  background-color: var(--color-text-white);
  border: var(--border-comic);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic);
  padding: var(--space-lg);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-comic-lg);
}

.card-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 2px dashed var(--color-bg-dark);
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: 0;
}

.card-body {
  flex: 1;
}

.card-footer {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 2px dashed var(--color-bg-dark);
}

/* Card Variants */
.card-primary {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
}

.card-hero {
  border-color: var(--color-hero-blue);
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
}

.card-success {
  border-color: var(--color-success);
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

/* ===== Mode Selection Cards ===== */
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-xl);
  cursor: pointer;
  min-height: 200px;
}

.mode-card .mode-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.mode-card .mode-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.mode-card .mode-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  padding: var(--space-md);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background-color: var(--color-text-white);
  border: var(--border-comic);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic-lg);
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: var(--border-comic);
  background-color: var(--color-primary);
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin: 0;
}

.modal-close {
  font-size: var(--font-size-xl);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-round);
  transition: background-color var(--transition-fast);
}

.modal-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-top: 2px dashed var(--color-bg-dark);
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--font-size-md);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: var(--space-md);
  font-size: var(--font-size-lg);
  border: var(--border-comic);
  border-radius: var(--radius-md);
  background-color: var(--color-text-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-hero-blue);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

/* Range Slider */
.form-range {
  width: 100%;
  height: 24px;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.form-range::-webkit-slider-runnable-track {
  width: 100%;
  height: 12px;
  background: linear-gradient(to right, var(--color-success), var(--color-primary), var(--color-error));
  border: var(--border-comic);
  border-radius: var(--radius-md);
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  background-color: var(--color-text-white);
  border: var(--border-comic);
  border-radius: var(--radius-round);
  margin-top: -12px;
  box-shadow: var(--shadow-comic-sm);
  transition: transform var(--transition-fast);
}

.form-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.form-range::-moz-range-track {
  width: 100%;
  height: 12px;
  background: linear-gradient(to right, var(--color-success), var(--color-primary), var(--color-error));
  border: var(--border-comic);
  border-radius: var(--radius-md);
}

.form-range::-moz-range-thumb {
  width: 32px;
  height: 32px;
  background-color: var(--color-text-white);
  border: var(--border-comic);
  border-radius: var(--radius-round);
  box-shadow: var(--shadow-comic-sm);
}

.range-value {
  display: inline-block;
  font-size: var(--font-size-xxl);
  font-weight: 700;
  color: var(--color-hero-blue);
  min-width: 60px;
  text-align: center;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  width: 60px;
  height: 32px;
  background-color: var(--color-bg-dark);
  border: var(--border-comic);
  border-radius: var(--radius-lg);
  transition: background-color var(--transition-fast);
  position: relative;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background-color: var(--color-text-white);
  border: 2px solid #333;
  border-radius: var(--radius-round);
  top: 2px;
  left: 2px;
  transition: transform var(--transition-fast);
}

.toggle-input:checked + .toggle-slider {
  background-color: var(--color-success);
}

.toggle-input:checked + .toggle-slider::before {
  transform: translateX(28px);
}

.toggle-label {
  margin-left: var(--space-md);
  font-weight: 500;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  border: var(--border-comic);
  border-radius: var(--radius-round);
  box-shadow: var(--shadow-comic);
  transition: transform var(--transition-fast);
}

.badge:hover {
  transform: scale(1.1) rotate(5deg);
}

.badge.locked {
  background: linear-gradient(135deg, #E0E0E0 0%, #BDBDBD 100%);
  filter: grayscale(1);
  opacity: 0.6;
}

.badge.locked::after {
  content: '🔒';
  position: absolute;
  font-size: 1rem;
  bottom: -5px;
  right: -5px;
}

.badge-sm {
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
}

.badge-lg {
  width: 100px;
  height: 100px;
  font-size: 3rem;
}

/* Badge Card */
.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md);
  position: relative;
}

.badge-card .badge-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-top: var(--space-sm);
}

.badge-card .badge-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}

/* ===== Progress Bar ===== */
.progress {
  width: 100%;
  height: 24px;
  background-color: var(--color-bg-dark);
  border: var(--border-comic);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-success) 0%, var(--color-primary) 100%);
  border-radius: var(--radius-sm);
  transition: width var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-weight: 600;
  font-size: var(--font-size-sm);
}

/* XP Progress */
.xp-bar {
  position: relative;
}

.xp-bar .progress-bar {
  background: linear-gradient(90deg, var(--color-hero-blue) 0%, var(--color-primary) 100%);
}

.xp-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  color: var(--color-text);
  text-shadow: 1px 1px 0 white;
}

/* ===== Stats Display ===== */
.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background-color: var(--color-text-white);
  border: var(--border-comic);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-comic-sm);
  min-width: 80px;
}

.stat-value {
  font-size: var(--font-size-xxl);
  font-weight: 700;
  line-height: 1;
  color: var(--color-hero-blue);
}

.stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  text-transform: uppercase;
  margin-top: var(--space-xs);
}

/* ===== Game UI Elements ===== */
.problem-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  font-size: var(--font-size-hero);
  font-weight: 700;
  padding: var(--space-xl);
  background-color: var(--color-text-white);
  border: var(--border-comic);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic);
}

.problem-number {
  color: var(--color-hero-blue);
}

.problem-operator {
  color: var(--color-secondary);
}

.problem-equals {
  color: var(--color-text);
}

.problem-answer {
  min-width: 80px;
  color: var(--color-primary-dark);
  text-align: center;
}

/* Lives Display */
.lives-display {
  display: flex;
  gap: var(--space-xs);
}

.life {
  font-size: var(--font-size-xl);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.life.lost {
  opacity: 0.3;
  transform: scale(0.8);
}

/* Streak Display */
.streak-display {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-primary);
  border: var(--border-comic);
  border-radius: var(--radius-md);
  font-weight: 600;
}

.streak-icon {
  font-size: var(--font-size-xl);
}

.streak-count {
  font-size: var(--font-size-lg);
}

/* ===== Numpad ===== */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  max-width: 300px;
  margin: 0 auto;
}

.numpad-btn {
  aspect-ratio: 1;
  font-size: var(--font-size-xxl);
  font-weight: 700;
  background-color: var(--color-text-white);
  border: var(--border-comic);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-comic-sm);
  transition: all var(--transition-fast);
}

.numpad-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.numpad-btn.btn-clear {
  background-color: var(--color-error);
  color: var(--color-text-white);
}

.numpad-btn.btn-submit {
  background-color: var(--color-success);
  color: var(--color-text-white);
}

.numpad-btn.btn-zero {
  grid-column: span 1;
}

/* ===== Multiple Choice ===== */
.choices-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  max-width: 400px;
  margin: 0 auto;
}

.choice-btn {
  padding: var(--space-lg);
  font-size: var(--font-size-xxl);
  font-weight: 700;
  background-color: var(--color-text-white);
  border: var(--border-comic);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic);
  transition: all var(--transition-fast);
}

.choice-btn:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-comic-lg);
}

.choice-btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.choice-btn.correct {
  background-color: var(--color-success);
  color: var(--color-text-white);
}

.choice-btn.wrong {
  background-color: var(--color-error);
  color: var(--color-text-white);
}

/* ===== Timer ===== */
.timer-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-text-white);
  border: var(--border-comic);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-comic-sm);
}

.timer-icon {
  font-size: var(--font-size-xl);
}

.timer-value {
  font-size: var(--font-size-xxl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.timer-display.warning {
  background-color: var(--color-primary);
  animation: pulse 0.5s infinite;
}

.timer-display.danger {
  background-color: var(--color-error);
  color: var(--color-text-white);
  animation: pulse 0.3s infinite;
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-text-white);
  border: var(--border-comic);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-comic);
  font-weight: 600;
  animation: slideInDown var(--transition-normal);
  pointer-events: auto;
}

.toast-success {
  background-color: var(--color-success);
  color: var(--color-text-white);
}

.toast-error {
  background-color: var(--color-error);
  color: var(--color-text-white);
}

.toast-badge {
  background-color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* ===== Header Bar ===== */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background-color: var(--color-primary);
  border-bottom: var(--border-comic);
}

.header-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: var(--space-sm);
}

/* ===== Footer Bar ===== */
.footer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  margin-top: auto;
}

/* ===== Empty State ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xxl);
  text-align: center;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
}

.empty-state-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

.empty-state-text {
  color: var(--color-text-light);
}

/* ===== Badge Category ===== */
.badge-category-header {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px dashed var(--color-bg-dark);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.badge-category-header:first-child {
  margin-top: 0;
}

.badge-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

/* ===== Active Button States ===== */
.difficulty-btn.active,
.input-method-btn.active {
  background-color: var(--color-hero-blue);
  color: var(--color-text-white);
  border-color: var(--color-hero-blue-dark);
}

/* ===== Screen Content ===== */
.screen-content {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  height: 100%;
}

/* ===== Text Size Utilities ===== */
.text-sm {
  font-size: var(--font-size-sm);
}

.text-lg {
  font-size: var(--font-size-lg);
}

.text-xl {
  font-size: var(--font-size-xl);
}

/* ===== HOME SCREEN STYLES ===== */
.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-lg);
  gap: var(--space-lg);
  max-width: 500px;
  margin: 0 auto;
}

/* Title */
.home-header {
  text-align: center;
  animation: fadeInDown 0.6s ease;
}

.home-title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  margin: 0;
}

.title-super {
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  font-weight: 500;
  color: var(--color-text);
}

.title-maths {
  font-size: clamp(2.5rem, 12vw, 4.5rem);
  font-weight: 700;
  color: var(--color-hero-blue);
  text-shadow: 3px 3px 0 var(--color-primary),
               6px 6px 0 rgba(0,0,0,0.1);
}

.title-hero {
  font-size: clamp(2rem, 10vw, 3.5rem);
  font-weight: 700;
  color: var(--color-secondary);
  text-shadow: 2px 2px 0 #000;
}

.home-subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-light);
  margin-top: var(--space-sm);
}

/* Mascot */
.home-mascot {
  flex-shrink: 0;
}

.mascot-img {
  width: clamp(150px, 40vw, 220px);
  height: auto;
  filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.2));
}

/* Stats Card */
.home-stats {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  background: white;
  border: var(--border-comic);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-comic);
  padding: var(--space-md) var(--space-lg);
  width: 100%;
  max-width: 320px;
}

.level-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border: var(--border-comic);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  min-width: 70px;
}

.level-icon {
  font-size: 1.5rem;
}

.level-number {
  font-size: var(--font-size-xxl);
  font-weight: 700;
  line-height: 1;
}

.xp-section {
  flex: 1;
}

.xp-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.xp-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}

.xp-value {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-hero-blue);
}

/* Play Button */
.btn-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  width: 100%;
  max-width: 320px;
  padding: var(--space-lg) var(--space-xl);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border: 4px solid #333;
  border-radius: var(--radius-lg);
  box-shadow: 6px 6px 0 #333;
  font-size: var(--font-size-xxl);
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.15s ease;
  animation: pulse 2s ease-in-out infinite;
}

.btn-play:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 #333;
}

.btn-play:active {
  transform: translate(3px, 3px);
  box-shadow: 3px 3px 0 #333;
  animation: none;
}

.play-icon {
  font-size: 1.5rem;
}

/* Secondary Actions */
.home-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
  max-width: 320px;
}

.secondary-actions {
  display: flex;
  gap: var(--space-md);
}

.btn-secondary-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: white;
  border: var(--border-comic);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-comic-sm);
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary-action:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-comic);
}

.btn-secondary-action:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn-badges {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  border-color: var(--color-hero-blue);
}

.btn-icon-small {
  font-size: 1.2rem;
}

/* ===== BACK BUTTON ===== */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: white;
  border: var(--border-comic);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-comic-sm);
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-back:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-comic);
}

.btn-back:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn-back-icon {
  font-size: var(--font-size-xl);
  font-weight: 700;
  line-height: 1;
}

.btn-back-text {
  font-size: var(--font-size-sm);
}

/* ===== SCREEN HEADER FIXED ===== */
.screen-header-fixed {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-lg);
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 10;
}

.screen-header-fixed .screen-title {
  flex: 1;
  margin: 0;
  font-size: var(--font-size-xl);
}

.screen-header-fixed .badge-counter {
  font-weight: 600;
  color: var(--color-hero-blue);
  background: white;
  border: var(--border-comic);
  border-radius: var(--radius-md);
  padding: var(--space-xs) var(--space-md);
}

/* ===== SETTINGS SCROLL ===== */
.settings-scroll {
  padding-top: 0;
  overflow-y: auto;
  max-height: 100vh;
  -webkit-overflow-scrolling: touch;
}

.settings-content {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.settings-content .card {
  width: 100%;
  box-sizing: border-box;
}

/* ===== OPERATIONS GRID ===== */
.operations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.operation-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.operation-checkbox:hover {
  background: var(--color-bg-dark);
}

.operation-checkbox:has(.operation-input:checked) {
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  border-color: var(--color-hero-blue);
}

.operation-input {
  width: 20px;
  height: 20px;
  accent-color: var(--color-hero-blue);
  cursor: pointer;
}

.operation-label {
  font-weight: 500;
  font-size: var(--font-size-md);
  white-space: nowrap;
}

/* ===== CARD DANGER ===== */
.card-danger {
  background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
  border-color: var(--color-error);
}

.card-danger .card-title {
  color: var(--color-error);
}

/* ===== RESULT MESSAGE ===== */
.result-message {
  color: var(--color-text-light);
}

.result-title.success {
  color: var(--color-success);
}

.result-title.warning {
  color: var(--color-primary-dark);
}

.result-title.error {
  color: var(--color-error);
}

/* ===== QUESTION TIMER ===== */
.question-timer-container {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-md) auto;
  max-width: 300px;
  width: 100%;
}

.question-timer-bar {
  flex: 1;
  height: 8px;
  background: var(--color-bg-dark);
  border-radius: var(--radius-round);
  overflow: hidden;
  border: 1px solid #333;
}

.question-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-success) 0%, var(--color-primary) 50%, var(--color-error) 100%);
  border-radius: var(--radius-round);
  transition: width 0.3s ease;
  width: 100%;
}

.question-timer-fill.warning {
  background: var(--color-primary);
}

.question-timer-fill.danger {
  background: var(--color-error);
  animation: pulse 0.5s infinite;
}

.question-timer-text {
  font-size: var(--font-size-lg);
  font-weight: 700;
  min-width: 30px;
  text-align: center;
  color: var(--color-text);
}

.question-timer-text.warning {
  color: var(--color-primary-dark);
}

.question-timer-text.danger {
  color: var(--color-error);
  animation: pulse 0.5s infinite;
}

/* ===== TIMER BUTTONS ===== */
.timer-options {
  justify-content: center;
}

.timer-btn {
  min-width: 70px;
}

.timer-btn.active {
  background-color: var(--color-hero-blue);
  color: var(--color-text-white);
  border-color: var(--color-hero-blue-dark);
}

/* ===== CHOICE BUTTON FEEDBACK ===== */
.choice-btn.selected {
  background-color: var(--color-hero-blue);
  color: var(--color-text-white);
  transform: scale(0.98);
}

.choice-btn.correct {
  background-color: var(--color-success);
  color: var(--color-text-white);
  animation: correctPop 0.3s ease;
}

.choice-btn.wrong {
  background-color: var(--color-error);
  color: var(--color-text-white);
  animation: shake 0.3s ease;
}

.choice-btn.reveal-correct {
  background-color: var(--color-success);
  color: var(--color-text-white);
  opacity: 0.7;
}

@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ===== SUBTLE BADGE TOAST ===== */
.toast-badge-mini {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border: 2px solid #333;
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  box-shadow: 2px 2px 0 #333;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
  z-index: var(--z-toast);
  max-width: 200px;
}

.toast-badge-mini .badge-emoji {
  font-size: 1.2rem;
}

.toast-badge-mini .badge-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}
