/* Ficha do personagem (ficha.js): janela larga em três colunas, no molde da tela do dono (26/09/2026) — grupo à esquerda,
   boneco com os slots em volta e inventário no meio, atributos e habilidades à direita. Moldura de bronze e ouro do layout. */
#jan.jficha { width: min(1560px, 97vw); height: min(900px, 92vh); max-height: 92vh; }
#jan.jficha #janC { display: block; padding: 12px; overflow-y: auto; }
.fh { --c-knight: #c69b6d; --c-mago: #3fc7eb; --c-druida: #ff7c0a; --c-paladino: #aad372;
  display: grid; grid-template-columns: 280px minmax(0, 1fr) 290px; gap: 12px; align-items: start; min-height: 100%; }
.fh .win { box-shadow: 0 0 0 1px #000, 0 0 0 2px #5c4a2c, 0 0 0 3px #1a140c, inset 0 0 0 1px rgba(228,188,108,.14) !important; border-radius: 6px; }
.fh-t { margin: 0 0 8px; padding: 0 0 6px; border-bottom: 1px solid rgba(92,74,44,.7); color: #ffd98a; font: 700 14px/1.2 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.fh-t small { color: var(--ink-muted); font: 400 11px var(--font-serif); letter-spacing: 0; text-transform: none; }
.fh-t2 { margin-top: 12px; }
.fh-col { padding: 10px 12px 12px; }
.fh-meio, .fh-dir { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* grupo */
.fh-p { display: flex; gap: 10px; padding: 9px; margin-bottom: 8px; border-radius: 6px; cursor: pointer; background: rgba(0,0,0,.35); box-shadow: 0 0 0 1px #2c2417; }
.fh-p:hover { box-shadow: 0 0 0 1px #8a6d3b; }
.fh-p.on { background: linear-gradient(rgba(58,46,23,.55), rgba(20,16,9,.6)); box-shadow: 0 0 0 1px #000, 0 0 0 2px #e4bc6c, 0 0 12px rgba(228,188,108,.25); }
.fh-p.bloq { flex-direction: column; gap: 2px; color: var(--ink-muted); }
.fh-ret { flex: none; width: 64px; height: 64px; position: relative; overflow: hidden; border-radius: 6px; background: radial-gradient(circle at 50% 40%, #2c261c, #070605 75%); box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #5c4a2c; }
.fh-ret > :is(canvas, img) { position: absolute; width: 124px !important; height: 124px !important; left: -54px; top: -52px; max-width: none; image-rendering: pixelated; }
.fh-pm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fh-pn { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.fh-pn b { font: 700 14px var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-nv { flex: none; padding: 1px 6px; border-radius: 3px; background: #0c0a07; box-shadow: 0 0 0 1px #5c4a2c; color: var(--ink); font: 600 11px var(--font-mono); }
.fh-pm > small { color: var(--ink-muted); margin-top: -2px; }
.fh .barra { position: relative; height: 15px; margin: 0; border-radius: 2px; }
.fh .barra b { display: flex !important; align-items: center; justify-content: center; font: 600 10px/1 var(--font-mono); color: #fff; text-shadow: 0 1px 1px #000; }
.fh .barra.hp i { background: linear-gradient(#35e763, #0a9a31 55%, #057424) !important; }
.fh .barra.mp i { background: linear-gradient(#4d95ff, #0b55cf 55%, #073f9c) !important; }
.fh-eqp { display: flex; gap: 3px; margin-top: 3px; }
.fh-eqp i { width: 28px; height: 28px; background: #0a0c0e center / 24px no-repeat; image-rendering: pixelated; box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #3d3322; border-radius: 3px; }

/* cabeçalho do personagem */
.fh-cab { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 12px 16px; }
.fh-nome b { display: block; font: 700 24px/1.1 var(--font-display); letter-spacing: .03em; text-shadow: 0 2px 2px #000; }
.fh-nome span { color: var(--ink-muted); font: 400 14px var(--font-serif); }
.fh-xp { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; color: var(--ink-muted); font-size: 12px; }
.fh-xp > span b { color: #ffd98a; font: 700 18px var(--font-display); }
.fh-xp .barra { height: 18px; }
.fh-xp .barra i { background: linear-gradient(#ffd46a, #d59a22 55%, #9a6b10) !important; }
.fh-abas { display: flex; gap: 4px; }
.fh-abas .bt { min-width: 92px; }

/* boneco */
.fh-boneco { display: grid; grid-template-columns: 92px minmax(150px, 1fr) 92px minmax(260px, 1.25fr); gap: 12px; padding: 14px; align-items: stretch;
  background: linear-gradient(rgba(6,7,9,.72), rgba(6,7,9,.86)), var(--bg-000) var(--cena, none) center / cover no-repeat !important; }
.fh-lado { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.fh-slot { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 4px 7px; border-radius: 5px; cursor: pointer; background: rgba(0,0,0,.45); box-shadow: 0 0 0 1px #3d3322; }
.fh-slot small { color: var(--ink-muted); font: 600 11px var(--font-serif); }
.fh-slot:hover { box-shadow: 0 0 0 1px #8a6d3b; }
.fh-slot.on { box-shadow: 0 0 0 1px #000, 0 0 0 2px #e4bc6c, 0 0 10px rgba(228,188,108,.35); }
.fh-q { width: 58px; height: 58px; border: 1px solid #3d3322; border-radius: 4px; background: #07080a center / 44px no-repeat; image-rendering: pixelated; box-shadow: inset 0 0 10px #000; }
.fh-fig { position: relative; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; min-height: 300px; }
.fh-fig > canvas { position: relative; z-index: 2; width: 256px; height: 256px; image-rendering: pixelated; margin-bottom: 0; cursor: pointer; filter: drop-shadow(0 6px 10px rgba(0,0,0,.8)); }
/* aura no chão na cor da classe, pulsando; brasas subindo; ao equipar a aura acende (.brilho) */
.fh-aura { position: absolute; z-index: 1; left: 50%; bottom: 14px; width: 190px; height: 46px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--cc) 55%, transparent) 0%, color-mix(in srgb, var(--cc) 18%, transparent) 45%, transparent 70%);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cc) 35%, transparent); animation: fhPulsa 2.6s ease-in-out infinite; }
.fh-aura::after { content: ''; position: absolute; inset: 6px 22px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--cc) 60%, transparent); animation: fhGira 9s linear infinite; }
@keyframes fhPulsa { 0%, 100% { opacity: .55; transform: translateX(-50%) scale(.94); } 50% { opacity: 1; transform: translateX(-50%) scale(1.04); } }
@keyframes fhGira { to { transform: rotate(360deg); } }
.fh-fig > i { position: absolute; z-index: 3; bottom: 30px; width: 3px; height: 3px; border-radius: 50%; background: color-mix(in srgb, var(--cc) 70%, #fff); box-shadow: 0 0 6px var(--cc);
  opacity: 0; animation: fhBrasa 3.4s linear infinite; pointer-events: none; }
.fh-fig > i:nth-of-type(1) { left: 38%; animation-delay: 0s; } .fh-fig > i:nth-of-type(2) { left: 46%; animation-delay: .4s; } .fh-fig > i:nth-of-type(3) { left: 55%; animation-delay: .9s; }
.fh-fig > i:nth-of-type(4) { left: 62%; animation-delay: 1.3s; } .fh-fig > i:nth-of-type(5) { left: 42%; animation-delay: 1.8s; } .fh-fig > i:nth-of-type(6) { left: 58%; animation-delay: 2.2s; }
.fh-fig > i:nth-of-type(7) { left: 50%; animation-delay: 2.6s; } .fh-fig > i:nth-of-type(8) { left: 35%; animation-delay: 3s; } .fh-fig > i:nth-of-type(9) { left: 66%; animation-delay: 1.1s; }
@keyframes fhBrasa { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: .9; } 100% { opacity: 0; transform: translate(10px, -190px); } }
.fh-fig.brilho .fh-aura { animation: fhAcende 1.6s ease-out 1, fhPulsa 2.6s ease-in-out 1.6s infinite; }
.fh-fig.brilho::before { content: ''; position: absolute; z-index: 1; left: 50%; bottom: 20px; width: 240px; height: 260px; transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 80%, rgba(255,217,138,.55), transparent 65%); animation: fhClarao 1.6s ease-out 1 forwards; }
@keyframes fhAcende { 0% { opacity: 1; transform: translateX(-50%) scale(1.6); filter: brightness(2); } 100% { opacity: .6; transform: translateX(-50%) scale(1); filter: none; } }
@keyframes fhClarao { 0% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fh-aura, .fh-aura::after, .fh-fig > i { animation: none; } }
.fh-det { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 6px; background: rgba(8,9,11,.9); box-shadow: 0 0 0 1px #000, 0 0 0 2px #5c4a2c; font-size: 13px; }
.fh-det .fh-bots { margin-top: auto; padding-top: 10px; }
.fh-det.fh-vazio { color: var(--ink-muted); display: flex; align-items: center; text-align: center; }
/* a ficha do item é a mesma do pop-up (#dica): as classes dela repintadas aqui */
.fh-det .dr { font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.fh-det .dn { color: var(--ink); font: 700 18px/1.2 var(--font-display); margin: 2px 0 8px; }
.fh-det .dr, .fh-det .dn { padding-right: 62px; }
.fh-det .dp { display: none; }
.fh-det .di { order: -1; align-self: flex-end; width: 52px; height: 52px; margin: 0 0 -52px; display: flex; align-items: center; justify-content: center; border: 2px solid; border-radius: 5px; background: #07080a; }
.fh-det .di img { width: 44px; height: 44px; image-rendering: pixelated; }
.fh-det .dl { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; color: var(--ink-muted); }
.fh-det .dl b { color: var(--ink); }
.fh-det .dt { margin-top: 8px; color: #ffd98a; font-weight: 700; }
.fh-det .db { color: #60e060; padding: 1px 0; } .fh-det .db.ruim { color: #ff7060; } .fh-det .db.igual { color: #a8a8a8; } .fh-det .db small { color: #c0c0c0; }
.fh-det .dv { margin-top: 6px; color: var(--ink-muted); font-style: italic; }
.fh-cmp { padding: 2px 0; }
.fh-bots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.fh-bots .bt { flex: 1; min-height: 32px; }
.fh-equipar { flex: 1 0 100%; min-height: 40px !important; font: 700 14px var(--font-display) !important; letter-spacing: .06em; text-transform: uppercase;
  color: #1a1206 !important; background: linear-gradient(#ffe08a, #e0a93a 55%, #b37a1c) !important; box-shadow: 0 0 0 1px #000, 0 0 0 2px #8a6d3b !important; border: 0 !important; }
.fh-equipar:disabled { filter: grayscale(1) brightness(.6); }

/* inventário */
.fh-inv { padding: 10px 12px 12px; }
.fh-invt { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.fh-invt .fh-t { border: 0; flex: 1; }
.fh-filtros { display: flex; gap: 4px; flex-wrap: wrap; }
.fh-filtros .bt { padding: 4px 10px; font-size: 11px; }
.fh-grade { display: grid; grid-template-columns: repeat(auto-fill, 50px); gap: 6px; padding-top: 8px; border-top: 1px solid rgba(92,74,44,.7); }
.fh-s { position: relative; width: 50px; height: 50px; border: 1px solid #3d3322; border-radius: 4px; background: #07080a center / 36px no-repeat; image-rendering: pixelated; box-shadow: inset 0 0 8px #000; }
.fh-s[data-ac] { cursor: pointer; } .fh-s[data-ac]:hover { box-shadow: inset 0 0 8px #000, 0 0 0 1px #e4bc6c; }
.fh-s.on { box-shadow: 0 0 0 2px #e4bc6c, 0 0 10px rgba(228,188,108,.4); }
.fh-s.nao { opacity: .45; }
.fh-s b { position: absolute; right: 3px; bottom: 1px; color: #fff; font: 600 11px var(--font-mono); text-shadow: 0 1px 1px #000, 0 0 2px #000; }
.fh-dica { margin: 8px 0 0; color: var(--ink-muted); font-size: 11px; }

/* direita: atributos e habilidades */
.fh-a { display: flex; justify-content: space-between; padding: 3px 0; color: var(--ink-muted); font-size: 13px; }
.fh-a b { color: var(--ink); font-family: var(--font-mono); font-weight: 600; }
.fh-a b.hpv { color: #4de37a; } .fh-a b.mpv { color: #6aa6ff; } .fh-a b.apagada { color: var(--ink-muted); font-weight: 400; }
.fh-hab { display: flex; flex-direction: column; gap: 6px; }
.fh-h { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.fh-hi { position: relative; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; cursor: pointer; background: #07080a center / 40px no-repeat;
  box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #4d4230, inset 0 -6px 8px rgba(0,0,0,.45); image-rendering: pixelated; }
.fh-hi:hover { box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #ffd100, 0 0 8px rgba(255,209,0,.35); }
.fh-hi u { position: absolute; top: 1px; right: 3px; text-decoration: none; color: #fff; font: 700 10px/1 var(--font-mono); text-shadow: 0 1px 1px #000; }
.fh-hn { display: flex; flex-direction: column; min-width: 0; }
.fh-hn b { color: var(--ink); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-hn small { color: var(--ink-muted); font-size: 11px; }
.fh-h.vazia .fh-hn b { color: var(--ink-muted); font-weight: 400; }
.fh-auto { display: flex; align-items: center; gap: 4px; color: var(--ink-muted); font-size: 12px; cursor: pointer; }
.fh-auto input { accent-color: #e4bc6c; width: 15px; height: 15px; }

/* Tática e Visual dentro da ficha: o miolo das janelas de sempre, sem o seletor de personagem (o grupo à esquerda já faz isso) */
.fh-emb { display: grid; gap: 10px; min-width: 0; }
.fh-emb .htopo .hchar { display: none; }

@media (max-width: 1400px) {
  .fh { grid-template-columns: 240px minmax(0, 1fr) 250px; }
  .fh-boneco { grid-template-columns: 84px minmax(120px, 1fr) 84px; } .fh-det { grid-column: 1 / -1; }
  .fh-fig > canvas { width: 200px; height: 200px; } .fh-fig { min-height: 240px; }
}
@media (max-width: 1100px) {
  .fh { grid-template-columns: minmax(0, 1fr); } .fh-grupo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .fh-grupo .fh-t { grid-column: 1 / -1; } .fh-p { margin: 0; }
  .fh-cab { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 700px) {
  .fh-grupo { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px; } .fh-grupo .fh-t { display: none; }
  .fh-p { flex: none; width: 150px; padding: 6px; gap: 6px; } .fh-p .barra, .fh-p .fh-eqp, .fh-pm > small { display: none; } .fh-ret { width: 44px; height: 44px; }
  .fh-ret > :is(canvas, img) { width: 88px !important; height: 88px !important; left: -38px; top: -36px; } .fh-pn { flex-direction: column; align-items: flex-start; gap: 2px; } .fh-boneco { grid-template-columns: 76px minmax(0, 1fr) 76px; } .fh-q { width: 46px; height: 46px; background-size: 36px; } }

/* aba Habilidades: os 6 slots em cartões grandes e o seletor de magias do slot escolhido embaixo */
.fh-habs, .fh-pick { padding: 10px 12px 12px; }
.fh-hcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.fh-hc { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border-radius: 6px; cursor: pointer;
  background: rgba(0,0,0,.4); box-shadow: 0 0 0 1px #3d3322; }
.fh-hc:hover { box-shadow: 0 0 0 1px #8a6d3b; }
.fh-hc.on { background: linear-gradient(rgba(58,46,23,.55), rgba(20,16,9,.6)); box-shadow: 0 0 0 1px #000, 0 0 0 2px #e4bc6c, 0 0 12px rgba(228,188,108,.3); }
.fh-hcico { position: relative; width: 64px; height: 64px; border-radius: 5px; background: #07080a center / 60px no-repeat; image-rendering: pixelated;
  box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #4d4230, inset 0 -8px 10px rgba(0,0,0,.45); }
.fh-hc.on .fh-hcico { box-shadow: inset 0 0 0 1px #000, 0 0 0 1px #ffd100, 0 0 10px rgba(255,209,0,.4); }
.fh-hc.trava .fh-hcico { filter: grayscale(1) brightness(.5); }
.fh-hcico u { position: absolute; top: 2px; right: 4px; text-decoration: none; color: #fff; font: 700 11px/1 var(--font-mono); text-shadow: 0 1px 1px #000; }
.fh-hct { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fh-hct small { color: var(--ink-muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.fh-hct b { color: var(--ink); font: 700 15px var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-hct code { color: #ffd98a; font: 12px var(--font-mono); }
.fh-hct span { color: var(--ink-muted); font-size: 11px; line-height: 1.35; }
.fh-hct em { color: #ff8060; font-style: normal; font-size: 11px; }
.fh-hc.vazia .fh-hct b { color: var(--ink-muted); }
.fh-pick .fh-emb > .sec:first-child { margin-top: 0; }
