/* ===================== KORVION v3.9.6 — mesa de forja ===================== */
.v396f { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.v396f > .v38c-grid { flex: 1 1 auto; }
.v396f-gal { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.v396f-gal .v38c-card > img { width: 52px; height: 52px; }
.v396f-gs { font-size: 11px; font-weight: 900; color: #ffd35a; margin-top: 2px; }
.v396f-gs small { color: #c8c0ff; font-weight: 800; }

.v396f-main { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(240px, 40%) minmax(0, 1fr); gap: 10px; }
.v396f-prev, .v396f-parts { min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .1); padding: 10px; }
.v396f-card { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.v396f-card img { width: 76px; height: 76px; flex-shrink: 0; border-radius: 16px; background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .16), rgba(255, 255, 255, .03) 70%); }
.v396f-card b { font-size: 15px; line-height: 1.15; display: block; }
.v396f-card small { color: #a39cc4; font-size: 11px; }

.v396f-stats { display: grid; grid-template-columns: auto minmax(36px, 1fr) auto auto; gap: 5px 8px; align-items: center; font-size: 12px; }
.v396f-stats.nocmp { grid-template-columns: auto minmax(36px, 1fr) auto; }
.v396f-stats .l { color: #d8d2f4; white-space: nowrap; }
.v396f-stats .bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.v396f-stats .bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #f0a03a, #ffd35a); transition: width .25s; }
.v396f-stats .bar.low i { background: linear-gradient(90deg, #6a8cc8, #a8c4f0); }
.v396f-stats .v { font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.v396f-stats .d { font-size: 10.5px; font-weight: 800; text-align: right; white-space: nowrap; min-width: 40px; }
.v396f-stats .d.eq { color: #8a84aa; }
.v396f .up { color: #7af09a; }
.v396f .dn { color: #ff8a8a; }
.v396f-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.v396f-tags span { font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 8px; background: rgba(255, 211, 90, .13); color: #ffe08a; }
.v396f-cmp { font-size: 10.5px; color: #a39cc4; margin-top: 8px; line-height: 1.35; }
.v396f-cmp b { color: #e0dcf4; }
.v396f-q { font-size: 10px; color: #8a84aa; margin-top: 6px; line-height: 1.35; }

.v396f-ph { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; }
.v396f-ph b { font-size: 12px; letter-spacing: .6px; text-transform: uppercase; color: #ffd35a; }
.v396f-ph span { font-size: 11px; color: #a39cc4; }
.v396f-mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin-bottom: 12px; }
.v396f-m { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 7px; row-gap: 1px; align-items: center; padding: 6px 8px 6px 6px; border-radius: 11px; background: rgba(255, 255, 255, .05); border: 1.5px solid rgba(255, 255, 255, .1); cursor: pointer; min-width: 0; transition: transform .08s; }
.v396f-m > img, .v396f-m > .nog { grid-row: 1 / span 2; width: 34px; height: 34px; }
.v396f-m > .nog { display: flex; align-items: center; justify-content: center; font-size: 18px; opacity: .5; }
.v396f-m .t { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; min-width: 0; }
.v396f-m .t b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.v396f-m .t .c { font-size: 11px; font-weight: 900; flex-shrink: 0; }
.v396f-m .c.ok { color: #8af0a8; }
.v396f-m .c.no { color: #ff9a9a; }
.v396f-m .h { font-size: 10px; line-height: 1.3; min-width: 0; overflow: hidden; color: #c8c0ff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.v396f-m .h i { white-space: nowrap; display: inline-block; }
.v396f-m .h i { font-style: normal; font-weight: 800; margin-right: 6px; }
.v396f-m .h i.chs { color: #a39cc4; font-weight: 700; }
.v396f-m.sel { border-color: #ffd35a; background: rgba(255, 211, 90, .12); box-shadow: 0 0 0 2px rgba(255, 211, 90, .25); }
.v396f-m.no { opacity: .55; }
.v396f-m:active { transform: scale(.97); }
.v396f-none { grid-column: 1 / -1; font-size: 11px; color: #a39cc4; padding: 4px 2px; }

.v396f-foot { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.v396f-foot > .btn.sm { flex: 0 0 auto; }
.v396f-cost { flex: 1 1 auto; min-width: 0; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; }
.v396f-cost::-webkit-scrollbar { display: none; }
.v396f-cost span { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 3px 9px 3px 4px; border-radius: 9px; background: rgba(0, 0, 0, .3); color: #e0dcf4; }
.v396f-cost span b { font-weight: 900; }
.v396f-cost span.ok b { color: #8af0a8; }
.v396f-cost span.no b { color: #ff9a9a; }
.v396f-cost img { width: 22px; height: 22px; }
.v396f-foot > .btn.big { flex: 0 0 auto; font-size: 15px; padding: 9px 20px; }

@media (max-height: 460px) {
  .v396f { gap: 6px; }
  .v396f-prev, .v396f-parts { padding: 7px 8px; }
  .v396f-card { margin-bottom: 5px; }
  .v396f-card img { width: 54px; height: 54px; border-radius: 12px; }
  .v396f-card b { font-size: 13.5px; }
  .v396f-stats { font-size: 11px; gap: 3px 7px; }
  .v396f-mats { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 4px; margin-bottom: 8px; }
  .v396f-m { padding: 4px 6px 4px 4px; grid-template-columns: 30px minmax(0, 1fr); }
  .v396f-m > img, .v396f-m > .nog { width: 30px; height: 30px; }
  .v396f-foot > .btn.big { padding: 7px 14px; font-size: 14px; }
  .v396f-cost img { width: 18px; height: 18px; }
  .v396f-cost span { font-size: 10.5px; }
}
/* ventanas muy estrechas: una sola columna que baja entera */
@media (max-width: 600px) {
  .v396f-main { display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .v396f-prev, .v396f-parts { overflow: visible; margin-bottom: 8px; }
  .v396f-cost span { font-size: 10.5px; }
  .v396f-foot > .btn.sm { padding-left: 8px; padding-right: 8px; }
}

/* v3.9.8: guía del mando por contexto, sin bloquear el juego. */
#gp398-hud { position:absolute; left:50%; bottom:8px; transform:translateX(-50%);
  display:none; flex-wrap:wrap; gap:5px 9px; align-items:center; justify-content:center;
  width:max-content; max-width:min(96vw,700px); box-sizing:border-box;
  padding:5px 9px; border:1px solid rgba(180,175,240,.3); border-radius:12px;
  background:rgba(10,12,27,.82); color:#e5e6f9; font:600 11px/1.3 sans-serif;
  pointer-events:none; z-index:15; }
#gp398-hud strong {color:#ffdb87; white-space:nowrap}
#gp398-hud span {display:inline-flex;align-items:center;gap:3px;white-space:nowrap}
#gp398-hud .glyph {font-size:10px;min-width:17px;padding:2px 3px}
.gp398-dialog .box {overflow:auto}
.gp398-tabs {display:flex; flex-wrap:wrap}
.gp398-list {max-height:42vh;overflow:auto}
.gp398-list .remap-row {cursor:pointer}
@media(max-height:420px) {#gp398-hud{bottom:2px;padding:3px 6px;font-size:10px}.gp398-list{max-height:30vh}}
