/* Gameficate cartridge — Accessibility: the ♿ panel, text sizes, grayscale and reduced motion. */
/* ---------- Accessibility panel ---------- */
.a11y-panel {
  position: absolute;
  top: calc(var(--hud-h, 110px) + 10px);
  right: 24px;
  z-index: 25;
  width: 440px;
  max-height: calc(100% - var(--hud-h, 110px) - 30px);
  overflow-y: auto;
  padding: 18px 20px 16px;
  border-radius: calc(22px * var(--rs, 1));
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(10, 25, 40, 0.35);
  border: 2px solid var(--line);
  animation: pop 0.25s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.a11y-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.a11y-head h3 {
  flex: 1;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--navy);
}
.a11y-x {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--navy);
  font-size: 18px;
  font-weight: 900;
  display: grid;
  place-items: center;
}
/* ---------- Panel rows, switches and segmented choices ---------- */
.a11y-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-top: 2px solid var(--line);
}
.a11y-row.col {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.a11y-row .ar-ic {
  font-size: 24px;
  width: 30px;
  text-align: center;
  flex: 0 0 auto;
}
.a11y-row .ar-t {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.25;
}
.a11y-row .ar-t small {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
}
.a11y-row .ar-line {
  display: flex;
  align-items: center;
  gap: 12px;
}
.a11y-sw {
  position: relative;
  width: 62px;
  height: 34px;
  border-radius: calc(999px * var(--rs, 1));
  background: var(--edge);
  flex: 0 0 auto;
  transition: background 0.15s;
}
.a11y-sw::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.a11y-sw[aria-checked='true'] {
  background: var(--teal);
}
.a11y-sw[aria-checked='true']::after {
  transform: translateX(28px);
}
.a11y-sw .st {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 900;
  color: #fff;
}
.a11y-sw[aria-checked='true'] .st .of,
.a11y-sw[aria-checked='false'] .st .on {
  visibility: hidden;
}
.a11y-sw:disabled {
  opacity: 0.45;
}
.a11y-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: calc(14px * var(--rs, 1));
  background: var(--soft);
  border: 2px solid var(--line);
}
.a11y-seg button {
  flex: 1;
  height: 42px;
  border-radius: calc(10px * var(--rs, 1));
  font-size: 15px;
  font-weight: 900;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.a11y-seg button[aria-checked='true'] {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.a11y-seg .aa-s {
  font-size: 13px;
}
.a11y-seg .aa-m {
  font-size: 16px;
}
.a11y-seg .aa-l {
  font-size: 20px;
}
.a11y-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 2px solid var(--line);
}
.a11y-foot button {
  font-size: 14px;
  font-weight: 800;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.start-a11y {
  margin-top: 0;
}

/* Text size (Small / Medium / Large). Panels scale their text; the map redraws its labels. */
body[data-text='s'] {
  --ts: 0.88;
}
body[data-text='l'] {
  --ts: 1.2;
}
.qprompt,
.clues,
.qz-head,
.qz-opt,
.qz-typed,
.qz-tried,
.feedback,
.pinbox,
.reviewbar,
.progress-row,
.tip > *,
.modal h2,
.modal .sub,
.howto,
.q-rows,
.mode-cards,
.lang-cards,
.layer-chip,
.lb-title,
.btn-chip,
.coords,
.a11y-row,
.a11y-head {
  zoom: var(--ts, 1);
}
.qz-input {
  font-size: calc(20px * var(--ts, 1));
  height: calc(56px * var(--ts, 1));
}
.btn-primary {
  font-size: calc(25px * var(--ts, 1));
}
.btn-secondary {
  font-size: calc(19px * var(--ts, 1));
}
.toast {
  font-size: calc(18px * var(--ts, 1));
}
.gesture-hint {
  font-size: calc(16px * var(--ts, 1));
}

/* Grayscale (colour-blind friendly): answers are also marked with symbols and patterns. */
body.gray #stage,
body.gray .a11y-panel {
  filter: grayscale(1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Short screens: two columns instead of a scrollbar (AccessibilityPanel.fit). */
.a11y-panel.two-col {
  width: min(900px, calc(100% - 48px));
  column-count: 2;
  column-gap: 26px;
}
.a11y-panel.two-col .a11y-head {
  column-span: all;
}
.a11y-panel.two-col > * {
  break-inside: avoid;
}
