/* ── ACCESIBILIDAD: TEXTO GRANDE ─────────────────────────────────────────── */
/* Escalamos el font-size del elemento raíz html para que todos los rem
   escalen proporcionalmente — sin tocar elementos individuales */
html.a11y-large-text  { font-size: 120%; }
html.a11y-larger-text { font-size: 145%; }
/* Excluir el panel de accesibilidad del escalado para que no se desborde */
html.a11y-large-text  #a11y-panel,
html.a11y-larger-text #a11y-panel { font-size: 0.8rem; }
html.a11y-large-text  #a11y-fab,
html.a11y-larger-text #a11y-fab  { font-size: 1.1rem; }

/* ── ACCESIBILIDAD: ALTO CONTRASTE ──────────────────────────────────────── */
body.a11y-high-contrast {
  --dec-dark-bg: #000000;
  --dec-panel-bg: #0a0a0a;
  --dec-text-main: #FFFFFF;
  --dec-text-muted: #E0E0E0;
  --dec-border: #555555;
  --dec-blue-primary: #4DD8FF;
  --dec-blue-dark: #00AAEE;
  --dec-blue-glow: rgba(77,216,255,0.2);
  --shadow-card: 0 0 0 1px #555;
}
body.a11y-high-contrast #header {
  background: #000 !important;
  border-bottom: 2px solid #4DD8FF;
}
body.a11y-high-contrast .nav-tab.active {
  background: #4DD8FF; color: #000; font-weight: 900;
}
body.a11y-high-contrast .info-card,
body.a11y-high-contrast .equip-card,
body.a11y-high-contrast .comp-card {
  border: 1px solid #555 !important;
}
body.a11y-high-contrast img { filter: brightness(1.1) contrast(1.1); }

/* ── ACCESIBILIDAD: REDUCIR ANIMACIONES ─────────────────────────────────── */
body.a11y-reduce-motion *, body.a11y-reduce-motion *::before, body.a11y-reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

/* ── ACCESIBILIDAD: ESPACIADO AMPLIADO ──────────────────────────────────── */
body.a11y-wide-spacing { --section-pad: 3rem; letter-spacing: 0.03em; word-spacing: 0.1em; }
body.a11y-wide-spacing p, body.a11y-wide-spacing li { line-height: 2; margin-bottom: 0.75em; }

/* ── PANEL ACCESIBILIDAD ─────────────────────────────────────────────────── */
#a11y-fab {
  flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1.5px solid var(--dec-border);
  background: none; color: var(--dec-text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
#a11y-fab:hover { background: var(--dec-dark-bg); color: var(--dec-text-main); }
#a11y-fab:focus-visible { outline: 3px solid var(--dec-blue-primary); outline-offset: 2px; }

#a11y-panel {
  position: fixed; top: calc(var(--header-h) + 0.5rem); right: 1rem; z-index: 9998;
  background: var(--dec-panel-bg); border: 1px solid var(--dec-border);
  border-radius: 14px; padding: 1.25rem 1.5rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  width: 270px;
  display: none;
}
#a11y-panel.open { display: block; animation: fadeIn .15s ease; }
#a11y-panel h3 {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--dec-text-muted);
  margin-bottom: 1rem;
}
.a11y-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0; border-bottom: 1px solid var(--dec-border);
}
.a11y-row:last-child { border-bottom: none; }
.a11y-row label { font-size: 0.88rem; font-weight: 500; cursor: pointer; }
.a11y-row-sub { font-size: 0.72rem; color: var(--dec-text-muted); display: block; }
.a11y-toggle {
  position: relative; width: 38px; height: 22px; flex-shrink: 0;
}
.a11y-toggle input { opacity: 0; width: 0; height: 0; }
.a11y-toggle .track {
  position: absolute; inset: 0; border-radius: 11px;
  background: var(--dec-border); cursor: pointer;
  transition: background .2s;
}
.a11y-toggle input:checked + .track { background: var(--dec-blue-primary); }
.a11y-toggle .track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .2s;
}
.a11y-toggle input:checked + .track::after { transform: translateX(16px); }
.a11y-toggle input:focus-visible + .track { outline: 2px solid var(--dec-blue-primary); outline-offset: 2px; }
.a11y-font-btns { display: flex; gap: 0.35rem; }
.a11y-font-btn {
  border: 1.5px solid var(--dec-border); background: transparent;
  border-radius: 6px; padding: 3px 8px; cursor: pointer; font-weight: 700;
  color: var(--dec-text-main); transition: background .15s, border-color .15s;
}
.a11y-font-btn:hover, .a11y-font-btn.active { background: var(--dec-blue-primary); border-color: var(--dec-blue-primary); color: #fff; }
.a11y-reset {
  margin-top: 0.9rem; width: 100%; padding: 0.5rem;
  border: 1.5px solid var(--dec-border); border-radius: 8px;
  background: transparent; color: var(--dec-text-muted);
  font-size: 0.82rem; cursor: pointer; transition: background .15s;
}
.a11y-reset:hover { background: var(--dec-dark-bg); color: var(--dec-text-main); }
