/* =========================================================================
 * KONKAI — Acessibilidade (Opções > Acessibilidade / Teclas; js/ui/panel-misc.js, js/core/keymap.js)
 *
 *  - Modo daltônico: classes no <html> ("cb" + "cb-deuter" | "cb-protan" | "cb-tritan"). O JS troca as cores de raridade
 *    (BI.balance.RARITIES[i].color, que também pintam as bordas das células e as molduras dos ícones) e publica as cores
 *    atuais em --rar0 … --rar5. Aqui: marca de FORMA por raridade nas células de item, cores seguras para "bom/ruim"
 *    e para as barras de HP (laranja, hachurada) e Konryoku (azul, lisa).
 *  - Reduzir movimento: classe "rm" no <html> (e também o pedido do sistema, prefers-reduced-motion); "rm-off" quando
 *    o jogador desligou de propósito mesmo com o sistema pedindo menos movimento.
 *  - Tamanho do texto: não é CSS — BI.ui.textScale multiplica o zoom da interface (js/main.js, BI.main.relayout()).
 * ========================================================================= */
:root {
  --rar0: #b9b9b9; --rar1: #4fd16b; --rar2: #4aa3ff; --rar3: #b066ff; --rar4: #ff9a1f; --rar5: #ff3b5c;
  --mark-font: "Segoe UI Symbol", "Noto Sans Symbols2", "Noto Sans Symbols", "Apple Symbols", "DejaVu Sans", sans-serif;
}

/* ---------------- marca de forma da raridade (texto) ---------------- */
.rmk { display: inline-block; margin-right: 0.28em; font: 800 0.95em/1 var(--mark-font); font-style: normal; color: inherit; text-shadow: 0 0 2px #000, 0 0 3px #000; vertical-align: baseline; }

/* ---------------- Opções: pré-visualização das raridades ---------------- */
.rar-prev { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 8px 0 2px; }
.rar-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 7px; font: 700 12px/18px var(--font-b); letter-spacing: 0.02em; background: rgba(0, 0, 0, 0.5); border: 1px solid currentColor; }
.rar-chip .rmk { margin: 0; }
.setrow.stack { align-items: flex-start; flex-direction: column; gap: 2px; }
.setrow.stack .seg { margin: 2px 0 6px; }
.gfx-now { font-weight: 700; color: var(--paper); }

/* ---------------- Opções: teclas ---------------- */
.keygrp { margin: 12px 0 4px; font: 800 12px var(--font-b); letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-dim); }
.keygrp:first-of-type { margin-top: 6px; }
.keylist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 0 26px; }
.keyrow { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 34px; padding: 2px 0; border-bottom: 1px dashed var(--ink-line); }
.keyrow .kr-n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.keyrow.chg .kr-n { color: #fff; }
.keyrow.chg .kr-n::after { content: " •"; color: var(--reiatsu); }
.keybtn { flex: 0 1 auto; min-width: 54px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 28px; padding: 0 8px; font: 700 12px/26px var(--font-b); letter-spacing: 0.03em; text-align: center; color: var(--paper); background: #000; border: 1px solid var(--ink-line2); border-radius: 0; }
.keybtn:hover { border-color: var(--paper); }
.keybtn.none { color: var(--paper-dk); }
.keybtn.cap { min-width: 150px; color: #06202e; background: var(--reiatsu); border-color: var(--reiatsu); animation: keyCap 1s ease-in-out infinite; }
.keybtn.bad { border-color: var(--bad); }
.key-undo, .key-undo-sp { flex: none; width: 30px; min-width: 30px; padding: 0; }
@media (max-width: 899px) { .keybtn.cap { min-width: 0; } .keyrow .kr-n { flex-basis: 90px; } }
.keymsg { margin: 6px 0; padding: 5px 9px; font: 700 12.5px var(--font-b); color: var(--paper); border-left: 3px solid var(--reiatsu); background: rgba(94, 200, 255, 0.08); }
.keymsg.warn { border-left-color: var(--warn); background: rgba(255, 180, 87, 0.09); }
@keyframes keyCap { 50% { background: #9adfff; } }

/* ---------------- modo daltônico ---------------- */
html.cb { --good: #56b4e9; --bad: #ff9a3d; --warn: #f0e442; }
html.cb-tritan { --good: #2bd1c0; --bad: #ff6a85; --warn: #ffd6a0; }
/* células de item: o pontinho da raridade vira uma forma (ponto, losango, triângulo, estrela, brilho) */
html.cb .cell.r1::before, html.cb .cell.r2::before, html.cb .cell.r3::before, html.cb .cell.r4::before, html.cb .cell.r5::before {
  display: block; width: auto; height: auto; right: 2px; top: 0; background: none; border-radius: 0; box-shadow: none;
  font: 800 13px/15px var(--mark-font); color: var(--rc); text-shadow: 0 0 2px #000, 0 0 3px #000, 1px 1px 0 #000, -1px -1px 0 #000;
}
html.cb .cell.r1::before { content: "\25CF"; }
html.cb .cell.r2::before { content: "\25C6"; }
html.cb .cell.r3::before { content: "\25B2"; }
html.cb .cell.r4::before { content: "\2605"; }
html.cb .cell.r5::before { content: "\2726"; font-size: 14px; }
html.cb .cell.r4::after, html.cb .cell.r5::after { opacity: 0.65; }
/* HP: laranja com hachura diagonal · Konryoku: azul liso (diferem em cor, brilho e textura) */
html.cb-deuter .bb-hp .bb-f::before, html.cb-protan .bb-hp .bb-f::before {
  background: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.34) 0 2px, transparent 2px 7px), linear-gradient(180deg, #ffb680, #ff8a3d 55%, #b84f17);
}
html.cb-deuter .bb-rei .bb-f::before, html.cb-protan .bb-rei .bb-f::before { background: linear-gradient(180deg, #b9e0ff, #4db2ff 55%, #1d6fc4); }
html.cb-tritan .bb-hp .bb-f::before {
  background: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.34) 0 2px, transparent 2px 7px), linear-gradient(180deg, #ff8fa6, #ff4a63 55%, #a8203c);
}
html.cb-tritan .bb-rei .bb-f::before { background: linear-gradient(180deg, #a6f3e8, #34d6c0 55%, #15907f); }
html.cb .bb-hp .bb-t, html.cb .bb-rei .bb-t { text-shadow: 0 1px 0 #000, 0 0 4px #000, 1px 0 0 #000, -1px 0 0 #000; }

/* ---------------- reduzir movimento ---------------- */
html.rm *, html.rm *::before, html.rm *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  html:not(.rm-off) *, html:not(.rm-off) *::before, html:not(.rm-off) *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
/* o cursor piscando do campo de tecla e o brilho do selo continuam legíveis sem animação */
html.rm .keybtn.cap { background: var(--reiatsu); }
