/* ===================== KORVION v3.8 ===================== */

/* ---- botón de atacar con dirección ---- */
#b-atk { overflow: visible; touch-action: none; }
#b-atk .v38-aim { position: absolute; inset: -9px; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .12s; border: 2px dashed rgba(255, 190, 190, .55); }
#b-atk .v38-aim.on { opacity: 1; }
#b-atk .v38-aim b { position: absolute; right: -12px; top: 50%; width: 0; height: 0; margin-top: -9px; border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-left: 14px solid #ffd35a; filter: drop-shadow(0 0 3px rgba(0, 0, 0, .7)); }
#b-atk::after { content: '✥'; position: absolute; right: 4px; top: 3px; font-size: 9px; opacity: .55; pointer-events: none; }
.v38-press { filter: brightness(1.3); transform: scale(.94); }

/* ---- hechizos: botones que se ocultan si no hay hechizos activos ---- */
.v38-na { display: none !important; }
.v38-spell { display: flex; align-items: center; gap: 8px; }
.v38-spell .sw { flex-shrink: 0; width: 46px; height: 26px; border-radius: 13px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); position: relative; cursor: pointer; transition: background .15s; }
.v38-spell .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #c8c0e0; transition: left .15s, background .15s; }
.v38-spell .sw.on { background: #3ac070; border-color: #8af0b0; }
.v38-spell .sw.on::after { left: 22px; background: #fff; }
.v38-spell.off .t { opacity: .5; }
.v38-spellbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; font-size: 12px; }
.v38-spellbar .cnt { margin-left: auto; color: #ffd35a; font-weight: 800; }

/* ---- galería de fabricación ---- */
.v38c { display: flex; gap: 10px; height: 100%; min-height: 0; }
.v38c-left { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.v38c-bar { flex-shrink: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.v38c-bar .v2search { flex: 1 1 120px; min-width: 90px; }
.v38c-cats { flex-shrink: 0; display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 4px; scrollbar-width: none; }
.v38c-cats::-webkit-scrollbar { display: none; }
.v38c-cats button { flex-shrink: 0; }
.v38c-grid { flex: 1 1 auto; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; align-content: start; padding: 2px 2px 10px; -webkit-overflow-scrolling: touch; }
.v38c-card { position: relative; border-radius: 12px; background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); border: 1.5px solid rgba(255, 255, 255, .12); padding: 5px 4px 4px; display: flex; flex-direction: column; align-items: center; cursor: pointer; min-width: 0; transition: transform .08s, border-color .12s; }
.v38c-card:active { transform: scale(.96); }
.v38c-card.ok { border-color: rgba(120, 230, 150, .55); box-shadow: inset 0 0 12px rgba(80, 220, 120, .12); }
.v38c-card.sel { border-color: #ffd35a; box-shadow: 0 0 0 2px rgba(255, 211, 90, .35), inset 0 0 14px rgba(255, 211, 90, .18); }
.v38c-card.no { opacity: .62; }
.v38c-card > img { width: 46px; height: 46px; image-rendering: auto; }
.v38c-card .nm { font-size: 10px; font-weight: 800; text-align: center; line-height: 1.1; margin-top: 2px; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 22px; }
.v38c-card .qty { position: absolute; top: 3px; right: 5px; font-size: 10px; font-weight: 900; color: #ffd35a; }
.v38c-card .st { position: absolute; top: 3px; left: 4px; font-size: 10px; }
.v38c-ing { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-top: 3px; }
.v38c-ing span { display: inline-flex; align-items: center; gap: 1px; font-size: 9px; font-weight: 800; padding: 0 3px 0 1px; border-radius: 6px; background: rgba(0, 0, 0, .3); }
.v38c-ing span img { width: 15px; height: 15px; }
.v38c-ing span.ok { color: #8af0a8; }
.v38c-ing span.no { color: #ff9a9a; }
.v38c-right { flex: 0 0 min(300px, 44%); min-width: 0; display: flex; flex-direction: column; border-radius: 14px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .1); padding: 10px; min-height: 0; }
.v38c-det { flex: 1 1 auto; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.v38c-det .hd { display: flex; gap: 10px; align-items: center; }
.v38c-det .hd img { width: 64px; height: 64px; flex-shrink: 0; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.v38c-det .hd b { font-size: 15px; display: block; line-height: 1.15; }
.v38c-det .hd small { color: #a39cc4; font-size: 11px; }
.v38c-det .desc { font-size: 12px; line-height: 1.4; margin: 8px 0; color: #e0dcf4; }
.v38c-det h4 { margin: 10px 0 4px; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: #ffd35a; }
.v38c-det .use { font-size: 11.5px; color: #c8c0ff; line-height: 1.4; }
.v38c-mat { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 9px; background: rgba(255, 255, 255, .05); margin-bottom: 3px; font-size: 12px; }
.v38c-mat img { width: 26px; height: 26px; }
.v38c-mat .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v38c-mat .c { font-weight: 900; }
.v38c-mat.ok .c { color: #8af0a8; }
.v38c-mat.no .c { color: #ff9a9a; }
.v38c-mat .chs { font-size: 10px; color: #a39cc4; font-style: normal; }
.v38c-act { flex: 0 0 auto; padding-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.v38c-act .btn { flex: 1 1 auto; }
.v38c-act .btn.big { font-size: 15px; padding: 10px 12px; flex-basis: 100%; }
.v38c-empty { font-size: 12px; color: #a39cc4; padding: 14px 6px; text-align: center; line-height: 1.5; }
.v38c-note { flex-shrink: 0; font-size: 10.5px; color: #a39cc4; margin-bottom: 4px; }
.v38c-parts { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.v38c-parts .slot { width: 40px; height: 40px; }
.v38c-dur { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: 3px; width: 80%; }
.v38c-dur i { display: block; height: 100%; background: linear-gradient(90deg, #ff6a5a, #ffd35a, #6ae08a); }
@media (max-height: 420px) {
  .v38c-grid { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 4px; }
  .v38c-card > img { width: 38px; height: 38px; }
  .v38c-right { padding: 8px; }
  .v38c-det .hd img { width: 48px; height: 48px; }
}
@media (max-width: 560px) {
  .v38c { flex-direction: column; }
  .v38c-right { flex: 0 0 auto; max-height: 48%; }
}
.pbody.v38c-body { display: flex; flex-direction: column; overflow: hidden; }
.pbody.v38c-body > .v38c { flex: 1 1 auto; min-height: 0; }
