/* ── NeuroDinoWorld Accessibility Modes ───────────────────────────────── */

/* High Contrast */
body.a11y-high-contrast {
  --bg: #000 !important;
  --text: #fff !important;
  filter: contrast(1.4);
}
body.a11y-high-contrast .sec, body.a11y-high-contrast [style*="background"] {
  background: #111 !important;
  border-color: rgba(255,255,255,0.5) !important;
}

/* Large Text */
body.a11y-large-text { font-size: 120% !important; }
body.a11y-large-text .sec, body.a11y-large-text p,
body.a11y-large-text div { line-height: 1.7 !important; }

/* Dyslexia-friendly font */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;700;800&display=swap');
body.a11y-dyslexia,
body.a11y-dyslexia p,
body.a11y-dyslexia div,
body.a11y-dyslexia button,
body.a11y-dyslexia input,
body.a11y-dyslexia label {
  font-family: 'Lexend', sans-serif !important;
  letter-spacing: 0.05em !important;
  word-spacing: 0.1em !important;
  line-height: 1.8 !important;
}

/* Reduced Motion */
body.a11y-reduced-motion *,
body.a11y-reduced-motion *::before,
body.a11y-reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

/* Low Stimulation — muted colours, no gradients */
body.a11y-low-stim {
  filter: saturate(0.4) brightness(0.95);
}
body.a11y-low-stim [style*="animation"],
body.a11y-low-stim .float,
body.a11y-low-stim .pulse {
  animation: none !important;
}

/* No Characters — hide character portraits and emoji decorations */
body.a11y-no-chars .char-portrait,
body.a11y-no-chars .char-emoji,
body.a11y-no-chars [class*="portrait"],
body.a11y-no-chars img[alt*="character"],
body.a11y-no-chars img[alt*="Rex"],
body.a11y-no-chars img[alt*="Marina"],
body.a11y-no-chars img[alt*="Aurora"],
body.a11y-no-chars img[alt*="Duke"] {
  display: none !important;
}

/* Focus visible for keyboard users */
body *:focus-visible {
  outline: 3px solid #4cc9f0 !important;
  outline-offset: 3px !important;
}

/* A11y settings panel */
.a11y-panel {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.a11y-sheet {
  background: linear-gradient(145deg,#0d1a2e,#111d35);
  border-radius: 28px 28px 0 0;
  padding: 28px 22px calc(32px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
}
.a11y-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.a11y-toggle-row:last-child { border-bottom: none; }
.a11y-toggle-label { flex: 1; }
.a11y-toggle-label b { display: block; font-size: 0.9rem; color: #fff; font-weight: 800; margin-bottom: 2px; }
.a11y-toggle-label span { font-size: 0.72rem; color: rgba(255,255,255,0.45); line-height: 1.4; }

/* Toggle switch */
.a11y-switch { position: relative; width: 48px; height: 27px; flex-shrink: 0; margin-left: 14px; }
.a11y-switch input { opacity: 0; width: 0; height: 0; }
.a11y-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 27px;
  cursor: pointer;
  transition: background 0.2s;
}
.a11y-slider::before {
  content: '';
  position: absolute;
  width: 21px; height: 21px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.a11y-switch input:checked + .a11y-slider { background: #52b788; }
.a11y-switch input:checked + .a11y-slider::before { transform: translateX(21px); }
