/* ================= Accessibilité (a11y/a11y.js, a11y/subtitles.js) ================= */
/* les options s'allongent : le panneau défile */
#opt-box { max-height: calc(100vh - var(--u) * 10); overflow-y: auto; scrollbar-width: none; }
#opt-box::-webkit-scrollbar { display: none; }

/* police lisible : lissage normal (la police pixel est rendue sans lissage) */
html.a11y-font body { -webkit-font-smoothing: auto; }
html.a11y-font #log div, html.a11y-font #qdlg .qd-text { letter-spacing: .01em; }

/* taille du texte : les panneaux à largeur fixe s'élargissent un peu */
html.a11y-text #status { width: calc(var(--u) * 92 * var(--ts, 1)); }
html.a11y-text #log { width: min(calc(var(--u) * 170 * var(--ts, 1)), 60vw); }
html.a11y-text .bar { grid-template-columns: calc(var(--u) * 24 * var(--ts, 1)) 1fr; }

/* ---------- mode daltonien : couleurs Okabe-Ito et motifs distincts ---------- */
html.a11y-cb #hud-goal i { --c: #f0e442; }
html.a11y-cb #hud-hp i { --c: #009e73; }
html.a11y-cb #hud-stam i { --c: #56b4e9; }
html.a11y-cb #hud-gas i { --c: #cc79a7; }
html.a11y-cb #hud-heat i { --c: #d55e00; }
/* santé : segments pleins ; souffle : rayures horizontales ; gaz : damier ; repérage : hachures ; objectif : points */
html.a11y-cb #hud-stam i::after { background: repeating-linear-gradient(0deg, var(--c) 0 var(--u), #1d4a66 var(--u) calc(var(--u) * 2)); }
html.a11y-cb #hud-gas i::after { background: repeating-conic-gradient(var(--c) 0 25%, #5a2a4a 0 50%) 0 0 / calc(var(--u) * 2) calc(var(--u) * 2); }
html.a11y-cb #hud-heat i::after { background: repeating-linear-gradient(45deg, var(--c) 0 calc(var(--u) * 1.4), #f0e442 calc(var(--u) * 1.4) calc(var(--u) * 2.4)); }
html.a11y-cb #hud-goal i::after { background: radial-gradient(#7a6a10 30%, transparent 32%) 0 0 / calc(var(--u) * 2) calc(var(--u) * 2), var(--c); }
html.a11y-cb .bar span::before { display: inline-block; width: calc(var(--u) * 3.5); margin-right: var(--u); text-align: center; color: var(--c, var(--paper)); }
html.a11y-cb #status .bar:is(#hud-goal, #hud-hp, #hud-stam, #hud-gas, #hud-heat) { grid-template-columns: calc(var(--u) * 29 * var(--ts, 1)) 1fr; }
html.a11y-cb #status .bar span { white-space: nowrap; }
html.a11y-cb #hud-hp span::before { content: '+'; color: #009e73; }
html.a11y-cb #hud-stam span::before { content: '≈'; color: #56b4e9; }
html.a11y-cb #hud-gas span::before { content: '#'; color: #cc79a7; }
html.a11y-cb #hud-heat span::before { content: '!'; color: #d55e00; }
html.a11y-cb #hud-goal span::before { content: '★'; color: #f0e442; }
html.a11y-cb #hud-heat.hot span { color: #f0e442; }
html.a11y-cb #log .bad { box-shadow: inset 0 0 0 var(--u) var(--ink), inset calc(var(--u) * 3) 0 0 0 #d55e00; }
html.a11y-cb #log .good { box-shadow: inset 0 0 0 var(--u) var(--ink), inset calc(var(--u) * 3) 0 0 0 #56b4e9; }
html.a11y-cb #log .warn { box-shadow: inset 0 0 0 var(--u) var(--ink), inset calc(var(--u) * 3) 0 0 0 #f0e442; }

/* ---------- sous-titres des sons ---------- */
#subs { position: fixed; left: 50%; bottom: calc(var(--u) * 46); transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: var(--u); pointer-events: none; z-index: 9; }
#subs.show { display: flex; }
#subs div { background: rgba(20, 16, 24, .82); color: #fff3d6; padding: 0 calc(var(--u) * 2.5); font: calc(var(--u) * 4.4 * var(--ts, 1))/1.45 'Pixelify', monospace; box-shadow: inset 0 0 0 var(--u) var(--ink); white-space: nowrap; }
#subs div b { color: var(--sun); font-weight: 400; }
body:not([data-scene="game"]):not([data-scene="custody"]) #subs { display: none; }
