/* Accessibility and touch-target rules.

   Scattered :focus-visible rules already existed on about seven specific
   components. Everything else -- including every button in the Arena decision
   panel -- had no visible focus at all, so a keyboard user could tab through
   the whole screen without ever seeing where they were. */

/* ── screen-reader-only ────────────────────────────────────────────────── */
.qq-sr-only{
  position:absolute;
  width:1px;height:1px;
  margin:-1px;padding:0;border:0;
  overflow:hidden;
  clip:rect(0 0 0 0);
  clip-path:inset(50%);
  white-space:nowrap;
}

/* Visible again on focus, so the skip link can be reached but not seen. */
.qq-skip-link:focus{
  position:fixed;
  top:12px;left:12px;
  z-index:9999;
  width:auto;height:auto;
  margin:0;padding:10px 16px;
  clip:auto;clip-path:none;
  border-radius:10px;
  background:#0ea5e9;
  color:#00131f;
  font-weight:800;
  text-decoration:none;
  box-shadow:0 8px 24px rgba(0,0,0,.45);
}

/* ── focus ring ────────────────────────────────────────────────────────── */
/* :focus-visible only fires for keyboard/AT navigation, so pointer users see
   no change. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
canvas:focus-visible,
[tabindex]:focus-visible{
  outline:3px solid #38bdf8;
  outline-offset:2px;
  border-radius:8px;
}

/* On a dark panel a plain outline can vanish against the border; the halo
   keeps it readable without changing layout. */
.rpdir:focus-visible,
.rpsh:focus-visible,
.rptr:focus-visible,
.rppower:focus-visible,
.choice:focus-visible,
.shield:focus-visible,
.treasure:focus-visible,
.power:focus-visible{
  outline:3px solid #38bdf8;
  outline-offset:2px;
  box-shadow:0 0 0 6px rgba(56,189,248,.18);
}

/* ── keyboard hint ─────────────────────────────────────────────────────── */
.qq-kbd-hint{
  display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;
  margin-top:10px;
  font-size:11px;color:#64748b;
}
.qq-kbd{
  display:inline-block;
  min-width:18px;padding:1px 6px;
  border-radius:5px;
  border:1px solid rgba(148,163,184,.3);
  border-bottom-width:2px;
  background:rgba(148,163,184,.08);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:10.5px;font-weight:700;color:#cbd5e1;
  text-align:center;
}
/* Touch devices have no keyboard to hint at. */
@media (hover:none) and (pointer:coarse){
  .qq-kbd-hint{display:none}
}

/* ── touch targets ─────────────────────────────────────────────────────── */
/* WCAG 2.5.5 asks for 44x44 CSS px. The Arena's five risk buttons sit in one
   row and land well under that on a phone. */
@media (max-width:640px){
  .rpdir,.rpsh,.rptr,.rppower,
  .choice,.shield,.treasure,.power{
    min-height:44px;
  }
  .rppower{
    padding-left:4px;padding-right:4px;
    font-size:11px;
  }
  /* A 480px chart plus a decision panel does not fit a phone viewport; let the
     chart shrink so the controls stay reachable without a long scroll. */
  .rp-chart-stage{min-height:300px}
  .rp-decision-col{padding:10px}
}

/* ── reduced motion ────────────────────────────────────────────────────── */
/* Individual components honour this already; this is the backstop for the
   confetti, reveal and shimmer animations that do not. */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    scroll-behavior:auto !important;
  }
}

/* ── language switcher ─────────────────────────────────────────────────── */
.qq-lang{display:inline-flex;gap:2px;padding:2px;border-radius:9px;
  background:rgba(148,163,184,.08);border:1px solid rgba(148,163,184,.16)}
.qq-lang-btn{min-width:30px;min-height:26px;padding:2px 7px;border:0;border-radius:7px;
  background:transparent;color:#94a3b8;font-size:11px;font-weight:800;letter-spacing:.04em;
  cursor:pointer}
.qq-lang-btn:hover{color:#e2e8f0}
.qq-lang-btn.sel{background:rgba(56,189,248,.16);color:#bae6fd}

/* Says plainly that the interface is translated but the lessons are not, rather
   than letting an English speaker discover it one lesson in. */
.qq-lang-notice{margin:0 0 4px;padding:9px 13px;border-radius:11px;
  background:rgba(56,189,248,.07);border:1px solid rgba(56,189,248,.18);
  font-size:12px;line-height:1.5;color:#bae6fd}

@media (max-width:640px){
  .qq-lang-btn{min-height:32px}
}
