/* ---- assets/css/game.css ---- */
:root{
  --bg:#0b1220; --panel:#121b2e; --panel2:#18243a; --line:#2a3855;
  --text:#eef4ff; --muted:#9fb0ca; --gold:#f4c45e; --danger:#ff6b6b;
  --wei:#3173d8; --shu:#43a85d; --wu:#d84a4a;
}
*{box-sizing:border-box}
html,body{margin:0;background:radial-gradient(circle at 50% 0%,#17243c 0,#0a1020 55%,#070c16 100%);color:var(--text);font-family:system-ui,-apple-system,"Noto Sans KR",sans-serif}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
.app{min-height:100vh;display:grid;grid-template-columns:270px minmax(700px,1fr) 290px;gap:12px;padding:12px}
.panel{background:rgba(18,27,46,.94);border:1px solid var(--line);border-radius:16px;box-shadow:0 12px 40px #0005;overflow:hidden}
.panel h2,.panel h3{margin:0}
.side{padding:14px;display:flex;flex-direction:column;gap:12px}
.brand{padding:4px 0 8px}
.brand h1{font-size:20px;margin:0 0 3px}
.small{font-size:12px;color:var(--muted);line-height:1.5}
.statbox{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.stat{background:#0b1324;border:1px solid #283652;border-radius:12px;padding:10px}
.stat b{display:block;font-size:21px;margin-top:2px}
.gold{color:var(--gold)}
.hpbar{height:10px;background:#222c3d;border-radius:999px;overflow:hidden;margin-top:5px}
.hpfill{height:100%;background:linear-gradient(90deg,#45d36b,#d6dc55);width:100%}
.btnrow{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.btn{border:1px solid #334767;background:#1a2942;color:#fff;border-radius:10px;padding:9px 10px}
.btn:hover{background:#223553}
.btn.primary{background:#2c62ba;border-color:#4f84df}
.btn.warn{background:#7e3e28;border-color:#b76242}
.btn:disabled{opacity:.4;cursor:not-allowed}
.log{height:250px;overflow:auto;background:#080f1d;border:1px solid #22304a;border-radius:12px;padding:8px;font-size:12px;line-height:1.55}
.log div{padding:3px 4px;border-bottom:1px dashed #1f2c42}
.turnbadge{display:inline-flex;align-items:center;gap:6px;background:#0c172a;border:1px solid #334565;border-radius:999px;padding:5px 9px;font-size:12px}

.battle-panel{display:flex;flex-direction:column;min-width:0}
.topbar{height:58px;display:flex;align-items:center;justify-content:space-between;padding:9px 14px;border-bottom:1px solid var(--line);background:#111a2c}
.topbar .title{font-weight:800}
.controls{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
select,input{background:#0d1727;color:#eef4ff;border:1px solid #31415f;border-radius:8px;padding:7px}

.boardwrap{position:relative;flex:1;min-height:740px;overflow:auto;background:
linear-gradient(#0002,#0002),
repeating-linear-gradient(90deg,transparent 0,transparent 79px,#ffffff08 80px),
linear-gradient(180deg,#4a2c2b 0 13%,#3d4a2d 13% 87%,#233d59 87% 100%)}
.board{min-width:680px;max-width:900px;margin:0 auto;padding:10px 16px 14px;display:flex;flex-direction:column;gap:6px}
.basezone{display:grid;grid-template-columns:1fr 1.6fr 1fr;gap:10px;align-items:center;margin:0 auto;width:min(650px,90%)}
.hq{height:80px;border:2px solid #d09943;background:linear-gradient(180deg,#a95f21,#6d341a);border-radius:12px;padding:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;box-shadow:0 7px 18px #0006}
.hq.ally{background:linear-gradient(180deg,#2c5aa2,#173b72);border-color:#6aa0ee}
.hq .hptxt{font-weight:900;font-size:20px}
.hq.faction-fortress{
  min-height:112px;height:112px;background-size:cover!important;background-position:center!important;
  overflow:hidden;isolation:isolate;justify-content:flex-end;padding:8px 10px 7px;
}
.hq.faction-fortress::before{
  content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,#00000008 0%,#00000030 48%,#000000d8 100%);
}
.hq.faction-fortress::after{
  content:"";position:absolute;inset:0;z-index:-1;box-shadow:inset 0 0 0 1px #ffffff18,inset 0 -35px 45px #0009;pointer-events:none;
}
.hq-title{font-size:11px;font-weight:950;letter-spacing:.08em;text-shadow:0 2px 5px #000;line-height:1.2}
.hq-subtitle{font-size:8px;color:#e8eef7d6;text-shadow:0 1px 4px #000;margin-bottom:1px}
.hq.faction-fortress .hptxt{font-size:18px;text-shadow:0 2px 6px #000}
.hq.faction-fortress.emergency,.hq.faction-fortress.has-base-unit{height:142px}
.hq.faction-fortress .hq-unit-slot{background:#050b13d9;backdrop-filter:blur(2px)}
.advisor{min-height:78px;height:78px;overflow:hidden}
.advisor.has-portrait{padding:4px;background:#0e1827;border-color:#96b36b}
.advisor-card.rich{display:grid;grid-template-columns:46px 1fr;gap:6px;text-align:left;align-items:center;width:100%;height:100%}
.advisor-portrait{width:46px;height:62px;border-radius:7px;overflow:hidden;border:1px solid #d9e99577;background:#16211b}
.advisor-portrait img{width:100%;height:100%;object-fit:cover;display:block}
.advisor-copy{min-width:0;display:flex;flex-direction:column;gap:2px}
.advisor-copy b{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hq{position:relative}
.hq.emergency{border-color:#ffb347;box-shadow:0 0 0 2px #ffb34744,0 7px 18px #0006}
.hq.emergency,.hq.has-base-unit{height:116px}
.hq.summon-valid{outline:3px solid #67d87b;box-shadow:0 0 0 5px #67d87b22,0 7px 18px #0006}
.hq-unit-slot{display:none;width:92%;height:38px;margin-top:4px;border:1px dashed #ffffff66;border-radius:7px;background:#07101d99;align-items:center;justify-content:center;overflow:hidden}
.hq.emergency .hq-unit-slot,.hq.has-base-unit .hq-unit-slot{display:flex}
.hq-unit-slot.empty::after{content:"본진 소환 1칸";font-size:9px;color:#d8e5f7aa}
.base-unit{width:100%;height:100%;display:grid;grid-template-columns:30px 1fr auto;align-items:center;gap:5px;padding:3px 5px;border-radius:6px;border:1px solid #8aa5cc;background:#172842;cursor:pointer;position:relative}
.base-unit.wei{border-color:#66a7ff;background:#173a71}.base-unit.shu{border-color:#73df8c;background:#235f31}.base-unit.wu{border-color:#ff8181;background:#6e2424}
.base-unit.selected{outline:2px solid #ffe07d}.base-unit.spent{filter:saturate(.55) brightness(.72)}
.base-unit-art{height:28px;border-radius:4px;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#0004;font-size:18px}.base-unit-art img{width:100%;height:100%;object-fit:cover}
.base-unit-name{min-width:0;font-size:9px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.base-unit-stat{font-size:8px;color:#d9e6f8;white-space:nowrap}
.advisor{height:67px;border:2px solid #74aa4e;background:linear-gradient(180deg,#7ec44d,#3b7836);border-radius:12px;padding:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;font-size:12px;box-shadow:0 5px 14px #0005}
.advisor .mana{font-weight:800;color:#eefdb9}
.advisor{cursor:pointer;position:relative;transition:.15s ease}
.advisor:hover{filter:brightness(1.07)}
.advisor.summon-valid{outline:3px solid #67d87b;box-shadow:0 0 0 5px #67d87b22,0 7px 18px #0006}
.advisor.active{outline:3px solid #ffe07d;box-shadow:0 0 0 5px #ffe07d22,0 7px 18px #0006}
.advisor-card{width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;line-height:1.15}
.advisor-card b{font-size:12px}
.advisor-card .advisor-meta{font-size:9px;color:#eaf6d6}
.advisor-empty{font-size:10px;color:#e6f5d2aa;line-height:1.35}
.advisor-level{display:inline-flex;align-items:center;gap:4px;background:#101b26aa;border:1px solid #d7ed9a88;border-radius:999px;padding:2px 6px;font-size:9px;font-weight:900}

.lane{position:relative;border:1px solid #ffffff1a;border-radius:14px;padding:6px 8px;background:#0d162654}
.lane .label{position:absolute;left:8px;top:6px;font-size:11px;color:#d7e2f2aa;z-index:2}
.slots{display:grid;gap:8px;justify-content:center;min-height:92px;align-items:center}
.slots.n4{grid-template-columns:repeat(4,110px)}
.slots.n3{grid-template-columns:repeat(3,120px)}
.slots.n2{grid-template-columns:repeat(2,132px)}
.slot{height:84px;border:1px dashed #c7d5ef44;border-radius:10px;background:#07101d44;display:flex;align-items:center;justify-content:center;position:relative}
.slot.empty::after{content:"빈칸";font-size:11px;color:#c3d1e455}
.slot.valid{outline:2px solid #67d87b;box-shadow:0 0 0 4px #67d87b26}
.slot.attackable{outline:2px solid #ff6b6b;box-shadow:0 0 0 4px #ff6b6b22}
.slot.movable{outline:2px solid #f1c859;box-shadow:0 0 0 4px #f1c85922}
.slot .move-cost{position:absolute;left:4px;top:4px;z-index:10;background:#5b430ee8;color:#fff3b4;border:1px solid #f1c859;border-radius:999px;padding:2px 6px;font-size:8px;font-weight:950;pointer-events:none}
.slot.supportable{outline:3px solid #58e2d0;box-shadow:0 0 0 5px #58e2d02e,0 0 20px #58e2d033}
.slot.supportable::before{content:"협력 대상";position:absolute;right:4px;top:4px;z-index:8;background:#0a4b46e8;color:#d9fffa;border:1px solid #72f0df;border-radius:999px;padding:2px 6px;font-size:8px;font-weight:900;pointer-events:none}
.support-charge{position:absolute;right:3px;bottom:3px;z-index:4;background:#073f3bde;color:#d8fff9;border:1px solid #65e6d5;border-radius:5px;padding:2px 4px;font-size:8px;font-weight:900}
.support-guide{margin-top:7px;padding:8px 9px;border:1px solid #3aa99c;background:#0b2c2a;border-radius:9px;color:#cffff8;font-size:11px;line-height:1.45}

.river{height:34px;border:1px solid #8ccdf233;border-radius:12px;background:linear-gradient(90deg,#1c587c77,#3b86a877,#1d628477);display:flex;align-items:center;justify-content:center;font-size:11px;letter-spacing:5px;color:#d8f3ff;margin:2px 0}

.unit{width:100%;height:100%;border-radius:9px;border:2px solid #aaa;background:#1e2d48;display:grid;grid-template-rows:auto 1fr auto;overflow:hidden;position:relative;box-shadow:0 5px 12px #0005}
.unit.wei{border-color:#66a7ff;background:linear-gradient(180deg,#255baf,#173a71)}
.unit.shu{border-color:#73df8c;background:linear-gradient(180deg,#3a944f,#235f31)}
.unit.wu{border-color:#ff8181;background:linear-gradient(180deg,#ae3f3f,#6e2424)}
.unit.selected{outline:3px solid #ffe07d;transform:translateY(-2px)}
.unit.spent{filter:saturate(.55) brightness(.72)}
.uname{font-size:12px;font-weight:800;padding:3px 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:#0003}
.uimg{display:flex;align-items:center;justify-content:center;font-size:24px;position:relative}
.grade{position:absolute;right:3px;top:3px;font-size:9px;font-weight:950;background:#111d;padding:2px 5px;border-radius:5px;border:1px solid #ffffff55;z-index:3}
.grade-S,.card-grade.grade-S{background:#8a5b08;color:#fff3bd;border-color:#ffd76a}
.grade-R,.card-grade.grade-R{background:#6d285f;color:#ffd8f7;border-color:#e98ad7}
.grade-U,.card-grade.grade-U{background:#205d72;color:#d9f7ff;border-color:#78d8f5}
.grade-C,.card-grade.grade-C{background:#3e4a59;color:#edf3fa;border-color:#9aa9ba}
.stats{display:grid;grid-template-columns:repeat(3,1fr);font-size:10px;text-align:center;background:#050a12aa;padding:3px}
.buff{position:absolute;left:3px;top:23px;background:#f7c64d;color:#1a1405;font-size:9px;font-weight:800;border-radius:5px;padding:2px 4px}
.typeicon{position:absolute;left:3px;bottom:3px;font-size:11px;background:#0008;border-radius:5px;padding:2px 4px}

.handbox{border-top:1px solid var(--line);background:#0d1628;padding:8px 10px}

.bottom-hud{
  position:sticky;
  bottom:0;
  z-index:25;
  background:linear-gradient(180deg,#101a2d 0%,#0b1322 100%);
  border-top:2px solid #354b70;
  box-shadow:0 -12px 28px #0009;
}
.hud-status{
  display:grid;
  grid-template-columns:72px 90px 92px 72px minmax(135px,1fr) minmax(135px,1fr) 95px auto;
  gap:7px;
  align-items:stretch;
  padding:8px 10px 5px;
}
.hud-block,.hud-hp{
  min-height:52px;
  border:1px solid #2e405f;
  background:#0a1323;
  border-radius:10px;
  padding:6px 8px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.hud-block b{
  font-size:19px;
  line-height:1.1;
}
.hud-block.ap{
  border-color:#b88929;
  background:linear-gradient(180deg,#362b14,#18160f);
}
.hud-block.ap b{
  font-size:25px;
  text-shadow:0 0 12px #f4c45e66;
}
.hud-label{
  font-size:10px;
  color:#9fb0ca;
  white-space:nowrap;
}
.hud-hp-line{
  display:grid;
  grid-template-columns:46px 1fr;
  gap:7px;
  align-items:center;
}
.hud-hp-line b{font-size:14px}
.hud-hp .hpbar{margin:0;height:9px}
.hud-hp.enemy .hpfill{
  background:linear-gradient(90deg,#ff8e78,#d64444);
}
.hud-actions{
  display:grid;
  grid-template-columns:repeat(2,minmax(78px,1fr));
  gap:5px;
  min-width:180px;
}
.hud-actions .btn{
  padding:5px 7px;
  font-size:11px;
  min-height:24px;
}
.bottom-hud .handbox{
  border-top:1px solid #263854;
  background:#0b1424;
  padding:6px 10px 8px;
}
.bottom-hud .hand{
  min-height:128px;
}
.bottom-hud .card{
  flex-basis:100px;
  height:126px;
  grid-template-rows:19px 50px 19px 1fr;
}
.boardwrap{
  min-height:0 !important;
}
.battle-panel{
  height:calc(100vh - 24px);
}

.handhead{display:flex;justify-content:space-between;align-items:center;margin-bottom:7px}
.hand{display:flex;gap:7px;overflow-x:auto;padding-bottom:4px;min-height:142px}
.card{flex:0 0 106px;height:138px;border:2px solid #5577a7;border-radius:10px;background:#20385e;display:grid;grid-template-rows:20px 58px 20px 1fr;overflow:hidden;position:relative;box-shadow:0 5px 12px #0005}
.card.wei{border-color:#65a0ff;background:#2558a0}
.card.shu{border-color:#6fd47f;background:#3b8c49}
.card.wu{border-color:#ff7777;background:#a94141}
.card.item{border-color:#e4c16b;background:#6a5426}
.card.tactic{border-color:#be8cff;background:#56388a}
.card.support{border-color:#75e7d4}
.card.advisor-card-hand{border-color:#d7ed79;background:linear-gradient(180deg,#5c6f2b,#26361c)}
.card.selected{outline:3px solid #ffe47b;transform:translateY(-4px)}
.cname{font-size:11px;font-weight:900;padding:2px 4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:#0004}
.cimg{display:flex;align-items:center;justify-content:center;font-size:30px;background:#ead9c355;color:#101623}
.cstats{font-size:9px;text-align:center;padding:2px;background:#0006}
.ctext{font-size:9px;line-height:1.25;padding:4px;overflow:hidden}
.cost{position:absolute;right:4px;top:23px;background:#0b1527;border-radius:999px;width:22px;height:22px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:900;color:#ffd96a;border:1px solid #d1a63f}
.card-grade{position:absolute;left:4px;top:23px;z-index:4;border-radius:999px;padding:2px 6px;font-size:8px;font-weight:950;border:1px solid #ffffff66;box-shadow:0 2px 6px #0007}

.right-section{border:1px solid #293854;border-radius:12px;overflow:hidden}
.right-title{padding:8px 10px;background:#0b1424;font-size:13px;font-weight:800;border-bottom:1px solid #293854}
.details{padding:10px;font-size:12px;line-height:1.55;min-height:170px}
.skilllist{display:grid;gap:7px;padding:8px}
.skill{border:1px solid #3b4e71;background:#14233c;border-radius:9px;padding:8px;color:#fff;text-align:left}
.skill b{display:block;font-size:12px}
.skill span{font-size:10px;color:#aabbd3}
.legend{display:grid;grid-template-columns:1fr 1fr;gap:6px;font-size:11px}
.legend div{padding:6px;border-radius:7px;background:#0b1424}
.dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:5px}
.admin{max-height:300px;overflow:auto;padding:9px}
.admin label{font-size:10px;color:#9fb0ca;display:block;margin-top:5px}
.admin input,.admin select,.admin textarea{width:100%;padding:6px;font-size:11px}
.admin textarea{height:55px;resize:vertical}
.notice{background:#392f17;border:1px solid #6f5a20;color:#f1da93;padding:7px 9px;border-radius:9px;font-size:11px;line-height:1.5}

.modal{position:fixed;inset:0;background:#000a;display:none;align-items:center;justify-content:center;z-index:50}
.modal.show{display:flex}
.modalbox{width:min(680px,94vw);max-height:88vh;overflow:auto;background:#111a2d;border:1px solid #40506d;border-radius:16px;padding:16px}
.rules{font-size:13px;line-height:1.65}
.rules ol{padding-left:22px}
.win{font-size:32px;font-weight:950;text-align:center;margin:16px 0}
@media (max-width:1180px){
  .app{grid-template-columns:220px minmax(650px,1fr)}
  .right{grid-column:1 / -1;display:grid;grid-template-columns:repeat(3,1fr)}
}
@media (max-width:850px){
  .app{display:block;padding:6px}
  .side{margin-bottom:8px}
  .left{display:grid;grid-template-columns:1fr 1fr}
  .left .brand,.left .log{grid-column:1/-1}
  .boardwrap{min-height:720px}
  .right{display:block}
}

@media (max-width:1300px){
  .hud-status{
    grid-template-columns:65px 78px 82px 62px minmax(120px,1fr) minmax(120px,1fr) 85px;
  }
  .hud-actions{
    grid-column:1/-1;
    grid-template-columns:repeat(4,1fr);
  }
}
@media (max-width:850px){
  .battle-panel{height:auto;min-height:100vh}
  .bottom-hud{position:sticky;bottom:0}
  .hud-status{
    grid-template-columns:repeat(4,1fr);
  }
  .hud-hp{
    grid-column:span 2;
  }
  .hud-block.mana{
    grid-column:span 2;
  }
  .hud-actions{
    grid-column:span 2;
    grid-template-columns:repeat(2,1fr);
    min-width:0;
  }
  .bottom-hud .hand{
    min-height:118px;
  }
  .bottom-hud .card{
    flex-basis:92px;
    height:116px;
  }
}


.lane.captured-ally{
  border-color:#6fb0ff;
  box-shadow:inset 0 0 0 1px #6fb0ff55, 0 0 18px #2d70d844;
}
.lane.captured-enemy{
  border-color:#ff7a7a;
  box-shadow:inset 0 0 0 1px #ff7a7a55, 0 0 18px #d84a4a44;
}
.lane .capture-tag{
  position:absolute;
  right:8px;
  top:5px;
  z-index:3;
  font-size:10px;
  font-weight:900;
  border-radius:999px;
  padding:2px 7px;
  background:#09111dcc;
  border:1px solid #ffffff2b;
}
.lane.captured-ally .capture-tag{color:#8dc2ff}
.lane.captured-enemy .capture-tag{color:#ff9a9a}


/* 즉시 안내 팝업 */
.game-toast-wrap{
  position:fixed;left:50%;top:72px;transform:translateX(-50%);
  z-index:120;display:flex;flex-direction:column;gap:8px;
  width:min(520px,92vw);pointer-events:none;
}
.game-toast{
  pointer-events:auto;
  border:1px solid #49617f;background:#101c30ee;color:#f6f9ff;
  border-radius:12px;padding:11px 14px;box-shadow:0 12px 34px #0009;
  font-size:13px;line-height:1.45;animation:toastIn .16s ease-out;
}
.game-toast strong{display:block;font-size:13px;margin-bottom:2px}
.game-toast.info{border-color:#4d7cc2;background:#102344f2}
.game-toast.error{border-color:#d45d5d;background:#401b22f2}
.game-toast.success{border-color:#55a96d;background:#173622f2}
.game-toast.warn{border-color:#d2a545;background:#403319f2}
.game-toast.equipment-event{position:relative;overflow:hidden;border-width:2px;box-shadow:0 16px 42px #000a,0 0 18px #ffffff15;animation:equipmentToastIn .42s cubic-bezier(.2,.9,.2,1.05)}
.game-toast.equipment-event::after{content:'';position:absolute;inset:-40% auto auto -30%;width:55%;height:190%;background:linear-gradient(90deg,transparent,#ffffff80,transparent);transform:rotate(18deg);animation:equipmentShine 1.05s ease-out 1}
.game-toast.equipment-destroy{border-color:#ff9867;background:linear-gradient(135deg,#5b1e10f5,#28110af5 60%,#130c09f5)}
.game-toast.equipment-steal{border-color:#74d8ff;background:linear-gradient(135deg,#0f3353f5,#0b1d34f5 60%,#091118f5)}
@keyframes toastIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}
@keyframes equipmentToastIn{0%{opacity:0;transform:translateY(-18px) scale(.92)}55%{opacity:1;transform:translateY(3px) scale(1.03)}100%{opacity:1;transform:translateY(0) scale(1)}}
@keyframes equipmentShine{from{transform:translateX(-160%) rotate(18deg)}to{transform:translateX(270%) rotate(18deg)}}

/* 카드 이미지 */
.card-art-img,.unit-art-img{width:100%;height:100%;object-fit:cover;display:block}
.cimg,.uimg{overflow:hidden}
.default-art{width:100%;height:100%;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden;background:radial-gradient(circle at 30% 25%,#ffffff55 0,#ffffff15 16%,transparent 18%),linear-gradient(180deg,#334a73 0,#17253e 100%)}
.default-art::after{content:'';position:absolute;inset:10% 16%;border-radius:16px;background:radial-gradient(circle at 50% 35%,#ffffff3d 0,#ffffff15 22%,transparent 23%),linear-gradient(180deg,#ffffff14,#00000018);border:1px solid #ffffff24;box-shadow:inset 0 0 18px #00000022}
.default-art span{position:relative;z-index:1;font-size:28px;filter:drop-shadow(0 4px 8px #0008)}
.default-art.card span{font-size:34px}
.default-art.card.wei{background:radial-gradient(circle at 25% 20%,#ffffff4d 0,#ffffff12 18%,transparent 20%),linear-gradient(180deg,#3d6ec8 0,#1d3663 100%)}
.default-art.card.shu{background:radial-gradient(circle at 25% 20%,#ffffff4d 0,#ffffff12 18%,transparent 20%),linear-gradient(180deg,#49a866 0,#234b2d 100%)}
.default-art.card.wu{background:radial-gradient(circle at 25% 20%,#ffffff4d 0,#ffffff12 18%,transparent 20%),linear-gradient(180deg,#cf5b5b 0,#5e2424 100%)}
.default-art.card.item,.default-art.unit.item{background:radial-gradient(circle at 25% 20%,#fff4c455 0,#fff0bc18 18%,transparent 20%),linear-gradient(180deg,#9d7a2f 0,#4b3813 100%)}
.default-art.card.tactic,.default-art.unit.tactic{background:radial-gradient(circle at 25% 20%,#f0dcff55 0,#f0dcff18 18%,transparent 20%),linear-gradient(180deg,#7656aa 0,#342155 100%)}
.default-art.card.support,.default-art.unit.support{background:radial-gradient(circle at 25% 20%,#ffffff55 0,#ffffff12 18%,transparent 20%),linear-gradient(180deg,#5f7ab3 0,#24314f 100%)}
.default-art.card.advisor,.default-art.unit.advisor{background:radial-gradient(circle at 25% 20%,#f7ffd855 0,#efff9a18 18%,transparent 20%),linear-gradient(180deg,#71834a 0,#2b371f 100%)}

/* 카드 관리자 */
.card-manager-box{
  width:min(1180px,96vw);height:min(820px,92vh);padding:0;overflow:hidden;
  display:grid;grid-template-rows:58px 1fr;background:#0c1424;
}
.manager-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 14px;border-bottom:1px solid #32425f;background:#121d31;
}
.manager-head h2{font-size:18px;margin:0}
.manager-main{display:grid;grid-template-columns:320px 1fr;min-height:0}
.manager-list-pane{border-right:1px solid #2d3d59;padding:10px;display:flex;flex-direction:column;gap:8px;min-height:0}
.manager-search{display:grid;grid-template-columns:1fr 94px;gap:6px}
.manager-list{overflow:auto;display:flex;flex-direction:column;gap:6px;padding-right:3px}
.manager-card-row{
  border:1px solid #2e405e;background:#101b2e;color:#fff;border-radius:9px;
  display:grid;grid-template-columns:48px 1fr auto;gap:8px;align-items:center;
  padding:6px;text-align:left;cursor:pointer;
}
.manager-card-row:hover,.manager-card-row.active{border-color:#6c95d2;background:#172844}
.manager-thumb{width:48px;height:58px;border-radius:6px;background:#23324b;overflow:hidden;display:flex;align-items:center;justify-content:center;font-size:22px}
.manager-row-name{font-weight:800;font-size:12px}
.manager-row-meta{font-size:10px;color:#9fb1cb;margin-top:2px}
.manager-edit-pane{overflow:auto;padding:14px}
.manager-grid{display:grid;grid-template-columns:220px 1fr;gap:16px}
.manager-preview-wrap{display:flex;flex-direction:column;gap:8px}
.manager-preview{
  height:300px;border:2px solid #4a6388;border-radius:14px;overflow:hidden;
  background:#1d2b43;display:flex;align-items:center;justify-content:center;font-size:62px;
}
.manager-preview img{width:100%;height:100%;object-fit:cover}
.manager-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.manager-field{display:flex;flex-direction:column;gap:4px}
.manager-field.full{grid-column:1/-1}
.manager-field label{font-size:10px;color:#9fb0ca}
.manager-field input,.manager-field select,.manager-field textarea{width:100%;background:#091321;color:#fff;border:1px solid #334763;border-radius:8px;padding:8px}
.manager-field textarea{min-height:84px;resize:vertical}
.manager-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}
.manager-help{font-size:11px;color:#99abc3;line-height:1.55;background:#0a1322;border:1px solid #283852;border-radius:9px;padding:9px}
@media(max-width:850px){
  .card-manager-box{height:94vh}
  .manager-main{grid-template-columns:1fr;grid-template-rows:210px 1fr}
  .manager-list-pane{border-right:0;border-bottom:1px solid #2d3d59}
  .manager-grid{grid-template-columns:1fr}
  .manager-preview{height:220px}
  .manager-form{grid-template-columns:1fr}
}



/* ================================================================
   v10 reference battlefield UI — user-supplied screenshot inspired
   ================================================================ */
:root{
  --ref-bg:#070b0c;--ref-panel:#0b1113;--ref-panel2:#111719;
  --ref-gold:#b9853e;--ref-gold2:#e0b36a;--ref-copper:#74451d;
  --ref-red:#8e251d;--ref-blue:#1f527b;--ref-text:#e7dfcf;--ref-muted:#a69a86;
  --castle-wei:url("../images/castle_wei.jpg");
  --castle-shu:url("../images/castle_shu.jpg");
  --castle-wu:url("../images/castle_wu.jpg");
}
html,body{height:100%;overflow:hidden;background:#050708;color:var(--ref-text);font-family:"Malgun Gothic","Noto Sans KR",system-ui,sans-serif}
body{background:
  radial-gradient(circle at 50% 38%,#34251435 0 18%,transparent 52%),
  repeating-linear-gradient(0deg,#ffffff018 0 1px,transparent 1px 4px),
  linear-gradient(180deg,#080c0d,#040607)}
.app{height:100vh;min-height:720px;display:grid;grid-template-columns:230px minmax(720px,1fr) 350px;gap:4px;padding:4px}
.panel{border-radius:0;border:1px solid #5d3d1e;background:linear-gradient(180deg,#0b1113f7,#070b0df7);box-shadow:inset 0 0 0 1px #16100a,inset 0 0 32px #000b,0 0 0 1px #000;position:relative}
.panel::before,.panel::after{content:"";position:absolute;width:22px;height:22px;pointer-events:none;z-index:40;opacity:.85}
.panel::before{left:3px;top:3px;border-left:2px solid #8f622d;border-top:2px solid #8f622d}
.panel::after{right:3px;bottom:3px;border-right:2px solid #8f622d;border-bottom:2px solid #8f622d}
.side{padding:0;gap:0;min-height:0}
.small{color:#9d927f}

.reference-left{display:flex;flex-direction:column;overflow:hidden}
.reference-brand{height:94px;min-height:94px;padding:13px 15px 8px;border-bottom:1px solid #68441f;background:linear-gradient(180deg,#0a0f10,#070a0b)}
.reference-brand h1{margin:0;font-family:"Malgun Myeongjo","Batang",serif;font-size:31px;line-height:1.05;letter-spacing:-1.7px;color:#d7a65b;text-shadow:0 2px 0 #241608,0 0 15px #b87d3340}
.reference-brand h1::first-letter{font-size:37px}
.brand-sub{font-size:15px;font-weight:800;letter-spacing:.14em;color:#d6a14d;margin-top:8px}
.ornate-title{height:28px;display:flex;align-items:center;justify-content:center;border-bottom:1px solid #6a4624;background:linear-gradient(180deg,#15202a,#0b1116);font-size:13px;font-weight:900;color:#d7dbe1;letter-spacing:.05em;text-shadow:0 1px #000}
.ornate-title.enemy{color:#e47462;background:linear-gradient(180deg,#251411,#130b09)}
.ornate-title.ally{color:#71aee3;background:linear-gradient(180deg,#10202c,#0a1218)}
.left-status-frame{border-bottom:1px solid #69451f;background:linear-gradient(180deg,#0b1721,#071017);padding-bottom:5px}
.left-stat-row,.resource-line{min-height:37px;display:flex;align-items:center;justify-content:space-between;padding:0 15px;border-bottom:1px solid #273139;font-size:13px}
.left-stat-row span,.resource-line span{color:#b7afa1}
.left-stat-row b,.resource-line b{font-size:16px;color:#ede4d4}
.hp-value{color:#d9e7f6!important} .hp-value::first-letter{color:#4f98d0}
.mana-value{color:#d7e9fb!important}
.left-ap-row{display:flex;align-items:center;justify-content:space-between;padding:3px 15px 0;color:#baaa90;font-size:12px}
.left-ap-row b{font-size:21px;color:#e2b45e}
.left-advisor-frame{border-bottom:1px solid #69451f;background:linear-gradient(180deg,#101519,#090d0f)}
.advisor-mirror{height:108px;padding:7px 8px;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 35% 20%,#263849 0,transparent 44%),#0b1114}
.advisor-mirror-empty{font-size:11px;color:#7e7669;text-align:center;line-height:1.5}
.advisor-mirror-card{width:100%;height:100%;display:grid;grid-template-columns:76px 1fr;gap:8px;align-items:center}
.advisor-mirror-art{height:92px;border:1px solid #8d6738;background:#13191d;overflow:hidden;box-shadow:inset 0 0 0 1px #000}
.advisor-mirror-art img,.advisor-mirror-art .default-art{width:100%;height:100%;object-fit:cover}
.advisor-mirror-copy b{display:block;color:#e7d0a4;font-size:14px;margin-bottom:4px}
.advisor-mirror-copy span{display:block;color:#b7ac9a;font-size:10px;line-height:1.45}
.advisor-switch{width:calc(100% - 16px);margin:0 8px 5px;min-height:29px;padding:4px}
.compact-skills{padding:0 8px 7px}
.compact-skills .notice{padding:5px 6px;margin-bottom:5px;font-size:9px;line-height:1.35;border-radius:2px;background:#1a1610;border-color:#5d4c2c;color:#cbb98d}
.compact-skill-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px}
.compact-skill-grid .skill,.compact-skill-grid .btn{min-height:35px;padding:4px 5px;border-radius:2px}
.compact-skill-grid .skill b{font-size:10px} .compact-skill-grid .skill span{font-size:8px}
.left-log-frame{flex:1;min-height:130px;display:flex;flex-direction:column;background:#080c0e}
.left-log-frame .log{flex:1;height:auto;margin:6px 7px;border-radius:0;border:1px solid #46341f;background:#050809;padding:5px;font-size:10px;line-height:1.55;color:#aeb7bd}
.log div{border-bottom:0;padding:1px 2px}
.log div:nth-child(4n+1){color:#e4b756} .log div:nth-child(4n+2){color:#79acd5} .log div:nth-child(4n+3){color:#d56a4e}
.left-bottom-actions{min-height:74px;padding:9px 16px;display:grid;grid-template-columns:1fr;gap:6px;border-top:1px solid #5d3c1d;background:#090c0d}
.left-bottom-actions .btn{min-height:27px}

.battle-panel{height:calc(100vh - 8px);min-height:0;display:flex;flex-direction:column;overflow:hidden}
.reference-topbar{height:96px;min-height:96px;padding:8px 10px;display:grid;grid-template-columns:minmax(380px,1.4fr) 150px minmax(300px,1fr);grid-template-rows:1fr 24px;gap:4px 8px;border-bottom:1px solid #6e4a24;background:linear-gradient(180deg,#0f171a,#090e10)}
.top-control-group{display:flex;gap:8px;align-items:center}
.top-field{display:flex;flex-direction:column;gap:3px;font-size:10px;color:#b39e7d}
.top-field select{min-width:126px}
.top-new{height:38px;margin-top:14px;min-width:96px}
.turn-plate{grid-row:1;grid-column:2;align-self:stretch;display:flex;flex-direction:column;align-items:center;justify-content:center;border:1px solid #8e622b;background:linear-gradient(180deg,#121a1d,#080d0f);box-shadow:inset 0 0 16px #000}
.turn-plate>div{font-family:"Malgun Myeongjo",serif;font-size:15px;color:#dcc9a5}
.turn-plate b{font-size:31px;color:#e5c288;margin-right:4px}
.turn-plate .turnbadge{margin-top:1px;border:0;background:transparent;color:#53aee3;font-weight:900;font-size:12px;padding:1px}
.top-options{display:grid;grid-template-columns:1fr 1fr auto;grid-template-rows:1fr 1fr;gap:4px 8px;align-items:center}
.checkline{display:flex;align-items:center;gap:6px;font-size:12px;color:#d0c5b4}
.checkline input{accent-color:#759e4a;width:18px;height:18px}
.top-options #cardManagerBtn{grid-column:3;grid-row:1/3;min-width:88px}
.top-options #rulesTopBtn{display:none}
.faction-pickers{grid-column:1/4;display:flex;justify-content:flex-end;gap:12px;align-items:center;border-top:1px solid #273036;padding-top:3px;font-size:9px;color:#8f8779}
.faction-pickers label{display:flex;gap:4px;align-items:center}
.faction-pickers select{padding:2px 6px;font-size:10px;min-width:70px}
select,input{border-radius:2px;background:#0b1113;border:1px solid #4b5356;color:#e2ded4;padding:7px 9px}
.btn{border-radius:2px;border:1px solid #775329;background:linear-gradient(180deg,#151b1d,#080c0d);color:#e3dac9;box-shadow:inset 0 0 0 1px #000;padding:7px 10px}
.btn:hover{background:linear-gradient(180deg,#232a2b,#0d1112)}
.btn.primary{background:linear-gradient(180deg,#174776,#0b2b4c);border-color:#7d9bb7}
.btn.warn{background:linear-gradient(180deg,#4a2116,#1d0e0a);border-color:#8c542f}

.boardwrap{flex:1;min-height:0!important;overflow:hidden;background:
  radial-gradient(circle at 50% 35%,#5f492f30,transparent 38%),
  repeating-linear-gradient(90deg,transparent 0 119px,#b7843320 120px,#0000 121px),
  repeating-linear-gradient(0deg,#ffffff08 0 1px,transparent 1px 5px),
  linear-gradient(180deg,#2d2118 0 48%,#241b14 48% 52%,#2c2118 52% 100%)}
.board{height:100%;min-width:0;max-width:none;width:100%;margin:0;padding:4px 7px;gap:2px;justify-content:space-between}
.basezone{width:100%;height:142px;display:grid;grid-template-columns:138px minmax(0,1fr);grid-template-rows:69px 69px;gap:4px;margin:0;align-items:stretch}
.basezone>.advisor:first-child{grid-column:1;grid-row:1}
.basezone>.advisor:last-child{grid-column:1;grid-row:2}
.basezone>.hq{grid-column:2;grid-row:1/3}
.advisor{height:auto!important;min-height:0!important;border-radius:0;border:1px solid #72502c;background:linear-gradient(180deg,#15191a,#090c0d);padding:3px;box-shadow:inset 0 0 0 1px #000;overflow:hidden}
.advisor.has-portrait{background:#0b0f11;border-color:#805a32;padding:3px}
.advisor-card.rich{grid-template-columns:48px 1fr;gap:5px}
.advisor-portrait{width:48px;height:60px;border-radius:0;border-color:#72583a}
.advisor-copy b{font-size:9px;color:#e2c693} .advisor-copy .advisor-meta{font-size:8px} .advisor-level{font-size:8px;padding:1px 4px}
.hq.faction-fortress{height:142px!important;min-height:142px!important;border-radius:0;border:1px solid #9a6b31;background-color:#15110d;background-size:cover!important;background-position:center 45%!important;padding:0;justify-content:flex-end;box-shadow:inset 0 0 0 1px #000,0 0 0 1px #211306;overflow:hidden}
.hq.faction-fortress::before{background:linear-gradient(180deg,#00000010 0,#0000 45%,#000b 100%)}
.hq.faction-fortress::after{box-shadow:inset 0 0 40px #0008,inset 0 -42px 35px #000b}
.hq-title{position:absolute;top:0;left:50%;transform:translateX(-50%);min-width:210px;padding:5px 24px 6px;background:linear-gradient(180deg,#4b1c12,#291009);border:1px solid #a66d35;color:#efc99a;font-size:12px;clip-path:polygon(8% 0,92% 0,100% 50%,92% 100%,8% 100%,0 50%);z-index:3}
#allyHq .hq-title{background:linear-gradient(180deg,#17334b,#0c1b29);border-color:#5b7590;color:#bcd7ed}
.hq-subtitle{position:absolute;top:31px;left:12px;font-size:8px;color:#d8c7afaa}
.hq.faction-fortress .hptxt{position:relative;z-index:3;margin:0 auto 5px;padding:3px 12px;background:#080806d6;border:1px solid #6e5438;color:#e6dbcb;font-size:18px}
.hq.faction-fortress .hptxt::before{content:"♥ ";color:#b84930}
.hq-unit-slot{position:absolute;right:8px;bottom:6px;width:125px;height:34px;margin:0;border-radius:0}
.lane{min-height:55px;flex:1;border-radius:0;border:1px solid #6a4d2a55;padding:1px 5px;background:linear-gradient(180deg,#1f171147,#130f0b38);box-shadow:inset 0 0 18px #0004}
.lane .label{left:5px;top:3px;font-size:8px;color:#9e8a6b88}
.slots{min-height:52px;height:100%;gap:4px;align-items:center}
.slots.n4{grid-template-columns:repeat(4,minmax(70px,112px))}
.slots.n3{grid-template-columns:repeat(3,minmax(72px,116px))}
.slots.n2{grid-template-columns:repeat(2,minmax(76px,120px))}
.slot{height:50px;border-radius:0;border:1px solid #76522673;background:linear-gradient(135deg,#21170f80,#0f0b0780);box-shadow:inset 0 0 12px #0007}
.slot.empty::after{content:"✥";font-family:serif;font-size:25px;color:#7250257a;text-shadow:0 1px #000}
.slot.valid,.slot.attackable,.slot.movable,.slot.supportable{box-shadow:inset 0 0 0 1px currentColor,0 0 10px currentColor}
.river{height:17px;min-height:17px;border-radius:0;border:0;border-top:1px solid #6d4d2a;border-bottom:1px solid #4c351d;background:linear-gradient(90deg,#342619,#5e4323,#342619);color:#a88757;font-size:8px;letter-spacing:.55em;margin:0}
.unit{border-radius:0;border-width:1px;grid-template-rows:14px 1fr 14px;box-shadow:0 2px 4px #0008;background:#171717!important}
.unit.wei{border-color:#547ea7} .unit.shu{border-color:#688a53} .unit.wu{border-color:#a34e3b}
.uname{font-size:9px;padding:1px 3px;background:#050505c9;text-align:center}
.uimg{font-size:16px;background:#221d17}
.stats{font-size:8px;padding:1px;background:#050505db}
.grade{font-size:6px;padding:1px 3px;right:1px;top:1px;border-radius:1px}
.typeicon{font-size:8px;left:1px;bottom:1px;padding:1px 2px}
.buff,.support-charge{font-size:6px;padding:1px 2px}

.bottom-hud{height:154px;min-height:154px;position:relative;bottom:auto;display:grid;grid-template-columns:minmax(0,1fr) 145px;background:linear-gradient(180deg,#0f1517,#070b0c);border-top:1px solid #785429;box-shadow:0 -4px 15px #000b}
.bottom-hud .hud-status{grid-column:2;grid-row:1;padding:8px;display:block;background:#090d0f}
.bottom-hud .hud-status>:not(.hud-actions){display:none}
.hud-actions{display:grid;grid-template-columns:1fr;gap:7px;min-width:0;height:100%;align-content:center}
.hud-actions .btn{min-height:28px;padding:5px;font-size:11px}
.bottom-hud .handbox{grid-column:1;grid-row:1;border:0;padding:6px 8px;background:#0b1012;min-width:0}
.handhead{height:18px;margin-bottom:3px;font-size:10px;color:#b6a688}
.handhead .small{font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:70%}
.bottom-hud .hand{height:121px;min-height:121px;gap:5px;overflow-x:auto;overflow-y:hidden}
.bottom-hud .card{flex:0 0 96px;height:118px;border-radius:0;border-width:1px;grid-template-rows:17px 52px 17px 1fr;box-shadow:0 2px 5px #000a;background:#181511!important}
.card.wei{border-color:#4f7eaa} .card.shu{border-color:#608955} .card.wu{border-color:#a44d3d} .card.item{border-color:#a37d3a} .card.tactic{border-color:#8b5d9d}
.cname{font-size:9px;text-align:center;padding:2px;background:#050505d0}
.cimg{background:#221d17}
.cstats{font-size:8px;padding:1px} .ctext{font-size:7px;padding:2px;line-height:1.15}
.cost{width:19px;height:19px;right:2px;top:19px;font-size:9px;border-radius:50%;background:#16110b;border-color:#c59b55}
.card-grade{left:2px;top:19px;font-size:6px;padding:1px 4px;border-radius:2px}

.reference-right{display:flex;flex-direction:column;overflow:hidden;padding:0}
.right-resource-frame{height:110px;min-height:110px;border-bottom:1px solid #65411e;background:linear-gradient(180deg,#130d0b,#090b0c)}
.right-resource-frame .resource-line{min-height:38px}
.mana-pips{display:flex;gap:5px}
.mana-pip{width:18px;height:18px;border-radius:50%;border:2px solid #913425;background:radial-gradient(circle at 35% 30%,#ff9c6d 0 16%,#c73524 18% 58%,#4a0f09 60%);box-shadow:0 0 0 1px #d1804b,0 0 6px #b62b1c88 inset}
.roster-section{min-height:0;border-bottom:1px solid #5d3d1d;background:#080c0d;display:flex;flex-direction:column}
.enemy-roster-section{height:37%} .ally-roster-section{height:40%}
.roster-grid{flex:1;display:grid;grid-template-columns:repeat(3,1fr);grid-auto-rows:minmax(0,1fr);gap:4px;padding:4px;overflow:hidden}
.roster-card{position:relative;min-width:0;min-height:0;border:1px solid #6b4e2f;background:#17120e;overflow:hidden;box-shadow:inset 0 0 0 1px #000}
.roster-card.wei{border-color:#426f97} .roster-card.shu{border-color:#557c4d} .roster-card.wu{border-color:#914432}
.roster-art{position:absolute;inset:0 0 22px;overflow:hidden;background:#1d1712}
.roster-art img,.roster-art>.default-art{width:100%;height:100%;object-fit:cover}
.roster-name{position:absolute;left:0;right:0;bottom:11px;height:15px;background:#050505c7;color:#efe5d6;font-size:8px;font-weight:900;text-align:center;line-height:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.roster-stats{position:absolute;left:0;right:0;bottom:0;height:12px;background:#050505e6;display:flex;justify-content:space-around;align-items:center;font-size:7px;color:#e8d6b9}
.roster-cost{position:absolute;left:2px;top:2px;width:17px;height:17px;border-radius:50%;background:#15110b;border:1px solid #b98c4f;color:#f0d5a0;font-size:8px;font-weight:900;display:flex;align-items:center;justify-content:center;z-index:3}
.roster-empty{border:1px solid #3c2f22;background:radial-gradient(circle,#261a1080,#080706);display:flex;align-items:center;justify-content:center;color:#604321;font-size:22px}
.selection-strip{flex:1;min-height:72px;overflow:hidden;background:#090d0f}
.selection-strip .details{min-height:0;height:calc(100% - 28px);padding:5px 7px;font-size:9px;line-height:1.35;overflow:auto;color:#b9b0a2}

.game-toast-wrap{top:102px}
.game-toast{border-radius:2px}
.modalbox{border-radius:2px;border-color:#75512a;background:#0d1214}

@media (max-width:1280px){
  .app{grid-template-columns:205px minmax(650px,1fr) 305px}
  .reference-topbar{grid-template-columns:minmax(315px,1.2fr) 125px minmax(260px,1fr)}
  .top-field select{min-width:105px}
  .reference-brand h1{font-size:27px}
}
@media (max-width:1050px){
  html,body{overflow:auto}
  .app{height:auto;display:grid;grid-template-columns:190px minmax(660px,1fr);min-width:900px}
  .reference-right{grid-column:1/3;height:470px;display:grid;grid-template-columns:220px 1fr 1fr 220px}
  .right-resource-frame,.enemy-roster-section,.ally-roster-section,.selection-strip{height:auto!important;min-height:0}
}



/* =======================
   v11 user-requested layout refinements
   ======================= */
.battle-panel{position:relative}
.reference-topbar{
  position:absolute;top:8px;right:10px;z-index:35;
  width:min(520px,calc(100% - 26px));height:auto;min-height:0;
  padding:7px 10px;display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto auto auto;
  gap:6px;border:1px solid #7b5530;background:linear-gradient(180deg,#0e1518f7,#070b0df4);
  box-shadow:inset 0 0 0 1px #000,0 10px 28px #000a;
}
.top-control-group{grid-column:1/3;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 108px;gap:8px;align-items:end}
.top-field{min-width:0}
.top-field select{width:100%;min-width:0}
.top-new{height:38px;min-width:0;margin-top:0}
.turn-plate{grid-column:1;grid-row:2;min-height:70px}
.top-options{grid-column:2;grid-row:2;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto;gap:6px;align-content:stretch}
.top-options #cardManagerBtn{grid-column:1;grid-row:2;min-width:0}
.top-options #rulesTopBtn{grid-column:2;grid-row:2;display:block;min-width:0}
.faction-pickers{grid-column:1/3;grid-row:3;justify-content:space-between;padding-top:4px}
.boardwrap{padding-top:122px}
.board{padding:6px 8px 10px;gap:4px}
.basezone{height:172px}
.hq.faction-fortress{height:170px!important;min-height:170px!important}
.hq-title{min-width:225px;font-size:13px}
.hq-subtitle{top:33px;left:14px;font-size:9px}
.hq.faction-fortress .hptxt{display:none}
.hq-unit-slot{right:10px;bottom:8px;width:140px;height:42px;z-index:6}

.hq-info-overlay{position:absolute;left:12px;right:162px;top:44px;display:flex;flex-wrap:wrap;gap:6px;z-index:6;align-items:flex-start}
.hq-stat-chip{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;background:#050608dc;border:1px solid #715332;color:#f1e7d5;font-size:11px;font-weight:800;box-shadow:0 2px 6px #0008}
.hq-stat-chip.hp b{color:#efc7b8}.hq-stat-chip.mp b{color:#d7ecff}.hq-stat-chip.ap b{color:#f0cd7a}.hq-stat-chip.skill b{color:#d5efab}
.hq-advisor-summary{position:absolute;left:12px;right:162px;bottom:10px;min-height:36px;padding:5px 8px;background:linear-gradient(180deg,#050608dc,#030405e6);border:1px solid #6a5032;color:#dfd5c3;font-size:10px;line-height:1.35;z-index:6;display:flex;flex-direction:column;justify-content:center;box-shadow:0 2px 8px #0009}
.hq-advisor-summary b{display:block;font-size:11px;color:#ecd3a6}
#allyHq .hq-advisor-summary b{color:#bad9f4}
#enemyHq .hq-stat-chip{background:#140909dc;border-color:#7c4a36}
#allyHq .hq-stat-chip{background:#071018dc;border-color:#4b667b}
#enemyHq .hq-advisor-summary{background:linear-gradient(180deg,#150a08e6,#090404e6);border-color:#734936}
#allyHq .hq-advisor-summary{background:linear-gradient(180deg,#09111be6,#04080ce6);border-color:#4a647e}

.lane{min-height:76px;padding:3px 8px}
.lane .label{font-size:9px}
.slots{min-height:72px;gap:8px}
.slots.n4{grid-template-columns:repeat(4,minmax(88px,148px))}
.slots.n3{grid-template-columns:repeat(3,minmax(96px,156px))}
.slots.n2{grid-template-columns:repeat(2,minmax(108px,170px))}
.slot{height:68px}
.unit{grid-template-rows:18px 1fr 18px}
.uname{font-size:11px;padding:2px 4px}
.uimg{font-size:20px}
.stats{font-size:10px;padding:2px 3px}
.grade{font-size:7px;padding:1px 4px}
.typeicon{font-size:9px}
.buff,.support-charge{font-size:7px}

.bottom-hud{height:72px;min-height:72px;grid-template-columns:1fr;padding:8px 10px;align-items:center}
.bottom-hud .hud-status{grid-column:1;padding:0;background:transparent}
.bottom-hud .hud-status>:not(.hud-actions){display:none!important}
.hud-actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;height:auto;align-content:stretch}
.hud-actions .btn{min-height:42px;font-size:12px}
.bottom-hud .handbox{display:none!important}

.left-status-frame{display:none}
.left-advisor-frame{flex:0 0 auto}

.reference-right{display:flex;flex-direction:column;overflow:hidden;padding:0}
.right-resource-frame{display:none}
.enemy-roster-section{height:32%;flex:0 0 32%}
.right-deck-section{flex:0 0 118px;display:flex;flex-direction:column;border-bottom:1px solid #5d3d1d;background:#090c0d}
.right-deck-body{flex:1;display:flex;align-items:center;gap:12px;padding:8px 10px}
.deck-stack{position:relative;width:84px;height:108px}
.deck-back,.deck-back::before,.deck-back::after{content:"";position:absolute;inset:0;border:1px solid #826039;background:linear-gradient(180deg,#16202a,#0a1015);box-shadow:inset 0 0 0 1px #000}
.deck-back::before{transform:translate(5px,-5px);opacity:.5}
.deck-back::after{transform:translate(10px,-10px);opacity:.25}
.deck-emblem{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-family:"Malgun Myeongjo",serif;font-size:28px;color:#d7bf95;z-index:2;text-shadow:0 2px 8px #000}
.deck-info{display:flex;flex-direction:column;gap:4px;color:#cdbda2;font-size:11px}
.deck-info b{font-size:20px;color:#f0e1c7}
.deck-help{color:#9c917e;line-height:1.35}
.right-hand-section{flex:1;min-height:0;display:flex;flex-direction:column;border-bottom:1px solid #5d3d1d;background:#080c0d}
.right-hand-section .handbox{flex:1;min-height:0;border:0;padding:6px 8px;background:#080c0d;display:flex;flex-direction:column}
.right-hand-section .handhead{height:auto;min-height:28px;margin-bottom:6px;display:flex;justify-content:space-between;align-items:flex-start;gap:8px;font-size:11px;color:#c6b79e}
.right-hand-section .handhead .small{font-size:9px;white-space:normal;max-width:none}
#hand.hand{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;overflow:auto;overflow-x:hidden;padding-bottom:4px;min-height:0;height:100%}
#hand.hand .card{flex:none;width:auto;height:145px;border-radius:0;border-width:1px;grid-template-rows:18px 64px 18px 1fr;box-shadow:0 3px 8px #000a;background:#181511!important}
#hand.hand .cname{font-size:10px}
#hand.hand .cstats{font-size:8px}
#hand.hand .ctext{font-size:8px;line-height:1.2;padding:3px}
.selection-strip{flex:0 0 118px;min-height:118px}
.selection-strip .details{font-size:10px;line-height:1.4}
.title-flex{display:flex;align-items:center;justify-content:space-between;padding:0 10px}
.title-count{font-size:11px;color:#d4c5ad}

@media (max-width:1280px){
  .reference-topbar{width:min(470px,calc(100% - 22px))}
  .slots.n4{grid-template-columns:repeat(4,minmax(80px,132px))}
  .slots.n3{grid-template-columns:repeat(3,minmax(88px,140px))}
  .slots.n2{grid-template-columns:repeat(2,minmax(96px,150px))}
  #hand.hand .card{height:132px}
}
@media (max-width:1050px){
  .reference-topbar{position:relative;top:auto;right:auto;width:auto}
  .boardwrap{padding-top:8px}
  .left-status-frame{display:none}
  .reference-right{grid-column:1/3;height:640px;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:220px 180px 1fr}
  .enemy-roster-section{grid-column:1;grid-row:1/3;height:auto;flex:auto}
  .right-deck-section{grid-column:2;grid-row:1;height:auto}
  .right-hand-section{grid-column:2;grid-row:2/4;height:auto}
  .selection-strip{grid-column:1;grid-row:3;height:auto}
}



/* =======================
   v12 layout tuning based on latest feedback
   ======================= */
.app{grid-template-columns:220px minmax(560px,.82fr) 360px;gap:6px;padding:6px}
.reference-left{overflow:hidden}
.reference-topbar{
  position:relative;top:auto;right:auto;left:auto;z-index:5;
  width:218px;height:auto;min-height:0;margin:8px 0 6px 8px;padding:6px 7px;
  display:grid;grid-template-columns:1fr;grid-template-rows:auto auto auto auto;gap:5px;
  border:1px solid #6f4b27;background:linear-gradient(180deg,#0e1416,#070b0d);box-shadow:inset 0 0 0 1px #000;
}
.top-control-group{grid-column:auto;display:grid;grid-template-columns:1fr 1fr;gap:5px;align-items:end}
.top-field{gap:2px}
.top-field span{font-size:9px;color:#b8a385}
.top-field select{min-width:0;width:100%;padding:5px 6px;font-size:10px}
.top-new{grid-column:1/3;min-width:0;height:28px;font-size:11px;padding:4px 6px}
.turn-plate{grid-column:auto;grid-row:auto;min-height:0;padding:4px 6px;border:1px solid #62462b;background:#0b1012;display:flex;justify-content:center;align-items:center}
.turn-plate>div{display:none}
.turn-plate .turnbadge{margin:0;padding:2px 0;background:transparent;color:#73b9e8;font-size:11px;letter-spacing:.02em}
.top-options{grid-column:auto;grid-row:auto;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto;gap:4px 6px;align-items:center}
.checkline{gap:4px;font-size:10px}
.checkline input{width:14px;height:14px;padding:0}
.top-options #cardManagerBtn,.top-options #rulesTopBtn{grid-row:2;min-width:0;height:26px;padding:3px 4px;font-size:10px}
.top-options #cardManagerBtn{grid-column:1}.top-options #rulesTopBtn{grid-column:2;display:block}
.faction-pickers{grid-column:auto;display:grid;grid-template-columns:1fr;gap:4px;justify-content:stretch;padding-top:4px;border-top:1px solid #242d32;font-size:9px}
.faction-pickers label{display:flex;justify-content:space-between;gap:6px}
.faction-pickers select{flex:1;min-width:0;font-size:10px;padding:3px 6px}
.boardwrap{padding-top:0;overflow:auto}
.board{width:80%;min-width:540px;max-width:780px;margin:0 auto;padding:4px 0 8px;gap:4px}
.basezone{height:162px}
.hq.faction-fortress{height:162px!important;min-height:162px!important}
.hq-info-overlay{left:10px;right:146px;top:42px;gap:5px}
.hq-stat-chip{padding:3px 6px;font-size:10px}
.hq-advisor-summary{left:10px;right:146px;bottom:8px;min-height:32px;padding:4px 7px;font-size:9px}
.hq-advisor-summary b{font-size:10px}
.enemy-turn-badge{position:absolute;right:10px;bottom:8px;z-index:7;display:flex;align-items:center;justify-content:center;min-width:48px;height:24px;padding:0 8px;background:#07090bdd;border:1px solid #9d6a35;color:#f3d59f;font-size:12px;font-weight:900;box-shadow:0 2px 8px #0009}
#allyHq .enemy-turn-badge{display:none}
.hq-unit-slot{right:10px;bottom:38px;width:122px;height:36px}

.lane{min-height:68px;padding:2px 6px}
.lane .label{font-size:8px}
.slots{min-height:64px;gap:6px}
.slots.n4{grid-template-columns:repeat(4,minmax(72px,120px))}
.slots.n3{grid-template-columns:repeat(3,minmax(80px,128px))}
.slots.n2{grid-template-columns:repeat(2,minmax(90px,136px))}
.slot{height:60px}
.unit{grid-template-rows:16px 1fr 16px}
.uname{font-size:10px;padding:1px 3px}
.uimg{font-size:18px}
.stats{font-size:9px;padding:1px 2px}
.grade{font-size:6px}
.typeicon{font-size:8px}
.buff,.support-charge{font-size:6px}

.bottom-hud{height:66px;min-height:66px;padding:7px 9px}
.hud-actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.hud-actions .btn{min-height:38px;font-size:11px}

.enemy-roster-section{height:31%;flex:0 0 31%}
.right-deck-section{flex:0 0 108px}
.right-deck-body{gap:10px;padding:7px 9px}
.deck-stack{width:78px;height:100px}
.deck-info{font-size:10px}
.deck-info b{font-size:18px}
.right-hand-section .handbox{padding:5px 7px}
.right-hand-section .handhead{min-height:24px;margin-bottom:5px;font-size:10px}
.right-hand-section .handhead .small{font-size:8px}
#hand.hand{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
#hand.hand .card{height:128px;grid-template-rows:17px 56px 16px 1fr}
#hand.hand .cname{font-size:9px}
#hand.hand .cstats{font-size:7px}
#hand.hand .ctext{font-size:7px;line-height:1.15}
.roster-grid{gap:3px;padding:3px}
.roster-name{font-size:7px}
.roster-stats{font-size:6px}
.selection-strip{flex:0 0 104px;min-height:104px}
.selection-strip .details{font-size:9px}

@media (max-width:1280px){
  .app{grid-template-columns:210px minmax(520px,.78fr) 330px}
  .board{width:82%;min-width:500px;max-width:740px}
  .slots.n4{grid-template-columns:repeat(4,minmax(68px,112px))}
  .slots.n3{grid-template-columns:repeat(3,minmax(76px,120px))}
  .slots.n2{grid-template-columns:repeat(2,minmax(84px,128px))}
  #hand.hand .card{height:120px}
}
@media (max-width:1050px){
  .app{height:auto;grid-template-columns:190px minmax(520px,1fr);min-width:860px}
  .reference-topbar{width:174px;margin:6px 0 6px 6px}
  .top-control-group{grid-template-columns:1fr}
  .top-new{grid-column:1}
  .top-options{grid-template-columns:1fr 1fr}
  .board{width:90%;min-width:460px}
  .reference-right{grid-column:1/3;height:620px;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:200px 160px 1fr}
}



/* =======================
   v13 compact menu + advisor overlay + reference card design
   ======================= */
.app{grid-template-columns:210px minmax(560px,.82fr) 370px}
.reference-left{display:flex;flex-direction:column}
.reference-brand{padding:12px 8px 10px}
.reference-brand h1{font-size:26px}
.reference-brand .brand-sub{font-size:12px}
.left-status-frame{display:none}
.left-advisor-frame.compact-settings-holder{display:block;flex:0 0 auto;padding:6px 8px 8px;background:#080c0d;border-top:1px solid #503719;border-bottom:1px solid #503719}
.settings-mini-copy{padding:8px 10px;font-size:10px;line-height:1.45;color:#afa490;background:#101518;border:1px solid #544127}
.left-log-frame{margin-top:6px;min-height:140px}
.left-bottom-actions{padding:8px 12px;grid-template-columns:1fr 1fr;gap:6px}
.left-bottom-actions .btn{min-height:30px}

.reference-topbar{position:relative;width:auto;left:auto;top:auto;right:auto;margin:0 8px 8px;padding:6px;border:1px solid #6e4a24;background:linear-gradient(180deg,#11181b,#090d0f);display:grid;grid-template-columns:1fr;gap:5px;box-shadow:inset 0 0 0 1px #000}
.top-control-group{grid-template-columns:1fr 1fr;gap:5px}
.top-field span{font-size:8px}
.top-field select{padding:4px 6px;font-size:10px}
.top-new{grid-column:1/3;height:28px;font-size:10px;padding:4px 6px}
.turn-plate{min-height:0;padding:4px;border:1px solid #4e3a22;background:#0b1012}
.turn-plate>div{display:none}.turn-plate .turnbadge{font-size:11px}
.top-options{grid-template-columns:1fr 1fr;gap:4px}
.top-options #cardManagerBtn,.top-options #rulesTopBtn{height:26px;padding:3px 4px;font-size:10px}
.checkline{font-size:10px}.checkline input{width:14px;height:14px}
.faction-pickers{display:grid;grid-template-columns:1fr;gap:4px;font-size:9px}
.faction-pickers label{display:flex;justify-content:space-between;gap:6px}
.faction-pickers select{flex:1;min-width:0;padding:3px 6px;font-size:10px}

.board{width:80%;min-width:540px;max-width:780px}
.basezone{height:190px}
.hq.faction-fortress{height:188px!important;min-height:188px!important}
.hq-info-overlay{left:10px;right:158px;top:40px}
.hq-advisor-summary{left:10px;right:158px;bottom:8px;min-height:30px;padding:4px 6px;font-size:9px}
.hq-advisor-console{position:absolute;top:38px;right:8px;bottom:8px;width:142px;display:flex;flex-direction:column;gap:4px;padding:0;z-index:8}
.hq-advisor-console .advisor-mirror.in-castle{height:54px;padding:4px;background:linear-gradient(180deg,#0f1418d9,#090d10d9);border:1px solid #5e4528}
.hq-advisor-console .advisor-mirror-card{grid-template-columns:40px 1fr;gap:5px}
.hq-advisor-console .advisor-mirror-art{height:44px}
.hq-advisor-console .advisor-mirror-copy b{font-size:10px;margin-bottom:1px}
.hq-advisor-console .advisor-mirror-copy span{font-size:8px;line-height:1.25}
.hq-advisor-console .advisor-switch.mini{width:100%;margin:0;min-height:22px;padding:3px 4px;font-size:9px}
.hq-advisor-console .compact-skills.in-castle{padding:0}
.hq-advisor-console .compact-skills .notice{padding:4px 5px;margin:0;font-size:8px;line-height:1.25;background:#16110eda;border:1px solid #5b482c;color:#d3c19e}
.hq-advisor-console .compact-skill-grid{display:grid;grid-template-columns:1fr;gap:3px;margin-top:4px}
.hq-advisor-console .compact-skill-grid .skill,.hq-advisor-console .compact-skill-grid .btn{min-height:26px;padding:3px 4px}
.hq-advisor-console .compact-skill-grid .skill b{font-size:9px}.hq-advisor-console .compact-skill-grid .skill span{font-size:7px;line-height:1.15}
.hq-unit-slot{right:156px;bottom:10px;width:112px;height:34px}

.right-hand-section .handhead{display:none}
#hand.hand{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding-right:4px}
#hand.hand .card{position:relative;overflow:visible;height:178px;border:1px solid #7a5a33;background:linear-gradient(180deg,#131517,#0b0d0f)!important;box-shadow:0 3px 10px #000b,inset 0 0 0 1px #000;display:grid;grid-template-rows:18px 92px 1fr}
#hand.hand .card.selected{outline:2px solid #7cbcf7;box-shadow:0 0 0 2px #0e2438,0 0 18px #59a9ff55}
#hand.hand .cname{display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800;padding:1px 4px;background:linear-gradient(180deg,#3d2a1f,#1c1511);border-bottom:1px solid #7f6039;color:#f2eadf;line-height:1.1}
#hand.hand .cimg{position:relative;background:#1b1713;overflow:hidden;border-bottom:1px solid #3d3024}
#hand.hand .cimg img,#hand.hand .cimg .default-art{width:100%;height:100%;object-fit:cover}
#hand.hand .card-grade{left:4px;top:22px;padding:1px 4px;border-radius:2px;font-size:8px}
#hand.hand .cost{right:4px;top:22px;width:22px;height:22px;font-size:10px}
#hand.hand .cstats{display:grid;grid-template-rows:auto auto;gap:4px;padding:5px 5px 6px;background:linear-gradient(180deg,#131619,#0d1012)}
#hand.hand .card-type-line{display:flex;justify-content:space-between;align-items:center;font-size:8px;color:#d5c7b0}
#hand.hand .card-stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}
#hand.hand .card-stat-cell{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:4px 2px;background:#171d22;border:1px solid #374450;min-height:34px}
#hand.hand .card-stat-cell b{font-size:18px;line-height:1;color:#edf3ff}
#hand.hand .card-stat-cell span{font-size:8px;color:#aac3da;letter-spacing:.02em}
#hand.hand .card-stat-cell.subtle{background:#171310;border-color:#5c4a32}
#hand.hand .card-stat-cell.subtle b{font-size:13px;color:#f0dfbf}
#hand.hand .ctext{display:none}
#hand.hand .card-hover-tooltip{position:absolute;left:calc(100% + 8px);top:6px;width:190px;padding:8px 10px;background:#111316f2;border:1px solid #8b673a;color:#ede4d4;font-size:11px;line-height:1.45;box-shadow:0 10px 24px #000c;opacity:0;pointer-events:none;transform:translateX(-4px);transition:opacity .16s ease,transform .16s ease;z-index:40}
#hand.hand .card-hover-tooltip b{display:block;margin-bottom:4px;color:#f2d49e;font-size:12px}
#hand.hand .card:hover .card-hover-tooltip{opacity:1;transform:translateX(0)}
#hand.hand .card:nth-child(2n) .card-hover-tooltip{left:auto;right:calc(100% + 8px)}
#hand.hand .card.advisor-card-hand .card-stat-cell b{font-size:12px}
#hand.hand .card.item .card-stat-grid,#hand.hand .card.tactic .card-stat-grid,#hand.hand .card.advisor-card-hand .card-stat-grid{grid-template-columns:repeat(2,1fr)}
#hand.hand .card.item .card-stat-cell:last-child,#hand.hand .card.tactic .card-stat-cell:last-child,#hand.hand .card.advisor-card-hand .card-stat-cell:last-child{grid-column:1/3}

@media (max-width:1280px){
  .app{grid-template-columns:198px minmax(520px,.8fr) 340px}
  .board{min-width:500px;max-width:730px}
  #hand.hand .card{height:166px}
  .hq-advisor-console{width:134px}
  .hq-info-overlay,.hq-advisor-summary{right:148px}
  .hq-unit-slot{right:148px}
}

.no-anim *{animation:none!important;transition:none!important}

/* =======================
   v14 move top menu under left battle log
   ======================= */
.left-log-frame{min-height:120px;flex:1 1 auto}
.left-menu-dock{flex:0 0 auto;padding:6px 8px 10px;border-top:1px solid #4f3518;background:#090d0f}
#leftMenuMount{margin-top:6px}
#leftMenuMount .reference-topbar{margin:0;width:100%;border:1px solid #6e4a24;background:linear-gradient(180deg,#10171a,#090d0f);box-shadow:inset 0 0 0 1px #000}
#leftMenuMount .top-control-group{grid-template-columns:1fr;gap:4px}
#leftMenuMount .top-new{grid-column:auto;height:26px}
#leftMenuMount .turn-plate{padding:4px 6px}
#leftMenuMount .turn-plate .turnbadge{display:block;text-align:center}
#leftMenuMount .top-options{grid-template-columns:1fr 1fr;gap:4px}
#leftMenuMount .top-options #cardManagerBtn,#leftMenuMount .top-options #rulesTopBtn{grid-column:auto;grid-row:auto}
#leftMenuMount .faction-pickers{grid-template-columns:1fr;gap:4px}
#leftMenuMount .faction-pickers label{justify-content:space-between}
#leftMenuMount .faction-pickers select{flex:1;min-width:0}
.battle-panel>.reference-topbar{display:none!important}
.battle-panel{padding-top:0}
.boardwrap{padding-top:0}



/* =======================
   v15 compact HQ + large battlefield cards + fixed card function tooltip
   ======================= */
/* 중앙 하단 HUD는 제거하고 우측 하단 명령 버튼을 사용 */
.bottom-hud{display:none!important}

/* 본진을 낮추고 폭도 살짝 줄임 */
.basezone{display:block!important;position:relative;height:118px!important;min-height:118px!important;width:100%!important;margin:0!important}
.basezone>.hq{display:flex!important;position:relative;width:90%!important;height:116px!important;min-height:116px!important;margin:0 auto!important;grid-column:auto!important;grid-row:auto!important}
.hq.faction-fortress{height:116px!important;min-height:116px!important;background-position:center 43%!important}
.hq-title{min-width:190px;padding:4px 20px 5px;font-size:11px}
.hq-subtitle{top:27px;left:10px;font-size:7px}
.hq-info-overlay{left:9px;right:132px;top:31px;gap:4px}
.hq-stat-chip{padding:2px 5px;font-size:9px}
.hq-advisor-summary{left:9px;right:132px;bottom:7px;min-height:25px;padding:3px 5px;font-size:8px;line-height:1.2}
.hq-advisor-summary b{font-size:9px}
.enemy-turn-badge{right:8px;bottom:7px;height:21px;min-width:43px;font-size:10px}
.hq-unit-slot{right:134px;bottom:6px;width:92px;height:27px}

/* 좌/우 책사 배치칸을 본진 이미지 안에 실제로 넣어 보이게 함 */
.hq>.advisor{position:absolute!important;right:7px!important;width:118px!important;height:32px!important;min-height:32px!important;z-index:12;border:1px solid #76532d!important;background:linear-gradient(180deg,#171b1cde,#080b0cde)!important;padding:2px 4px!important}
.hq>.advisor[data-advisor="left"]{top:31px!important}
.hq>.advisor[data-advisor="right"]{top:66px!important}
.hq>.advisor .advisor-empty{font-size:8px!important;line-height:1.15!important}
.hq>.advisor .advisor-card.rich{grid-template-columns:27px 1fr!important;gap:3px!important}
.hq>.advisor .advisor-portrait{width:27px!important;height:27px!important}
.hq>.advisor .advisor-copy b{font-size:8px!important}
.hq>.advisor .advisor-copy .advisor-meta,.hq>.advisor .advisor-level{font-size:6px!important}

/* 아군 책사 스킬 콘솔 역시 본진 내부에 완전히 수납 */
.hq-advisor-console{position:absolute!important;left:40%!important;right:130px!important;top:31px!important;bottom:7px!important;width:auto!important;display:flex!important;flex-direction:column!important;gap:3px!important;overflow:hidden!important;z-index:10}
.hq-advisor-console .advisor-mirror.in-castle{display:none!important}
.hq-advisor-console .advisor-switch.mini{width:100%!important;margin:0!important;min-height:18px!important;height:18px!important;padding:1px 3px!important;font-size:7px!important}
.hq-advisor-console .compact-skills.in-castle{padding:0!important;min-height:0!important}
.hq-advisor-console .compact-skills .notice{display:none!important}
.hq-advisor-console .compact-skill-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:2px!important;margin:0!important}
.hq-advisor-console .compact-skill-grid .skill,.hq-advisor-console .compact-skill-grid .btn{min-height:27px!important;height:27px!important;padding:2px 3px!important;overflow:hidden!important}
.hq-advisor-console .compact-skill-grid .skill b{font-size:7px!important;line-height:1!important}
.hq-advisor-console .compact-skill-grid .skill span{font-size:5.5px!important;line-height:1!important}
.hq-advisor-console #upgradeAdvisorBtn{font-size:6.5px!important;line-height:1.05!important}

/* 전투 필드 카드의 높이를 키워 이미지 가독성 강화 */
.lane{min-height:86px!important;height:auto!important;padding:2px 6px!important}
.slots{min-height:82px!important;height:82px!important;gap:7px!important}
.slot{height:80px!important}
.unit{grid-template-rows:18px 1fr 18px!important}
.uname{font-size:10px!important;padding:2px 3px!important}
.uimg{font-size:22px!important;min-height:42px!important}
.stats{font-size:9px!important;padding:2px!important}
.grade{font-size:7px!important;padding:1px 3px!important}
.typeicon{font-size:9px!important}

/* 우측 핸드: 6장을 3 x 2로 배치해 스크롤 없이 표시 */
.enemy-roster-section{height:24%!important;flex:0 0 24%!important}
.right-deck-section{flex:0 0 88px!important}
.right-deck-body{padding:5px 8px!important;gap:8px!important}
.deck-stack{width:58px!important;height:70px!important}
.deck-info{font-size:9px!important;gap:2px!important}
.deck-info b{font-size:15px!important}
.deck-help{font-size:8px!important}
.right-hand-section{flex:1 1 auto!important;min-height:330px!important;overflow:visible!important}
.right-hand-section .handbox{padding:5px!important;overflow:visible!important}
#hand.hand{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:repeat(2,154px)!important;grid-auto-rows:154px!important;gap:5px!important;height:auto!important;min-height:313px!important;overflow:visible!important;align-content:start!important;padding:0!important}
#hand.hand .card{width:100%!important;height:154px!important;min-width:0!important;min-height:0!important;grid-template-rows:17px 80px 1fr!important;overflow:hidden!important}
#hand.hand .cname{font-size:8px!important;padding:1px 2px!important}
#hand.hand .cimg{min-height:0!important}
#hand.hand .card-grade{left:2px!important;top:19px!important;font-size:6px!important;padding:1px 3px!important}
#hand.hand .cost{right:2px!important;top:19px!important;width:18px!important;height:18px!important;font-size:8px!important}
#hand.hand .cstats{padding:3px!important;gap:2px!important}
#hand.hand .card-type-line{font-size:6px!important}
#hand.hand .card-stat-grid{gap:2px!important}
#hand.hand .card-stat-cell{min-height:26px!important;padding:2px 1px!important}
#hand.hand .card-stat-cell b{font-size:13px!important}
#hand.hand .card-stat-cell span{font-size:6px!important}
#hand.hand .card-stat-cell.subtle b{font-size:8px!important}
#hand.hand .ctext,#hand.hand .card-hover-tooltip{display:none!important}

/* 부모 overflow와 무관한 전역 카드 기능 팝업 */
.card-function-tooltip{position:fixed;z-index:500;display:none;max-width:240px;min-width:150px;padding:8px 10px;background:#0c0f11f5;border:1px solid #a2753d;color:#f0e7d8;font-size:11px;line-height:1.45;box-shadow:0 10px 28px #000d;pointer-events:none;white-space:normal;overflow-wrap:anywhere}
.card-function-tooltip.show{display:block}
.card-function-tooltip::before{content:"카드 기능";display:block;margin-bottom:4px;color:#e6bd7a;font-size:10px;font-weight:900}

/* 우측 하단: 선택 정보 대신 전투 버튼 */
.right-action-strip{flex:0 0 112px!important;min-height:112px!important;border-top:1px solid #60401e;background:#080c0e;display:flex;flex-direction:column}
.right-action-strip #details{display:none!important}
.right-action-mount{flex:1;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:6px;padding:7px}
.right-action-mount .btn{width:100%!important;height:100%!important;min-height:32px!important;padding:6px 5px!important;font-size:11px!important}
.right-action-mount #shuffleBtn{grid-column:1;grid-row:1}
.right-action-mount #cancelBtn{grid-column:2;grid-row:1}
.right-action-mount #endTurnBtn{grid-column:1/3;grid-row:2;font-size:13px!important;font-weight:900!important}

@media(max-width:1280px){
  .basezone{height:112px!important;min-height:112px!important}
  .basezone>.hq,.hq.faction-fortress{height:110px!important;min-height:110px!important}
  .lane{min-height:82px!important}
  .slots{min-height:78px!important;height:78px!important}
  .slot{height:76px!important}
  #hand.hand{grid-template-rows:repeat(2,145px)!important;grid-auto-rows:145px!important;min-height:295px!important}
  #hand.hand .card{height:145px!important;grid-template-rows:16px 74px 1fr!important}
}

/* ================================================================
   v16 screenshot-inspired placement — layout only, original visual theme retained
   HQ/advisors are moved to a narrow right rail to maximize battle-row height.
   ================================================================ */
.boardwrap{padding-top:0!important;overflow:hidden!important}
.battlefield-layout{
  height:100%;min-height:0;width:100%;display:grid;
  grid-template-columns:minmax(0,1fr) 184px;gap:0;
  padding:5px 0;
}
.battlefield-layout>.board{
  width:100%!important;min-width:0!important;max-width:none!important;height:100%!important;
  margin:0!important;padding:0!important;display:grid!important;
  grid-template-rows:repeat(3,minmax(92px,1fr)) 22px repeat(3,minmax(92px,1fr));
  gap:5px!important;align-content:stretch!important;
}
.battlefield-layout .lane{
  min-height:0!important;height:100%!important;padding:3px 6px!important;overflow:visible;
}
.battlefield-layout .lane .label{font-size:9px!important;top:3px!important;left:6px!important}
.battlefield-layout .slots{
  width:100%;height:100%!important;min-height:0!important;margin:0 auto;gap:7px!important;
  align-items:center!important;justify-content:center!important;
}
.battlefield-layout .slots.n4{grid-template-columns:repeat(4,minmax(72px,1fr))!important;max-width:650px}
.battlefield-layout .slots.n3{grid-template-columns:repeat(3,minmax(78px,1fr))!important;max-width:510px;width:82%}
.battlefield-layout .slots.n2{grid-template-columns:repeat(2,minmax(86px,1fr))!important;max-width:365px;width:58%}
.battlefield-layout .slot{
  width:100%!important;height:calc(100% - 8px)!important;min-height:78px!important;max-height:114px!important;
}
.battlefield-layout .unit{grid-template-rows:20px 1fr 20px!important}
.battlefield-layout .uname{font-size:11px!important;padding:2px 4px!important}
.battlefield-layout .uimg{font-size:24px!important;min-height:0!important}
.battlefield-layout .stats{font-size:10px!important;padding:2px!important}
.battlefield-layout .grade{font-size:8px!important;padding:1px 4px!important}
.battlefield-layout .typeicon{font-size:10px!important;padding:1px 3px!important}
.battlefield-layout .river{height:22px!important;min-height:22px!important;margin:0!important}

.field-side-rail{
  min-width:0;height:100%;display:flex;flex-direction:column;gap:5px;
  border-left:1px solid #72502c;background:linear-gradient(180deg,#11100d99,#080a0b80);
  padding-left:0;
}
.rail-side-group{display:flex;flex-direction:column;gap:5px;flex:0 0 auto}
.rail-spacer{flex:1 1 auto;min-height:28px;border-top:1px solid #4c361f33;border-bottom:1px solid #4c361f33}
.rail-hq-wrap{width:100%;height:154px;min-height:154px}
.field-side-rail .hq.faction-fortress{
  display:flex!important;position:relative!important;width:100%!important;height:154px!important;min-height:154px!important;
  margin:0!important;padding:0!important;border-radius:0!important;background-position:center 44%!important;
}
.field-side-rail .hq-title{
  top:0!important;left:50%!important;min-width:142px!important;max-width:calc(100% - 10px);
  padding:4px 12px 5px!important;font-size:10px!important;white-space:nowrap;
}
.field-side-rail .hq-subtitle{top:28px!important;left:7px!important;font-size:7px!important}
.field-side-rail .hq.faction-fortress .hptxt{display:none!important}
.field-side-rail .hq-info-overlay{
  left:6px!important;right:6px!important;top:34px!important;display:grid!important;grid-template-columns:1fr 1fr;gap:3px!important;
}
.field-side-rail .hq-stat-chip{justify-content:center!important;padding:2px 3px!important;font-size:8px!important;min-width:0}
.field-side-rail .hq-advisor-summary{
  left:6px!important;right:6px!important;bottom:7px!important;min-height:36px!important;max-height:39px!important;
  padding:3px 4px!important;font-size:7px!important;line-height:1.2!important;overflow:hidden!important;
}
.field-side-rail .hq-advisor-summary b{font-size:8px!important}
.field-side-rail .enemy-turn-badge{right:6px!important;bottom:48px!important;height:18px!important;min-width:37px!important;font-size:8px!important}
.field-side-rail .hq-unit-slot{
  left:6px!important;right:auto!important;bottom:48px!important;width:86px!important;height:22px!important;margin:0!important;z-index:8;
}
.field-side-rail .hq-unit-slot.empty::after{font-size:7px!important}
.field-side-rail .base-unit{grid-template-columns:20px 1fr auto!important;gap:2px!important;padding:1px 2px!important}
.field-side-rail .base-unit-art{height:18px!important;font-size:12px!important}
.field-side-rail .base-unit-name{font-size:7px!important}.field-side-rail .base-unit-stat{font-size:6px!important}

.rail-advisor-row{display:grid;grid-template-columns:1fr 1fr;gap:4px;height:69px;min-height:69px}
.field-side-rail .advisor{
  position:relative!important;inset:auto!important;width:auto!important;height:69px!important;min-height:69px!important;
  margin:0!important;padding:3px!important;border:1px solid #72502c!important;border-radius:0!important;
  background:linear-gradient(180deg,#15191a,#090c0d)!important;overflow:hidden!important;
}
.field-side-rail .advisor.has-portrait{padding:2px!important}
.field-side-rail .advisor-card.rich{grid-template-columns:31px 1fr!important;gap:3px!important;height:100%!important}
.field-side-rail .advisor-portrait{width:31px!important;height:57px!important}
.field-side-rail .advisor-copy b{font-size:8px!important}
.field-side-rail .advisor-copy .advisor-meta{font-size:6px!important;line-height:1.1!important}
.field-side-rail .advisor-level{font-size:6px!important;padding:1px 3px!important}
.field-side-rail .advisor-empty{font-size:9px!important;line-height:1.3!important;color:#d2c6b2!important}

/* 아군 책사 스킬은 본진 내부 하단에 작게 유지하여 기능 손실을 막는다. */
.field-side-rail #allyHq .hq-advisor-summary{display:none!important}
.field-side-rail #allyHq .hq-advisor-console{
  display:block!important;position:absolute!important;left:6px!important;right:6px!important;top:auto!important;bottom:6px!important;
  width:auto!important;height:58px!important;overflow:hidden!important;z-index:10!important;
}
.field-side-rail #allyHq .advisor-mirror.in-castle,.field-side-rail #allyHq .compact-skills .notice{display:none!important}
.field-side-rail #allyHq .advisor-switch.mini{height:17px!important;min-height:17px!important;width:100%!important;margin:0 0 2px!important;padding:1px 3px!important;font-size:6px!important}
.field-side-rail #allyHq .compact-skill-grid{display:grid!important;grid-template-columns:repeat(2,1fr)!important;gap:2px!important;margin:0!important}
.field-side-rail #allyHq .compact-skill-grid .skill,.field-side-rail #allyHq .compact-skill-grid .btn{height:18px!important;min-height:18px!important;padding:1px 2px!important}
.field-side-rail #allyHq .compact-skill-grid .skill b{font-size:6px!important;line-height:1!important}
.field-side-rail #allyHq .compact-skill-grid .skill span{display:none!important}
.field-side-rail #allyHq #upgradeAdvisorBtn{font-size:5.5px!important;line-height:1!important}
.field-side-rail #allyHq .hq-unit-slot{bottom:67px!important}

@media(max-width:1280px){
  .battlefield-layout{grid-template-columns:minmax(0,1fr) 164px;gap:0}
  .rail-hq-wrap{height:142px;min-height:142px}
  .field-side-rail .hq.faction-fortress{height:142px!important;min-height:142px!important}
  .rail-advisor-row{height:62px;min-height:62px}
  .field-side-rail .advisor{height:62px!important;min-height:62px!important}
  .field-side-rail .advisor-portrait{height:50px!important;width:28px!important}
  .battlefield-layout .slots{gap:5px!important}
  .battlefield-layout .slots.n4{grid-template-columns:repeat(4,minmax(62px,1fr))!important}
}

/* ================================================================
   v18 — screenshot-proportioned battlefield + zero field/HQ gap
   + direct mana/AP readout above allied advisors + larger typography
   ================================================================ */

/* 전투 필드와 본진 레일을 스크린샷과 비슷한 약 3:1 비율로 붙여 배치 */
.battlefield-layout{
  grid-template-columns:minmax(0,3.15fr) minmax(190px,1fr)!important;
  gap:0!important;
  padding:0!important;
}
.battlefield-layout>.board{
  border-right:0!important;
  padding:0!important;
  gap:4px!important;
}
.field-side-rail{
  margin:0!important;
  padding:0!important;
  gap:4px!important;
  border-left:1px solid #77512b!important;
}

/* 필드 행을 더 넓게 사용하고 전투 카드가 빈 공간 없이 크게 보이도록 조정 */
.battlefield-layout>.board{
  grid-template-rows:repeat(3,minmax(104px,1fr)) 24px repeat(3,minmax(104px,1fr))!important;
}
.battlefield-layout .lane{
  padding:4px 5px!important;
}
.battlefield-layout .slots{
  gap:8px!important;
}
.battlefield-layout .slots.n4{max-width:720px!important;width:94%!important}
.battlefield-layout .slots.n3{max-width:590px!important;width:82%!important}
.battlefield-layout .slots.n2{max-width:440px!important;width:62%!important}
.battlefield-layout .slot{
  height:calc(100% - 10px)!important;
  min-height:88px!important;
  max-height:136px!important;
}
.battlefield-layout .river{
  height:24px!important;
  min-height:24px!important;
  font-size:12px!important;
  letter-spacing:7px!important;
}

/* 아군 책사 바로 위에 마나/행동력을 크게 표시 */
.rail-resource-strip{
  height:42px;
  min-height:42px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
  padding:4px;
  background:linear-gradient(180deg,#111619,#080c0e);
  border-top:1px solid #654621;
  border-bottom:1px solid #654621;
}
.rail-resource-item{
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:5px;
  padding:4px 6px;
  border:1px solid #4b4234;
  background:#090d0fda;
  box-shadow:inset 0 0 0 1px #000;
  font-weight:900;
}
.rail-resource-item span{
  font-size:10px;
  color:#b9ad98;
  white-space:nowrap;
}
.rail-resource-item b{
  font-size:17px;
  line-height:1;
  color:#f0e8dc;
  white-space:nowrap;
}
.rail-resource-item.mana{border-color:#49687c;background:linear-gradient(180deg,#10202b,#081117)}
.rail-resource-item.mana b{color:#a9d9ff;text-shadow:0 0 8px #3d91c766}
.rail-resource-item.ap{border-color:#765b2d;background:linear-gradient(180deg,#302714,#141108)}
.rail-resource-item.ap b{color:#f3c868;text-shadow:0 0 8px #e6ae4466}

/* 본진/책사 비율: 본진은 충분히 읽히되 전투 필드 공간을 우선 */
.rail-hq-wrap{height:150px!important;min-height:150px!important}
.field-side-rail .hq.faction-fortress{height:150px!important;min-height:150px!important}
.rail-advisor-row{height:74px!important;min-height:74px!important}
.field-side-rail .advisor{height:74px!important;min-height:74px!important}
.field-side-rail .advisor-portrait{width:34px!important;height:62px!important}
.rail-spacer{min-height:16px!important}

/* 전체적으로 너무 작았던 글자를 한 단계 확대 */
.battlefield-layout .lane .label{font-size:12px!important;font-weight:800!important;color:#bba583a6!important}
.battlefield-layout .unit{grid-template-rows:22px 1fr 22px!important}
.battlefield-layout .uname{font-size:13px!important;padding:3px 5px!important}
.battlefield-layout .uimg{font-size:27px!important}
.battlefield-layout .stats{font-size:12px!important;padding:3px!important}
.battlefield-layout .grade{font-size:9px!important}
.battlefield-layout .typeicon{font-size:11px!important}
.battlefield-layout .buff,.battlefield-layout .support-charge{font-size:8px!important}

.field-side-rail .hq-title{font-size:12px!important;min-width:156px!important}
.field-side-rail .hq-subtitle{font-size:9px!important}
.field-side-rail .hq-stat-chip{font-size:10px!important;padding:3px 4px!important}
.field-side-rail .hq-advisor-summary{font-size:9px!important;line-height:1.25!important}
.field-side-rail .hq-advisor-summary b{font-size:10px!important}
.field-side-rail .enemy-turn-badge{font-size:10px!important;height:20px!important}
.field-side-rail .hq-unit-slot.empty::after{font-size:8px!important}
.field-side-rail .base-unit-name{font-size:8px!important}
.field-side-rail .base-unit-stat{font-size:7px!important}

.field-side-rail .advisor-copy b{font-size:10px!important}
.field-side-rail .advisor-copy .advisor-meta{font-size:8px!important;line-height:1.2!important}
.field-side-rail .advisor-level{font-size:8px!important;padding:1px 4px!important}
.field-side-rail .advisor-empty{font-size:11px!important;line-height:1.35!important}
.field-side-rail .advisor .mana{font-size:11px!important}

/* 좌/우 메뉴와 우측 카드 패널도 가독성 위주로 소폭 확대 */
.reference-left .ornate-title,.reference-right .ornate-title{font-size:14px!important}
.settings-mini-copy{font-size:11px!important}
.left-log-frame .log{font-size:11px!important}
#leftMenuMount .top-field span,.faction-pickers{font-size:10px!important}
#leftMenuMount .top-field select,#leftMenuMount .faction-pickers select{font-size:11px!important}
#leftMenuMount .turn-plate .turnbadge{font-size:12px!important}
#leftMenuMount .checkline{font-size:11px!important}
#leftMenuMount .btn,.left-bottom-actions .btn{font-size:12px!important}

.deck-info{font-size:11px!important}
.deck-info b{font-size:17px!important}
.deck-help{font-size:9px!important}
#hand.hand .cname{font-size:9px!important}
#hand.hand .card-type-line{font-size:7px!important}
#hand.hand .card-stat-cell span{font-size:7px!important}
.right-action-mount .btn{font-size:12px!important}
.right-action-mount #endTurnBtn{font-size:14px!important}

@media(max-width:1280px){
  .battlefield-layout{grid-template-columns:minmax(0,3.05fr) minmax(176px,1fr)!important}
  .rail-resource-strip{height:39px;min-height:39px;padding:3px}
  .rail-resource-item b{font-size:15px}
  .rail-resource-item span{font-size:9px}
  .rail-hq-wrap{height:140px!important;min-height:140px!important}
  .field-side-rail .hq.faction-fortress{height:140px!important;min-height:140px!important}
  .rail-advisor-row{height:68px!important;min-height:68px!important}
  .field-side-rail .advisor{height:68px!important;min-height:68px!important}
  .field-side-rail .advisor-portrait{height:56px!important;width:31px!important}
  .battlefield-layout .uname{font-size:12px!important}
  .battlefield-layout .stats{font-size:11px!important}
}

/* ================================================================
   v19 — target screenshot layout + soldier image registration UX
   ================================================================ */
/* 2번 참고 화면처럼: 좌측 메뉴 / 압축된 전투영역 / 넓은 우측 카드영역 비율 */
.app{
  grid-template-columns:210px minmax(560px,1.7fr) minmax(340px,1fr)!important;
  gap:4px!important;padding:4px!important;
}

/* 전투열 옆에 본진 레일을 바짝 붙이고, 중앙의 불필요한 빈 폭을 줄임 */
.battlefield-layout{
  grid-template-columns:minmax(0,1.32fr) minmax(220px,1fr)!important;
  gap:0!important;padding:0!important;
}
.battlefield-layout>.board{min-width:0!important;max-width:none!important;width:100%!important}
.battlefield-layout .slots.n4{width:96%!important;max-width:none!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
.battlefield-layout .slots.n3{width:84%!important;max-width:none!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
.battlefield-layout .slots.n2{width:64%!important;max-width:none!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
.field-side-rail{min-width:220px!important}

/* 우측 핸드는 2번 참고 화면처럼 3 x 2 유지, 카드 가독성 확보 */
.reference-right{min-width:0!important}
#hand.hand{grid-template-columns:repeat(3,minmax(0,1fr))!important}

/* 카드/병사 이미지 관리자 */
.manager-search{grid-template-columns:minmax(0,1fr) 92px 104px!important}
.manager-upload-label{
  display:block;padding:7px 9px;border:1px solid #6f532e;background:linear-gradient(180deg,#241b10,#100d09);
  color:#efd39d;font-size:11px;font-weight:900;text-align:center;cursor:pointer;
}
.manager-upload-label:hover{filter:brightness(1.12)}
.manager-help b{color:#f0cf92}

@media (max-width:1280px) and (min-width:851px){
  .app{grid-template-columns:188px minmax(530px,1.7fr) minmax(315px,1fr)!important;gap:3px!important;padding:2px!important;min-width:1038px!important}
  .battlefield-layout{grid-template-columns:minmax(0,1.32fr) minmax(218px,1fr)!important}
  .field-side-rail{min-width:218px!important}
  .reference-brand h1{font-size:25px!important}
  .reference-brand{padding-left:10px!important;padding-right:8px!important}
}

/* 기존 1050px 이하에서 우측 패널이 아래로 내려가던 규칙을 덮어써 2번 화면의 3열 배치를 유지 */
@media (max-width:1050px) and (min-width:851px){
  .app{height:100vh!important;grid-template-columns:188px 530px minmax(315px,1fr)!important;min-width:1038px!important}
  .reference-right{grid-column:auto!important;height:calc(100vh - 4px)!important;display:flex!important;flex-direction:column!important}
  .enemy-roster-section{height:24%!important;flex:0 0 24%!important}
  .right-deck-section{flex:0 0 88px!important}
  .right-hand-section{flex:1 1 auto!important;min-height:330px!important}
}

/* ================================================================
   v20 — PC compact 3-column layout
   - removes the separate right-hand panel chrome/empty space
   - unifies HQ/advisors/deck/hand/resources into one right HUD
   - gives the battlefield the full center column
   ================================================================ */
@media (min-width:851px){
  html,body{width:100%;height:100%;overflow:hidden!important}
  .app{
    width:100vw!important;height:100vh!important;min-height:0!important;
    display:grid!important;
    grid-template-columns:205px minmax(560px,1fr) minmax(330px,370px)!important;
    gap:3px!important;padding:3px!important;
  }
  .panel{border-radius:0!important}
  .reference-left,.battle-panel,.reference-right{height:calc(100vh - 6px)!important;min-height:0!important}

  /* 중앙은 전투 필드만 사용: 본진 레일 때문에 생기던 폭 손실 제거 */
  .boardwrap{height:100%!important;min-height:0!important;overflow:hidden!important;padding:0!important}
  .battlefield-layout{
    display:block!important;width:100%!important;height:100%!important;min-height:0!important;padding:0!important;
  }
  .battlefield-layout>.board{
    width:100%!important;height:100%!important;min-width:0!important;max-width:none!important;margin:0!important;
    padding:0!important;gap:4px!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:repeat(3,minmax(0,1fr)) 24px repeat(3,minmax(0,1fr))!important;
  }
  .battlefield-layout .lane{height:100%!important;min-height:0!important;padding:3px 5px!important}
  .battlefield-layout .slots{height:100%!important;min-height:0!important;width:100%!important;max-width:none!important;gap:6px!important}
  .battlefield-layout .slots.n4{width:96%!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .battlefield-layout .slots.n3{width:82%!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .battlefield-layout .slots.n2{width:62%!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .battlefield-layout .slot{height:calc(100% - 8px)!important;min-height:70px!important;max-height:none!important}

  /* 우측을 사진처럼 하나의 세로 HUD로 통합 */
  .reference-right{
    position:relative!important;display:flex!important;flex-direction:column!important;
    overflow:hidden!important;padding:0!important;background:#080c0d!important;
  }
  .field-side-rail{display:contents!important}
  .rail-spacer{display:none!important}
  .enemy-roster-section{display:none!important}
  .enemy-rail-group{order:1!important;flex:0 0 auto!important;gap:3px!important}
  .right-deck-section{order:2!important;flex:0 0 76px!important;min-height:76px!important}
  .right-hand-section{order:3!important;flex:1 1 auto!important;min-height:190px!important;border-bottom:1px solid #5d3d1d!important;background:#080c0d!important}
  .ally-rail-group{order:4!important;flex:0 0 auto!important;gap:3px!important}
  .right-action-strip{display:none!important}

  /* 본진 + 책사 크기는 화면 높이에 맞춰 자연스럽게 조정 */
  .rail-hq-wrap{height:clamp(118px,15.5vh,150px)!important;min-height:118px!important}
  .field-side-rail .hq.faction-fortress{
    width:100%!important;height:clamp(118px,15.5vh,150px)!important;min-height:118px!important;
  }
  .rail-advisor-row{height:clamp(56px,7.5vh,72px)!important;min-height:56px!important;gap:3px!important}
  .field-side-rail .advisor{height:100%!important;min-height:0!important}
  .field-side-rail .advisor-portrait{height:calc(100% - 6px)!important;max-height:62px!important}
  .rail-resource-strip{height:38px!important;min-height:38px!important;padding:3px!important;gap:3px!important}
  .rail-resource-item{padding:3px 5px!important}
  .rail-resource-item span{font-size:9px!important}
  .rail-resource-item b{font-size:15px!important}

  /* 별도 '핸드 전용 공간'의 제목/설명/여백 제거. 카드 그리드만 HUD에 밀착 배치 */
  .right-hand-section>.ornate-title,.right-hand-section .handhead{display:none!important}
  .right-hand-section .handbox{
    width:100%!important;height:100%!important;min-height:0!important;flex:1 1 auto!important;
    padding:4px!important;margin:0!important;border:0!important;overflow:hidden!important;background:#080c0d!important;
  }
  #hand.hand{
    width:100%!important;height:100%!important;min-height:0!important;margin:0!important;padding:0!important;
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;grid-auto-rows:minmax(0,1fr)!important;
    gap:4px!important;overflow:hidden!important;align-content:stretch!important;
  }
  #hand.hand .card{
    width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;
    border-radius:0!important;grid-template-rows:16px minmax(42px,1fr) auto!important;overflow:hidden!important;
  }
  #hand.hand .cname{font-size:8px!important;padding:1px 2px!important}
  #hand.hand .cimg{min-height:0!important}
  #hand.hand .cstats{padding:2px!important;gap:2px!important}
  #hand.hand .card-stat-grid{gap:2px!important}
  #hand.hand .card-stat-cell{min-height:22px!important;padding:1px!important}
  #hand.hand .card-stat-cell b{font-size:11px!important}
  #hand.hand .card-stat-cell span{font-size:6px!important}
  #hand.hand .card-type-line{font-size:6px!important}
  #hand.hand .ctext,#hand.hand .card-hover-tooltip{display:none!important}

  /* 덱과 명령 버튼을 같은 줄에 배치하여 별도 명령 공간 삭제 */
  .right-deck-body{
    height:100%!important;min-height:0!important;display:grid!important;
    grid-template-columns:50px minmax(72px,1fr) 112px!important;gap:6px!important;align-items:center!important;padding:5px 6px!important;
  }
  .deck-stack{width:46px!important;height:58px!important}
  .deck-emblem{font-size:20px!important}
  .deck-info{font-size:9px!important;gap:1px!important;min-width:0!important}
  .deck-info b{font-size:16px!important;line-height:1!important}
  .deck-help{display:none!important}
  .deck-action-mount{
    width:100%!important;height:62px!important;min-width:0!important;padding:0!important;
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:23px 35px!important;
    gap:3px!important;
  }
  .deck-action-mount .btn{min-width:0!important;width:100%!important;height:100%!important;min-height:0!important;padding:2px 3px!important;font-size:8px!important}
  .deck-action-mount #shuffleBtn{grid-column:1!important;grid-row:1!important}
  .deck-action-mount #cancelBtn{grid-column:2!important;grid-row:1!important}
  .deck-action-mount #rulesBtn{display:none!important}
  .deck-action-mount #endTurnBtn{grid-column:1/3!important;grid-row:2!important;font-size:11px!important;font-weight:900!important}

  /* 좌측 메뉴는 사진처럼 세로 공간을 꽉 사용 */
  .reference-left{padding:0!important;gap:0!important;overflow:hidden!important}
  .reference-brand{flex:0 0 86px!important}
  .left-advisor-frame{flex:0 0 auto!important}
  .left-log-frame{flex:1 1 auto!important;min-height:150px!important}
  .left-menu-dock{flex:0 0 auto!important}
  .left-bottom-actions{flex:0 0 62px!important;min-height:62px!important;padding:6px 10px!important}
}

@media (min-width:851px) and (max-width:1180px){
  .app{grid-template-columns:188px minmax(520px,1fr) 320px!important;min-width:1028px!important}
  .right-deck-body{grid-template-columns:44px minmax(66px,1fr) 104px!important;gap:4px!important;padding:4px!important}
  .deck-stack{width:42px!important;height:54px!important}
  .field-side-rail .hq-title{font-size:10px!important;min-width:140px!important}
  .field-side-rail .hq-stat-chip{font-size:8px!important}
  .field-side-rail .advisor-copy b{font-size:8px!important}
  .field-side-rail .advisor-copy .advisor-meta{font-size:7px!important}
}

/* ================================================================
   v21 — narrower battlefield width + non-fullscreen PC canvas
   - battlefield column reduced to about 70% of prior PC width
   - app no longer forced to fill the entire PC viewport
   ================================================================ */
@media (min-width:851px){
  html,body{
    width:100%;
    height:auto!important;
    min-height:100%;
    overflow:auto!important;
  }
  body{
    padding:18px 0!important;
  }
  .app{
    width:min(1015px, calc(100vw - 40px))!important;
    height:auto!important;
    min-height:0!important;
    margin:0 auto!important;
    display:grid!important;
    grid-template-columns:205px minmax(392px, 420px) minmax(330px, 360px)!important;
    gap:8px!important;
    padding:0!important;
    align-items:start!important;
  }
  .reference-left,.battle-panel,.reference-right{
    height:820px!important;
    min-height:820px!important;
  }
  .reference-left,.battle-panel,.reference-right{max-height:none!important}
}

@media (min-width:851px) and (max-width:1180px){
  body{padding:12px 0!important}
  .app{
    width:min(955px, calc(100vw - 24px))!important;
    grid-template-columns:188px minmax(360px, 390px) minmax(300px, 330px)!important;
    gap:6px!important;
  }
  .reference-left,.battle-panel,.reference-right{
    height:780px!important;
    min-height:780px!important;
  }
}

/* ================================================================
   v22 — requested control/card/HQ/advisor refinements
   ================================================================ */
@media (min-width:851px){
  .right-deck-section{flex-basis:70px!important;min-height:70px!important}
  .right-deck-body{display:grid!important;grid-template-columns:.9fr 1fr 1.15fr!important;grid-template-rows:1fr!important;gap:5px!important;padding:6px!important;align-items:stretch!important}
  .right-deck-body .deck-stack{display:none!important}
  .right-deck-body .deck-info{grid-column:1!important;grid-row:1!important;min-width:0!important;height:auto!important;align-items:center!important;justify-content:center!important;text-align:center!important;gap:1px!important;padding:4px!important;border:1px solid #6b5131!important;background:linear-gradient(180deg,#1c1711,#0d0b08)!important}
  .right-deck-body .deck-info b{font-size:19px!important;line-height:1!important}
  .right-deck-body .deck-info>span:not(.deck-help){font-size:10px!important}
  .right-deck-body .deck-action-mount{display:contents!important}
  .right-deck-body #shuffleBtn,.right-deck-body #endTurnBtn{min-width:0!important;width:100%!important;height:auto!important;min-height:0!important;padding:6px 4px!important;font-size:13px!important;font-weight:900!important}
  .right-deck-body #shuffleBtn{grid-column:2!important;grid-row:1!important}
  .right-deck-body #endTurnBtn{grid-column:3!important;grid-row:1!important}

  .ally-rail-group>.rail-resource-strip{display:none!important}
  .field-side-rail .hq-info-overlay{left:9px!important;right:9px!important;top:38px!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:12px!important;flex-wrap:nowrap!important;pointer-events:none!important}
  .field-side-rail .hq-stat-chip{padding:0!important;margin:0!important;border:0!important;background:transparent!important;box-shadow:none!important;font-size:12px!important;font-weight:900!important;color:#fff!important;text-shadow:0 2px 5px #000,0 0 8px #000!important}
  .field-side-rail .hq-stat-chip b{font-size:14px!important;color:#fff!important}
  .field-side-rail .hq-stat-chip.skill{display:none!important}
  .field-side-rail .hq-title{font-size:14px!important;text-shadow:0 2px 6px #000!important}
  .field-side-rail .hq-subtitle{font-size:10px!important;text-shadow:0 2px 5px #000!important}

  #allyHq #allyAdvisorConsole{display:none!important}
  #allyHq #allyAdvisorConsole.skill-menu-open{display:block!important;position:absolute!important;left:7px!important;right:7px!important;top:34px!important;bottom:7px!important;width:auto!important;height:auto!important;z-index:60!important;padding:7px!important;border:1px solid #9b7844!important;background:linear-gradient(180deg,#090d10f2,#07090bf5)!important;box-shadow:0 8px 24px #000d,inset 0 0 0 1px #000!important;overflow:auto!important}
  #allyAdvisorConsole .advisor-mirror,#allyAdvisorConsole .advisor-switch{display:none!important}
  #allyAdvisorConsole .compact-skills{display:block!important;padding:0!important}
  #allyAdvisorConsole .notice{display:block!important;margin:0 0 6px!important;padding:4px 6px!important;border:0!important;background:transparent!important;color:#f0e3ce!important;font-size:11px!important;line-height:1.3!important;text-align:center!important}
  #allyAdvisorConsole .compact-skill-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important;margin:0!important}
  #allyAdvisorConsole .compact-skill-grid .skill{min-height:48px!important;padding:5px!important;text-align:center!important}
  #allyAdvisorConsole .compact-skill-grid .skill b{font-size:11px!important;line-height:1.15!important}
  #allyAdvisorConsole .compact-skill-grid .skill span{font-size:9px!important;line-height:1.2!important}
  #allyAdvisorConsole #upgradeAdvisorBtn{grid-column:1/-1!important;min-height:30px!important;padding:4px 6px!important;font-size:10px!important;font-weight:900!important}

  #hand.hand .cname{font-size:11px!important;line-height:1.15!important}
  #hand.hand .card-type-line{font-size:9px!important;font-weight:800!important}
  #hand.hand .card-stat-cell{min-height:25px!important;padding:2px!important}
  #hand.hand .card-stat-cell.combat b{font-size:14px!important;white-space:nowrap!important}
  #hand.hand .card-type-badge{position:absolute;left:4px;bottom:4px;z-index:6;padding:2px 5px;border:1px solid #ffffff55;background:#05080dcc;color:#fff4de;font-size:9px;font-weight:900;line-height:1.15;text-shadow:0 1px 3px #000}
  .battlefield-layout .uname{font-size:14px!important}
  .battlefield-layout .stats{font-size:13px!important;font-weight:900!important}
  .battlefield-layout .typeicon{left:4px!important;bottom:4px!important;padding:2px 5px!important;font-size:10px!important;font-weight:900!important;color:#fff!important;border:1px solid #ffffff44!important;background:#05080dcc!important;text-shadow:0 1px 3px #000!important}
  .battlefield-layout .lane .label{font-size:13px!important}
  .field-side-rail .advisor-copy b{font-size:11px!important}
  .field-side-rail .advisor-copy .advisor-meta{font-size:9px!important}
  .field-side-rail .advisor-level{font-size:9px!important}
  .field-side-rail .advisor-empty{font-size:12px!important}
  .field-side-rail .advisor .mana{font-size:12px!important}
}
@media (max-width:850px){
  .card-type-badge{position:absolute;left:4px;bottom:4px;z-index:6;padding:2px 5px;background:#05080dcc;border:1px solid #ffffff55;font-size:9px;font-weight:900}
  #allyHq #allyAdvisorConsole{display:none!important}
  #allyHq #allyAdvisorConsole.skill-menu-open{display:block!important;position:absolute!important;inset:34px 6px 6px!important;z-index:60!important;padding:6px!important;background:#080b0ef2!important;border:1px solid #9b7844!important;overflow:auto!important}
  #allyAdvisorConsole .advisor-mirror,#allyAdvisorConsole .advisor-switch{display:none!important}
  #allyAdvisorConsole .compact-skill-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px!important}
  #allyAdvisorConsole #upgradeAdvisorBtn{grid-column:1/-1!important}
}

/* ================================================================
   v23 — modular build / formation / shuffle / turn highlight
   ================================================================ */
.formation-control{display:grid;gap:6px;padding:8px;border:1px solid #4d3b27;background:#0b0e10;border-radius:7px}
.formation-control span{font-size:11px;color:#d8c8ae;font-weight:800;text-align:center}
.formation-control select{width:100%;font-size:13px;font-weight:900;text-align:center;background:#17120d;border-color:#7b5b35;color:#f3e2c5}
.formation-note{font-size:9px;line-height:1.35;color:#9f917c;text-align:center}

/* 해당 진영의 행동 턴에는 3개 전투열의 외곽선을 밝게 표시 */
.lane.turn-active{border-color:#f3d58a!important;box-shadow:0 0 0 2px #f2cc6f55,0 0 22px #f4c45e70,inset 0 0 18px #f4c45e18!important;animation:activeLaneGlow 1.4s ease-in-out infinite alternate}
.lane.turn-active .label{color:#fff4ce!important;text-shadow:0 0 8px #f3c660!important;font-weight:950!important}
@keyframes activeLaneGlow{from{filter:brightness(1)}to{filter:brightness(1.18)}}
body.no-anim .lane.turn-active{animation:none}

/* 본진 자원 수치: 성 이미지 중앙에 크게 배치 */
.field-side-rail .hq-info-overlay{left:50%!important;right:auto!important;top:50%!important;transform:translate(-50%,-50%)!important;width:calc(100% - 18px)!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:15px!important;flex-wrap:nowrap!important;pointer-events:none!important;text-align:center!important}
.field-side-rail .hq-stat-chip{padding:0!important;margin:0!important;border:0!important;background:transparent!important;box-shadow:none!important;font-size:14px!important;font-weight:950!important;color:#fff!important;text-shadow:0 2px 6px #000,0 0 10px #000!important;white-space:nowrap!important}
.field-side-rail .hq-stat-chip b{font-size:18px!important;line-height:1!important;color:#fff!important}
.field-side-rail .hq-stat-chip.skill{display:none!important}
.field-side-rail .hq.faction-fortress>.hptxt{display:none!important}

/* 카드명은 최상단 1회만 표시. 등급 / 필요 행동력은 더 크게. */
#hand.hand .cname{display:flex!important;align-items:center!important;justify-content:flex-start!important;min-height:22px!important;padding:2px 6px!important;font-size:12px!important;font-weight:950!important;text-align:left!important}
#hand.hand .card-grade{left:5px!important;top:25px!important;padding:3px 7px!important;border-radius:5px!important;font-size:11px!important;line-height:1.1!important;box-shadow:0 2px 7px #000b!important}
#hand.hand .cost{right:5px!important;top:25px!important;width:auto!important;min-width:38px!important;height:26px!important;padding:0 6px!important;border-radius:7px!important;font-size:12px!important;font-weight:950!important;line-height:1!important}
#hand.hand .cost::before{content:'AP ';font-size:9px;font-weight:850;margin-right:2px;color:#fff0bd}

/* 셔플 버튼 */
#shuffleBtn{font-weight:950!important}

@media(max-width:850px){
  .field-side-rail .hq-info-overlay{gap:9px!important}
  .field-side-rail .hq-stat-chip{font-size:11px!important}
  .field-side-rail .hq-stat-chip b{font-size:14px!important}
  #hand.hand .card-grade{font-size:9px!important;padding:2px 5px!important}
  #hand.hand .cost{min-width:33px!important;height:23px!important;font-size:10px!important}
}


/* ================================================================
   v24 — 카드 상단 정보 통합 / 카드 이미지 폴더
   ================================================================ */
/* 카드 이름 영역 안에 이름 + 등급 + AP + 능력을 함께 표시 */
#hand.hand .card-title-area{
  min-height:36px!important;
  height:36px!important;
  padding:3px 4px!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto auto!important;
  grid-template-rows:15px 13px!important;
  column-gap:3px!important;
  row-gap:2px!important;
  align-items:center!important;
  justify-content:stretch!important;
  overflow:hidden!important;
  background:linear-gradient(180deg,#493324,#211812)!important;
  border-bottom:1px solid #8c683e!important;
  color:#f4ecdf!important;
  text-align:left!important;
}
#hand.hand .card-name-text{
  min-width:0!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
  font-size:10px!important;
  line-height:15px!important;
  font-weight:950!important;
}
#hand.hand .card-head-grade,
#hand.hand .card-head-cost{
  position:static!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  height:15px!important;
  padding:0 4px!important;
  border-radius:4px!important;
  border:1px solid #ffffff55!important;
  font-size:7px!important;
  line-height:1!important;
  font-weight:950!important;
  white-space:nowrap!important;
  box-shadow:none!important;
}
#hand.hand .card-head-cost{
  background:#16110b!important;
  border-color:#c59b55!important;
  color:#ffd96a!important;
}
#hand.hand .card-head-ability{
  grid-column:1 / -1!important;
  min-width:0!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
  font-size:7px!important;
  line-height:13px!important;
  font-weight:700!important;
  color:#e1d4bf!important;
}
#hand.hand .card-head-ability b{
  margin-right:3px!important;
  color:#f4c875!important;
  font-size:7px!important;
  font-weight:950!important;
}
/* 기존 이미지 위 등급/AP 배지는 제거하고 상단 이름칸에서만 표시 */
#hand.hand .card-grade,
#hand.hand .cost{display:none!important}

/* 3 x 2 핸드 레이아웃에서 상단 정보칸을 확장한 만큼 이미지 영역을 재배분 */
#hand.hand .card{
  grid-template-rows:36px minmax(52px,1fr) auto!important;
}

@media (max-width:850px){
  #hand.hand .card-title-area{
    min-height:34px!important;
    height:34px!important;
    grid-template-rows:14px 12px!important;
    padding:3px!important;
  }
  #hand.hand .card-name-text{font-size:9px!important;line-height:14px!important}
  #hand.hand .card-head-grade,#hand.hand .card-head-cost{height:14px!important;font-size:6.5px!important;padding:0 3px!important}
  #hand.hand .card-head-ability,#hand.hand .card-head-ability b{font-size:6.5px!important;line-height:12px!important}
  #hand.hand .card{grid-template-rows:34px minmax(46px,1fr) auto!important}
}


/* ================================================================
   v25 — HQ behind row 1 / one advisor / adjustable art / AP feedback
   ================================================================ */
.card-art-img,.unit-art-img,.manager-preview img,.advisor-portrait img,.roster-art img,.base-unit-art img{
  object-fit:cover!important;
  object-position:var(--img-x,50%) var(--img-y,50%)!important;
  transform:scale(var(--img-scale,1));
  transform-origin:var(--img-x,50%) var(--img-y,50%);
  transition:transform .12s ease,object-position .12s ease;
}
.manager-preview,.manager-thumb,.cimg,.uimg,.advisor-portrait,.roster-art,.base-unit-art{overflow:hidden!important}
.image-adjust-panel{display:grid;gap:7px;padding:9px;border:1px solid #5f472d;background:#0a0d0f}
.image-adjust-title{font-size:11px;font-weight:950;color:#efcf95;text-align:center}
.image-adjust-panel label{display:grid;grid-template-columns:58px minmax(0,1fr) 42px;gap:7px;align-items:center;font-size:10px;color:#d5c7b2}
.image-adjust-panel input[type="range"]{width:100%;accent-color:#c69b55}
.image-adjust-panel output{text-align:right;color:#f2d69f;font-weight:900;font-size:10px}
.image-adjust-panel .btn{min-height:27px!important;font-size:10px!important}
.batch-image-preset-panel{display:grid;gap:10px;padding:10px;border:1px solid #5f472d;background:#0a0d0f}
.batch-image-preset-note{font-size:10px;line-height:1.45;color:#d6c8b3}
.batch-image-preset-note.compact{font-size:9px;color:#bba98c}
.batch-image-preset-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px}
.batch-image-preset-slot{display:grid;gap:8px;padding:8px;border:1px solid #6c4d2b;background:linear-gradient(180deg,#12100d,#0a0c0e)}
.batch-image-preset-head{display:flex;align-items:center;justify-content:space-between;gap:6px}
.batch-image-preset-head b{font-size:11px;color:#efcf95}
.batch-image-preset-head .btn,.batch-image-preset-slot>.btn{min-height:26px!important;font-size:10px!important}
.batch-image-preset-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.batch-image-preset-fields label{display:grid;gap:4px;font-size:10px;color:#d5c7b2}
.batch-image-preset-fields input{width:100%;min-width:0;background:#0b0d0f;border:1px solid #745734;color:#f4e1b8;padding:4px 6px}
.batch-image-type-select{display:flex;flex-wrap:wrap;gap:10px 14px;padding:4px 2px}
.batch-image-type-select label{display:flex;align-items:center;gap:5px;font-size:11px;color:#e0d3bf}
.batch-image-type-select input{accent-color:#c69b55}


/* Center battlefield now owns both HQs. Each HQ sits directly behind its row 1. */
@media (min-width:851px){
  .battlefield-layout>.board{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:104px repeat(3,minmax(0,1fr)) 24px repeat(3,minmax(0,1fr)) 104px!important;
    gap:3px!important;
  }
  .hq-battle-row{min-height:0!important;height:100%!important;padding:0 5px!important;display:flex!important;align-items:stretch!important;justify-content:center!important}
  .battle-hq{width:98%!important;height:100%!important;min-height:0!important;max-height:none!important;border-radius:0!important;margin:0!important;display:block!important;position:relative!important;overflow:hidden!important;background-position:center 43%!important}
  .battle-hq .hq-title{top:0!important;font-size:12px!important;min-width:190px!important;padding:3px 18px 4px!important}
  .battle-hq .hq-subtitle{top:25px!important;left:8px!important;font-size:7px!important}
  .battle-hq .hq-info-overlay{position:absolute!important;left:10px!important;right:auto!important;top:37px!important;transform:none!important;width:auto!important;display:flex!important;gap:10px!important;justify-content:flex-start!important;z-index:8!important}
  .battle-hq .hq-stat-chip{font-size:10px!important;text-shadow:0 2px 5px #000!important}
  .battle-hq .hq-stat-chip b{font-size:13px!important}
  .battle-hq .hq-advisor-summary{left:10px!important;right:132px!important;bottom:7px!important;min-height:28px!important;font-size:9px!important;padding:3px 6px!important}
  .battle-hq .hq-advisor-summary b{font-size:10px!important}
  .battle-hq .hq-advisor-slot{position:absolute!important;right:7px!important;top:29px!important;width:118px!important;height:67px!important;min-height:0!important;z-index:10!important;border-radius:4px!important;padding:3px!important;background:linear-gradient(180deg,#11191aee,#080c0dee)!important;border:1px solid #9b7844!important}
  .battle-hq .hq-advisor-slot.has-portrait{padding:3px!important}
  .battle-hq .hq-advisor-slot .advisor-card.rich{grid-template-columns:44px 1fr!important;gap:4px!important;height:100%!important}
  .battle-hq .hq-advisor-slot .advisor-portrait{width:44px!important;height:58px!important}
  .battle-hq .hq-advisor-slot .advisor-copy b{font-size:10px!important}
  .battle-hq .hq-advisor-slot .advisor-meta,.battle-hq .hq-advisor-slot .advisor-level{font-size:8px!important}
  .battle-hq .hq-advisor-slot .advisor-empty{font-size:10px!important;line-height:1.25!important}
  .battle-hq .hq-unit-slot{right:132px!important;bottom:7px!important;width:118px!important;height:30px!important;z-index:9!important}
  .battle-hq.emergency .hq-unit-slot,.battle-hq.has-base-unit .hq-unit-slot{display:flex!important}
  .battle-hq.emergency,.battle-hq.has-base-unit{height:100%!important;min-height:0!important}
  .battle-hq .enemy-turn-badge{z-index:12!important}

  /* Right HUD now prioritizes the 3x2 hand. Minimum card height is 154px -> 185px (+20%). */
  .reference-right{display:flex!important;flex-direction:column!important;overflow:hidden!important}
  .right-deck-section{order:1!important;flex:0 0 74px!important;min-height:74px!important}
  .right-hand-section{order:2!important;flex:1 1 auto!important;min-height:0!important;overflow:auto!important;background:#080c0d!important}
  .right-hand-section>.ornate-title{display:flex!important;flex:0 0 30px!important}
  .right-hand-section .handhead{display:none!important}
  .right-hand-section .handbox{height:auto!important;min-height:0!important;overflow:visible!important;padding:5px!important}
  #hand.hand{height:auto!important;min-height:374px!important;grid-template-rows:repeat(2,minmax(185px,1fr))!important;grid-auto-rows:minmax(185px,1fr)!important;overflow:visible!important}
  #hand.hand .card{height:100%!important;min-height:185px!important;grid-template-rows:36px minmax(100px,1fr) auto!important}
  #hand.hand .cimg{min-height:100px!important}
  #hand.hand .card-stat-cell{min-height:27px!important}

  /* One-advisor skill menu, larger and easier to read. */
  #allyHq #allyAdvisorConsole.skill-menu-open{display:block!important;position:absolute!important;left:8px!important;right:132px!important;top:28px!important;bottom:6px!important;z-index:40!important;padding:7px!important;background:#070a0df5!important;border:1px solid #b58b4f!important;overflow:auto!important}
  #allyAdvisorConsole .notice{display:block!important;font-size:13px!important;line-height:1.35!important;padding:4px 5px!important;margin:0 0 5px!important;text-align:left!important;color:#f3e5cc!important}
  #allyAdvisorConsole .compact-skill-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important}
  #allyAdvisorConsole .compact-skill-grid .skill{min-height:50px!important;padding:5px!important}
  #allyAdvisorConsole .compact-skill-grid .skill b{font-size:14px!important;line-height:1.15!important}
  #allyAdvisorConsole .compact-skill-grid .skill span{display:block!important;font-size:10px!important;line-height:1.2!important;margin-top:3px!important}
  #allyAdvisorConsole #upgradeAdvisorBtn{grid-column:1/-1!important;min-height:30px!important;font-size:11px!important}
  #allyAdvisorConsole .advisor-mirror{display:none!important}

  .reference-left,.battle-panel,.reference-right{height:860px!important;min-height:860px!important}
}

@media (max-width:850px){
  .hq-battle-row{padding:3px 0}
  .battle-hq{height:125px!important;min-height:125px!important;border-radius:0!important}
  .battle-hq .hq-advisor-slot{position:absolute;right:6px;top:34px;width:112px;height:76px;z-index:10;border-radius:4px}
  .battle-hq .hq-info-overlay{left:8px!important;right:124px!important;top:38px!important;transform:none!important;width:auto!important;justify-content:flex-start!important;gap:7px!important;flex-wrap:wrap!important}
  .battle-hq .hq-advisor-summary{left:8px!important;right:124px!important;bottom:7px!important;font-size:8px!important}
  #hand.hand{grid-auto-rows:185px!important}
  #hand.hand .card{min-height:185px!important;grid-template-rows:34px minmax(100px,1fr) auto!important}
  #allyAdvisorConsole .notice{font-size:12px!important}
  #allyAdvisorConsole .compact-skill-grid .skill b{font-size:13px!important}
  #allyAdvisorConsole .compact-skill-grid .skill span{font-size:10px!important}
}

.ap-spend-feedback{position:fixed;left:50%;top:18%;transform:translate(-50%,-10px) scale(.96);z-index:1000;display:flex;align-items:center;gap:10px;padding:10px 16px;border:1px solid #d0a458;background:#090c0ff2;box-shadow:0 12px 35px #000d;color:#f2dfbe;opacity:0;pointer-events:none;transition:.18s ease}
.ap-spend-feedback.show{opacity:1;transform:translate(-50%,0) scale(1)}
.ap-spend-feedback b{font-size:22px;line-height:1;color:#ffd66e;text-shadow:0 0 12px #f2b94d66}
.ap-spend-feedback span{font-size:12px;font-weight:900}
.ap-value-flash{animation:apValueFlash .65s ease!important}
@keyframes apValueFlash{0%{transform:scale(1);filter:brightness(1)}35%{transform:scale(1.35);filter:brightness(1.8);text-shadow:0 0 12px #ffd15a}100%{transform:scale(1);filter:brightness(1)}}
body.no-anim .ap-value-flash{animation:none!important}

/* ================================================================
   v26 — taller PC game canvas / ally HQ clipping fix
   - extends the full game canvas vertically
   - gives the bottom allied HQ a slightly larger dedicated row
   - keeps body scrolling available on shorter displays
   ================================================================ */
@media (min-width:851px){
  body{padding-bottom:24px!important;}
  .app{min-height:1000px!important;}
  .reference-left,.battle-panel,.reference-right{
    height:1000px!important;
    min-height:1000px!important;
  }
  .boardwrap{
    min-height:0!important;
    overflow:hidden!important;
  }
  .battlefield-layout>.board{
    grid-template-rows:112px repeat(3,minmax(0,1fr)) 24px repeat(3,minmax(0,1fr)) 120px!important;
    padding-bottom:6px!important;
  }
  .enemy-hq-row{min-height:112px!important;}
  .ally-hq-row{min-height:120px!important;padding-bottom:4px!important;}
  .ally-hq-row .battle-hq{min-height:116px!important;}
}


/* ================================================================
   v27 — advisor hand skill panel / draggable art / HQ uploads / field card UI
   ================================================================ */
.card-function-tooltip{white-space:pre-line!important;max-width:330px!important;line-height:1.45!important}

/* Card manager button fills its menu box width. */
#leftMenuMount .top-options #cardManagerBtn{
  grid-column:1 / -1!important;
  width:100%!important;
  min-height:34px!important;
  font-size:12px!important;
  font-weight:900!important;
}

/* Card art position is manipulated directly on the preview. */
.manager-preview{position:relative;cursor:grab;touch-action:none;user-select:none}
.manager-preview.dragging{cursor:grabbing;outline:2px solid #e3b867;box-shadow:0 0 20px #d8a95055}
.manager-preview.drop-ready{outline:2px dashed #9ed1ff;background:#10202a}
.manager-preview::after{content:'이미지를 드래그해 위치 조절';position:absolute;left:7px;right:7px;bottom:7px;z-index:7;padding:4px 6px;background:#05080bbb;border:1px solid #ffffff33;color:#f3e5ce;font-size:9px;font-weight:800;text-align:center;pointer-events:none}
.drag-position-readout{display:flex;align-items:center;justify-content:space-between;min-height:25px;padding:4px 7px;border:1px solid #463925;background:#101315;color:#d5c7b2;font-size:10px}
.drag-position-readout b{color:#f2d69f}

.hq-image-manager{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px;padding:8px;border:1px solid #5f472d;background:#0a0d0f}
.hq-image-manager>.image-adjust-title{grid-column:1/-1}
.hq-image-setting{display:grid;gap:5px;min-width:0}
.hq-image-preview{height:66px;background-size:cover;background-position:center;border:1px solid #76552e;position:relative;overflow:hidden}
.hq-image-preview span{position:absolute;left:4px;bottom:4px;padding:2px 5px;background:#05080bbb;color:#fff;font-size:8px;font-weight:900}
.hq-image-preview.custom{box-shadow:inset 0 0 0 1px #e0b15b}
.hq-image-setting .manager-upload-label,.hq-image-setting .btn{font-size:9px!important;min-height:26px!important;padding:4px!important}

/* Advisor click opens the hand-space skill console: advisor card on left, skills on right. */
.advisor-hand-panel{display:none;height:100%;min-height:0;grid-template-columns:minmax(110px,.82fr) minmax(150px,1.18fr);gap:8px;padding:6px;background:linear-gradient(180deg,#0b1013,#070a0c)}
.right-hand-section.advisor-skill-mode .advisor-hand-panel{display:grid!important}
.right-hand-section.advisor-skill-mode #hand.hand{display:none!important}
.right-hand-section.advisor-skill-mode .ornate-title .title-flex>span:first-child{font-size:0}
.right-hand-section.advisor-skill-mode .ornate-title .title-flex>span:first-child::after{content:'책사 스킬';font-size:12px}
.advisor-hand-card,.advisor-hand-skills{min-width:0;min-height:0;border:1px solid #76552e;background:#0c1012;padding:6px;overflow:auto}
.advisor-hand-preview-card{height:100%;display:grid;grid-template-rows:28px minmax(150px,1fr) 25px auto;border:1px solid #9a7440;background:linear-gradient(180deg,#171b1d,#0c0e10);overflow:hidden}
.advisor-hand-name{display:flex;align-items:center;justify-content:center;gap:6px;font-size:13px;font-weight:950;color:#f4eadb;background:#211912;border-bottom:1px solid #76552e}
.advisor-hand-art{min-height:0;overflow:hidden;position:relative}.advisor-hand-art img,.advisor-hand-art .default-art{width:100%;height:100%;object-fit:cover}
.advisor-hand-meta{display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:900;color:#e6c98f;background:#11171a;border-top:1px solid #46515a}
.advisor-hand-copy{padding:6px;font-size:9px;line-height:1.35;color:#d7cbb7;background:#0b0e10}
.advisor-hand-empty{height:100%;display:grid;place-items:center;color:#bcae98;font-size:11px;text-align:center}
.advisor-hand-skills{display:flex;flex-direction:column;gap:7px}
.advisor-hand-status{padding:7px 8px;border:1px solid #624b2e;background:#17120d;color:#f2e4cd;font-size:12px;line-height:1.35}
.advisor-hand-skill-grid{display:grid;grid-template-columns:1fr;gap:7px}
.advisor-hand-skill-grid .skill{min-height:62px;padding:8px;text-align:left}
.advisor-hand-skill-grid .skill b{display:block;font-size:15px;line-height:1.15;color:#f3d7a3}
.advisor-hand-skill-grid .skill span{display:block;margin-top:4px;font-size:11px;line-height:1.3}
.advisor-hand-upgrade,.advisor-hand-close{min-height:34px!important;font-size:11px!important;font-weight:900!important}

/* Battlefield cards +20% taller, while preserving 3-line board layout. */
@media (min-width:851px){
  .battlefield-layout .lane{min-height:86px!important;padding-top:3px!important;padding-bottom:3px!important}
  .battlefield-layout .slots{min-height:82px!important;align-items:center!important}
  .battlefield-layout .slot{height:82px!important;min-height:82px!important}
  .battlefield-layout .unit{height:100%!important;grid-template-rows:21px minmax(0,1fr) 20px!important}
  .battlefield-layout .uname{display:flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;font-size:13px!important;white-space:nowrap!important;overflow:hidden!important}
  .field-unit-name{overflow:hidden;text-overflow:ellipsis}
  .field-grade{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:16px;padding:0 4px;border:1px solid #ffffff44;background:#0a0d10cc;color:#ffe9b0;font-size:9px;font-weight:950;line-height:1}
  .battlefield-layout .uimg{min-height:0!important}
  .battlefield-layout .typeicon.icon-only{min-width:23px!important;min-height:23px!important;padding:1px!important;display:grid!important;place-items:center!important;font-size:16px!important;line-height:1!important;text-indent:0!important}
}

/* Hand: grade beside name, AP shown as a numbered circle on the image. */
#hand.hand .card-title-area{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-rows:18px 12px!important;column-gap:4px!important;align-items:center!important}
#hand.hand .card-name-text{grid-column:1!important;grid-row:1!important;justify-self:center!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
#hand.hand .card-head-grade{grid-column:2!important;grid-row:1!important;position:static!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:18px!important;height:14px!important;padding:0 3px!important;font-size:8px!important}
#hand.hand .card-head-ability{grid-column:1/-1!important;grid-row:2!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
#hand.hand .card-head-cost{display:none!important}
#hand.hand .card-image-cost{position:absolute;right:6px;top:6px;z-index:8;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 35% 30%,#f9dd83,#b57918 68%,#5a3307);border:2px solid #ffe9a5;box-shadow:0 2px 7px #000c,inset 0 0 0 1px #6b3b0a;color:#171005;font-size:15px;font-weight:1000;line-height:1}
#hand.hand .card-type-badge.icon-only{min-width:25px;min-height:25px;display:grid;place-items:center;padding:2px!important;font-size:16px!important;line-height:1!important}
#hand.hand .card-type-line span:last-child{font-size:15px!important;line-height:1!important}

.base-unit-name{display:flex!important;align-items:center!important;gap:5px!important}
.base-unit .typeicon.icon-only{font-size:15px!important;min-width:22px!important;text-align:center!important}

@media (max-width:850px){
  .advisor-hand-panel{grid-template-columns:42% 58%;gap:5px;padding:4px}
  .advisor-hand-preview-card{grid-template-rows:24px minmax(110px,1fr) 22px auto}
  .advisor-hand-name{font-size:11px}.advisor-hand-copy{font-size:8px}
  .advisor-hand-status{font-size:10px;padding:5px}.advisor-hand-skill-grid .skill{min-height:48px;padding:5px}
  .advisor-hand-skill-grid .skill b{font-size:12px}.advisor-hand-skill-grid .skill span{font-size:9px}
  .hq-image-manager{grid-template-columns:1fr}
  .hq-image-manager>.image-adjust-title{grid-column:1}
}


/* ================================================================
   v28 — advisor popover beside HQ card; hand stays visible
   ================================================================ */
/* v27 hand replacement UI is retired. */
.advisor-hand-panel{display:none!important}
.right-hand-section.advisor-skill-mode #hand.hand{display:grid!important}
.right-hand-section.advisor-skill-mode .ornate-title .title-flex>span:first-child{font-size:inherit!important}
.right-hand-section.advisor-skill-mode .ornate-title .title-flex>span:first-child::after{content:none!important}

/* Keep the hand untouched and show the advisor controls as a compact floating panel
   anchored immediately to the right of the advisor card. JS supplies viewport coords. */
#allyHq #allyAdvisorConsole{display:none!important}
#allyHq #allyAdvisorConsole.skill-menu-open{
  display:block!important;
  position:fixed!important;
  left:var(--advisor-pop-left, 50%)!important;
  top:var(--advisor-pop-top, 50%)!important;
  right:auto!important;
  bottom:auto!important;
  width:272px!important;
  height:auto!important;
  max-height:min(340px,calc(100vh - 16px))!important;
  padding:8px!important;
  z-index:1200!important;
  overflow:auto!important;
  border:1px solid #b58b4f!important;
  border-radius:5px!important;
  background:linear-gradient(180deg,#0b0f12f7,#06090bf7)!important;
  box-shadow:0 12px 32px #000e,inset 0 0 0 1px #ffffff0d!important;
}
#allyHq #allyAdvisorConsole.skill-menu-open::before{
  content:'';
  position:absolute;
  left:-7px;
  top:24px;
  width:12px;
  height:12px;
  transform:rotate(45deg);
  background:#0a0e11;
  border-left:1px solid #b58b4f;
  border-bottom:1px solid #b58b4f;
}
#allyHq #allyAdvisorConsole.skill-menu-open .compact-skills{display:block!important;padding:0!important}
#allyHq #allyAdvisorConsole.skill-menu-open .notice{
  display:block!important;margin:0 0 7px!important;padding:6px 7px!important;
  font-size:12px!important;line-height:1.35!important;text-align:left!important;
  color:#f2e4ce!important;background:#16110ed9!important;border:1px solid #604a2e!important;
}
#allyHq #allyAdvisorConsole.skill-menu-open .compact-skill-grid{
  display:grid!important;grid-template-columns:1fr!important;gap:6px!important;margin:0!important;
}
#allyHq #allyAdvisorConsole.skill-menu-open .compact-skill-grid .skill{
  min-height:54px!important;height:auto!important;padding:7px 8px!important;text-align:left!important;
}
#allyHq #allyAdvisorConsole.skill-menu-open .compact-skill-grid .skill b{font-size:14px!important;line-height:1.15!important}
#allyHq #allyAdvisorConsole.skill-menu-open .compact-skill-grid .skill span{display:block!important;margin-top:3px!important;font-size:10px!important;line-height:1.25!important}
#allyHq #allyAdvisorConsole.skill-menu-open #upgradeAdvisorBtn{
  grid-column:1!important;min-height:34px!important;height:auto!important;padding:6px 8px!important;font-size:11px!important;
}
#allyHq #allyAdvisorConsole.skill-menu-open .advisor-mirror{display:none!important}
#allyHq.advisor-menu-open{overflow:visible!important}

@media (max-width:850px){
  #allyHq #allyAdvisorConsole.skill-menu-open{width:min(252px,calc(100vw - 16px))!important;max-height:300px!important}
}


/* ================================================================
   v29 — strategist popover layering / fixed hand size / taller lanes
   ================================================================ */

/* The strategist console is portaled to <body> by JS. It therefore cannot be
   clipped by the HQ, battlefield, or right-hand panel stacking contexts. */
#allyAdvisorConsole{display:none!important}
#allyAdvisorConsole.skill-menu-open{
  display:block!important;
  position:fixed!important;
  left:var(--advisor-pop-left,50%)!important;
  top:var(--advisor-pop-top,50%)!important;
  right:auto!important;
  bottom:auto!important;
  width:272px!important;
  height:auto!important;
  max-height:min(360px,calc(100vh - 16px))!important;
  padding:8px!important;
  z-index:10000!important;
  overflow:auto!important;
  border:1px solid #b58b4f!important;
  border-radius:5px!important;
  background:linear-gradient(180deg,#0b0f12fc,#06090bfc)!important;
  box-shadow:0 14px 38px #000f,inset 0 0 0 1px #ffffff10!important;
}
#allyAdvisorConsole.skill-menu-open::before{
  content:'';position:absolute;left:-7px;top:24px;width:12px;height:12px;
  transform:rotate(45deg);background:#0a0e11;border-left:1px solid #b58b4f;border-bottom:1px solid #b58b4f;
}
#allyAdvisorConsole.skill-menu-open .compact-skills{display:block!important;padding:0!important}
#allyAdvisorConsole.skill-menu-open .notice{display:block!important;margin:0 0 7px!important;padding:6px 7px!important;font-size:12px!important;line-height:1.35!important;text-align:left!important;color:#f2e4ce!important;background:#16110ed9!important;border:1px solid #604a2e!important}
#allyAdvisorConsole.skill-menu-open .compact-skill-grid{display:grid!important;grid-template-columns:1fr!important;gap:6px!important;margin:0!important}
#allyAdvisorConsole.skill-menu-open .compact-skill-grid .skill{min-height:54px!important;height:auto!important;padding:7px 8px!important;text-align:left!important}
#allyAdvisorConsole.skill-menu-open .compact-skill-grid .skill b{font-size:14px!important;line-height:1.15!important}
#allyAdvisorConsole.skill-menu-open .compact-skill-grid .skill span{display:block!important;margin-top:3px!important;font-size:10px!important;line-height:1.25!important}
#allyAdvisorConsole.skill-menu-open #upgradeAdvisorBtn{grid-column:1!important;min-height:34px!important;height:auto!important;padding:6px 8px!important;font-size:11px!important}
#allyAdvisorConsole.skill-menu-open .advisor-mirror{display:none!important}

/* Remove the static strategist-skill explanation area from the allied HQ. */
#allyHq .hq-advisor-summary{display:none!important}

/* Every hand card uses an identical, non-stretching track. Shuffle/order changes
   can no longer alter individual card height. */
#hand.hand{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,185px)!important;
  grid-auto-rows:185px!important;
  align-items:stretch!important;
  align-content:start!important;
}
#hand.hand .card{
  width:100%!important;
  height:185px!important;
  min-height:185px!important;
  max-height:185px!important;
  box-sizing:border-box!important;
  grid-template-rows:36px 100px 49px!important;
}
#hand.hand .cimg{height:100px!important;min-height:100px!important;max-height:100px!important}
#hand.hand .cstats{min-height:49px!important;max-height:49px!important;overflow:hidden!important}
#hand.hand .ctext{display:none!important}

/* Battle rows are roughly 20% taller than v28's 86px target. Cards stretch to
   the full usable row height instead of floating with unused vertical space. */
@media (min-width:851px){
  .battlefield-layout>.board{
    grid-template-rows:112px repeat(3,minmax(103px,1fr)) 24px repeat(3,minmax(103px,1fr)) 120px!important;
    gap:3px!important;
  }
  .battlefield-layout .lane{
    min-height:103px!important;
    height:100%!important;
    padding:2px 5px!important;
    box-sizing:border-box!important;
  }
  .battlefield-layout .slots{
    height:100%!important;
    min-height:0!important;
    align-items:stretch!important;
  }
  .battlefield-layout .slot{
    height:100%!important;
    min-height:98px!important;
    max-height:none!important;
    align-self:stretch!important;
    box-sizing:border-box!important;
  }
  .battlefield-layout .unit{
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    align-self:stretch!important;
    grid-template-rows:22px minmax(0,1fr) 21px!important;
  }
  .battlefield-layout .uimg{height:100%!important;min-height:0!important}
}

@media (max-width:850px){
  #allyAdvisorConsole.skill-menu-open{width:min(252px,calc(100vw - 16px))!important;max-height:320px!important}
  #hand.hand{grid-template-rows:repeat(2,170px)!important;grid-auto-rows:170px!important}
  #hand.hand .card{height:170px!important;min-height:170px!important;max-height:170px!important;grid-template-rows:34px 92px 44px!important}
  #hand.hand .cimg{height:92px!important;min-height:92px!important;max-height:92px!important}
  #hand.hand .cstats{min-height:44px!important;max-height:44px!important}
}


/* ================================================================
   v30 — hand alignment / HQ icon HUD / freer image drag / start formation modal
   ================================================================ */
.ally-side-align-spacer,.ally-hand-align-spacer{flex:0 0 0;height:0;transition:flex-basis .18s ease,height .18s ease}
.reference-right{position:relative!important}
.right-hand-section{position:relative;z-index:1}

.formation-modal-box{max-width:360px;width:min(92vw,360px);padding:18px 16px 16px}
.formation-modal-body{display:grid;gap:12px;margin-top:14px}
.formation-modal-field{display:grid;gap:6px;font-size:12px;color:#d6c8af}
.formation-modal-field select{width:100%;padding:10px 12px;font-size:15px}
.formation-modal-note{font-size:11px;line-height:1.5;color:#aeb7c6;background:#0a1322;border:1px solid #2f4262;border-radius:10px;padding:10px}

.hq-info-overlay{gap:8px!important}
.hq-stat-chip{display:inline-flex!important;align-items:center!important;gap:6px!important;padding:5px 10px!important;border-radius:999px!important}
.hq-stat-icon{display:inline-flex;align-items:center;justify-content:center;width:19px;height:19px;border-radius:999px;background:#00000044;font-size:12px;line-height:1;box-shadow:inset 0 0 0 1px #ffffff14}
.hq-stat-chip b,.hq-stat-chip .hq-stat-value{font-size:18px!important;line-height:1!important;font-weight:950!important;letter-spacing:.02em}
.battle-hq .hq-stat-chip{font-size:0!important}
.battle-hq .hq-stat-chip.skill .hq-stat-value{font-size:14px!important}
.battle-hq .hq-stat-chip.skill .hq-stat-icon{font-size:11px}

.battlefield-layout>.board{
  grid-template-rows:minmax(128px,1.08fr) repeat(3,minmax(112px,1fr)) 24px repeat(3,minmax(112px,1fr)) minmax(136px,1.12fr)!important;
  gap:6px!important;
}
.battlefield-layout .lane{padding:4px 6px!important}
.battlefield-layout .slots{height:100%!important;min-height:0!important;align-items:stretch!important}
.battlefield-layout .slot{
  width:100%!important;height:100%!important;min-height:92px!important;max-height:none!important;
}
.battlefield-layout .unit{height:100%!important;min-height:0!important;grid-template-rows:22px 1fr 22px!important}
.battlefield-layout .uimg{height:100%!important;min-height:0!important;font-size:26px!important}
.battlefield-layout .uname{font-size:12px!important}
.battlefield-layout .stats{font-size:11px!important}
.battlefield-layout .typeicon{font-size:11px!important}

@media (max-width:850px){
  .ally-hand-align-spacer{display:none!important}
  .hq-stat-chip b,.hq-stat-chip .hq-stat-value{font-size:15px!important}
}


/* ================================================================
   v32 — ally-side deck/hand alignment, large art, rarity frames, +30% lanes
   ================================================================ */
:root{
  --grade-s:#f6cc58;
  --grade-r:#dc72d5;
  --grade-u:#65cdef;
  --grade-c:#a9b2bd;
}

/* 위/촉/오 외 세력 및 공통 카드는 기타로 통합 */
.card.other,.unit.other,.base-unit.other{background:linear-gradient(180deg,#48433d,#211e1a)!important}
.default-art.card.other,.default-art.unit.other{background:radial-gradient(circle at 25% 20%,#ffffff35 0,#ffffff10 18%,transparent 20%),linear-gradient(180deg,#6a6259 0,#2b2722 100%)!important}

/* 카드 등급이 국가색보다 우선하도록 테두리를 등급별로 고정 */
.card.grade-border-S,.unit.grade-border-S,.base-unit.grade-border-S{border-color:var(--grade-s)!important;box-shadow:0 0 0 1px #5b4618,0 0 12px #f6cc5840!important}
.card.grade-border-R,.unit.grade-border-R,.base-unit.grade-border-R{border-color:var(--grade-r)!important;box-shadow:0 0 0 1px #51234c,0 0 10px #dc72d538!important}
.card.grade-border-U,.unit.grade-border-U,.base-unit.grade-border-U{border-color:var(--grade-u)!important;box-shadow:0 0 0 1px #1d5264,0 0 9px #65cdef32!important}
.card.grade-border-C,.unit.grade-border-C,.base-unit.grade-border-C{border-color:var(--grade-c)!important;box-shadow:0 0 0 1px #3c444e!important}
#hand.hand .card.selected{outline:2px solid #fff1a8!important;box-shadow:0 0 0 2px #604d1d,0 0 18px #ffe47b66!important}

/* 핸드: 이름 아래 능력문구 및 이미지 아래 국가명/아이콘 전용 줄 제거 */
#hand.hand .card-head-ability,#hand.hand .card-type-line{display:none!important}
#hand.hand .cname.card-title-area{height:auto!important;min-height:27px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:5px!important;padding:3px 5px!important}
#hand.hand .card-name-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px!important;font-weight:900!important}
#hand.hand .card-head-grade{position:static!important;flex:0 0 auto!important;font-size:8px!important;padding:1px 4px!important}
#hand.hand .cstats{display:flex!important;align-items:center!important;justify-content:center!important;padding:3px!important}
#hand.hand .card-stat-grid{width:100%!important}

/* 이미지 영역을 확대: 타입 아이콘은 이미지 위 오버레이로 유지 */
#hand.hand{grid-template-rows:repeat(2,198px)!important;grid-auto-rows:198px!important}
#hand.hand .card{
  height:198px!important;min-height:198px!important;max-height:198px!important;
  grid-template-rows:28px 128px 42px!important;
}
#hand.hand .cimg{height:128px!important;min-height:128px!important;max-height:128px!important}
#hand.hand .cimg img,#hand.hand .cimg .default-art{width:100%!important;height:100%!important}
#hand.hand .card-stat-cell{min-height:32px!important;padding:2px 1px!important}
#hand.hand .card-stat-cell b{font-size:13px!important}
#hand.hand .card.item .card-stat-cell b,#hand.hand .card.tactic .card-stat-cell b,#hand.hand .card.advisor-card-hand .card-stat-cell b{font-size:9px!important}
#hand.hand .card-stat-cell span{font-size:6px!important}

/* 아군 전투열 오른쪽에 덱/핸드가 붙도록 우측 패널의 상단 블록을 고정 크기로 사용 */
@media (min-width:851px){
  .reference-right{display:flex!important;flex-direction:column!important;height:1120px!important;min-height:1120px!important}
  .right-deck-section{flex:0 0 82px!important;min-height:82px!important}
  .right-hand-section{flex:0 0 446px!important;height:446px!important;min-height:446px!important;max-height:446px!important}
  .right-hand-section .handbox{height:100%!important;min-height:0!important;padding:4px!important}
  #hand.hand{height:100%!important;overflow:hidden!important;align-content:start!important;gap:5px!important}
  .ally-side-align-spacer{flex-shrink:0!important}

  /* v30 기준 전투열 높이에서 약 30% 확대 */
  body{padding-top:12px!important;padding-bottom:12px!important}
  .app{height:auto!important;min-height:0!important;align-items:start!important}
  .reference-left,.battle-panel,.reference-right{height:1120px!important;min-height:1120px!important}
  .boardwrap{height:1120px!important;overflow:auto!important}
  .battlefield-layout>.board{
    height:auto!important;
    grid-template-rows:minmax(136px,auto) repeat(3,146px) 26px repeat(3,146px) minmax(146px,auto)!important;
    gap:6px!important;
  }
  .battlefield-layout .lane{height:146px!important;min-height:146px!important;padding:4px 6px!important}
  .battlefield-layout .slot{height:100%!important;min-height:136px!important}
  .battlefield-layout .unit{grid-template-rows:24px minmax(0,1fr) 23px!important}
  .battlefield-layout .uimg{min-height:0!important;height:100%!important}
}

/* 카드 관리자: 프로젝트 폴더와 직접 연동 */
.manager-folder-sync{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:7px;border:1px solid #3b4d61;background:#081018}
.manager-folder-sync .btn{width:100%;min-height:30px!important;font-size:10px!important}
.manager-folder-sync span{grid-column:1/-1}
.manager-folder-hint{display:block;color:#7f93a8;font-size:9.5px;line-height:1.4;margin:2px 0 6px}
#managerProjectFolderStatus{display:block;font-size:9px;line-height:1.35;color:#9fb0c6;text-align:center;word-break:break-all}
#managerProjectFolderStatus.connected{color:#91d8a0}

@media (max-width:850px){
  #hand.hand{grid-template-rows:repeat(2,180px)!important;grid-auto-rows:180px!important}
  #hand.hand .card{height:180px!important;min-height:180px!important;max-height:180px!important;grid-template-rows:27px 112px 41px!important}
  #hand.hand .cimg{height:112px!important;min-height:112px!important;max-height:112px!important}
}


/* ================================================================
   v33 — unified battlefield + deck panel / no battle-deck scroll split
   ================================================================ */
@media (min-width:851px){
  html,body{height:100%!important;overflow:hidden!important;}
  body{padding:0!important;}

  /* 전투필드와 우측 덱/핸드 패널을 한 화면 안에 고정 */
  .app{
    height:100vh!important;
    min-height:0!important;
    padding:6px!important;
    gap:0!important;
    grid-template-columns:220px minmax(0,1fr) 344px!important;
    align-items:stretch!important;
  }
  .reference-left,.battle-panel,.reference-right{
    height:calc(100vh - 12px)!important;
    min-height:0!important;
    max-height:calc(100vh - 12px)!important;
  }

  /* 분할된 느낌을 줄이기 위해 중앙+우측 패널을 시각적으로 연결 */
  .battle-panel{
    border-top-right-radius:0!important;
    border-bottom-right-radius:0!important;
    border-right:none!important;
    overflow:hidden!important;
  }
  .reference-right{
    border-top-left-radius:0!important;
    border-bottom-left-radius:0!important;
    border-left:1px solid #5c3a19!important;
    overflow:hidden!important;
    background:#080c0d!important;
  }

  /* 상하 분리 스크롤 제거 */
  .boardwrap{
    flex:1 1 auto!important;
    height:auto!important;
    min-height:0!important;
    overflow:hidden!important;
    padding:0!important;
  }
  .battlefield-layout{height:100%!important;min-height:0!important;}
  .battlefield-layout>.board{
    height:100%!important;
    min-height:0!important;
    grid-template-rows:minmax(114px,1.04fr) repeat(3,minmax(98px,1fr)) 24px repeat(3,minmax(98px,1fr)) minmax(120px,1.06fr)!important;
    gap:5px!important;
  }
  .battlefield-layout .lane{height:auto!important;min-height:0!important;padding:3px 5px!important;}
  .battlefield-layout .slots{height:100%!important;min-height:0!important;gap:5px!important;align-items:stretch!important;}
  .battlefield-layout .slot{height:100%!important;min-height:90px!important;max-height:none!important;}
  .battlefield-layout .unit{height:100%!important;grid-template-rows:22px minmax(0,1fr) 22px!important;}
  .battlefield-layout .uimg{height:100%!important;min-height:0!important;}
  .battlefield-layout .uname{font-size:12px!important;padding:3px 5px!important;}
  .battlefield-layout .stats{font-size:11px!important;padding:3px!important;}
  .battlefield-layout .lane .label{font-size:12px!important;}
  .battle-hq,.hq.faction-fortress{height:100%!important;min-height:0!important;}

  /* 우측 덱/핸드도 단일 고정 레이아웃으로 배치 */
  .ally-side-align-spacer,.ally-hand-align-spacer{flex:0 0 0!important;height:0!important;}
  .right-deck-section{flex:0 0 92px!important;min-height:92px!important;max-height:92px!important;}
  .right-deck-body{gap:8px!important;padding:6px 8px!important;}
  .right-hand-section{
    flex:1 1 auto!important;
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
    overflow:hidden!important;
  }
  .right-hand-section .handbox{
    flex:1 1 auto!important;
    min-height:0!important;
    height:auto!important;
    padding:5px!important;
    overflow:hidden!important;
  }
  .right-hand-section .handhead{display:flex!important;min-height:24px!important;margin-bottom:4px!important;font-size:10px!important;}
  .right-hand-section .handhead .small{font-size:8px!important;line-height:1.3!important;}
  #hand.hand{
    height:100%!important;
    min-height:0!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:minmax(0,1fr)!important;
    gap:5px!important;
    overflow:hidden!important;
    padding:0!important;
  }
  #hand.hand .card{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    grid-template-rows:24px minmax(86px,1fr) 38px!important;
  }
  #hand.hand .cimg{height:auto!important;min-height:0!important;max-height:none!important;}
  #hand.hand .card-name-text{font-size:10px!important;}
  #hand.hand .card-stat-cell{min-height:28px!important;padding:1px!important;}
  #hand.hand .card-stat-cell b{font-size:12px!important;}

  /* 하단 HUD는 유지하되 높이를 줄여 전체 화면에 맞춤 */
  .bottom-hud{flex:0 0 auto!important;padding:4px 6px!important;}
  .hud-status{gap:6px!important;}
  .hud-block,.hud-hp,.hud-actions{min-height:0!important;}
}


/* ================================================================
   v34 — floating right hand panel, +20% battle lane height, no formation popup
   ================================================================ */
@media (min-width:851px){
  /* 전체 화면 분할 느낌을 줄이고, 우측은 카드 박스만 노출 */
  .app{
    grid-template-columns:220px minmax(0,1fr) 310px!important;
    gap:8px!important;
    height:100vh!important;
    padding:6px!important;
  }
  .battle-panel{
    border-top-right-radius:16px!important;
    border-bottom-right-radius:16px!important;
    border-right:1px solid var(--line)!important;
    overflow:hidden!important;
  }
  .reference-right{
    background:transparent!important;
    border:none!important;
    box-shadow:none!important;
    overflow:visible!important;
    padding:0!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
  }
  .right-action-strip{display:none!important;}
  .ally-side-align-spacer{flex:0 0 clamp(248px,31vh,292px)!important;height:auto!important;}
  .ally-hand-align-spacer{display:none!important;}
  .right-deck-section, .right-hand-section{
    border:1px solid #6c4520!important;
    box-shadow:0 8px 24px #0008,inset 0 0 0 1px #000!important;
    background:#080c0d!important;
  }
  .right-deck-section{
    flex:0 0 88px!important;
    min-height:88px!important;
    max-height:88px!important;
    border-bottom:none!important;
  }
  .right-hand-section{
    flex:0 0 398px!important;
    min-height:398px!important;
    max-height:398px!important;
    overflow:hidden!important;
  }
  .right-hand-section>.ornate-title{flex:0 0 30px!important;display:flex!important;}
  .right-hand-section .handbox{
    flex:1 1 auto!important;
    min-height:0!important;
    padding:4px 5px 5px!important;
    overflow:hidden!important;
    background:#080c0d!important;
  }
  .right-hand-section .handhead{display:none!important;}
  #hand.hand{
    height:100%!important;
    min-height:0!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:minmax(0,1fr)!important;
    gap:4px!important;
    overflow:hidden!important;
    padding:0!important;
  }
  #hand.hand .card{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    grid-template-rows:22px minmax(78px,1fr) 34px!important;
    border-width:1px!important;
  }
  #hand.hand .cimg{height:auto!important;min-height:0!important;max-height:none!important;}
  #hand.hand .card-name-text{font-size:10px!important;}
  #hand.hand .card-stat-cell{min-height:26px!important;padding:1px!important;}
  #hand.hand .card-stat-cell b{font-size:11px!important;}
  #hand.hand .card-stat-cell span{font-size:6px!important;}

  /* 전투열 높이 20% 확대 */
  .boardwrap{overflow:hidden!important;padding:0!important;}
  .battlefield-layout{height:100%!important;min-height:0!important;}
  .battlefield-layout>.board{
    height:100%!important;
    min-height:0!important;
    grid-template-rows:minmax(128px,1.05fr) repeat(3,minmax(118px,1fr)) 24px repeat(3,minmax(118px,1fr)) minmax(132px,1.08fr)!important;
    gap:5px!important;
  }
  .battlefield-layout .lane{min-height:118px!important;height:auto!important;padding:4px 6px!important;}
  .battlefield-layout .slots{min-height:0!important;height:100%!important;gap:6px!important;align-items:stretch!important;}
  .battlefield-layout .slot{min-height:108px!important;height:100%!important;max-height:none!important;}
  .battlefield-layout .unit{height:100%!important;grid-template-rows:23px minmax(0,1fr) 23px!important;}
  .battlefield-layout .uimg{height:100%!important;min-height:0!important;}
  .battlefield-layout .uname{font-size:12px!important;padding:3px 5px!important;}
  .battlefield-layout .stats{font-size:11px!important;padding:3px!important;}
  .battlefield-layout .lane .label{font-size:12px!important;}

  /* 좌측 진형 설정 패널은 유지하되 팝업 관련 안내는 제거 */
  .formation-modal-box,.formation-modal-body,.formation-modal-field,.formation-modal-note{display:none!important;}
}


/* ================================================================
   v35 — hidden-scroll battlefield, formation panel over deck, expanded item pool
   ================================================================ */
@media (min-width:851px){
  /* 전장 스크롤은 가능하지만 스크롤바는 보이지 않게 */
  .boardwrap{
    overflow:auto!important;
    scrollbar-width:none!important;
    -ms-overflow-style:none!important;
    overscroll-behavior:contain!important;
    touch-action:pan-y!important;
  }
  .boardwrap::-webkit-scrollbar{width:0!important;height:0!important;display:none!important;background:transparent!important;}

  /* 우측 패널에 전투진형 설정창을 덱 위로 이동 */
  .right-formation-mount{
    display:block!important;
    flex:0 0 auto!important;
    margin-bottom:6px!important;
  }
  .reference-right .compact-settings-holder{
    display:block!important;
    margin:0!important;
    border:1px solid #6c4520!important;
    border-radius:0!important;
    background:#080c0d!important;
    box-shadow:0 8px 24px #0008,inset 0 0 0 1px #000!important;
    padding:8px!important;
  }
  .reference-right .compact-settings-holder .ornate-title{margin-bottom:6px!important;}
  .reference-right .compact-settings-holder .formation-control{display:grid!important;gap:6px!important;font-size:11px!important;}
  .reference-right .compact-settings-holder select{width:100%!important;min-height:30px!important;}
  .reference-right .compact-settings-holder .formation-note{font-size:10px!important;line-height:1.35!important;}

  /* 본진이 안 보일 때 내부 스크롤로 상하 이동 가능하도록 전장 총높이 확보 */
  .battlefield-layout>.board{
    min-height:980px!important;
  }
}

@media (max-width:850px){
  .boardwrap{
    overflow:auto!important;
    scrollbar-width:none!important;
    -ms-overflow-style:none!important;
  }
  .boardwrap::-webkit-scrollbar{width:0!important;height:0!important;display:none!important;}
}


/* ================================================================
   v36 — card grade/cost on image corner, right deck HQ status row
   ================================================================ */
/* 우측 패널 본진 상태 바 */
.right-hq-summary{flex:0 0 auto;display:block;background:#080c0d;border:1px solid #6c4520;box-shadow:0 8px 24px #0008,inset 0 0 0 1px #000;margin-bottom:6px}
.right-hq-line{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:6px}
.right-hq-stat{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 4px;border:1px solid #6b5131;background:linear-gradient(180deg,#1c1711,#0d0b08);color:#eadfc8;text-align:center}
.right-hq-stat span{font-size:10px;color:#c8b89d;font-weight:700;letter-spacing:.02em}
.right-hq-stat b{font-size:16px;color:#fff3d8;line-height:1;font-weight:950}
.right-hq-stat.hp b{color:#ffe4df}.right-hq-stat.mp b{color:#d8eeff}.right-hq-stat.ap b{color:#fff0b3}

/* 핸드 카드: 등급/소환에너지를 이미지 우측 하단으로 이동 */
#hand.hand .cname.card-title-area{justify-content:flex-start!important;padding-right:6px!important}
#hand.hand .card-corner-meta{position:absolute;right:5px;bottom:5px;z-index:9;display:flex;flex-direction:column;align-items:flex-end;gap:4px}
#hand.hand .card-image-grade{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:16px;padding:0 5px;border-radius:999px;border:1px solid #f3d48e;background:linear-gradient(180deg,#3b2a18,#171008);box-shadow:0 2px 6px #000c;color:#fff6e3;font-size:9px;font-weight:1000;line-height:1}
#hand.hand .card-image-grade.grade-S{border-color:var(--grade-s);color:#fff4c8;background:linear-gradient(180deg,#574316,#241906)}
#hand.hand .card-image-grade.grade-R{border-color:var(--grade-r);color:#ffe6fe;background:linear-gradient(180deg,#4a2147,#1e0f1c)}
#hand.hand .card-image-grade.grade-U{border-color:var(--grade-u);color:#e3fbff;background:linear-gradient(180deg,#153849,#091b23)}
#hand.hand .card-image-grade.grade-C{border-color:var(--grade-c);color:#eef2f6;background:linear-gradient(180deg,#29313a,#11161b)}
#hand.hand .card-image-cost{position:static!important;right:auto!important;top:auto!important;z-index:auto!important;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:radial-gradient(circle at 35% 30%,#f9dd83,#b57918 68%,#5a3307);border:2px solid #ffe9a5;box-shadow:0 2px 7px #000c,inset 0 0 0 1px #6b3b0a;color:#171005;font-size:13px;font-weight:1000;line-height:1}
#hand.hand .card-head-grade{display:none!important}

/* 우측 덱 정보: 보조 문구 최소화 */
.deck-info{justify-content:center!important}
.deck-info .deck-help{font-size:8px!important;line-height:1.2!important}

@media (min-width:851px){
  .right-deck-section{flex:0 0 96px!important;min-height:96px!important;max-height:96px!important}
  .right-deck-body{padding:5px 8px!important}
  .right-hq-stat b{font-size:15px!important}
}


/* ================================================================
   v37 — AP feedback above ally backline, full-height advisor slot, HQ overlay removal
   ================================================================ */
/* 행동력 차감 효과 위치: 아군 3열 상단 중앙 */
.ap-spend-feedback{
  position:fixed!important;
  left:50%;
  top:18%;
  transform:translate(-50%,-10px) scale(.96);
  z-index:1000;
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 14px;
  border:1px solid #d0a458;
  background:#090c0ff2;
  box-shadow:0 12px 35px #000d;
  color:#f2dfbe;
  opacity:0;
  pointer-events:none;
  transition:.18s ease;
}
.ap-spend-feedback.show{opacity:1;transform:translate(-50%,0) scale(1)}

/* 본진 내부 수치 표시는 삭제 */
.battle-hq .hq-info-overlay,
.battle-hq .hptxt{display:none!important;}

/* 본진 책사 박스를 여백 없이 가득 차게 */
.battle-hq .hq-advisor-slot{
  position:absolute!important;
  right:7px!important;
  top:29px!important;
  bottom:7px!important;
  height:auto!important;
  width:118px!important;
  min-height:0!important;
  padding:0!important;
  overflow:hidden!important;
  display:flex!important;
  align-items:stretch!important;
  justify-content:stretch!important;
  background:linear-gradient(180deg,#11191aee,#080c0dee)!important;
}
.battle-hq .hq-advisor-slot .advisor-empty,
.battle-hq .hq-advisor-slot .advisor-card.rich{
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  border-radius:0!important;
}
.battle-hq .hq-advisor-slot .advisor-empty{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  padding:4px!important;
  line-height:1.2!important;
}
.battle-hq .hq-advisor-slot .advisor-card.rich{grid-template-columns:46px 1fr!important;gap:4px!important;padding:3px!important;}
.battle-hq .hq-advisor-slot .advisor-portrait{width:46px!important;height:100%!important;max-height:none!important;border-radius:0!important;}
.battle-hq .hq-advisor-slot .advisor-copy{justify-content:center!important;}

/* 우측 아군 덱 영역: 덱 수량/셔플/턴 종료 버튼 높이를 상태바와 통일 */
.right-hq-line{grid-template-columns:repeat(3,1fr)!important;gap:6px!important;padding:6px!important;}
.right-hq-stat{min-height:42px!important;height:42px!important;}
.right-deck-section{flex:0 0 96px!important;min-height:96px!important;max-height:96px!important;}
.right-deck-body{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;padding:6px!important;align-items:stretch!important;}
.right-deck-body .deck-stack{display:none!important;}
.right-deck-body .deck-info,
.right-deck-body #shuffleBtn,
.right-deck-body #endTurnBtn{
  min-width:0!important;
  min-height:42px!important;
  height:42px!important;
  margin:0!important;
  border:1px solid #6b5131!important;
  background:linear-gradient(180deg,#1c1711,#0d0b08)!important;
  box-shadow:none!important;
}
.right-deck-body .deck-info{
  grid-column:1!important;
  grid-row:1!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:1px!important;
  padding:4px!important;
  text-align:center!important;
}
.right-deck-body .deck-info b{font-size:18px!important;line-height:1!important;}
.right-deck-body .deck-help{display:none!important;}
.right-deck-body .deck-action-mount{display:contents!important;}
.right-deck-body #shuffleBtn{grid-column:2!important;grid-row:1!important;padding:4px 6px!important;font-size:12px!important;font-weight:900!important;}
.right-deck-body #endTurnBtn{grid-column:3!important;grid-row:1!important;padding:4px 6px!important;font-size:12px!important;font-weight:900!important;}

/* 본진 수치가 빠진 만큼 설명 영역 정리 */
.battle-hq .hq-subtitle{top:26px!important;}
.battle-hq .hq-advisor-summary{left:10px!important;right:132px!important;bottom:7px!important;min-height:32px!important;}


/* ================================================================
   v38 — raise right panel / show advisor name & level on slot header
   ================================================================ */
@media (min-width:851px){
  /* 우측 패널을 전체적으로 조금 더 위로 */
  .ally-side-align-spacer{flex:0 0 clamp(208px,26vh,248px)!important;height:auto!important;}
  .right-hq-summary{margin-bottom:4px!important;}
  .right-deck-section{margin-bottom:4px!important;}
  .right-hand-section{flex:0 0 404px!important;min-height:404px!important;max-height:404px!important;}
  .right-hand-section .handbox{padding:3px 4px 4px!important;}
}

/* 책사 배치 시 이름과 LV를 박스 상단 헤더에 표시 */
.battle-hq .hq-advisor-slot{position:absolute!important;overflow:hidden!important;}
.battle-hq .hq-advisor-slot .advisor-slot-badge{
  position:absolute;
  left:0; right:0; top:0;
  height:18px;
  z-index:12;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  padding:2px 5px;
  background:linear-gradient(180deg,#2d2011,#110c07);
  border-bottom:1px solid #a37a43;
  color:#f7e6c8;
  box-shadow:0 1px 4px #000a;
}
.battle-hq .hq-advisor-slot .advisor-slot-badge b{font-size:9px;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:900;}
.battle-hq .hq-advisor-slot .advisor-slot-badge span{font-size:8px;line-height:1;color:#ffe29d;font-weight:900;flex:0 0 auto;}
.battle-hq .hq-advisor-slot.has-portrait .advisor-card.rich{padding-top:20px!important;}
.battle-hq .hq-advisor-slot.has-portrait .advisor-portrait{height:calc(100% - 0px)!important;}
.battle-hq .hq-advisor-slot.has-portrait .advisor-copy b{display:none!important;}

/* 비어 있을 때는 헤더 없이 중앙 정렬 */
.battle-hq .hq-advisor-slot:not(.has-portrait) .advisor-empty{padding-top:4px!important;}


/* ================================================================
   v39 — ensure full hand visibility on right panel with bottom breathing room
   ================================================================ */
@media (min-width:851px){
  .reference-right{padding-bottom:12px!important;box-sizing:border-box!important;}
  .ally-side-align-spacer{flex:0 0 clamp(168px,22vh,210px)!important;height:auto!important;}
  .right-hq-summary{margin-bottom:4px!important;}
  .right-hq-line{padding:5px!important;gap:5px!important;}
  .right-hq-stat{min-height:40px!important;height:40px!important;}
  .right-hq-stat span{font-size:9px!important;}
  .right-hq-stat b{font-size:14px!important;}
  .right-deck-section{flex:0 0 92px!important;min-height:92px!important;max-height:92px!important;margin-bottom:4px!important;}
  .right-deck-body{padding:5px!important;gap:5px!important;}
  .right-hand-section{flex:0 0 390px!important;min-height:390px!important;max-height:390px!important;overflow:hidden!important;}
  .right-hand-section>.ornate-title{flex:0 0 28px!important;}
  .right-hand-section .handbox{padding:3px 4px 10px!important;overflow:hidden!important;}
  #hand.hand{gap:4px!important;padding:0!important;}
  #hand.hand .card{grid-template-rows:20px minmax(72px,1fr) 32px!important;}
  #hand.hand .card-name-text{font-size:9px!important;}
  #hand.hand .card-stat-cell{min-height:24px!important;padding:1px!important;}
  #hand.hand .card-stat-cell b{font-size:10px!important;}
  #hand.hand .card-stat-cell span{font-size:6px!important;}
  #hand.hand .card-corner-meta{right:4px!important;bottom:4px!important;gap:3px!important;}
  #hand.hand .card-image-grade{min-width:20px!important;height:15px!important;font-size:8px!important;padding:0 4px!important;}
  #hand.hand .card-image-cost{width:22px!important;height:22px!important;font-size:12px!important;}
}


/* ================================================================
   v40 — popup-only utility descriptions / advisor grade system / auto image folders
   ================================================================ */
/* 아이템·스킬·책사 카드의 용도/상태 설명은 카드 앞면에서 제거하고 팝업에서만 제공 */
#hand.hand .card.utility-card{grid-template-rows:20px minmax(0,1fr)!important;}
#hand.hand .card.utility-card .cimg{height:100%!important;min-height:0!important;max-height:none!important;border-bottom:0!important;}
#hand.hand .card.utility-card .cstats,#hand.hand .card.utility-card .ctext{display:none!important;}
#hand.hand .card .ctext{display:none!important;}
#hand.hand .card.utility-card .card-type-badge{left:4px!important;bottom:4px!important;}

/* 폴더 자동 이미지도 기존 이미지 크기/위치 규칙을 그대로 사용 */
.card-art-img.auto-folder-art,.unit-art-img.auto-folder-art{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important;}

/* 책사 등급을 슬롯에서도 식별 */
.battle-hq .hq-advisor-slot .advisor-copy b{display:block!important;}
.battle-hq .hq-advisor-slot .advisor-slot-badge span{min-width:34px;text-align:right;}


/* ================================================================
   v41 — taller battle rows / image-first field cards / hidden scroll / deck builder
   ================================================================ */
/* 소환 카드: 이름/등급을 이미지 위 오버레이로 표시 */
.battlefield-layout .unit{grid-template-rows:minmax(0,1fr) 23px!important;}
.battlefield-layout .uname{display:none!important;}
.battlefield-layout .uimg{position:relative!important;overflow:hidden!important;}
.battlefield-layout .unit-image-meta{position:absolute;left:4px;right:4px;top:4px;z-index:8;display:flex;align-items:center;justify-content:space-between;gap:4px;padding:2px 4px;background:linear-gradient(180deg,#05080dcc,#05080d80);border-bottom:1px solid #ffffff24;pointer-events:none;}
.battlefield-layout .unit-image-meta .field-unit-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:950;color:#fff7e8;text-shadow:0 1px 4px #000;}
.battlefield-layout .unit-image-meta .field-grade{flex:0 0 auto;min-width:20px;height:16px;font-size:9px;}
/* 전투열 이미지는 얼굴/상단을 우선 */
.battlefield-layout .unit-art-img{object-fit:cover!important;object-position:var(--img-x,50%) var(--img-y,50%)!important;transform-origin:var(--img-x,50%) var(--img-y,50%)!important;}
.battlefield-layout .unit-art-img.auto-folder-art{object-position:var(--img-x,50%) var(--img-y,50%)!important;}

/* 소환 에너지 원: 단선 테두리 */
#hand.hand .card-image-cost{border:1px solid #ffe9a5!important;box-shadow:0 2px 6px #000b!important;}

/* 우측 패널/핸드: 스크롤 가능, 스크롤바 숨김 */
.reference-right,.right-hand-section,.right-hand-section .handbox,#hand.hand{scrollbar-width:none!important;-ms-overflow-style:none!important;}
.reference-right::-webkit-scrollbar,.right-hand-section::-webkit-scrollbar,.right-hand-section .handbox::-webkit-scrollbar,#hand.hand::-webkit-scrollbar{width:0!important;height:0!important;display:none!important;}
@media (min-width:851px){
  .reference-right{overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;}
  .right-hand-section{overflow-y:auto!important;overflow-x:hidden!important;}
  .right-hand-section .handbox{overflow-y:auto!important;overflow-x:hidden!important;}
  #hand.hand{overflow-y:auto!important;overflow-x:hidden!important;align-content:start!important;grid-template-rows:repeat(2,minmax(176px,1fr))!important;grid-auto-rows:minmax(176px,1fr)!important;}

  /* 기존 대비 약 20% 높인 전투열. 중앙 전장은 숨김 스크롤로 탐색 */
  .battlefield-layout>.board{height:auto!important;min-height:1220px!important;grid-template-rows:156px repeat(3,142px) 28px repeat(3,142px) 162px!important;gap:6px!important;}
  .battlefield-layout .lane{height:142px!important;min-height:142px!important;padding:4px 6px!important;}
  .battlefield-layout .slot{height:100%!important;min-height:132px!important;max-height:none!important;}
}

/* 전투 시작 전 설정 잠금/해제 */
.formation-start-btn{width:100%;margin-top:4px;min-height:32px!important;font-weight:900;}
body.prebattle .board,body.prebattle .right-hand-section,body.prebattle .right-deck-body{filter:saturate(.78) brightness(.82);}
body.prebattle .board,body.prebattle .right-hand-section,body.prebattle .right-deck-body{pointer-events:none;}
#allyFormationSelect:disabled{opacity:.6;cursor:not-allowed;}

/* 덱 구성 버튼 */
.deck-title-tools{display:flex;align-items:center;gap:6px;}
.deck-builder-open{border:1px solid #9c7642;background:#17110b;color:#f1d8aa;font-size:9px;font-weight:900;padding:2px 7px;cursor:pointer;}
.deck-builder-open:hover{background:#2a1c0f;}
.deck-builder-box{width:min(1050px,96vw)!important;max-height:92vh!important;padding:0!important;overflow:hidden!important;display:flex;flex-direction:column;}
.deck-builder-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid #5c4328;background:#0a0d0f;}
.deck-builder-head h2{margin:0 0 3px;font-size:18px;color:#f0d5a3;}
.deck-builder-toolbar{display:grid;grid-template-columns:120px 120px minmax(180px,1fr) 90px;gap:8px;padding:10px 12px;border-bottom:1px solid #40301f;background:#0d1115;align-items:end;}
.deck-builder-toolbar label{display:grid;gap:4px;font-size:9px;color:#cdbb9e;}
.deck-builder-toolbar select,.deck-builder-toolbar input{min-height:32px;padding:5px 7px;background:#111925;color:#e8edf5;border:1px solid #45556e;}
.deck-builder-count{height:32px;display:flex;align-items:center;justify-content:center;border:1px solid #8c6837;background:#17120d;color:#e7d2ac;font-size:12px;}.deck-builder-count b{font-size:18px;color:#ffdd91;margin-right:4px;}
.deck-builder-main{flex:1;min-height:0;display:grid;grid-template-columns:1.15fr .85fr;gap:8px;padding:10px 12px;background:#070a0d;}
.deck-builder-pane{min-height:0;display:flex;flex-direction:column;border:1px solid #49351f;background:#0b0f13;}
.deck-builder-pane-title{flex:0 0 30px;display:flex;align-items:center;padding:0 9px;border-bottom:1px solid #49351f;color:#e6cfaa;font-size:11px;font-weight:900;}
.deck-builder-list{flex:1;min-height:0;overflow:auto;padding:6px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;align-content:start;scrollbar-width:none;}.deck-builder-list::-webkit-scrollbar{display:none;}
.deck-builder-list.selected{grid-template-columns:1fr;}
.deck-builder-card{min-width:0;display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:6px;padding:4px;border:1px solid #3c4858;background:#10161d;color:#e8edf2;text-align:left;cursor:pointer;}
.deck-builder-card.selected{grid-template-columns:minmax(0,1fr) auto;border-color:#654a2b;background:#14110d;}
.deck-builder-card:hover{border-color:#c59a57;background:#171e26;}
.deck-builder-thumb{width:38px;height:48px;display:block;overflow:hidden;background:#151719;}.deck-builder-thumb img,.deck-builder-thumb .default-art{width:100%;height:100%;object-fit:cover;}
.deck-builder-copy{min-width:0;display:flex;flex-direction:column;gap:2px;}.deck-builder-copy b{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.deck-builder-copy small{font-size:8px;color:#9faebe;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.deck-builder-owned{display:flex;align-items:center;gap:5px;font-size:9px;color:#c9b58e;}.deck-builder-owned em{font-style:normal;width:20px;height:20px;display:grid;place-items:center;border:1px solid #806039;color:#ffe1a3;font-size:14px;}
.deck-builder-empty{padding:16px;text-align:center;color:#84909d;font-size:10px;grid-column:1/-1;}
.deck-builder-summary{padding:8px 12px;border-top:1px solid #40301f;color:#bfae94;background:#0b0f13;font-size:10px;text-align:center;}
.deck-builder-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;padding:10px 12px;border-top:1px solid #49351f;background:#090c0f;}
@media(max-width:850px){.deck-builder-toolbar{grid-template-columns:1fr 1fr}.deck-builder-main{grid-template-columns:1fr}.deck-builder-list{max-height:260px}.deck-builder-actions{grid-template-columns:1fr}.deck-builder-box{max-height:94vh!important;overflow:auto!important;}}

/* ================================================================
   v42 — strategist combat / unit ability / equipment UI
   ================================================================ */
.unit-class-tag{
  position:absolute;right:4px;bottom:4px;z-index:7;
  padding:2px 5px;border:1px solid #ffffff55;background:#05080dcc;
  color:#f1eadf;font-size:8px;font-weight:900;line-height:1.1;
}
.battlefield-layout .unit .typeicon{left:4px!important;right:auto!important;}
.hq-image-manager{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
.hq-image-manager>.image-adjust-title{grid-column:1/-1!important;}
@media(max-width:1050px){.hq-image-manager{grid-template-columns:1fr!important;}.hq-image-manager>.image-adjust-title{grid-column:1!important;}}
.manager-field select:disabled,.manager-field input:disabled{opacity:.45;cursor:not-allowed;}


/* ================================================================
   v43 — 7-tier grades, general classes, item delta stats, 3x zoom
   ================================================================ */
:root{
  --grade-sss:#fff1a6;--grade-ss:#ff9f43;--grade-s:#f6cc58;--grade-rr:#ee86da;
  --grade-r:#b47cff;--grade-u:#65cdef;--grade-c:#a9b2bd;
}
.grade-SSS,.card-grade.grade-SSS{background:#66520e;color:#fff9cf;border-color:var(--grade-sss)}
.grade-SS,.card-grade.grade-SS{background:#713b0f;color:#fff0d7;border-color:var(--grade-ss)}
.grade-S,.card-grade.grade-S{background:#8a5b08;color:#fff3bd;border-color:var(--grade-s)}
.grade-RR,.card-grade.grade-RR{background:#762c68;color:#ffe0fa;border-color:var(--grade-rr)}
.grade-R,.card-grade.grade-R{background:#4b2a78;color:#efe3ff;border-color:var(--grade-r)}
.grade-U,.card-grade.grade-U{background:#205d72;color:#d9f7ff;border-color:var(--grade-u)}
.grade-C,.card-grade.grade-C{background:#3e4a59;color:#edf3fa;border-color:var(--grade-c)}
.card.grade-border-SSS,.unit.grade-border-SSS,.base-unit.grade-border-SSS{border-color:var(--grade-sss)!important;box-shadow:0 0 0 2px #9e7e17,0 0 18px #fff1a675!important}
.card.grade-border-SS,.unit.grade-border-SS,.base-unit.grade-border-SS{border-color:var(--grade-ss)!important;box-shadow:0 0 0 1px #754313,0 0 15px #ff9f435a!important}
.card.grade-border-S,.unit.grade-border-S,.base-unit.grade-border-S{border-color:var(--grade-s)!important;box-shadow:0 0 0 1px #5b4618,0 0 12px #f6cc5840!important}
.card.grade-border-RR,.unit.grade-border-RR,.base-unit.grade-border-RR{border-color:var(--grade-rr)!important;box-shadow:0 0 0 1px #59224e,0 0 11px #ee86da48!important}
.card.grade-border-R,.unit.grade-border-R,.base-unit.grade-border-R{border-color:var(--grade-r)!important;box-shadow:0 0 0 1px #3f285e,0 0 10px #b47cff44!important}
.card.grade-border-U,.unit.grade-border-U,.base-unit.grade-border-U{border-color:var(--grade-u)!important;box-shadow:0 0 0 1px #1d5264,0 0 9px #65cdef32!important}
.card.grade-border-C,.unit.grade-border-C,.base-unit.grade-border-C{border-color:var(--grade-c)!important;box-shadow:0 0 0 1px #3c444e!important}
#hand.hand .card-image-grade.grade-SSS{border-color:var(--grade-sss);color:#fffbd7;background:linear-gradient(180deg,#776112,#251b04)}
#hand.hand .card-image-grade.grade-SS{border-color:var(--grade-ss);color:#fff0d7;background:linear-gradient(180deg,#704114,#241306)}
#hand.hand .card-image-grade.grade-S{border-color:var(--grade-s);color:#fff4c8;background:linear-gradient(180deg,#574316,#241906)}
#hand.hand .card-image-grade.grade-RR{border-color:var(--grade-rr);color:#ffe5fb;background:linear-gradient(180deg,#5a2250,#20101d)}
#hand.hand .card-image-grade.grade-R{border-color:var(--grade-r);color:#f0e7ff;background:linear-gradient(180deg,#44286b,#171022)}
#hand.hand .card-image-grade.grade-U{border-color:var(--grade-u);color:#e3fbff;background:linear-gradient(180deg,#153849,#091b23)}
#hand.hand .card-image-grade.grade-C{border-color:var(--grade-c);color:#eef2f6;background:linear-gradient(180deg,#29313a,#11161b)}

/* 본진 책략가 슬롯은 빈 상태에서 굵은 테두리와 지정 문구만 표시 */
.advisor:not(.has-portrait){border:4px solid #d8e1ec!important;background:#0b1422d9!important;box-shadow:inset 0 0 0 1px #25344b,0 5px 14px #0007!important}
.advisor:not(.has-portrait) .advisor-empty{font-size:12px!important;font-weight:950!important;color:#f1f5fb!important;letter-spacing:.03em;line-height:1.2!important}
.advisor:not(.has-portrait) .mana{display:none!important}

/* 장수형/병종 표기 */
.unit-class-tag.general-class{background:#19120de8;border-color:#e3bd78;color:#ffe8b6;max-width:70px}

/* 장착 아이템 증가 수치는 기존 공격/방어/체력 위치에 바로 표시 */
.equip-stat-bonus{font-style:normal;font-size:.78em;font-weight:1000;color:#8ff0a4;margin-left:1px;text-shadow:0 1px 2px #000}
.stats .equip-stat-bonus,.base-unit-stat .equip-stat-bonus{display:inline}

/* 카드 이름 클릭 → 이미지 확대 */
.zoomable-card-name{cursor:zoom-in!important;text-decoration:none;transition:.12s ease}
.zoomable-card-name:hover{text-decoration:underline;text-underline-offset:2px;filter:brightness(1.18)}
.card-image-zoom-modal{align-items:center;justify-content:center;padding:20px;overflow:auto}
.card-image-zoom-box{max-width:none;min-width:320px;background:#0c1422;border:2px solid #8da4c5;border-radius:14px;padding:12px;box-shadow:0 24px 70px #000c}
.card-image-zoom-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:10px}
.card-image-zoom-head b{font-size:16px}
.card-image-zoom-scroll{max-width:88vw;max-height:78vh;overflow:auto;border:1px solid #2e405d;background:#050a11;padding:10px;display:grid;place-items:center}
.card-image-zoom-visual{flex:0 0 auto;overflow:hidden;border-radius:10px;background:#101a29;display:flex;align-items:center;justify-content:center}
.card-image-zoom-visual>img,.card-image-zoom-visual>.default-art{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important}
.card-image-zoom-note{margin-top:8px;text-align:center}

/* 진형 확장으로 5칸이 된 열 */
.slots.n5{grid-template-columns:repeat(5,minmax(82px,102px));gap:6px}
@media(max-width:850px){.slots.n5{grid-template-columns:repeat(5,94px)}}

.general-class-hand-badge{position:absolute;left:5px;bottom:5px;z-index:9;display:inline-flex;align-items:center;min-height:18px;padding:2px 6px;border:1px solid #e0bd7a;background:#17100bd9;color:#ffe8b4;border-radius:999px;font-size:8px;font-weight:950;box-shadow:0 2px 7px #000b}


/* v45: 아이템 능력치를 장수 카드와 동일한 3칸 위치에 표시 */
#hand.hand .card.item-stat-card{grid-template-rows:20px minmax(0,1fr) auto!important;}
#hand.hand .card.item-stat-card .card-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
#hand.hand .card.item-stat-card .card-stat-cell:last-child{grid-column:auto!important;}
#hand.hand .card.item-stat-card .card-stat-cell b{font-size:13px!important;white-space:nowrap!important;color:#fff2bd;}
#hand.hand .card.item-stat-card .card-stat-cell span{font-size:6px!important;white-space:nowrap!important;color:#d9c794;}
#hand.hand .card.item-stat-card .cstats{display:block!important;}
.equip-stat-bonus{white-space:nowrap;}
.roster-stats .equip-stat-bonus{font-size:.7em;}


/* ================================================================
   v46 — AP accumulation / strategist actions / class icons
   ================================================================ */
/* 전투열: v45의 142px 대비 약 20% 확대 */
@media (min-width:851px){
  .battlefield-layout>.board{min-height:1395px!important;grid-template-rows:156px repeat(3,170px) 28px repeat(3,170px) 162px!important;gap:6px!important;}
  .battlefield-layout .lane{height:170px!important;min-height:170px!important;padding:4px 6px!important;}
  .battlefield-layout .slot{height:100%!important;min-height:160px!important;max-height:none!important;}
}
/* 병종 텍스트는 제거하고 상징 아이콘만 표시 */
.unit-class-tag{display:none!important;}
.unit-class-icon{position:absolute;right:5px;bottom:5px;z-index:10;width:24px;height:24px;display:grid;place-items:center;border-radius:50%;border:1px solid #ffffff88;background:#05080de8;font-size:15px;line-height:1;box-shadow:0 2px 7px #000b;}
.unit-class-icon.general-class-icon{border-color:#e3bd78;background:#19120deb;}
/* 전장 카드 이름 클릭 확대가 실제로 동작하도록 오버레이 이벤트 허용 */
.battlefield-layout .unit-image-meta{pointer-events:auto!important;}
.battlefield-layout .unit-image-meta .field-unit-name{pointer-events:auto!important;cursor:zoom-in!important;}
.battlefield-layout .unit-image-meta .field-grade{pointer-events:none!important;}
.field-strategist{cursor:pointer;}
.field-strategist::after{content:'🧠';position:absolute;left:5px;bottom:31px;z-index:10;width:22px;height:22px;display:grid;place-items:center;border:1px solid #86bbff;background:#08182ee8;border-radius:50%;font-size:13px;box-shadow:0 2px 7px #000b;}
.field-strategist-menu{position:fixed;z-index:12000;width:min(280px,calc(100vw - 16px));max-height:calc(100vh - 16px);overflow:auto;display:none;padding:8px;border:1px solid #8aa9d3;border-radius:10px;background:#07101cf5;color:#edf5ff;box-shadow:0 18px 50px #000d;}
.field-strategist-menu.show{display:block;}
.field-strategist-head{display:flex;align-items:flex-end;justify-content:space-between;gap:8px;padding:4px 4px 8px;border-bottom:1px solid #405575;}
.field-strategist-head b{font-size:15px;color:#fff1c0;}.field-strategist-head span{font-size:9px;color:#9fb6d2;}
.field-strategist-actions{display:grid;gap:5px;padding-top:7px;}
.field-strategist-actions button{display:grid;gap:2px;text-align:left;padding:7px 8px;border:1px solid #415a7c;background:#111d2c;color:#eaf2fc;cursor:pointer;}
.field-strategist-actions button:hover:not(:disabled){border-color:#e0b966;background:#1b293a;}
.field-strategist-actions button:disabled{opacity:.55;cursor:not-allowed;}
.field-strategist-actions button b{font-size:11px;color:#ffe2a1;}.field-strategist-actions button span{font-size:8px;line-height:1.35;color:#b9c8da;}
.field-strategist-actions .field-passive{border-style:dashed;}
.ap-gain-feedback{border-color:#75d598!important;}
.ap-gain-feedback b{color:#91f0ad!important;}
@media(max-width:850px){
  .field-strategist-menu{left:8px!important;right:8px!important;top:auto!important;bottom:8px!important;width:auto!important;max-height:62vh;}
  .unit-class-icon{width:22px;height:22px;font-size:13px;}
}

.soldier-class-hand-icon{position:absolute;left:5px;bottom:5px;z-index:9;width:22px;height:22px;display:grid;place-items:center;border-radius:50%;border:1px solid #ffffff88;background:#05080de8;font-size:13px;box-shadow:0 2px 7px #000b;}
.base-soldier-class-icon{position:absolute;right:26px;bottom:3px;z-index:6;width:20px;height:20px;display:grid;place-items:center;border-radius:50%;border:1px solid #ffffff77;background:#05080de8;font-size:12px;}


/* 파일 입력 겹침 방지 */
.manager-preview-wrap input[type=file],
.hq-image-setting input[type=file]{
  position:absolute!important;
  width:1px!important;height:1px!important;
  padding:0!important;margin:-1px!important;border:0!important;
  overflow:hidden!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;
  white-space:nowrap!important;
}
.manager-preview-wrap .manager-upload-label,
.hq-image-setting .manager-upload-label,
.hq-image-setting .btn{
  width:100%;display:flex;align-items:center;justify-content:center;
  box-sizing:border-box;
}
.hq-image-setting{align-content:start}
.hq-image-preview{border-radius:6px}
.hq-image-manager{align-items:start}

/* ================================================================
   v48 — 40-card point deck / card shop / default image rules
   ================================================================ */
/* 카드 이름 확대 + 이름 오른쪽 등급 */
#hand.hand .cname.card-title-area{
  min-height:30px!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:5px!important;
  padding:4px 6px!important;
  justify-content:stretch!important;
}
#hand.hand .card-name-text{
  justify-self:start!important;
  max-width:100%!important;
  font-size:13px!important;
  line-height:1.1!important;
  font-weight:1000!important;
  text-align:left!important;
}
#hand.hand .card-title-grade,
.collection-card-title em{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:25px;
  height:18px;
  padding:0 5px;
  border:0;
  border-radius:4px;
  font-size:9px;
  font-style:normal;
  font-weight:1000;
  line-height:1;
  box-shadow:0 1px 4px #0009;
}
#hand.hand .card-corner-meta,#hand.hand .card-image-grade,#hand.hand .card-image-cost{display:none!important;}

/* 우측 하단: 테두리 없는 카드 종류 / 책략가 / 행동력 아이콘 */
#hand.hand .card-bottom-icons,
.battlefield-layout .unit-bottom-icons,
.collection-card-icons{
  position:absolute;
  right:5px;
  bottom:5px;
  z-index:12;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:4px;
  color:#fff8e8;
  font-weight:1000;
  line-height:1;
  text-shadow:0 2px 4px #000,0 0 5px #000;
  pointer-events:none;
}
#hand.hand .card-bottom-icons span,
.battlefield-layout .unit-bottom-icons span,
.collection-card-icons span{
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  padding:0!important;
  min-width:0!important;
  height:auto!important;
  border-radius:0!important;
  font-size:15px;
  white-space:nowrap;
}
#hand.hand .card-bottom-icons .card-ap-icon,
.battlefield-layout .unit-bottom-icons span:last-child,
.collection-card-icons span:last-child{font-size:13px;color:#ffe58c;letter-spacing:-.04em;}
#hand.hand .card-type-badge{display:none!important;}
#hand.hand .general-class-hand-badge,#hand.hand .soldier-class-hand-icon{left:5px!important;right:auto!important;bottom:5px!important;}
.battlefield-layout .unit-class-icon{left:5px!important;right:auto!important;bottom:5px!important;}
.battlefield-layout .typeicon{display:none!important;}
.battlefield-layout .unit-image-meta .field-unit-name{font-size:13px!important;}
.battlefield-layout .unit-image-meta .field-grade{border:0!important;font-size:9px!important;}
.field-strategist::after{display:none!important;}

/* 관리자: 미등록 카드 기본 이미지 */
.default-card-image-manager{display:grid;gap:7px;padding:9px;border:1px solid #536176;background:#0b1118;}
.default-image-note{font-size:8px;line-height:1.45;color:#aebbc9;}
.default-image-controls{display:grid;grid-template-columns:1fr 1fr;gap:6px;}
.default-image-controls label{display:grid;gap:3px;font-size:8px;color:#cbb998;}
.default-image-controls select{min-height:30px;padding:4px 6px;background:#111925;color:#e9eef5;border:1px solid #485a73;}
.default-image-preview{height:112px;display:grid;place-items:center;overflow:hidden;border:1px dashed #51647d;background:#070b10;color:#7f8c9c;font-size:9px;}
.default-image-preview img{width:100%;height:100%;display:block;object-fit:cover;}
.default-card-image-manager input[type=file]{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;border:0!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;}

/* 덱 구성: 이미지 카드 그리드 + 점수 */
.deck-builder-toolbar{grid-template-columns:115px 115px minmax(150px,1fr) 92px 112px!important;}
.deck-builder-score{height:32px;display:flex;align-items:center;justify-content:center;border:1px solid #4a7a5a;background:#0d1711;color:#cfe8d5;font-size:10px;}
.deck-builder-score b{font-size:17px;color:#99edaa;margin-right:4px;}
.deck-builder-score.over{border-color:#a84b45;background:#21100f;color:#ffb8b3;}
.deck-builder-score.over b{color:#ff766f;}
.deck-builder-list{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:7px!important;padding:8px!important;}
.deck-builder-list.selected{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
.deck-builder-visual-card,.shop-card{
  position:relative;
  min-width:0;
  overflow:hidden;
  display:grid;
  grid-template-rows:30px minmax(118px,1fr) 28px;
  padding:0;
  border:2px solid #4a5665;
  background:#0c1219;
  color:#eaf0f6;
  text-align:left;
}
button.deck-builder-visual-card{cursor:pointer;}
button.deck-builder-visual-card:hover{filter:brightness(1.12);transform:translateY(-1px);}
.deck-builder-visual-card.selected{background:#15110d;}
.collection-card-title{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px;padding:4px 5px;background:linear-gradient(180deg,#302117,#17100b);border-bottom:1px solid #61492e;}
.collection-card-title b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:1000;color:#fff3dc;}
.collection-card-art{position:relative;min-height:0;display:block;overflow:hidden;background:#101722;}
.collection-card-art>img,.collection-card-art>.default-art{width:100%!important;height:100%!important;display:block!important;object-fit:cover!important;}
.collection-card-foot{min-width:0;display:flex;align-items:center;justify-content:space-between;gap:4px;padding:4px 5px;background:#0b1016;border-top:1px solid #354253;}
.collection-card-foot small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:7px;color:#9eafc0;}
.collection-card-foot strong{flex:0 0 auto;font-size:10px;color:#ffe0a1;}
.deck-builder-summary .score-over{color:#ff7972;}.deck-builder-summary .score-ok{color:#8fe0a0;}

/* 카드 상점 */
.card-shop-box{width:min(1180px,97vw)!important;max-height:94vh!important;padding:0!important;overflow:hidden!important;display:flex;flex-direction:column;}
.card-shop-head,.game-settings-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid #5c4328;background:#0a0d0f;}
.card-shop-head h2,.game-settings-head h2{margin:0 0 3px;font-size:19px;color:#f0d5a3;}
.card-shop-toolbar{display:grid;grid-template-columns:130px 130px minmax(180px,1fr) 90px;gap:8px;padding:10px 12px;border-bottom:1px solid #40301f;background:#0d1115;align-items:end;}
.card-shop-toolbar label{display:grid;gap:4px;font-size:9px;color:#cdbb9e;}
.card-shop-toolbar select,.card-shop-toolbar input{min-height:32px;padding:5px 7px;background:#111925;color:#e8edf5;border:1px solid #45556e;}
.card-shop-count{height:32px;display:flex;align-items:center;justify-content:center;border:1px solid #8c6837;background:#17120d;color:#e7d2ac;font-size:10px;}.card-shop-count b{font-size:17px;color:#ffdd91;margin-right:3px;}
.card-shop-grid{flex:1;min-height:0;overflow:auto;display:grid;grid-template-columns:repeat(6,minmax(120px,1fr));gap:9px;padding:12px;background:#070a0d;align-content:start;scrollbar-width:none;}.card-shop-grid::-webkit-scrollbar{display:none;}
.shop-card{min-height:210px;cursor:zoom-in;}
.shop-card:hover{filter:brightness(1.12);transform:translateY(-2px);}

/* 게임 설정 */
.game-settings-box{width:min(660px,94vw)!important;padding:0!important;overflow:hidden!important;}
.deck-rule-form{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;padding:16px;background:#0b1016;}
.deck-rule-form label{display:grid;gap:5px;padding:9px;border:1px solid #3f4d60;background:#101823;color:#d3deea;font-size:10px;font-weight:800;}
.deck-rule-form input{min-width:0;height:34px;padding:5px 7px;background:#080d13;color:#fff1c7;border:1px solid #586a80;font-size:15px;font-weight:900;text-align:center;}
.deck-rule-form .deck-limit-field{grid-column:span 2;border-color:#9a7440;background:#17120d;}
.settings-note{padding:10px 16px;border-top:1px solid #3d4857;background:#090d12;color:#9eacba;font-size:9px;line-height:1.5;}
.game-settings-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:12px 16px;border-top:1px solid #49351f;background:#090c0f;}

/* 설정/상점 버튼이 좌측 메뉴 폭에 맞게 배치 */
.top-options{grid-template-columns:1fr 1fr!important;}
.top-options .checkline{grid-column:span 1;}
.top-options .btn{width:100%;min-width:0;}

@media(max-width:1000px){
  .card-shop-grid{grid-template-columns:repeat(4,minmax(110px,1fr));}
  .deck-builder-list{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  .deck-builder-list.selected{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media(max-width:850px){
  #hand.hand .card-name-text{font-size:11px!important;}
  .deck-builder-toolbar{grid-template-columns:1fr 1fr!important;}
  .deck-builder-score,.deck-builder-count{min-width:0;}
  .deck-builder-list,.deck-builder-list.selected{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-height:340px;}
  .card-shop-toolbar{grid-template-columns:1fr 1fr;}
  .card-shop-grid{grid-template-columns:repeat(2,minmax(120px,1fr));}
  .deck-rule-form{grid-template-columns:repeat(2,minmax(0,1fr));}
  .deck-rule-form .deck-limit-field{grid-column:span 2;}
  .default-image-controls{grid-template-columns:1fr;}
}
.game-settings-box{max-height:92vh!important;overflow:auto!important;}
.deck-builder-list{grid-auto-rows:176px!important;}
.deck-builder-visual-card{height:176px!important;min-height:176px!important;}


/* ================================================================
   v49 — special armies / uniform battlefield cards / larger hand
   ================================================================ */
/* 본진 지략가 슬롯: 카드 이미지만 표시하고 이름·Lv·MP는 한 줄 오버레이 */
.battle-hq .hq-advisor-slot.has-portrait{padding:0!important;background:#080d14!important;}
.battle-hq .hq-advisor-slot .advisor-image-only{position:relative!important;width:100%!important;height:100%!important;display:block!important;padding:0!important;overflow:hidden!important;}
.battle-hq .hq-advisor-slot .advisor-image-only .advisor-portrait{width:100%!important;height:100%!important;border:0!important;border-radius:0!important;background:#0a111b!important;overflow:hidden!important;}
.battle-hq .hq-advisor-slot .advisor-image-only .advisor-portrait>img,
.battle-hq .hq-advisor-slot .advisor-image-only .advisor-portrait>.default-art{width:100%!important;height:100%!important;display:block!important;object-fit:cover!important;object-position:center top!important;}
.battle-hq .hq-advisor-slot .advisor-image-only .advisor-slot-badge{height:20px!important;padding:2px 5px!important;background:linear-gradient(180deg,#080b10e8,#080b10c7)!important;border-bottom:1px solid #d5aa62!important;}
.battle-hq .hq-advisor-slot .advisor-image-only .advisor-slot-badge b{font-size:10px!important;}
.battle-hq .hq-advisor-slot .advisor-image-only .advisor-slot-badge span{font-size:9px!important;min-width:auto!important;}

/* 덱 점수 가독성 확대 */
.deck-builder-score{font-size:13px!important;font-weight:900!important;}
.deck-builder-score b{font-size:22px!important;}
.collection-card-foot small{font-size:10px!important;font-weight:850!important;color:#d3deea!important;}
.collection-card-foot strong{font-size:12px!important;}
.deck-builder-summary{font-size:13px!important;}
.deck-builder-summary b{font-size:16px!important;}

@media (min-width:851px){
  /* v48 실측 전장 457px → 약 548px(+20%), 핸드 310px → 372px(+20%) */
  .app{
    width:min(1168px,calc(100vw - 24px))!important;
    grid-template-columns:220px minmax(0,1fr) 372px!important;
  }
  /* v48 최종 핸드 390px → 429px(+10%) */
  .right-hand-section{flex-basis:429px!important;min-height:429px!important;max-height:429px!important;}
  /* 중앙 패널 자체를 확장했으므로 보드는 패널 폭을 정확히 사용 */
  .battlefield-layout>.board{width:100%!important;max-width:none!important;margin-left:0!important;margin-right:0!important;}
  /* 4·3·2칸 진형: 96/4 = 72/3 = 48/2로 카드 1장 폭을 동일화 */
  .battlefield-layout .slots.n4{width:96%!important;max-width:none!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  .battlefield-layout .slots.n3{width:72%!important;max-width:none!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  .battlefield-layout .slots.n2{width:48%!important;max-width:none!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}

/* 전투필드 장수·지략가 클릭 기술 팝업 가독성 */
.field-strategist-menu{width:min(310px,calc(100vw - 16px))!important;}
.field-strategist-head b{font-size:16px!important;}
.field-strategist-actions button b{font-size:12px!important;}
.field-strategist-actions button span{font-size:10px!important;}


/* ================================================================
   v53 — ally HQ moved above right-side HP/MP/AP and HUD spacing polish
   ================================================================ */
@media (min-width:851px){
  /* 중앙 전투필드에서는 하단 아군 본진 행을 제거한 8행 구조를 사용한다. */
  .battlefield-layout>.board{
    grid-template-rows:156px repeat(3,170px) 28px repeat(3,170px)!important;
    min-height:1238px!important;
  }

  /* 아군 본진을 우측 체력·MP·행동력 상태 박스 바로 위에 배치한다. */
  .reference-right .right-panel-hq-row{
    order:0!important;
    flex:0 0 104px!important;
    width:100%!important;
    height:104px!important;
    min-height:104px!important;
    padding:0!important;
    margin:0 0 4px!important;
    align-items:stretch!important;
    box-sizing:border-box!important;
  }
  .reference-right .right-panel-hq-row .battle-hq{
    width:100%!important;
    height:104px!important;
    min-height:104px!important;
    max-height:104px!important;
    margin:0!important;
    border-left:0!important;
    border-right:0!important;
    box-sizing:border-box!important;
  }

  /* 우측 HUD의 박스 간격과 내부 여백을 4px/5px 기준으로 통일한다. */
  .reference-right{padding-bottom:4px!important;}
  .right-formation-mount,
  .reference-right .right-panel-hq-row,
  .right-hq-summary,
  .right-deck-section{
    margin-bottom:4px!important;
  }
  .right-hand-section{
    margin:0!important;
    border:1px solid #6c4520!important;
    box-sizing:border-box!important;
  }
  .right-hand-section>.ornate-title{
    height:28px!important;
    min-height:28px!important;
    flex:0 0 28px!important;
  }
  .right-hand-section .handbox{
    padding:5px!important;
    margin:0!important;
    box-sizing:border-box!important;
  }

  /* '40 장', '셔플', '턴 종료'의 글자 크기와 행 높이를 동일하게 한다. */
  .right-deck-body .deck-info b,
  .right-deck-body #shuffleBtn,
  .right-deck-body #endTurnBtn{
    font-size:13px!important;
    line-height:1!important;
    font-weight:900!important;
    letter-spacing:0!important;
  }
  .right-deck-body .deck-info,
  .right-deck-body #shuffleBtn,
  .right-deck-body #endTurnBtn{
    height:40px!important;
    min-height:40px!important;
    padding:4px 6px!important;
    box-sizing:border-box!important;
  }
}

@media (max-width:850px){
  /* 모바일에서도 이동된 아군 본진이 상태 박스 바로 위에 자연스럽게 표시된다. */
  .reference-right .right-panel-hq-row{
    width:100%!important;
    min-height:104px!important;
    padding:0!important;
    margin:0 0 4px!important;
  }
  .reference-right .right-panel-hq-row .battle-hq{
    width:100%!important;
    height:104px!important;
    min-height:104px!important;
  }
}


/* v54 layout updates */
.formation-control{display:grid;gap:6px;padding:8px;border:1px solid #4d3b27;background:#0b0e10;border-radius:7px}
.formation-control>span{font-size:11px;color:#d8c8ae;font-weight:800;text-align:left}
.formation-inline{display:flex;align-items:center;gap:8px;justify-content:flex-start}
.formation-inline #allyFormationSelect{width:118px!important;min-width:118px!important;max-width:118px!important;flex:0 0 118px!important;font-size:12px!important}
.formation-inline .formation-start-btn{flex:0 0 auto;width:auto!important;min-width:98px!important;margin-top:0!important;padding:0 14px!important;white-space:nowrap}
.reference-right .compact-settings-holder .formation-inline{display:flex!important;align-items:center!important;gap:8px!important}
.reference-right .compact-settings-holder .formation-inline #allyFormationSelect{width:112px!important;min-width:112px!important;max-width:112px!important;flex:0 0 112px!important}
.reference-right .compact-settings-holder .formation-inline .formation-start-btn{width:auto!important;min-width:96px!important;margin-top:0!important}
.formation-note{display:none!important}
.right-hq-summary{display:none!important}
/* 본진 이미지 위 자연스러운 상태 표시 */
.battle-hq .hq-info-overlay{display:flex!important;position:absolute!important;left:12px!important;right:132px!important;top:44px!important;gap:10px!important;align-items:center!important;justify-content:flex-start!important;flex-wrap:wrap!important;pointer-events:none!important;z-index:8!important}
.battle-hq .hptxt{display:none!important}
.battle-hq .hq-stat-chip{display:inline-flex!important;align-items:center!important;gap:5px!important;padding:0!important;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;font-size:13px!important;font-weight:950!important;color:#fff7e8!important;text-shadow:0 2px 8px rgba(0,0,0,.95),0 0 12px rgba(0,0,0,.8)!important}
.battle-hq .hq-stat-chip .hq-stat-icon{font-size:12px!important;opacity:.98!important}
.battle-hq .hq-stat-chip b,.battle-hq .hq-stat-chip .hq-stat-value{font-size:16px!important;line-height:1!important;font-weight:950!important;color:inherit!important}
.battle-hq .hq-stat-chip.skill{display:none!important}
#enemyHq .hq-info-overlay{right:136px!important}
#allyHq .hq-info-overlay{right:136px!important}
@media (max-width: 1480px){
  .formation-inline #allyFormationSelect{width:108px!important;min-width:108px!important;max-width:108px!important;flex-basis:108px!important}
  .battle-hq .hq-info-overlay{left:10px!important;right:124px!important;top:40px!important;gap:8px!important}
  .battle-hq .hq-stat-chip{font-size:12px!important}
  .battle-hq .hq-stat-chip b,.battle-hq .hq-stat-chip .hq-stat-value{font-size:14px!important}
}


/* v56: 전투설정 우측 상단 재배치 + 아군 본진 높이 확대 */
.reference-right #rightFormationMount{
  order:-10!important;
  flex:0 0 auto!important;
  width:100%!important;
  min-height:0!important;
  margin:0 0 6px!important;
  display:block!important;
}
.reference-right #rightFormationMount .compact-settings-holder{
  display:block!important;
  width:100%!important;
  margin:0!important;
}
.reference-right .right-panel-hq-row{
  flex:0 0 136px!important;
  height:136px!important;
  min-height:136px!important;
  margin:0 0 6px!important;
}
.reference-right .right-panel-hq-row .battle-hq{
  height:136px!important;
  min-height:136px!important;
  max-height:136px!important;
}
.reference-right .right-panel-hq-row .battle-hq .hq-info-overlay{
  top:48px!important;
}
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot{
  top:33px!important;
  height:88px!important;
}
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-summary{
  bottom:9px!important;
}
@media (max-width:850px){
  .reference-right .right-panel-hq-row{
    flex-basis:124px!important;
    height:124px!important;
    min-height:124px!important;
  }
  .reference-right .right-panel-hq-row .battle-hq{
    height:124px!important;
    min-height:124px!important;
    max-height:124px!important;
  }
  .reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot{
    height:80px!important;
  }
}


/* v57: 덱 구성 버튼 이동 및 아군 본진 가변 높이 */
.reference-right #allySideAlignSpacer,
.reference-right #allyHandAlignSpacer{
  display:none!important;
  height:0!important;
  flex:0 0 0!important;
}
.reference-right #rightFormationMount{
  order:-10!important;
  flex:0 0 auto!important;
  margin:0 0 6px!important;
}
.reference-right .right-panel-hq-row{
  order:-9!important;
  flex:1 1 auto!important;
  height:auto!important;
  min-height:190px!important;
  max-height:none!important;
  margin:0 0 6px!important;
  align-items:stretch!important;
  overflow:hidden!important;
}
.reference-right .right-panel-hq-row .battle-hq{
  width:100%!important;
  height:100%!important;
  min-height:190px!important;
  max-height:none!important;
  flex:1 1 auto!important;
  margin:0!important;
}
.reference-right .right-deck-section{
  order:-8!important;
  flex:0 0 96px!important;
  min-height:96px!important;
  max-height:96px!important;
  margin:0 0 4px!important;
}
.reference-right .right-hand-section{order:-7!important;}
.reference-right .formation-inline{
  display:grid!important;
  grid-template-columns:minmax(92px,112px) minmax(88px,1fr) minmax(78px,1fr)!important;
  gap:6px!important;
  align-items:stretch!important;
}
.reference-right .formation-inline #allyFormationSelect{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  flex:none!important;
}
.reference-right .formation-inline .formation-start-btn,
.reference-right .formation-inline .formation-deck-btn{
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0 7px!important;
  min-height:32px!important;
  white-space:nowrap!important;
  font-size:11px!important;
  font-weight:900!important;
}
.reference-right .formation-inline .formation-deck-btn{
  border-color:#8b6b3c!important;
  background:linear-gradient(180deg,#2b2419,#17130e)!important;
  color:#f3dfb6!important;
}
.right-deck-section .deck-title-tools,
.right-deck-section .title-count{
  display:none!important;
}
@media (max-width:850px){
  .reference-right .right-panel-hq-row{
    flex:1 1 auto!important;
    height:auto!important;
    min-height:180px!important;
    max-height:none!important;
  }
  .reference-right .right-panel-hq-row .battle-hq{
    height:100%!important;
    min-height:180px!important;
    max-height:none!important;
  }
}

/* ================================================================
   v58 — 좌우 본진 대칭 배치, 전략가 슬롯, 상단 메뉴 간소화
   ================================================================ */
@media (min-width:851px){
  /* 좌우 패널 폭을 동일하게 맞춘다. */
  .app{
    width:min(1516px,calc(100vw - 24px))!important;
    grid-template-columns:372px minmax(520px,1fr) 372px!important;
  }
  .reference-left,.reference-right{min-width:0!important;width:auto!important;}

  /* 적 본진을 중앙 전장에서 제거했으므로 3+전선+3열 구조로 정리한다. */
  .battlefield-layout>.board{
    grid-template-rows:repeat(3,170px) 28px repeat(3,170px)!important;
    min-height:1048px!important;
  }

  /* 좌측 전투로그 자리에 적 본진을 배치하고 아군 본진과 동일 높이로 동기화한다. */
  .reference-left .enemy-hq-host{
    flex:0 0 auto!important;
    min-height:190px!important;
    margin:6px 0!important;
    padding:0!important;
    border:0!important;
    background:#080c0e!important;
    overflow:hidden!important;
  }
  .reference-left .enemy-hq-mount,
  .reference-left .enemy-hq-row{
    width:100%!important;
    height:100%!important;
    min-height:190px!important;
    padding:0!important;
    margin:0!important;
    box-sizing:border-box!important;
    align-items:stretch!important;
  }
  .reference-left .enemy-hq-row .battle-hq{
    width:100%!important;
    height:100%!important;
    min-height:190px!important;
    max-height:none!important;
    margin:0!important;
    border-left:0!important;
    border-right:0!important;
    box-sizing:border-box!important;
  }
}

.battle-log-hidden{display:none!important;}

/* 적 지략가 설명 박스와 행동 단계 배지를 완전히 제거한다. */
#castleEnemyAdvisorSummary,.battle-hq .hq-advisor-summary,#phaseBadge{display:none!important;}
.turn-plate{gap:0!important;}

/* 전략가 배치 슬롯: 일반 1px 테두리, 핸드 카드의 약 80% 크기. */
.battle-hq .hq-advisor-slot{
  width:94px!important;
  height:144px!important;
  min-width:94px!important;
  min-height:144px!important;
  max-width:94px!important;
  max-height:144px!important;
  right:12px!important;
  top:50%!important;
  bottom:auto!important;
  transform:translateY(-50%)!important;
  padding:0!important;
  border:1px solid #9b7844!important;
  border-radius:4px!important;
  box-shadow:none!important;
  overflow:hidden!important;
  background:#080d14!important;
  box-sizing:border-box!important;
}
.battle-hq .hq-advisor-slot .advisor-card,
.battle-hq .hq-advisor-slot .advisor-image-only,
.battle-hq .hq-advisor-slot .advisor-portrait{
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  overflow:hidden!important;
  background:#080d14!important;
}
.battle-hq .hq-advisor-slot .advisor-portrait>img,
.battle-hq .hq-advisor-slot .advisor-portrait>.default-art,
.battle-hq .hq-advisor-slot .advisor-portrait>svg{
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  object-position:center top!important;
}
.battle-hq .hq-advisor-slot .advisor-slot-badge{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:0!important;
  bottom:auto!important;
  height:22px!important;
  padding:2px 4px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  background:linear-gradient(180deg,#090d12ed,#090d12c9)!important;
  border:0!important;
  border-bottom:1px solid #9b7844!important;
  z-index:5!important;
  box-sizing:border-box!important;
}
.battle-hq .hq-advisor-slot .advisor-slot-badge b{font-size:9px!important;}
.battle-hq .hq-advisor-slot .advisor-slot-badge span{font-size:8px!important;}
.battle-hq .hq-advisor-slot .advisor-empty{
  display:grid!important;
  place-items:center!important;
  width:100%!important;
  height:100%!important;
  padding:8px!important;
  border:0!important;
  font-size:11px!important;
  line-height:1.35!important;
  text-align:center!important;
  color:#c7b18f!important;
  box-sizing:border-box!important;
}

/* 본진 수치가 전략가 카드와 겹치지 않도록 여백을 확보한다. */
.battle-hq .hq-info-overlay{
  right:118px!important;
  top:46px!important;
}

/* 상단 설정을 간소화하고 카드 상점/관리 버튼을 동일 크기로 좌우 배치한다. */
.reference-topbar{
  grid-template-columns:auto auto minmax(210px,260px) auto!important;
  align-items:center!important;
}
.simplified-top-control{display:flex!important;align-items:center!important;}
.top-card-actions{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:8px!important;
  width:100%!important;
  min-width:220px!important;
  align-items:stretch!important;
}
.top-card-actions .btn{
  width:100%!important;
  min-width:0!important;
  height:34px!important;
  min-height:34px!important;
  padding:5px 8px!important;
  font-size:11px!important;
  font-weight:900!important;
  box-sizing:border-box!important;
}

@media (max-width:850px){
  .battle-hq .hq-advisor-slot{
    width:84px!important;
    height:128px!important;
    min-width:84px!important;
    min-height:128px!important;
    max-width:84px!important;
    max-height:128px!important;
    right:8px!important;
  }
  .battle-hq .hq-info-overlay{right:100px!important;}
  .top-card-actions{min-width:0!important;grid-template-columns:1fr 1fr!important;}
}

/* v58 좌측 전투 메뉴 내부 상단바 정렬 보정 */
#leftMenuMount .reference-topbar{
  width:100%!important;
  margin:0!important;
  padding:6px!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  grid-template-rows:auto auto auto!important;
  gap:6px!important;
  box-sizing:border-box!important;
}
#leftMenuMount .simplified-top-control{
  grid-column:1!important;
  grid-row:1!important;
  display:flex!important;
}
#leftMenuMount .simplified-top-control .top-new{
  width:100%!important;
  height:30px!important;
  min-height:30px!important;
}
#leftMenuMount .turn-plate{
  grid-column:2!important;
  grid-row:1!important;
  min-height:30px!important;
  padding:2px 6px!important;
}
#leftMenuMount .turn-plate>div{
  display:block!important;
  font-size:12px!important;
  line-height:1!important;
}
#leftMenuMount .turn-plate b{font-size:20px!important;}
#leftMenuMount .top-card-actions{
  grid-column:1/3!important;
  grid-row:2!important;
  width:100%!important;
  min-width:0!important;
}
#leftMenuMount .faction-pickers{
  grid-column:1/3!important;
  grid-row:3!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:6px!important;
  width:100%!important;
}
#leftMenuMount .faction-pickers label{min-width:0!important;}


/* v59 전략가 배치 슬롯 미세조정: 핸드 카드의 약 80% 크기, 상하 동일 최소 여백 */
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot{
  width:96px!important;
  height:148px!important;
  min-width:96px!important;
  min-height:148px!important;
  max-width:96px!important;
  max-height:148px!important;
  right:10px!important;
  top:50%!important;
  bottom:auto!important;
  transform:translateY(-50%)!important;
  margin:0!important;
  display:flex!important;
  align-items:stretch!important;
  justify-content:stretch!important;
}
.reference-right .right-panel-hq-row .battle-hq .hq-info-overlay,
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-summary,
.reference-right .right-panel-hq-row .battle-hq .hq-unit-slot{
  right:118px!important;
}
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot .advisor-card,
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot .advisor-image-only,
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot .advisor-portrait,
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot .advisor-empty{
  width:100%!important;
  height:100%!important;
}
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot .advisor-empty{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  padding:8px 7px!important;
  font-size:11px!important;
  line-height:1.3!important;
}
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot .advisor-slot-badge{
  height:20px!important;
  padding:2px 5px!important;
}
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot .advisor-slot-badge b{
  font-size:10px!important;
}
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot .advisor-slot-badge span{
  font-size:8px!important;
}
@media (max-width:850px){
  .reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot{
    width:86px!important;
    height:132px!important;
    min-width:86px!important;
    min-height:132px!important;
    max-width:86px!important;
    max-height:132px!important;
    right:8px!important;
  }
  .reference-right .right-panel-hq-row .battle-hq .hq-info-overlay,
  .reference-right .right-panel-hq-row .battle-hq .hq-advisor-summary,
  .reference-right .right-panel-hq-row .battle-hq .hq-unit-slot{
    right:100px!important;
  }
}


/* v60: 전투 행동력, 전투 카드 폭, 양쪽 본진/책사 슬롯 대칭 보정 */
@media (min-width:851px){
  /* 기존 전투 카드 폭 대비 20% 축소. 4/3/2칸 진형 모두 카드 1장 폭은 동일하다. */
  .battlefield-layout .slots.n4{
    width:76.8%!important;
    max-width:none!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:6px!important;
  }
  .battlefield-layout .slots.n3{
    width:57.6%!important;
    max-width:none!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:6px!important;
  }
  .battlefield-layout .slots.n2{
    width:38.4%!important;
    max-width:none!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:6px!important;
  }

  /* 적군/아군 본진은 같은 폭·높이 규칙을 사용한다. */
  .reference-left .enemy-hq-host,
  .reference-left .enemy-hq-row,
  .reference-left .enemy-hq-row .battle-hq,
  .reference-right .right-panel-hq-row,
  .reference-right .right-panel-hq-row .battle-hq{
    min-height:190px!important;
    box-sizing:border-box!important;
  }
}

/* 적군 책사 박스를 아군 책사 박스와 완전히 동일하게 맞춘다. */
.reference-left .enemy-hq-row .battle-hq .hq-advisor-slot,
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot{
  width:96px!important;
  height:148px!important;
  min-width:96px!important;
  min-height:148px!important;
  max-width:96px!important;
  max-height:148px!important;
  right:10px!important;
  top:50%!important;
  bottom:auto!important;
  transform:translateY(-50%)!important;
  margin:0!important;
  padding:0!important;
  border:1px solid #9b7844!important;
  border-radius:4px!important;
  box-shadow:none!important;
  overflow:hidden!important;
  background:#080d14!important;
  box-sizing:border-box!important;
}
.reference-left .enemy-hq-row .battle-hq .hq-info-overlay,
.reference-left .enemy-hq-row .battle-hq .hq-unit-slot,
.reference-right .right-panel-hq-row .battle-hq .hq-info-overlay,
.reference-right .right-panel-hq-row .battle-hq .hq-unit-slot{
  right:118px!important;
}
.reference-left .enemy-hq-row .battle-hq .hq-advisor-slot .advisor-card,
.reference-left .enemy-hq-row .battle-hq .hq-advisor-slot .advisor-image-only,
.reference-left .enemy-hq-row .battle-hq .hq-advisor-slot .advisor-portrait,
.reference-left .enemy-hq-row .battle-hq .hq-advisor-slot .advisor-empty,
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot .advisor-card,
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot .advisor-image-only,
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot .advisor-portrait,
.reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot .advisor-empty{
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
}
@media (max-width:850px){
  .reference-left .enemy-hq-row .battle-hq .hq-advisor-slot,
  .reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot{
    width:86px!important;
    height:132px!important;
    min-width:86px!important;
    min-height:132px!important;
    max-width:86px!important;
    max-height:132px!important;
    right:8px!important;
  }
  .reference-left .enemy-hq-row .battle-hq .hq-info-overlay,
  .reference-left .enemy-hq-row .battle-hq .hq-unit-slot,
  .reference-right .right-panel-hq-row .battle-hq .hq-info-overlay,
  .reference-right .right-panel-hq-row .battle-hq .hq-unit-slot{
    right:100px!important;
  }
}


/* v61: 카드 상점 카드를 핸드 카드와 동일 크기로 표시 */
@media (min-width:851px){
  .card-shop-grid{
    grid-template-columns:repeat(auto-fill,118px)!important;
    grid-auto-rows:185px!important;
    justify-content:start!important;
    align-items:start!important;
    gap:9px!important;
  }
  .card-shop-grid .shop-card{
    width:118px!important;
    height:185px!important;
    min-width:118px!important;
    min-height:185px!important;
    max-width:118px!important;
    max-height:185px!important;
    grid-template-rows:22px minmax(0,1fr) 34px!important;
    box-sizing:border-box!important;
  }
  .card-shop-grid .collection-card-title{
    min-height:22px!important;
    padding:2px 4px!important;
  }
  .card-shop-grid .collection-card-title b{font-size:10px!important;}
  .card-shop-grid .collection-card-art{min-height:0!important;}
  .card-shop-grid .collection-card-foot{
    min-height:34px!important;
    padding:3px 4px!important;
  }
  .card-shop-grid .collection-card-foot small{font-size:7px!important;}
  .card-shop-grid .collection-card-foot strong{font-size:10px!important;}
}
@media (max-width:850px){
  .card-shop-grid{
    grid-template-columns:repeat(auto-fill,minmax(104px,1fr))!important;
    grid-auto-rows:170px!important;
    gap:7px!important;
  }
  .card-shop-grid .shop-card{
    width:100%!important;
    height:170px!important;
    min-height:170px!important;
    max-height:170px!important;
    grid-template-rows:21px minmax(0,1fr) 32px!important;
    box-sizing:border-box!important;
  }
}

/* v62: 전장 폭, 핸드 페이지, 규칙 모달, 연막 표시 */
@media (min-width:851px){
  .battle-panel .boardwrap{
    width:80%!important;
    max-width:80%!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  .battle-panel .battlefield-layout{
    width:100%!important;
    max-width:100%!important;
    margin:0 auto!important;
  }
}
.reference-left .enemy-hq-host,
.reference-left .enemy-hq-mount,
.reference-left .enemy-hq-row,
.reference-left .enemy-hq-row .battle-hq{
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
.hand-pager{
  flex:0 0 28px;
  min-height:28px;
  display:grid;
  grid-template-columns:34px 1fr 34px;
  align-items:center;
  gap:6px;
  margin:0 0 5px;
  padding:2px 4px;
  border:1px solid #5b4024;
  background:#0b0e10;
}
.hand-pager[hidden]{display:none!important;}
.hand-pager .btn{height:24px!important;min-height:24px!important;padding:0!important;font-size:18px!important;line-height:1!important;}
.hand-pager b{text-align:center;font-size:11px;color:#f0d7a7;}
.concealed-unit .stats{position:relative;overflow:hidden;background:linear-gradient(180deg,#1a2026,#0a0d10)!important;}
.concealed-unit .stats::before{content:'';position:absolute;inset:0;background:linear-gradient(110deg,transparent,#dbe8f02e,transparent);pointer-events:none;}
.concealed-unit .stats span{position:relative;color:#eef5fa!important;text-shadow:0 1px 5px #000;}
.smoke-buff{background:#dfe9ef!important;color:#15202a!important;border-color:#fff!important;}
.rules-box{width:min(980px,94vw)!important;max-height:88vh!important;overflow:auto!important;}
.rules-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid #76522c;}
.rules-head h2{margin:0 0 4px;}
.rules-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.rules-grid section{padding:11px 13px;border:1px solid #5a4127;background:linear-gradient(180deg,#101417,#090c0e);}
.rules-grid h3{margin:0 0 8px;color:#efca8c;font-size:14px;}
.rules-grid ul{margin:0;padding-left:18px;display:grid;gap:5px;}
.rules-grid li,.rules-grid dd{font-size:11px;line-height:1.5;color:#d6cbb9;}
.rules-grid dl{display:grid;grid-template-columns:82px 1fr;gap:5px 8px;margin:0;}
.rules-grid dt{font-size:11px;font-weight:900;color:#f1d6a6;}
.rules-grid dd{margin:0;}
.formation-start-btn.warn{background:linear-gradient(180deg,#6d241f,#39110f)!important;border-color:#b95d4e!important;color:#fff0e8!important;}
@media (max-width:850px){
  .rules-grid{grid-template-columns:1fr;}
  .rules-box{width:96vw!important;max-height:92vh!important;}
}


/* v64 UI 정렬, 규칙 가독성, 핸드 상태, 본진 턴 표시 */
/* 전투 메뉴에서 새로 하기와 기존 턴 박스는 사용하지 않는다. */
#restartBtn,.top-new,.turn-plate,.enemy-turn-badge{display:none!important;}
#leftMenuMount .reference-topbar{
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:auto auto!important;
  gap:6px!important;
  padding:6px!important;
}
#leftMenuMount .top-card-actions{
  grid-column:1!important;
  grid-row:1!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:7px!important;
  width:100%!important;
}
#leftMenuMount .top-card-actions .btn{
  width:100%!important;
  height:36px!important;
  min-height:36px!important;
  padding:6px 8px!important;
  font-size:12px!important;
  font-weight:900!important;
}
#leftMenuMount .faction-pickers{
  grid-column:1!important;
  grid-row:2!important;
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:7px!important;
  width:100%!important;
}

/* 적군 본진은 아군 본진과 동일한 실제 폭을 사용한다. */
.reference-left .enemy-hq-host,
.reference-left .enemy-hq-mount,
.reference-left .enemy-hq-row,
.reference-left .enemy-hq-row .battle-hq{
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  box-sizing:border-box!important;
}

/* 아군 전략가 슬롯 아래 현재 턴 표시 */
#allyHq .hq-advisor-slot{
  top:calc(50% - 12px)!important;
  transform:translateY(-50%)!important;
}
.ally-hq-turn{
  position:absolute;
  right:10px;
  top:calc(50% + 66px);
  width:96px;
  height:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  border:1px solid #8a6a3f;
  background:linear-gradient(180deg,#111820e8,#080c10e8);
  color:#dfceb0;
  font-size:10px;
  font-weight:900;
  box-sizing:border-box;
  z-index:12;
}
.ally-hq-turn b{font-size:13px;color:#ffe09d;line-height:1;}

/* 행동력이 충분한 핸드 카드 */
#hand.hand .card.affordable{
  border-color:#f7d77f!important;
  box-shadow:0 0 0 1px #fff1b9,0 0 13px #ffd56c88,inset 0 0 0 1px #6e501d!important;
}
#hand.hand .card.affordable:not(.selected)::after{
  content:'';
  position:absolute;
  inset:1px;
  border:1px solid #fff2ad66;
  pointer-events:none;
  z-index:15;
}

/* 덱 행동열 아래 내부 여백 제거, 외부 간격은 전투설정-본진 간격과 동일하게 6px */
.reference-right #rightFormationMount{margin-bottom:6px!important;}
.reference-right .right-panel-hq-row{margin-bottom:6px!important;}
.reference-right .right-deck-section{
  margin-bottom:6px!important;
  padding-bottom:0!important;
}
.reference-right .right-deck-body{
  padding-bottom:0!important;
  margin-bottom:0!important;
  align-items:stretch!important;
}
.reference-right .right-hand-section{margin-top:0!important;}
.reference-right #allyHandAlignSpacer{display:none!important;height:0!important;min-height:0!important;}

/* 핸드 카드 이미지와 공격/방어/체력 칸 사이의 세로 여백 제거 */
#hand.hand .card:not(.utility-card){
  grid-template-rows:20px minmax(0,1fr) 34px!important;
  row-gap:0!important;
}
#hand.hand .card .cimg{
  margin:0!important;
  padding:0!important;
  border-bottom:0!important;
}
#hand.hand .card .cstats{
  height:34px!important;
  min-height:34px!important;
  margin:0!important;
  padding:0!important;
  align-self:stretch!important;
}
#hand.hand .card-stat-grid{
  height:34px!important;
  min-height:34px!important;
  gap:2px!important;
  margin:0!important;
}
#hand.hand .card-stat-cell{
  height:34px!important;
  min-height:34px!important;
  padding:1px!important;
  box-sizing:border-box!important;
}

/* 규칙 확인 글자 크기 확대 */
.rules-box{width:min(1040px,95vw)!important;}
.rules-head h2{font-size:24px!important;}
.rules-head .small{font-size:13px!important;line-height:1.55!important;}
.rules-grid{gap:12px!important;}
.rules-grid section{padding:14px 16px!important;}
.rules-grid h3{font-size:17px!important;margin-bottom:10px!important;}
.rules-grid li,.rules-grid dd{
  font-size:14px!important;
  line-height:1.65!important;
}
.rules-grid dt{
  font-size:14px!important;
  line-height:1.55!important;
}
.rules-grid dl{grid-template-columns:104px 1fr!important;gap:7px 10px!important;}
.rules-grid ul{gap:7px!important;padding-left:20px!important;}

@media (max-width:850px){
  #allyHq .hq-advisor-slot{top:calc(50% - 11px)!important;}
  .ally-hq-turn{right:8px;top:calc(50% + 59px);width:86px;height:19px;font-size:9px;}
  .ally-hq-turn b{font-size:12px;}
  .rules-grid li,.rules-grid dd,.rules-grid dt{font-size:13px!important;}
  .rules-grid dl{grid-template-columns:88px 1fr!important;}
}


/* v65 상단 버튼, 턴 표시, 덱 상태, 버프 특능 가독성 */
/* 카드 상점과 카드 관리를 완전히 동일한 크기로 나란히 배치 */
.top-card-actions,
#leftMenuMount .top-card-actions{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-auto-rows:38px!important;
  gap:7px!important;
  width:100%!important;
  align-items:stretch!important;
}
.top-card-actions #cardShopBtn,
.top-card-actions #cardManagerBtn,
#leftMenuMount .top-card-actions #cardShopBtn,
#leftMenuMount .top-card-actions #cardManagerBtn{
  grid-column:auto!important;
  grid-row:auto!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:38px!important;
  min-height:38px!important;
  padding:6px 8px!important;
  margin:0!important;
  font-size:12px!important;
  line-height:1!important;
  box-sizing:border-box!important;
}

/* 전략가 슬롯 아래에서 본진 하단까지 턴 박스가 자연스럽게 채워지도록 설정 */
.ally-hq-turn{
  right:10px!important;
  top:calc(50% + 64px)!important;
  bottom:8px!important;
  width:96px!important;
  height:auto!important;
  min-height:34px!important;
  padding:4px 5px!important;
  gap:8px!important;
  font-size:15px!important;
  line-height:1!important;
  border-color:#b28b50!important;
  background:linear-gradient(180deg,#17212ce8,#080d13f2)!important;
  box-shadow:inset 0 0 0 1px #0009,0 3px 10px #0009!important;
}
.ally-hq-turn span{font-size:15px!important;font-weight:950!important;color:#f2dfbd!important;}
.ally-hq-turn b{font-size:22px!important;font-weight:1000!important;color:#ffe28f!important;line-height:1!important;}

/* 아군 덱 상태는 아군 핸드 제목·카드 영역과 균형이 맞는 높이로 조정 */
.reference-right .right-deck-section{
  flex:0 0 108px!important;
  height:108px!important;
  min-height:108px!important;
  max-height:108px!important;
}
.reference-right .right-deck-section>.ornate-title{
  flex:0 0 30px!important;
  height:30px!important;
  min-height:30px!important;
}
.reference-right .right-deck-body{
  flex:0 0 78px!important;
  height:78px!important;
  min-height:78px!important;
  max-height:78px!important;
  padding:6px!important;
  gap:6px!important;
  box-sizing:border-box!important;
}
.reference-right .right-deck-body .deck-info,
.reference-right .right-deck-body #shuffleBtn,
.reference-right .right-deck-body #endTurnBtn{
  height:100%!important;
  min-height:0!important;
  box-sizing:border-box!important;
}
.reference-right .right-hand-section>.ornate-title{
  height:30px!important;
  min-height:30px!important;
  flex-basis:30px!important;
}

/* 버프 제공 장수의 특능을 카드 위에서 선명하게 표시 */
.buff-provider-badge{
  position:absolute!important;
  left:4px!important;
  right:auto!important;
  bottom:24px!important;
  top:auto!important;
  z-index:12!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:1px!important;
  min-width:70px!important;
  padding:4px 6px!important;
  border:1px solid #7ff2dc!important;
  border-radius:4px!important;
  background:linear-gradient(180deg,#0a5c52f2,#06362ff2)!important;
  color:#e8fffa!important;
  box-shadow:0 0 0 1px #001c18,0 0 12px #58e2d077!important;
  text-shadow:0 1px 3px #000!important;
}
.buff-provider-badge b{font-size:10px!important;line-height:1.05!important;color:#ffffff!important;}
.buff-provider-badge small{font-size:8px!important;line-height:1.05!important;color:#bfffee!important;white-space:nowrap!important;}
.hand-buff-provider-badge{
  position:absolute!important;
  left:4px!important;
  top:4px!important;
  z-index:14!important;
  display:flex!important;
  flex-direction:column!important;
  gap:1px!important;
  padding:3px 5px!important;
  border:1px solid #83f3de!important;
  border-radius:4px!important;
  background:linear-gradient(180deg,#0b655af2,#063a33f2)!important;
  color:#effffb!important;
  box-shadow:0 0 10px #58e2d066!important;
  text-shadow:0 1px 3px #000!important;
}
.hand-buff-provider-badge b{font-size:9px!important;line-height:1!important;}
.hand-buff-provider-badge small{font-size:7px!important;line-height:1!important;color:#c5fff2!important;white-space:nowrap!important;}

/* 적용 중인 버프·약화 효과를 구체적인 수치와 이름으로 표시 */
.active-buff-badge{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:1px!important;
  max-width:calc(100% - 8px)!important;
  padding:3px 5px!important;
  border:1px solid #ffe08a!important;
  border-radius:4px!important;
  background:linear-gradient(180deg,#7c5b13f2,#3f2b06f2)!important;
  color:#fff8d8!important;
  box-shadow:0 0 10px #ffd45d66!important;
  text-shadow:0 1px 3px #000!important;
}
.active-buff-badge.negative{
  border-color:#ff948d!important;
  background:linear-gradient(180deg,#742a26f2,#3b1210f2)!important;
  color:#ffe5e2!important;
  box-shadow:0 0 10px #ff706655!important;
}
.active-buff-badge b{font-size:9px!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:100%!important;}
.active-buff-badge small{font-size:7px!important;line-height:1!important;white-space:nowrap!important;}
.popup.buff-popup .popup-body,
.buff-popup .popup-body{font-size:14px!important;line-height:1.55!important;}

@media (max-width:850px){
  .ally-hq-turn{
    right:8px!important;
    top:calc(50% + 58px)!important;
    bottom:6px!important;
    width:86px!important;
    min-height:30px!important;
    font-size:13px!important;
  }
  .ally-hq-turn span{font-size:13px!important;}
  .ally-hq-turn b{font-size:19px!important;}
  .reference-right .right-deck-section{
    flex-basis:100px!important;
    height:100px!important;
    min-height:100px!important;
    max-height:100px!important;
  }
  .reference-right .right-deck-body{
    flex-basis:70px!important;
    height:70px!important;
    min-height:70px!important;
    max-height:70px!important;
  }
}


/* v66: 버프 표시 중앙 정렬, 핸드 페이지 제목 내 이동, 전투열 추가효과, 랜덤 덱 비율 */
.hand-buff-provider-badge{
  left:50%!important;
  right:auto!important;
  top:auto!important;
  bottom:5px!important;
  transform:translateX(-50%)!important;
  align-items:center!important;
  min-width:82px!important;
  padding:4px 7px!important;
  text-align:center!important;
}
.hand-buff-provider-badge b{font-size:11px!important;line-height:1.05!important;}
.hand-buff-provider-badge small{font-size:8px!important;line-height:1.05!important;}
.buff-provider-badge{
  left:50%!important;
  right:auto!important;
  top:auto!important;
  bottom:4px!important;
  transform:translateX(-50%)!important;
  align-items:center!important;
  min-width:82px!important;
  text-align:center!important;
}
.buff-provider-badge b{font-size:11px!important;}
.buff-provider-badge small{font-size:8px!important;}
.unit .active-buff-badge{
  position:absolute!important;
  left:50%!important;
  right:auto!important;
  top:auto!important;
  bottom:4px!important;
  transform:translateX(-50%)!important;
  z-index:14!important;
  align-items:center!important;
  min-width:82px!important;
  max-width:calc(100% - 8px)!important;
  text-align:center!important;
}
.unit .active-buff-badge b{font-size:10px!important;}
.unit .active-buff-badge small{font-size:8px!important;}
.unit .active-buff-badge + .buff-provider-badge{bottom:34px!important;}

.hand-title-bar{padding:0 6px!important;}
.hand-title-paged{
  width:100%!important;
  display:grid!important;
  grid-template-columns:28px 1fr auto 28px!important;
  align-items:center!important;
  gap:5px!important;
}
.hand-title-label{text-align:center!important;font-size:13px!important;font-weight:900!important;}
.hand-title-page{font-size:10px!important;color:#ffe0a6!important;white-space:nowrap!important;}
.hand-title-arrow{
  width:26px!important;height:24px!important;min-height:24px!important;padding:0!important;
  border:1px solid #8d6738!important;background:#15100b!important;color:#ffe0a6!important;
  font-size:20px!important;line-height:20px!important;font-weight:950!important;cursor:pointer!important;
}
.hand-title-arrow:disabled{opacity:.3!important;cursor:default!important;}
.hand-title-arrow[hidden],.hand-title-page[hidden]{display:block!important;visibility:hidden!important;}

.lane .lane-synergy-tag{
  position:absolute!important;
  left:50%!important;
  top:5px!important;
  transform:translateX(-50%)!important;
  z-index:9!important;
  max-width:70%!important;
  padding:3px 8px!important;
  border:1px solid #76e9d5!important;
  border-radius:999px!important;
  background:linear-gradient(180deg,#0c5e55ef,#07352fef)!important;
  color:#eafffb!important;
  box-shadow:0 0 12px #61e1cf66!important;
  font-size:9px!important;
  line-height:1.1!important;
  font-weight:950!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  pointer-events:none!important;
}
.lane.synergy-active{box-shadow:inset 0 0 0 1px #65dbc866,0 0 14px #48cbb52c!important;}

.deck-auto-ratio{
  display:grid!important;
  grid-template-columns:auto repeat(4,minmax(105px,1fr)) auto!important;
  align-items:center!important;
  gap:7px!important;
  margin:8px 0!important;
  padding:8px 10px!important;
  border:1px solid #66502f!important;
  background:#0b0f12!important;
  font-size:11px!important;
}
.deck-auto-ratio>b{color:#f0cf91!important;white-space:nowrap!important;}
.deck-auto-ratio label{display:flex!important;align-items:center!important;justify-content:center!important;gap:4px!important;white-space:nowrap!important;}
.deck-auto-ratio input{width:48px!important;height:28px!important;padding:2px 4px!important;text-align:center!important;}
.deck-auto-ratio>span{color:#b8aa91!important;font-size:10px!important;white-space:nowrap!important;}
@media(max-width:850px){
  .deck-auto-ratio{grid-template-columns:repeat(2,1fr)!important;}
  .deck-auto-ratio>b,.deck-auto-ratio>span{grid-column:1/-1!important;text-align:center!important;}
}


/* v67: 전장 안개, 함정, 정찰, 무력화, 임시 전투칸 */
.unit.fog-hidden{border-color:#46505c!important;box-shadow:0 3px 12px #000d,inset 0 0 22px #000!important;filter:saturate(.2)!important;}
.unit.fog-hidden .fog-uimg{background:#090d12!important;}
.enemy-shadow-art{display:block;width:100%;height:100%;object-fit:cover;filter:brightness(.8) contrast(1.15);}
.unit.fog-hidden .field-unit-name{color:#c1c8cf!important;letter-spacing:.04em;}
.unit.fog-hidden .stats span{color:#aab3bc!important;background:#10151a!important;}
.slot.trap-known{box-shadow:inset 0 0 0 2px #d88d42aa,0 0 14px #ff9c3f33!important;}
.trap-marker{position:absolute;left:5px;top:5px;z-index:28;padding:2px 6px;border:1px solid #ffbd73;border-radius:999px;background:#32180de8;color:#ffe3b8;font-size:8px;font-weight:950;pointer-events:none;box-shadow:0 0 10px #ff933f66;}
.slot.temporary-slot{border:2px dashed #66e5d5!important;background:repeating-linear-gradient(135deg,#0d3b3744 0 8px,#07191544 8px 16px)!important;box-shadow:inset 0 0 15px #5ee6d33b!important;}
.slot.temporary-slot::after{content:'임시 전투칸';position:absolute;right:4px;bottom:4px;z-index:5;padding:2px 4px;background:#062c28df;border:1px solid #62dbc9;color:#dffffa;font-size:7px;font-weight:900;pointer-events:none;}
.chain-overlay{position:absolute;inset:12% 3% 18%;z-index:32;display:grid;place-items:center;font-size:46px;line-height:1;color:#d4d8de;text-shadow:0 2px 8px #000,0 0 15px #a7b2c2;transform:rotate(-12deg);pointer-events:none;opacity:.95;}
.unit.chain-locked{position:relative;overflow:hidden;filter:grayscale(.44) brightness(.74)!important;box-shadow:inset 0 0 0 2px #a3acb8,inset 0 0 18px #e8edf633,0 0 16px #8690a077!important;}
.unit.chain-locked::before,.unit.chain-locked::after{content:'';position:absolute;inset:-10% -18%;z-index:31;pointer-events:none;opacity:.9;background-repeat:no-repeat;}
.unit.chain-locked::before{transform:rotate(-10deg);background:
  repeating-linear-gradient(135deg,transparent 0 13%,rgba(225,231,238,.0) 13% 14.5%,rgba(220,226,233,.92) 14.5% 17.5%,rgba(118,126,139,.96) 17.5% 20%,rgba(220,226,233,.92) 20% 23%,rgba(0,0,0,0) 23% 32%),
  linear-gradient(135deg,transparent 0 8%,rgba(255,255,255,.16) 8% 9%,transparent 9% 100%);}
.unit.chain-locked::after{transform:rotate(8deg);background:
  repeating-linear-gradient(45deg,transparent 0 15%,rgba(232,236,241,.0) 15% 16%,rgba(220,226,233,.9) 16% 19%,rgba(116,124,138,.95) 19% 21.5%,rgba(220,226,233,.9) 21.5% 24%,rgba(0,0,0,0) 24% 34%),
  linear-gradient(45deg,transparent 0 12%,rgba(255,255,255,.14) 12% 13%,transparent 13% 100%);}
.unit.chain-locked .uimg::before{content:'';position:absolute;inset:0;z-index:30;pointer-events:none;background:radial-gradient(circle at 50% 50%,rgba(255,255,255,.10),rgba(0,0,0,.16) 68%,rgba(0,0,0,.28));}
.unit.chain-locked .field-unit-name,.unit.chain-locked .field-grade,.unit.chain-locked .stats span{position:relative;z-index:33!important;}
.unit-scout-badge{position:absolute;right:4px;top:26px;z-index:20;padding:2px 5px;border:1px solid #7edcff;border-radius:999px;background:#083248e8;color:#dcf8ff;font-size:8px;font-weight:950;box-shadow:0 0 9px #55c8ff66;}

/* 버프/스킬 사용 가능 카드 표시용 소형 배지: 카드 상단 모서리에 작게 배치해
   하단(병력 종류 아이콘, 행동력 등) 및 이미지 중앙을 가리지 않게 한다. */
.unit-buff-box,.unit-skill-box{
  position:absolute;
  top:3px;
  z-index:20;
  padding:1px 4px;
  border-radius:3px;
  font-size:7px;
  font-weight:950;
  line-height:1.5;
  white-space:nowrap;
  pointer-events:none;
  text-shadow:0 1px 2px #000;
  box-shadow:0 1px 4px #0008;
}
.unit-buff-box{left:3px;border:1px solid #7ff2dc;background:#073f3bd9;color:#ccfff6;}
.unit-skill-box{right:3px;border:1px solid #b79bff;background:#241a45d9;color:#ecdfff;}
.battlefield-layout .unit-scout-badge{top:18px!important;}
@media (max-width:850px){
  .unit-buff-box,.unit-skill-box{font-size:6px;padding:1px 3px;}
}
.fx-tactic.trap{background:radial-gradient(circle,#ffe5bacc 0 12%,#b95d2588 38%,transparent 72%);box-shadow:0 0 30px #ff843d;}
.fx-tactic.battleprep{background:radial-gradient(circle,#d6fff5cc 0 12%,#2ca58b88 38%,transparent 72%);box-shadow:0 0 30px #58e4c8;}
.fx-tactic.wind{background:radial-gradient(circle,#f5fbffcc 0 10%,#72c8e388 36%,transparent 74%);box-shadow:0 0 34px #8de6ff;animation:fxWindBurst 1.05s ease-out forwards;}
@keyframes fxWindBurst{0%{opacity:0;transform:translate(-70%,-50%) scale(.4) rotate(-35deg)}25%{opacity:1;transform:translate(-50%,-50%) scale(1.15) rotate(10deg)}70%{opacity:1;transform:translate(-25%,-50%) scale(1) rotate(35deg)}100%{opacity:0;transform:translate(10%,-50%) scale(1.5) rotate(80deg)}}

/* v67 임시 전투칸 5~6칸 배열 */
.battlefield-layout .slots.n5{width:100%!important;max-width:none!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:5px!important;}
.battlefield-layout .slots.n6{width:100%!important;max-width:none!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:4px!important;}
@media(max-width:850px){.battlefield-layout .slots.n5,.battlefield-layout .slots.n6{width:max-content!important;grid-template-columns:repeat(5,82px)!important;}.battlefield-layout .slots.n6{grid-template-columns:repeat(6,76px)!important;}}


/* v69 저체력 본진 경고 */
.battle-hq,.hq{isolation:isolate;}
.battle-hq.low-energy::after,.hq.low-energy::after{content:'';position:absolute;inset:0;z-index:65;pointer-events:none;background:rgba(175,28,28,.16);box-shadow:inset 0 0 34px rgba(255,72,72,.28);animation:hqLowEnergyPulse 1.25s ease-in-out infinite alternate;}
@keyframes hqLowEnergyPulse{from{opacity:.48}to{opacity:.9}}

/* v69 핸드 장수 버프 배지: 하단 행동력/능력치 영역을 가리지 않도록 상단 이동 */
.hand-buff-provider-badge{left:6px!important;right:auto!important;top:28px!important;bottom:auto!important;transform:none!important;min-width:74px!important;max-width:calc(100% - 12px)!important;padding:3px 6px!important;z-index:24!important;}

/* v69 카드 관리자 본진 연출 표시 영역 */
.event-image-layout{display:grid;grid-template-columns:1fr;gap:5px;margin:7px 0 2px;padding:7px;border:1px solid #34475d;background:#090f18;}
.event-image-layout label{display:grid;grid-template-columns:62px 1fr;align-items:center;gap:6px;font-size:9px;color:#c9d7e7;}
.event-image-layout input[type=range]{width:100%;}
.event-image-layout output{font-size:9px;color:#f0d6a3;text-align:center;}
.event-image-preview img{transform:scale(var(--scene-preview-scale,1));transform-origin:center;}

/* v69 전투 메뉴·설정·덱 조작부 높이 통일 */
:root{--battle-control-height:42px;}
.reference-right .right-deck-body .deck-info,.reference-right .right-deck-body #shuffleBtn,.reference-right .right-deck-body #endTurnBtn,.formation-inline select,.formation-inline .formation-start-btn,.formation-inline .formation-deck-btn,.left-menu-dock button{height:var(--battle-control-height)!important;min-height:var(--battle-control-height)!important;max-height:var(--battle-control-height)!important;box-sizing:border-box!important;}
.reference-right .right-deck-body{min-height:calc(var(--battle-control-height) + 12px)!important;}


/* v70 대상 없는 스킬: 더블클릭 또는 전장 드래그 발동 */
#hand.hand .card.instant-tactic-card{cursor:grab;}
#hand.hand .card.instant-tactic-card:active{cursor:grabbing;}
#hand.hand .card.instant-tactic-card.dragging-tactic{opacity:.48;transform:scale(.96);}
.battlefield-layout>.board.tactic-drop-ready{
  position:relative;
  outline:3px solid #c79cff!important;
  outline-offset:-4px;
  box-shadow:inset 0 0 34px #8e5eff55,0 0 20px #8e5eff55!important;
}
.battlefield-layout>.board.tactic-drop-ready::after{
  content:'스킬카드를 놓아 즉시 발동';
  position:absolute;
  inset:10px;
  z-index:90;
  display:grid;
  place-items:center;
  border:2px dashed #e1cfff;
  background:#25153dcc;
  color:#f5edff;
  font-size:18px;
  font-weight:950;
  letter-spacing:.04em;
  text-shadow:0 2px 6px #000;
  pointer-events:none;
}


/* v74 카드 관리자 배치 재정렬: 프리셋 가로 1줄 / 연출 3열 / 본진 국가 이미지 3열 */
.batch-image-preset-grid{grid-template-columns:1fr!important;gap:6px!important;}
.batch-image-preset-slot{
  display:grid!important;
  grid-template-columns:160px minmax(220px,1fr) 138px!important;
  gap:8px!important;
  align-items:center!important;
  padding:8px 10px!important;
}
.batch-image-preset-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:6px!important;}
.batch-image-preset-head b{white-space:nowrap!important;}
.batch-image-preset-fields{grid-template-columns:repeat(3,minmax(72px,1fr))!important;gap:8px!important;align-items:end!important;}
.batch-image-preset-fields label{gap:3px!important;}
.batch-image-preset-slot>.btn{width:100%!important;}
.batch-image-type-select{justify-content:flex-start!important;}

.event-image-manager{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:10px!important;
  margin-top:8px!important;
  padding:10px!important;
  border:1px solid #5f472d!important;
  background:#0a0d0f!important;
  align-items:start!important;
}
.event-image-manager>.image-adjust-title,
.event-image-manager>.event-image-note{grid-column:1/-1!important;}
.event-image-setting{display:grid!important;gap:6px!important;min-width:0!important;padding:8px!important;border:1px solid #6b4f31!important;background:linear-gradient(180deg,#12100d,#0a0c0e)!important;}
.event-image-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:6px!important;flex-wrap:wrap!important;}
.event-image-head span{font-size:9px!important;color:#cdb999!important;}
.event-image-preview{height:132px!important;}

.hq-image-manager{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:10px!important;
  margin-top:8px!important;
  padding:10px!important;
  border:1px solid #5f472d!important;
  background:#0a0d0f!important;
  align-items:start!important;
}
.hq-image-manager>.image-adjust-title{grid-column:1/-1!important;}
.hq-image-setting{padding:8px!important;border:1px solid #6b4f31!important;background:linear-gradient(180deg,#12100d,#0a0c0e)!important;}
.hq-image-preview{height:88px!important;}

@media(max-width:1200px){
  .batch-image-preset-slot{grid-template-columns:1fr!important;}
  .batch-image-preset-head,.batch-image-preset-fields{width:100%!important;}
}
@media(max-width:1050px){
  .event-image-manager,.hq-image-manager{grid-template-columns:1fr!important;}
}


/* v75 카드 관리자 헤더 및 기타이미지 분리 */
.manager-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap;}
.manager-head-actions .btn{min-width:92px;}
.other-image-box{width:min(92vw,760px)!important;max-width:760px!important;padding:14px!important;}
.other-image-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:12px;}
.other-image-head h2{margin:0;}
.other-image-head .small{margin-top:4px;}
#otherImageModal .default-card-image-manager{display:grid!important;gap:8px!important;padding:10px!important;border:1px solid #536176!important;background:#0b1118!important;}
#otherImageModal .default-image-preview{height:180px!important;}

/* v75 프리셋 행형 배치 단순화 */
.batch-image-preset-panel{gap:8px!important;}
.batch-image-preset-grid{grid-template-columns:1fr!important;gap:6px!important;}
.batch-image-preset-slot{grid-template-columns:118px minmax(240px,1fr) 132px!important;gap:6px!important;padding:7px 9px!important;align-items:center!important;}
.batch-image-preset-head{gap:6px!important;}
.batch-image-preset-head .btn,.batch-image-preset-slot>.btn{min-height:24px!important;font-size:9px!important;}
.batch-image-preset-fields{grid-template-columns:repeat(3,minmax(68px,1fr))!important;gap:6px!important;}
.batch-image-preset-fields label{font-size:9px!important;}
.batch-image-preset-fields input{padding:3px 5px!important;}
.batch-image-preset-note{font-size:9px!important;}

/* v75 연출/본진 이미지 가로 정렬 유지 */
.event-image-manager{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important;align-items:start!important;}
.event-image-manager>.image-adjust-title,.event-image-manager>.event-image-note{grid-column:1/-1!important;}
.event-image-setting{display:grid!important;gap:6px!important;}
.event-image-preview{height:126px!important;}
.hq-image-manager{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important;align-items:start!important;}
.hq-image-manager>.image-adjust-title{grid-column:1/-1!important;}
.hq-image-preview{height:88px!important;}

@media(max-width:1200px){.batch-image-preset-slot{grid-template-columns:1fr!important;}}
@media(max-width:1050px){.event-image-manager,.hq-image-manager{grid-template-columns:1fr!important;}}
@media(max-width:760px){.other-image-head{flex-direction:column;align-items:stretch;}.manager-head-actions{width:100%;justify-content:flex-end;}}


/* v76 카드 능력 및 설명 아래로 이미지 설정 영역 이동 */
.manager-inline-image-zone{display:grid;gap:10px;margin-top:10px;min-width:0;}
.manager-inline-image-zone .batch-image-preset-panel,
.manager-inline-image-zone .event-image-manager,
.manager-inline-image-zone .hq-image-manager{margin-top:0!important;}
.manager-inline-image-zone .batch-image-preset-panel{order:1;}
.manager-inline-image-zone .event-image-manager{order:2;}
.manager-inline-image-zone .hq-image-manager{order:3;}
.manager-preview-wrap{align-self:start;}
.manager-grid>div:last-child{min-width:0;}
@media(max-width:1050px){.manager-inline-image-zone{margin-top:8px;}}


/* v77 이미지 일괄설정 한 줄 배치 */
.manager-inline-image-zone .batch-image-preset-panel{display:grid;gap:6px!important;padding:8px 10px!important;}
.manager-inline-image-zone .batch-image-preset-panel .image-adjust-title{font-size:12px!important;margin-bottom:2px!important;}
.manager-inline-image-zone .batch-image-preset-grid.compact{display:grid!important;grid-template-columns:1fr!important;gap:6px!important;}
.manager-inline-image-zone .batch-image-preset-row{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important;padding:6px 8px!important;border:1px solid #6c4d2b;background:linear-gradient(180deg,#12100d,#0a0c0e)!important;}
.manager-inline-image-zone .batch-image-preset-row-label{font-size:11px;font-weight:900;color:#efcf95;min-width:42px;}
.manager-inline-image-zone .batch-check{display:inline-flex;align-items:center;gap:4px;font-size:10px;color:#e0d3bf;white-space:nowrap;}
.manager-inline-image-zone .batch-check input{accent-color:#c69b55;}
.manager-inline-image-zone .batch-mini-field{display:inline-flex;align-items:center;gap:4px;font-size:10px;color:#d5c7b2;white-space:nowrap;}
.manager-inline-image-zone .batch-mini-field input{width:54px!important;min-width:54px!important;max-width:54px!important;padding:3px 4px!important;text-align:center!important;background:#0b0d0f;border:1px solid #745734;color:#f4e1b8;}
.manager-inline-image-zone .batch-image-preset-row .btn{min-height:24px!important;font-size:9px!important;padding:4px 8px!important;white-space:nowrap;}
@media(max-width:1200px){.manager-inline-image-zone .batch-image-preset-row{gap:6px!important;}}


/* v78 · image settings navigation split */
.other-image-box{width:min(94vw,1080px)!important;max-width:1080px!important;max-height:92vh;overflow:auto;}
.other-image-content{display:grid;gap:14px;min-width:0;}
.other-image-content .hq-image-manager{margin-top:0!important;}
.batch-settings-box{width:min(96vw,1240px)!important;max-width:1240px!important;max-height:94vh;overflow:auto;padding:14px!important;}
.batch-settings-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding-bottom:10px;border-bottom:1px solid #5f472d;}
.batch-settings-head h2{margin:0 0 4px;}
.batch-current-card{margin:10px 0;padding:8px 10px;border:1px solid #7a5a34;background:linear-gradient(180deg,#18130d,#0d0f11);color:#f1d49b;font-size:12px;font-weight:800;}
.batch-current-card.empty{color:#b7aa95;}
.batch-settings-content{display:grid;gap:14px;}
.batch-settings-section{display:grid;gap:10px;padding:10px;border:1px solid #4f4131;background:#080a0c;min-width:0;}
.batch-section-head>div{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;}
.batch-section-head b{font-size:14px;color:#f1d49b;}
.batch-section-head span{font-size:10px;color:#b6aa97;}
.batch-settings-section .batch-image-preset-panel{margin:0!important;}
.batch-settings-section .batch-image-preset-grid.compact{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;}
.batch-settings-section .batch-image-preset-row{display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important;padding:7px 8px!important;border:1px solid #6c4d2b;background:linear-gradient(180deg,#12100d,#0a0c0e)!important;}
.batch-settings-section .batch-image-preset-row-label{font-size:11px;font-weight:900;color:#efcf95;min-width:42px;}
.batch-settings-section .batch-check{display:inline-flex;align-items:center;gap:4px;font-size:10px;color:#e0d3bf;white-space:nowrap;}
.batch-settings-section .batch-check input{accent-color:#c69b55;}
.batch-settings-section .batch-mini-field{display:inline-flex;align-items:center;gap:4px;font-size:10px;color:#d5c7b2;white-space:nowrap;}
.batch-settings-section .batch-mini-field input{width:58px!important;min-width:58px!important;max-width:58px!important;padding:4px!important;text-align:center!important;background:#0b0d0f;border:1px solid #745734;color:#f4e1b8;}
.batch-settings-section .event-image-manager{margin:0!important;}
.batch-scene-actions{display:flex;justify-content:flex-end;padding-top:2px;}
@media(max-width:760px){
  .batch-settings-head{flex-direction:column;align-items:stretch;}
  .batch-settings-head>.btn{align-self:flex-end;}
  .batch-settings-section{padding:8px;}
}


/* v79 · 이미지 설정 화면 전환 안정화 */
#otherImageModal,#batchSettingsModal{z-index:90!important;}
#otherImageModal.show,#batchSettingsModal.show{display:flex!important;pointer-events:auto!important;}
#otherImageModal .modalbox,#batchSettingsModal .modalbox{position:relative;z-index:1;}
#openOtherImagesBtn,#openBatchSettingsBtn{position:relative;z-index:2;pointer-events:auto!important;cursor:pointer;}


/* v80 · 본진 연출 실제 크기 미리보기 */
.scene-stage-preview-panel{display:grid;gap:8px;padding:10px;border:1px solid #5f472d;background:linear-gradient(180deg,#12100d,#0a0c0e);margin-bottom:10px;}
.scene-stage-preview-wrap{display:flex;justify-content:center;align-items:center;padding:4px 0 8px;}
.scene-stage-preview.hq{width:var(--stage-hq-width,320px)!important;max-width:100%;height:var(--stage-hq-height,170px)!important;min-height:var(--stage-hq-height,170px)!important;position:relative;overflow:hidden;}
.scene-stage-preview .hq-unit-slot{display:flex!important;right:10px;bottom:8px;width:140px;height:42px;z-index:6;color:#d4dbeb;font-size:10px;}
.scene-stage-preview .hq-unit-slot span{padding:0 6px;text-align:center;}
.scene-stage-preview .hq-title{z-index:6;}
.scene-stage-preview .hq-subtitle{z-index:6;}
.event-image-preview-actions{display:flex;gap:6px;flex-wrap:wrap;margin:-1px 0 6px;}
.event-image-preview-actions .btn{flex:1 1 120px;min-height:28px!important;font-size:10px!important;padding:5px 8px!important;}
.hq-card-scene.preview-static .scene-energy,.hq-card-scene.preview-static::before,.hq-card-scene.preview-static::after{opacity:.2!important;animation:none!important;}
.hq-card-scene.preview-static img{animation:none!important;transform:scale(var(--scene-scale,1))!important;opacity:1!important;filter:saturate(1.05) contrast(1.03)!important;}
@media(max-width:760px){.scene-stage-preview.hq{max-width:100%;}.event-image-preview-actions .btn{flex:1 1 100%;}}


/* v81 · 설정/실전 본진 연출 완전 동기화 */
.scene-stage-preview .hq-card-scene{inset:0!important;}
.scene-stage-preview .hq-card-scene img{object-position:var(--scene-x,50%) var(--scene-y,50%)!important;transform-origin:var(--scene-x,50%) var(--scene-y,50%)!important;}


/* v82 · 카드 위치/본진 연출 프리셋 동기화 */
.batch-scene-preset-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap;padding-top:4px;border-top:1px solid #3f3121;}
.batch-scene-preset-actions>span{margin-right:auto;font-size:10px;color:#cdbb9e;}
.batch-scene-preset-actions .btn{min-height:28px!important;font-size:10px!important;padding:5px 9px!important;}
@media(max-width:760px){.batch-scene-preset-actions>span{flex:1 1 100%;}.batch-scene-preset-actions .btn{flex:1 1 30%;}}


/* v83: 본진 5칸 전투필드 */
.hq-battlefield-grid{display:grid!important;grid-template-columns:repeat(5,minmax(54px,1fr));gap:6px;width:min(100%,620px)!important;min-height:100px!important;padding:8px!important;background:rgba(10,15,22,.82);border:1px solid rgba(223,183,102,.55);border-radius:12px;overflow:visible!important}
.hq-battlefield-grid.inactive{opacity:.28;pointer-events:none}.hq-battlefield-grid.active{opacity:1;box-shadow:0 0 22px rgba(255,177,54,.24)}
.hq-field-slot{position:relative;min-height:88px;border:1px dashed rgba(238,203,126,.42);border-radius:8px;display:flex;align-items:stretch;justify-content:center;background:rgba(255,255,255,.035);overflow:hidden}.hq-field-slot.empty>span{margin:auto;font-weight:900;color:#bda66f}.hq-field-slot.empty:hover{background:rgba(255,190,75,.14);border-color:#ffd16e}.hq-field-slot .base-unit{width:100%;height:100%;padding:3px;display:grid;grid-template-rows:1fr auto;cursor:pointer}.hq-field-slot .base-unit-art{min-height:58px}.hq-field-slot .base-unit-mini{font-size:9px;line-height:1.2;display:grid;gap:2px;background:rgba(0,0,0,.62);padding:3px}.hq-field-slot .base-unit-mini span{white-space:nowrap;font-size:8px}.hq.emergency .hq-battlefield-grid{animation:hqFieldPulse 1.1s ease-out 1}@keyframes hqFieldPulse{0%{transform:scale(.94);filter:brightness(1.7)}100%{transform:scale(1);filter:brightness(1)}}
/* 전투준비 임시 칸은 일반 칸과 명확히 구분 */
.slot.temporary-slot{background:linear-gradient(145deg,rgba(44,120,164,.55),rgba(33,71,113,.72))!important;border:2px solid #78d9ff!important;box-shadow:inset 0 0 14px rgba(105,217,255,.25),0 0 10px rgba(105,217,255,.22)!important}.slot.temporary-slot::after{content:'전투준비';position:absolute;right:3px;bottom:2px;font-size:8px;font-weight:900;color:#bfeeff;background:rgba(0,24,43,.72);padding:1px 4px;border-radius:4px}
/* 덱 편집 카드 확대 및 상세 정보 */
.deck-builder-toolbar{flex-wrap:wrap}.deck-builder-list{grid-template-columns:repeat(auto-fill,minmax(190px,1fr))!important;align-content:start}.deck-builder-visual-card{min-height:330px!important;padding:8px!important;display:grid!important;grid-template-rows:auto 178px auto auto auto!important;gap:6px;background:linear-gradient(180deg,rgba(24,28,35,.98),rgba(9,12,17,.98));border-radius:10px}.deck-builder-visual-card .collection-card-art{height:178px!important}.collection-five-stats{display:block;text-align:center;font-size:13px;font-weight:900;letter-spacing:.04em;padding:5px;border-radius:6px;background:rgba(231,197,124,.1);color:#ffe0a0}.collection-extra{display:block;min-height:34px;font-size:10px;line-height:1.35;color:#d8d0c1;overflow:hidden}.deck-card-controls{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.deck-card-controls button{border:1px solid #755f39;background:#1b2027;color:#f5deb0;border-radius:6px;padding:5px 7px;font-size:10px;cursor:pointer}.deck-card-controls button:disabled{opacity:.35;cursor:not-allowed}.deck-add-card{margin-left:auto!important;background:#6f4a13!important}.deck-builder-owned button{width:24px;height:24px;padding:0}.deck-builder-owned em{width:28px!important;height:24px!important}.deck-builder-list.selected .deck-builder-visual-card{min-height:310px!important}
.card-image-zoom-box{width:min(820px,96vw)!important}.card-image-zoom-scroll{max-height:82vh;overflow:auto}.card-image-zoom-visual{max-width:none!important}.card-zoom-layout{display:grid;grid-template-columns:minmax(250px,42%) 1fr;gap:22px;padding:16px}.card-zoom-art{min-height:430px;border-radius:12px;overflow:hidden;background:#0d1118}.card-zoom-art img,.card-zoom-art .card-art-img{width:100%;height:100%;object-fit:cover}.card-zoom-info{display:flex;flex-direction:column;gap:12px;color:#efe7d6}.card-zoom-info h3{font-size:26px;margin:0}.card-zoom-info h3 em{font-style:normal;font-size:16px}.card-zoom-info p{margin:0;color:#cdbf9e}.card-zoom-stats{font-size:19px;font-weight:900;letter-spacing:.06em;padding:12px;background:rgba(230,188,96,.12);border:1px solid rgba(230,188,96,.28);border-radius:9px}.card-zoom-skill{display:grid;gap:7px;padding:13px;background:rgba(79,116,165,.13);border-radius:9px}.card-zoom-skill span,.card-zoom-description{font-size:14px;line-height:1.6}.zoomable-card-name.cimg,.zoomable-card-name.uimg,.zoomable-card-name.base-unit-art{cursor:zoom-in}
@media(max-width:760px){.hq-battlefield-grid{grid-template-columns:repeat(5,minmax(42px,1fr));gap:3px;padding:4px!important}.hq-field-slot{min-height:72px}.card-zoom-layout{grid-template-columns:1fr}.card-zoom-art{min-height:340px}.deck-builder-list{grid-template-columns:repeat(2,minmax(145px,1fr))!important}.deck-builder-visual-card{min-height:300px!important;grid-template-rows:auto 145px auto auto auto!important}.deck-builder-visual-card .collection-card-art{height:145px!important}}


/* ================================================================
   v84 — 덱 구성 1줄 도구막대 / 3열 카드 / 클릭식 추가·제거 / 상점 정보 재배치
   ================================================================ */
.deck-builder-box{width:min(1260px,98vw)!important;}
.deck-builder-toolbar{
  display:grid!important;
  grid-template-columns:92px 98px 94px 78px 88px minmax(150px,1fr) 88px 116px!important;
  gap:6px!important;
  align-items:end!important;
  flex-wrap:nowrap!important;
}
.deck-builder-toolbar>*{min-width:0!important;}
.deck-builder-toolbar label{min-width:0!important;}
.deck-builder-toolbar select,.deck-builder-toolbar input{width:100%!important;min-width:0!important;padding-left:6px!important;padding-right:6px!important;}
.deck-builder-count,.deck-builder-score{
  min-width:0!important;
  height:32px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:4px!important;
  padding:0 5px!important;
  white-space:nowrap!important;
}
.deck-builder-count>span,.deck-builder-score>span{font-size:9px;font-weight:800;color:#cdbb9e;}
.deck-builder-count b,.deck-builder-score b{margin:0!important;font-size:18px!important;line-height:1!important;}
.deck-builder-count small,.deck-builder-score small{font-size:10px;color:#b9c1ca;}
.deck-builder-main{grid-template-columns:minmax(0,1.35fr) minmax(0,.85fr)!important;}
.deck-builder-list{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-rows:max-content!important;
  align-items:start!important;
  align-content:start!important;
  gap:8px!important;
  padding:8px!important;
}
.deck-builder-list.selected{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
.deck-builder-visual-card{
  width:100%!important;
  height:auto!important;
  min-height:310px!important;
  max-height:none!important;
  align-self:start!important;
  box-sizing:border-box!important;
  grid-template-rows:auto 154px auto minmax(34px,auto) auto auto!important;
  overflow:hidden!important;
  cursor:pointer!important;
}
.deck-builder-visual-card .collection-card-art{height:154px!important;min-height:154px!important;}
.deck-builder-visual-card .collection-five-stats{font-size:12px!important;padding:5px 3px!important;}
.deck-builder-visual-card .collection-extra{min-height:34px!important;max-height:44px!important;line-height:1.35!important;}
.deck-builder-visual-card .collection-card-foot{min-height:36px!important;padding:4px 5px!important;align-items:center!important;}
.deck-builder-visual-card .collection-card-foot small{white-space:normal!important;line-height:1.25!important;font-size:8px!important;}
.deck-builder-visual-card.selected:hover{border-color:#d6a55f!important;background:#21170e!important;}
.deck-card-controls{margin-top:auto!important;}

/* 카드 상점: 이름 영역에 국가·종류·점수 배치, 기존 하단 정보칸 제거 */
.card-shop-grid{
  grid-template-columns:repeat(auto-fill,minmax(160px,1fr))!important;
  grid-auto-rows:auto!important;
  align-items:start!important;
  gap:10px!important;
}
.card-shop-grid .shop-card{
  width:100%!important;
  height:270px!important;
  min-width:0!important;
  min-height:270px!important;
  max-width:none!important;
  max-height:none!important;
  grid-template-rows:46px minmax(0,1fr) 31px 36px!important;
  box-sizing:border-box!important;
}
.card-shop-grid .shop-card-title{min-height:46px!important;padding:4px 5px!important;}
.shop-card-heading{min-width:0;display:flex;align-items:baseline;gap:5px;flex-wrap:wrap;line-height:1.1;}
.shop-card-heading b{flex:0 1 auto;max-width:100%;font-size:11px!important;}
.shop-card-heading small{min-width:0;font-size:7px;color:#ceb98f;white-space:normal;line-height:1.25;}
.card-shop-grid .shop-card-title>em{align-self:start;}
.card-shop-grid .collection-card-art{height:auto!important;min-height:0!important;}
.card-shop-grid .collection-five-stats{font-size:12px!important;padding:5px 3px!important;}
.card-shop-grid .collection-extra{min-height:36px!important;max-height:36px!important;padding:4px 5px!important;font-size:9px!important;line-height:1.35!important;}
.card-shop-grid .collection-card-foot{display:none!important;}

@media(max-width:1050px){
  .deck-builder-toolbar{grid-template-columns:86px 90px 86px 72px 82px minmax(130px,1fr) 82px 106px!important;gap:4px!important;}
  .deck-builder-toolbar select,.deck-builder-toolbar input{font-size:10px!important;}
  .deck-builder-list.selected{grid-template-columns:1fr!important;}
}
@media(max-width:850px){
  .deck-builder-toolbar{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  .deck-builder-main{grid-template-columns:1fr!important;}
  .deck-builder-list{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .deck-builder-list.selected{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .deck-builder-visual-card{min-height:290px!important;grid-template-rows:auto 138px auto minmax(34px,auto) auto auto!important;}
  .deck-builder-visual-card .collection-card-art{height:138px!important;min-height:138px!important;}
  .card-shop-grid{grid-template-columns:repeat(2,minmax(130px,1fr))!important;}
}

/* v84.1: 카드 종류별로 능력치 행이 없는 경우에도 정보 행이 밀리지 않도록 고정 */
.deck-builder-visual-card{grid-template-rows:auto 154px auto auto auto auto!important;}
.deck-builder-visual-card>.collection-card-title{grid-row:1;}
.deck-builder-visual-card>.collection-card-art{grid-row:2;}
.deck-builder-visual-card>.collection-five-stats{grid-row:3;}
.deck-builder-visual-card>.collection-extra{grid-row:4;}
.deck-builder-visual-card>.collection-card-foot{grid-row:5;}
.deck-builder-visual-card>.deck-card-controls{grid-row:6;}
.card-shop-grid .shop-card{grid-template-rows:46px minmax(0,1fr) auto auto!important;}
.card-shop-grid .shop-card>.collection-card-title{grid-row:1;}
.card-shop-grid .shop-card>.collection-card-art{grid-row:2;}
.card-shop-grid .shop-card>.collection-five-stats{grid-row:3;min-height:31px;box-sizing:border-box;}
.card-shop-grid .shop-card>.collection-extra{grid-row:4;min-height:36px!important;box-sizing:border-box;}
@media(max-width:850px){
  .deck-builder-visual-card{grid-template-rows:auto 138px auto auto auto auto!important;}
}

/* ================================================================
   v85 — 덱 편집·카드 상점 표시 통일 / 이름 클릭 전용 확대
   ================================================================ */
.collection-card-title{
  min-height:50px!important;
  padding:5px 6px!important;
  align-items:start!important;
}
.collection-card-heading{
  min-width:0;
  display:flex;
  align-items:baseline;
  align-content:flex-start;
  column-gap:6px;
  row-gap:2px;
  flex-wrap:wrap;
  line-height:1.18;
}
.collection-card-heading .collection-card-name{
  flex:0 1 auto;
  max-width:100%;
  font-size:13px!important;
  line-height:1.2!important;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.collection-card-heading small{
  min-width:0;
  font-size:9px!important;
  font-weight:800;
  color:#d8c39b;
  white-space:normal;
  line-height:1.25;
}
.collection-card-name.zoomable-card-name{cursor:zoom-in;text-decoration:underline dotted rgba(255,225,166,.45);text-underline-offset:3px;}

.deck-builder-visual-card{
  min-height:326px!important;
  grid-template-rows:50px 160px auto minmax(48px,auto) auto!important;
}
.deck-builder-visual-card>.collection-card-title{grid-row:1!important;}
.deck-builder-visual-card>.collection-card-art{grid-row:2!important;height:160px!important;min-height:160px!important;}
.deck-builder-visual-card>.collection-five-stats{grid-row:3!important;}
.deck-builder-visual-card>.collection-extra{grid-row:4!important;}
.deck-builder-visual-card>.deck-card-controls{grid-row:5!important;}
.deck-builder-visual-card>.collection-card-foot{display:none!important;}
.deck-builder-visual-card .collection-five-stats{
  min-height:36px!important;
  display:flex!important;
  align-items:center;
  justify-content:center;
  padding:6px 5px!important;
  font-size:11px!important;
  line-height:1.35!important;
  white-space:normal!important;
}
.deck-builder-visual-card .collection-extra{
  min-height:48px!important;
  max-height:66px!important;
  padding:7px 7px!important;
  font-size:12px!important;
  font-weight:750!important;
  line-height:1.42!important;
  overflow:auto!important;
}
.deck-card-controls{min-height:30px!important;}
.deck-builder-list.selected .deck-builder-visual-card{min-height:326px!important;}

.card-shop-box{width:min(1260px,98vw)!important;}
.card-shop-toolbar{
  display:grid!important;
  grid-template-columns:110px 100px 82px 92px minmax(170px,1fr) 86px!important;
  gap:6px!important;
  align-items:end!important;
}
.card-shop-toolbar>*{min-width:0!important;}
.card-shop-toolbar label{min-width:0!important;}
.card-shop-toolbar select,.card-shop-toolbar input{width:100%!important;min-width:0!important;}
.card-shop-count{
  min-width:0!important;
  height:32px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:4px!important;
  padding:0 6px!important;
  white-space:nowrap!important;
}
.card-shop-count span,.card-shop-count small{font-size:9px;color:#cdbb9e;}
.card-shop-count b{font-size:18px!important;line-height:1!important;}
.card-shop-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-rows:max-content!important;
  align-items:start!important;
  align-content:start!important;
  gap:8px!important;
  padding:8px!important;
}
.card-shop-grid .shop-card{
  width:100%!important;
  height:auto!important;
  min-height:292px!important;
  display:grid!important;
  grid-template-rows:50px 160px auto minmax(48px,auto)!important;
  overflow:hidden!important;
  cursor:default!important;
  box-sizing:border-box!important;
}
.card-shop-grid .shop-card>.collection-card-title{grid-row:1!important;}
.card-shop-grid .shop-card>.collection-card-art{grid-row:2!important;height:160px!important;min-height:160px!important;}
.card-shop-grid .shop-card>.collection-five-stats{grid-row:3!important;}
.card-shop-grid .shop-card>.collection-extra{grid-row:4!important;}
.card-shop-grid .collection-five-stats{
  min-height:36px!important;
  display:flex!important;
  align-items:center;
  justify-content:center;
  padding:6px 5px!important;
  font-size:11px!important;
  line-height:1.35!important;
  white-space:normal!important;
}
.card-shop-grid .collection-extra{
  min-height:48px!important;
  max-height:66px!important;
  padding:7px 7px!important;
  font-size:12px!important;
  font-weight:750!important;
  line-height:1.42!important;
  overflow:auto!important;
}

/* 전투 카드 본문은 선택·소환에 사용하며, 이름만 확대한다. */
.card .cimg,.base-unit-art{cursor:pointer!important;}
.card .card-name-text.zoomable-card-name,.field-unit-name.zoomable-card-name,.base-unit-name-click.zoomable-card-name,.advisor-name-click.zoomable-card-name,.advisor-hand-name-click.zoomable-card-name{cursor:zoom-in!important;}

@media(max-width:1050px){
  .card-shop-toolbar{grid-template-columns:100px 92px 76px 84px minmax(140px,1fr) 78px!important;gap:4px!important;}
  .card-shop-toolbar select,.card-shop-toolbar input{font-size:10px!important;}
}
@media(max-width:850px){
  .card-shop-toolbar{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  .card-shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .deck-builder-visual-card{grid-template-rows:50px 142px auto minmax(48px,auto) auto!important;}
  .deck-builder-visual-card>.collection-card-art{height:142px!important;min-height:142px!important;}
  .card-shop-grid .shop-card{grid-template-rows:50px 142px auto minmax(48px,auto)!important;}
  .card-shop-grid .shop-card>.collection-card-art{height:142px!important;min-height:142px!important;}
}
@media(max-width:560px){
  .card-shop-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .deck-builder-list,.deck-builder-list.selected,.card-shop-grid{grid-template-columns:1fr!important;}
}


/* ================================================================
   v86 — 핸드 카드 비율 통일 / 더블클릭 덱 편집 / 이미지 설정 동기화
   ================================================================ */
.auto-point-rule-form{grid-template-columns:minmax(220px,360px)!important;justify-content:center!important;}
.deck-builder-list,.deck-builder-list.selected,.card-shop-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-rows:max-content!important;
  align-items:start!important;
  align-content:start!important;
  gap:7px!important;
  padding:7px!important;
}
.deck-builder-visual-card,.card-shop-grid .shop-card{
  position:relative!important;
  width:100%!important;
  height:214px!important;
  min-height:214px!important;
  max-height:214px!important;
  padding:0!important;
  display:grid!important;
  grid-template-rows:22px 118px 34px 40px!important;
  gap:0!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
  border-radius:4px!important;
  background:linear-gradient(180deg,#151719,#0b0d0f)!important;
  cursor:default!important;
}
.deck-builder-visual-card>.collection-card-title,.card-shop-grid .shop-card>.collection-card-title{
  grid-row:1!important;
  min-height:22px!important;
  height:22px!important;
  padding:2px 4px!important;
  align-items:center!important;
  background:linear-gradient(180deg,#3d2a1f,#1c1511)!important;
  border-bottom:1px solid #7f6039!important;
}
.collection-card-heading{display:flex!important;align-items:center!important;gap:4px!important;flex-wrap:nowrap!important;overflow:hidden!important;}
.collection-card-heading .collection-card-name{font-size:10px!important;line-height:1!important;max-width:48%!important;}
.collection-card-heading small{font-size:7px!important;line-height:1!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
.collection-card-title>em{font-size:8px!important;padding:1px 3px!important;align-self:center!important;}
.deck-builder-visual-card>.collection-card-art,.card-shop-grid .shop-card>.collection-card-art{
  grid-row:2!important;
  height:118px!important;
  min-height:118px!important;
  max-height:118px!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  background:#15120f!important;
}
.collection-card-art .card-art-img,.collection-card-art .configured-default-art,.collection-card-art .auto-folder-art{
  width:100%!important;height:100%!important;object-fit:cover!important;
  object-position:var(--img-x,50%) var(--img-y,50%)!important;
  transform:scale(var(--img-scale,1))!important;
  transform-origin:var(--img-x,50%) var(--img-y,50%)!important;
}
.collection-card-icons{right:4px!important;bottom:4px!important;gap:3px!important;}
.collection-card-icons span{font-size:8px!important;padding:2px 4px!important;}
.deck-builder-visual-card>.collection-five-stats,.card-shop-grid .shop-card>.collection-five-stats{
  grid-row:3!important;
  height:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:2px 3px!important;
  margin:0!important;
  border-radius:0!important;
  font-size:9px!important;
  font-weight:950!important;
  line-height:1.15!important;
  letter-spacing:0!important;
  white-space:normal!important;
  overflow:hidden!important;
  background:linear-gradient(180deg,#131619,#0d1012)!important;
  border-top:1px solid #374450!important;
  border-bottom:1px solid #374450!important;
}
.collection-five-stats.item-bonus-stats{color:#fff0ae!important;}
.deck-builder-visual-card>.collection-extra,.card-shop-grid .shop-card>.collection-extra{
  grid-row:4!important;
  height:40px!important;
  min-height:40px!important;
  max-height:40px!important;
  padding:5px 6px!important;
  margin:0!important;
  font-size:10px!important;
  font-weight:800!important;
  line-height:1.32!important;
  display:-webkit-box!important;
  -webkit-line-clamp:2!important;
  -webkit-box-orient:vertical!important;
  overflow:hidden!important;
  background:#101318!important;
  color:#ded5c6!important;
}
.deck-builder-visual-card.selected{border-color:#c99b55!important;box-shadow:inset 0 0 0 1px #6f4a20!important;}
.deck-builder-visual-card[data-deck-card]::after,.deck-builder-visual-card[data-selected-card]::after{
  content:'더블클릭';position:absolute;left:4px;top:26px;z-index:8;padding:2px 4px;border-radius:3px;
  background:rgba(0,0,0,.65);border:1px solid rgba(255,221,151,.45);color:#f7dfa8;font-size:7px;font-weight:900;pointer-events:none;
}
.deck-owned-compact{position:absolute;left:4px;bottom:43px;z-index:9;display:flex;align-items:center;gap:2px;height:20px;padding:1px 3px;border:1px solid #80643c;background:rgba(5,8,11,.86);border-radius:4px;}
.deck-owned-compact small{font-size:7px;color:#d9c79f;}
.deck-owned-compact button{width:17px!important;height:17px!important;min-height:17px!important;padding:0!important;border:1px solid #80643c!important;background:#1b2027!important;color:#ffe1a3!important;font-size:11px!important;line-height:1!important;border-radius:3px!important;}
.deck-owned-compact em{min-width:15px;text-align:center;font-size:9px;font-style:normal;font-weight:950;color:#fff;}
.deck-builder-visual-card>.deck-card-controls,.deck-builder-visual-card>.collection-card-foot{display:none!important;}
.card-shop-grid .shop-card{cursor:default!important;}
.collection-card-name.zoomable-card-name{cursor:zoom-in!important;}
@media(max-width:850px){
  .deck-builder-list,.deck-builder-list.selected,.card-shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .deck-builder-visual-card,.card-shop-grid .shop-card{height:205px!important;min-height:205px!important;max-height:205px!important;grid-template-rows:22px 109px 34px 40px!important;}
  .deck-builder-visual-card>.collection-card-art,.card-shop-grid .shop-card>.collection-card-art{height:109px!important;min-height:109px!important;max-height:109px!important;}
}
@media(max-width:560px){.deck-builder-list,.deck-builder-list.selected,.card-shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}.collection-card-heading small{display:none!important;}}


/* v86 final — 전투 핸드 카드 실제 크기 + 설명 1줄 */
.deck-builder-list,.deck-builder-list.selected,.card-shop-grid{
  grid-template-columns:repeat(3,var(--collection-card-width,118px))!important;
  justify-content:start!important;
  justify-items:start!important;
}
.deck-builder-visual-card,.card-shop-grid .shop-card{
  width:var(--collection-card-width,118px)!important;
  min-width:var(--collection-card-width,118px)!important;
  max-width:var(--collection-card-width,118px)!important;
  height:var(--collection-card-height,232px)!important;
  min-height:var(--collection-card-height,232px)!important;
  max-height:var(--collection-card-height,232px)!important;
  grid-template-rows:var(--collection-card-title-height,22px) var(--collection-card-art-height,136px) var(--collection-card-stats-height,34px) var(--collection-card-desc-height,40px)!important;
}
.deck-builder-visual-card>.collection-card-title,.card-shop-grid .shop-card>.collection-card-title{
  height:var(--collection-card-title-height,22px)!important;
  min-height:var(--collection-card-title-height,22px)!important;
}
.deck-builder-visual-card>.collection-card-art,.card-shop-grid .shop-card>.collection-card-art{
  height:var(--collection-card-art-height,136px)!important;
  min-height:var(--collection-card-art-height,136px)!important;
  max-height:var(--collection-card-art-height,136px)!important;
}
.deck-builder-visual-card>.collection-five-stats,.card-shop-grid .shop-card>.collection-five-stats{
  height:var(--collection-card-stats-height,34px)!important;
  min-height:var(--collection-card-stats-height,34px)!important;
  max-height:var(--collection-card-stats-height,34px)!important;
  font-size:8px!important;
}
.deck-builder-visual-card>.collection-extra,.card-shop-grid .shop-card>.collection-extra{
  height:var(--collection-card-desc-height,40px)!important;
  min-height:var(--collection-card-desc-height,40px)!important;
  max-height:var(--collection-card-desc-height,40px)!important;
  font-size:9px!important;
}
.collection-card-heading .collection-card-name{max-width:45%!important;font-size:9px!important;}
.collection-card-heading small{font-size:6.5px!important;}
.collection-card-title>em{font-size:7px!important;}
@media(max-width:850px){
  .deck-builder-list,.deck-builder-list.selected,.card-shop-grid{grid-template-columns:repeat(2,var(--collection-card-width,112px))!important;}
  .deck-builder-visual-card,.card-shop-grid .shop-card{
    width:var(--collection-card-width,112px)!important;min-width:var(--collection-card-width,112px)!important;max-width:var(--collection-card-width,112px)!important;
    height:var(--collection-card-height,220px)!important;min-height:var(--collection-card-height,220px)!important;max-height:var(--collection-card-height,220px)!important;
    grid-template-rows:var(--collection-card-title-height,20px) var(--collection-card-art-height,128px) var(--collection-card-stats-height,32px) var(--collection-card-desc-height,40px)!important;
  }
}


/* ================================================================
   v87 — 덱 편집 5열/4열 · 카드 폭 10% 확대 · 독립 본진 진영
   ================================================================ */
.deck-builder-box{width:min(1580px,99vw)!important;}
.deck-builder-main{
  grid-template-columns:minmax(690px,5fr) minmax(550px,4fr)!important;
  gap:10px!important;
}
.deck-builder-list{
  grid-template-columns:repeat(5,var(--collection-card-width,130px))!important;
  gap:8px!important;
  justify-content:start!important;
  justify-items:start!important;
  overflow:auto!important;
}
.deck-builder-list.selected{
  grid-template-columns:repeat(4,var(--collection-card-width,130px))!important;
}
.card-shop-box{width:min(1040px,98vw)!important;}
.card-shop-grid{
  grid-template-columns:repeat(5,var(--collection-card-width,130px))!important;
  gap:8px!important;
  justify-content:start!important;
  justify-items:start!important;
}
.deck-card-entry,.shop-card-entry{
  width:var(--collection-card-width,130px)!important;
  min-width:var(--collection-card-width,130px)!important;
  max-width:var(--collection-card-width,130px)!important;
  display:grid!important;
  grid-template-rows:auto 24px!important;
  gap:4px!important;
  align-content:start!important;
}
.deck-card-entry .deck-builder-visual-card,.shop-card-entry .shop-card{
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
}
.deck-owned-compact{display:none!important;}
.deck-owned-outside,.shop-owned-outside{
  height:24px!important;
  min-height:24px!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:4px!important;
  padding:2px 4px!important;
  border:1px solid #80643c!important;
  border-radius:4px!important;
  background:#0b0f14!important;
  color:#e6d2aa!important;
  font-size:8px!important;
  font-weight:900!important;
}
.deck-owned-outside small{font-size:8px!important;color:#d9c79f!important;}
.deck-owned-outside button{
  width:19px!important;height:19px!important;min-height:19px!important;padding:0!important;
  border:1px solid #80643c!important;background:#1b2027!important;color:#ffe1a3!important;
  font-size:12px!important;line-height:1!important;border-radius:3px!important;cursor:pointer!important;
}
.deck-owned-outside em{min-width:18px!important;text-align:center!important;font-size:10px!important;font-style:normal!important;color:#fff!important;}
.deck-builder-visual-card>.collection-five-stats,.card-shop-grid .shop-card>.collection-five-stats{
  white-space:nowrap!important;
  flex-wrap:nowrap!important;
  font-size:7.6px!important;
  letter-spacing:-.035em!important;
  padding-left:1px!important;
  padding-right:1px!important;
}
/* 현재 덱과 카드 상점은 설명을 최대 3줄 높이로 표시하고, 초과분은 내부 스크롤/툴팁으로 확인 */
.deck-builder-list.selected .deck-builder-visual-card,.card-shop-grid .shop-card{
  height:calc(var(--collection-card-height,232px) + 18px)!important;
  min-height:calc(var(--collection-card-height,232px) + 18px)!important;
  max-height:calc(var(--collection-card-height,232px) + 18px)!important;
  grid-template-rows:var(--collection-card-title-height,22px) var(--collection-card-art-height,136px) var(--collection-card-stats-height,34px) calc(var(--collection-card-desc-height,40px) + 18px)!important;
}
.deck-builder-list.selected .collection-extra,.card-shop-grid .collection-extra{
  height:calc(var(--collection-card-desc-height,40px) + 18px)!important;
  min-height:calc(var(--collection-card-desc-height,40px) + 18px)!important;
  max-height:calc(var(--collection-card-desc-height,40px) + 18px)!important;
  display:block!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-line-clamp:unset!important;
  scrollbar-width:thin!important;
  scrollbar-color:#80643c #101318!important;
}
.deck-builder-list.selected .collection-extra::-webkit-scrollbar,.card-shop-grid .collection-extra::-webkit-scrollbar{width:4px!important;}
.deck-builder-list.selected .collection-extra::-webkit-scrollbar-thumb,.card-shop-grid .collection-extra::-webkit-scrollbar-thumb{background:#80643c!important;border-radius:4px!important;}

/* 본진 전투필드는 본진 이미지 내부가 아니라 아군 1열 바로 아래의 독립 전투열로 표시 */
.ally-hq-defense-lane[hidden],.ally-hq-defense-lane.inactive{display:none!important;}
.ally-hq-defense-lane.active{
  display:block!important;
  border:3px solid #ffe27a!important;
  background:linear-gradient(180deg,rgba(76,57,19,.82),rgba(17,23,32,.94))!important;
  box-shadow:0 0 0 2px rgba(255,176,43,.46),0 0 30px rgba(255,205,80,.62),inset 0 0 24px rgba(255,211,96,.24)!important;
  animation:allyBaseLaneGlow 1.3s ease-in-out infinite alternate!important;
}
.ally-hq-defense-lane.active .label{
  color:#fff6c8!important;
  font-weight:1000!important;
  text-shadow:0 0 8px #ffcf55,0 0 14px #ff9d2d!important;
  z-index:5!important;
}
.ally-hq-defense-lane .hq-battlefield-grid{
  width:100%!important;
  max-width:none!important;
  height:100%!important;
  min-height:0!important;
  padding:7px 8px 5px!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:7px!important;
  border:0!important;
  border-radius:8px!important;
  background:rgba(6,10,17,.64)!important;
  box-shadow:inset 0 0 18px rgba(255,210,94,.13)!important;
}
.ally-hq-defense-lane .hq-field-slot{
  height:100%!important;
  min-height:120px!important;
  border:2px dashed rgba(255,231,151,.68)!important;
  background:linear-gradient(145deg,rgba(58,43,18,.62),rgba(7,14,24,.8))!important;
  box-shadow:inset 0 0 13px rgba(255,210,100,.12)!important;
}
.ally-hq-defense-lane .hq-field-slot.valid,.ally-hq-defense-lane .hq-field-slot.empty:hover{
  border-style:solid!important;
  border-color:#fff09a!important;
  box-shadow:0 0 18px rgba(255,225,103,.62),inset 0 0 18px rgba(255,218,91,.25)!important;
}
@keyframes allyBaseLaneGlow{
  from{filter:brightness(1);}
  to{filter:brightness(1.13);}
}

@media(max-width:1280px){
  .deck-builder-box{width:min(1240px,99vw)!important;}
  .deck-builder-main{grid-template-columns:minmax(520px,4fr) minmax(410px,3fr)!important;}
  .deck-builder-list{grid-template-columns:repeat(4,var(--collection-card-width,130px))!important;}
  .deck-builder-list.selected{grid-template-columns:repeat(3,var(--collection-card-width,130px))!important;}
  .card-shop-grid{grid-template-columns:repeat(4,var(--collection-card-width,130px))!important;}
}
@media(max-width:980px){
  .deck-builder-main{grid-template-columns:1fr!important;overflow:auto!important;}
  .deck-builder-list{grid-template-columns:repeat(3,var(--collection-card-width,130px))!important;max-height:430px!important;}
  .deck-builder-list.selected{grid-template-columns:repeat(3,var(--collection-card-width,130px))!important;max-height:430px!important;}
  .card-shop-grid{grid-template-columns:repeat(3,var(--collection-card-width,130px))!important;}
}
@media(max-width:650px){
  .deck-builder-list,.deck-builder-list.selected,.card-shop-grid{grid-template-columns:repeat(2,var(--collection-card-width,123px))!important;}
  .ally-hq-defense-lane .hq-battlefield-grid{gap:3px!important;padding:5px 4px!important;}
  .ally-hq-defense-lane .hq-field-slot{min-height:88px!important;}
}


/* v87 검증 보정: 전투 시작 전에도 10% 확대 기본폭을 유지하고 선택/상점 설명 우선순위를 고정 */
:root{--collection-card-width:130px;}
.deck-builder-list.selected>.deck-builder-visual-card{
  width:var(--collection-card-width,130px)!important;
  min-width:var(--collection-card-width,130px)!important;
  max-width:var(--collection-card-width,130px)!important;
}
.deck-builder-list.selected>.deck-builder-visual-card>.collection-extra,
.card-shop-grid .shop-card>.collection-extra{
  height:calc(var(--collection-card-desc-height,40px) + 18px)!important;
  min-height:calc(var(--collection-card-desc-height,40px) + 18px)!important;
  max-height:calc(var(--collection-card-desc-height,40px) + 18px)!important;
  display:block!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-line-clamp:unset!important;
  scrollbar-width:thin!important;
  scrollbar-color:#80643c #101318!important;
}


/* ================================================================
   v88 — 6/5/7열 카드 배열 · 다중 이름 덱 · 본진 소환 보정
   ================================================================ */
.deck-builder-box{width:min(1840px,99.5vw)!important;}
.deck-builder-main{grid-template-columns:minmax(830px,6fr) minmax(700px,5fr)!important;gap:10px!important;}
.deck-builder-list{grid-template-columns:repeat(6,var(--collection-card-width,130px))!important;}
.deck-builder-list.selected{grid-template-columns:repeat(5,var(--collection-card-width,130px))!important;}
.card-shop-box{width:min(1160px,99vw)!important;}
.card-shop-grid{grid-template-columns:repeat(7,var(--collection-card-width,130px))!important;}
.deck-builder-visual-card[data-deck-card]::after,.deck-builder-visual-card[data-selected-card]::after{content:none!important;display:none!important;}
.deck-builder-toolbar{grid-template-columns:88px minmax(135px,1.2fr) minmax(130px,1.2fr) 66px 88px 88px 82px minmax(150px,1.3fr) 78px 88px!important;align-items:end!important;}
.deck-builder-toolbar>.deck-new-btn{height:34px!important;align-self:end!important;padding:5px 7px!important;white-space:nowrap!important;}
#deckBuilderName{height:34px!important;box-sizing:border-box!important;}
@media(max-width:1560px){
  .deck-builder-box{width:min(1500px,99.5vw)!important;}
  .deck-builder-main{grid-template-columns:minmax(690px,5fr) minmax(550px,4fr)!important;}
  .deck-builder-list{grid-template-columns:repeat(5,var(--collection-card-width,130px))!important;}
  .deck-builder-list.selected{grid-template-columns:repeat(4,var(--collection-card-width,130px))!important;}
  .card-shop-grid{grid-template-columns:repeat(6,var(--collection-card-width,130px))!important;}
}
@media(max-width:1280px){
  .deck-builder-list{grid-template-columns:repeat(4,var(--collection-card-width,130px))!important;}
  .deck-builder-list.selected{grid-template-columns:repeat(3,var(--collection-card-width,130px))!important;}
  .card-shop-grid{grid-template-columns:repeat(5,var(--collection-card-width,130px))!important;}
  .deck-builder-toolbar{grid-template-columns:repeat(5,minmax(105px,1fr))!important;}
}
@media(max-width:980px){
  .deck-builder-list,.deck-builder-list.selected{grid-template-columns:repeat(3,var(--collection-card-width,130px))!important;}
  .card-shop-grid{grid-template-columns:repeat(3,var(--collection-card-width,130px))!important;}
}
@media(max-width:650px){
  .deck-builder-list,.deck-builder-list.selected,.card-shop-grid{grid-template-columns:repeat(2,var(--collection-card-width,123px))!important;}
}

/* ================================================================
   v89 — 6/5/7열 그리드에 맞춘 모달 폭 정밀 조정
   ================================================================ */
@media(min-width:1561px){
  /* 카드 목록 6장 + 현재 덱 5장이 각 패널을 빈틈없이 채우는 폭 */
  .deck-builder-box{
    width:min(1570px,99.5vw)!important;
  }
  .deck-builder-main{
    grid-template-columns:836px 698px!important;
    justify-content:start!important;
  }
  .deck-builder-list{
    grid-template-columns:repeat(6,var(--collection-card-width,130px))!important;
  }
  .deck-builder-list.selected{
    grid-template-columns:repeat(5,var(--collection-card-width,130px))!important;
  }

  /* 카드 7장과 6개 간격, 좌우 패딩만 남기는 상점 폭 */
  .card-shop-box{
    width:min(974px,99vw)!important;
  }
  .card-shop-grid{
    grid-template-columns:repeat(7,var(--collection-card-width,130px))!important;
    justify-content:start!important;
  }
}

/* v89 정밀 보정: 런타임에서 계산된 실제 카드 폭을 모달 폭에 반영 */
@media(min-width:1561px){
  .deck-builder-box{
    width:min(calc(
      var(--collection-card-width,130px) + var(--collection-card-width,130px) +
      var(--collection-card-width,130px) + var(--collection-card-width,130px) +
      var(--collection-card-width,130px) + var(--collection-card-width,130px) +
      var(--collection-card-width,130px) + var(--collection-card-width,130px) +
      var(--collection-card-width,130px) + var(--collection-card-width,130px) +
      var(--collection-card-width,130px) + 140px
    ),99.5vw)!important;
  }
  .deck-builder-main{
    grid-template-columns:
      calc(
        var(--collection-card-width,130px) + var(--collection-card-width,130px) +
        var(--collection-card-width,130px) + var(--collection-card-width,130px) +
        var(--collection-card-width,130px) + var(--collection-card-width,130px) + 56px
      )
      calc(
        var(--collection-card-width,130px) + var(--collection-card-width,130px) +
        var(--collection-card-width,130px) + var(--collection-card-width,130px) +
        var(--collection-card-width,130px) + 48px
      )!important;
  }
  .deck-builder-list.selected{gap:8px!important;}
  .card-shop-box{
    width:min(calc(
      var(--collection-card-width,130px) + var(--collection-card-width,130px) +
      var(--collection-card-width,130px) + var(--collection-card-width,130px) +
      var(--collection-card-width,130px) + var(--collection-card-width,130px) +
      var(--collection-card-width,130px) + 64px
    ),99vw)!important;
  }
}

.event-image-effect-line{margin-top:8px}
.event-image-effect-line label{display:flex;flex-direction:column;gap:6px;color:#d7e4f5;font-size:12px;font-weight:700}
.sss-effect-panel{margin-top:8px;padding:14px;border:1px solid #2d4465;border-radius:14px;background:#0a1524}
.sss-effect-panel.disabled{opacity:.55}
.sss-effect-head{display:flex;flex-direction:column;gap:4px;margin-bottom:12px;color:#d7e6fb}
.sss-effect-head span{font-size:12px;color:#9fb5d3}
.sss-effect-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}
.sss-trigger-box{padding:12px;border:1px solid #233650;border-radius:12px;background:#09111d;display:flex;flex-direction:column;gap:10px}
.sss-trigger-title label{display:flex;align-items:center;gap:8px;font-weight:800;color:#f7fbff}
.sss-trigger-fields{display:grid;grid-template-columns:1.2fr .8fr;gap:10px}
.sss-trigger-fields label,.sss-effect-stat{display:flex;flex-direction:column;gap:6px;font-size:12px;color:#cfe0f8}
.sss-effect-stat-list{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.sss-effect-stat label{font-weight:700}
.sss-effect-stat input[type="number"],.sss-trigger-fields input,.sss-trigger-fields select{width:100%}
.sss-effect-summary{padding:8px 10px;border-radius:10px;background:#102038;color:#f0f6ff;font-size:12px;line-height:1.45;border:1px solid #ffffff18}
@media (max-width:900px){.sss-effect-stat-list,.sss-trigger-fields{grid-template-columns:1fr}}

.manager-scene-lock{margin-top:9px;padding:8px 10px;border:1px solid #385274;border-radius:10px;background:#0d1a2a;color:#e5f0ff;display:flex;align-items:center;gap:8px;font-size:12px;font-weight:800}
.manager-scene-lock small{margin-left:auto;color:#9eb2cc;font-size:10px;font-weight:600}
.manager-scene-lock input{accent-color:#efb84b}


/* v93: 핸드 버프 표시를 카드 중앙보다 약간 아래로 이동 */
#hand.hand .card .hand-buff-provider-badge{
  left:50%!important;right:auto!important;top:60%!important;bottom:auto!important;
  transform:translate(-50%,-50%)!important;min-width:78px!important;max-width:calc(100% - 12px)!important;
  z-index:28!important;text-align:center!important;
}
#enemyHq .hq-stat-chip.deck{display:inline-flex!important;color:#ffe3a2!important}

/* ================================================================
   v94 — 부활 위치 선택 · 전투 메뉴/덱 조작부 정렬
   ================================================================ */
.left-menu-dock .top-card-actions,
.left-bottom-actions{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:6px!important;
}
.left-menu-dock .top-card-actions .btn,
.left-bottom-actions .btn{
  width:100%!important;
  height:var(--battle-control-height,34px)!important;
  min-height:var(--battle-control-height,34px)!important;
  max-height:var(--battle-control-height,34px)!important;
  padding:4px 6px!important;
  font-size:12px!important;
  font-weight:900!important;
  box-sizing:border-box!important;
}

.reference-right .formation-control{padding:6px!important;gap:5px!important;}
.reference-right .formation-inline{
  display:grid!important;
  grid-template-columns:72px minmax(112px,1fr) 58px!important;
  gap:6px!important;
  align-items:center!important;
}
.reference-right .formation-inline #allyFormationSelect{
  width:72px!important;min-width:72px!important;max-width:72px!important;flex-basis:72px!important;
  padding:3px 2px!important;font-size:11px!important;
}
.reference-right .formation-inline #battleDeckSelect{
  width:100%!important;min-width:0!important;max-width:none!important;
  padding:3px 5px!important;font-size:11px!important;text-overflow:ellipsis!important;
}
.reference-right .formation-inline .formation-deck-btn{
  width:58px!important;min-width:58px!important;max-width:58px!important;
  padding:3px 4px!important;font-size:11px!important;white-space:nowrap!important;
}

.reference-right .right-deck-body{
  display:flex!important;
  grid-template-columns:none!important;
  align-items:stretch!important;
  padding:6px!important;
  gap:6px!important;
}
.reference-right .right-deck-body .deck-stack{display:none!important;}
.reference-right .right-action-mount{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:var(--battle-control-height,34px)!important;
  gap:6px!important;
  padding:0!important;
  width:100%!important;
  flex:1 1 auto!important;
  align-items:stretch!important;
}
.reference-right .right-action-mount .deck-info,
.reference-right .right-action-mount #shuffleBtn,
.reference-right .right-action-mount #endTurnBtn,
.reference-right .right-action-mount #battleControlBtn{
  grid-column:auto!important;
  grid-row:auto!important;
  width:100%!important;
  min-width:0!important;
  height:var(--battle-control-height,34px)!important;
  min-height:var(--battle-control-height,34px)!important;
  max-height:var(--battle-control-height,34px)!important;
  margin:0!important;
  padding:3px 4px!important;
  box-sizing:border-box!important;
  font-size:11px!important;
  font-weight:900!important;
  line-height:1.05!important;
  white-space:nowrap!important;
}
.reference-right .right-action-mount .deck-info{
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  border:1px solid #6b5131!important;
  border-radius:6px!important;
  background:linear-gradient(180deg,#1c1711,#0d0b08)!important;
  color:#f3dfb7!important;
}
.reference-right .right-action-mount .deck-info b{font-size:13px!important;line-height:1!important;}
.reference-right .right-action-mount .deck-help{display:block!important;font-size:8px!important;line-height:1!important;color:#a99a82!important;}
body.prebattle .reference-right .right-deck-body{
  pointer-events:auto!important;
  filter:saturate(.88) brightness(.9)!important;
}
body.prebattle #shuffleBtn,body.prebattle #endTurnBtn{pointer-events:none!important;opacity:.55!important;}

.revive-select-box{width:min(780px,94vw)!important;max-height:82vh!important;display:flex!important;flex-direction:column!important;gap:12px!important;}
.revive-select-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;}
.revive-select-head h2{margin:0 0 4px;}
.revive-candidate-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;overflow:auto;padding:2px 2px 8px;}
.revive-candidate-card{display:grid;grid-template-columns:72px minmax(0,1fr);gap:9px;align-items:center;padding:8px;border:1px solid #3a506e;border-radius:10px;background:linear-gradient(145deg,#0e1a2a,#080d15);color:#eef5ff;text-align:left;cursor:pointer;}
.revive-candidate-card:hover{border-color:#ffe287;box-shadow:0 0 14px rgba(255,221,102,.34);transform:translateY(-1px);}
.revive-candidate-art{height:92px;overflow:hidden;border-radius:7px;background:#070b10;}
.revive-candidate-art .cimg{height:100%!important;min-height:100%!important;}
.revive-candidate-info{display:flex;flex-direction:column;gap:6px;min-width:0;}
.revive-candidate-info b{font-size:14px;color:#fff0bf;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.revive-candidate-info small{font-size:10px;line-height:1.4;color:#b9c9dd;}
.slot.revive-target{border:2px solid #fff09a!important;background:linear-gradient(145deg,rgba(255,228,112,.28),rgba(28,48,78,.64))!important;box-shadow:0 0 18px rgba(255,232,122,.82),inset 0 0 16px rgba(255,228,102,.22)!important;animation:reviveTargetPulse .85s ease-in-out infinite alternate!important;cursor:pointer!important;}
@keyframes reviveTargetPulse{from{filter:brightness(1)}to{filter:brightness(1.28)}}
@media(max-width:760px){.revive-candidate-list{grid-template-columns:1fr!important}.reference-right .formation-inline{grid-template-columns:66px minmax(96px,1fr) 56px!important}.reference-right .formation-inline #allyFormationSelect{width:66px!important;min-width:66px!important;max-width:66px!important}}

/* v94 최종 치수 보정 */
#cardShopBtn,#cardManagerBtn,#settingsBtn,#rulesBtn{
  height:var(--battle-control-height,42px)!important;
  min-height:var(--battle-control-height,42px)!important;
  max-height:var(--battle-control-height,42px)!important;
  padding:4px 6px!important;
  box-sizing:border-box!important;
  font-size:12px!important;
  font-weight:900!important;
}
.reference-right .compact-settings-holder .formation-inline #allyFormationSelect{
  width:72px!important;min-width:72px!important;max-width:72px!important;flex:0 0 72px!important;
}
.reference-right .compact-settings-holder .formation-inline #battleDeckSelect{
  width:100%!important;min-width:0!important;max-width:none!important;flex:1 1 auto!important;
}
#leftMenuMount .top-card-actions{grid-auto-rows:var(--battle-control-height,42px)!important;}
#leftMenuMount .top-card-actions #cardShopBtn,
#leftMenuMount .top-card-actions #cardManagerBtn{
  height:var(--battle-control-height,42px)!important;
  min-height:var(--battle-control-height,42px)!important;
  max-height:var(--battle-control-height,42px)!important;
  padding:4px 6px!important;
}


/* v95: 전투 조작 순서 고정 · 항복/게임 시작 → 덱 장수 → 셔플 → 턴 종료 */
.reference-right .right-action-mount #battleControlBtn{grid-column:1!important;grid-row:1!important;}
.reference-right .right-action-mount .deck-info{grid-column:2!important;grid-row:1!important;}
.reference-right .right-action-mount #shuffleBtn{grid-column:3!important;grid-row:1!important;}
.reference-right .right-action-mount #endTurnBtn{grid-column:4!important;grid-row:1!important;}

/* v96: 일괄설정과 개별 장수 연출 설정 분리 */
#batchSettingsModal [hidden]{display:none!important}
.batch-shuttle-panel{display:grid;gap:12px;padding:12px;border:1px solid #3e5f80;border-radius:12px;background:linear-gradient(180deg,#0e1b2b,#08111d);margin-bottom:12px}
.batch-card-image-shuttle{display:grid;grid-template-columns:140px repeat(3,minmax(170px,1fr));gap:10px;align-items:center;padding:10px;border:1px solid #29425f;border-radius:10px;background:#0a1524}
.batch-card-image-shuttle label,.batch-scene-shuttle-card label{display:grid;grid-template-columns:auto 1fr auto;gap:7px;align-items:center;color:#dbe9fb;font-size:12px}
.batch-card-image-shuttle input[type="range"],.batch-scene-shuttle-card input[type="range"]{min-width:0;width:100%}
.batch-card-image-shuttle output,.batch-scene-shuttle-card output{min-width:42px;text-align:right;color:#9ed8ff;font-weight:800}
.batch-scene-shuttle-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.batch-scene-shuttle-card{display:grid;gap:8px;padding:11px;border:1px solid #36516f;border-radius:11px;background:linear-gradient(180deg,#101d2e,#09131f)}
.batch-scene-shuttle-card>b{color:#fff4d6;font-size:13px}
.batch-scene-shuttle-card select{grid-column:2/4;min-width:0}
.batch-image-preset-row{grid-template-columns:auto repeat(4,auto) repeat(3,72px) minmax(220px,1fr) auto auto auto!important;align-items:center!important}
.batch-preset-scene-summary{min-width:220px;padding:7px 9px;border-radius:8px;background:#0b1726;border:1px solid #29445f;color:#cfe4ff;font-size:11px;line-height:1.35}
.batch-mini-field input[readonly]{background:#07101b!important;color:#8fcfff!important;border-color:#29445f!important;cursor:default}
#batchSettingsModal[data-settings-mode="batch"] .batch-current-card{display:none!important}
#batchSettingsModal[data-settings-mode="individual"] .batch-settings-box{max-width:min(1280px,98vw)!important}
#batchSettingsModal[data-settings-mode="individual"] .event-image-manager{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important}
#batchSettingsModal[data-settings-mode="individual"] .event-image-setting{padding:12px!important;border-radius:12px!important;border-color:#4b6686!important;background:linear-gradient(180deg,#111d2c,#090f18)!important}
.event-image-preview.event-hq-live-preview{display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important;height:auto!important;min-height:calc(var(--stage-hq-height,170px) + 12px)!important;padding:6px!important;border:0!important;background:#04080e!important;overflow:visible!important}
.event-hq-preview-frame{position:relative!important;width:var(--stage-hq-width,320px)!important;height:var(--stage-hq-height,170px)!important;min-height:var(--stage-hq-height,170px)!important;max-width:100%!important;overflow:hidden!important;border:2px solid #ffffff38!important;box-shadow:0 12px 28px #000a,0 0 20px #6ebeff25!important}
.event-hq-preview-frame .hq-card-scene{inset:0!important}
.event-hq-preview-frame>.hq-title,.event-hq-preview-frame>.hq-subtitle{z-index:90!important;pointer-events:none}
.event-image-preview-actions{justify-content:center!important}
.event-image-preview-actions .btn{min-width:180px!important}
.event-image-manager>.image-adjust-title,.event-image-manager>.event-image-note{grid-column:1/-1!important}
@media(max-width:1100px){
  .batch-card-image-shuttle{grid-template-columns:1fr!important}
  .batch-scene-shuttle-grid,#batchSettingsModal[data-settings-mode="individual"] .event-image-manager{grid-template-columns:1fr!important}
  .batch-image-preset-row{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .batch-preset-scene-summary{grid-column:1/-1!important}
}


.batch-scene-shuttle-card .batch-scene-preview{margin-top:4px;min-height:var(--stage-hq-height,170px)}
.batch-scene-shuttle-card .batch-scene-preview-actions{justify-content:flex-end;padding-top:2px}
.batch-scene-shuttle-card .batch-scene-preview-actions .btn{min-height:30px!important;font-size:11px!important}
.batch-scene-shuttle-card .event-hq-preview-frame{width:min(100%,var(--stage-hq-width,320px));margin:0 auto}

.batch-settings-head-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.batch-settings-head-actions .btn{min-width:92px}
.batch-target-selector{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 12px;border:1px solid #365574;border-radius:10px;background:#0a1625;color:#dbe9fb}
.batch-target-selector>b{color:#fff1cf;margin-right:4px}
.batch-target-selector label{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:800;white-space:nowrap}
.batch-target-selector input{accent-color:#58aee8}
.individual-card-picker{display:grid!important;grid-template-columns:minmax(220px,.8fr) minmax(300px,1.2fr) minmax(220px,1fr);gap:10px;align-items:end}
.individual-card-picker label{display:grid;gap:5px;color:#d6e5f7;font-size:11px;font-weight:800}
.individual-card-picker input,.individual-card-picker select{width:100%;min-height:36px}
#individualCardMeta{display:flex;align-items:center;min-height:36px;padding:7px 10px;border:1px solid #385675;border-radius:8px;background:#0a1625;color:#f0d49a;font-size:12px;font-weight:800}
@media(max-width:900px){.individual-card-picker{grid-template-columns:1fr!important}.batch-settings-head-actions{width:100%}.batch-settings-head-actions .btn{flex:1}}


/* v99 · 셔틀은 이미지 위치·크기만 정적으로 표시 */
.event-hq-preview-frame .scene-static-image-layer{position:absolute;inset:0;z-index:4;overflow:hidden;background:#02050a;pointer-events:none}
.event-hq-preview-frame .scene-static-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;max-width:none;max-height:none;animation:none!important;transition:none!important;filter:none!important;opacity:1!important}
.event-hq-preview-frame .scene-static-guide{position:absolute;left:8px;right:8px;bottom:6px;z-index:6;padding:4px 7px;border:1px solid #ffffff38;background:#05080dd9;color:#f4ead7;font-size:10px;font-weight:900;letter-spacing:.02em;text-align:center;text-shadow:0 1px 4px #000}
.event-hq-preview-frame .scene-static-empty{position:absolute;inset:0;display:grid;place-items:center;color:#aebbc9;font-size:12px;font-weight:800;background:linear-gradient(135deg,#0c1724,#05090f)}
.event-hq-preview-frame>.hq-title,.event-hq-preview-frame>.hq-subtitle{z-index:7!important}

/* v100 · 셔틀값을 정적 이미지에 즉시 반영 */
.event-hq-preview-frame .scene-static-image{
  object-position:var(--preview-x,50%) var(--preview-y,50%)!important;
  transform-origin:var(--preview-x,50%) var(--preview-y,50%)!important;
  transform:scale(var(--preview-scale,1))!important;
  will-change:transform,object-position;
}

/* ================================================================
   v103 — 전투 준비 6장 카드 뒷면 및 전투 시작 플립 공개
   ================================================================ */
#hand.hand .card.opening-hand-card{
  perspective:1100px!important;
  transform:none!important;
  overflow:visible!important;
  isolation:isolate;
}
#hand.hand .card.opening-hand-card.selected{outline:none!important;transform:none!important}
#hand.hand .opening-hand-flipper{
  position:absolute;
  inset:0;
  z-index:2;
  width:100%;
  height:100%;
  transform-style:preserve-3d;
  transform:rotateY(0deg);
  transition:transform .72s cubic-bezier(.2,.72,.18,1);
  transition-delay:calc(var(--opening-card-index,0) * 90ms);
  will-change:transform;
}
#hand.hand .opening-card-face{
  position:absolute;
  inset:-1px;
  border-radius:inherit;
  overflow:hidden;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
  box-sizing:border-box;
}
#hand.hand .opening-card-front-face{
  display:grid;
  grid-template-rows:inherit;
  transform:rotateY(180deg);
  background:inherit;
  border:1px solid transparent;
}
#hand.hand .opening-card-back-face{
  display:grid;
  place-items:center;
  border:2px solid #b98a49;
  background:
    radial-gradient(circle at 50% 48%,rgba(210,166,89,.22) 0 13%,transparent 14% 100%),
    repeating-radial-gradient(circle at 50% 50%,transparent 0 16px,rgba(212,169,94,.12) 17px 18px),
    linear-gradient(145deg,#111b25,#05090d 68%,#171007);
  box-shadow:inset 0 0 0 3px #0b0d10,inset 0 0 0 5px #7b5428,inset 0 0 28px #000,0 7px 18px #000a;
}
#hand.hand .opening-card-back-face::before,
#hand.hand .opening-card-back-face::after{
  content:"";
  position:absolute;
  width:42px;
  height:42px;
  border-color:#a7793e;
  opacity:.75;
}
#hand.hand .opening-card-back-face::before{left:9px;top:9px;border-left:2px solid;border-top:2px solid}
#hand.hand .opening-card-back-face::after{right:9px;bottom:9px;border-right:2px solid;border-bottom:2px solid}
#hand.hand .opening-card-back-frame{
  position:relative;
  z-index:2;
  width:68%;
  aspect-ratio:1/1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  border:1px solid #c6944d;
  outline:1px solid #3f2b17;
  outline-offset:4px;
  transform:rotate(45deg);
  background:radial-gradient(circle,#2c261c,#101318 72%);
  box-shadow:0 0 24px rgba(208,151,62,.22),inset 0 0 18px #000b;
}
#hand.hand .opening-card-back-frame>*{transform:rotate(-45deg)}
#hand.hand .opening-card-back-frame b{font-family:"Malgun Myeongjo","Batang",serif;font-size:19px;letter-spacing:.08em;color:#e3bc78;text-shadow:0 2px 5px #000}
#hand.hand .opening-card-back-frame span{font-size:6px;font-weight:900;letter-spacing:.12em;color:#9f8d70;white-space:nowrap}
#hand.hand .opening-card-back-frame small{font-family:"Malgun Myeongjo","Batang",serif;font-size:24px;line-height:1;color:#a12e24;text-shadow:0 0 10px #d0432e55}
body.prebattle #hand.hand .card.opening-hand-card{
  border-color:#7b5b34!important;
  background:#0c1116!important;
  box-shadow:0 4px 12px #000b!important;
}
body.hand-reveal-active #hand.hand .opening-hand-flipper{transform:rotateY(180deg)}
body.hand-reveal-active #hand.hand,
body.hand-reveal-active #shuffleBtn,
body.hand-reveal-active #endTurnBtn{pointer-events:none!important}
body.hand-reveal-active #shuffleBtn,
body.hand-reveal-active #endTurnBtn{opacity:.5!important}
@media(max-width:850px){
  #hand.hand .opening-card-back-frame b{font-size:17px}
  #hand.hand .opening-card-back-frame small{font-size:21px}
}
@media(prefers-reduced-motion:reduce){
  #hand.hand .opening-hand-flipper{transition-duration:.01ms!important;transition-delay:0ms!important}
}

/* ===== v105 책사 성장·국가 전열·핸드 가독성 ===== */
#hand.hand .card.actionable-card:not(.opening-hand-card){
  border-color:#72e6a2!important;
  box-shadow:0 0 0 2px rgba(52,180,112,.42),0 0 16px rgba(69,224,139,.32)!important;
}
#hand.hand .card.actionable-card:not(.opening-hand-card)::before{
  content:'행동 가능';position:absolute;z-index:12;left:6px;top:6px;padding:2px 6px;border-radius:999px;
  background:rgba(11,92,55,.94);border:1px solid #9af4bd;color:#edfff4;font-size:9px;font-weight:900;letter-spacing:.03em;
}
#hand.hand .card.selected-vivid:not(.opening-hand-card){
  filter:saturate(1.25) brightness(1.18) contrast(1.08)!important;
  outline:3px solid #fff0a6!important;
  box-shadow:0 0 0 3px #8b6c16,0 0 28px rgba(255,223,103,.75)!important;
  transform:translateY(-9px) scale(1.025)!important;
  z-index:20!important;
}
#hand.hand .card.free-advisor-deploy:not(.opening-hand-card)::after{
  content:'전장 배치 AP 0';position:absolute;z-index:13;right:6px;top:6px;padding:2px 5px;border-radius:4px;
  background:#173b6d;border:1px solid #8fc5ff;color:#eaf5ff;font-size:9px;font-weight:900;
}
.ally-advisor.replace-valid{box-shadow:0 0 0 3px #f0b64b,0 0 24px rgba(240,182,75,.65)!important;}
.ally-advisor.replace-valid::after{content:'교체 가능';position:absolute;right:4px;top:4px;z-index:8;padding:2px 5px;border-radius:4px;background:#7d4c08;color:#fff1c3;font-size:9px;font-weight:900;}
.faction-formation-status{display:inline-flex;align-items:center;min-height:24px;padding:3px 8px;margin-left:6px;border:1px solid #5f6671;border-radius:999px;background:#15191f;color:#9ca5b2;font-size:10px;font-weight:800;white-space:nowrap;}
.faction-formation-status.active{border-color:#d2aa4e;background:linear-gradient(180deg,#4c3712,#251b0b);color:#ffe5a0;box-shadow:0 0 12px rgba(227,177,70,.3);}
.deck-faction-rule-note{margin:8px 12px 0;padding:7px 10px;border:1px solid #4b6681;border-radius:7px;background:#111d28;color:#bdd7ef;font-size:10px;line-height:1.45;}
.deck-builder-toolbar{grid-template-columns:110px minmax(145px,1.25fr) 72px 120px 88px 88px 82px minmax(145px,1.2fr) 78px 88px!important;}
.deck-builder-toolbar .deck-faction-filter select{border-color:#c59642!important;color:#ffe0a4!important;background:#251b0d!important;}
@media(max-width:1100px){.deck-builder-toolbar{grid-template-columns:repeat(5,minmax(105px,1fr))!important;}}
@media(max-width:720px){.deck-builder-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))!important;}.faction-formation-status{display:none;}}


/* ================================================================
   v107 — 적 1열 진입 시 대칭형 적군 본진 진영 5칸
   ================================================================ */
.enemy-hq-defense-lane[hidden],.enemy-hq-defense-lane.inactive{display:none!important;}
.enemy-hq-defense-lane.active{
  display:block!important;
  border:3px solid #ff9b82!important;
  background:linear-gradient(180deg,rgba(79,29,23,.84),rgba(17,23,32,.94))!important;
  box-shadow:0 0 0 2px rgba(255,92,62,.38),0 0 30px rgba(255,112,84,.48),inset 0 0 24px rgba(255,132,96,.18)!important;
  animation:enemyBaseLaneGlow 1.3s ease-in-out infinite alternate!important;
}
.enemy-hq-defense-lane.active .label{
  color:#ffe2d9!important;
  font-weight:1000!important;
  text-shadow:0 0 8px #ff8b71,0 0 14px #d93d2d!important;
  z-index:5!important;
}
.enemy-hq-defense-lane .hq-battlefield-grid{
  width:100%!important;
  max-width:none!important;
  height:100%!important;
  min-height:0!important;
  padding:7px 8px 5px!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  gap:7px!important;
  border:0!important;
  border-radius:8px!important;
  background:rgba(17,7,7,.66)!important;
  box-shadow:inset 0 0 18px rgba(255,112,84,.12)!important;
}
.enemy-hq-defense-lane .hq-field-slot{
  height:100%!important;
  min-height:120px!important;
  border:2px dashed rgba(255,177,157,.62)!important;
  background:linear-gradient(145deg,rgba(69,25,20,.64),rgba(11,13,19,.82))!important;
  box-shadow:inset 0 0 13px rgba(255,105,76,.1)!important;
}
@keyframes enemyBaseLaneGlow{
  from{filter:brightness(1);}
  to{filter:brightness(1.13);}
}
@media(max-width:760px){
  .enemy-hq-defense-lane .hq-battlefield-grid{gap:3px!important;padding:5px 4px!important;}
  .enemy-hq-defense-lane .hq-field-slot{min-height:88px!important;}
}

/* ================================================================
   v108 — 적용 버프 위치 조정 · 지원 장수 버프 선택/취소 상태
   ================================================================ */
/* 적용된 강화/약화 표시는 카드 중앙보다 약간 아래에 배치해
   상단 이름·정찰·병과 표시와 하단 능력 아이콘을 가리지 않는다. */
.battlefield-layout .unit .active-buff-badge,
.battlefield-layout .unit .smoke-buff{
  position:absolute!important;
  left:50%!important;
  right:auto!important;
  top:68%!important;
  bottom:auto!important;
  transform:translate(-50%,-50%)!important;
  z-index:22!important;
  min-width:72px!important;
  max-width:calc(100% - 16px)!important;
  padding:3px 5px!important;
  align-items:center!important;
  text-align:center!important;
  pointer-events:none!important;
}
/* 지원 장수 자신에게 다른 버프가 걸린 경우, 제공 능력 배지는 위쪽으로
   분리하여 두 배지가 서로 겹치지 않게 한다. */
.battlefield-layout .unit .active-buff-badge + .buff-provider-badge,
.battlefield-layout .unit .smoke-buff + .buff-provider-badge{
  left:50%!important;
  right:auto!important;
  top:33%!important;
  bottom:auto!important;
  transform:translate(-50%,-50%)!important;
}
/* 버프 대상 선택 중인 장수 */
.battlefield-layout .unit.support-buff-caster{
  outline:3px solid #7ff2dc!important;
  outline-offset:2px!important;
  filter:brightness(1.12) saturate(1.18)!important;
  box-shadow:0 0 0 2px #062f29,0 0 18px #58e2d0cc!important;
}
.slot.buff-cancel-source::after{
  content:'버프 선택 중';
  position:absolute;
  left:50%;top:4px;
  transform:translateX(-50%);
  z-index:35;
  padding:2px 5px;
  border:1px solid #a9fff0;
  border-radius:999px;
  background:#063c35ee;
  color:#effffb;
  font-size:8px;
  font-weight:950;
  white-space:nowrap;
  pointer-events:none;
}
.field-strategist-actions .buff-start-action{
  border-color:#47cdb7!important;
  background:linear-gradient(180deg,#0b5f54,#073d36)!important;
}
.field-strategist-actions .buff-cancel-action{
  border-color:#ffb26d!important;
  background:linear-gradient(180deg,#78411c,#4a2410)!important;
  color:#fff1df!important;
}


/* v125 · 기타이미지 PC/모바일 나란히 미리보기 */
#otherImageModal .default-card-image-manager{grid-template-columns:1fr!important;align-items:start!important;}
#otherImageModal .default-card-image-manager>.image-adjust-title,
#otherImageModal .default-card-image-manager>.default-image-note,
#otherImageModal .default-card-image-manager>.default-image-controls,
#otherImageModal .default-card-image-manager>.default-image-preview-dual,
#otherImageModal .default-card-image-manager>#saveDefaultImageLayoutBtn,
#otherImageModal .default-card-image-manager>.manager-upload-label,
#otherImageModal .default-card-image-manager>input[type=file],
#otherImageModal .default-card-image-manager>#removeDefaultCardImageBtn{grid-column:1!important;}
.default-image-preview-dual,.hq-image-preview-dual,.batch-base-preview-dual{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.default-image-preview-dual .default-image-preview{height:230px!important;border:2px solid #4a6388!important;border-radius:12px!important;background:#111a27!important;}
@media(max-width:900px){
  .default-image-preview-dual,.hq-image-preview-dual,.batch-base-preview-dual{grid-template-columns:1fr;}
}
.other-adjustable-preview{position:relative!important;overflow:hidden!important;cursor:grab!important;touch-action:none!important;user-select:none!important;display:grid!important;place-items:center!important;}
.other-adjustable-preview.dragging{cursor:grabbing!important;outline:2px solid #e3b867!important;box-shadow:0 0 20px #d8a95055!important;}
.other-adjustable-preview.has-image::after,.hq-image-preview.custom::after{content:'이미지를 드래그해 위치 조절';position:absolute;left:7px;right:7px;bottom:7px;z-index:8;padding:4px 6px;background:#05080bbb;border:1px solid #ffffff33;color:#f3e5ce;font-size:9px;font-weight:800;text-align:center;pointer-events:none;}
.other-preview-art{width:100%!important;height:100%!important;display:block!important;object-fit:cover!important;object-position:var(--img-x,50%) var(--img-y,50%)!important;transform:scale(var(--img-scale,1));transform-origin:var(--img-x,50%) var(--img-y,50%);transition:transform .12s ease,object-position .12s ease;}
.other-image-adjust-panel{display:grid;gap:8px;padding:10px;border:1px solid #5f472d;background:#0a0d0f;min-width:0;}
.other-image-adjust-panel label{display:grid;grid-template-columns:46px minmax(0,1fr) 44px;gap:7px;align-items:center;font-size:10px;color:#d5c7b2;}
.other-image-adjust-panel input[type=range]{width:100%;accent-color:#c69b55;}
.other-image-adjust-panel output{text-align:right;color:#f2d69f;font-weight:900;font-size:10px;}
.other-image-adjust-actions{display:flex;gap:6px;flex-wrap:wrap;}
.other-image-adjust-actions .btn{flex:1;min-width:82px;}
#otherImageModal .hq-image-setting{display:grid!important;gap:7px!important;min-width:0!important;}
#otherImageModal .hq-image-preview{height:180px!important;background-size:cover!important;background-position:center!important;}
#otherImageModal .hq-image-preview .other-preview-art{position:absolute;inset:0;z-index:1;}
#otherImageModal .hq-image-preview span{z-index:7!important;}
#otherImageModal .other-image-adjust-panel.compact{padding:7px;gap:6px;}
#otherImageModal .other-image-adjust-panel.compact .image-adjust-title{display:none;}
.drag-position-readout{font-size:10px;color:#d5c7b2;padding:4px 0;}
.drag-position-readout b{color:#f2d69f;}
@media(max-width:900px){
  #otherImageModal .default-card-image-manager{grid-template-columns:1fr!important;}
  #otherImageModal .default-card-image-manager>*{grid-column:1!important;grid-row:auto!important;}
  #otherImageModal .default-card-image-manager>.default-image-preview{height:260px!important;}
}

/* ================================================================
   v110 — 모바일 전용 메뉴 · 전투필드 · 본진 · 핸드 레이아웃
   ================================================================ */
.mobile-game-header,.mobile-ally-hq-mount,.mobile-hand-mount{display:none}
.responsive-anchor{display:none!important}

@media (max-width:850px){
  :root{--mobile-action-height:58px;--mobile-hand-height:174px}
  html,body{height:auto!important;min-height:100%!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior-y:contain;background:#050708!important}
  body{padding:0 0 calc(env(safe-area-inset-bottom,0px) + 6px)!important;touch-action:pan-y;}
  body::before{content:'';position:fixed;inset:0;pointer-events:none;z-index:-1;background:radial-gradient(circle at 50% 4%,#432b1538,transparent 38%),linear-gradient(180deg,#080b0c,#030506)}

  .mobile-game-header{display:block;position:sticky;top:0;z-index:96;width:100%;border-bottom:1px solid #8a5b28;background:linear-gradient(180deg,#11191cfa,#070b0df7);box-shadow:0 8px 22px #000c,inset 0 -1px #000;padding-top:env(safe-area-inset-top,0px)}
  .mobile-brand-row{height:44px;display:flex;align-items:center;justify-content:space-between;padding:6px 10px;border-bottom:1px solid #3f2b17}
  .mobile-brand-row>div{display:flex;align-items:baseline;gap:8px;min-width:0}
  .mobile-brand-row b{font-family:"Malgun Myeongjo","Batang",serif;color:#e0b36a;font-size:19px;letter-spacing:-.04em;text-shadow:0 2px #241608}
  .mobile-brand-row span{color:#9f9789;font-size:10px;font-weight:800}
  .mobile-icon-btn{width:34px;height:32px;display:grid;place-items:center;border:1px solid #604621;background:#17130e;color:#e6c27d;border-radius:8px;font-size:17px;padding:0}

  .mobile-prebattle-menu{display:grid;gap:8px;padding:9px}
  .mobile-menu-card{display:grid;grid-template-columns:76px minmax(0,1fr);gap:7px;align-items:center;padding:8px;border:1px solid #5f482b;background:linear-gradient(145deg,#14191b,#0a0e10);box-shadow:inset 0 0 0 1px #000;border-radius:10px}
  .mobile-menu-label{align-self:stretch;display:flex;flex-direction:column;justify-content:center;padding-right:7px;border-right:1px solid #43341f}
  .mobile-menu-label span{color:#efd399;font-size:13px;font-weight:950}
  .mobile-menu-label small{margin-top:2px;color:#8f887b;font-size:8px;line-height:1.25}
  .mobile-menu-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
  .mobile-menu-card .btn{min-height:42px;padding:7px;font-size:13px;font-weight:900;border-radius:8px}
  .battle-menu-card{grid-template-columns:76px minmax(0,1fr) 94px}
  .battle-menu-card select{min-width:0;width:100%;height:42px;padding:5px 8px;border-color:#71552e;background:#0b1114;color:#f1e6d2;font-size:12px;font-weight:800}
  .battle-menu-card #mobileBattleStartBtn{height:42px;background:linear-gradient(180deg,#376fc0,#1b477f);border-color:#68a2f1;color:#fff}
  .mobile-advanced-setup{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding:9px;border:1px solid #4a3a24;background:#080c0e;border-radius:9px}
  .mobile-advanced-setup[hidden]{display:none!important}
  .mobile-advanced-setup label{display:grid;gap:4px;color:#bdb2a0;font-size:9px;font-weight:800}
  .mobile-advanced-setup label:last-of-type{grid-column:1/-1}
  .mobile-advanced-setup select{width:100%;min-width:0;height:36px;padding:5px 7px;font-size:11px}
  .mobile-advanced-actions{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
  .mobile-advanced-actions .btn{min-height:36px;padding:5px;font-size:10px}

  .mobile-combat-summary{display:none;height:42px;grid-template-columns:repeat(5,1fr);border-top:1px solid #2e2519;border-bottom:1px solid #5f431f;background:#080c0e}
  .mobile-combat-summary>div{display:flex;align-items:center;justify-content:center;gap:4px;border-right:1px solid #2d3132;font-size:9px;color:#9f9a90}
  .mobile-combat-summary>div:last-child{border-right:0}
  .mobile-combat-summary b{font-size:13px;color:#f0d99f}
  .mobile-jump-nav{display:none;grid-template-columns:repeat(4,1fr);height:36px;background:#0c1113;border-bottom:1px solid #392c1b}
  .mobile-jump-nav button{border:0;border-right:1px solid #2f3537;background:transparent;color:#bfb6a8;font-size:10px;font-weight:900;padding:0}
  .mobile-jump-nav button:last-child{border-right:0}
  .mobile-jump-nav button:active{background:#2b2115;color:#f3d595}

  body.prebattle .mobile-combat-summary,body.prebattle .mobile-jump-nav{display:none!important}
  body:not(.prebattle) .mobile-prebattle-menu{display:none!important}
  body:not(.prebattle) .mobile-combat-summary{display:grid!important}
  body:not(.prebattle) .mobile-jump-nav{display:grid!important}
  body.prebattle .app{display:none!important}

  .app{display:block!important;width:100%!important;height:auto!important;min-height:0!important;min-width:0!important;padding:0!important;margin:0!important;overflow:visible!important}
  .app>.reference-left,.app>.reference-right{display:none!important}
  .battle-panel{display:flex!important;flex-direction:column!important;width:100%!important;height:auto!important;min-height:0!important;min-width:0!important;margin:0!important;border:0!important;border-radius:0!important;overflow:visible!important;background:#050708!important;box-shadow:none!important}
  .battle-panel::before,.battle-panel::after{display:none!important}
  .battle-panel>.reference-topbar{display:none!important}

  .boardwrap{order:1!important;display:block!important;position:relative!important;flex:none!important;width:100%!important;height:auto!important;min-height:0!important;overflow:visible!important;padding:8px 5px 5px!important;background:linear-gradient(#0003,#0003),linear-gradient(180deg,#4a2928 0 18%,#34402a 18% 82%,#223b50 82% 100%)!important}
  .battlefield-layout{display:block!important;width:100%!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important}
  .battlefield-layout>.board,.board{display:flex!important;flex-direction:column!important;gap:5px!important;width:100%!important;max-width:none!important;min-width:0!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important;overflow:visible!important}

  .enemy-hq-row,.mobile-ally-hq-mount .ally-hq-row{display:block!important;width:100%!important;height:auto!important;min-height:0!important;margin:0!important;padding:0!important}
  .enemy-hq-row .battle-hq,.mobile-ally-hq-mount .battle-hq{display:flex!important;width:100%!important;max-width:none!important;height:132px!important;min-height:132px!important;max-height:132px!important;margin:0!important;border-width:1px!important;border-radius:10px!important;background-position:center 42%!important}
  .enemy-hq-row .hq-title,.mobile-ally-hq-mount .hq-title{min-width:0!important;max-width:64%!important;font-size:12px!important;padding:3px 8px!important}
  .enemy-hq-row .hq-info-overlay,.mobile-ally-hq-mount .hq-info-overlay{left:7px!important;right:7px!important;top:36px!important;display:flex!important;gap:3px!important;flex-wrap:wrap!important;max-width:58%!important}
  .enemy-hq-row .hq-stat-chip,.mobile-ally-hq-mount .hq-stat-chip{font-size:8px!important;padding:2px 4px!important}
  .enemy-hq-row .hq-advisor-slot,.mobile-ally-hq-mount .hq-advisor-slot{right:6px!important;top:37px!important;width:38%!important;height:54px!important;min-height:54px!important}
  .mobile-ally-hq-mount{display:block!important;order:2!important;width:100%!important;padding:5px!important;background:linear-gradient(180deg,#182a3a,#071018)!important;border-top:1px solid #6b4b25!important}
  .mobile-ally-hq-mount .ally-hq-turn{right:7px!important;bottom:5px!important}
  .mobile-ally-hq-mount .hq-advisor-console{z-index:150!important}

  .battlefield-layout .lane{display:block!important;width:100%!important;height:auto!important;min-height:88px!important;margin:0!important;padding:17px 4px 4px!important;border-radius:8px!important;overflow:visible!important}
  .battlefield-layout .lane .label{left:7px!important;top:3px!important;font-size:9px!important;line-height:12px!important}
  .battlefield-layout .slots,.battlefield-layout .slots.n4,.battlefield-layout .slots.n3,.battlefield-layout .slots.n2{display:grid!important;width:100%!important;max-width:none!important;height:68px!important;min-height:68px!important;gap:3px!important;margin:0!important;align-items:stretch!important}
  .battlefield-layout .slots.n4{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  .battlefield-layout .slots.n3{grid-template-columns:repeat(3,minmax(0,1fr))!important;padding-inline:9%!important}
  .battlefield-layout .slots.n2{grid-template-columns:repeat(2,minmax(0,1fr))!important;padding-inline:20%!important}
  .battlefield-layout .slot{width:100%!important;height:68px!important;min-height:68px!important;max-height:68px!important;border-radius:7px!important}
  .battlefield-layout .unit{height:100%!important;min-height:0!important;border-width:1px!important;border-radius:7px!important;grid-template-rows:16px minmax(0,1fr) 17px!important}
  .battlefield-layout .uname{height:16px!important;padding:1px 3px!important;font-size:8px!important;line-height:14px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .battlefield-layout .uimg{height:100%!important;min-height:0!important;font-size:17px!important}
  .battlefield-layout .stats{height:17px!important;padding:1px!important;font-size:8px!important;line-height:14px!important}
  .battlefield-layout .typeicon{left:2px!important;bottom:18px!important;min-width:16px!important;min-height:16px!important;padding:1px 2px!important;font-size:8px!important}
  .battlefield-layout .active-buff-badge,.battlefield-layout .smoke-buff{min-width:42px!important;max-width:calc(100% - 6px)!important;padding:1px 2px!important;font-size:6px!important;line-height:1.1!important}
  .battlefield-layout .lane .capture-tag{right:5px!important;top:2px!important;font-size:7px!important;padding:1px 4px!important}
  .river{height:24px!important;min-height:24px!important;margin:0!important;border-radius:7px!important;font-size:9px!important;letter-spacing:4px!important}
  .hq-defense-lane.active{min-height:92px!important;padding-top:17px!important}
  .hq-defense-lane .hq-battlefield-grid,.enemy-hq-defense-lane .hq-battlefield-grid{height:68px!important;min-height:68px!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:2px!important;padding:2px!important}
  .hq-defense-lane .hq-field-slot,.enemy-hq-defense-lane .hq-field-slot{height:64px!important;min-height:64px!important;max-height:64px!important}

  .mobile-hand-mount{display:block!important;order:3!important;position:sticky!important;bottom:calc(var(--mobile-action-height) + env(safe-area-inset-bottom,0px))!important;z-index:78!important;width:100%!important;height:var(--mobile-hand-height)!important;min-height:var(--mobile-hand-height)!important;max-height:var(--mobile-hand-height)!important;padding:0!important;background:#070b0df8!important;border-top:1px solid #8a5b28!important;box-shadow:0 -7px 20px #000c!important;backdrop-filter:blur(8px)}
  .mobile-hand-mount .right-hand-section{display:flex!important;flex-direction:column!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;overflow:hidden!important}
  .mobile-hand-mount .right-hand-section>.ornate-title{display:flex!important;flex:0 0 27px!important;height:27px!important;min-height:27px!important}
  .mobile-hand-mount .right-hand-section .handbox{display:block!important;flex:1!important;height:auto!important;min-height:0!important;padding:4px 5px 5px!important;overflow:hidden!important;background:transparent!important}
  .mobile-hand-mount .right-hand-section .handhead{display:none!important}
  .mobile-hand-mount #hand.hand{display:flex!important;grid-template-columns:none!important;width:100%!important;height:137px!important;min-height:137px!important;gap:5px!important;padding:1px 2px 8px!important;overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
  .mobile-hand-mount #hand.hand .card{flex:0 0 86px!important;width:86px!important;height:126px!important;min-height:126px!important;max-height:126px!important;display:grid!important;grid-template-rows:17px 67px minmax(0,1fr)!important;scroll-snap-align:start;border-radius:7px!important;overflow:hidden!important;transform:none}
  .mobile-hand-mount #hand.hand .card.selected,.mobile-hand-mount #hand.hand .card.selected-vivid{transform:translateY(-3px) scale(1.02)!important;z-index:8!important}
  .mobile-hand-mount #hand.hand .cname{font-size:8px!important;padding:1px 2px!important}
  .mobile-hand-mount #hand.hand .cimg{height:67px!important;min-height:67px!important}
  .mobile-hand-mount #hand.hand .cstats{padding:2px!important;gap:2px!important}
  .mobile-hand-mount #hand.hand .card-stat-grid{gap:2px!important}
  .mobile-hand-mount #hand.hand .card-stat-cell{min-height:27px!important;padding:1px!important}
  .mobile-hand-mount #hand.hand .card-stat-cell b{font-size:9px!important}
  .mobile-hand-mount #hand.hand .card-bottom-icons{gap:2px!important;padding:1px 2px!important;font-size:7px!important}
  .mobile-hand-mount #hand.hand .opening-hand-flipper{height:100%!important}
  .mobile-hand-mount #hand.hand .opening-card-face{border-radius:6px!important}
  .mobile-hand-mount .hand-title-arrow{min-width:30px!important;height:24px!important}

  .bottom-hud{display:block!important;order:4!important;position:sticky!important;bottom:0!important;z-index:82!important;width:100%!important;height:var(--mobile-action-height)!important;min-height:var(--mobile-action-height)!important;max-height:var(--mobile-action-height)!important;margin:0!important;padding:5px 6px calc(5px + env(safe-area-inset-bottom,0px))!important;border-top:1px solid #8a5b28!important;background:#070b0dfb!important;box-shadow:0 -5px 18px #000c!important}
  .bottom-hud .hud-status{display:block!important;width:100%!important;height:100%!important;padding:0!important;background:transparent!important}
  .bottom-hud .hud-status>:not(.hud-actions){display:none!important}
  .bottom-hud .hud-actions{display:grid!important;grid-template-columns:72px 1fr 1fr!important;gap:6px!important;width:100%!important;height:100%!important;min-width:0!important;margin:0!important}
  .bottom-hud .hud-actions .btn{display:block!important;width:100%!important;height:44px!important;min-height:44px!important;padding:5px 4px!important;border-radius:8px!important;font-size:11px!important;font-weight:950!important}
  .bottom-hud #battleControlBtn{order:1!important}
  .bottom-hud #shuffleBtn{order:2!important}
  .bottom-hud #endTurnBtn{order:3!important}

  .field-strategist-menu{position:fixed!important;left:8px!important;right:8px!important;top:auto!important;bottom:calc(var(--mobile-hand-height) + var(--mobile-action-height) + 8px + env(safe-area-inset-bottom,0px))!important;width:auto!important;max-height:42vh!important;overflow-y:auto!important;z-index:180!important}
  #allyAdvisorConsole.skill-menu-open{position:fixed!important;left:8px!important;right:8px!important;top:auto!important;bottom:calc(var(--mobile-hand-height) + var(--mobile-action-height) + 8px + env(safe-area-inset-bottom,0px))!important;width:auto!important;max-height:48vh!important;overflow-y:auto!important;z-index:181!important}
  .card-function-tooltip{display:none!important}
  .game-toast-wrap{top:calc(88px + env(safe-area-inset-top,0px))!important;width:calc(100vw - 18px)!important}

  .modal{align-items:flex-end!important;padding:0!important}
  .modalbox{width:100%!important;max-width:none!important;max-height:92dvh!important;border-radius:14px 14px 0 0!important;margin:0!important;padding-bottom:env(safe-area-inset-bottom,0px)!important}
  .deck-builder-box,.card-shop-box,.card-manager-box{height:92dvh!important;max-height:92dvh!important}
  .deck-builder-head,.manager-head,.card-shop-head{padding:10px!important;gap:7px!important}
  .deck-builder-main{grid-template-columns:1fr!important;grid-template-rows:minmax(170px,1fr) minmax(150px,.8fr)!important;min-height:0!important}
  .deck-builder-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:8px!important}
  .deck-builder-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;padding:8px!important}
  .deck-builder-actions .btn{min-width:0!important;font-size:10px!important;padding:7px 4px!important}
  .card-shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}

  @media (orientation:landscape){
    :root{--mobile-hand-height:146px;--mobile-action-height:52px}
    .mobile-brand-row{height:38px}
    .mobile-combat-summary{height:34px}
    .mobile-jump-nav{height:30px}
    .battlefield-layout .lane{min-height:79px!important}
    .battlefield-layout .slots,.battlefield-layout .slots.n4,.battlefield-layout .slots.n3,.battlefield-layout .slots.n2{height:60px!important;min-height:60px!important}
    .battlefield-layout .slot{height:60px!important;min-height:60px!important;max-height:60px!important}
    .mobile-hand-mount #hand.hand{height:109px!important;min-height:109px!important}
    .mobile-hand-mount #hand.hand .card{height:100px!important;min-height:100px!important;max-height:100px!important;grid-template-rows:15px 50px 1fr!important}
    .mobile-hand-mount #hand.hand .cimg{height:50px!important;min-height:50px!important}
    .bottom-hud .hud-actions .btn{height:39px!important;min-height:39px!important}
  }
}
@media (max-width:850px){
  #enemyHq,#board,#allyHq,#hand{scroll-margin-top:126px}
}
@media (max-width:850px){
  .battlefield-layout .hq-defense-lane[hidden],
  .battlefield-layout .hq-defense-lane.inactive{display:none!important}
  .battlefield-layout .hq-defense-lane.active{display:block!important}
  #enemyBaseSlot,#allyBaseSlot{
    width:100%!important;max-width:100%!important;min-width:0!important;
    overflow:hidden!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;
  }
  #enemyBaseSlot>.hq-field-slot,#allyBaseSlot>.hq-field-slot{width:auto!important;min-width:0!important;max-width:100%!important}
}
@media (max-width:850px){
  .modal{z-index:500!important}
}
@media (max-width:850px){
  body:not(.prebattle) .mobile-game-header{position:fixed!important;top:0!important;left:0!important;right:0!important}
  body:not(.prebattle) .app{padding-top:123px!important}
}
@media (max-width:850px) and (orientation:landscape){
  body:not(.prebattle) .app{padding-top:102px!important}
}

/* ================================================================
   v111 — PC/모바일 버전 선택 · 아군 덱 높이 · 모바일 세로 스크롤
   ================================================================ */
.ui-mode-switch{
  display:grid;
  grid-template-columns:54px minmax(0,1fr) minmax(0,1fr);
  align-items:center;
  gap:4px;
  padding:4px;
  border:1px solid #4d3922;
  border-radius:7px;
  background:linear-gradient(180deg,#111719,#080c0e);
}
.ui-mode-switch>span{
  color:#a99b86;
  font-size:9px;
  font-weight:900;
  text-align:center;
  white-space:nowrap;
}
.ui-mode-switch .btn{
  width:100%!important;
  min-width:0!important;
  height:30px!important;
  min-height:30px!important;
  max-height:30px!important;
  padding:3px 4px!important;
  border-radius:5px!important;
  font-size:10px!important;
  font-weight:900!important;
}
.ui-mode-switch .btn.active{
  border-color:#e5b85d!important;
  background:linear-gradient(180deg,#6f4d20,#38230f)!important;
  color:#fff0c1!important;
  box-shadow:inset 0 0 0 1px #f4d08355,0 0 8px #d5963338!important;
}
.desktop-ui-mode-switch{margin:0 6px 6px}
.mobile-ui-mode-switch{grid-column:1/-1}

@media (min-width:851px){
  .reference-right .right-deck-section{
    flex:0 0 72px!important;
    min-height:72px!important;
    max-height:72px!important;
    height:72px!important;
    margin-bottom:4px!important;
  }
  .reference-right .right-deck-section>.ornate-title{
    flex:0 0 24px!important;
    height:24px!important;
    min-height:24px!important;
    max-height:24px!important;
    padding:2px 7px!important;
    margin:0!important;
    line-height:20px!important;
  }
  .reference-right .right-deck-body{
    flex:0 0 48px!important;
    width:100%!important;
    height:48px!important;
    min-height:48px!important;
    max-height:48px!important;
    padding:5px 6px!important;
    gap:5px!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  .reference-right .right-action-mount{
    grid-template-rows:38px!important;
    height:38px!important;
    min-height:38px!important;
    max-height:38px!important;
    gap:5px!important;
  }
  .reference-right .right-action-mount .deck-info,
  .reference-right .right-action-mount #battleControlBtn,
  .reference-right .right-action-mount #shuffleBtn,
  .reference-right .right-action-mount #endTurnBtn{
    height:38px!important;
    min-height:38px!important;
    max-height:38px!important;
    padding:3px 4px!important;
  }
}

@media (max-width:850px){
  :root{--mobile-action-height:58px;--mobile-hand-height:216px}
  .mobile-jump-nav,
  body:not(.prebattle) .mobile-jump-nav{display:none!important}
  body:not(.prebattle) .app{padding-top:86px!important;padding-bottom:calc(var(--mobile-action-height) + env(safe-area-inset-bottom,0px) + 8px)!important}
  body:not(.prebattle){padding-bottom:calc(var(--mobile-action-height) + env(safe-area-inset-bottom,0px) + 8px)!important}

  .enemy-hq-row .battle-hq,.mobile-ally-hq-mount .battle-hq{
    height:150px!important;min-height:150px!important;max-height:150px!important;
  }
  .battlefield-layout .lane{
    min-height:130px!important;
    padding:18px 4px 5px!important;
  }
  .battlefield-layout .slots,
  .battlefield-layout .slots.n4,
  .battlefield-layout .slots.n3,
  .battlefield-layout .slots.n2{
    height:106px!important;min-height:106px!important;gap:4px!important;
  }
  .battlefield-layout .slots.n3{padding-inline:7%!important}
  .battlefield-layout .slots.n2{padding-inline:17%!important}
  .battlefield-layout .slot{
    height:106px!important;min-height:106px!important;max-height:106px!important;
  }
  .battlefield-layout .unit{
    grid-template-rows:19px minmax(0,1fr) 21px!important;
  }
  .battlefield-layout .uname{
    height:19px!important;font-size:9px!important;line-height:17px!important;padding:1px 3px!important;
  }
  .battlefield-layout .uimg{font-size:22px!important}
  .battlefield-layout .stats{
    height:21px!important;font-size:9px!important;line-height:18px!important;padding:1px 2px!important;
  }
  .battlefield-layout .typeicon{
    bottom:22px!important;min-width:18px!important;min-height:18px!important;font-size:9px!important;
  }
  .hq-defense-lane.active{min-height:119px!important}
  .hq-defense-lane .hq-battlefield-grid,.enemy-hq-defense-lane .hq-battlefield-grid{
    height:94px!important;min-height:94px!important;gap:3px!important;
  }
  .hq-defense-lane .hq-field-slot,.enemy-hq-defense-lane .hq-field-slot{
    height:90px!important;min-height:90px!important;max-height:90px!important;
  }

  .mobile-hand-mount{
    display:block!important;
    order:3!important;
    position:relative!important;
    bottom:auto!important;
    z-index:20!important;
    height:var(--mobile-hand-height)!important;
    min-height:var(--mobile-hand-height)!important;
    max-height:var(--mobile-hand-height)!important;
    padding:0!important;
    box-shadow:none!important;
  }
  .mobile-hand-mount .right-hand-section>.ornate-title{
    flex:0 0 30px!important;height:30px!important;min-height:30px!important;
  }
  .mobile-hand-mount .right-hand-section .handbox{
    padding:5px 6px 8px!important;
  }
  .mobile-hand-mount #hand.hand{
    height:178px!important;min-height:178px!important;gap:7px!important;padding:2px 3px 10px!important;
  }
  .mobile-hand-mount #hand.hand .card{
    flex:0 0 112px!important;
    width:112px!important;
    height:164px!important;
    min-height:164px!important;
    max-height:164px!important;
    grid-template-rows:19px 88px minmax(0,1fr)!important;
  }
  .mobile-hand-mount #hand.hand .cname{font-size:9px!important;padding:2px 3px!important}
  .mobile-hand-mount #hand.hand .cimg{height:88px!important;min-height:88px!important}
  .mobile-hand-mount #hand.hand .card-stat-cell{min-height:30px!important}
  .mobile-hand-mount #hand.hand .card-stat-cell b{font-size:10px!important}
  .mobile-hand-mount #hand.hand .card-bottom-icons{font-size:8px!important}

  .bottom-hud{
    position:fixed!important;
    left:0!important;right:0!important;bottom:0!important;
    z-index:92!important;
  }
  #enemyHq,#board,#allyHq,#hand{scroll-margin-top:92px!important}

  .mobile-ui-mode-switch{margin-top:1px}
  .desktop-ui-mode-switch{display:none!important}
}

@media (max-width:850px) and (orientation:landscape){
  :root{--mobile-action-height:54px;--mobile-hand-height:196px}
  body:not(.prebattle) .app{padding-top:72px!important}
  .battlefield-layout .lane{min-height:112px!important}
  .battlefield-layout .slots,.battlefield-layout .slots.n4,.battlefield-layout .slots.n3,.battlefield-layout .slots.n2{
    height:90px!important;min-height:90px!important;
  }
  .battlefield-layout .slot{height:90px!important;min-height:90px!important;max-height:90px!important}
  .mobile-hand-mount #hand.hand{height:158px!important;min-height:158px!important}
  .mobile-hand-mount #hand.hand .card{
    height:146px!important;min-height:146px!important;max-height:146px!important;grid-template-rows:18px 76px minmax(0,1fr)!important;
  }
  .mobile-hand-mount #hand.hand .cimg{height:76px!important;min-height:76px!important}
}


/* ================================================================
   v112 — 모바일 단계형 메뉴 · 전투필드/핸드 연속 스크롤
   ================================================================ */
@media (max-width:850px){
  /* 전투 전: 덱 메뉴와 전투 메뉴만 핵심 동선으로 표시 */
  body.prebattle .mobile-game-header{
    position:relative!important;
    min-height:100dvh;
    display:flex!important;
    flex-direction:column;
    background:
      radial-gradient(circle at 50% 8%,#70451e38,transparent 34%),
      linear-gradient(180deg,#11191c,#050809 74%);
  }
  body.prebattle .mobile-prebattle-menu{
    display:grid!important;
    align-content:start;
    gap:12px;
    width:100%;
    padding:14px 10px calc(18px + env(safe-area-inset-bottom,0px));
  }
  body.prebattle .mobile-menu-card{
    grid-template-columns:92px minmax(0,1fr);
    gap:9px;
    padding:10px;
    border-radius:12px;
  }
  body.prebattle .battle-menu-card{
    grid-template-columns:92px minmax(0,1fr);
  }
  body.prebattle .battle-menu-card .mobile-menu-label{
    grid-row:1 / span 2;
  }
  body.prebattle .battle-menu-card #mobileBattleDeckSelect,
  body.prebattle .battle-menu-card #mobileBattleStartBtn{
    grid-column:2;
    width:100%;
    min-width:0;
  }
  body.prebattle .mobile-menu-card .btn,
  body.prebattle .battle-menu-card select{
    min-height:46px!important;
    height:46px!important;
    font-size:13px!important;
  }
  .mobile-prebattle-guide{
    margin:0;
    padding:10px 12px;
    border:1px solid #4b3a25;
    border-radius:10px;
    background:#080c0ecc;
    color:#bdb2a0;
    font-size:10px;
    line-height:1.5;
    text-align:center;
  }
  body:not(.prebattle) .mobile-prebattle-guide{display:none!important}

  /* 전투 시작 후: 필드와 핸드를 한 문서 흐름으로 연결 */
  body.mobile-battle-active,
  body:not(.prebattle){
    overflow-y:auto!important;
    touch-action:pan-y!important;
    scroll-behavior:smooth;
  }
  body:not(.prebattle) .mobile-game-header{
    position:sticky!important;
    top:0!important;
    left:auto!important;
    right:auto!important;
    width:100%!important;
  }
  body:not(.prebattle) .app{
    display:block!important;
    padding-top:0!important;
    padding-bottom:calc(var(--mobile-action-height) + env(safe-area-inset-bottom,0px) + 12px)!important;
  }
  body:not(.prebattle) .battle-panel{
    display:flex!important;
    flex-direction:column!important;
    overflow:visible!important;
  }
  body:not(.prebattle) .boardwrap{
    order:1!important;
    position:relative!important;
    overflow:visible!important;
  }
  body:not(.prebattle) .mobile-ally-hq-mount{
    order:2!important;
    position:relative!important;
  }
  body:not(.prebattle) .mobile-hand-mount{
    order:3!important;
    position:relative!important;
    inset:auto!important;
    overflow:visible!important;
    margin:0!important;
    height:auto!important;
    min-height:216px!important;
    max-height:none!important;
    scroll-margin-top:90px!important;
  }
  body:not(.prebattle) .mobile-hand-mount .right-hand-section{
    height:auto!important;
    min-height:216px!important;
    max-height:none!important;
    overflow:visible!important;
  }
  body:not(.prebattle) .mobile-hand-mount .handbox{
    min-height:184px!important;
    overflow:visible!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand{
    overflow-x:auto!important;
    overflow-y:hidden!important;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card,
  body:not(.prebattle) .battlefield-layout .slot,
  body:not(.prebattle) .battlefield-layout .unit{
    pointer-events:auto!important;
    touch-action:manipulation!important;
  }
  body:not(.prebattle) .bottom-hud{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
  }
  .mobile-jump-nav{display:none!important}
}

@media (max-width:850px) and (orientation:landscape){
  body:not(.prebattle) .app{padding-top:0!important}
  body:not(.prebattle) .mobile-hand-mount{
    min-height:196px!important;
  }
  body:not(.prebattle) .mobile-hand-mount .right-hand-section{
    min-height:196px!important;
  }
}


/* ================================================================
   v113 — 국가별 카드색 / 숫자형 공방체 / 데스크톱 모바일 미리보기 보강
   ================================================================ */
#hand.hand .card.wei{--card-accent:#78adff;--card-panel:#295ca3;--card-panel-strong:#1b4073;--card-panel-soft:rgba(137,182,255,.18);--card-panel-border:rgba(164,203,255,.42)}
#hand.hand .card.shu{--card-accent:#83d08d;--card-panel:#2f7a3e;--card-panel-strong:#225930;--card-panel-soft:rgba(137,224,153,.16);--card-panel-border:rgba(167,234,176,.38)}
#hand.hand .card.wu{--card-accent:#ff9898;--card-panel:#9b3939;--card-panel-strong:#6f2727;--card-panel-soft:rgba(255,162,162,.16);--card-panel-border:rgba(255,202,202,.38)}
#hand.hand .card.other,
#hand.hand .card.item,
#hand.hand .card.tactic,
#hand.hand .card.support,
#hand.hand .card.advisor-card-hand{--card-accent:#c0c6cd;--card-panel:#5f6874;--card-panel-strong:#434a53;--card-panel-soft:rgba(215,220,228,.15);--card-panel-border:rgba(230,234,240,.32)}

#hand.hand .card{
  background:linear-gradient(180deg,var(--card-panel-strong,#273341),#11171d 68%)!important;
  border-color:var(--card-accent,#8fa0b5)!important;
}
#hand.hand .card .cname{
  background:linear-gradient(180deg,color-mix(in srgb,var(--card-panel,#425468) 90%,#ffffff 10%),var(--card-panel-strong,#243342))!important;
  border-bottom:1px solid var(--card-panel-border,#506174)!important;
  color:#f6fbff!important;
}
#hand.hand .card .cstats{
  background:linear-gradient(180deg,color-mix(in srgb,var(--card-panel-strong,#243342) 78%,#ffffff 6%),#11171d)!important;
  padding:0!important;
}
#hand.hand .card-stat-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:0!important;
  width:100%!important;
  border-top:1px solid rgba(255,255,255,.08)!important;
}
#hand.hand .card-stat-cell{
  min-height:34px!important;
  padding:2px 0!important;
  border:0!important;
  border-right:1px solid rgba(255,255,255,.18)!important;
  background:var(--card-panel-soft,rgba(255,255,255,.08))!important;
}
#hand.hand .card-stat-cell:last-child{border-right:0!important}
#hand.hand .card-stat-cell b{
  font-size:15px!important;
  font-weight:900!important;
  color:#edf4ff!important;
  letter-spacing:.01em!important;
}
#hand.hand .card-stat-cell span,
#hand.hand .equip-stat-bonus{display:none!important}
#hand.hand .card.item-stat-card .card-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
#hand.hand .card.item-stat-card .card-stat-cell:last-child{grid-column:auto!important}
#hand.hand .card.item-stat-card .card-stat-cell b{color:#f8fbff!important;font-size:14px!important}

.unit.wei,.base-unit.wei{background:linear-gradient(180deg,#2d5f9f,#173552)!important}
.unit.shu,.base-unit.shu{background:linear-gradient(180deg,#367946,#1e4728)!important}
.unit.wu,.base-unit.wu{background:linear-gradient(180deg,#9f4040,#5f2525)!important}
.unit.other,.base-unit.other{background:linear-gradient(180deg,#666d77,#383d44)!important}
.unit .stats,.base-unit-mini span,.base-unit-stat{
  background:rgba(9,12,15,.62)!important;
  border-top:1px solid rgba(255,255,255,.1)!important;
}

/* 모바일 버전을 데스크톱에서 강제 선택했을 때 1/2/3 단계 화면을 항상 노출 */
html.ui-mode-mobile-preview,
body.ui-mode-mobile-preview{
  --mobile-action-height:58px;
  --mobile-hand-height:216px;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  background:#050708!important;
}
body.ui-mode-mobile-preview .mobile-game-header,
body.ui-mode-mobile-preview .mobile-ally-hq-mount,
body.ui-mode-mobile-preview .mobile-hand-mount{display:block!important}
body.ui-mode-mobile-preview .desktop-ui-mode-switch{display:none!important}
body.ui-mode-mobile-preview .app{display:block!important;width:100%!important;height:auto!important;min-height:0!important;padding:0!important;margin:0!important;overflow:visible!important}
body.ui-mode-mobile-preview .app>.reference-left,
body.ui-mode-mobile-preview .app>.reference-right{display:none!important}
body.ui-mode-mobile-preview .battle-panel{display:flex!important;flex-direction:column!important;width:100%!important;height:auto!important;border:0!important;border-radius:0!important;overflow:visible!important;background:#050708!important;box-shadow:none!important}
body.ui-mode-mobile-preview .battle-panel>.reference-topbar{display:none!important}
body.ui-mode-mobile-preview.prebattle .app{display:none!important}
body.ui-mode-mobile-preview.prebattle .mobile-game-header{
  position:relative!important;
  min-height:100vh;
  display:flex!important;
  flex-direction:column;
  background:radial-gradient(circle at 50% 8%,#70451e38,transparent 34%),linear-gradient(180deg,#11191c,#050809 74%)!important;
}
body.ui-mode-mobile-preview.prebattle .mobile-prebattle-menu{display:grid!important;align-content:start;gap:12px;width:100%;padding:14px 10px 18px!important}
body.ui-mode-mobile-preview.prebattle .mobile-combat-summary{display:none!important}
body.ui-mode-mobile-preview.prebattle .mobile-menu-card{display:grid!important;grid-template-columns:92px minmax(0,1fr);gap:9px;align-items:center;padding:10px;border:1px solid #5f482b;background:linear-gradient(145deg,#14191b,#0a0e10);border-radius:12px}
body.ui-mode-mobile-preview.prebattle .mobile-menu-label{align-self:stretch;display:flex;flex-direction:column;justify-content:center;padding-right:8px;border-right:1px solid #43341f}
body.ui-mode-mobile-preview.prebattle .mobile-menu-label span{color:#efd399;font-size:13px;font-weight:950}
body.ui-mode-mobile-preview.prebattle .mobile-menu-label small{margin-top:2px;color:#8f887b;font-size:8px;line-height:1.25}
body.ui-mode-mobile-preview.prebattle .mobile-menu-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
body.ui-mode-mobile-preview.prebattle .mobile-menu-card .btn,
body.ui-mode-mobile-preview.prebattle .battle-menu-card select{min-height:46px!important;height:46px!important;font-size:13px!important}
body.ui-mode-mobile-preview.prebattle .battle-menu-card{grid-template-columns:92px minmax(0,1fr)!important}
body.ui-mode-mobile-preview.prebattle .battle-menu-card .mobile-menu-label{grid-row:1 / span 2}
body.ui-mode-mobile-preview.prebattle .battle-menu-card #mobileBattleDeckSelect,
body.ui-mode-mobile-preview.prebattle .battle-menu-card #mobileBattleStartBtn{grid-column:2;width:100%;min-width:0}
body.ui-mode-mobile-preview.prebattle .mobile-prebattle-guide{display:block!important;margin:0;padding:10px 12px;border:1px solid #4b3a25;border-radius:10px;background:#080c0ecc;color:#bdb2a0;font-size:10px;line-height:1.5;text-align:center}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-prebattle-menu{display:none!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-game-header{position:sticky!important;top:0!important;left:auto!important;right:auto!important;width:100%!important;border-bottom:1px solid #8a5b28;background:linear-gradient(180deg,#11191cfa,#070b0df7)!important;box-shadow:0 8px 22px #000c,inset 0 -1px #000}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-combat-summary{display:grid!important;height:42px;grid-template-columns:repeat(5,1fr);border-top:1px solid #2e2519;border-bottom:1px solid #5f431f;background:#080c0e}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-combat-summary>div{display:flex;align-items:center;justify-content:center;gap:4px;border-right:1px solid #2d3132;font-size:9px;color:#9f9a90}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-combat-summary>div:last-child{border-right:0}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-combat-summary b{font-size:13px;color:#f0d99f}
body.ui-mode-mobile-preview:not(.prebattle) .app{display:block!important;padding-bottom:calc(var(--mobile-action-height) + 12px)!important}
body.ui-mode-mobile-preview .boardwrap{order:1!important;display:block!important;position:relative!important;flex:none!important;width:100%!important;height:auto!important;overflow:visible!important;padding:8px 5px 5px!important;background:linear-gradient(#0003,#0003),linear-gradient(180deg,#4a2928 0 18%,#34402a 18% 82%,#223b50 82% 100%)!important}
body.ui-mode-mobile-preview .battlefield-layout{display:block!important;width:100%!important;height:auto!important;padding:0!important}
body.ui-mode-mobile-preview .battlefield-layout>.board,
body.ui-mode-mobile-preview .board{display:flex!important;flex-direction:column!important;gap:5px!important;width:100%!important;height:auto!important;margin:0!important;padding:0!important;overflow:visible!important}
body.ui-mode-mobile-preview .enemy-hq-row,
body.ui-mode-mobile-preview .mobile-ally-hq-mount .ally-hq-row{display:block!important;width:100%!important;margin:0!important;padding:0!important}
body.ui-mode-mobile-preview .enemy-hq-row .battle-hq,
body.ui-mode-mobile-preview .mobile-ally-hq-mount .battle-hq{display:flex!important;width:100%!important;height:150px!important;min-height:150px!important;max-height:150px!important;border-radius:10px!important}
body.ui-mode-mobile-preview .battlefield-layout .lane{display:block!important;width:100%!important;min-height:130px!important;margin:0!important;padding:18px 4px 5px!important;border-radius:8px!important;overflow:visible!important}
body.ui-mode-mobile-preview .battlefield-layout .lane .label{left:7px!important;top:3px!important;font-size:9px!important;line-height:12px!important}
body.ui-mode-mobile-preview .battlefield-layout .slots,
body.ui-mode-mobile-preview .battlefield-layout .slots.n4,
body.ui-mode-mobile-preview .battlefield-layout .slots.n3,
body.ui-mode-mobile-preview .battlefield-layout .slots.n2{display:grid!important;width:100%!important;height:106px!important;min-height:106px!important;gap:4px!important;margin:0!important;align-items:stretch!important}
body.ui-mode-mobile-preview .battlefield-layout .slots.n4{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body.ui-mode-mobile-preview .battlefield-layout .slots.n3{grid-template-columns:repeat(3,minmax(0,1fr))!important;padding-inline:7%!important}
body.ui-mode-mobile-preview .battlefield-layout .slots.n2{grid-template-columns:repeat(2,minmax(0,1fr))!important;padding-inline:17%!important}
body.ui-mode-mobile-preview .battlefield-layout .slot{width:100%!important;height:106px!important;min-height:106px!important;max-height:106px!important;border-radius:7px!important}
body.ui-mode-mobile-preview .battlefield-layout .unit{height:100%!important;border-width:1px!important;border-radius:7px!important;grid-template-rows:19px minmax(0,1fr) 21px!important}
body.ui-mode-mobile-preview .battlefield-layout .uname{height:19px!important;padding:1px 3px!important;font-size:9px!important;line-height:17px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
body.ui-mode-mobile-preview .battlefield-layout .uimg{height:100%!important;font-size:22px!important}
body.ui-mode-mobile-preview .battlefield-layout .stats{height:21px!important;padding:1px 2px!important;font-size:9px!important;line-height:18px!important}
body.ui-mode-mobile-preview .mobile-ally-hq-mount{display:block!important;order:2!important;width:100%!important;padding:5px!important;background:linear-gradient(180deg,#182a3a,#071018)!important;border-top:1px solid #6b4b25!important}
body.ui-mode-mobile-preview .mobile-hand-mount{display:block!important;order:3!important;position:relative!important;inset:auto!important;overflow:visible!important;margin:0!important;min-height:216px!important;max-height:none!important;padding:0!important}
body.ui-mode-mobile-preview .mobile-hand-mount .right-hand-section{height:auto!important;min-height:216px!important;max-height:none!important;overflow:visible!important}
body.ui-mode-mobile-preview .mobile-hand-mount .right-hand-section>.ornate-title{flex:0 0 30px!important;height:30px!important;min-height:30px!important}
body.ui-mode-mobile-preview .mobile-hand-mount .handbox{min-height:184px!important;padding:5px 6px 8px!important;overflow:visible!important}
body.ui-mode-mobile-preview .mobile-hand-mount #hand.hand{height:178px!important;min-height:178px!important;overflow-x:auto!important;overflow-y:hidden!important;gap:7px!important;padding:2px 3px 10px!important;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
body.ui-mode-mobile-preview .mobile-hand-mount #hand.hand .card{flex:0 0 112px!important;width:112px!important;height:164px!important;min-height:164px!important;max-height:164px!important;grid-template-rows:19px 88px minmax(0,1fr)!important}
body.ui-mode-mobile-preview .mobile-hand-mount #hand.hand .cname{font-size:9px!important;padding:2px 3px!important}
body.ui-mode-mobile-preview .mobile-hand-mount #hand.hand .cimg{height:88px!important;min-height:88px!important}
body.ui-mode-mobile-preview .mobile-hand-mount #hand.hand .card-stat-cell{min-height:30px!important}
body.ui-mode-mobile-preview .mobile-hand-mount #hand.hand .card-stat-cell b{font-size:10px!important}
body.ui-mode-mobile-preview .mobile-hand-mount #hand.hand .card,
body.ui-mode-mobile-preview .battlefield-layout .slot,
body.ui-mode-mobile-preview .battlefield-layout .unit{pointer-events:auto!important;touch-action:manipulation!important}
body.ui-mode-mobile-preview .bottom-hud{position:fixed!important;left:calc(50vw - 215px)!important;right:auto!important;bottom:0!important;width:430px!important;max-width:430px!important;z-index:92!important}
body.ui-mode-mobile-preview #enemyHq,
body.ui-mode-mobile-preview #board,
body.ui-mode-mobile-preview #allyHq,
body.ui-mode-mobile-preview #hand{scroll-margin-top:92px!important}

.unit .stats{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:0!important}
.unit .stats span{display:flex!important;align-items:center!important;justify-content:center!important;font-weight:900!important;border-right:1px solid rgba(255,255,255,.16)!important}
.unit .stats span:last-child{border-right:0!important}
.base-unit-stat,.base-unit-mini span{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:0!important;text-align:center!important}


/* ================================================================
   v114 — 모바일 안정화 / 관리자·상점·덱편집 최종 보정
   ================================================================ */
.mobile-brand-actions{display:flex;align-items:center;gap:6px}
.mobile-pc-switch{display:none}

html.mobile-modal-open,body.mobile-modal-open{overflow:hidden!important;overscroll-behavior:none!important}
body.mobile-modal-open .modal.show{overscroll-behavior:contain;touch-action:pan-y}

@media (max-width:850px){
  .mobile-brand-actions{display:flex!important}
  .mobile-pc-switch{display:grid!important;place-items:center;width:42px;height:32px;padding:0;border:1px solid #604621;border-radius:8px;background:#17130e;color:#e6c27d;font-size:11px;font-weight:950}
  .mobile-pc-switch.active{border-color:#d2a257;background:#3b2a17;color:#fff0c8}

  body.prebattle .mobile-menu-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  body.prebattle .mobile-menu-actions .btn{height:52px!important;min-height:52px!important;font-size:15px!important}
  body.prebattle .battle-menu-card #mobileBattleDeckSelect,
  body.prebattle .battle-menu-card #mobileBattleStartBtn{height:52px!important;min-height:52px!important;font-size:14px!important}
  body.prebattle .battle-menu-card #mobileBattleStartBtn{font-size:15px!important}

  .modal.show{display:flex!important;align-items:stretch!important;justify-content:stretch!important;padding:0!important;background:#000d!important}
  .modal.show>.modalbox{width:100%!important;height:100dvh!important;max-width:none!important;max-height:100dvh!important;margin:0!important;border:0!important;border-radius:0!important;padding-bottom:env(safe-area-inset-bottom,0px)!important;overscroll-behavior:contain!important}

  .card-manager-box{display:grid!important;grid-template-rows:auto minmax(0,1fr)!important;overflow:hidden!important}
  .manager-head{position:relative!important;z-index:3!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-items:stretch!important;padding:9px!important;gap:8px!important}
  .manager-head h2{font-size:16px!important}
  .manager-head .small{font-size:9px!important;line-height:1.4!important}
  .manager-head-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;width:100%!important;gap:6px!important}
  .manager-head-actions .btn{width:100%!important;min-width:0!important;min-height:42px!important;padding:6px 3px!important;font-size:10px!important}
  .manager-main{display:grid!important;grid-template-columns:1fr!important;grid-template-rows:190px minmax(0,1fr)!important;min-height:0!important;overflow:hidden!important}
  .manager-list-pane{min-height:0!important;padding:7px!important;gap:6px!important;border-right:0!important;border-bottom:1px solid #2d3d59!important;overflow:hidden!important}
  .manager-search{grid-template-columns:minmax(0,1fr) 92px!important;gap:5px!important}
  .manager-search #managerTypeFilter{grid-column:1/-1!important;height:38px!important}
  .manager-search input,.manager-search select{height:38px!important;min-width:0!important;padding:5px 7px!important;font-size:11px!important}
  .manager-list{display:grid!important;grid-auto-flow:column!important;grid-auto-columns:minmax(168px,72vw)!important;overflow-x:auto!important;overflow-y:hidden!important;gap:6px!important;padding:0 0 4px!important;scroll-snap-type:x proximity!important;-webkit-overflow-scrolling:touch}
  .manager-card-row{grid-template-columns:42px minmax(0,1fr) auto!important;min-height:66px!important;padding:5px!important;border-radius:8px!important;scroll-snap-align:start!important}
  .manager-thumb{width:42px!important;height:52px!important}
  .manager-row-name{font-size:11px!important}.manager-row-meta{font-size:8px!important}
  .manager-edit-pane{min-height:0!important;padding:9px!important;overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch}
  .manager-grid{grid-template-columns:1fr!important;gap:10px!important}
  .manager-preview-wrap{gap:6px!important;padding-bottom:8px!important;border-bottom:1px solid #2a3b52!important}
  .manager-preview{height:190px!important;min-height:190px!important;border-radius:10px!important}
  .manager-upload-label,.manager-preview-wrap>.btn{min-height:42px!important;display:flex!important;align-items:center!important;justify-content:center!important;font-size:11px!important}
  .image-adjust-panel{padding:8px!important}
  .manager-form{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  .manager-field.full,.sss-effect-panel{grid-column:1/-1!important}
  .manager-field label{font-size:9px!important}
  .manager-field input,.manager-field select,.manager-field textarea{min-height:40px!important;padding:7px!important;font-size:12px!important}
  .manager-field textarea{min-height:96px!important}
  .manager-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;position:sticky!important;bottom:0!important;z-index:4!important;padding:8px 0 calc(8px + env(safe-area-inset-bottom,0px))!important;background:linear-gradient(180deg,transparent,#0c1424 18%)!important}
  .manager-actions .btn{min-height:44px!important;font-size:11px!important}
  .sss-effect-stat-list,.sss-trigger-fields{grid-template-columns:1fr!important}

  .deck-builder-box,.card-shop-box{display:flex!important;flex-direction:column!important;overflow:hidden!important}
  .deck-builder-head,.card-shop-head{flex:0 0 auto!important;position:sticky!important;top:0!important;z-index:4!important;padding:9px!important;background:#11191d!important}
  .deck-builder-head h2,.card-shop-head h2{font-size:16px!important}
  .deck-builder-head .small,.card-shop-head .small{font-size:9px!important}
  .deck-builder-head .btn,.card-shop-head .btn{min-width:64px!important;min-height:42px!important;font-size:11px!important}
  .deck-builder-toolbar,.card-shop-toolbar{flex:0 0 auto!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;padding:8px!important;overflow:visible!important}
  .deck-builder-toolbar label,.card-shop-toolbar label{min-width:0!important;font-size:9px!important}
  .deck-builder-toolbar input,.deck-builder-toolbar select,.card-shop-toolbar input,.card-shop-toolbar select{width:100%!important;min-width:0!important;height:42px!important;font-size:11px!important}
  .deck-builder-toolbar>input,.card-shop-toolbar>input{grid-column:1/-1!important}
  .deck-builder-count,.deck-builder-score,.card-shop-count{min-height:42px!important}
  .deck-builder-main{flex:1 1 auto!important;grid-template-rows:minmax(190px,1fr) minmax(170px,.9fr)!important;overflow:hidden!important}
  .deck-builder-pane{min-height:0!important;overflow:hidden!important}
  .deck-builder-pane-title{height:30px!important;min-height:30px!important;font-size:11px!important}
  .deck-builder-list{grid-template-columns:repeat(2,minmax(0,1fr))!important;align-content:start!important;max-height:none!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding:7px!important;gap:7px!important;-webkit-overflow-scrolling:touch}
  .deck-builder-list.selected{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .deck-auto-ratio{grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:7px!important;gap:5px!important}
  .deck-auto-ratio>b,.deck-auto-ratio>span{grid-column:1/-1!important}
  .deck-builder-summary{font-size:9px!important;padding:6px 8px!important}
  .deck-builder-actions{flex:0 0 auto!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;padding:7px!important;gap:6px!important;background:#0b1012!important}
  .deck-builder-actions .btn{min-height:44px!important;font-size:10px!important;padding:5px 3px!important}

  .card-shop-grid{flex:1 1 auto!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-content:start!important;overflow-y:auto!important;overflow-x:hidden!important;padding:8px!important;gap:8px!important;-webkit-overflow-scrolling:touch}
  .shop-card-entry,.shop-card{min-width:0!important;width:100%!important}
}

/* 데스크톱에서 선택한 모바일 미리보기의 안정적인 430px 셸 */
html.ui-mode-mobile-preview{height:auto!important;min-height:100%!important;overflow-x:hidden!important;overflow-y:auto!important;background:#020304!important}
body.ui-mode-mobile-preview{width:430px!important;max-width:430px!important;min-height:100vh!important;height:auto!important;margin:0 auto!important;overflow-x:hidden!important;overflow-y:auto!important;box-shadow:0 0 34px #000!important}
body.ui-mode-mobile-preview .mobile-game-header{width:430px!important;max-width:430px!important;margin:0 auto!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-game-header{left:50%!important;right:auto!important;transform:translateX(-50%)!important}
body.ui-mode-mobile-preview .bottom-hud{left:50%!important;right:auto!important;width:430px!important;max-width:430px!important;transform:translateX(-50%)!important}
body.ui-mode-mobile-preview .modal{left:50%!important;right:auto!important;width:430px!important;max-width:430px!important;transform:translateX(-50%)!important}


/* ================================================================
   v115 — 모바일 본진 조건 / 카드 정렬 / 전환 버튼 개선
   ================================================================ */
.mobile-brand-actions{display:flex!important;align-items:center!important;gap:6px!important}
.mobile-ui-switch-btn{display:grid!important;place-items:center;width:42px;height:32px;padding:0;border:1px solid #604621;border-radius:8px;background:#17130e;color:#e6c27d;font-size:11px;font-weight:950;line-height:1}
.mobile-ui-switch-btn.active{border-color:#d2a257;background:#3b2a17;color:#fff0c8}
.mobile-mobile-switch{letter-spacing:-.02em}

/* 핸드 카드: 박스에 딱 맞도록 정렬 */
#hand.hand .card,
.mobile-hand-mount #hand.hand .card{box-sizing:border-box!important;overflow:hidden!important;align-content:stretch!important}
#hand.hand .card-title-area,
.mobile-hand-mount #hand.hand .card-title-area{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:start!important;column-gap:4px!important;padding:3px 5px!important;min-height:24px!important;height:auto!important}
#hand.hand .card-name-text,
.mobile-hand-mount #hand.hand .card-name-text{display:block!important;min-width:0!important;line-height:1.15!important;word-break:keep-all!important;overflow:hidden!important;text-overflow:ellipsis!important}
#hand.hand .card-title-grade,
.mobile-hand-mount #hand.hand .card-title-grade{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:1px!important;min-width:28px!important;padding:2px 4px!important;line-height:1!important}
#hand.hand .card-ready-label,
.mobile-hand-mount #hand.hand .card-ready-label{display:block!important;font-size:7px!important;font-weight:900!important;line-height:1!important;color:#fff6cb!important;letter-spacing:-.02em}
#hand.hand .cimg,
.mobile-hand-mount #hand.hand .cimg{position:relative!important;width:100%!important;overflow:hidden!important;display:block!important;background:#18202a!important}
#hand.hand .cimg img,
#hand.hand .cimg .default-art,
.mobile-hand-mount #hand.hand .cimg img,
.mobile-hand-mount #hand.hand .cimg .default-art{width:100%!important;height:100%!important;display:block!important;object-fit:cover!important;object-position:var(--img-x,50%) var(--img-y,50%)!important}
#hand.hand .cstats,
.mobile-hand-mount #hand.hand .cstats{display:block!important;width:100%!important;padding:0!important;overflow:hidden!important}
#hand.hand .card-stat-grid,
.mobile-hand-mount #hand.hand .card-stat-grid{width:100%!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:0!important}
#hand.hand .card-stat-cell,
.mobile-hand-mount #hand.hand .card-stat-cell{box-sizing:border-box!important;min-width:0!important;border-right:1px solid rgba(255,255,255,.16)!important}
#hand.hand .card-stat-cell:last-child,
.mobile-hand-mount #hand.hand .card-stat-cell:last-child{border-right:0!important}

/* 필드 카드: 크기와 이미지 밀림 보정 */
.battlefield-layout .slot,
.battlefield-layout .unit,
.hq-field-slot,
.hq-field-slot .base-unit{box-sizing:border-box!important;min-width:0!important;max-width:100%!important;overflow:hidden!important}
.battlefield-layout .slot{padding:0!important}
.battlefield-layout .unit{display:grid!important;grid-template-rows:minmax(0,1fr) 22px!important;align-content:stretch!important}
.battlefield-layout .uimg{position:relative!important;display:block!important;width:100%!important;height:100%!important;min-height:0!important;overflow:hidden!important;background:#10161d!important}
.battlefield-layout .uimg img,
.battlefield-layout .uimg .default-art,
.hq-field-slot .base-unit-art img,
.hq-field-slot .base-unit-art .default-art{width:100%!important;height:100%!important;display:block!important;object-fit:cover!important;object-position:var(--img-x,50%) var(--img-y,50%)!important}
.battlefield-layout .unit-image-meta{left:0!important;right:0!important;top:0!important;border-radius:0!important;padding:2px 4px!important}
.battlefield-layout .stats{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:0!important;min-width:0!important}
.battlefield-layout .stats span{min-width:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.hq-field-slot .base-unit{grid-template-rows:minmax(0,1fr) auto!important;padding:2px!important}
.hq-field-slot .base-unit-art{height:auto!important;min-height:0!important}
.hq-field-slot .base-unit-mini{min-width:0!important;overflow:hidden!important}
.hq-field-slot .base-unit-mini b,
.hq-field-slot .base-unit-mini span{display:block!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}

/* 모바일 전투 UI 크기 보정 */
@media (max-width:850px){
  .mobile-combat-summary{height:50px!important}
  .mobile-combat-summary>div{font-size:9px!important;padding:0 2px!important}
  .mobile-combat-summary b{font-size:15px!important}
  .battle-hq .hq-advisor-slot{width:42%!important;min-width:112px!important;height:62px!important;min-height:62px!important;top:38px!important;right:6px!important}
  .battle-hq .hq-info-overlay{right:calc(42% + 12px)!important;max-width:none!important}
  .battle-hq .hq-advisor-summary{right:calc(42% + 12px)!important}
  .mobile-hand-mount #hand.hand .card{grid-template-rows:24px 92px 1fr!important}
  .mobile-hand-mount #hand.hand .cstats{min-height:46px!important}
  .mobile-hand-mount #hand.hand .card-stat-cell{min-height:32px!important}
  .battlefield-layout .slots,
  .battlefield-layout .slots.n4,
  .battlefield-layout .slots.n3,
  .battlefield-layout .slots.n2{align-items:stretch!important}
  .battlefield-layout .slot{height:106px!important;min-height:106px!important;max-height:106px!important}
  .battlefield-layout .unit{height:100%!important;grid-template-rows:minmax(0,1fr) 21px!important;border-radius:7px!important}
  .battlefield-layout .uimg{font-size:20px!important}
  .battlefield-layout .unit-image-meta .field-unit-name{font-size:8px!important}
  .battlefield-layout .unit-image-meta .field-grade{font-size:8px!important;min-width:18px!important;height:14px!important}
  .hq-defense-lane .hq-battlefield-grid,.enemy-hq-defense-lane .hq-battlefield-grid{height:96px!important;min-height:96px!important}
  .hq-defense-lane .hq-field-slot,.enemy-hq-defense-lane .hq-field-slot{height:92px!important;min-height:92px!important;max-height:92px!important}
}
body.ui-mode-mobile-preview .mobile-combat-summary{height:50px!important}
body.ui-mode-mobile-preview .mobile-combat-summary b{font-size:15px!important}
body.ui-mode-mobile-preview .mobile-hand-mount #hand.hand .card{grid-template-rows:24px 92px 1fr!important}
body.ui-mode-mobile-preview .mobile-hand-mount #hand.hand .cstats{min-height:46px!important}
body.ui-mode-mobile-preview .battlefield-layout .unit{grid-template-rows:minmax(0,1fr) 21px!important}
body.ui-mode-mobile-preview .battlefield-layout .unit-image-meta .field-unit-name{font-size:8px!important}
body.ui-mode-mobile-preview .battlefield-layout .unit-image-meta .field-grade{font-size:8px!important;min-width:18px!important;height:14px!important}
body.ui-mode-mobile-preview .hq-defense-lane .hq-field-slot,
body.ui-mode-mobile-preview .enemy-hq-defense-lane .hq-field-slot{height:92px!important;min-height:92px!important;max-height:92px!important}


/* ================================================================
   v116 — 본진 개방 조건 / 동일 카드폭 / 상태 유지 전환 / 하단 플로팅
   ================================================================ */
/* 기존 등급 아래 별도 '가능' 텍스트는 사용하지 않는다. */
#hand.hand .card-ready-label{display:none!important}
/* 기존 행동 가능 박스를 등급 바로 아래로 이동하고 문구를 단순화한다. */
#hand.hand .card.actionable-card:not(.opening-hand-card)::before{
  content:'가능'!important;
  left:auto!important;
  right:5px!important;
  top:27px!important;
  min-width:28px!important;
  padding:2px 4px!important;
  border-radius:4px!important;
  text-align:center!important;
  font-size:8px!important;
  line-height:1.05!important;
  letter-spacing:0!important;
}

/* 양쪽 본진의 책사 슬롯과 턴 표시를 같은 높이에서 나란히 배치 */
.battle-hq .hq-advisor-slot{
  right:58px!important;
  top:36px!important;
  width:112px!important;
  height:62px!important;
  min-height:62px!important;
  max-height:62px!important;
}
.hq-turn-box{
  position:absolute;
  right:6px;
  top:36px;
  z-index:13;
  width:46px;
  height:62px;
  min-height:62px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  border:1px solid #8a6a3f;
  border-radius:5px;
  background:linear-gradient(180deg,#111820e8,#080c10e8);
  color:#dfceb0;
  box-sizing:border-box;
  font-size:10px;
  font-weight:900;
}
.hq-turn-box b{font-size:18px!important;color:#ffe09d!important;line-height:1!important}
.hq-turn-box span{font-size:9px!important;color:#dfceb0!important;line-height:1!important}
.ally-hq-turn{right:6px!important;top:36px!important;bottom:auto!important;width:46px!important;height:62px!important}

@media (max-width:850px){
  :root{
    --mobile-action-height:58px;
    --mobile-hand-float-height:174px;
    --mobile-hq-float-height:104px;
    --mobile-bottom-dock-height:calc(var(--mobile-action-height) + var(--mobile-hand-float-height) + var(--mobile-hq-float-height));
  }
  /* 1·2·3열 모두 1열과 동일한 카드 폭을 사용한다. */
  .battlefield-layout .slots.n4,
  .battlefield-layout .slots.n3,
  .battlefield-layout .slots.n2{
    display:flex!important;
    align-items:stretch!important;
    justify-content:center!important;
    width:100%!important;
    padding-inline:0!important;
    gap:4px!important;
  }
  .battlefield-layout .slots.n4>.slot,
  .battlefield-layout .slots.n3>.slot,
  .battlefield-layout .slots.n2>.slot{
    flex:0 0 calc((100% - 12px)/4)!important;
    width:calc((100% - 12px)/4)!important;
    min-width:0!important;
    max-width:calc((100% - 12px)/4)!important;
  }
  /* 모바일 하단: 아군 본진 + 핸드 + 전투 버튼을 항상 고정 표시 */
  body:not(.prebattle),
  body.mobile-battle-active{
    padding-bottom:calc(var(--mobile-bottom-dock-height) + env(safe-area-inset-bottom,0px) + 8px)!important;
  }
  body:not(.prebattle) .app{
    padding-bottom:calc(var(--mobile-bottom-dock-height) + env(safe-area-inset-bottom,0px) + 8px)!important;
  }
  body:not(.prebattle) .mobile-ally-hq-mount{
    display:block!important;
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:calc(var(--mobile-action-height) + var(--mobile-hand-float-height) + env(safe-area-inset-bottom,0px))!important;
    z-index:88!important;
    width:100%!important;
    height:var(--mobile-hq-float-height)!important;
    min-height:var(--mobile-hq-float-height)!important;
    max-height:var(--mobile-hq-float-height)!important;
    margin:0!important;
    padding:4px!important;
    overflow:hidden!important;
    border-top:1px solid #8a5b28!important;
    background:linear-gradient(180deg,#182a3af7,#071018fa)!important;
    box-shadow:0 -8px 18px #000b!important;
  }
  body:not(.prebattle) .mobile-ally-hq-mount .ally-hq-row{
    display:block!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
  }
  body:not(.prebattle) .mobile-ally-hq-mount .battle-hq{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
  }
  body:not(.prebattle) .mobile-ally-hq-mount .hq-title{font-size:10px!important;padding:2px 6px!important}
  body:not(.prebattle) .mobile-ally-hq-mount .hq-subtitle,
  body:not(.prebattle) .mobile-ally-hq-mount .hptxt{display:none!important}
  body:not(.prebattle) .mobile-ally-hq-mount .hq-info-overlay{
    left:6px!important;
    right:180px!important;
    top:30px!important;
    max-width:none!important;
    gap:2px!important;
  }
  body:not(.prebattle) .mobile-ally-hq-mount .hq-stat-chip{padding:2px 3px!important;font-size:7px!important}
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot{
    right:55px!important;
    top:29px!important;
    width:116px!important;
    height:62px!important;
    min-height:62px!important;
  }
  body:not(.prebattle) .mobile-ally-hq-mount .hq-turn-box{
    right:5px!important;
    top:29px!important;
    width:44px!important;
    height:62px!important;
    min-height:62px!important;
  }
  body:not(.prebattle) .mobile-hand-mount{
    display:block!important;
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:calc(var(--mobile-action-height) + env(safe-area-inset-bottom,0px))!important;
    z-index:89!important;
    width:100%!important;
    height:var(--mobile-hand-float-height)!important;
    min-height:var(--mobile-hand-float-height)!important;
    max-height:var(--mobile-hand-float-height)!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    background:#080c0ef8!important;
    border-top:1px solid #6d522e!important;
    box-shadow:0 -5px 14px #000a!important;
  }
  body:not(.prebattle) .mobile-hand-mount .right-hand-section{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .mobile-hand-mount .right-hand-section>.ornate-title{
    flex:0 0 27px!important;
    height:27px!important;
    min-height:27px!important;
  }
  body:not(.prebattle) .mobile-hand-mount .handbox{
    flex:1 1 auto!important;
    min-height:0!important;
    height:auto!important;
    padding:3px 5px 5px!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .mobile-hand-mount .handhead{display:none!important}
  body:not(.prebattle) .mobile-hand-mount #hand.hand{
    width:100%!important;
    height:142px!important;
    min-height:142px!important;
    max-height:142px!important;
    padding:1px 2px 4px!important;
    gap:6px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card{
    flex:0 0 104px!important;
    width:104px!important;
    height:136px!important;
    min-height:136px!important;
    max-height:136px!important;
    grid-template-rows:23px 74px 39px!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .cimg{
    height:74px!important;
    min-height:74px!important;
    max-height:74px!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .cstats{
    height:39px!important;
    min-height:39px!important;
    max-height:39px!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card-stat-cell{
    min-height:39px!important;
    height:39px!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card.actionable-card:not(.opening-hand-card)::before{
    right:4px!important;
    top:25px!important;
    min-width:25px!important;
    font-size:7px!important;
  }
  body:not(.prebattle) .bottom-hud{
    bottom:0!important;
    height:var(--mobile-action-height)!important;
    min-height:var(--mobile-action-height)!important;
    padding-bottom:env(safe-area-inset-bottom,0px)!important;
    z-index:92!important;
  }
}

/* PC에서 모바일 모드를 선택한 미리보기에서도 동일한 하단 플로팅 사용 */
body.ui-mode-mobile-preview:not(.prebattle){
  --mobile-action-height:58px;
  --mobile-hand-float-height:174px;
  --mobile-hq-float-height:104px;
  --mobile-bottom-dock-height:calc(var(--mobile-action-height) + var(--mobile-hand-float-height) + var(--mobile-hq-float-height));
  padding-bottom:calc(var(--mobile-bottom-dock-height) + 8px)!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .app{padding-bottom:calc(var(--mobile-bottom-dock-height) + 8px)!important}
body.ui-mode-mobile-preview .battlefield-layout .slots.n4,
body.ui-mode-mobile-preview .battlefield-layout .slots.n3,
body.ui-mode-mobile-preview .battlefield-layout .slots.n2{display:flex!important;align-items:stretch!important;justify-content:center!important;padding-inline:0!important;gap:4px!important}
body.ui-mode-mobile-preview .battlefield-layout .slots.n4>.slot,
body.ui-mode-mobile-preview .battlefield-layout .slots.n3>.slot,
body.ui-mode-mobile-preview .battlefield-layout .slots.n2>.slot{flex:0 0 calc((100% - 12px)/4)!important;width:calc((100% - 12px)/4)!important;max-width:calc((100% - 12px)/4)!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount{position:fixed!important;left:calc(50vw - 215px)!important;right:auto!important;bottom:calc(var(--mobile-action-height) + var(--mobile-hand-float-height))!important;width:430px!important;height:var(--mobile-hq-float-height)!important;min-height:var(--mobile-hq-float-height)!important;max-height:var(--mobile-hq-float-height)!important;z-index:88!important;padding:4px!important;overflow:hidden!important;background:linear-gradient(180deg,#182a3af7,#071018fa)!important;border-top:1px solid #8a5b28!important;box-shadow:0 -8px 18px #000b!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .ally-hq-row,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .battle-hq{height:100%!important;min-height:0!important;max-height:none!important;margin:0!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-subtitle,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hptxt{display:none!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-info-overlay{left:6px!important;right:180px!important;top:30px!important;max-width:none!important;gap:2px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot{right:55px!important;top:29px!important;width:116px!important;height:62px!important;min-height:62px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-turn-box{right:5px!important;top:29px!important;width:44px!important;height:62px!important;min-height:62px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount{position:fixed!important;left:calc(50vw - 215px)!important;right:auto!important;bottom:var(--mobile-action-height)!important;width:430px!important;height:var(--mobile-hand-float-height)!important;min-height:var(--mobile-hand-float-height)!important;max-height:var(--mobile-hand-float-height)!important;z-index:89!important;overflow:hidden!important;background:#080c0ef8!important;border-top:1px solid #6d522e!important;box-shadow:0 -5px 14px #000a!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount .right-hand-section{height:100%!important;min-height:0!important;overflow:hidden!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount .right-hand-section>.ornate-title{height:27px!important;min-height:27px!important;flex:0 0 27px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount .handbox{min-height:0!important;padding:3px 5px 5px!important;overflow:hidden!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount .handhead{display:none!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand{height:142px!important;min-height:142px!important;max-height:142px!important;padding:1px 2px 4px!important;gap:6px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card{flex:0 0 104px!important;width:104px!important;height:136px!important;min-height:136px!important;max-height:136px!important;grid-template-rows:23px 74px 39px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .cimg{height:74px!important;min-height:74px!important;max-height:74px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .cstats{height:39px!important;min-height:39px!important;max-height:39px!important}

.mobile-mobile-switch{width:54px!important;font-size:10px!important}


/* ================================================================
   v117 — 모바일 본진/핸드 재정렬 및 본진 진영 초기 노출 차단
   ================================================================ */
.hq-defense-lane[hidden],
.hq-defense-lane.inactive:not(.active),
.hq-battlefield-grid[hidden],
.hq-battlefield-grid.inactive:not(.active){
  display:none!important;
  visibility:hidden!important;
  height:0!important;
  min-height:0!important;
  max-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
}
.hq-defense-lane.active{visibility:visible!important}

/* PC: 책사 박스와 턴 박스를 고정된 서로 다른 영역에 배치 */
.battle-hq .hq-advisor-slot{
  box-sizing:border-box!important;
  right:56px!important;
  width:112px!important;
  max-width:112px!important;
  overflow:hidden!important;
}
.battle-hq .hq-turn-box{
  box-sizing:border-box!important;
  right:6px!important;
  width:44px!important;
  max-width:44px!important;
  overflow:hidden!important;
}
.battle-hq .hq-advisor-slot + .hq-turn-box{margin-left:6px!important}
.mobile-hq-turn-inline{display:none}

@media (max-width:850px){
  :root{
    --mobile-action-height:58px;
    --mobile-field-card-width:calc((100vw - 22px)/4);
    --mobile-field-card-height:106px;
    --mobile-hand-float-height:136px;
    --mobile-hq-float-height:132px;
    --mobile-bottom-dock-height:calc(var(--mobile-action-height) + var(--mobile-hand-float-height) + var(--mobile-hq-float-height));
  }

  /* 턴은 큰 별도 박스를 숨기고 행동력 칩 오른쪽에 간단히 표시 */
  .battle-hq .hq-turn-box{display:none!important}
  .mobile-hq-turn-inline{
    display:inline-flex!important;
    align-items:center!important;
    gap:1px!important;
    margin-left:3px!important;
    padding-left:4px!important;
    border-left:1px solid rgba(255,255,255,.22)!important;
    color:#ffe1a0!important;
    font-size:8px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  .mobile-hq-turn-inline b{font-size:9px!important;color:#fff3c7!important}

  /* 적군 본진은 플로팅하지 않고 전투 화면 최상단에 유지 */
  body:not(.prebattle) .enemy-hq-row{
    display:block!important;
    position:relative!important;
    inset:auto!important;
    z-index:2!important;
    width:100%!important;
    height:var(--mobile-hq-float-height)!important;
    min-height:var(--mobile-hq-float-height)!important;
    max-height:var(--mobile-hq-float-height)!important;
    margin:0!important;
    padding:4px!important;
    background:linear-gradient(180deg,#301b1bf5,#130909fa)!important;
    border-bottom:1px solid #8a5b28!important;
    box-shadow:none!important;
  }

  /* 아군 플로팅 본진과 적군 상단 본진을 동일한 카드 형태로 표시 */
  body:not(.prebattle) .enemy-hq-row .battle-hq,
  body:not(.prebattle) .mobile-ally-hq-mount .battle-hq{
    display:block!important;
    position:relative!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    border:1px solid #8b6a3c!important;
    border-radius:9px!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-title,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-title{
    top:4px!important;
    left:5px!important;
    max-width:calc(100% - 150px)!important;
    padding:2px 6px!important;
    font-size:10px!important;
    line-height:16px!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-subtitle,
  body:not(.prebattle) .enemy-hq-row .hptxt,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-subtitle,
  body:not(.prebattle) .mobile-ally-hq-mount .hptxt{display:none!important}
  body:not(.prebattle) .enemy-hq-row .hq-info-overlay,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-info-overlay{
    position:absolute!important;
    left:6px!important;
    right:146px!important;
    top:31px!important;
    width:auto!important;
    max-width:none!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:3px!important;
    transform:none!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-stat-chip,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-stat-chip{
    min-width:0!important;
    max-width:100%!important;
    height:25px!important;
    padding:2px 4px!important;
    gap:2px!important;
    font-size:7px!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-stat-chip b,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-stat-chip b{font-size:9px!important;white-space:nowrap!important}
  body:not(.prebattle) .enemy-hq-row .hq-stat-chip.skill,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-stat-chip.skill{display:none!important}

  /* 책사 박스는 모바일 본진 안에서 정상 크기로 표시 */
  body:not(.prebattle) .enemy-hq-row .hq-advisor-slot,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot{
    display:block!important;
    position:absolute!important;
    right:7px!important;
    top:31px!important;
    width:132px!important;
    min-width:132px!important;
    max-width:132px!important;
    height:91px!important;
    min-height:91px!important;
    max-height:91px!important;
    margin:0!important;
    padding:3px!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
    border-radius:6px!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-advisor-slot .advisor-card,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot .advisor-card{
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    overflow:hidden!important;
  }

  /* 아군 본진만 하단 플로팅 */
  body:not(.prebattle) .mobile-ally-hq-mount{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:calc(var(--mobile-action-height) + var(--mobile-hand-float-height) + env(safe-area-inset-bottom,0px))!important;
    z-index:88!important;
    width:100%!important;
    height:var(--mobile-hq-float-height)!important;
    min-height:var(--mobile-hq-float-height)!important;
    max-height:var(--mobile-hq-float-height)!important;
    padding:4px!important;
    overflow:hidden!important;
  }

  /* 핸드 카드를 1열 카드와 같은 폭/높이로 통일 */
  body:not(.prebattle) .mobile-hand-mount{
    height:var(--mobile-hand-float-height)!important;
    min-height:var(--mobile-hand-float-height)!important;
    max-height:var(--mobile-hand-float-height)!important;
  }
  body:not(.prebattle) .mobile-hand-mount .right-hand-section>.ornate-title{
    flex:0 0 26px!important;
    height:26px!important;
    min-height:26px!important;
  }
  body:not(.prebattle) .mobile-hand-mount .handbox{padding:2px 5px 3px!important}
  body:not(.prebattle) .mobile-hand-mount #hand.hand{
    height:107px!important;
    min-height:107px!important;
    max-height:107px!important;
    gap:4px!important;
    padding:0 0 1px!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card{
    position:relative!important;
    flex:0 0 var(--mobile-field-card-width)!important;
    width:var(--mobile-field-card-width)!important;
    min-width:var(--mobile-field-card-width)!important;
    max-width:var(--mobile-field-card-width)!important;
    height:var(--mobile-field-card-height)!important;
    min-height:var(--mobile-field-card-height)!important;
    max-height:var(--mobile-field-card-height)!important;
    display:grid!important;
    grid-template-rows:20px 64px 22px!important;
    row-gap:0!important;
    transform:none!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card-title-area{
    position:relative!important;
    inset:auto!important;
    z-index:3!important;
    width:100%!important;
    height:20px!important;
    min-height:20px!important;
    max-height:20px!important;
    padding:2px 3px!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card-name-text{
    font-size:8px!important;
    line-height:16px!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .cimg{
    position:relative!important;
    inset:auto!important;
    z-index:1!important;
    width:100%!important;
    height:64px!important;
    min-height:64px!important;
    max-height:64px!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .cimg img,
  body:not(.prebattle) .mobile-hand-mount #hand.hand .cimg .default-art{
    width:100%!important;
    height:100%!important;
    display:block!important;
    object-fit:cover!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .cstats,
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card-stat-grid,
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card-stat-cell{
    height:22px!important;
    min-height:22px!important;
    max-height:22px!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card-stat-cell b{font-size:9px!important}
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card.actionable-card:not(.opening-hand-card)::before{
    top:22px!important;
    right:3px!important;
    min-width:22px!important;
    padding:1px 3px!important;
    font-size:7px!important;
  }

  body:not(.prebattle),
  body:not(.prebattle) .app{
    padding-bottom:calc(var(--mobile-bottom-dock-height) + env(safe-area-inset-bottom,0px) + 8px)!important;
  }
}

@media (max-width:850px) and (orientation:landscape){
  :root{
    --mobile-field-card-height:90px;
    --mobile-hand-float-height:116px;
    --mobile-hq-float-height:116px;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand{height:91px!important;min-height:91px!important;max-height:91px!important}
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card{grid-template-rows:18px 54px 18px!important}
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card-title-area{height:18px!important;min-height:18px!important;max-height:18px!important}
  body:not(.prebattle) .mobile-hand-mount #hand.hand .cimg{height:54px!important;min-height:54px!important;max-height:54px!important}
  body:not(.prebattle) .mobile-hand-mount #hand.hand .cstats,
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card-stat-grid,
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card-stat-cell{height:18px!important;min-height:18px!important;max-height:18px!important}
  body:not(.prebattle) .enemy-hq-row .hq-advisor-slot,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot{height:76px!important;min-height:76px!important;max-height:76px!important}
}

/* PC에서 모바일 모드 미리보기 */
body.ui-mode-mobile-preview:not(.prebattle){
  --mobile-action-height:58px;
  --mobile-field-card-width:102px;
  --mobile-field-card-height:106px;
  --mobile-hand-float-height:136px;
  --mobile-hq-float-height:132px;
  --mobile-bottom-dock-height:326px;
  padding-bottom:334px!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .app{padding-bottom:334px!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row{position:relative!important;inset:auto!important;height:132px!important;min-height:132px!important;max-height:132px!important;padding:4px!important;background:linear-gradient(180deg,#301b1bf5,#130909fa)!important;border-bottom:1px solid #8a5b28!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .battle-hq,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .battle-hq{height:100%!important;min-height:0!important;max-height:none!important;border:1px solid #8b6a3c!important;border-radius:9px!important;overflow:hidden!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .hq-turn-box,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-turn-box{display:none!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hq-turn-inline{display:inline-flex!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .hq-subtitle,
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .hptxt,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-subtitle,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hptxt{display:none!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .hq-info-overlay,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-info-overlay{left:6px!important;right:146px!important;top:31px!important;width:auto!important;max-width:none!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:3px!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .hq-advisor-slot,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot{right:7px!important;top:31px!important;width:132px!important;min-width:132px!important;max-width:132px!important;height:91px!important;min-height:91px!important;max-height:91px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount{height:132px!important;min-height:132px!important;max-height:132px!important;bottom:194px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount{height:136px!important;min-height:136px!important;max-height:136px!important;bottom:58px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand{height:107px!important;min-height:107px!important;max-height:107px!important;gap:4px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card{flex:0 0 102px!important;width:102px!important;min-width:102px!important;max-width:102px!important;height:106px!important;min-height:106px!important;max-height:106px!important;grid-template-rows:20px 64px 22px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card-title-area{position:relative!important;inset:auto!important;height:20px!important;min-height:20px!important;max-height:20px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .cimg{height:64px!important;min-height:64px!important;max-height:64px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .cstats,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card-stat-grid,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card-stat-cell{height:22px!important;min-height:22px!important;max-height:22px!important}


/* v117.1 — 모바일 책사 위치와 핸드 폭 정밀 보정 */
@media (max-width:850px){
  :root{--mobile-field-card-width:calc((100vw - 32px)/4)}
  body:not(.prebattle) .enemy-hq-row .hq-advisor-slot,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot{
    transform:none!important;
    translate:none!important;
    inset:31px 7px auto auto!important;
  }
}
body.ui-mode-mobile-preview:not(.prebattle){--mobile-field-card-width:99.5px}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .hq-advisor-slot,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot{
  transform:none!important;
  translate:none!important;
  inset:31px 7px auto auto!important;
}


/* ================================================================
   v118 — 국가별 전투 카드 테두리 / 모바일 핸드 페이지 / 본진 동일 크기
   ================================================================ */
:root{
  --faction-wei-border:#45b9ff;
  --faction-shu-border:#51d775;
  --faction-wu-border:#ff6666;
  --faction-other-border:#aeb6c0;
}

/* 등급 테두리보다 국가색 테두리를 우선 표시한다. */
.battlefield-layout .unit.wei,
.hq-field-slot .base-unit.wei,
#hand.hand .card.wei{
  border-color:var(--faction-wei-border)!important;
  box-shadow:inset 0 0 0 1px #164f86,0 0 0 1px #8bdbff,0 2px 8px #0009!important;
}
.battlefield-layout .unit.shu,
.hq-field-slot .base-unit.shu,
#hand.hand .card.shu{
  border-color:var(--faction-shu-border)!important;
  box-shadow:inset 0 0 0 1px #1e6a35,0 0 0 1px #a0f0af,0 2px 8px #0009!important;
}
.battlefield-layout .unit.wu,
.hq-field-slot .base-unit.wu,
#hand.hand .card.wu{
  border-color:var(--faction-wu-border)!important;
  box-shadow:inset 0 0 0 1px #7f2424,0 0 0 1px #ffaaaa,0 2px 8px #0009!important;
}
.battlefield-layout .unit.other,
.hq-field-slot .base-unit.other,
#hand.hand .card.other,
#hand.hand .card.item,
#hand.hand .card.tactic{
  border-color:var(--faction-other-border)!important;
  box-shadow:inset 0 0 0 1px #4a515a,0 0 0 1px #e0e4e9,0 2px 8px #0009!important;
}

@media (max-width:850px){
  :root{
    --mobile-field-card-width:calc((100vw - 32px)/4);
    --mobile-field-card-height:106px;
    --mobile-hq-float-height:138px;
    --mobile-hand-float-height:136px;
    --mobile-bottom-dock-height:calc(var(--mobile-action-height) + var(--mobile-hand-float-height) + var(--mobile-hq-float-height));
  }

  /* 1·2·3열 모두 같은 카드 크기, 열별 개수만 다르게 중앙 정렬 */
  .battlefield-layout .lane:not(.hq-defense-lane) .slots.n4,
  .battlefield-layout .lane:not(.hq-defense-lane) .slots.n3,
  .battlefield-layout .lane:not(.hq-defense-lane) .slots.n2{
    display:grid!important;
    width:100%!important;
    height:var(--mobile-field-card-height)!important;
    min-height:var(--mobile-field-card-height)!important;
    max-height:var(--mobile-field-card-height)!important;
    gap:4px!important;
    padding-inline:0!important;
    justify-content:center!important;
    align-items:stretch!important;
  }
  .battlefield-layout .lane:not(.hq-defense-lane) .slots.n4{grid-template-columns:repeat(4,var(--mobile-field-card-width))!important}
  .battlefield-layout .lane:not(.hq-defense-lane) .slots.n3{grid-template-columns:repeat(3,var(--mobile-field-card-width))!important}
  .battlefield-layout .lane:not(.hq-defense-lane) .slots.n2{grid-template-columns:repeat(2,var(--mobile-field-card-width))!important}
  .battlefield-layout .lane:not(.hq-defense-lane) .slot{
    width:var(--mobile-field-card-width)!important;
    min-width:var(--mobile-field-card-width)!important;
    max-width:var(--mobile-field-card-width)!important;
    height:var(--mobile-field-card-height)!important;
    min-height:var(--mobile-field-card-height)!important;
    max-height:var(--mobile-field-card-height)!important;
  }

  /* 모바일 핸드는 전투필드 카드와 정확히 같은 크기와 국가별 테두리를 사용한다. */
  body:not(.prebattle) .mobile-hand-mount #hand.hand{
    display:flex!important;
    width:100%!important;
    overflow:hidden!important;
    justify-content:flex-start!important;
    align-items:stretch!important;
    gap:4px!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card{
    flex:0 0 var(--mobile-field-card-width)!important;
    width:var(--mobile-field-card-width)!important;
    min-width:var(--mobile-field-card-width)!important;
    max-width:var(--mobile-field-card-width)!important;
    height:var(--mobile-field-card-height)!important;
    min-height:var(--mobile-field-card-height)!important;
    max-height:var(--mobile-field-card-height)!important;
  }

  /* 한 줄에 모두 표시되지 않으면 제목 양옆 화살표로 페이지 이동 */
  body:not(.prebattle) .mobile-hand-mount .hand-title-paged{
    display:grid!important;
    grid-template-columns:32px minmax(0,1fr) 32px!important;
    align-items:center!important;
    width:100%!important;
    gap:3px!important;
  }
  body:not(.prebattle) .mobile-hand-mount #handPrevBtn{grid-column:1!important;grid-row:1!important}
  body:not(.prebattle) .mobile-hand-mount .hand-title-label{grid-column:2!important;grid-row:1!important;text-align:center!important}
  body:not(.prebattle) .mobile-hand-mount #handNextBtn{grid-column:3!important;grid-row:1!important}
  body:not(.prebattle) .mobile-hand-mount .hand-title-page{display:none!important}
  body:not(.prebattle) .mobile-hand-mount .hand-title-arrow{
    display:grid!important;
    place-items:center!important;
    width:30px!important;
    min-width:30px!important;
    height:23px!important;
    padding:0!important;
    border:1px solid #8e6b38!important;
    border-radius:5px!important;
    background:#17110b!important;
    color:#ffe2a7!important;
    font-size:20px!important;
    line-height:1!important;
  }
  body:not(.prebattle) .mobile-hand-mount .hand-title-arrow[hidden]{visibility:hidden!important}

  /* 적군/아군 본진 박스 크기와 내부 배치를 완전히 동일하게 한다. */
  body:not(.prebattle) .enemy-hq-row,
  body:not(.prebattle) .mobile-ally-hq-mount{
    box-sizing:border-box!important;
    width:100%!important;
    height:var(--mobile-hq-float-height)!important;
    min-height:var(--mobile-hq-float-height)!important;
    max-height:var(--mobile-hq-float-height)!important;
    padding:4px!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .enemy-hq-row .battle-hq,
  body:not(.prebattle) .mobile-ally-hq-mount .battle-hq{
    box-sizing:border-box!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    border-radius:9px!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-title,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-title{
    max-width:calc(100% - var(--mobile-field-card-width) - 18px)!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-info-overlay,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-info-overlay{
    right:calc(var(--mobile-field-card-width) + 14px)!important;
  }

  /* 책사 박스를 전투필드 카드와 동일한 폭·높이로 맞춘다. */
  body:not(.prebattle) .enemy-hq-row .hq-advisor-slot,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot{
    inset:27px 6px auto auto!important;
    width:var(--mobile-field-card-width)!important;
    min-width:var(--mobile-field-card-width)!important;
    max-width:var(--mobile-field-card-width)!important;
    height:var(--mobile-field-card-height)!important;
    min-height:var(--mobile-field-card-height)!important;
    max-height:var(--mobile-field-card-height)!important;
    padding:2px!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-advisor-slot .advisor-card,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot .advisor-card,
  body:not(.prebattle) .enemy-hq-row .hq-advisor-slot .advisor-image-only,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot .advisor-image-only,
  body:not(.prebattle) .enemy-hq-row .hq-advisor-slot .advisor-portrait,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot .advisor-portrait{
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    max-width:none!important;
    max-height:none!important;
    overflow:hidden!important;
  }
}

/* PC에서 모바일 모드 미리보기에도 동일 적용 */
body.ui-mode-mobile-preview:not(.prebattle){
  --mobile-field-card-width:99.5px;
  --mobile-field-card-height:106px;
  --mobile-hq-float-height:138px;
  --mobile-hand-float-height:136px;
  --mobile-bottom-dock-height:332px;
}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n4{grid-template-columns:repeat(4,var(--mobile-field-card-width))!important;justify-content:center!important;padding-inline:0!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n3{grid-template-columns:repeat(3,var(--mobile-field-card-width))!important;justify-content:center!important;padding-inline:0!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n2{grid-template-columns:repeat(2,var(--mobile-field-card-width))!important;justify-content:center!important;padding-inline:0!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slot{width:var(--mobile-field-card-width)!important;min-width:var(--mobile-field-card-width)!important;max-width:var(--mobile-field-card-width)!important;height:var(--mobile-field-card-height)!important;min-height:var(--mobile-field-card-height)!important;max-height:var(--mobile-field-card-height)!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand{overflow:hidden!important;justify-content:flex-start!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card{flex:0 0 var(--mobile-field-card-width)!important;width:var(--mobile-field-card-width)!important;min-width:var(--mobile-field-card-width)!important;max-width:var(--mobile-field-card-width)!important;height:var(--mobile-field-card-height)!important;min-height:var(--mobile-field-card-height)!important;max-height:var(--mobile-field-card-height)!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount .hand-title-paged{display:grid!important;grid-template-columns:32px minmax(0,1fr) 32px!important;align-items:center!important;width:100%!important;gap:3px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #handPrevBtn{grid-column:1!important;grid-row:1!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount .hand-title-label{grid-column:2!important;grid-row:1!important;text-align:center!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #handNextBtn{grid-column:3!important;grid-row:1!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount .hand-title-page{display:none!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount{height:var(--mobile-hq-float-height)!important;min-height:var(--mobile-hq-float-height)!important;max-height:var(--mobile-hq-float-height)!important;padding:4px!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .hq-advisor-slot,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot{inset:27px 6px auto auto!important;width:var(--mobile-field-card-width)!important;min-width:var(--mobile-field-card-width)!important;max-width:var(--mobile-field-card-width)!important;height:var(--mobile-field-card-height)!important;min-height:var(--mobile-field-card-height)!important;max-height:var(--mobile-field-card-height)!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .hq-info-overlay,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-info-overlay{right:calc(var(--mobile-field-card-width) + 14px)!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount{bottom:194px!important}


/* ================================================================
   v119 — 핸드/전투필드 카드 디자인 통일 · 모바일 전투열 폭 정렬
   ================================================================ */
:root{
  --tcg-card-head:24px;
  --tcg-card-stat:28px;
  --tcg-card-radius:8px;
}

/* PC 핸드 카드 디자인을 전투필드 카드에도 동일하게 적용 */
#hand.hand .card,
.battlefield-layout .unit{
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-rows:var(--tcg-card-head) minmax(0,1fr) var(--tcg-card-stat)!important;
  align-content:stretch!important;
  overflow:hidden!important;
  border-width:2px!important;
  border-style:solid!important;
  border-radius:var(--tcg-card-radius)!important;
  background:#11171d!important;
}
#hand.hand .card .card-title-area,
.battlefield-layout .unit .card-title-area{
  position:relative!important;
  inset:auto!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:4px!important;
  width:100%!important;
  height:var(--tcg-card-head)!important;
  min-height:var(--tcg-card-head)!important;
  max-height:var(--tcg-card-head)!important;
  padding:3px 5px!important;
  border-bottom:1px solid rgba(255,255,255,.16)!important;
  background:linear-gradient(180deg,#2b3440,#141a21)!important;
  color:#f5f7fa!important;
}
#hand.hand .card .card-name-text,
.battlefield-layout .unit .field-unit-name{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:11px!important;
  font-weight:950!important;
  line-height:1!important;
  color:#f7f8fa!important;
  text-shadow:0 1px 2px #000!important;
}
#hand.hand .card .card-title-grade,
.battlefield-layout .unit .field-grade{
  position:static!important;
  flex:0 0 auto!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:24px!important;
  height:16px!important;
  padding:0 4px!important;
  border-radius:3px!important;
  font-size:8px!important;
  font-weight:1000!important;
  line-height:1!important;
}
#hand.hand .card .cimg,
.battlefield-layout .unit .uimg{
  position:relative!important;
  inset:auto!important;
  box-sizing:border-box!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
  overflow:hidden!important;
  background:#0d1218!important;
  border:0!important;
}
#hand.hand .card .cimg img,
#hand.hand .card .cimg .default-art,
.battlefield-layout .unit .uimg img,
.battlefield-layout .unit .uimg .default-art{
  width:100%!important;
  height:100%!important;
  min-width:100%!important;
  min-height:100%!important;
  display:block!important;
  object-fit:cover!important;
  object-position:var(--img-x,50%) var(--img-y,50%)!important;
}
#hand.hand .card .cstats,
.battlefield-layout .unit .stats{
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:0!important;
  width:100%!important;
  height:var(--tcg-card-stat)!important;
  min-height:var(--tcg-card-stat)!important;
  max-height:var(--tcg-card-stat)!important;
  padding:0!important;
  border-top:1px solid rgba(255,255,255,.12)!important;
  background:#131a21!important;
}
#hand.hand .card .card-stat-grid{
  display:contents!important;
}
#hand.hand .card .card-stat-cell,
.battlefield-layout .unit .stats span{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:0!important;
  height:100%!important;
  padding:0 2px!important;
  border:0!important;
  border-right:1px solid rgba(255,255,255,.18)!important;
  background:rgba(255,255,255,.03)!important;
  color:#eef3f8!important;
  font-size:11px!important;
  font-weight:950!important;
  line-height:1!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
#hand.hand .card .card-stat-cell:last-child,
.battlefield-layout .unit .stats span:last-child{border-right:0!important}

/* 국가별 헤더/테두리 통일 */
#hand.hand .card.wei .card-title-area,
.battlefield-layout .unit.wei .card-title-area{background:linear-gradient(180deg,#3376bd,#173d69)!important}
#hand.hand .card.shu .card-title-area,
.battlefield-layout .unit.shu .card-title-area{background:linear-gradient(180deg,#419552,#225832)!important}
#hand.hand .card.wu .card-title-area,
.battlefield-layout .unit.wu .card-title-area{background:linear-gradient(180deg,#b94e4e,#682929)!important}
#hand.hand .card.other .card-title-area,
#hand.hand .card.item .card-title-area,
#hand.hand .card.tactic .card-title-area,
.battlefield-layout .unit.other .card-title-area{background:linear-gradient(180deg,#68717c,#3c434b)!important}

/* 기존 이미지 위 이름 오버레이 제거 */
.battlefield-layout .unit-image-meta{display:none!important}

@media (max-width:850px){
  :root{
    --mobile-play-width:min(calc(100vw - 12px),430px);
    --mobile-card-gap:4px;
    --mobile-card-width:calc((var(--mobile-play-width) - 20px)/4);
    --mobile-card-height:calc(var(--mobile-card-width) * 1.30);
    --tcg-card-head:21px;
    --tcg-card-stat:22px;
  }

  /* 전투필드·양쪽 본진·핸드 공간 폭을 동일하게 사용 */
  body:not(.prebattle) .boardwrap,
  body:not(.prebattle) .battlefield-layout,
  body:not(.prebattle) .battlefield-layout>.board,
  body:not(.prebattle) .enemy-hq-row,
  body:not(.prebattle) .mobile-ally-hq-mount,
  body:not(.prebattle) .mobile-hand-mount .right-hand-section{
    box-sizing:border-box!important;
    width:var(--mobile-play-width)!important;
    min-width:var(--mobile-play-width)!important;
    max-width:var(--mobile-play-width)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  body:not(.prebattle) .boardwrap{padding:4px!important;overflow:visible!important}
  body:not(.prebattle) .battlefield-layout>.board{padding:0!important;gap:4px!important}

  /* 적/아군 1·2·3열 문구 삭제 */
  .battlefield-layout .lane:not(.hq-defense-lane)>.label{display:none!important}

  /* 열 배경과 카드 그리드를 같은 폭·중앙축으로 고정 */
  .battlefield-layout .lane:not(.hq-defense-lane){
    box-sizing:border-box!important;
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    height:calc(var(--mobile-card-height) + 8px)!important;
    min-height:calc(var(--mobile-card-height) + 8px)!important;
    max-height:calc(var(--mobile-card-height) + 8px)!important;
    margin:0!important;
    padding:4px!important;
    overflow:hidden!important;
    border-radius:8px!important;
  }
  .battlefield-layout .lane:not(.hq-defense-lane) .slots.n4,
  .battlefield-layout .lane:not(.hq-defense-lane) .slots.n3,
  .battlefield-layout .lane:not(.hq-defense-lane) .slots.n2{
    box-sizing:border-box!important;
    display:grid!important;
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    height:var(--mobile-card-height)!important;
    min-height:var(--mobile-card-height)!important;
    max-height:var(--mobile-card-height)!important;
    margin:0!important;
    padding:0!important;
    gap:var(--mobile-card-gap)!important;
    align-items:stretch!important;
    justify-content:center!important;
  }
  .battlefield-layout .lane:not(.hq-defense-lane) .slots.n4{grid-template-columns:repeat(4,var(--mobile-card-width))!important}
  .battlefield-layout .lane:not(.hq-defense-lane) .slots.n3{grid-template-columns:repeat(3,var(--mobile-card-width))!important}
  .battlefield-layout .lane:not(.hq-defense-lane) .slots.n2{grid-template-columns:repeat(2,var(--mobile-card-width))!important}
  .battlefield-layout .lane:not(.hq-defense-lane) .slot,
  .battlefield-layout .lane:not(.hq-defense-lane) .unit{
    box-sizing:border-box!important;
    width:var(--mobile-card-width)!important;
    min-width:var(--mobile-card-width)!important;
    max-width:var(--mobile-card-width)!important;
    height:var(--mobile-card-height)!important;
    min-height:var(--mobile-card-height)!important;
    max-height:var(--mobile-card-height)!important;
    margin:0!important;
  }

  /* 모바일 핸드도 같은 카드 크기와 같은 폭 사용 */
  body:not(.prebattle) .mobile-hand-mount{width:100%!important;padding:0!important}
  body:not(.prebattle) .mobile-hand-mount .right-hand-section{padding:0!important}
  body:not(.prebattle) .mobile-hand-mount .handbox{box-sizing:border-box!important;width:100%!important;padding:4px!important}
  body:not(.prebattle) .mobile-hand-mount #hand.hand{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    height:var(--mobile-card-height)!important;
    min-height:var(--mobile-card-height)!important;
    max-height:var(--mobile-card-height)!important;
    padding:0!important;
    gap:var(--mobile-card-gap)!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card{
    flex:0 0 var(--mobile-card-width)!important;
    width:var(--mobile-card-width)!important;
    min-width:var(--mobile-card-width)!important;
    max-width:var(--mobile-card-width)!important;
    height:var(--mobile-card-height)!important;
    min-height:var(--mobile-card-height)!important;
    max-height:var(--mobile-card-height)!important;
  }

  #hand.hand .card .card-name-text,
  .battlefield-layout .unit .field-unit-name{font-size:9px!important}
  #hand.hand .card .card-title-grade,
  .battlefield-layout .unit .field-grade{min-width:20px!important;height:14px!important;font-size:7px!important;padding:0 3px!important}
  #hand.hand .card .card-stat-cell,
  .battlefield-layout .unit .stats span{font-size:9px!important}
}

/* 데스크톱에서 강제 모바일 미리보기에도 동일 규칙 적용 */
body.ui-mode-mobile-preview:not(.prebattle){--mobile-play-width:418px;--mobile-card-gap:4px;--mobile-card-width:calc((var(--mobile-play-width) - 20px)/4);--mobile-card-height:calc(var(--mobile-card-width) * 1.30);--tcg-card-head:21px;--tcg-card-stat:22px}
body.ui-mode-mobile-preview:not(.prebattle) .boardwrap,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout>.board,
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount .right-hand-section{box-sizing:border-box!important;width:var(--mobile-play-width)!important;min-width:var(--mobile-play-width)!important;max-width:var(--mobile-play-width)!important;margin-left:auto!important;margin-right:auto!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane)>.label{display:none!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane){box-sizing:border-box!important;width:100%!important;height:calc(var(--mobile-card-height) + 8px)!important;min-height:calc(var(--mobile-card-height) + 8px)!important;max-height:calc(var(--mobile-card-height) + 8px)!important;margin:0!important;padding:4px!important;overflow:hidden!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n4,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n3,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n2{display:grid!important;width:100%!important;height:var(--mobile-card-height)!important;min-height:var(--mobile-card-height)!important;max-height:var(--mobile-card-height)!important;margin:0!important;padding:0!important;gap:var(--mobile-card-gap)!important;align-items:stretch!important;justify-content:center!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n4{grid-template-columns:repeat(4,var(--mobile-card-width))!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n3{grid-template-columns:repeat(3,var(--mobile-card-width))!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n2{grid-template-columns:repeat(2,var(--mobile-card-width))!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slot,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .unit,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card{width:var(--mobile-card-width)!important;min-width:var(--mobile-card-width)!important;max-width:var(--mobile-card-width)!important;height:var(--mobile-card-height)!important;min-height:var(--mobile-card-height)!important;max-height:var(--mobile-card-height)!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand{width:100%!important;height:var(--mobile-card-height)!important;min-height:var(--mobile-card-height)!important;max-height:var(--mobile-card-height)!important;padding:0!important;gap:var(--mobile-card-gap)!important;overflow:hidden!important}

/* ================================================================
   v120 — 필드 버프 / 모바일 본진 상태·조작 / 이미지 셔틀 보정
   ================================================================ */
.mobile-hq-actions{display:none}
.mobile-hq-turn-chip{display:none}

/* PC: 턴 박스를 책사 박스 위쪽 제목 행으로 분리해 겹침 제거 */
@media (min-width:851px){
  .battle-hq .hq-turn-box{
    display:flex!important;
    position:absolute!important;
    top:5px!important;
    right:7px!important;
    bottom:auto!important;
    width:58px!important;
    height:22px!important;
    min-height:22px!important;
    padding:2px 5px!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    gap:4px!important;
    border-radius:5px!important;
    z-index:24!important;
  }
  .battle-hq .hq-turn-box span{font-size:9px!important}
  .battle-hq .hq-turn-box b{font-size:13px!important}
  .battle-hq .hq-title{padding-right:72px!important}
  .battle-hq .hq-advisor-slot{
    top:32px!important;
    right:7px!important;
    bottom:auto!important;
  }
  .mobile-hq-turn-chip{display:none!important}
}

/* 카드 관리자: PC·모바일 미리보기 박스 비율은 game.js의 REFERENCE_CARD_ASPECT(500/700)와
   반드시 일치해야 함. 이 값이 어긋나면 실시간 보정 모듈(v126)이 미리보기 자기 자신에도
   잘못된 보정을 적용해 셔틀로 값을 조정해도 정확히 반영되지 않고, PC·모바일 두 박스가
   동일한(그리고 기준과 다른) 비율을 강제로 공유하게 되어 두 미리보기가 항상 같은 모양으로
   움직이는 문제가 발생한다. */
.manager-preview{
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:500 / 700!important;
  align-self:start!important;
  touch-action:none!important;
  background:#111820!important;
}
.manager-preview>img,
.manager-preview>.card-art-img,
.manager-preview>.default-art{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  object-position:var(--img-x,50%) var(--img-y,50%)!important;
}
.image-adjust-panel .drag-position-readout{
  display:flex!important;
  justify-content:space-between!important;
  gap:8px!important;
  font-size:9px!important;
  color:#baa98f!important;
}
.image-adjust-panel .drag-position-readout b{color:#f0d29a!important;white-space:nowrap!important}

@media (max-width:850px){
  :root{
    --v120-hand-height:calc(var(--mobile-card-height,132px) + 34px);
    --v120-hq-height:178px;
    --v120-bottom-total:calc(var(--v120-hand-height) + var(--v120-hq-height));
  }

  /* 모바일 적·아군 본진을 동일한 규격으로 고정 */
  body:not(.prebattle) .enemy-hq-row,
  body:not(.prebattle) .mobile-ally-hq-mount{
    box-sizing:border-box!important;
    width:var(--mobile-play-width,min(calc(100vw - 12px),430px))!important;
    min-width:var(--mobile-play-width,min(calc(100vw - 12px),430px))!important;
    max-width:var(--mobile-play-width,min(calc(100vw - 12px),430px))!important;
    height:var(--v120-hq-height)!important;
    min-height:var(--v120-hq-height)!important;
    max-height:var(--v120-hq-height)!important;
    margin-left:auto!important;
    margin-right:auto!important;
    padding:4px!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .enemy-hq-row{
    position:relative!important;
    inset:auto!important;
    z-index:20!important;
    background:linear-gradient(180deg,#281719,#120b0d)!important;
    border-bottom:1px solid #6f3d33!important;
  }
  body:not(.prebattle) .mobile-ally-hq-mount{
    position:fixed!important;
    left:50%!important;
    right:auto!important;
    bottom:var(--v120-hand-height)!important;
    transform:translateX(-50%)!important;
    z-index:92!important;
    background:linear-gradient(180deg,#182a3af8,#071018fa)!important;
    border-top:1px solid #8a5b28!important;
    box-shadow:0 -7px 18px #000b!important;
  }
  body:not(.prebattle) .enemy-hq-row .battle-hq,
  body:not(.prebattle) .mobile-ally-hq-mount .battle-hq{
    box-sizing:border-box!important;
    position:relative!important;
    display:block!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    border-radius:9px!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-title,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-title{
    box-sizing:border-box!important;
    height:24px!important;
    min-height:24px!important;
    max-height:24px!important;
    padding:3px 7px!important;
    padding-right:7px!important;
    font-size:10px!important;
    line-height:17px!important;
    max-width:100%!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-subtitle,
  body:not(.prebattle) .enemy-hq-row .hptxt,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-subtitle,
  body:not(.prebattle) .mobile-ally-hq-mount .hptxt,
  body:not(.prebattle) .enemy-hq-row .hq-turn-box,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-turn-box,
  body:not(.prebattle) .enemy-hq-row .desktop-hq-skill-chip,
  body:not(.prebattle) .mobile-ally-hq-mount .desktop-hq-skill-chip{
    display:none!important;
  }

  /* 라이프·MP·행동력·덱·턴을 정확히 한 줄로 표시 */
  body:not(.prebattle) .enemy-hq-row .hq-info-overlay,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-info-overlay{
    box-sizing:border-box!important;
    position:absolute!important;
    left:5px!important;
    right:5px!important;
    top:27px!important;
    width:auto!important;
    max-width:none!important;
    height:25px!important;
    min-height:25px!important;
    display:grid!important;
    grid-template-columns:1.25fr 1fr .8fr .8fr .7fr!important;
    gap:3px!important;
    padding:0!important;
    transform:none!important;
    z-index:22!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-stat-chip,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-stat-chip{
    box-sizing:border-box!important;
    min-width:0!important;
    height:25px!important;
    min-height:25px!important;
    padding:2px 3px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:2px!important;
    border-radius:5px!important;
    font-size:8px!important;
    white-space:nowrap!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-stat-icon,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-stat-icon{font-size:9px!important;flex:0 0 auto!important}
  body:not(.prebattle) .enemy-hq-row .hq-stat-value,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-stat-value{font-size:9px!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important}
  body:not(.prebattle) .mobile-hq-turn-chip{display:flex!important}

  /* 양쪽 책사 박스 동일 규격 */
  body:not(.prebattle) .enemy-hq-row .hq-advisor-slot,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot{
    box-sizing:border-box!important;
    position:absolute!important;
    top:56px!important;
    right:6px!important;
    bottom:auto!important;
    left:auto!important;
    width:var(--mobile-card-width,100px)!important;
    min-width:var(--mobile-card-width,100px)!important;
    max-width:var(--mobile-card-width,100px)!important;
    height:84px!important;
    min-height:84px!important;
    max-height:84px!important;
    padding:2px!important;
    overflow:hidden!important;
    border-radius:7px!important;
    z-index:23!important;
  }
  body:not(.prebattle) .enemy-hq-row .hq-advisor-slot .advisor-card,
  body:not(.prebattle) .enemy-hq-row .hq-advisor-slot .advisor-image-only,
  body:not(.prebattle) .enemy-hq-row .hq-advisor-slot .advisor-portrait,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot .advisor-card,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot .advisor-image-only,
  body:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot .advisor-portrait{
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    max-width:none!important;
    max-height:none!important;
    overflow:hidden!important;
  }

  /* 항복·셔플·턴 종료를 아군 본진 내부에 배치 */
  body:not(.prebattle) .mobile-ally-hq-mount .mobile-hq-actions{
    box-sizing:border-box!important;
    position:absolute!important;
    left:6px!important;
    right:6px!important;
    bottom:5px!important;
    height:31px!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:5px!important;
    z-index:30!important;
  }
  body:not(.prebattle) .mobile-ally-hq-mount .mobile-hq-actions .btn{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    height:31px!important;
    min-height:31px!important;
    max-height:31px!important;
    padding:3px 4px!important;
    border-radius:6px!important;
    font-size:10px!important;
    font-weight:950!important;
    line-height:1!important;
  }

  /* 기존 하단 HUD는 제거하고 핸드를 최하단에 고정 */
  body:not(.prebattle) .bottom-hud{display:none!important}
  body:not(.prebattle) .mobile-hand-mount{
    position:fixed!important;
    left:50%!important;
    right:auto!important;
    bottom:0!important;
    transform:translateX(-50%)!important;
    width:var(--mobile-play-width,min(calc(100vw - 12px),430px))!important;
    min-width:var(--mobile-play-width,min(calc(100vw - 12px),430px))!important;
    max-width:var(--mobile-play-width,min(calc(100vw - 12px),430px))!important;
    height:var(--v120-hand-height)!important;
    min-height:var(--v120-hand-height)!important;
    max-height:var(--v120-hand-height)!important;
    z-index:93!important;
    overflow:hidden!important;
    background:#080c0efa!important;
    border-top:1px solid #70552d!important;
    box-shadow:0 -5px 15px #000b!important;
  }
  body:not(.prebattle) .mobile-hand-mount .right-hand-section{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .mobile-hand-mount .right-hand-section>.ornate-title{
    height:28px!important;
    min-height:28px!important;
    max-height:28px!important;
    flex:0 0 28px!important;
  }
  body:not(.prebattle) .mobile-hand-mount .handbox{
    height:calc(100% - 28px)!important;
    min-height:0!important;
    padding:3px 4px!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .mobile-hand-mount .handhead{display:none!important}
  body:not(.prebattle) .app,
  body:not(.prebattle){
    padding-bottom:calc(var(--v120-bottom-total) + 10px)!important;
  }

  /* 카드 관리자 모바일 셔틀: PC와 동일하게 드래그·크기·X/Y 위치 사용 */
  #cardManagerModal .card-manager-box{
    height:96dvh!important;
    max-height:96dvh!important;
  }
  #cardManagerModal .manager-main{
    grid-template-rows:154px minmax(0,1fr)!important;
  }
  #cardManagerModal .manager-list-pane{min-height:0!important;overflow:hidden!important}
  #cardManagerModal .manager-edit-pane{min-height:0!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}
  #cardManagerModal .manager-grid{grid-template-columns:1fr!important;gap:10px!important}
  #cardManagerModal .manager-preview-wrap{width:100%!important;max-width:340px!important;margin:0 auto!important}
  #cardManagerModal .manager-preview{
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    aspect-ratio:500 / 700!important;
    touch-action:none!important;
  }
  #cardManagerModal .image-adjust-panel label{
    grid-template-columns:64px minmax(0,1fr) 42px!important;
  }
}

/* PC에서 모바일 미리보기에도 v120 모바일 구조 적용 */
body.ui-mode-mobile-preview:not(.prebattle){
  --v120-hand-height:calc(var(--mobile-card-height,136px) + 34px);
  --v120-hq-height:178px;
  --v120-bottom-total:calc(var(--v120-hand-height) + var(--v120-hq-height));
}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount{height:var(--v120-hq-height)!important;min-height:var(--v120-hq-height)!important;max-height:var(--v120-hq-height)!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .hq-info-overlay,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-info-overlay{left:5px!important;right:5px!important;top:27px!important;width:auto!important;height:25px!important;display:grid!important;grid-template-columns:1.25fr 1fr .8fr .8fr .7fr!important;gap:3px!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .desktop-hq-skill-chip,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .desktop-hq-skill-chip,
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .hq-turn-box,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-turn-box{display:none!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hq-turn-chip{display:flex!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .hq-advisor-slot,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot{top:56px!important;right:6px!important;width:var(--mobile-card-width,100px)!important;min-width:var(--mobile-card-width,100px)!important;max-width:var(--mobile-card-width,100px)!important;height:84px!important;min-height:84px!important;max-height:84px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount{position:fixed!important;left:50%!important;right:auto!important;bottom:var(--v120-hand-height)!important;transform:translateX(-50%)!important;z-index:92!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount{position:fixed!important;left:50%!important;right:auto!important;bottom:0!important;transform:translateX(-50%)!important;height:var(--v120-hand-height)!important;min-height:var(--v120-hand-height)!important;max-height:var(--v120-hand-height)!important;z-index:93!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .mobile-hq-actions{position:absolute!important;left:6px!important;right:6px!important;bottom:5px!important;height:31px!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important;z-index:30!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .mobile-hq-actions .btn{height:31px!important;min-height:31px!important;padding:3px 4px!important;font-size:10px!important}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud{display:none!important}
body.ui-mode-mobile-preview:not(.prebattle) .app,
body.ui-mode-mobile-preview:not(.prebattle){padding-bottom:calc(var(--v120-bottom-total) + 10px)!important}


/* ================================================================
   v121 — HQ compact layout and card manager PC/mobile art controls
   ================================================================ */
.card-art-img,.unit-art-img,.manager-preview img,.advisor-portrait img,.roster-art img,.base-unit-art img{
  transform:scale(var(--img-scale-x,var(--img-scale,1)),var(--img-scale-y,var(--img-scale,1)))!important;
  transform-origin:var(--img-x,50%) var(--img-y,50%)!important;
}
.collection-card-art .card-art-img,.collection-card-art .configured-default-art,.collection-card-art .auto-folder-art,
.other-preview-art{transform:scale(var(--img-scale-x,var(--img-scale,1)),var(--img-scale-y,var(--img-scale,1)))!important;transform-origin:var(--img-x,50%) var(--img-y,50%)!important;}
.image-adjust-panel select{width:100%;min-height:28px;background:#151b22;color:#f7e8c9;border:1px solid #5d4324}
.image-adjust-subtitle{grid-column:1/-1;font-size:11px;font-weight:900;color:#f0c980;padding:2px 0 0}
.image-adjust-subtitle small{font-size:9px;color:#d8c6aa;font-weight:700}
.image-adjust-title small{font-size:9px;font-weight:700;color:#9fb0ca}
.manager-preview-dual{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.manager-inline-preview-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;padding:10px;border:1px solid #2d3d59;border-radius:10px;background:#0a1322}
.manager-preview-dual-col{display:flex;flex-direction:column;gap:6px;min-width:0}
.manager-preview-dual-label{font-size:11px;font-weight:900;color:#9fc2e6;text-align:center}
.manager-inline-preview-grid .manager-preview{height:190px}
.manager-preview-dual .manager-preview{height:210px}
.manager-preview-dual .manager-preview#managerPreviewMobile{border-color:#5ca9d9}
.manager-preview.mobile-preview{outline:2px solid #5ca9d955;outline-offset:2px}
.manager-preview.layout-linked{cursor:default;opacity:.55}
.manager-preview.layout-linked::after{content:'PC 값과 연동됨'}
.image-adjust-panel.compact{padding:7px;gap:5px}
.image-adjust-panel.compact label{grid-template-columns:52px minmax(0,1fr) 38px;font-size:9px}
@media(max-width:850px){
  .manager-preview-dual{grid-template-columns:1fr}
  .manager-inline-preview-grid{grid-template-columns:1fr}
  .manager-preview-dual .manager-preview{height:190px}
}

@media (min-width:851px){
  .right-panel-hq-row .battle-hq,.enemy-hq-row .battle-hq{min-height:112px!important;height:112px!important;padding-bottom:0!important}
  .right-panel-hq-row .battle-hq .hq-advisor-slot,.enemy-hq-row .battle-hq .hq-advisor-slot{top:30px!important;bottom:6px!important;height:auto!important;min-height:0!important}
  .right-panel-hq-row .battle-hq .hq-advisor-summary,.enemy-hq-row .battle-hq .hq-advisor-summary{bottom:6px!important}
  .right-panel-hq-row .battle-hq .hq-turn-box,.enemy-hq-row .battle-hq .hq-turn-box{top:8px!important;bottom:auto!important}
}

@media (max-width:850px){
  :root{--mobile-hand-card-w:86px;--mobile-hand-card-h:126px}
  .enemy-hq-row,.mobile-ally-hq-mount{width:100%!important;padding:5px!important;box-sizing:border-box!important}
  .enemy-hq-row .battle-hq,.mobile-ally-hq-mount .battle-hq{display:block!important;width:100%!important;height:138px!important;min-height:138px!important;max-height:138px!important;border-radius:10px!important;position:relative!important;overflow:hidden!important}
  .enemy-hq-row .battle-hq .hq-info-overlay,.mobile-ally-hq-mount .battle-hq .hq-info-overlay{left:8px!important;right:calc(var(--mobile-hand-card-w) + 14px)!important;top:34px!important;display:flex!important;gap:7px!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-start!important}
  .enemy-hq-row .battle-hq .hq-stat-chip,.mobile-ally-hq-mount .battle-hq .hq-stat-chip{font-size:11px!important}
  .enemy-hq-row .battle-hq .hq-stat-chip b,.mobile-ally-hq-mount .battle-hq .hq-stat-chip b{font-size:12px!important}
  .enemy-hq-row .battle-hq .hq-advisor-slot,.mobile-ally-hq-mount .battle-hq .hq-advisor-slot{position:absolute!important;right:8px!important;top:8px!important;width:var(--mobile-hand-card-w)!important;height:var(--mobile-hand-card-h)!important;min-width:var(--mobile-hand-card-w)!important;min-height:var(--mobile-hand-card-h)!important;max-width:var(--mobile-hand-card-w)!important;max-height:var(--mobile-hand-card-h)!important;border-radius:8px!important;padding:0!important;overflow:hidden!important}
  .enemy-hq-row .battle-hq .hq-advisor-slot .advisor-image-only .advisor-slot-badge,.mobile-ally-hq-mount .battle-hq .hq-advisor-slot .advisor-image-only .advisor-slot-badge{height:18px!important;padding:2px 4px!important}
  .enemy-hq-row .battle-hq .hq-advisor-summary,.mobile-ally-hq-mount .battle-hq .hq-advisor-summary{left:8px!important;right:calc(var(--mobile-hand-card-w) + 14px)!important;bottom:6px!important;min-height:24px!important;font-size:8px!important;padding:3px 5px!important}
  .enemy-hq-row .battle-hq .hq-turn-box,.mobile-ally-hq-mount .battle-hq .hq-turn-box{display:none!important}
  .enemy-hq-row .battle-hq .desktop-hq-skill-chip,.mobile-ally-hq-mount .battle-hq .desktop-hq-skill-chip{display:none!important}
  .mobile-hq-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px!important;padding:4px 6px 0!important}
  .mobile-hq-actions .btn{min-height:30px!important;font-size:11px!important;padding:0 4px!important}
}

body.ui-mode-mobile-preview{--mobile-hand-card-w:86px;--mobile-hand-card-h:126px}
body.ui-mode-mobile-preview .enemy-hq-row,
body.ui-mode-mobile-preview .mobile-ally-hq-mount{width:100%!important;padding:5px!important;box-sizing:border-box!important}
body.ui-mode-mobile-preview .enemy-hq-row .battle-hq,
body.ui-mode-mobile-preview .mobile-ally-hq-mount .battle-hq{display:block!important;width:100%!important;height:138px!important;min-height:138px!important;max-height:138px!important;border-radius:10px!important;position:relative!important;overflow:hidden!important}
body.ui-mode-mobile-preview .enemy-hq-row .battle-hq .hq-info-overlay,
body.ui-mode-mobile-preview .mobile-ally-hq-mount .battle-hq .hq-info-overlay{left:8px!important;right:calc(var(--mobile-hand-card-w) + 14px)!important;top:34px!important;display:flex!important;gap:7px!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-start!important}
body.ui-mode-mobile-preview .enemy-hq-row .battle-hq .hq-advisor-slot,
body.ui-mode-mobile-preview .mobile-ally-hq-mount .battle-hq .hq-advisor-slot{position:absolute!important;right:8px!important;top:8px!important;width:var(--mobile-hand-card-w)!important;height:var(--mobile-hand-card-h)!important;min-width:var(--mobile-hand-card-w)!important;min-height:var(--mobile-hand-card-h)!important;max-width:var(--mobile-hand-card-w)!important;max-height:var(--mobile-hand-card-h)!important;border-radius:8px!important;padding:0!important;overflow:hidden!important}
body.ui-mode-mobile-preview .enemy-hq-row .battle-hq .hq-advisor-summary,
body.ui-mode-mobile-preview .mobile-ally-hq-mount .battle-hq .hq-advisor-summary{left:8px!important;right:calc(var(--mobile-hand-card-w) + 14px)!important;bottom:6px!important;min-height:24px!important;font-size:8px!important;padding:3px 5px!important}
body.ui-mode-mobile-preview .enemy-hq-row .battle-hq .hq-turn-box,
body.ui-mode-mobile-preview .mobile-ally-hq-mount .battle-hq .hq-turn-box,
body.ui-mode-mobile-preview .enemy-hq-row .battle-hq .desktop-hq-skill-chip,
body.ui-mode-mobile-preview .mobile-ally-hq-mount .battle-hq .desktop-hq-skill-chip{display:none!important}

@media (max-width:850px){
  .mobile-hand-mount #hand.hand .card{flex:0 0 var(--mobile-hand-card-w)!important;width:var(--mobile-hand-card-w)!important;height:var(--mobile-hand-card-h)!important;min-height:var(--mobile-hand-card-h)!important;max-height:var(--mobile-hand-card-h)!important}
}
body.ui-mode-mobile-preview .mobile-hand-mount #hand.hand .card{flex:0 0 var(--mobile-hand-card-w)!important;width:var(--mobile-hand-card-w)!important;height:var(--mobile-hand-card-h)!important;min-height:var(--mobile-hand-card-h)!important;max-height:var(--mobile-hand-card-h)!important}


/* ================================================================
   v122 — 본진 높이 정리 / 모바일 카드 이미지 PC 동기화 / 반응형 이미지 셔틀
   ================================================================ */
.image-layout-link-toggle{grid-column:1/-1!important;display:flex!important;align-items:center!important;gap:7px!important;min-height:28px!important;padding:5px 7px!important;border:1px solid #5b4328!important;background:#10161d!important;color:#ead7b4!important;font-size:10px!important;font-weight:800!important}
.image-layout-link-toggle input{width:auto!important;min-width:16px!important;height:16px!important;margin:0!important}
.responsive-image-adjust select{width:100%;min-height:28px;background:#151b22;color:#f7e8c9;border:1px solid #5d4324}
.responsive-image-adjust .image-adjust-subtitle{grid-column:1/-1;margin-top:3px;padding-top:6px;border-top:1px solid #3d3325}
.batch-base-image-preview{grid-column:1/-1;width:min(100%,360px)!important;aspect-ratio:500/700!important;min-height:0!important;margin:3px auto 8px!important;touch-action:none!important;overflow:hidden!important}
.default-image-preview.mobile-preview,.hq-image-preview.mobile-preview,.batch-base-image-preview.mobile-preview{outline:2px solid #5ca9d9;outline-offset:2px}
.other-image-adjust-panel label,.batch-card-image-shuttle label{grid-template-columns:82px minmax(0,1fr) 48px!important}
.other-image-adjust-panel .image-layout-link-toggle,.batch-card-image-shuttle .image-layout-link-toggle{grid-template-columns:auto 1fr!important}

@media (min-width:851px){
  :root{--v122-pc-advisor-w:96px;--v122-pc-advisor-h:148px;--v122-pc-hq-top:29px;--v122-pc-hq-h:178px}
  .reference-left .enemy-hq-host,
  .reference-left .enemy-hq-row,
  .reference-right .right-panel-hq-row{height:var(--v122-pc-hq-h)!important;min-height:var(--v122-pc-hq-h)!important;max-height:var(--v122-pc-hq-h)!important;padding-bottom:0!important;margin-bottom:6px!important;overflow:hidden!important}
  .reference-left .enemy-hq-row .battle-hq,
  .reference-right .right-panel-hq-row .battle-hq{height:var(--v122-pc-hq-h)!important;min-height:var(--v122-pc-hq-h)!important;max-height:var(--v122-pc-hq-h)!important;padding-bottom:0!important;overflow:hidden!important}
  .reference-left .enemy-hq-row .battle-hq .hq-advisor-slot,
  .reference-right .right-panel-hq-row .battle-hq .hq-advisor-slot{top:var(--v122-pc-hq-top)!important;right:10px!important;bottom:1px!important;transform:none!important;width:var(--v122-pc-advisor-w)!important;min-width:var(--v122-pc-advisor-w)!important;max-width:var(--v122-pc-advisor-w)!important;height:var(--v122-pc-advisor-h)!important;min-height:var(--v122-pc-advisor-h)!important;max-height:var(--v122-pc-advisor-h)!important;margin:0!important}
  #allyHq .hq-advisor-slot,#enemyHq .hq-advisor-slot{top:var(--v122-pc-hq-top)!important;right:10px!important;bottom:1px!important;left:auto!important;transform:none!important;width:var(--v122-pc-advisor-w)!important;min-width:var(--v122-pc-advisor-w)!important;max-width:var(--v122-pc-advisor-w)!important;height:var(--v122-pc-advisor-h)!important;min-height:var(--v122-pc-advisor-h)!important;max-height:var(--v122-pc-advisor-h)!important;margin:0!important}
}

@media (max-width:850px){
  :root{--mobile-hand-card-w:var(--mobile-card-width,100px);--mobile-hand-card-h:var(--mobile-card-height,130px);--v122-hq-pad:5px;--v122-mobile-hq-h:calc(var(--mobile-hand-card-h) + 16px);--v120-hq-height:var(--v122-mobile-hq-h);--v120-bottom-total:calc(var(--v120-hand-height) + var(--v122-mobile-hq-h))}
  body:not(.prebattle) .enemy-hq-row,
  body:not(.prebattle) .mobile-ally-hq-mount{box-sizing:border-box!important;width:var(--mobile-play-width,min(calc(100vw - 12px),430px))!important;min-width:var(--mobile-play-width,min(calc(100vw - 12px),430px))!important;max-width:var(--mobile-play-width,min(calc(100vw - 12px),430px))!important;height:var(--v122-mobile-hq-h)!important;min-height:var(--v122-mobile-hq-h)!important;max-height:var(--v122-mobile-hq-h)!important;padding:var(--v122-hq-pad)!important;margin:0 auto!important;overflow:hidden!important}
  body:not(.prebattle) .enemy-hq-row .battle-hq,
  body:not(.prebattle) .mobile-ally-hq-mount .battle-hq{box-sizing:border-box!important;width:100%!important;height:calc(var(--v122-mobile-hq-h) - (var(--v122-hq-pad) * 2))!important;min-height:calc(var(--v122-mobile-hq-h) - (var(--v122-hq-pad) * 2))!important;max-height:calc(var(--v122-mobile-hq-h) - (var(--v122-hq-pad) * 2))!important;margin:0!important;padding:0!important;overflow:hidden!important}
  body:not(.prebattle) .enemy-hq-row .battle-hq .hq-advisor-slot,
  body:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-advisor-slot{position:absolute!important;top:3px!important;right:3px!important;bottom:3px!important;left:auto!important;transform:none!important;width:var(--mobile-hand-card-w)!important;min-width:var(--mobile-hand-card-w)!important;max-width:var(--mobile-hand-card-w)!important;height:var(--mobile-hand-card-h)!important;min-height:var(--mobile-hand-card-h)!important;max-height:var(--mobile-hand-card-h)!important;margin:0!important;padding:0!important;overflow:hidden!important}
  body:not(.prebattle) #allyHq .hq-advisor-slot,body:not(.prebattle) #enemyHq .hq-advisor-slot{position:absolute!important;top:3px!important;right:3px!important;bottom:3px!important;left:auto!important;transform:none!important;width:var(--mobile-hand-card-w)!important;min-width:var(--mobile-hand-card-w)!important;max-width:var(--mobile-hand-card-w)!important;height:var(--mobile-hand-card-h)!important;min-height:var(--mobile-hand-card-h)!important;max-height:var(--mobile-hand-card-h)!important;margin:0!important;padding:0!important;overflow:hidden!important}
  body:not(.prebattle) .enemy-hq-row .battle-hq .hq-info-overlay,
  body:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-info-overlay{left:7px!important;right:calc(var(--mobile-hand-card-w) + 11px)!important;top:31px!important;width:auto!important;max-width:none!important;height:auto!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important;align-items:center!important;justify-items:stretch!important;overflow:visible!important}
  body:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip,
  body:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip{box-sizing:border-box!important;width:100%!important;min-width:0!important;height:24px!important;min-height:24px!important;padding:2px 4px!important;display:flex!important;font-size:9px!important;overflow:hidden!important}
  body:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip b,
  body:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip b{font-size:10px!important}
  body:not(.prebattle) .mobile-ally-hq-mount{bottom:var(--v120-hand-height)!important}
  body:not(.prebattle) .mobile-ally-hq-mount .mobile-hq-actions{left:7px!important;right:calc(var(--mobile-hand-card-w) + 11px)!important;bottom:5px!important;height:29px!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:3px!important;padding:0!important}
  body:not(.prebattle) .mobile-ally-hq-mount .mobile-hq-actions .btn{height:29px!important;min-height:29px!important;max-height:29px!important;font-size:9px!important;padding:2px!important}
  body:not(.prebattle) .app,body:not(.prebattle){padding-bottom:calc(var(--v120-hand-height) + var(--v122-mobile-hq-h) + 10px)!important}

  body:not(.prebattle) .mobile-hand-mount #hand.hand .card{flex:0 0 var(--mobile-hand-card-w)!important;width:var(--mobile-hand-card-w)!important;min-width:var(--mobile-hand-card-w)!important;max-width:var(--mobile-hand-card-w)!important;height:var(--mobile-hand-card-h)!important;min-height:var(--mobile-hand-card-h)!important;max-height:var(--mobile-hand-card-h)!important}
  #otherImageModal .other-image-box,#batchSettingsModal .batch-settings-box{width:96vw!important;max-width:96vw!important;height:94dvh!important;max-height:94dvh!important}
  .responsive-image-adjust label{grid-template-columns:72px minmax(0,1fr) 44px!important}
}

body.ui-mode-mobile-preview:not(.prebattle){--mobile-hand-card-w:var(--mobile-card-width,100px);--mobile-hand-card-h:var(--mobile-card-height,130px);--v122-hq-pad:5px;--v122-mobile-hq-h:calc(var(--mobile-hand-card-h) + 16px);--v120-hq-height:var(--v122-mobile-hq-h);--v120-bottom-total:calc(var(--v120-hand-height) + var(--v122-mobile-hq-h))}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount{width:var(--mobile-play-width,418px)!important;min-width:var(--mobile-play-width,418px)!important;max-width:var(--mobile-play-width,418px)!important;height:var(--v122-mobile-hq-h)!important;min-height:var(--v122-mobile-hq-h)!important;max-height:var(--v122-mobile-hq-h)!important;padding:var(--v122-hq-pad)!important;margin-left:auto!important;margin-right:auto!important;overflow:hidden!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .battle-hq,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .battle-hq{height:calc(var(--v122-mobile-hq-h) - (var(--v122-hq-pad) * 2))!important;min-height:calc(var(--v122-mobile-hq-h) - (var(--v122-hq-pad) * 2))!important;max-height:calc(var(--v122-mobile-hq-h) - (var(--v122-hq-pad) * 2))!important;margin:0!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .battle-hq .hq-advisor-slot,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-advisor-slot{top:3px!important;right:3px!important;bottom:3px!important;left:auto!important;transform:none!important;width:var(--mobile-hand-card-w)!important;min-width:var(--mobile-hand-card-w)!important;max-width:var(--mobile-hand-card-w)!important;height:var(--mobile-hand-card-h)!important;min-height:var(--mobile-hand-card-h)!important;max-height:var(--mobile-hand-card-h)!important}
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .battle-hq .hq-info-overlay,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-info-overlay{left:7px!important;right:calc(var(--mobile-hand-card-w) + 11px)!important;top:31px!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount{bottom:var(--v120-hand-height)!important}
body.ui-mode-mobile-preview:not(.prebattle) .app,body.ui-mode-mobile-preview:not(.prebattle){padding-bottom:calc(var(--v120-hand-height) + var(--v122-mobile-hq-h) + 10px)!important}

/* v122 final ID specificity: 구버전 #allyHq 위치 규칙보다 우선 */
body.ui-mode-mobile-preview:not(.prebattle) #allyHq .hq-advisor-slot,
body.ui-mode-mobile-preview:not(.prebattle) #enemyHq .hq-advisor-slot{position:absolute!important;top:3px!important;right:3px!important;bottom:3px!important;left:auto!important;transform:none!important;width:var(--mobile-hand-card-w)!important;min-width:var(--mobile-hand-card-w)!important;max-width:var(--mobile-hand-card-w)!important;height:var(--mobile-hand-card-h)!important;min-height:var(--mobile-hand-card-h)!important;max-height:var(--mobile-hand-card-h)!important;margin:0!important;padding:0!important;overflow:hidden!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card{flex:0 0 var(--mobile-hand-card-w)!important;width:var(--mobile-hand-card-w)!important;min-width:var(--mobile-hand-card-w)!important;max-width:var(--mobile-hand-card-w)!important;height:var(--mobile-hand-card-h)!important;min-height:var(--mobile-hand-card-h)!important;max-height:var(--mobile-hand-card-h)!important}


/* ================================================================
   v123 — 일괄 셔틀 4열 · 본진 정보 2행 · 버프 장수 직접 클릭
   ================================================================ */
.batch-card-image-shuttle{
  grid-template-columns:1fr!important;
}
.batch-card-image-shuttle>.batch-base-preview-dual{
  grid-column:1/-1!important;
}
.batch-card-image-shuttle>.image-adjust-subtitle,
.batch-card-image-shuttle>.image-layout-link-toggle,
.batch-card-image-shuttle>.batch-base-control-row{
  grid-column:1/-1!important;
}
.batch-base-control-row{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(150px,1fr))!important;
  gap:10px!important;
  width:100%!important;
  min-width:0!important;
  overflow-x:auto!important;
  padding:2px 0 6px!important;
}
.batch-base-control-row>label{
  display:grid!important;
  grid-template-columns:68px minmax(80px,1fr) 42px!important;
  gap:6px!important;
  align-items:center!important;
  min-width:150px!important;
  margin:0!important;
}
.batch-base-control-row input[type="range"]{width:100%!important;min-width:80px!important}
.batch-base-control-row output{min-width:42px!important;text-align:right!important}
.manager-preview-dual-col .batch-base-control-row{grid-template-columns:repeat(2,minmax(110px,1fr))!important}

.mobile-combat-summary{grid-template-columns:repeat(4,1fr)!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-combat-summary{grid-template-columns:repeat(4,1fr)!important}

/* PC와 모바일 본진의 6개 정보: 라이프 · MP · AP · 카드 수 · 턴 · 책략을 3×2로 통일 */
#allyHq .hptxt,#enemyHq .hptxt,#allyHq .hq-turn-box,#enemyHq .hq-turn-box{display:none!important}
#allyHq .hq-info-overlay,#enemyHq .hq-info-overlay{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(22px,auto))!important;
  gap:4px!important;
  align-items:stretch!important;
  justify-items:stretch!important;
  overflow:visible!important;
}
#allyHq .hq-stat-chip,#enemyHq .hq-stat-chip{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:3px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
}
#allyHq .mobile-hq-turn-chip,#enemyHq .mobile-hq-turn-chip,
#allyHq .desktop-hq-skill-chip,#enemyHq .desktop-hq-skill-chip{display:flex!important}

@media (min-width:851px){
  #allyHq .hq-info-overlay,#enemyHq .hq-info-overlay{
    left:8px!important;
    right:116px!important;
    top:31px!important;
    height:auto!important;
  }
  #allyHq .hq-stat-chip,#enemyHq .hq-stat-chip{
    min-height:25px!important;
    padding:3px 5px!important;
    font-size:10px!important;
  }
  #allyHq .hq-stat-chip b,#enemyHq .hq-stat-chip b{font-size:11px!important}
}

@media (max-width:850px){
  body:not(.prebattle) #allyHq .hq-info-overlay,
  body:not(.prebattle) #enemyHq .hq-info-overlay{
    left:7px!important;
    right:calc(var(--mobile-hand-card-w) + 11px)!important;
    top:29px!important;
    height:50px!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,23px)!important;
    gap:4px!important;
  }
  body:not(.prebattle) #allyHq .hq-stat-chip,
  body:not(.prebattle) #enemyHq .hq-stat-chip{
    height:23px!important;
    min-height:23px!important;
    padding:2px 3px!important;
    font-size:8px!important;
  }
  body:not(.prebattle) #allyHq .hq-stat-chip b,
  body:not(.prebattle) #enemyHq .hq-stat-chip b{font-size:9px!important}
  body:not(.prebattle) .mobile-ally-hq-mount .mobile-hq-actions{
    left:7px!important;
    right:calc(var(--mobile-hand-card-w) + 11px)!important;
    bottom:5px!important;
    height:29px!important;
    z-index:35!important;
  }
}

body.ui-mode-mobile-preview:not(.prebattle) #allyHq .hq-info-overlay,
body.ui-mode-mobile-preview:not(.prebattle) #enemyHq .hq-info-overlay{
  left:7px!important;
  right:calc(var(--mobile-hand-card-w) + 11px)!important;
  top:29px!important;
  height:50px!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,23px)!important;
  gap:4px!important;
}
body.ui-mode-mobile-preview:not(.prebattle) #allyHq .hq-stat-chip,
body.ui-mode-mobile-preview:not(.prebattle) #enemyHq .hq-stat-chip{
  height:23px!important;
  min-height:23px!important;
  padding:2px 3px!important;
  font-size:8px!important;
}
body.ui-mode-mobile-preview:not(.prebattle) #allyHq .hq-stat-chip b,
body.ui-mode-mobile-preview:not(.prebattle) #enemyHq .hq-stat-chip b{font-size:9px!important}
body.ui-mode-mobile-preview:not(.prebattle) #allyHq .mobile-hq-turn-chip,
body.ui-mode-mobile-preview:not(.prebattle) #enemyHq .mobile-hq-turn-chip,
body.ui-mode-mobile-preview:not(.prebattle) #allyHq .desktop-hq-skill-chip,
body.ui-mode-mobile-preview:not(.prebattle) #enemyHq .desktop-hq-skill-chip{display:flex!important}

@media (max-width:700px){
  .batch-base-control-row{grid-template-columns:repeat(4,150px)!important}
}

/* v123 mobile dock centering: 구형 left:0 규칙과 translate 충돌 방지 */
@media (max-width:850px){
  html body:not(.prebattle) .battle-panel > #mobileAllyHqMount,
  html body:not(.prebattle) .battle-panel > #mobileHandMount{
    left:calc((100vw - var(--mobile-play-width,min(calc(100vw - 12px),430px)))/2)!important;
    right:auto!important;
    transform:none!important;
    margin-left:0!important;
    margin-right:0!important;
  }
}
html body.ui-mode-mobile-preview:not(.prebattle) .battle-panel > #mobileAllyHqMount,
html body.ui-mode-mobile-preview:not(.prebattle) .battle-panel > #mobileHandMount{
  left:calc((100vw - var(--mobile-play-width,min(calc(100vw - 12px),430px)))/2)!important;
  right:auto!important;
  transform:none!important;
  margin-left:0!important;
  margin-right:0!important;
}

/* ================================================================
   v129 — PC·모바일 카드 이미지/구조 단일 기준
   - 관리자 미리보기는 실제 카드의 이미지 영역 비율(약 0.84)을 사용
   - 모바일 핸드는 PC 핸드 카드 비율, 모바일 전장은 PC 전장 카드 비율 사용
   - 동일한 이미지 크기·위치 CSS 변수만 사용
   ================================================================ */
.unified-card-image-controls{
  grid-template-columns:minmax(240px,360px)!important;
  justify-content:center!important;
  width:100%!important;
}
.unified-card-image-controls .manager-preview-dual-col{width:100%!important;max-width:360px!important;margin:0 auto!important}
.manager-inline-preview-grid.unified-card-image-controls .manager-preview,
.default-image-preview-dual.unified-card-image-controls .default-image-preview,
.batch-base-preview-dual.unified-card-image-controls .batch-base-image-preview{
  box-sizing:border-box!important;
  width:min(100%,320px)!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:21/25!important;
  margin-left:auto!important;
  margin-right:auto!important;
  touch-action:none!important;
  overflow:hidden!important;
}
.unified-card-image-controls .image-adjust-panel,
.unified-card-image-controls .other-image-adjust-panel,
.unified-card-image-controls .batch-base-control-row{width:100%!important;box-sizing:border-box!important}

@media (max-width:850px){
  :root{
    --mobile-play-width:min(calc(100vw - 12px),430px);
    --mobile-card-gap:4px;
    --mobile-card-width:calc((var(--mobile-play-width) - 20px)/4);
    --v129-hand-card-height:calc(var(--mobile-card-width) * 1.632);
    --v129-field-card-height:calc(var(--mobile-card-width) * 1.767);
    --mobile-card-height:var(--v129-field-card-height);
    --mobile-hand-card-w:var(--mobile-card-width);
    --mobile-hand-card-h:var(--v129-hand-card-height);
    --v120-hand-height:calc(var(--v129-hand-card-height) + 34px);
    --v122-mobile-hq-h:calc(var(--v129-hand-card-height) + 16px);
    --v120-hq-height:var(--v122-mobile-hq-h);
    --v120-bottom-total:calc(var(--v120-hand-height) + var(--v122-mobile-hq-h));
  }
  body:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane){
    height:calc(var(--v129-field-card-height) + 8px)!important;
    min-height:calc(var(--v129-field-card-height) + 8px)!important;
    max-height:calc(var(--v129-field-card-height) + 8px)!important;
  }
  body:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n4,
  body:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n3,
  body:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n2{
    height:var(--v129-field-card-height)!important;
    min-height:var(--v129-field-card-height)!important;
    max-height:var(--v129-field-card-height)!important;
  }
  body:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slot,
  body:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .unit{
    width:var(--mobile-card-width)!important;
    min-width:var(--mobile-card-width)!important;
    max-width:var(--mobile-card-width)!important;
    height:var(--v129-field-card-height)!important;
    min-height:var(--v129-field-card-height)!important;
    max-height:var(--v129-field-card-height)!important;
  }
  body:not(.prebattle) .battlefield-layout .unit{
    grid-template-rows:calc(var(--mobile-card-width) * .2684) minmax(0,1fr) calc(var(--mobile-card-width) * .3131)!important;
  }
  body:not(.prebattle) .battlefield-layout .unit .card-title-area,
  body:not(.prebattle) .battlefield-layout .unit .stats{height:100%!important;min-height:0!important;max-height:none!important}

  body:not(.prebattle) .mobile-hand-mount{
    height:var(--v120-hand-height)!important;
    min-height:var(--v120-hand-height)!important;
    max-height:var(--v120-hand-height)!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand{
    height:var(--v129-hand-card-height)!important;
    min-height:var(--v129-hand-card-height)!important;
    max-height:var(--v129-hand-card-height)!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card{
    flex:0 0 var(--mobile-card-width)!important;
    width:var(--mobile-card-width)!important;
    min-width:var(--mobile-card-width)!important;
    max-width:var(--mobile-card-width)!important;
    height:var(--v129-hand-card-height)!important;
    min-height:var(--v129-hand-card-height)!important;
    max-height:var(--v129-hand-card-height)!important;
    grid-template-rows:calc(var(--mobile-card-width) * .1705) minmax(0,1fr) calc(var(--mobile-card-width) * .2898)!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-title-area,
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card .cstats,
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-stat-grid,
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-stat-cell{
    height:100%!important;min-height:0!important;max-height:none!important;
  }
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card-name-text,
  body:not(.prebattle) .battlefield-layout .unit .field-unit-name{font-size:8px!important}
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card-title-grade,
  body:not(.prebattle) .battlefield-layout .unit .field-grade{height:13px!important;min-width:18px!important;font-size:7px!important;padding:0 3px!important}
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card-stat-cell,
  body:not(.prebattle) .battlefield-layout .unit .stats span{font-size:9px!important}

  body:not(.prebattle) .mobile-ally-hq-mount{bottom:var(--v120-hand-height)!important}
  body:not(.prebattle),body:not(.prebattle) .app{padding-bottom:calc(var(--v120-hand-height) + var(--v122-mobile-hq-h) + 10px)!important}
}

body.ui-mode-mobile-preview:not(.prebattle){
  --mobile-play-width:418px;
  --mobile-card-gap:4px;
  --mobile-card-width:calc((var(--mobile-play-width) - 20px)/4);
  --v129-hand-card-height:calc(var(--mobile-card-width) * 1.632);
  --v129-field-card-height:calc(var(--mobile-card-width) * 1.767);
  --mobile-card-height:var(--v129-field-card-height);
  --mobile-hand-card-w:var(--mobile-card-width);
  --mobile-hand-card-h:var(--v129-hand-card-height);
  --v120-hand-height:calc(var(--v129-hand-card-height) + 34px);
  --v122-mobile-hq-h:calc(var(--v129-hand-card-height) + 16px);
  --v120-hq-height:var(--v122-mobile-hq-h);
  --v120-bottom-total:calc(var(--v120-hand-height) + var(--v122-mobile-hq-h));
}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane){height:calc(var(--v129-field-card-height) + 8px)!important;min-height:calc(var(--v129-field-card-height) + 8px)!important;max-height:calc(var(--v129-field-card-height) + 8px)!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n4,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n3,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slots.n2{height:var(--v129-field-card-height)!important;min-height:var(--v129-field-card-height)!important;max-height:var(--v129-field-card-height)!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .slot,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .lane:not(.hq-defense-lane) .unit{width:var(--mobile-card-width)!important;min-width:var(--mobile-card-width)!important;max-width:var(--mobile-card-width)!important;height:var(--v129-field-card-height)!important;min-height:var(--v129-field-card-height)!important;max-height:var(--v129-field-card-height)!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .unit{grid-template-rows:calc(var(--mobile-card-width) * .2684) minmax(0,1fr) calc(var(--mobile-card-width) * .3131)!important}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .unit .card-title-area,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .unit .stats{height:100%!important;min-height:0!important;max-height:none!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount{height:var(--v120-hand-height)!important;min-height:var(--v120-hand-height)!important;max-height:var(--v120-hand-height)!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand{height:var(--v129-hand-card-height)!important;min-height:var(--v129-hand-card-height)!important;max-height:var(--v129-hand-card-height)!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card{flex:0 0 var(--mobile-card-width)!important;width:var(--mobile-card-width)!important;min-width:var(--mobile-card-width)!important;max-width:var(--mobile-card-width)!important;height:var(--v129-hand-card-height)!important;min-height:var(--v129-hand-card-height)!important;max-height:var(--v129-hand-card-height)!important;grid-template-rows:calc(var(--mobile-card-width) * .1705) minmax(0,1fr) calc(var(--mobile-card-width) * .2898)!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-title-area,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card .cstats,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-stat-grid,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-stat-cell{height:100%!important;min-height:0!important;max-height:none!important}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount{bottom:var(--v120-hand-height)!important}
body.ui-mode-mobile-preview:not(.prebattle),body.ui-mode-mobile-preview:not(.prebattle) .app{padding-bottom:calc(var(--v120-hand-height) + var(--v122-mobile-hq-h) + 10px)!important}


/* v129.1 — 모바일 핸드 이미지 행의 구형 64px 고정값 제거 */
@media (max-width:850px){
  body:not(.prebattle) .mobile-hand-mount #hand.hand .card .cimg{
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
  }
}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card .cimg{
  height:100%!important;
  min-height:0!important;
  max-height:none!important;
}

/* v129.2 — 기타 이미지 모달의 ID 고정 높이보다 공통 카드 비율을 우선 */
#otherImageModal .default-image-preview-dual.unified-card-image-controls #defaultCardImagePreviewPc{
  width:min(100%,320px)!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:21/25!important;
}

/* v130 — mobile ally HQ should not cover the ally front row.
   Reserve dedicated scroll space under the battlefield board for the floating ally HQ only.
   The hand/action dock is already accounted for by body/app padding-bottom. */
@media (max-width:850px){
  body:not(.prebattle) .battlefield-layout>.board{
    padding-bottom:calc(var(--mobile-hq-float-height) + 10px)!important;
    box-sizing:border-box!important;
  }
}

/* v131 — prevent the mobile ally HQ from covering the ally front row.
   Keep the ally HQ docked near the bottom, but as a sticky flow element so it preserves layout space. */
@media (max-width:850px){
  body:not(.prebattle) .mobile-ally-hq-mount{
    position:sticky!important;
    left:auto!important;
    right:auto!important;
    bottom:calc(var(--mobile-action-height) + var(--mobile-hand-float-height) + env(safe-area-inset-bottom,0px))!important;
    margin-top:6px!important;
    z-index:77!important;
    flex:0 0 var(--mobile-hq-float-height)!important;
  }
  body:not(.prebattle) .battlefield-layout>.board{
    padding-bottom:0!important;
  }
}

/* ================================================================
   v136 — 버프/스킬 가능 카드 소형 표식 · 행동별 선택 메뉴
   ================================================================ */
/* 전투필드의 기존 대형 공격 버프 제공 배지는 숨기고, 이미지 상단의 작은 표식만 사용한다. */
.battlefield-layout .unit .buff-provider-badge{
  display:none!important;
}
.battlefield-layout .unit .unit-buff-box,
.battlefield-layout .unit .unit-skill-box{
  top:2px!important;
  min-width:18px!important;
  height:11px!important;
  padding:0 2px!important;
  border-width:1px!important;
  border-radius:2px!important;
  font-size:6px!important;
  font-weight:900!important;
  line-height:9px!important;
  letter-spacing:-.04em!important;
  box-sizing:border-box!important;
  box-shadow:none!important;
  text-shadow:0 1px 1px #000!important;
  opacity:.92!important;
}
.battlefield-layout .unit .unit-buff-box{left:2px!important;right:auto!important;}
.battlefield-layout .unit .unit-skill-box{right:2px!important;left:auto!important;}

/* 버프 장수는 버프/이동/공격, 전장 지략가는 이동/공격을 독립 버튼으로 선택한다. */
.field-primary-action-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:5px!important;
}
.field-primary-action-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
.field-strategist-actions .field-primary-action-grid button{
  min-width:0!important;
  padding:7px 4px!important;
  text-align:center!important;
  align-content:center!important;
}
.field-strategist-actions .field-primary-action-grid button b{
  font-size:12px!important;
  line-height:1.1!important;
}
.field-strategist-actions .field-primary-action-grid button span{
  font-size:8px!important;
  line-height:1.2!important;
  white-space:normal!important;
}
.field-strategist-actions .field-primary-action-grid .buff-start-action{
  border-color:#52cfb5!important;
  background:#0b3a35!important;
}
.field-strategist-actions .field-primary-action-grid .buff-cancel-action{
  border-color:#ffd36e!important;
  background:#49340e!important;
}
@media(max-width:850px){
  .battlefield-layout .unit .unit-buff-box,
  .battlefield-layout .unit .unit-skill-box{
    min-width:17px!important;
    height:10px!important;
    font-size:5.5px!important;
    line-height:8px!important;
  }
  .field-strategist-actions .field-primary-action-grid button{padding:8px 3px!important;}
}


/* ================================================================
   v167 — online battle click-lock correction
   온라인 전투가 시작된 상태에서는 오래 남은 prebattle 클래스가
   덱 조작 버튼의 포인터 이벤트를 차단하지 못하도록 한다.
   ================================================================ */
body[data-online-room]:not(.hand-reveal-active) .right-deck-body,
body[data-online-room]:not(.hand-reveal-active) .right-deck-body .deck-action-mount,
body[data-online-room]:not(.hand-reveal-active) .right-deck-body #shuffleBtn,
body[data-online-room]:not(.hand-reveal-active) .right-deck-body #endTurnBtn{
  pointer-events:auto!important;
}
body[data-online-room] .right-deck-body #shuffleBtn,
body[data-online-room] .right-deck-body #endTurnBtn{
  position:relative!important;
  z-index:120!important;
  touch-action:manipulation!important;
}


/* ================================================================
   v168 — online action controls definitive input fix
   버튼은 런타임에 rightActionMount/mobileHqActions로 이동하므로
   부모 경로와 무관하게 온라인 방의 실제 버튼 ID를 직접 복구한다.
   ================================================================ */
body[data-online-room] #shuffleBtn,
body[data-online-room] #endTurnBtn,
body[data-online-room] #battleControlBtn{
  pointer-events:auto!important;
  position:relative!important;
  z-index:10020!important;
  touch-action:manipulation!important;
  user-select:none!important;
}
body[data-online-room] #rightActionMount,
body[data-online-room] #mobileHqActions,
body[data-online-room] .hud-actions,
body[data-online-room] .bottom-hud{
  pointer-events:auto!important;
  position:relative!important;
  z-index:10010!important;
}
body[data-online-room].prebattle #shuffleBtn:not(:disabled),
body[data-online-room].prebattle #endTurnBtn:not(:disabled){
  pointer-events:auto!important;
  opacity:1!important;
  filter:none!important;
}
body[data-online-room] #shuffleBtn:disabled,
body[data-online-room] #endTurnBtn:disabled{
  pointer-events:none!important;
}

/* ================================================================
   v170 — online battlefield/hand click-lock final backstop
   v167/v168은 셔플·턴종료 버튼에만 pointer-events를 강제했다.
   "카드 클릭이 안 된다"는 정작 .board/#hand 자체에는 같은 보호가
   없어 body.prebattle 클래스 제거 타이밍(JS)에만 의존하고 있었다.
   전투가 실제로 시작된 온라인 방에서는 CSS 레벨에서도 항상
   클릭 가능하도록 강제해, JS 쪽 타이밍 문제와 무관하게 동작을 보장한다.
   ================================================================ */
body[data-online-room].hand-reveal-active .board,
body[data-online-room].hand-reveal-active .right-hand-section{
  pointer-events:none;
}
body[data-online-room]:not(.hand-reveal-active) .board,
body[data-online-room]:not(.hand-reveal-active) .right-hand-section,
body[data-online-room]:not(.hand-reveal-active) #hand.hand,
body[data-online-room]:not(.hand-reveal-active) #hand.hand .card{
  pointer-events:auto!important;
}


/* ---- assets/css/effects.css ---- */
#battleFxLayer{position:fixed;inset:0;pointer-events:none;z-index:9999;overflow:hidden}
.fx-target-flash{position:fixed;border:2px solid #ffe29a;border-radius:10px;box-shadow:0 0 20px #ffd36a, inset 0 0 14px #fff3;animation:fxTargetFlash .42s ease-out forwards;pointer-events:none}
@keyframes fxTargetFlash{0%{opacity:0;transform:scale(.92)}35%{opacity:1;transform:scale(1.05)}100%{opacity:0;transform:scale(1.1)}}

.fx-melee-clash{position:fixed;width:76px;height:76px;transform:translate(-50%,-50%);pointer-events:none;filter:drop-shadow(0 0 8px #ffd16a)}
.fx-melee-clash .blade{position:absolute;left:30px;top:4px;width:13px;height:64px;border-radius:8px 8px 3px 3px;background:linear-gradient(90deg,#6e7682,#fff,#aeb7c5);border:1px solid #fff;transform-origin:50% 83%;box-shadow:0 0 7px #fff8}
.fx-melee-clash .blade::after{content:'';position:absolute;left:-8px;bottom:8px;width:27px;height:5px;border-radius:4px;background:#b88934;border:1px solid #f6d485}
.fx-melee-clash .blade.a{transform:rotate(-56deg);animation:bladeA .48s cubic-bezier(.2,.8,.2,1) forwards}
.fx-melee-clash .blade.b{transform:rotate(56deg);animation:bladeB .48s cubic-bezier(.2,.8,.2,1) forwards}
.fx-melee-clash .spark{position:absolute;left:34px;top:34px;width:8px;height:8px;border-radius:50%;background:#fff4bb;box-shadow:0 0 5px 2px #fff,0 0 18px 8px #f5b742;animation:sparkPop .42s ease-out forwards}
@keyframes bladeA{0%{opacity:0;transform:rotate(-105deg) scale(.75)}45%{opacity:1;transform:rotate(-38deg) scale(1.05)}100%{opacity:0;transform:rotate(-55deg) scale(.95)}}
@keyframes bladeB{0%{opacity:0;transform:rotate(105deg) scale(.75)}45%{opacity:1;transform:rotate(38deg) scale(1.05)}100%{opacity:0;transform:rotate(55deg) scale(.95)}}
@keyframes sparkPop{0%{opacity:0;transform:scale(.2)}42%{opacity:1;transform:scale(1.4)}100%{opacity:0;transform:scale(2.8)}}

.fx-arrow{position:fixed;left:0;top:0;width:38px;height:5px;border-radius:4px;background:linear-gradient(90deg,#5a3b1d,#e7c17d 70%,#f7e2a8);transform-origin:19px 2.5px;pointer-events:none;filter:drop-shadow(0 0 5px #ffc86a);will-change:transform,opacity}
.fx-arrow::before{content:'';position:absolute;right:-8px;top:-4px;border-left:10px solid #e7e3d4;border-top:6px solid transparent;border-bottom:6px solid transparent}
.fx-arrow::after{content:'';position:absolute;left:-8px;top:-4px;width:12px;height:13px;background:linear-gradient(135deg,transparent 45%,#c46a4d 46% 58%,transparent 59%),linear-gradient(45deg,transparent 45%,#c46a4d 46% 58%,transparent 59%)}
.fx-arrow.fly{animation:arrowFly var(--fx-duration,.42s) cubic-bezier(.12,.68,.2,1) forwards}
@keyframes arrowFly{0%{opacity:0;transform:translate(var(--sx),var(--sy)) rotate(var(--angle)) scale(.72)}12%{opacity:1}88%{opacity:1}100%{opacity:0;transform:translate(var(--tx),var(--ty)) rotate(var(--angle)) scale(1.05)}}

body.no-anim #battleFxLayer{display:none!important}

.fx-equipment-burst{position:fixed;left:50%;top:18%;transform:translateX(-50%);min-width:210px;padding:16px 24px;border-radius:18px;border:2px solid #fff8;background:linear-gradient(135deg,#101826f2,#0a0f18f7);box-shadow:0 20px 44px #000b,0 0 24px #ffffff14;display:flex;align-items:center;justify-content:center;gap:12px;z-index:10000;animation:equipmentBurstIn 1.05s ease-out forwards}
.fx-equipment-burst .ring{position:absolute;inset:-6px;border-radius:22px;border:2px solid #ffffff40;animation:equipmentRing 1s ease-out forwards}
.fx-equipment-burst .glyph{position:relative;font-size:28px;filter:drop-shadow(0 0 8px #fff8)}
.fx-equipment-burst .label{position:relative;font-size:18px;font-weight:900;color:#fff;text-shadow:0 2px 8px #000}
.fx-equipment-burst.destroy{border-color:#ffaf86;background:linear-gradient(135deg,#512012f5,#261109f7 65%,#150c08f7)}
.fx-equipment-burst.steal{border-color:#83ddff;background:linear-gradient(135deg,#163f62f5,#0d223af7 65%,#0a1117f7)}
@keyframes equipmentBurstIn{0%{opacity:0;transform:translateX(-50%) translateY(-20px) scale(.8)}20%{opacity:1;transform:translateX(-50%) translateY(0) scale(1.05)}70%{opacity:1;transform:translateX(-50%) translateY(0) scale(1)}100%{opacity:0;transform:translateX(-50%) translateY(-8px) scale(.98)}}
@keyframes equipmentRing{0%{opacity:.75;transform:scale(.85)}100%{opacity:0;transform:scale(1.16)}}


/* 스킬카드 및 아이템 장착 연출 */
.fx-tactic{
  position:fixed;
  width:78px;
  height:78px;
  transform:translate(-50%,-50%);
  display:grid;
  place-items:center;
  border-radius:50%;
  pointer-events:none;
  z-index:10001;
  animation:fxTacticBurst 1s ease-out forwards;
}
.fx-tactic span{font-size:44px;filter:drop-shadow(0 0 10px #fff);}
.fx-tactic.lightning{background:radial-gradient(circle,#ecf7ffcc 0 12%,#8bd7ff77 30%,transparent 68%);box-shadow:0 0 26px #9fe4ff;}
.fx-tactic.firestorm{background:radial-gradient(circle,#fff0a8cc 0 10%,#ff782c88 34%,transparent 70%);box-shadow:0 0 30px #ff6a2f;}
.fx-tactic.hqdamage{background:radial-gradient(circle,#ffe7aacc,#e43b2d88 38%,transparent 72%);}
.fx-tactic.defdown{background:radial-gradient(circle,#c8d6e5aa,#55697c77 40%,transparent 72%);}
.fx-tactic.draw{background:radial-gradient(circle,#d9c2ffbb,#7454b877 40%,transparent 72%);}
.fx-tactic.clone{background:radial-gradient(circle,#e9f6ffbb,#78b9d477 40%,transparent 72%);}
.fx-tactic.supply,.fx-tactic.hqheal{background:radial-gradient(circle,#efffcbbb,#66cf7a77 40%,transparent 72%);}
@keyframes fxTacticBurst{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.35) rotate(-12deg)}
  22%{opacity:1;transform:translate(-50%,-50%) scale(1.18) rotate(4deg)}
  70%{opacity:1;transform:translate(-50%,-50%) scale(.98) rotate(0)}
  100%{opacity:0;transform:translate(-50%,-50%) scale(1.45)}
}
.fx-item-equip{
  position:fixed;
  width:92px;
  height:92px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  border:2px solid #ffe2a0;
  background:radial-gradient(circle,#fff4c9cc 0 12%,#d49b4077 36%,transparent 70%);
  box-shadow:0 0 28px #ffd36f;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  animation:fxItemEquip 1.15s ease-out forwards;
  z-index:10001;
}
.fx-item-equip.linked{border-color:#b9ecff;box-shadow:0 0 32px #82dbff;background:radial-gradient(circle,#f3fdffdd 0 12%,#62bddd77 38%,transparent 72%);}
.fx-item-equip .icon{font-size:34px;filter:drop-shadow(0 0 8px #fff);}
.fx-item-equip .label{padding:2px 5px;background:#090c10dc;border:1px solid #ffffff66;color:#fff4d6;font-size:9px;font-weight:900;white-space:nowrap;}
@keyframes fxItemEquip{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.25) rotate(-25deg)}
  25%{opacity:1;transform:translate(-50%,-50%) scale(1.15) rotate(5deg)}
  72%{opacity:1;transform:translate(-50%,-50%) scale(1)}
  100%{opacity:0;transform:translate(-50%,-50%) scale(1.3)}
}


/* v66 스킬 애니메이션 */
.fx-lightning-field{
  position:fixed;pointer-events:none;border:1px solid #b9ebff99;
  background:linear-gradient(180deg,#d9f5ff3d,#77cfff17 45%,#ffffff16);
  box-shadow:inset 0 0 55px #bdefff66,0 0 42px #77d8ff55;
  animation:lightningFieldFlash .9s steps(2,end) forwards;
}
@keyframes lightningFieldFlash{0%{opacity:0}8%{opacity:1}18%{opacity:.12}28%{opacity:.95}42%{opacity:.18}58%{opacity:.75}100%{opacity:0}}
.fx-lightning-strike{
  position:fixed;width:90px;transform:translateX(-50%);pointer-events:none;z-index:10004;
  filter:drop-shadow(0 0 8px #d9f7ff) drop-shadow(0 0 20px #5cc8ff);
}
.fx-lightning-strike .bolt{position:absolute;display:block;background:linear-gradient(90deg,#ffffff,#aeeaff 45%,#fff);clip-path:polygon(45% 0,70% 0,56% 38%,83% 34%,35% 100%,45% 58%,18% 62%);}
.fx-lightning-strike .bolt.main{left:31px;top:0;width:28px;height:calc(100% - 10px);animation:lightningBolt .62s steps(2,end) forwards;}
.fx-lightning-strike .bolt.branch{width:16px;height:42%;bottom:12px;opacity:.8;}
.fx-lightning-strike .bolt.branch.a{left:20px;transform:rotate(-22deg);}
.fx-lightning-strike .bolt.branch.b{right:18px;transform:rotate(24deg);}
.fx-lightning-strike .impact{position:absolute;left:50%;bottom:-13px;width:86px;height:34px;transform:translateX(-50%);border-radius:50%;background:radial-gradient(ellipse,#fff 0 8%,#a9eaffaa 20%,#55bfff55 45%,transparent 72%);box-shadow:0 0 28px #9ee9ff;animation:lightningImpact .75s ease-out forwards;}
@keyframes lightningBolt{0%{opacity:0;transform:scaleY(.15)}18%{opacity:1;transform:scaleY(1)}28%{opacity:.12}42%{opacity:1}58%{opacity:.2}72%{opacity:.9}100%{opacity:0}}
@keyframes lightningImpact{0%{opacity:0;transform:translateX(-50%) scale(.2)}25%{opacity:1;transform:translateX(-50%) scale(1.2)}100%{opacity:0;transform:translateX(-50%) scale(1.7)}}
.fx-tactic.morale{width:120px;height:120px;border:2px solid #ffe296;background:radial-gradient(circle,#fff4bdcc 0 10%,#e2a83588 35%,transparent 72%);box-shadow:0 0 40px #ffd66f;}
.fx-tactic.morale::before,.fx-tactic.morale::after{content:'';position:absolute;inset:10px;border:2px solid #ffe8a5;border-radius:50%;animation:moraleWave .95s ease-out forwards;}
.fx-tactic.morale::after{animation-delay:.18s;}
@keyframes moraleWave{0%{opacity:1;transform:scale(.3)}100%{opacity:0;transform:scale(1.65)}}
.fx-tactic.discord{background:radial-gradient(circle,#ead7ffcc 0 12%,#7b3faf88 38%,transparent 72%);box-shadow:0 0 30px #b670ff;}


/* v68 카드별 본진 연출 이미지 관리자 */
.event-image-manager{margin-top:12px;padding:10px;border:1px solid #705739;background:#0a1019cc;display:grid;gap:9px}
.event-image-note{font-size:10px;line-height:1.45;color:#c9d4e2}
.event-image-setting{padding:8px;border:1px solid #4b6078;background:#101a27;transition:opacity .18s ease,filter .18s ease}
.event-image-setting.disabled{opacity:.42;filter:grayscale(.75)}
.event-image-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-size:11px;color:#f0d6a3}
.event-image-head span{font-size:9px;color:#9fb0c4}
.event-image-preview{position:relative;height:82px;overflow:hidden;border:1px solid #35475c;background:linear-gradient(135deg,#111b27,#05080d);display:flex;align-items:center;justify-content:center;color:#7f91a8;font-size:10px;margin-bottom:6px}
.event-image-preview img{width:100%;height:100%;object-fit:cover;object-position:center}
.event-image-preview .event-image-source{position:absolute;right:4px;bottom:4px;padding:2px 5px;background:#02050bd9;border:1px solid #ffffff2b;color:#dce8f5;font-size:8px}
.event-image-preview.dedicated{border-color:#c79a4f;box-shadow:inset 0 0 18px #eab75b17}

/* v68 본진 박스 카드 연출 */
.hq-card-scene{position:absolute;inset:0;z-index:80;overflow:hidden;pointer-events:none;background:#02050a;isolation:isolate}
.hq-card-scene img{position:absolute;inset:-4%;width:108%;height:108%;object-fit:cover;object-position:center;filter:saturate(1.08) contrast(1.05);will-change:transform,opacity,filter}
.hq-card-scene .scene-shade{position:absolute;inset:0;z-index:2;background:linear-gradient(180deg,#0000 35%,#02050ad9 100%);box-shadow:inset 0 0 30px #000}
.hq-card-scene .scene-energy{position:absolute;inset:0;z-index:3}
.hq-card-scene .scene-label{position:absolute;left:8px;right:8px;bottom:6px;z-index:5;padding:4px 7px;background:#05080dd9;border:1px solid #ffffff38;color:#f4ead7;font-size:10px;font-weight:900;letter-spacing:.04em;text-align:center;text-shadow:0 1px 4px #000}
.hq-card-scene.leaving{animation:hqSceneLeave .28s ease-in forwards}
@keyframes hqSceneLeave{to{opacity:0;filter:blur(2px)}}

.hq-card-scene.summon img{animation:hqSummonImage 1.05s cubic-bezier(.13,.78,.2,1) forwards}
.hq-card-scene.summon .scene-energy{background:linear-gradient(90deg,transparent 8%,#9ddcff00 28%,#dff8ffb8 49%,#fff 50%,#dff8ffb8 51%,#9ddcff00 72%,transparent 92%);mix-blend-mode:screen;animation:hqSummonBeam 1.05s ease-out forwards}
.hq-card-scene.summon::before,.hq-card-scene.summon::after{content:'';position:absolute;z-index:4;left:50%;top:50%;width:18px;height:18px;border:2px solid #d9f6ff;border-radius:50%;box-shadow:0 0 18px #8bdfff;transform:translate(-50%,-50%);animation:hqSummonRing 1s ease-out forwards}
.hq-card-scene.summon::after{animation-delay:.13s}
@keyframes hqSummonImage{0%{opacity:0;transform:translateY(18%) scale(calc(var(--scene-scale,1) * 1.18));filter:brightness(2.1) blur(7px)}38%{opacity:1;transform:translateY(5%) scale(calc(var(--scene-scale,1) * .96));filter:brightness(1.35) blur(0)}100%{opacity:1;transform:translateY(0) scale(var(--scene-scale,1));filter:brightness(1)}}
@keyframes hqSummonBeam{0%{opacity:0;transform:scaleX(.12)}28%{opacity:1;transform:scaleX(.65)}100%{opacity:0;transform:scaleX(1.4)}}
@keyframes hqSummonRing{0%{opacity:.95;transform:translate(-50%,-50%) scale(.25)}100%{opacity:0;transform:translate(-50%,-50%) scale(9)}}

.hq-card-scene.battle img{animation:hqBattleImage .82s cubic-bezier(.36,.07,.19,.97) forwards}
.hq-card-scene.battle .scene-energy{background:linear-gradient(118deg,transparent 42%,#fff8 48%,#ffb34d 50%,#ff3b20b8 52%,transparent 58%);mix-blend-mode:screen;animation:hqBattleSlash .76s ease-out forwards}
.hq-card-scene.battle::before,.hq-card-scene.battle::after{content:'';position:absolute;z-index:4;left:50%;top:48%;width:120%;height:3px;background:linear-gradient(90deg,transparent,#fff,#ff993b,transparent);box-shadow:0 0 14px #ff743b;transform:translate(-50%,-50%) rotate(24deg) scaleX(0);animation:hqBattleCut .72s ease-out forwards}
.hq-card-scene.battle::after{transform:translate(-50%,-50%) rotate(-20deg) scaleX(0);animation-delay:.08s}
@keyframes hqBattleImage{0%{opacity:0;transform:translate(0,0) scale(calc(var(--scene-scale,1) * 1.04))}12%{opacity:1}20%,40%,60%{transform:translate(-3px,0) rotate(-.7deg) scale(var(--scene-scale,1))}30%,50%,70%{transform:translate(4px,0) rotate(.7deg) scale(var(--scene-scale,1))}100%{transform:translate(0,0) rotate(0) scale(var(--scene-scale,1));filter:saturate(1.2) contrast(1.12)}}
@keyframes hqBattleSlash{0%{opacity:0;transform:translateX(-70%)}28%{opacity:1}100%{opacity:0;transform:translateX(70%)}}
@keyframes hqBattleCut{0%{opacity:0;transform:translate(-50%,-50%) rotate(24deg) scaleX(0)}35%{opacity:1;transform:translate(-50%,-50%) rotate(24deg) scaleX(1)}100%{opacity:0;transform:translate(-50%,-50%) rotate(24deg) scaleX(1.25)}}
.hq-card-scene.battle::after{animation-name:hqBattleCutReverse}
@keyframes hqBattleCutReverse{0%{opacity:0;transform:translate(-50%,-50%) rotate(-20deg) scaleX(0)}35%{opacity:1;transform:translate(-50%,-50%) rotate(-20deg) scaleX(1)}100%{opacity:0;transform:translate(-50%,-50%) rotate(-20deg) scaleX(1.25)}}

.hq-card-scene.tactic img{animation:hqTacticImage 1.25s ease-out forwards}
.hq-card-scene.tactic .scene-energy{background:radial-gradient(circle at center,#fff 0 2%,#b58cffb8 8%,#572fd78f 22%,transparent 52%);mix-blend-mode:screen;animation:hqTacticPulse 1.2s ease-out forwards}
.hq-card-scene.tactic::before,.hq-card-scene.tactic::after{content:'✦ ᚱ ✧ ᛟ ✦ ᚨ ✧';position:absolute;z-index:4;left:50%;top:48%;width:112px;height:112px;border:2px solid #d9c6ff;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#f2eaff;font-size:13px;letter-spacing:5px;text-shadow:0 0 8px #b688ff;box-shadow:0 0 18px #8e5eff,inset 0 0 18px #6a3acf;transform:translate(-50%,-50%) scale(.2);animation:hqMagicCircle 1.2s ease-out forwards}
.hq-card-scene.tactic::after{width:74px;height:74px;animation-direction:reverse;animation-duration:1s}
@keyframes hqTacticImage{0%{opacity:0;transform:translateY(0) scale(calc(var(--scene-scale,1) * 1.10));filter:hue-rotate(35deg) brightness(1.8) blur(5px)}30%{opacity:1;filter:hue-rotate(15deg) brightness(1.3) blur(0)}100%{transform:translateY(0) scale(var(--scene-scale,1));filter:hue-rotate(0) brightness(1.05)}}
@keyframes hqTacticPulse{0%{opacity:0;transform:scale(.25)}35%{opacity:1}100%{opacity:0;transform:scale(1.8)}}
@keyframes hqMagicCircle{0%{opacity:0;transform:translate(-50%,-50%) scale(.2) rotate(-100deg)}28%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(1.45) rotate(130deg)}}

body.no-anim .hq-card-scene:not(.stage-preview){display:none!important}


/* v69 본진 연출: 선택 영역, 원본 크기 정지, 노출 시간 연장 */
.hq-card-scene img{inset:0!important;width:100%!important;height:100%!important;object-position:var(--scene-x,50%) var(--scene-y,50%)!important;transform-origin:var(--scene-x,50%) var(--scene-y,50%)!important;}
.hq-card-scene.summon img,.hq-card-scene.battle img,.hq-card-scene.tactic img{animation-duration:1.25s!important;animation-fill-mode:forwards!important;}
.hq-card-scene.holding img{animation:none!important;transform:scale(var(--scene-scale,1))!important;opacity:1!important;filter:saturate(1.05) contrast(1.03)!important;transition:transform .18s ease!important;}
.hq-card-scene.holding .scene-energy,.hq-card-scene.holding::before,.hq-card-scene.holding::after{animation-play-state:paused!important;opacity:.32!important;}
.hq-card-scene.leaving{animation:hqSceneLeave .32s ease-in forwards!important;}
@keyframes hqSceneLeave{to{opacity:0;filter:brightness(.72)}}

.battlefield-card-scene{position:fixed!important;inset:auto!important;z-index:140;border-radius:16px;box-shadow:0 18px 40px #000a,0 0 0 1px #ffffff22;backdrop-filter:blur(2px)}
.hq-card-scene .scene-effect-caption{position:absolute;left:10px;right:10px;top:10px;z-index:6;display:flex;flex-direction:column;gap:4px;align-items:center;text-align:center}
.hq-card-scene .scene-effect-caption:empty{display:none}
.hq-card-scene .scene-title-big{padding:4px 10px;border-radius:999px;background:#09111ddb;border:1px solid #ffffff40;color:#fff6dd;font-size:18px;font-weight:900;letter-spacing:.06em;text-shadow:0 2px 6px #000}
.hq-card-scene .scene-title-small{padding:4px 10px;border-radius:999px;background:#03070cd4;border:1px solid #ffffff24;color:#eef6ff;font-size:11px;font-weight:700;line-height:1.3;text-shadow:0 1px 4px #000}
.hq-card-scene.death img{animation:hqDeathImage 1.06s ease-out forwards}
.hq-card-scene.death .scene-energy{background:radial-gradient(circle at center,#ffccd633 0 8%,#7d001199 28%,#15020ab8 62%,transparent 80%);mix-blend-mode:screen;animation:hqDeathPulse 1s ease-out forwards}
.hq-card-scene.death::before,.hq-card-scene.death::after{content:'';position:absolute;z-index:4;left:50%;top:50%;width:120%;height:120%;border:2px solid #ff9bb355;border-radius:50%;transform:translate(-50%,-50%) scale(.2);animation:hqDeathRing 1s ease-out forwards}
.hq-card-scene.death::after{animation-delay:.08s}
@keyframes hqDeathImage{0%{transform:scale(1.2);opacity:0;filter:brightness(1.8)}30%{opacity:1}100%{transform:scale(var(--scene-scale,1));opacity:1;filter:saturate(1.02) contrast(1.04)}}
@keyframes hqDeathPulse{0%{opacity:0;transform:scale(.5)}25%{opacity:1}100%{opacity:.2;transform:scale(1.08)}}
@keyframes hqDeathRing{0%{opacity:0;transform:translate(-50%,-50%) scale(.2)}30%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(1.18)}}
.hq-card-scene.fx-beam .scene-energy{background:linear-gradient(90deg,transparent 8%,#9ddcff00 28%,#dff8ffb8 49%,#fff 50%,#dff8ffb8 51%,#9ddcff00 72%,transparent 92%)!important}
.hq-card-scene.fx-flare .scene-energy{background:radial-gradient(circle at center,#fff6 0 8%,#ffe6a7d0 18%,#ff7a21a8 34%,transparent 62%)!important}
.hq-card-scene.fx-lightning .scene-energy{background:linear-gradient(120deg,transparent 34%,#d4ebff00 42%,#f9ffff 48%,#7fc6ff 50%,#f9ffff 52%,transparent 60%),radial-gradient(circle at center,#a9d7ff99 0 15%,transparent 55%)!important}
.hq-card-scene.fx-fire .scene-energy{background:radial-gradient(circle at center,#ffefbb77 0 10%,#ffb34dc9 20%,#ff4b2ba8 38%,transparent 68%)!important}
.hq-card-scene.fx-ice .scene-energy{background:radial-gradient(circle at center,#f8ffff77 0 12%,#b7f0ffd0 24%,#65bde9b0 38%,transparent 68%)!important}
.hq-card-scene.fx-smoke .scene-energy{background:radial-gradient(circle at center,#ffffff33 0 12%,#c9d1dc66 25%,#5a64757a 46%,transparent 72%)!important}
.hq-card-scene.fx-petals .scene-energy{background:radial-gradient(circle at center,#ffd5ef55 0 8%,#ff9ad2a8 22%,transparent 58%)!important}
.hq-card-scene.fx-shadow .scene-energy{background:radial-gradient(circle at center,#7b5cff66 0 12%,#2a154eaa 28%,#05030bbd 56%,transparent 78%)!important}
.hq-card-scene.fx-holy .scene-energy{background:radial-gradient(circle at center,#fffbe6aa 0 10%,#fff2b0d0 26%,#ffd56fb0 42%,transparent 72%)!important}
.hq-card-scene.fx-shock .scene-energy{background:linear-gradient(135deg,transparent 30%,#ffffff 50%,transparent 70%),radial-gradient(circle at center,#a7d8ff88 0 14%,transparent 50%)!important}
.hq-card-scene.fx-runes .scene-energy{background:radial-gradient(circle at center,#f1e6ff88 0 10%,#c69cffb8 20%,#5631c8a8 36%,transparent 66%)!important}
.hq-card-scene.fx-blood .scene-energy{background:radial-gradient(circle at center,#ff9bb355 0 12%,#c61134ba 30%,#3f000ab4 54%,transparent 76%)!important}

/* v92: SSS 중앙 연출 · 능력치 변화 */
.battlefield-center-scene{position:fixed!important;inset:auto!important;z-index:160!important;border-radius:22px!important;border:2px solid #ffffff55!important;box-shadow:0 28px 70px #000d,0 0 36px #9fdcff55!important}
.battlefield-center-scene .scene-title-big{font-size:26px!important;padding:7px 18px!important}
.battlefield-center-scene .scene-title-small{font-size:13px!important;max-width:92%;line-height:1.45!important}
.hq-card-scene .scene-particles{position:absolute;inset:0;z-index:4;overflow:hidden;pointer-events:none}
.hq-card-scene .scene-particles i{position:absolute;display:block;opacity:0}

/* 12종 효과는 입자 모양·이동 방식·회전 방향을 각각 다르게 구성 */
.hq-card-scene.fx-beam .scene-particles i{left:calc(12% * var(--n,1));bottom:-15%;width:3px;height:70%;background:linear-gradient(transparent,#efffff,transparent);animation:sceneBeamRise 1.2s ease-out forwards}
.hq-card-scene.fx-beam .scene-particles i:nth-child(1){--n:1}.hq-card-scene.fx-beam .scene-particles i:nth-child(2){--n:2;animation-delay:.06s}.hq-card-scene.fx-beam .scene-particles i:nth-child(3){--n:3;animation-delay:.12s}.hq-card-scene.fx-beam .scene-particles i:nth-child(4){--n:4;animation-delay:.18s}.hq-card-scene.fx-beam .scene-particles i:nth-child(5){--n:5;animation-delay:.24s}.hq-card-scene.fx-beam .scene-particles i:nth-child(6){--n:6;animation-delay:.3s}.hq-card-scene.fx-beam .scene-particles i:nth-child(7){--n:7;animation-delay:.36s}.hq-card-scene.fx-beam .scene-particles i:nth-child(8){--n:8;animation-delay:.42s}
.hq-card-scene.fx-flare .scene-particles i{left:50%;top:50%;width:6px;height:6px;border-radius:50%;background:#fff4b4;box-shadow:0 0 10px #ffbf45;animation:sceneFlareBurst 1s ease-out forwards}.hq-card-scene.fx-flare .scene-particles i:nth-child(2){--a:45deg}.hq-card-scene.fx-flare .scene-particles i:nth-child(3){--a:90deg}.hq-card-scene.fx-flare .scene-particles i:nth-child(4){--a:135deg}.hq-card-scene.fx-flare .scene-particles i:nth-child(5){--a:180deg}.hq-card-scene.fx-flare .scene-particles i:nth-child(6){--a:225deg}.hq-card-scene.fx-flare .scene-particles i:nth-child(7){--a:270deg}.hq-card-scene.fx-flare .scene-particles i:nth-child(8){--a:315deg}
.hq-card-scene.fx-lightning .scene-particles i{top:-20%;width:5px;height:78%;background:linear-gradient(170deg,transparent 0 20%,#eaffff 21% 27%,transparent 28% 40%,#7ac8ff 41% 50%,transparent 51%);filter:drop-shadow(0 0 7px #6bc5ff);animation:sceneLightningDrop .8s steps(2) forwards}.hq-card-scene.fx-lightning .scene-particles i:nth-child(odd){left:24%;transform:rotate(8deg)}.hq-card-scene.fx-lightning .scene-particles i:nth-child(even){right:24%;transform:rotate(-9deg);animation-delay:.12s}
.hq-card-scene.fx-fire .scene-particles i{bottom:-18%;width:18px;height:28px;border-radius:60% 40% 70% 30%;background:radial-gradient(circle at 50% 70%,#fff2a3,#ff8a25 42%,#e32016 70%,transparent 72%);animation:sceneFireRise 1.25s ease-out forwards}.hq-card-scene.fx-fire .scene-particles i:nth-child(1){left:10%}.hq-card-scene.fx-fire .scene-particles i:nth-child(2){left:22%;animation-delay:.12s}.hq-card-scene.fx-fire .scene-particles i:nth-child(3){left:34%;animation-delay:.04s}.hq-card-scene.fx-fire .scene-particles i:nth-child(4){left:46%;animation-delay:.18s}.hq-card-scene.fx-fire .scene-particles i:nth-child(5){left:58%;animation-delay:.08s}.hq-card-scene.fx-fire .scene-particles i:nth-child(6){left:70%;animation-delay:.22s}.hq-card-scene.fx-fire .scene-particles i:nth-child(7){left:82%;animation-delay:.14s}.hq-card-scene.fx-fire .scene-particles i:nth-child(8){left:90%;animation-delay:.26s}
.hq-card-scene.fx-ice .scene-particles i{left:50%;top:50%;width:4px;height:48%;background:linear-gradient(#efffff,#72d9ff,transparent);transform-origin:50% 100%;animation:sceneIceGrow 1.1s ease-out forwards}.hq-card-scene.fx-ice .scene-particles i:nth-child(2){--r:45deg}.hq-card-scene.fx-ice .scene-particles i:nth-child(3){--r:90deg}.hq-card-scene.fx-ice .scene-particles i:nth-child(4){--r:135deg}.hq-card-scene.fx-ice .scene-particles i:nth-child(5){--r:180deg}.hq-card-scene.fx-ice .scene-particles i:nth-child(6){--r:225deg}.hq-card-scene.fx-ice .scene-particles i:nth-child(7){--r:270deg}.hq-card-scene.fx-ice .scene-particles i:nth-child(8){--r:315deg}
.hq-card-scene.fx-smoke .scene-particles i{bottom:-10%;width:55px;height:55px;border-radius:50%;background:radial-gradient(circle,#e7edf288,#6c748077 55%,transparent 72%);filter:blur(4px);animation:sceneSmokeDrift 1.55s ease-out forwards}.hq-card-scene.fx-smoke .scene-particles i:nth-child(odd){left:12%}.hq-card-scene.fx-smoke .scene-particles i:nth-child(even){right:12%;animation-delay:.18s}
.hq-card-scene.fx-petals .scene-particles i{top:-12%;width:10px;height:16px;border-radius:80% 20% 80% 20%;background:#ff9fd1;box-shadow:0 0 6px #ffd8ed;animation:scenePetalFall 1.5s ease-in forwards}.hq-card-scene.fx-petals .scene-particles i:nth-child(1){left:8%}.hq-card-scene.fx-petals .scene-particles i:nth-child(2){left:20%;animation-delay:.15s}.hq-card-scene.fx-petals .scene-particles i:nth-child(3){left:34%;animation-delay:.3s}.hq-card-scene.fx-petals .scene-particles i:nth-child(4){left:48%;animation-delay:.08s}.hq-card-scene.fx-petals .scene-particles i:nth-child(5){left:60%;animation-delay:.22s}.hq-card-scene.fx-petals .scene-particles i:nth-child(6){left:72%;animation-delay:.36s}.hq-card-scene.fx-petals .scene-particles i:nth-child(7){left:84%;animation-delay:.12s}.hq-card-scene.fx-petals .scene-particles i:nth-child(8){left:92%;animation-delay:.28s}
.hq-card-scene.fx-shadow .scene-particles i{left:50%;top:50%;width:74%;height:74%;border:3px solid #7d4cff77;border-radius:50%;box-shadow:inset 0 0 25px #19092f,0 0 18px #7d4cff;animation:sceneShadowVortex 1.3s ease-out forwards}.hq-card-scene.fx-shadow .scene-particles i:nth-child(n+3){width:48%;height:48%;animation-direction:reverse;animation-delay:.12s}
.hq-card-scene.fx-holy .scene-particles i{left:50%;top:-8%;width:5px;height:110%;background:linear-gradient(transparent,#fffbe8,#ffd775,transparent);transform-origin:50% 50%;animation:sceneHolyRay 1.25s ease-out forwards}.hq-card-scene.fx-holy .scene-particles i:nth-child(2){--r:22deg}.hq-card-scene.fx-holy .scene-particles i:nth-child(3){--r:-22deg}.hq-card-scene.fx-holy .scene-particles i:nth-child(4){--r:42deg}.hq-card-scene.fx-holy .scene-particles i:nth-child(5){--r:-42deg}.hq-card-scene.fx-holy .scene-particles i:nth-child(6){--r:62deg}.hq-card-scene.fx-holy .scene-particles i:nth-child(7){--r:-62deg}.hq-card-scene.fx-holy .scene-particles i:nth-child(8){--r:90deg}
.hq-card-scene.fx-shock .scene-particles i{left:50%;top:50%;width:22px;height:22px;border:3px solid #d8f4ff;border-radius:50%;transform:translate(-50%,-50%);animation:sceneShockWave 1.05s ease-out forwards}.hq-card-scene.fx-shock .scene-particles i:nth-child(2){animation-delay:.1s}.hq-card-scene.fx-shock .scene-particles i:nth-child(3){animation-delay:.2s}.hq-card-scene.fx-shock .scene-particles i:nth-child(4){animation-delay:.3s}
.hq-card-scene.fx-runes .scene-particles i{left:50%;top:50%;width:72%;height:72%;border:2px dashed #e8d6ff;border-radius:50%;box-shadow:0 0 18px #985fff,inset 0 0 18px #5c28a0;transform:translate(-50%,-50%);animation:sceneRuneSpin 1.5s linear forwards}.hq-card-scene.fx-runes .scene-particles i:nth-child(n+2){width:48%;height:48%;animation-direction:reverse}
.hq-card-scene.fx-blood .scene-particles i{top:-12%;width:9px;height:18px;border-radius:50% 50% 65% 65%;background:linear-gradient(#ff7b91,#a1001c);box-shadow:0 0 8px #e4002b;animation:sceneBloodDrop 1.1s ease-in forwards}.hq-card-scene.fx-blood .scene-particles i:nth-child(1){left:12%}.hq-card-scene.fx-blood .scene-particles i:nth-child(2){left:26%;animation-delay:.08s}.hq-card-scene.fx-blood .scene-particles i:nth-child(3){left:40%;animation-delay:.16s}.hq-card-scene.fx-blood .scene-particles i:nth-child(4){left:54%;animation-delay:.24s}.hq-card-scene.fx-blood .scene-particles i:nth-child(5){left:68%;animation-delay:.12s}.hq-card-scene.fx-blood .scene-particles i:nth-child(6){left:82%;animation-delay:.2s}.hq-card-scene.fx-blood .scene-particles i:nth-child(7){left:90%;animation-delay:.28s}.hq-card-scene.fx-blood .scene-particles i:nth-child(8){left:6%;animation-delay:.32s}

.fx-stat-change{position:fixed;z-index:190;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;gap:3px;pointer-events:none;animation:statChangeFloat 1.2s ease-out forwards;text-align:center;text-shadow:0 2px 6px #000}
.fx-stat-change b{padding:5px 10px;border-radius:999px;font-size:16px;font-weight:950;white-space:nowrap;border:1px solid #ffffff66;box-shadow:0 5px 18px #0008}
.fx-stat-change small{padding:2px 7px;border-radius:999px;background:#05080dd9;color:#fff;font-size:10px;font-weight:800;white-space:nowrap}
.fx-stat-change.positive b{background:#0b8b4fe8;color:#eafff3}.fx-stat-change.negative b{background:#a51b35e8;color:#fff0f3}
.unit.stat-change-pulse{animation:unitStatPulse .9s ease-out!important;z-index:20!important}
@keyframes sceneBeamRise{0%{opacity:0;transform:translateY(25%)}35%{opacity:1}100%{opacity:0;transform:translateY(-25%)}}
@keyframes sceneFlareBurst{0%{opacity:0;transform:translate(-50%,-50%) rotate(var(--a,0deg)) translateX(0) scale(.2)}25%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) rotate(var(--a,0deg)) translateX(155px) scale(1.2)}}
@keyframes sceneLightningDrop{0%{opacity:0;transform:translateY(-30%) rotate(8deg)}35%{opacity:1}70%{opacity:.35}100%{opacity:0;transform:translateY(35%) rotate(-5deg)}}
@keyframes sceneFireRise{0%{opacity:0;transform:translateY(0) scale(.4)}35%{opacity:1}100%{opacity:0;transform:translateY(-210px) scale(1.6) rotate(18deg)}}
@keyframes sceneIceGrow{0%{opacity:0;transform:translate(-50%,-100%) rotate(var(--r,0deg)) scaleY(.05)}45%{opacity:1}100%{opacity:0;transform:translate(-50%,-100%) rotate(var(--r,0deg)) scaleY(1)}}
@keyframes sceneSmokeDrift{0%{opacity:0;transform:translateY(30px) scale(.5)}45%{opacity:.9}100%{opacity:0;transform:translate(70px,-130px) scale(1.8)}}
@keyframes scenePetalFall{0%{opacity:0;transform:translateY(-15px) rotate(0)}25%{opacity:1}100%{opacity:0;transform:translate(55px,260px) rotate(520deg)}}
@keyframes sceneShadowVortex{0%{opacity:0;transform:translate(-50%,-50%) scale(.2) rotate(0)}40%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(1.35) rotate(300deg)}}
@keyframes sceneHolyRay{0%{opacity:0;transform:rotate(var(--r,0deg)) scaleY(.1)}35%{opacity:1}100%{opacity:0;transform:rotate(var(--r,0deg)) scaleY(1)}}
@keyframes sceneShockWave{0%{opacity:0;transform:translate(-50%,-50%) scale(.15)}35%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(14)}}
@keyframes sceneRuneSpin{0%{opacity:0;transform:translate(-50%,-50%) scale(.2) rotate(0)}35%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(1.1) rotate(420deg)}}
@keyframes sceneBloodDrop{0%{opacity:0;transform:translateY(-15px) scale(.5)}30%{opacity:1}100%{opacity:0;transform:translateY(260px) scale(1.2)}}
@keyframes statChangeFloat{0%{opacity:0;transform:translate(-50%,-20%) scale(.65)}20%{opacity:1;transform:translate(-50%,-55%) scale(1.08)}75%{opacity:1}100%{opacity:0;transform:translate(-50%,-145%) scale(.96)}}
@keyframes unitStatPulse{0%{filter:brightness(1)}25%{filter:brightness(1.7) saturate(1.5);transform:scale(1.04)}100%{filter:brightness(1);transform:scale(1)}}


/* v93: 신규 장수 등장·사망 애니메이션 */
.hq-card-scene.fx-warcry .scene-energy{background:radial-gradient(ellipse at center,#fff4bd66 0 8%,#f1a532a8 22%,#8b3b12a0 42%,transparent 72%)!important}
.hq-card-scene.fx-warcry .scene-particles i{left:50%;top:50%;width:20px;height:20px;border:4px solid #ffe7a6;border-radius:50%;box-shadow:0 0 16px #ff9b35;transform:translate(-50%,-50%);animation:sceneWarcryRing 1.2s cubic-bezier(.15,.72,.25,1) forwards}
.hq-card-scene.fx-warcry .scene-particles i:nth-child(2){animation-delay:.09s}.hq-card-scene.fx-warcry .scene-particles i:nth-child(3){animation-delay:.18s}.hq-card-scene.fx-warcry .scene-particles i:nth-child(n+4){display:none}
.hq-card-scene.fx-dragon .scene-energy{background:conic-gradient(from 0deg at 50% 50%,transparent,#8fffd488,#36cfa1aa,#b9fff0aa,transparent 72%)!important;mix-blend-mode:screen}
.hq-card-scene.fx-dragon .scene-particles i{left:50%;top:50%;width:12px;height:12px;border-radius:55% 45% 70% 30%;background:#b9fff0;box-shadow:0 0 13px #35e1b0;animation:sceneDragonSpiral 1.45s ease-out forwards}
.hq-card-scene.fx-dragon .scene-particles i:nth-child(2){--a:45deg;animation-delay:.05s}.hq-card-scene.fx-dragon .scene-particles i:nth-child(3){--a:90deg;animation-delay:.1s}.hq-card-scene.fx-dragon .scene-particles i:nth-child(4){--a:135deg;animation-delay:.15s}.hq-card-scene.fx-dragon .scene-particles i:nth-child(5){--a:180deg;animation-delay:.2s}.hq-card-scene.fx-dragon .scene-particles i:nth-child(6){--a:225deg;animation-delay:.25s}.hq-card-scene.fx-dragon .scene-particles i:nth-child(7){--a:270deg;animation-delay:.3s}.hq-card-scene.fx-dragon .scene-particles i:nth-child(8){--a:315deg;animation-delay:.35s}
.hq-card-scene.fx-ascend .scene-energy{background:linear-gradient(180deg,transparent 12%,#d8e8ff33 40%,#f5fbff99 76%,transparent 100%)!important}
.hq-card-scene.fx-ascend .scene-particles i{bottom:-18%;width:18px;height:28px;border-radius:50%;background:radial-gradient(circle at 45% 38%,#fff,#bed6ff 42%,#6d87b8aa 68%,transparent 72%);filter:blur(.3px);animation:sceneSoulAscend 1.6s ease-out forwards}
.hq-card-scene.fx-ascend .scene-particles i:nth-child(1){left:10%}.hq-card-scene.fx-ascend .scene-particles i:nth-child(2){left:22%;animation-delay:.1s}.hq-card-scene.fx-ascend .scene-particles i:nth-child(3){left:35%;animation-delay:.2s}.hq-card-scene.fx-ascend .scene-particles i:nth-child(4){left:48%;animation-delay:.04s}.hq-card-scene.fx-ascend .scene-particles i:nth-child(5){left:60%;animation-delay:.14s}.hq-card-scene.fx-ascend .scene-particles i:nth-child(6){left:72%;animation-delay:.24s}.hq-card-scene.fx-ascend .scene-particles i:nth-child(7){left:84%;animation-delay:.08s}.hq-card-scene.fx-ascend .scene-particles i:nth-child(8){left:92%;animation-delay:.18s}
@keyframes sceneWarcryRing{0%{opacity:0;transform:translate(-50%,-50%) scale(.15)}28%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(18,9)}}
@keyframes sceneDragonSpiral{0%{opacity:0;transform:translate(-50%,-50%) rotate(var(--a,0deg)) translateX(18px) scale(.3)}28%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) rotate(calc(var(--a,0deg) + 620deg)) translateX(170px) scale(1.45)}}
@keyframes sceneSoulAscend{0%{opacity:0;transform:translateY(20px) scale(.55)}25%{opacity:1}70%{opacity:.8}100%{opacity:0;transform:translate(35px,-300px) scale(1.5)}}

/* v96: 16종 연출 강화 — 화면 전체 변화, 입자, 이미지 움직임을 각 효과별로 분리 */
.hq-card-scene{--fx-speed:1.35s}
.hq-card-scene .scene-energy{opacity:.96!important}
.hq-card-scene .scene-particles{filter:saturate(1.35) brightness(1.12)}

/* 1. 빛기둥 */
.hq-card-scene.fx-beam img{animation:fxBeamPortrait 1.35s cubic-bezier(.12,.75,.18,1) forwards!important}
.hq-card-scene.fx-beam::before{content:'';position:absolute;z-index:3;left:34%;right:34%;top:-20%;bottom:-20%;background:linear-gradient(90deg,transparent,#eaffff66,#fff,#eaffff66,transparent);filter:blur(5px);mix-blend-mode:screen;animation:fxBeamColumn 1.25s ease-out forwards}
@keyframes fxBeamPortrait{0%{opacity:0;transform:scale(.72) translateY(24%);filter:brightness(2.5) blur(7px)}42%{opacity:1;filter:brightness(1.65) blur(0)}100%{transform:scale(var(--scene-scale,1));filter:saturate(1.15) contrast(1.08)}}
@keyframes fxBeamColumn{0%{opacity:0;transform:scaleX(.15)}30%{opacity:1;transform:scaleX(1.25)}100%{opacity:0;transform:scaleX(2)}}

/* 2. 섬광 폭발 */
.hq-card-scene.fx-flare img{animation:fxFlarePortrait 1.2s ease-out forwards!important}
.hq-card-scene.fx-flare::before,.hq-card-scene.fx-flare::after{content:'';position:absolute;z-index:4;inset:-45%;background:conic-gradient(from 0deg,transparent 0 5%,#fff 6% 8%,transparent 9% 18%,#ffc76b 19% 22%,transparent 23% 34%,#fff 35% 37%,transparent 38% 100%);animation:fxFlareSpin 1.1s ease-out forwards}
.hq-card-scene.fx-flare::after{animation-direction:reverse;filter:blur(4px)}
@keyframes fxFlarePortrait{0%{opacity:0;transform:scale(1.65);filter:brightness(4)}28%{opacity:1;transform:scale(.92);filter:brightness(2.1)}100%{transform:scale(var(--scene-scale,1));filter:contrast(1.08)}}
@keyframes fxFlareSpin{0%{opacity:0;transform:rotate(0) scale(.1)}30%{opacity:1}100%{opacity:0;transform:rotate(230deg) scale(1.1)}}

/* 3. 낙뢰 */
.hq-card-scene.fx-lightning{animation:fxLightningScreen 1.25s steps(2) forwards}
.hq-card-scene.fx-lightning img{animation:fxLightningPortrait 1.2s steps(2) forwards!important}
.hq-card-scene.fx-lightning::before{content:'';position:absolute;z-index:5;left:46%;top:-20%;width:12%;height:130%;background:linear-gradient(165deg,transparent 0 18%,#fff 19% 27%,transparent 28% 38%,#80d8ff 39% 52%,transparent 53% 100%);filter:drop-shadow(0 0 14px #56bdff);animation:fxBoltStrike 1s steps(2) forwards}
@keyframes fxLightningScreen{0%,18%,42%,65%{filter:brightness(.55)}10%,28%,52%{filter:brightness(2.5)}100%{filter:none}}
@keyframes fxLightningPortrait{0%{opacity:0;transform:scale(1.12)}18%{opacity:1;filter:brightness(3) contrast(1.5)}100%{transform:scale(var(--scene-scale,1));filter:contrast(1.12)}}
@keyframes fxBoltStrike{0%,15%,36%{opacity:0}16%,37%,55%{opacity:1}100%{opacity:0}}

/* 4. 화염 지옥 — 사진 전체가 실제로 타오르는 느낌 */
.hq-card-scene.fx-fire{background:#260300!important;animation:fxFireScreen 1.65s ease-out forwards}
.hq-card-scene.fx-fire img{animation:fxBurnPortrait 1.6s ease-out forwards!important}
.hq-card-scene.fx-fire::before{content:'';position:absolute;z-index:4;inset:18% -5% -25%;background:repeating-radial-gradient(ellipse at 50% 100%,#fff2a7 0 4%,#ff9a22 5% 12%,#e32310 13% 21%,transparent 22% 31%);filter:blur(3px) saturate(1.8);mix-blend-mode:screen;animation:fxFireWall .72s ease-in-out infinite alternate}
.hq-card-scene.fx-fire::after{content:'';position:absolute;z-index:5;inset:0;background:linear-gradient(0deg,#ff2d00a8,transparent 55%),radial-gradient(circle at 50% 70%,transparent 10%,#ff6a0033 45%,#210000aa 100%);animation:fxHeatWave .22s linear infinite alternate}
@keyframes fxFireScreen{0%{box-shadow:inset 0 0 0 #000}45%{box-shadow:inset 0 -55px 80px #ff3100cc}100%{box-shadow:inset 0 -30px 50px #6c0800aa}}
@keyframes fxBurnPortrait{0%{opacity:0;transform:scale(.88) translateY(18%);filter:brightness(.25) sepia(1)}25%{opacity:1;filter:brightness(1.8) sepia(.6) saturate(2.5)}70%{transform:scale(calc(var(--scene-scale,1) * 1.05));filter:contrast(1.3) saturate(1.8)}100%{transform:scale(var(--scene-scale,1));filter:contrast(1.1) saturate(1.2)}}
@keyframes fxFireWall{from{transform:translateY(12%) scaleY(.82)}to{transform:translateY(-8%) scaleY(1.18)}}
@keyframes fxHeatWave{from{transform:translateX(-2px) skewX(-1deg)}to{transform:translateX(2px) skewX(1deg)}}

/* 5. 전면 빙결 — 화면 전체 결빙 */
.hq-card-scene.fx-ice{background:#031a2a!important;animation:fxFreezeScreen 1.55s ease-out forwards}
.hq-card-scene.fx-ice img{animation:fxFreezePortrait 1.5s ease-out forwards!important}
.hq-card-scene.fx-ice::before{content:'';position:absolute;inset:-2%;z-index:5;background:linear-gradient(135deg,#eaffff99 0 2%,transparent 3% 18%,#b8ecff88 19% 21%,transparent 22% 42%,#fff9 43% 45%,transparent 46%),radial-gradient(circle at 50% 50%,transparent 0 18%,#bceeff55 45%,#dff9ffcc 100%);clip-path:polygon(0 0,100% 0,100% 100%,0 100%);animation:fxIceSheet 1.35s ease-out forwards}
.hq-card-scene.fx-ice::after{content:'❄';position:absolute;z-index:6;inset:0;display:grid;place-items:center;color:#efffff;font-size:84px;text-shadow:0 0 25px #8be4ff;animation:fxIceBurst 1.4s ease-out forwards}
@keyframes fxFreezeScreen{0%{filter:brightness(.4) saturate(.3)}38%{filter:brightness(1.7) saturate(.65) hue-rotate(155deg)}100%{filter:brightness(1.05) saturate(.75) hue-rotate(165deg)}}
@keyframes fxFreezePortrait{0%{opacity:0;transform:scale(1.18);filter:blur(8px) brightness(2)}45%{opacity:1;filter:contrast(1.3) saturate(.2) hue-rotate(165deg)}100%{transform:scale(var(--scene-scale,1));filter:contrast(1.2) saturate(.45) hue-rotate(165deg)}}
@keyframes fxIceSheet{0%{opacity:0;transform:scale(.1)}45%{opacity:1}100%{opacity:.62;transform:scale(1.15)}}
@keyframes fxIceBurst{0%{opacity:0;transform:scale(.1) rotate(-40deg)}45%{opacity:1}100%{opacity:0;transform:scale(2.4) rotate(35deg)}}

/* 6. 연막 */
.hq-card-scene.fx-smoke img{animation:fxSmokePortrait 1.6s ease-out forwards!important}
.hq-card-scene.fx-smoke::before,.hq-card-scene.fx-smoke::after{content:'';position:absolute;z-index:5;width:95%;height:95%;border-radius:50%;background:radial-gradient(circle,#d9e0e5cc 0 12%,#737b8499 40%,transparent 72%);filter:blur(15px);animation:fxSmokeCloud 1.7s ease-out forwards}
.hq-card-scene.fx-smoke::before{left:-35%;bottom:-35%}.hq-card-scene.fx-smoke::after{right:-35%;top:-30%;animation-delay:.18s}
@keyframes fxSmokePortrait{0%{opacity:0;filter:blur(18px)}45%{opacity:.65;filter:blur(5px)}100%{opacity:1;transform:scale(var(--scene-scale,1));filter:contrast(1.02)}}
@keyframes fxSmokeCloud{0%{opacity:0;transform:scale(.4)}55%{opacity:.95}100%{opacity:0;transform:translate(45%, -35%) scale(1.75)}}

/* 7. 꽃잎 폭풍 */
.hq-card-scene.fx-petals img{animation:fxPetalPortrait 1.5s ease-out forwards!important}
.hq-card-scene.fx-petals::before{content:'✦  ❀  ✿  ❁  ✦  ❀  ✿';position:absolute;z-index:5;inset:-20%;color:#ffb2dc;font-size:28px;letter-spacing:22px;text-shadow:0 0 10px #ff78c0;animation:fxPetalStorm 1.6s cubic-bezier(.2,.7,.2,1) forwards}
@keyframes fxPetalPortrait{0%{opacity:0;transform:translateX(-25%) rotate(-5deg) scale(.9)}45%{opacity:1;transform:translateX(3%) rotate(1deg) scale(1.05)}100%{transform:scale(var(--scene-scale,1))}}
@keyframes fxPetalStorm{0%{opacity:0;transform:translate(-20%,-30%) rotate(-30deg) scale(.5)}35%{opacity:1}100%{opacity:0;transform:translate(30%,55%) rotate(210deg) scale(1.25)}}

/* 8. 암흑 소용돌이 */
.hq-card-scene.fx-shadow{animation:fxShadowScreen 1.55s ease-out forwards}
.hq-card-scene.fx-shadow img{animation:fxShadowPortrait 1.5s ease-out forwards!important}
.hq-card-scene.fx-shadow::before{content:'';position:absolute;z-index:5;left:50%;top:50%;width:150%;height:150%;border-radius:50%;background:repeating-conic-gradient(#0000 0 14deg,#6d3ac988 15deg 24deg,#05010c 25deg 40deg);mix-blend-mode:screen;animation:fxShadowSpiral 1.5s ease-in forwards}
@keyframes fxShadowScreen{0%{background:#000}55%{background:#090217}100%{background:#02030a}}
@keyframes fxShadowPortrait{0%{opacity:0;transform:scale(.4) rotate(-14deg);filter:brightness(.1)}55%{opacity:1;transform:scale(1.12) rotate(2deg);filter:brightness(1.4) saturate(.7)}100%{transform:scale(var(--scene-scale,1));filter:contrast(1.1)}}
@keyframes fxShadowSpiral{0%{opacity:0;transform:translate(-50%,-50%) scale(.05) rotate(0)}55%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(1.1) rotate(520deg)}}

/* 9. 성광 강림 */
.hq-card-scene.fx-holy img{animation:fxHolyPortrait 1.5s ease-out forwards!important}
.hq-card-scene.fx-holy::before{content:'';position:absolute;z-index:5;inset:-25%;background:repeating-conic-gradient(from 0deg,#fff0 0 8deg,#fff8d5cc 9deg 13deg,#fff0 14deg 28deg);mix-blend-mode:screen;animation:fxHolyBurst 1.45s ease-out forwards}
.hq-card-scene.fx-holy::after{content:'✦';position:absolute;z-index:6;inset:0;display:grid;place-items:center;font-size:88px;color:#fff9cf;text-shadow:0 0 30px #ffd45c;animation:fxHolySymbol 1.4s ease-out forwards}
@keyframes fxHolyPortrait{0%{opacity:0;transform:translateY(30%) scale(.8);filter:brightness(3)}45%{opacity:1;transform:translateY(-4%) scale(1.08);filter:brightness(1.7)}100%{transform:scale(var(--scene-scale,1));filter:brightness(1.08)}}
@keyframes fxHolyBurst{0%{opacity:0;transform:rotate(-40deg) scale(.2)}40%{opacity:1}100%{opacity:0;transform:rotate(60deg) scale(1.1)}}
@keyframes fxHolySymbol{0%{opacity:0;transform:scale(.1)}45%{opacity:1}100%{opacity:0;transform:scale(2.2)}}

/* 10. 대지 충격파 */
.hq-card-scene.fx-shock{animation:fxImpactShake 1.1s ease-out forwards}
.hq-card-scene.fx-shock img{animation:fxImpactPortrait 1.2s ease-out forwards!important}
.hq-card-scene.fx-shock::before,.hq-card-scene.fx-shock::after{content:'';position:absolute;z-index:5;left:50%;top:58%;width:30px;height:14px;border:5px solid #d8f6ff;border-radius:50%;box-shadow:0 0 24px #71d6ff;animation:fxImpactRing 1.1s ease-out forwards}
.hq-card-scene.fx-shock::after{animation-delay:.16s}
@keyframes fxImpactShake{0%,100%{transform:translate(0)}18%{transform:translate(-9px,4px)}32%{transform:translate(8px,-3px)}46%{transform:translate(-5px,2px)}60%{transform:translate(3px,-1px)}}
@keyframes fxImpactPortrait{0%{opacity:0;transform:scale(1.5) translateY(-15%)}32%{opacity:1;transform:scale(.88) translateY(8%)}100%{transform:scale(var(--scene-scale,1))}}
@keyframes fxImpactRing{0%{opacity:0;transform:translate(-50%,-50%) scale(.1)}30%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(15,8)}}

/* 11. 룬 마법진 */
.hq-card-scene.fx-runes img{animation:fxRunePortrait 1.55s ease-out forwards!important}
.hq-card-scene.fx-runes::before,.hq-card-scene.fx-runes::after{content:'ᚱ ᛟ ᚨ ᚾ ᛇ ᛉ';position:absolute;z-index:5;left:50%;top:50%;width:74%;height:74%;border:3px solid #d8baff;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#f0e4ff;font-size:20px;letter-spacing:14px;text-shadow:0 0 12px #a05cff;box-shadow:0 0 28px #8f51ff,inset 0 0 28px #54228d;animation:fxRuneCircle 1.6s linear forwards}
.hq-card-scene.fx-runes::after{width:48%;height:48%;animation-direction:reverse}
@keyframes fxRunePortrait{0%{opacity:0;transform:scale(.65);filter:hue-rotate(90deg) brightness(2)}50%{opacity:1;transform:scale(1.08)}100%{transform:scale(var(--scene-scale,1));filter:contrast(1.08)}}
@keyframes fxRuneCircle{0%{opacity:0;transform:translate(-50%,-50%) scale(.2) rotate(0)}35%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(1.15) rotate(540deg)}}

/* 12. 붉은 혈기 */
.hq-card-scene.fx-blood{background:#170005!important}
.hq-card-scene.fx-blood img{animation:fxBloodPortrait 1.5s ease-out forwards!important}
.hq-card-scene.fx-blood::before{content:'';position:absolute;z-index:5;inset:-10%;background:radial-gradient(circle at 20% 30%,#ff334499 0 3%,transparent 4%),radial-gradient(circle at 70% 22%,#a8001eaa 0 5%,transparent 6%),radial-gradient(circle at 85% 65%,#ff254099 0 4%,transparent 5%),radial-gradient(circle at 35% 78%,#8d001baa 0 6%,transparent 7%);animation:fxBloodSplash 1.3s ease-out forwards}
@keyframes fxBloodPortrait{0%{opacity:0;transform:scale(1.25);filter:grayscale(1) brightness(.25)}42%{opacity:1;filter:sepia(.8) saturate(3) hue-rotate(320deg)}100%{transform:scale(var(--scene-scale,1));filter:contrast(1.2) saturate(1.25)}}
@keyframes fxBloodSplash{0%{opacity:0;transform:scale(.2) rotate(-25deg)}40%{opacity:1}100%{opacity:0;transform:scale(1.6) rotate(20deg)}}

/* 13. 전장의 함성 */
.hq-card-scene.fx-warcry{animation:fxWarcryShake 1.4s ease-out forwards}
.hq-card-scene.fx-warcry img{animation:fxWarcryPortrait 1.35s ease-out forwards!important}
.hq-card-scene.fx-warcry::before{content:'喝!';position:absolute;z-index:6;right:8%;top:12%;color:#fff0b0;font-size:58px;font-weight:1000;text-shadow:0 0 20px #ff7b22;animation:fxWarcryText 1.2s ease-out forwards}
@keyframes fxWarcryShake{0%,100%{transform:translate(0)}25%{transform:translate(-6px)}38%{transform:translate(6px)}51%{transform:translate(-4px)}64%{transform:translate(3px)}}
@keyframes fxWarcryPortrait{0%{opacity:0;transform:translateX(-35%) scale(1.25)}38%{opacity:1;transform:translateX(4%) scale(1.1)}100%{transform:scale(var(--scene-scale,1))}}
@keyframes fxWarcryText{0%{opacity:0;transform:scale(.1) rotate(-15deg)}40%{opacity:1;transform:scale(1.25) rotate(5deg)}100%{opacity:0;transform:scale(1.8) rotate(8deg)}}

/* 14. 용혼 강림 */
.hq-card-scene.fx-dragon img{animation:fxDragonPortrait 1.7s ease-out forwards!important}
.hq-card-scene.fx-dragon::before{content:'龍';position:absolute;z-index:6;left:50%;top:50%;color:#d9fff2;font-size:108px;font-weight:1000;text-shadow:0 0 30px #1cffb2;animation:fxDragonGlyph 1.6s ease-out forwards}
.hq-card-scene.fx-dragon::after{content:'';position:absolute;z-index:5;left:50%;top:50%;width:140%;height:80%;border:10px solid #73ffd2;border-left-color:transparent;border-bottom-color:transparent;border-radius:50%;filter:drop-shadow(0 0 15px #24d9a6);animation:fxDragonArc 1.55s ease-out forwards}
@keyframes fxDragonPortrait{0%{opacity:0;transform:scale(.4) rotate(-12deg);filter:hue-rotate(80deg) brightness(2)}55%{opacity:1;transform:scale(1.12) rotate(1deg)}100%{transform:scale(var(--scene-scale,1));filter:contrast(1.08)}}
@keyframes fxDragonGlyph{0%{opacity:0;transform:translate(-50%,-50%) scale(.1) rotate(-30deg)}45%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(2) rotate(25deg)}}
@keyframes fxDragonArc{0%{opacity:0;transform:translate(-50%,-50%) scale(.15) rotate(-80deg)}45%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(1.15) rotate(380deg)}}

/* 15. 영혼 승천 */
.hq-card-scene.fx-ascend img{animation:fxAscendPortrait 1.65s ease-out forwards!important}
.hq-card-scene.fx-ascend::before{content:'';position:absolute;z-index:5;left:15%;right:15%;bottom:-20%;height:120%;background:linear-gradient(0deg,#dcecffcc,transparent 72%);clip-path:polygon(0 100%,20% 0,38% 100%,50% 8%,65% 100%,82% 0,100% 100%);filter:blur(5px);animation:fxAscendRays 1.6s ease-out forwards}
@keyframes fxAscendPortrait{0%{opacity:0;transform:translateY(35%) scale(.85);filter:brightness(2)}40%{opacity:1}100%{transform:translateY(-8%) scale(var(--scene-scale,1));filter:brightness(1.2)}}
@keyframes fxAscendRays{0%{opacity:0;transform:translateY(30%)}40%{opacity:1}100%{opacity:0;transform:translateY(-20%) scaleY(1.35)}}

/* 16. 혼백 붕괴 — 사망 전용 신규 효과 */
.hq-card-scene.fx-requiem{background:#02030a!important;animation:fxRequiemScreen 1.7s ease-out forwards}
.hq-card-scene.fx-requiem img{animation:fxRequiemPortrait 1.65s cubic-bezier(.2,.62,.24,1) forwards!important}
.hq-card-scene.fx-requiem::before{content:'✧  ✦  ◇  ✧  ✦';position:absolute;z-index:6;inset:0;display:grid;place-items:center;color:#e9f1ff;font-size:30px;letter-spacing:20px;text-shadow:0 0 16px #8ba8ff;animation:fxSoulFragments 1.6s ease-out forwards}
.hq-card-scene.fx-requiem::after{content:'';position:absolute;z-index:5;left:50%;top:50%;width:8px;height:8px;border:3px solid #e4edff;border-radius:50%;box-shadow:0 0 24px #91aaff;animation:fxSoulCollapse 1.55s ease-in-out forwards}
@keyframes fxRequiemScreen{0%{filter:brightness(1)}55%{filter:grayscale(1) brightness(.5)}100%{filter:grayscale(.8) brightness(.8)}}
@keyframes fxRequiemPortrait{0%{opacity:1;transform:scale(var(--scene-scale,1));filter:grayscale(0)}35%{opacity:1;transform:scale(1.04);filter:grayscale(.6) brightness(1.4)}100%{opacity:0;transform:translateY(-28%) scale(.55);filter:grayscale(1) blur(9px)}}
@keyframes fxSoulFragments{0%{opacity:0;transform:translateY(25%) scale(.5)}40%{opacity:1}100%{opacity:0;transform:translateY(-80%) scale(1.8) rotate(35deg)}}
@keyframes fxSoulCollapse{0%{opacity:0;transform:translate(-50%,-50%) scale(18)}55%{opacity:1}100%{opacity:0;transform:translate(-50%,-50%) scale(.05)}}


/* ---- assets/css/v132_mobile_dock_fix.css ---- */
/* ================================================================
   v132 — 모바일 하단 고정 UI(아군 본진 · 핸드 · 전투 버튼) 정리
   - game.css / mobile_preview.css 뒤에 로드되는 최종 패치 파일이므로
     기존 규칙과 동일하거나 더 깊은 선택자로 항상 우선 적용된다.
   - body.ui-mode-mobile 클래스는 "실제 모바일 화면"과 "PC의 모바일
     미리보기" 모드 모두에서 공통으로 붙으므로, 두 경우를 한 번에 다룬다.
   ================================================================ */

:root{
  /* JS(v132_mobile_dock_fix.js)가 실측 후 정확한 값으로 덮어씀. 아래는
     JS 실행 전 첫 렌더링에서 겹침이 보이지 않도록 하는 안전한 기본값. */
  --dock-action-h:58px;
  --dock-hq-h:176px;
  --dock-hand-h:174px;
  --dock-total-h:calc(var(--dock-action-h) + var(--dock-hq-h) + var(--dock-hand-h));
}

/* ----------------------------------------------------------------
   1) 하단 고정 스택 순서를 [버튼] → [아군 본진] → [핸드] 순으로 재배치
      (아래에서 위로). 아군 본진이 항복/셔플/턴종료 버튼 바로 위에 오도록.
   ---------------------------------------------------------------- */
body.ui-mode-mobile:not(.prebattle) .bottom-hud{
  bottom:0!important;
}
body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount{
  bottom:var(--dock-action-h)!important;
  height:var(--dock-hq-h)!important;
  min-height:var(--dock-hq-h)!important;
  max-height:var(--dock-hq-h)!important;
  padding:6px 6px 8px!important;
  overflow:visible!important;
}
body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount{
  bottom:calc(var(--dock-action-h) + var(--dock-hq-h))!important;
}

/* 본진/핸드/버튼 높이 합만큼 전투 화면 하단 여백을 확보해
   본진 박스가 전투 1열 카드를 가리지 않도록 한다 (실측값 기반). */
body.ui-mode-mobile:not(.prebattle) .app,
body.ui-mode-mobile:not(.prebattle){
  padding-bottom:calc(var(--dock-total-h) + env(safe-area-inset-bottom,0px) + 10px)!important;
}

/* ----------------------------------------------------------------
   2) 아군/적군 본진 박스 높이를 넉넉하게 키워 확대된 글씨가 잘리지 않게 함
   ---------------------------------------------------------------- */
body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .ally-hq-row,
body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq,
body.ui-mode-mobile:not(.prebattle) .enemy-hq-row,
body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq{
  height:168px!important;
  min-height:168px!important;
  max-height:168px!important;
  overflow:visible!important;
}

/* ----------------------------------------------------------------
   3) 라이프 · MP · 행동력(AP) · 카드 수 · 턴 수 · 책사 유무 —
      아군·적군 본진 모두 글씨/아이콘 크기 확대 (3칸 × 2줄 그리드 정리)
   ---------------------------------------------------------------- */
body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-info-overlay,
body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-info-overlay{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(0,1fr))!important;
  gap:5px 7px!important;
  align-content:center!important;
}
body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip,
body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:4px!important;
  width:auto!important;
  height:auto!important;
  min-height:24px!important;
  padding:4px 6px!important;
  font-size:12px!important;
  border-radius:6px!important;
}
body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip .hq-stat-icon,
body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip .hq-stat-icon{
  font-size:15px!important;
  line-height:1!important;
  flex:none!important;
}
body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip .hq-stat-value,
body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip b,
body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip .hq-stat-value,
body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip b{
  font-size:16px!important;
  font-weight:900!important;
  line-height:1.1!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
/* 책사 유무 칩은 항상 노출 (일부 기존 규칙이 skill 칩을 숨기던 것을 되돌림) */
body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip.skill,
body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip.skill{
  display:flex!important;
}

/* ----------------------------------------------------------------
   4) 항복 · 셔플 · 턴종료 버튼 글씨 크게
   ---------------------------------------------------------------- */
body.ui-mode-mobile:not(.prebattle) .bottom-hud .hud-actions .btn{
  font-size:16px!important;
  font-weight:950!important;
  letter-spacing:-0.02em!important;
}


/* ---- assets/css/v133_card_manager_fix.css ---- */
/* ================================================================
   v133 — 카드 관리자 수정
   1) 이미지 셔틀(가로/세로 크기·위치) 조정이 미리보기에 반영되지 않던
      문제 수정: .card-art-img / .unit-art-img / .manager-preview img
      가 --img-x/--img-y/--img-scale-x/--img-scale-y 값을 실제로
      쓰도록(object-position + transform) 하는 규칙이 누락되어 있었다.
      (배틀필드 유닛(.battlefield-layout .unit-art-img)과 기타이미지
      미리보기(.other-preview-art)에는 있었지만, 카드 매니저 미리보기를
      포함한 일반 카드 이미지에는 없었음)
   2) "카드 이름" 입력창 폭을 줄이고 바로 옆에 "수정 저장" 버튼 배치
   ================================================================ */

/* ---- 1) 이미지 셔틀 미리보기 반영 ---- */
.card-art-img,
.unit-art-img,
.manager-preview img{
  object-position:var(--img-x,50%) var(--img-y,50%)!important;
  transform:scale(var(--img-scale-x,var(--img-scale,1)),var(--img-scale-y,var(--img-scale,1)))!important;
  transform-origin:var(--img-x,50%) var(--img-y,50%)!important;
  transition:transform .12s ease,object-position .12s ease;
}
/* 자동 폴더 매칭 이미지(auto-folder-art)도 동일하게 셔틀 값을 반영 */
.card-art-img.auto-folder-art,
.unit-art-img.auto-folder-art{
  object-position:var(--img-x,50%) var(--img-y,50%)!important;
  transform:scale(var(--img-scale-x,var(--img-scale,1)),var(--img-scale-y,var(--img-scale,1)))!important;
  transform-origin:var(--img-x,50%) var(--img-y,50%)!important;
}

/* ---- 2) 카드 이름 + 수정 저장 버튼 한 줄 배치 ---- */
.manager-name-save-field .manager-name-save-inline{
  display:flex;
  align-items:center;
  gap:8px;
}
.manager-name-save-inline #mgrName{
  flex:1 1 auto;
  min-width:0;
  max-width:220px;
}
.manager-name-save-inline #managerSaveBtn{
  flex:0 0 auto;
  white-space:nowrap;
  padding:8px 16px;
}
@media (max-width:520px){
  .manager-name-save-inline{
    flex-wrap:wrap;
  }
  .manager-name-save-inline #mgrName{
    max-width:none;
    flex:1 1 140px;
  }
}

/* v147 카드 이미지 일괄 자동 매칭 */
.manager-bulk-image-box{margin:10px 0;padding:12px;border:1px dashed rgba(255,255,255,.28);border-radius:10px;background:rgba(0,0,0,.18);display:grid;gap:6px;text-align:left}
.manager-bulk-image-box.drop-ready{border-color:#e5bd62;background:rgba(229,189,98,.12);box-shadow:0 0 0 2px rgba(229,189,98,.12) inset}
.manager-bulk-image-box>strong{font-size:14px}.manager-bulk-image-box>span{font-size:12px}.manager-bulk-image-box>small{font-size:11px;line-height:1.45;opacity:.82}
.manager-bulk-image-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:4px}.manager-bulk-image-actions input{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.manager-bulk-image-status{max-height:150px;overflow:auto;white-space:pre-line;padding:8px;border-radius:7px;background:rgba(0,0,0,.24);font-size:11px;line-height:1.5}
.manager-bulk-image-status.success{color:#bce9c2}.manager-bulk-image-status.warning{color:#ffe09a}.manager-bulk-image-status.error{color:#ffb3b3}


/* ---- assets/css/relationship_events.css ---- */
#relationshipEventModal .modalbox{width:min(1120px,96vw);max-height:92vh;overflow:auto}.rel-event-layout{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(480px,1.35fr);gap:14px}.rel-panel{border:1px solid #735737;background:linear-gradient(180deg,#17130f,#0b0d10);padding:12px}.rel-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.rel-panel-head h3{margin:0}.rel-event-list{display:grid;gap:8px;max-height:620px;overflow:auto}.rel-event-card{border:1px solid #8b6a42;background:#10151b;padding:10px;display:grid;gap:7px}.rel-event-card.disabled{opacity:.55}.rel-event-card-head,.rel-card-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.rel-condition{color:#f0d3a4;font-size:12px}.rel-effect-summary{font-size:11px;color:#c8d6e6;line-height:1.5}.rel-card-actions{justify-content:flex-end}.rel-card-actions .danger{border-color:#8f4141;color:#ffb6b6}.rel-editor{display:grid;gap:12px}.rel-editor>label{display:grid;gap:5px}.rel-section{border:1px solid #394a5c;padding:10px;background:#090e14}.rel-section-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.rel-rows{display:grid;gap:7px}.rel-row{display:grid;gap:7px;align-items:end}.rel-required-row{grid-template-columns:1fr auto}.rel-effect-row{grid-template-columns:minmax(140px,1fr) repeat(3,78px) auto}.rel-effect-row label{display:grid;gap:3px;font-size:10px}.rel-row select,.rel-row input,#relEventName{width:100%;min-height:34px;background:#080c11;color:#f1e7d6;border:1px solid #526476;padding:6px}.rel-editor-actions{display:flex;justify-content:flex-end;gap:8px}.rel-empty{padding:28px 8px;text-align:center;color:#9eabba;border:1px dashed #536170}.manager-head-actions #openRelationshipEventsBtn{border-color:#b77b38;color:#ffe0ac}@media(max-width:850px){.rel-event-layout{grid-template-columns:1fr}.rel-effect-row{grid-template-columns:1fr repeat(3,1fr)}.rel-effect-row .rel-remove{grid-column:1/-1}}
.rel-visual-grid{display:grid;grid-template-columns:1.3fr .7fr .7fr;gap:8px}.rel-visual-grid label{display:grid;gap:4px;font-size:11px}.rel-visual-grid input,.rel-visual-grid select{width:100%;min-height:36px;background:#080c11;color:#f1e7d6;border:1px solid #526476;padding:6px}.rel-image-tools{display:flex;align-items:center;gap:10px;margin-top:8px}.rel-image-preview{margin-top:8px;aspect-ratio:16/6;max-height:210px;border:1px dashed #607488;background:#05080c;display:flex;align-items:center;justify-content:center;overflow:hidden;color:#8493a3}.rel-image-preview img{width:100%;height:100%;object-fit:contain}.rel-card-thumb{height:86px;overflow:hidden;border:1px solid #4c5b69;background:#05080c}.rel-card-thumb img{width:100%;height:100%;object-fit:cover}.rel-visual-summary{font-size:10px;color:#e1bd78}.rel-event-presentation{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .22s ease}.rel-event-presentation.show{opacity:1;visibility:visible}.rel-event-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.68);backdrop-filter:blur(3px)}.rel-event-stage{position:relative;width:min(900px,92vw);padding:18px;text-align:center;transform:scale(.78);opacity:0}.rel-event-presentation.show .rel-event-stage{animation:relStageIn .55s cubic-bezier(.2,.9,.2,1) forwards}.rel-event-main-image{display:block;width:100%;max-height:55vh;object-fit:contain;border:2px solid rgba(255,229,157,.8);box-shadow:0 0 38px rgba(255,201,74,.5);background:#07090c}.rel-event-title{margin-top:12px;font-size:clamp(28px,5vw,62px);font-weight:900;letter-spacing:.08em;color:#fff3c2;text-shadow:0 3px 12px #000}.rel-event-side{font-size:clamp(14px,2vw,22px);color:#fff}.rel-event-effect-text{margin:8px auto 0;max-width:900px;font-size:clamp(12px,1.7vw,18px);color:#dce9f7}.effect-gold .rel-event-stage:before,.effect-flame .rel-event-stage:before,.effect-lightning .rel-event-stage:before,.effect-aura .rel-event-stage:before{content:"";position:absolute;inset:-45px;z-index:-1;border-radius:28px}.effect-gold .rel-event-stage:before{background:radial-gradient(circle,rgba(255,225,94,.8),rgba(255,145,0,.2) 42%,transparent 70%);animation:relPulse .75s infinite alternate}.effect-flame .rel-event-stage:before{background:radial-gradient(ellipse at bottom,rgba(255,72,0,.82),rgba(255,170,0,.22) 45%,transparent 72%);filter:blur(8px);animation:relFlame .5s infinite alternate}.effect-lightning .rel-event-stage:before{background:conic-gradient(from 35deg,transparent,#9fd6ff,transparent 12%,transparent 45%,#fff 48%,transparent 51%,transparent);filter:blur(5px);animation:relSpin 1.1s linear infinite}.effect-aura .rel-event-stage:before{background:radial-gradient(circle,rgba(197,111,255,.65),rgba(75,147,255,.25) 50%,transparent 72%);animation:relPulse 1.2s infinite alternate}.effect-none .rel-event-stage:before{display:none}@keyframes relStageIn{to{transform:scale(1);opacity:1}}@keyframes relPulse{from{transform:scale(.95);opacity:.55}to{transform:scale(1.04);opacity:1}}@keyframes relFlame{from{transform:translateY(5px) scale(.96)}to{transform:translateY(-6px) scale(1.04)}}@keyframes relSpin{to{transform:rotate(360deg)}}
@media(max-width:850px){.rel-visual-grid{grid-template-columns:1fr}.rel-event-stage{width:96vw;padding:8px}.rel-event-main-image{max-height:48vh}.rel-event-title{margin-top:7px}}


/* ---- assets/css/v139_pc_bg_fit_and_mobile_dock_fix.css ---- */
/* ================================================================
   v139 — (1) PC 화면(강제 PC 모드 포함)에서 불필요하게 넓은 배경 영역 제거
          (2) 실제 모바일 화면에서 하단 고정 스택(본진·핸드·항복/셔플/턴종료
              버튼)을 진짜 화면 하단에 고정 + 전장 부드러운 스크롤
   game.css / mobile_preview.css / v132·v133 fix 파일보다 항상 나중에
   로드되는 최종 패치이므로 기존 규칙과 동일하거나 더 깊은 선택자로
   항상 우선 적용된다.
   ================================================================ */

/* ----------------------------------------------------------------
   (1) PC 레이아웃: 지금까지의 여러 버전이 .app/.boardwrap 등을
   100vh(또는 calc(100vh-Npx)) 고정 높이로 강제해 왔다. 평소 데스크톱
   에서는 화면 높이와 얼추 비슷해 티가 안 났지만, 휴대폰에서 "PC 버전"
   으로 전환하면 뷰포트 메타(width=1440, initial-scale=0.28)로 인해
   1vh가 실제보다 훨씬 커져, 실제 콘텐츠(전장·덱·핸드)보다 몇 배나 큰
   빈 배경이 화면 하단에 남는다. 높이를 콘텐츠 기준(auto)으로 바꿔
   이 문제를 근본적으로 해결한다. 화면이 콘텐츠보다 작을 때는
   body 스크롤로 대체한다. */
@media (min-width:851px){
  html,body{overflow:auto!important}
  .app{height:auto!important;min-height:0!important;align-items:start!important}
  .reference-left,.battle-panel,.reference-right{height:auto!important;min-height:0!important;max-height:none!important}
  .boardwrap{flex:0 0 auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}
  .battlefield-layout{height:auto!important;min-height:0!important}
  .battlefield-layout>.board{height:auto!important;min-height:0!important}
}

/* ----------------------------------------------------------------
   (2) 실제 모바일 화면: 하단 고정 스택이 실제로는 position:fixed가
   아니라(본진은 static, 핸드/버튼은 sticky) 일반 문서 흐름에 얹혀
   있어, 페이지 맨 위에서는 본진 바로 아래 핸드가 붙어 보이고 화면
   아래로 완전히 스크롤해야만 "고정"처럼 보였다. 세 요소 모두
   position:fixed로 화면 하단에 항상 고정하고, 전장(board)은 그
   높이만큼 padding-bottom을 확보한 채(v132에서 이미 계산) 자유롭게
   스크롤되도록 한다. */
@media (max-width:850px){
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount{
    position:fixed!important;
    left:0!important;right:0!important;width:100%!important;
    bottom:var(--dock-action-h)!important;
    z-index:88!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount{
    position:fixed!important;
    left:0!important;right:0!important;width:100%!important;
    bottom:calc(var(--dock-action-h) + var(--dock-hq-h))!important;
    z-index:89!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud{
    position:fixed!important;
    left:0!important;right:0!important;width:100%!important;
    bottom:0!important;
    z-index:92!important;
  }
  /* 전장(board)이 담긴 영역이 body 스크롤로 부드럽게 넘어가도록 보장 */
  body.ui-mode-mobile:not(.prebattle){
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:contain!important;
  }
}


/* ---- assets/css/v141_mobile_formation_hand_hq_fix.css ---- */
/* ================================================================
   v141 — (1) 모바일 "2. 전투" 메뉴에 진형 선택을 항상 보이게 노출
          (2) 모바일 핸드 카드에서 이미지가 카드 이름을 가리는 현상 수정
          (3) 본진 박스에서 "전략가 배치" 아래 남는 여백 제거(박스 높이 축소)
   game.css 및 이전 모든 fix 파일보다 나중에 로드되는 최종 패치.
   ================================================================ */

/* ----------------------------------------------------------------
   (1) "2. 전투" 카드 안에 진형 선택 + 덱 선택 셀렉트 두 개를 세로로
   쌓아 넣기 위한 레이아웃. 기존 .battle-menu-card는 [라벨][셀렉트]
   [버튼] 3칸 그리드였는데, 셀렉트 자리에 진형·덱 두 개를 넣는다. */
@media (max-width:850px){
  .battle-menu-card .battle-menu-selects{
    display:flex!important;
    flex-direction:column!important;
    gap:5px!important;
    min-width:0!important;
  }
  .battle-menu-card .battle-menu-selects select{
    width:100%!important;
  }
}

/* ----------------------------------------------------------------
   (2) 실제 모바일 핸드 카드: 카드 총 높이가 화면 폭에 따라 계산되는
   변수(--v129-hand-card-height 등)와 이름줄·이미지·능력치줄의 높이가
   서로 안 맞아떨어지는 경우, 그림 영역이 자기 grid 행 밖으로 넘쳐
   이름줄 위로 겹쳐 보이는 문제가 있었다. 이름·이미지·능력치 세 구간의
   높이를 고정값으로 명확히 나누어(합이 카드 전체 높이와 항상 일치)
   겹침이 생기지 않게 한다. */
@media (max-width:850px){
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card{
    height:142px!important;min-height:142px!important;max-height:142px!important;
    display:grid!important;
    grid-template-rows:20px minmax(0,1fr) 32px!important;
    overflow:hidden!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card .cname,
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-title-area{
    height:20px!important;min-height:20px!important;max-height:20px!important;
    display:flex!important;align-items:center!important;
    overflow:hidden!important;white-space:nowrap!important;
    position:relative!important;z-index:2!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-name-text{
    overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card .cimg{
    height:100%!important;min-height:0!important;max-height:none!important;
    overflow:hidden!important;position:relative!important;z-index:1!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card .cstats,
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-stat-grid{
    height:32px!important;min-height:32px!important;max-height:32px!important;
    overflow:hidden!important;
  }
}

/* ----------------------------------------------------------------
   (3) 본진 박스: 정보(라이프·MP·AP·카드수·턴수·책사유무) 두 줄과
   "전략가 배치" 칸은 실제로 100px 안팎이면 충분한데, 박스 자체 높이가
   168px로 고정돼 있어 전략가 배치 칸 아래로 빈 여백이 남았다.
   박스 높이를 실제 콘텐츠에 맞춰 줄인다. */
@media (max-width:850px){
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq{
    height:112px!important;min-height:112px!important;max-height:112px!important;
    overflow:visible!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .hq-advisor-slot{
    top:34px!important;height:58px!important;min-height:58px!important;
  }
}


/* ---- assets/css/online_platform.css ---- */
/* Online platform / role / release management extension */
.online-account-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.online-user-chip{padding:7px 10px;border:1px solid rgba(232,196,108,.42);border-radius:8px;background:rgba(20,16,12,.82);font-size:12px}.online-role-admin{color:#ffd66b}.online-role-user{color:#b7d8ff}.match-mode-grid,.booster-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}.match-card,.booster-card,.online-panel{border:1px solid rgba(232,196,108,.35);background:rgba(19,15,12,.88);border-radius:12px;padding:14px}.match-card h3,.booster-card h3{margin:0 0 8px}.match-status{margin-top:10px;padding:10px;border-radius:8px;background:rgba(0,0,0,.26);min-height:42px}.admin-only[hidden],.user-only[hidden]{display:none!important}.release-badge{display:inline-flex;padding:2px 7px;border-radius:999px;font-size:10px;font-weight:700;margin-left:4px}.release-released{background:#285d3b;color:#d7ffe2}.release-upcoming{background:#644f1f;color:#fff0af}.release-test{background:#493568;color:#eadcff}.online-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.online-form-grid label{display:grid;gap:5px;font-size:12px}.online-form-grid input,.online-form-grid select,.online-form-grid textarea{width:100%;box-sizing:border-box}.online-form-grid .full{grid-column:1/-1}.online-notice{font-size:12px;line-height:1.5;color:#d5c9b4}.booster-card .pack-art{font-size:44px;text-align:center;padding:12px}.mobile-online-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.opponent-human{outline:2px solid rgba(110,190,255,.55)}
@media(max-width:700px){.online-form-grid{grid-template-columns:1fr}.online-account-bar{font-size:11px}.match-mode-grid,.booster-grid{grid-template-columns:1fr}}
.visibility-badge{display:inline-flex;align-items:center;margin-left:5px;padding:2px 7px;border-radius:999px;font-size:11px;font-weight:700}
.visibility-public{background:#dff6e7;color:#176b37;border:1px solid #82c99b}
.visibility-private{background:#ececef;color:#555;border:1px solid #aaa}
.checkbox-line{display:flex!important;align-items:center;gap:8px;padding:10px;border:1px solid rgba(255,255,255,.15);border-radius:8px}
.checkbox-line input{width:auto!important;margin:0}
.wide-online-modal{width:min(1180px,96vw);max-width:none}.online-toolbar{display:grid;grid-template-columns:repeat(5,minmax(130px,1fr));gap:10px;margin:12px 0}.online-toolbar label{display:flex;flex-direction:column;gap:5px;font-size:12px}.online-table-wrap{max-height:62vh;overflow:auto;border:1px solid rgba(255,255,255,.14);border-radius:10px}.online-admin-table{width:100%;border-collapse:collapse;font-size:12px}.online-admin-table th,.online-admin-table td{padding:7px;border-bottom:1px solid rgba(255,255,255,.1);text-align:center;white-space:nowrap}.online-admin-table th{position:sticky;top:0;background:#171b25;z-index:2}.online-admin-table input,.online-admin-table select{min-width:58px;max-width:100px;padding:5px}.online-admin-table .name-cell{min-width:120px;text-align:left}.online-footer-actions{display:flex;justify-content:space-between;align-items:center;margin-top:12px}@media(max-width:760px){.online-toolbar{grid-template-columns:1fr 1fr}.wide-online-modal{width:98vw}.online-admin-table{min-width:900px}}

/* v149 Firebase account UI */
.auth-modalbox{width:min(720px,94vw);max-width:720px}
.auth-sections{display:grid;gap:14px;margin-top:12px}
.auth-section{padding:15px;border:1px solid rgba(232,196,108,.32);border-radius:12px;background:rgba(10,12,18,.44)}
.auth-section h3{margin:0 0 12px;font-size:16px;color:#f1d792}
.auth-reset-section{background:rgba(18,24,36,.55)}
.auth-actions{display:flex;gap:8px;justify-content:flex-end}
.auth-actions .btn{min-width:150px}
@media(max-width:700px){.auth-actions{justify-content:stretch}.auth-actions .btn{width:100%}}

/* v152 관리자 전용 카드관리 · 능력치 편집 이미지 등록 상태 */
html:not(.is-card-admin) #cardManagerBtn,
html:not(.is-card-admin) #mobileCardManagerBtn,
html:not(.is-card-admin) .admin-only{display:none!important}
.quick-stats-toolbar{grid-template-columns:repeat(4,minmax(120px,1fr)) minmax(220px,auto)}
.quick-stats-image-summary{align-self:end;min-height:34px;display:flex;align-items:center;justify-content:center;padding:0 10px;border:1px solid rgba(255,255,255,.14);border-radius:7px;background:rgba(0,0,0,.22);font-size:11px;white-space:nowrap}
.quick-stats-image-summary .registered-count{color:#8fe0a1}.quick-stats-image-summary .missing-count{color:#ffadad}
.quick-stats-table th:first-child,.quick-stats-table td:first-child{width:34px;min-width:34px;padding:3px}
.quick-stats-table th:nth-child(2),.quick-stats-table td:nth-child(2){width:56px;min-width:56px;padding-left:4px;padding-right:4px}
.qs-image-thumb{width:22px;height:30px;margin:auto;border:1px solid rgba(255,255,255,.28);border-radius:3px;overflow:hidden;background:rgba(255,255,255,.05);display:grid;place-items:center}
.qs-image-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.qs-image-empty{font-size:13px;line-height:1;color:#ff9f9f;opacity:.8}
.qs-image-status{display:inline-flex;align-items:center;gap:3px;font-size:9px;padding:2px 5px;border-radius:999px;font-weight:700}
.qs-image-status i{display:block;width:5px;height:5px;border-radius:50%}
.qs-image-status.registered{color:#c9f7d2;background:rgba(45,130,67,.26);border:1px solid rgba(94,195,116,.42)}
.qs-image-status.registered i{background:#63db7c;box-shadow:0 0 5px rgba(99,219,124,.7)}
.qs-image-status.missing{color:#ffd0d0;background:rgba(150,55,55,.24);border:1px solid rgba(226,103,103,.4)}
.qs-image-status.missing i{background:#ef7272}
.quick-stats-table tr.qs-image-missing td:first-child,.quick-stats-table tr.qs-image-missing td:nth-child(2){background:rgba(121,32,32,.10)}
@media(max-width:760px){.quick-stats-toolbar{grid-template-columns:1fr 1fr}.quick-stats-image-summary{grid-column:1/-1}.quick-stats-table{min-width:980px}}

/* v153: 실시간 사람 대전 대기 알림 */
.match-waiting-notice{
  width:calc(100% - 12px);margin:2px 6px 7px;padding:8px 10px;
  border:1px solid rgba(255,190,61,.78);border-radius:8px;
  background:linear-gradient(180deg,rgba(69,45,8,.96),rgba(34,23,7,.96));
  color:#ffe7a2;font-weight:800;font-size:12px;line-height:1.35;text-align:left;
  cursor:pointer;box-shadow:0 0 0 1px rgba(255,205,89,.08) inset,0 3px 12px rgba(0,0,0,.25)
}
.match-waiting-notice:hover{filter:brightness(1.12);border-color:#ffd46d}
.match-waiting-notice[hidden]{display:none!important}
.match-waiting-dot{display:inline-block;width:8px;height:8px;margin-right:7px;border-radius:50%;background:#ffbf34;box-shadow:0 0 0 0 rgba(255,191,52,.65);animation:matchWaitingPulse 1.45s infinite;vertical-align:1px}
.match-waiting-notice strong{color:#fff3c8}
@keyframes matchWaitingPulse{0%{box-shadow:0 0 0 0 rgba(255,191,52,.62)}70%{box-shadow:0 0 0 7px rgba(255,191,52,0)}100%{box-shadow:0 0 0 0 rgba(255,191,52,0)}}
.mobile-advanced-setup .match-waiting-notice{grid-column:1/-1;width:100%;margin:3px 0 0}
body.ui-mode-mobile-preview #mobileMatchWaitingNotice{display:block}
.mobile-header-match-notice{width:calc(100% - 16px);margin:4px 8px 6px;position:relative;z-index:2}
.auth-remember{display:flex!important;align-items:center;gap:8px}.auth-remember input{width:auto!important}.online-opponent-banner{position:fixed;top:10px;left:50%;transform:translateX(-50%);z-index:9998;padding:8px 16px;border-radius:999px;background:rgba(12,20,32,.92);color:#fff;font-weight:700;box-shadow:0 4px 18px rgba(0,0,0,.3)}


/* v158: online opponent/game log panel and reliable hand interaction */
.online-match-info-panel{margin-top:10px;padding:10px;border:1px solid rgba(205,170,93,.55);border-radius:10px;background:rgba(12,18,29,.92);color:#f5ead0;font-size:12px;line-height:1.45}
.online-match-info-title{font-weight:800;color:#ffd976;margin-bottom:5px}
.online-match-opponent{padding:6px 8px;border-radius:7px;background:rgba(255,255,255,.06);font-weight:700}
.online-match-log-title{margin-top:8px;color:#d6bd83;font-weight:700}
.online-match-game-log{margin-top:4px;max-height:130px;overflow:auto;padding:6px 8px;border-radius:7px;background:rgba(0,0,0,.25)}
.online-match-game-log>div{padding:3px 0;border-bottom:1px solid rgba(255,255,255,.07);word-break:break-word}
.online-match-game-log>div:first-child{color:#fff2ba}
#hand .card{pointer-events:auto!important;touch-action:manipulation;cursor:pointer;position:relative;z-index:2}
#hand .card.opening-hand-card{cursor:wait}
#hand .card.selected{z-index:6}
@media(max-width:900px){.mobile-online-match-info{display:block;margin:10px 0 0}.online-match-game-log{max-height:110px}}

.faction-auto-display{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.faction-auto-display span{padding:6px 10px;border:1px solid rgba(255,255,255,.18);border-radius:8px;background:rgba(0,0,0,.2)}.faction-auto-display b{margin-left:4px}


/* ---- assets/css/v173_user_request_fix.css ---- */
/* v173 요청사항: 핸드/필드 카드 크기 통일, 모바일 본진 압축, 관리자/로그인/드롭 UI */

/* 로그인 전에는 게임 전체 입력을 잠그고 로그인 창만 허용 */
html.login-required,body.login-required{overflow:hidden!important}
body.login-required .app,
body.login-required .mobile-game-header,
body.login-required .bottom-hud,
body.login-required #mobileMenuDrawer{pointer-events:none!important;user-select:none!important;filter:blur(1.5px) brightness(.42)!important}
body.login-required .modal:not(#loginModal){display:none!important}
body.login-required #loginModal{display:flex!important;opacity:1!important;visibility:visible!important;pointer-events:auto!important;z-index:50000!important}
body.login-required #loginModal [data-close-online="loginModal"]{display:none!important}
body.login-required #loginModal .modalbox{pointer-events:auto!important;filter:none!important}

/* 카드 관리자 상단 버튼: 작고 한 줄 유지 */
.card-manager-box .manager-head{gap:8px!important;align-items:flex-start!important}
.card-manager-box .manager-head>div:first-child{min-width:0!important}
.card-manager-box .manager-head h2{font-size:16px!important;line-height:1.2!important;white-space:nowrap!important}
.card-manager-box .manager-head .small{font-size:10px!important;line-height:1.3!important}
/* v212: max-width:52%+overflow-x:auto가 버튼들을 잘라 보이게 만들던 문제 수정.
   좁은 화면에서는 줄바꿈으로, 넓은 화면에서는 한 줄로 모든 버튼이 온전히 보이도록 한다. */
.card-manager-box .manager-head-actions{display:flex!important;flex-wrap:wrap!important;gap:4px!important;align-items:center!important;justify-content:flex-end!important;overflow:visible!important;max-width:none!important;flex:1 1 auto!important;min-width:0!important}
.card-manager-box .manager-head-actions .btn{min-height:26px!important;height:26px!important;padding:3px 7px!important;font-size:10px!important;line-height:1!important;white-space:nowrap!important;flex:0 0 auto!important;border-radius:6px!important}
.manager-direct-image-drop-zone{width:100%;min-height:92px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:12px;border:1.5px dashed rgba(79,182,255,.8);border-radius:10px;background:rgba(22,56,85,.42);text-align:center;cursor:pointer;transition:.15s ease}
.manager-direct-image-drop-zone:hover,.manager-direct-image-drop-zone:focus,.manager-direct-image-drop-zone.drop-ready{outline:none;border-color:#7ff0bd;background:rgba(23,104,85,.42);transform:translateY(-1px)}
.manager-direct-image-drop-zone strong{font-size:13px;color:#e9fbff}
.manager-direct-image-drop-zone span{font-size:10px;color:#b9d7e8;line-height:1.35}
.manager-direct-image-drop-zone small{font-size:9px;color:#8fa9b8}

/* v212: 카드관리 이미지 등록 - 프로젝트 폴더 직접저장 연결 UI */
.manager-project-folder-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:2px}
.manager-project-folder-row .btn{flex:0 0 auto;padding:6px 10px;font-size:11px}
.manager-project-folder-status{font-size:10.5px;color:#9fb1cb;padding:4px 8px;border:1px solid #334763;border-radius:8px;background:#0a1322}
.manager-project-folder-status.connected{color:#7ff0bd;border-color:#2f6b52;background:#0d2118}

/* v213: 항목3 — 폴더 직접저장 전용 등록 영역(서버 R2 영역과 시각적으로 구분: 초록 계열) */
.manager-folder-image-drop-zone{border-color:rgba(126,222,150,.85)!important;background:rgba(24,63,36,.42)!important;margin-top:10px}
.manager-folder-image-drop-zone:hover,.manager-folder-image-drop-zone:focus,.manager-folder-image-drop-zone.drop-ready{border-color:#9be9a8!important;background:rgba(31,94,48,.5)!important}

/* v212: 항목5 — 라이프/MP/EN이 최고치에 도달하면 밝은 색으로 강조 표시 */
.stat-maxed{color:#fff3b0!important;text-shadow:0 0 6px #ffe37acc,0 0 14px #ffcf4d80!important;font-weight:900!important}

/* 능력치 일괄편집 이미지 셀: 클릭/드롭 즉시 업로드 */
.qs-image-thumb{cursor:pointer;position:relative;outline:none;transition:.15s ease}
.qs-image-thumb:hover,.qs-image-thumb:focus,.qs-image-thumb.drop-ready{box-shadow:0 0 0 2px #65e6bd,0 0 14px rgba(101,230,189,.35)!important;transform:scale(1.04)}
.qs-image-thumb.uploading{pointer-events:none;opacity:.55}
.qs-image-thumb.uploading:after{content:'저장 중';position:absolute;inset:0;display:grid;place-items:center;background:rgba(4,15,25,.75);font-size:8px;color:#fff}
.qs-image-thumb.just-registered{animation:qsImageRegisteredFlash 1.4s ease-out}
.qs-image-thumb.just-registered:after{content:'✓ 등록됨';position:absolute;inset:0;display:grid;place-items:center;background:rgba(20,90,60,.75);font-size:8px;color:#d6ffe9;font-weight:900;animation:qsImageRegisteredLabel 1.4s ease-out forwards}
@keyframes qsImageRegisteredFlash{0%{box-shadow:0 0 0 3px #65e6bd,0 0 18px rgba(101,230,189,.6)}100%{box-shadow:0 0 0 0 rgba(101,230,189,0)}}
@keyframes qsImageRegisteredLabel{0%{opacity:1}70%{opacity:1}100%{opacity:0}}

/* 데스크톱 핸드카드 높이를 현재 전투필드 카드(160px)와 동일하게 */
@media (min-width:851px){
  #hand.hand{grid-auto-rows:160px!important;grid-template-rows:repeat(2,160px)!important;align-content:start!important}
  #hand.hand .card{height:160px!important;min-height:160px!important;max-height:160px!important;grid-template-rows:24px minmax(0,1fr) 28px!important}
}

/* 모바일: 핸드카드와 필드카드의 폭·높이·내부 행을 완전히 동일하게 */
@media (max-width:850px){
  :root{
    --v173-mobile-hq-height:118px;
    --v173-mobile-hq-content-height:56px;
    --v173-mobile-hand-height:calc(var(--v129-field-card-height, 154px) + 32px);
  }
  body.ui-mode-mobile #hand.hand .card,
  body.ui-mode-mobile .mobile-hand-mount #hand .card{
    width:var(--mobile-card-width)!important;
    min-width:var(--mobile-card-width)!important;
    max-width:var(--mobile-card-width)!important;
    height:var(--v129-field-card-height)!important;
    min-height:var(--v129-field-card-height)!important;
    max-height:var(--v129-field-card-height)!important;
    grid-template-rows:calc(var(--mobile-card-width) * .2684) minmax(0,1fr) calc(var(--mobile-card-width) * .3131)!important;
  }
  body.ui-mode-mobile #hand.hand{
    grid-auto-rows:var(--v129-field-card-height)!important;
    grid-template-rows:var(--v129-field-card-height)!important;
    min-height:var(--v129-field-card-height)!important;
  }
  /* 하단 고정영역 중복 예약을 해제하고 본진·핸드를 실제 흐름에 배치 */
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount,
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount{
    position:relative!important;inset:auto!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;transform:none!important;z-index:auto!important;width:100%!important;margin:4px 0!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount{height:var(--v173-mobile-hq-height)!important;min-height:var(--v173-mobile-hq-height)!important;max-height:var(--v173-mobile-hq-height)!important;padding:0!important}
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount{height:var(--v173-mobile-hand-height)!important;min-height:var(--v173-mobile-hand-height)!important;max-height:var(--v173-mobile-hand-height)!important;padding:0 4px!important;overflow:hidden!important}
  body.ui-mode-mobile:not(.prebattle) .bottom-hud{display:none!important}
  body.ui-mode-mobile:not(.prebattle),body.ui-mode-mobile:not(.prebattle) .app{padding-bottom:max(8px,env(safe-area-inset-bottom))!important}

  /* 적·아군 본진과 책사 슬롯의 높이 통일 */
  body.ui-mode-mobile .enemy-hq-row,
  body.ui-mode-mobile .ally-hq-row,
  body.ui-mode-mobile .battle-hq{
    height:var(--v173-mobile-hq-height)!important;
    min-height:var(--v173-mobile-hq-height)!important;
    max-height:var(--v173-mobile-hq-height)!important;
  }
  body.ui-mode-mobile .battle-hq{padding:0!important;overflow:hidden!important}
  body.ui-mode-mobile .battle-hq .hq-title{height:22px!important;min-height:22px!important;padding:3px 6px!important;font-size:10px!important;line-height:16px!important}
  body.ui-mode-mobile .battle-hq .hq-info-overlay{
    position:absolute!important;left:5px!important;right:calc(var(--mobile-card-width) + 10px)!important;top:25px!important;bottom:auto!important;height:var(--v173-mobile-hq-content-height)!important;min-height:var(--v173-mobile-hq-content-height)!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(0,1fr))!important;gap:2px!important;padding:2px!important;border-radius:6px!important;
  }
  body.ui-mode-mobile .battle-hq .hq-stat-chip{min-height:0!important;height:auto!important;padding:1px 2px!important;font-size:8px!important;line-height:1!important}
  body.ui-mode-mobile .battle-hq .hq-stat-value{font-size:8px!important;line-height:1!important}
  body.ui-mode-mobile .battle-hq .hq-stat-icon{font-size:8px!important}
  body.ui-mode-mobile .battle-hq .hq-advisor-slot{
    position:absolute!important;right:5px!important;top:25px!important;bottom:auto!important;width:var(--mobile-card-width)!important;height:var(--v173-mobile-hq-content-height)!important;min-height:var(--v173-mobile-hq-content-height)!important;max-height:var(--v173-mobile-hq-content-height)!important;padding:0!important;border-radius:6px!important;overflow:hidden!important;
  }
  body.ui-mode-mobile .hq-advisor-slot .advisor-card,
  body.ui-mode-mobile .hq-advisor-slot .advisor-portrait{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important;border-radius:5px!important;overflow:hidden!important}
  body.ui-mode-mobile .hq-advisor-slot .advisor-portrait img{width:100%!important;height:100%!important;object-fit:cover!important}
  body.ui-mode-mobile .hq-advisor-slot .advisor-slot-badge{position:absolute!important;left:0!important;right:0!important;bottom:0!important;height:17px!important;min-height:17px!important;padding:2px 3px!important;background:linear-gradient(transparent,rgba(2,8,16,.96))!important;display:flex!important;align-items:flex-end!important;justify-content:center!important;z-index:3!important}
  body.ui-mode-mobile .hq-advisor-slot .advisor-slot-badge b{display:block!important;width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;text-align:center!important;font-size:8px!important;line-height:12px!important}
  body.ui-mode-mobile .hq-advisor-slot .advisor-slot-badge span{display:none!important}
  body.ui-mode-mobile .hq-advisor-slot .advisor-empty{font-size:8px!important;line-height:1.2!important;text-align:center!important;padding:4px!important}
  body.ui-mode-mobile .battle-hq .mobile-hq-actions{position:absolute!important;left:5px!important;right:5px!important;bottom:4px!important;top:auto!important;height:27px!important;min-height:27px!important;display:flex!important;align-items:stretch!important;gap:3px!important;z-index:8!important}
  body.ui-mode-mobile .battle-hq .mobile-hq-actions .btn,
  body.ui-mode-mobile .battle-hq .mobile-hq-actions button{min-height:27px!important;height:27px!important;padding:2px 5px!important;font-size:9px!important;line-height:1!important;white-space:nowrap!important}
  body.ui-mode-mobile .battle-hq .hq-turn-box{display:none!important}
}

/* v173 최종 우선순위 고정: v132/v141의 더 깊은 선택자를 확실히 덮어쓴다. */
@media (max-width:850px){
  :root{
    --v129-hand-card-height:var(--v129-field-card-height)!important;
    --mobile-hand-card-h:var(--v129-field-card-height)!important;
    --v120-hand-height:calc(var(--v129-field-card-height) + 32px)!important;
    --v122-mobile-hq-h:118px!important;
    --v120-hq-height:118px!important;
    --v120-bottom-total:calc(var(--v129-field-card-height) + 150px)!important;
  }

  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand{
    height:var(--v129-field-card-height)!important;
    min-height:var(--v129-field-card-height)!important;
    max-height:var(--v129-field-card-height)!important;
    grid-auto-rows:var(--v129-field-card-height)!important;
    grid-template-rows:var(--v129-field-card-height)!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card{
    flex:0 0 var(--mobile-card-width)!important;
    width:var(--mobile-card-width)!important;
    min-width:var(--mobile-card-width)!important;
    max-width:var(--mobile-card-width)!important;
    height:var(--v129-field-card-height)!important;
    min-height:var(--v129-field-card-height)!important;
    max-height:var(--v129-field-card-height)!important;
    display:grid!important;
    grid-template-rows:calc(var(--mobile-card-width) * .2684) minmax(0,1fr) calc(var(--mobile-card-width) * .3131)!important;
    overflow:hidden!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card .cname,
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-title-area,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card .cname,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-title-area{
    height:100%!important;min-height:0!important;max-height:none!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card .cstats,
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-stat-grid,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card .cstats,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card .card-stat-grid{
    height:100%!important;min-height:0!important;max-height:none!important;
  }

  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .ally-hq-row,
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .ally-hq-row,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .battle-hq,
  body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row,
  body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .battle-hq{
    height:118px!important;min-height:118px!important;max-height:118px!important;overflow:hidden!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-info-overlay,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-info-overlay,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-info-overlay,
  body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .battle-hq .hq-info-overlay{
    left:5px!important;right:calc(var(--mobile-card-width) + 10px)!important;top:25px!important;bottom:auto!important;
    height:56px!important;min-height:56px!important;max-height:56px!important;
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(0,1fr))!important;
    gap:2px!important;padding:2px!important;align-content:stretch!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip,
  body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip{
    width:auto!important;height:auto!important;min-height:0!important;padding:1px 2px!important;gap:2px!important;font-size:8px!important;border-radius:4px!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip .hq-stat-icon,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip .hq-stat-icon,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip .hq-stat-icon,
  body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip .hq-stat-icon{
    font-size:8px!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip .hq-stat-value,
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip b,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip .hq-stat-value,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip b,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip .hq-stat-value,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-stat-chip b,
  body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip .hq-stat-value,
  body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .battle-hq .hq-stat-chip b{
    font-size:8px!important;line-height:1!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .hq-advisor-slot,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount .hq-advisor-slot,
  body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row .hq-advisor-slot{
    inset:25px 5px auto auto!important;
    width:var(--mobile-card-width)!important;min-width:var(--mobile-card-width)!important;max-width:var(--mobile-card-width)!important;
    height:56px!important;min-height:56px!important;max-height:56px!important;padding:0!important;overflow:hidden!important;
  }
}


/* ---- assets/css/v174_mobile_hq_dock_fix.css ---- */
/* ================================================================
   v174 — 모바일 본진 UI 3건
   1) 아군/적군 본진 이름을 박스 상단 중앙에 정확히 표시
      (기존 .hq-title는 PC용 min-width:210px가 좁은 모바일 박스에서
       그대로 남아있어 중앙 배너가 박스 밖으로 밀려나가고 overflow:hidden에
       잘려 "아군 본진 · 위"의 앞글자가 화면 왼쪽 밖으로 잘려 보이던 문제.
       모바일에서는 title을 절대배치 배너 방식에서 그리드 셀 안 텍스트
       중앙정렬 방식으로 바꿔 원천적으로 잘림이 생기지 않게 한다.)
   2) 책사 배치 박스 높이를 본진 박스 높이와 통일
      (기존엔 책사 박스가 정보칸과 같은 56px짜리 가운데 띠 안에만 있어
       박스 위·아래로 남는 공백이 있었음. 본진 박스를 [제목행]-[정보/책사행]
       -[버튼행](아군만) 3행 그리드로 재구성하고, 책사 박스를 정보+버튼
       두 행을 합친 오른쪽 칼럼 전체에 걸쳐 배치해 사실상 본진 박스
       전체 높이(제목행 제외)와 같아지도록 한다.)
   3) 본진 박스를 화면 하단에 완전히 밀착
      (기존엔 본진 박스가 일반 문서 흐름에 있어 그 아래 핸드 영역과
       세이프에어리어 패딩만큼 화면 하단과 틈이 있었음. 본진 박스를
       화면에 고정하고, 핸드는 그 바로 위에 고정해 본진 박스 아래쪽
       테두리가 화면 맨 아래에 완전히 붙도록 한다.)

   game.css 및 이전 모든 모바일 패치(v132/v133/v139/v141/v173)보다
   나중에 로드되는 최종 패치. 일부 규칙은 game.css의 #allyHq/#enemyHq
   ID 선택자가 class 선택자보다 우선하는 것을 피하기 위해 동일하게
   ID 선택자를 사용한다.
   ================================================================ */

@media (max-width:850px){

  /* ---- 본진 박스: 그리드 컨테이너로 전환 ---- */
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq{
    display:grid!important;
    grid-template-columns:1fr var(--mobile-card-width)!important;
    column-gap:5px!important;
    padding:3px!important;
    box-sizing:border-box!important;
    position:relative!important;
    overflow:hidden!important;
  }
  /* 아군 본진: 제목 / 정보+책사 / 버튼+책사 3행 — 책사 칸이 2·3행을 모두 차지 */
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq{
    grid-template-rows:22px 1fr 28px!important;
    grid-template-areas:"title title" "stats advisor" "actions advisor"!important;
    row-gap:2px!important;
  }
  /* 적군 본진: 버튼행이 없어 제목 / 정보+책사 2행 — 책사 칸이 남은 높이 전체를 차지 */
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq{
    grid-template-rows:22px 1fr!important;
    grid-template-areas:"title title" "stats advisor"!important;
  }

  /* ---- 본진 이름: 그리드 셀 안에서 절대배치를 해제하고 가운데 정렬 ---- */
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-title,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-title{
    grid-area:title!important;
    position:static!important;
    inset:auto!important;
    left:auto!important;top:auto!important;transform:none!important;
    width:100%!important;min-width:0!important;max-width:none!important;
    box-sizing:border-box!important;
    height:100%!important;min-height:0!important;max-height:none!important;
    margin:0!important;padding:0 4px!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    text-align:center!important;
    white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
    clip-path:none!important;
    font-size:11px!important;line-height:1.1!important;
  }

  /* ---- 정보칸(라이프·MP·행동력·덱·턴·책사유무): 그리드 셀에 맞춰 채움 ---- */
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .hq-info-overlay,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row .battle-hq .hq-info-overlay{
    grid-area:stats!important;
    position:static!important;
    inset:auto!important;
    left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
    width:100%!important;height:100%!important;
    min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;
    margin:0!important;padding:2px!important;box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    gap:2px!important;
  }

  /* ---- 책사 배치칸: 오른쪽 칼럼 전체(본진 박스와 같은 높이) ---- */
  body.ui-mode-mobile:not(.prebattle) #allyHq .hq-advisor-slot,
  body.ui-mode-mobile:not(.prebattle) #enemyHq .hq-advisor-slot{
    grid-area:advisor!important;
    position:static!important;
    inset:auto!important;
    left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
    transform:none!important;
    width:100%!important;height:100%!important;
    min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;
    margin:0!important;padding:0!important;box-sizing:border-box!important;
    border-radius:6px!important;overflow:hidden!important;
  }

  /* ---- 항복·셔플·턴종료 버튼(아군 본진만): 왼쪽 칼럼 맨 아래 행 ---- */
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .mobile-hq-actions{
    grid-area:actions!important;
    position:static!important;
    inset:auto!important;
    left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
    width:100%!important;height:100%!important;
    min-width:0!important;max-width:none!important;min-height:0!important;max-height:none!important;
    margin:0!important;padding:0!important;box-sizing:border-box!important;
    display:flex!important;align-items:stretch!important;justify-content:stretch!important;gap:3px!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .mobile-hq-actions .btn,
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount .battle-hq .mobile-hq-actions button{
    flex:1 1 0!important;
    width:auto!important;
    height:auto!important;min-height:0!important;max-height:none!important;
  }

  /* ---- 본진 박스를 화면 맨 아래에 고정, 핸드는 그 바로 위에 고정 ---- */
  body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount{
    position:fixed!important;
    left:0!important;right:0!important;top:auto!important;bottom:0!important;
    width:100%!important;margin:0!important;
    padding:0 4px env(safe-area-inset-bottom,0px)!important;
    box-sizing:border-box!important;
    z-index:60!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount{
    position:fixed!important;
    left:0!important;right:0!important;top:auto!important;
    bottom:calc(var(--v173-mobile-hq-height, 118px) + env(safe-area-inset-bottom,0px))!important;
    width:100%!important;margin:0!important;
    z-index:59!important;
  }
  /* 위에서 고정한 본진·핸드 두 줄 높이만큼 전투 화면 하단 여백을 확보해
     실제 전투필드 카드가 그 뒤에 가려지지 않게 한다. */
  body.ui-mode-mobile:not(.prebattle) .app,
  body.ui-mode-mobile:not(.prebattle){
    padding-bottom:calc(var(--v173-mobile-hq-height, 118px) + var(--v173-mobile-hand-height, 186px) + env(safe-area-inset-bottom,0px) + 6px)!important;
  }
}


/* ---- assets/css/v175_ui_patch.css ---- */
/* ================================================================
   v175 — 항목 23: 본진 체력·MP·행동력·카드수·턴을
   핸드 카드 바로 위(#allyHqQuickBar)에 더 크고 직관적으로 표시.
   기존 .hq-info-overlay(본진 박스 안의 작은 칩)는 그대로 두고,
   핸드 바로 위에 별도의 확대 표시줄을 추가하는 방식이라
   v173/v174에서 이미 안정화된 본진 박스 레이아웃은 건드리지 않는다.
   game.css 및 이전 모든 패치보다 나중에 로드된다.
   ================================================================ */

.hq-quickbar{
  display:flex;
  align-items:stretch;
  justify-content:space-between;
  gap:6px;
  margin:0 0 6px 0;
  padding:6px 8px;
  border-radius:10px;
  background:linear-gradient(180deg,#151b2be6,#0b0f18e6);
  border:1px solid #ffffff26;
  box-shadow:0 2px 10px #000a;
}
.hq-quick-stat{
  flex:1 1 0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-width:0;
}
.hq-quick-icon{font-size:15px;line-height:1;opacity:.9;}
.hq-quick-stat b{
  font-size:16px;
  font-weight:800;
  letter-spacing:.2px;
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.hq-quick-stat.hp b{color:#ff8a8a;}
.hq-quick-stat.mp b{color:#8ad6ff;}
.hq-quick-stat.ap b{color:#ffe28a;}
.hq-quick-stat.deck b{color:#c9b8ff;}
.hq-quick-stat.turn b{color:#9dffb0;}

@media (max-width:850px){
  body.ui-mode-mobile:not(.prebattle) .hq-quickbar{
    padding:5px 6px;
    margin:0 0 4px 0;
    border-radius:8px;
    gap:3px;
  }
  body.ui-mode-mobile:not(.prebattle) .hq-quick-icon{font-size:13px;}
  body.ui-mode-mobile:not(.prebattle) .hq-quick-stat b{font-size:14px;}
}

/* ================================================================
   v175 — 항목 1: 카드상점 카드 글씨 확대(상단은 이름+등급만, 공방체지매 강조)
   ================================================================ */
.card-shop-grid .collection-card-heading small{display:none!important;} /* 상단엔 이름+등급만 */
.card-shop-grid .collection-card-heading .collection-card-name{font-size:13px!important;font-weight:1000!important;}
.card-shop-grid .collection-card-title em{font-size:12px!important;min-width:24px!important;height:20px!important;}
.card-shop-grid .collection-five-stats{font-size:15px!important;font-weight:950!important;padding:6px 3px!important;}
@media (max-width:850px){
  .card-shop-grid .collection-card-heading .collection-card-name{font-size:11px!important;}
  .card-shop-grid .collection-five-stats{font-size:12px!important;}
}

/* ================================================================
   v175 — 항목 18: 사용 가능 카드 표시를 굵은 테두리 대신
   등급표시(.card-title-grade)와 같은 크기의 "가능" 배지로 변경.
   ================================================================ */
#hand.hand .card.affordable{
  border-color:#f7d77f!important;
  box-shadow:none!important; /* 굵은 강조 테두리 제거 → 일반 테두리 굵기만 유지 */
}
#hand.hand .card.affordable:not(.selected)::after{content:none!important;}
#hand.hand .card-ready-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:25px;
  height:18px;
  padding:0 5px;
  margin-left:2px;
  border-radius:3px;
  border:1px solid #6fe3a0;
  background:#0d2e1cd9;
  color:#c9ffd9;
  font-size:9px;
  font-weight:950;
  line-height:1;
  white-space:nowrap;
  text-shadow:0 1px 2px #000;
}
@media (max-width:850px){
  #hand.hand .card-ready-badge{min-width:20px;height:14px;font-size:7px;padding:0 3px;}
}

/* ================================================================
   v175 — 항목 10: 카드관리 폼에서 현재 카드 종류와 무관한 입력칸을
   흐리게 비활성화만 하지 않고 아예 숨겨 더 간결하게 정리.
   ================================================================ */
.manager-field.mgr-field-hidden{display:none!important;}

/* 전투 시작 전(준비 화면)에는 본진 요약줄을 숨긴다. */
body.prebattle .hq-quickbar{display:none;}

/* ================================================================
   v175 — 항목 20: 본진 1칸(책사 공간)을 밝은 박스로 표시.
   기존 .hq-advisor-slot(책사 배치칸)에 밝은 강조 배경·테두리를 추가해
   "본진 안의 책사 전용 칸"임을 시각적으로 구분한다.
   ================================================================ */
.battle-hq .hq-advisor-slot{
  background:linear-gradient(180deg,#3a3018e6,#241d0ce6)!important;
  border:1px solid #f3d67f!important;
  box-shadow:0 0 10px #f3d67f4d,inset 0 0 0 1px #ffe9a355!important;
}
.battle-hq .hq-advisor-slot.active{
  background:linear-gradient(180deg,#4a3d1fe6,#2c230ee6)!important;
  box-shadow:0 0 14px #ffe08a66,inset 0 0 0 1px #ffe9a377!important;
}

/* ================================================================
   v175-2 — 카드상점 + 덱편집 공통: 공/방/체·지력/매력·설명·아이콘 확대
   (카드 박스 자체 크기는 그대로 두고 내부 글씨/기호만 키운다)
   ================================================================ */
.card-shop-grid .collection-five-stats,
.deck-builder-visual-card .collection-five-stats{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:2px!important;
  font-size:15px!important;
  padding:5px 3px!important;
}
.collection-stat-core{
  font-size:15px!important;
  font-weight:1000!important;
  color:#ffe6ad!important;
  letter-spacing:.02em;
}
.collection-stat-mind{
  font-size:13px!important;
  font-weight:900!important;
  color:#8fe0ff!important; /* 지력·매력은 다른 색(하늘색)으로 구분 */
  letter-spacing:.02em;
}
@media (max-width:850px){
  .card-shop-grid .collection-five-stats,
  .deck-builder-visual-card .collection-five-stats{font-size:12px!important;}
  .collection-stat-core{font-size:12px!important;}
  .collection-stat-mind{font-size:11px!important;}
}

/* 설명(특수능력·텍스트) 글씨 확대. 박스 높이는 기존 제한을 그대로 유지해 카드 크기에는 영향 없음. */
.card-shop-grid .collection-extra,
.deck-builder-visual-card .collection-extra{
  font-size:11px!important;
  line-height:1.3!important;
  font-weight:600!important;
  color:#f0e6d0!important;
}

/* 병력종류(병종/카드유형) 아이콘, 행동력(EN) 아이콘 확대 */
.card-shop-grid .collection-card-icons,
.deck-builder-visual-card .collection-card-icons{
  gap:4px!important;
}
.card-shop-grid .collection-type-icon,
.card-shop-grid .collection-soldier-icon,
.card-shop-grid .collection-en-icon,
.deck-builder-visual-card .collection-type-icon,
.deck-builder-visual-card .collection-soldier-icon,
.deck-builder-visual-card .collection-en-icon{
  font-size:15px!important;
  font-weight:900!important;
  text-shadow:0 1px 3px #000;
}
.collection-soldier-icon{
  padding:0 2px;
}

/* ================================================================
   v178 — 항목 1·2: 본진 진영 카드 표시 오류 수정 + 책사 공간 재배치
   ================================================================ */
/* 본진 병력칸 이름 줄바꿈(세로로 글자가 쌓이는) 버그 방지: 항상 한 줄로, 넘치면 말줄임. */
.hq-field-slot .base-unit-mini,
.hq-field-slot .base-unit-mini b,
.hq-field-slot .base-unit-mini span,
.hq-field-slot .base-unit-name-click{
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  writing-mode:horizontal-tb!important;
  min-width:0!important;
}
.hq-field-slot{min-width:0!important;}
.hq-battlefield-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important;}

/* 책사 전용 칸(본진 진영의 마지막 칸): 밝은 강조 박스로 표시하고, 옮겨온 책사 배치 요소가
   칸 전체를 채우도록 한다. */
.hq-advisor-field-slot{
  border-style:solid!important;
  border-color:#f3d67f!important;
  background:linear-gradient(180deg,#3a3018e6,#241d0ce6)!important;
  box-shadow:0 0 10px #f3d67f4d,inset 0 0 0 1px #ffe9a355!important;
  padding:0!important;
}
.hq-advisor-field-slot .hq-advisor-slot,
.hq-advisor-field-slot .advisor{
  position:static!important;
  width:100%!important;
  height:100%!important;
  inset:auto!important;
  margin:0!important;
}

/* 항목 2: 핸드 위쪽 본진박스 안의 상태표시(체력·MP·행동력 등 칩)와 책사 배치칸은 더 이상
   여기서 보여주지 않는다(책사 배치는 본진 진영의 마지막 칸으로 이동했고, 상태표시는
   #allyHqQuickBar가 대신한다). */
#allyHq .hq-info-overlay,
#enemyHq .hq-info-overlay,
#allyHq > .hq-advisor-slot,
#enemyHq > .hq-advisor-slot{
  display:none!important;
}

/* ================================================================
   v178 — 항목 5: 핸드 카드 크기를 전투필드 카드 크기와 동일하게.
   syncHandCardSizeToField()가 매 렌더마다 채워주는 --hand-card-width/height를
   모든 반응형 분기(!important 다수)보다 나중에 로드되는 이 파일에서 강제 적용한다.
   ================================================================ */
#hand.hand .card{
  width:var(--hand-card-width,106px)!important;
  min-width:var(--hand-card-width,106px)!important;
  max-width:var(--hand-card-width,106px)!important;
  height:var(--hand-card-height,138px)!important;
  min-height:var(--hand-card-height,138px)!important;
  max-height:var(--hand-card-height,138px)!important;
}
/* 카드 크기가 가변이라 열 수를 고정하지 않고, 실제 카드 폭 기준으로 자동으로 줄바꿈되게 한다.
   → "사이드 공간 폭 조정": 핸드 영역이 카드 실제 크기에 맞춰 넓어지거나 좁아진다. */
#hand.hand{
  display:flex!important;
  flex-wrap:wrap!important;
  grid-template-columns:none!important;
  align-content:flex-start!important;
  justify-content:flex-start!important;
}
.right-hand-section{
  width:auto!important;
  min-width:calc(var(--hand-card-width,106px) * 2 + 30px)!important;
}
@media (max-width:850px){
  .right-hand-section{min-width:0!important;}
}

/* ================================================================
   v179 — 항목4: 아군/적군 3열을 삭제하고 "무점령지" 공유 구역(4칸) 하나로 병합.
   전용 라벨 없이(요청대로 "표시가 없는 구역") 두 진영 사이에 배치한다.
   ================================================================ */
.lane.neutral-lane{
  background:repeating-linear-gradient(135deg,#1c222a 0 10px,#161b21 10px 20px)!important;
  border:1px dashed #6b7688aa!important;
}
.lane.neutral-lane .slots.n4{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
@media (max-width:850px){
  .battlefield-layout .lane.neutral-lane{padding-top:6px!important;}
}

/* ================================================================
   v180 — 무점령지 레인이 아래(아군) 레인과 시각적으로 겹치는 문제 방어 조치.
   정확한 원인을 실제 브라우저로 확인할 수 없어, 겹침이 구조적으로 불가능하도록
   레인 자체를 내용에 맞춰 확실히 감싸고(overflow:hidden), 위아래 여백을 넉넉히
   확보하는 방어적 수정이다.
   ================================================================ */
.battlefield-layout .lane{
  overflow:hidden!important;
  isolation:isolate;
}
.lane.neutral-lane{
  margin:4px 0!important;
  min-height:86px!important;
}
.lane.neutral-lane .slots{
  min-height:78px!important;
}
@media (max-width:850px){
  .battlefield-layout .lane.neutral-lane{min-height:92px!important;margin:5px 0!important;}
  .battlefield-layout .lane.neutral-lane .slots{min-height:84px!important;}
}

/* ================================================================
   v185 — 매복 카드 UI + 화면 개편 요청 반영
   (1) 함정(구 매복 함정)/매복 카드 관련: 매복 선택 모달은 부활 모달과
       동일한 .revive-select-box/.revive-candidate-* 클래스를 재사용하므로
       별도 CSS 불필요.
   (2) 제목("TCG 삼국지"/"전투 프로토타입") 삭제는 HTML에서 요소 자체를
       삭제해 처리(별도 CSS 불필요).
   (3) 적군·아군 본진을 소형 박스로 나란히("사진처럼") 배치.
   (4) 모바일 하단 항복·셔플·턴종료 버튼줄 위에 적군·아군 상태줄 추가.
   (5) 전투필드 폭은 기존 그대로 유지, 나머지 화면(로그인·전투메뉴 등)
       폭을 핸드카드 화면(.right-hand-section) 폭 기준에 맞춤.
   실기기 렌더링 확인이 불가능한 환경에서 작성되었으므로, 실제 배치 후
   여백·줄바꿈이 어긋나면 스크린샷과 함께 재조정이 필요할 수 있습니다.
   ================================================================ */

/* ---- (3) 적군·아군 소형 상태 박스를 나란히 배치 ---- */
.battle-status-pair{
  display:flex;
  gap:8px;
  margin:0 0 6px 0;
}
.battle-status-pair .hq-quickbar{
  flex:1 1 0;
  min-width:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.hq-quickbar-title{
  font-size:10px;
  font-weight:900;
  color:#d8c497;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  padding:0 2px;
}
.hq-quickbar-stats{
  display:flex;
  align-items:stretch;
  justify-content:space-between;
  gap:4px;
}
.enemy-quickbar{border-color:#7a3a3aa0!important;background:linear-gradient(180deg,#2b1417e6,#150a0be6)!important;}
.enemy-quickbar .hq-quickbar-title{color:#f0a5a5;}
.ally-quickbar{border-color:#3a5a7aa0!important;background:linear-gradient(180deg,#141f2be6,#0a0f18e6)!important;}
.ally-quickbar .hq-quickbar-title{color:#a5c8f0;}
body.prebattle .battle-status-pair{display:none;}
@media (max-width:850px){
  .battle-status-pair{gap:5px;}
  .hq-quickbar-title{font-size:9px;}
  body.ui-mode-mobile:not(.prebattle) .battle-status-pair .hq-quick-stat b{font-size:12px;}
}

/* ---- (4) 모바일 하단 고정 상태줄(버튼 위) ---- */
:root{--mobile-status-row-height:0px;}
#mobileBottomStatusRow{display:none;}
@media (max-width:850px){
  body.ui-mode-mobile{--mobile-status-row-height:30px;}
  body.ui-mode-mobile:not(.prebattle) #mobileBottomStatusRow{
    display:flex!important;
    gap:6px!important;
    order:1!important;
    width:100%!important;
    height:var(--mobile-status-row-height)!important;
    min-height:var(--mobile-status-row-height)!important;
    max-height:var(--mobile-status-row-height)!important;
    padding:2px 2px 4px!important;
    margin:0!important;
    border-bottom:1px solid #2c2216!important;
    background:transparent!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud{
    display:flex!important;
    flex-direction:column!important;
    height:calc(var(--mobile-action-height) + var(--mobile-status-row-height))!important;
    min-height:calc(var(--mobile-action-height) + var(--mobile-status-row-height))!important;
    max-height:calc(var(--mobile-action-height) + var(--mobile-status-row-height))!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .hud-status{
    flex:0 0 var(--mobile-action-height)!important;
    height:var(--mobile-action-height)!important;
    order:2!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount{
    bottom:calc(var(--mobile-action-height) + var(--mobile-status-row-height) + env(safe-area-inset-bottom,0px))!important;
  }
  .mini-quickbar{
    flex:1 1 0;
    min-width:0;
    display:flex;
    align-items:center;
    gap:5px;
    padding:2px 5px;
    border-radius:6px;
    background:#0000002e;
  }
  .mini-quickbar.enemy{background:#3a15171f;}
  .mini-quickbar.ally{background:#15233a1f;}
  .mini-quickbar-label{font-size:9px;font-weight:950;color:#cbb98a;flex:0 0 auto;}
  .mini-quick-stat{display:flex;align-items:center;gap:2px;font-size:8px;color:#cfcfcf;white-space:nowrap;}
  .mini-quick-stat b{font-size:9px;font-weight:800;color:#fff;}
}

/* ---- 모바일 사전 설정 화면: "1.덱메뉴/2.전투" 2분할을 축소해
   전투메뉴만 기본 노출하고, 상점·부스터팩·2인플레이·편집은 ⚙(고급 설정)
   패널 안으로 접어 넣어 화면을 더 간결하게 만든다. ---- */
@media (max-width:850px){
  #mobileAdvancedSetup #mobileDeckMenu{grid-column:1/-1!important;margin-bottom:6px!important;}
}

/* ---- (5) 전투필드 폭은 유지하고, 나머지(로그인 모달 등) 폭을
   핸드카드 화면(.right-hand-section) 기준 폭에 맞춘다. PC 기준. ---- */
@media (min-width:851px){
  #loginModal .modalbox.auth-modalbox{
    width:min(420px, var(--hand-card-width,106px) * 3 + 60px)!important;
    max-width:92vw!important;
  }
}


/* ---- assets/css/v181_user_request_fix.css ---- */
/* ================================================================
   v181 — 요청사항 1~5: 전투열 간격, 본진 전투열, 책사 스킬,
   본진 버프 대상, 모바일 하단 배치 보정
   ================================================================ */

/* 1) 고정 그리드 행 수와 실제 DOM 행 수가 달라 생기던 무점령지/아군 2열 겹침 제거.
   전투 보드는 실제 자식 높이대로 흐르는 세로 flex로 배치한다. */
body:not(.prebattle) .boardwrap{
  overflow-x:hidden!important;
  overflow-y:auto!important;
}
body:not(.prebattle) .battlefield-layout>.board{
  display:flex!important;
  flex-direction:column!important;
  justify-content:flex-start!important;
  align-content:initial!important;
  height:auto!important;
  min-height:100%!important;
  gap:5px!important;
}
body:not(.prebattle) .battlefield-layout>.board>.lane,
body:not(.prebattle) .battlefield-layout>.board>.hq-battle-row{
  position:relative!important;
  flex:0 0 auto!important;
}
body:not(.prebattle) .battlefield-layout>.board>.neutral-lane{
  position:relative!important;
  z-index:1!important;
  margin:5px 0!important;
  clear:both!important;
}
body:not(.prebattle) .battlefield-layout>.board>.lane[data-row="a2"]{
  position:relative!important;
  z-index:1!important;
}

/* PC에서는 모든 일반 전투열이 카드 한 장을 완전히 감싸도록 고정한다. */
@media (min-width:851px){
  body:not(.prebattle) .battlefield-layout>.board>.lane:not(.hq-defense-lane){
    box-sizing:border-box!important;
    height:calc(var(--hand-card-height,138px) + 10px)!important;
    min-height:calc(var(--hand-card-height,138px) + 10px)!important;
    max-height:none!important;
    overflow:hidden!important;
  }
  body:not(.prebattle) .battlefield-layout>.board>.lane:not(.hq-defense-lane)>.slots{
    height:var(--hand-card-height,138px)!important;
    min-height:var(--hand-card-height,138px)!important;
    max-height:var(--hand-card-height,138px)!important;
  }
  body:not(.prebattle) .battlefield-layout>.board>.lane:not(.hq-defense-lane)>.slots>.slot,
  body:not(.prebattle) .battlefield-layout>.board>.lane:not(.hq-defense-lane)>.slots>.slot>.unit{
    height:var(--hand-card-height,138px)!important;
    min-height:var(--hand-card-height,138px)!important;
    max-height:var(--hand-card-height,138px)!important;
  }
}

/* 2) 본진 전투열도 일반 전투열과 같은 카드 크기/실선 슬롯을 사용한다. */
body:not(.prebattle) .hq-defense-lane.active{
  box-sizing:border-box!important;
  display:block!important;
  height:calc(var(--hand-card-height,138px) + 10px)!important;
  min-height:calc(var(--hand-card-height,138px) + 10px)!important;
  max-height:none!important;
  padding:4px 6px!important;
  overflow:hidden!important;
}
body:not(.prebattle) .hq-defense-lane .hq-battlefield-grid{
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:repeat(5,var(--hand-card-width,106px))!important;
  grid-template-rows:var(--hand-card-height,138px)!important;
  grid-auto-rows:var(--hand-card-height,138px)!important;
  width:max-content!important;
  max-width:100%!important;
  height:var(--hand-card-height,138px)!important;
  min-height:var(--hand-card-height,138px)!important;
  max-height:var(--hand-card-height,138px)!important;
  gap:7px!important;
  margin:0 auto!important;
  padding:0 3px 2px!important;
  align-items:stretch!important;
  justify-content:start!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:thin;
}
body:not(.prebattle) .hq-defense-lane .hq-field-slot{
  box-sizing:border-box!important;
  width:var(--hand-card-width,106px)!important;
  min-width:var(--hand-card-width,106px)!important;
  max-width:var(--hand-card-width,106px)!important;
  height:var(--hand-card-height,138px)!important;
  min-height:var(--hand-card-height,138px)!important;
  max-height:var(--hand-card-height,138px)!important;
  padding:0!important;
  border:1px solid #765b36!important;
  border-style:solid!important;
  border-radius:7px!important;
  background:linear-gradient(180deg,#17120de6,#0d0a08e8)!important;
  overflow:hidden!important;
}
body:not(.prebattle) .hq-defense-lane .hq-field-slot.empty::after{
  content:none!important;
}
body:not(.prebattle) .hq-defense-lane .hq-field-slot.empty>span{
  color:#bda57b80!important;
  font-size:10px!important;
  font-weight:800!important;
}
body:not(.prebattle) .hq-defense-lane .hq-field-slot>.unit{
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  height:100%!important;
  min-height:100%!important;
  max-height:100%!important;
  border-radius:6px!important;
}

/* 책사 칸은 크기만 동일하게 유지하고 보라/청색 계열로 구분한다. */
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot{
  border-color:#a899ff!important;
  background:linear-gradient(180deg,#292242f0,#12182ce8)!important;
  box-shadow:inset 0 0 0 1px #c4baff44,0 0 10px #7767d933!important;
}
body:not(.prebattle) .hq-advisor-field-slot .hq-advisor-slot,
body:not(.prebattle) .hq-advisor-field-slot .advisor{
  box-sizing:border-box!important;
  position:static!important;
  inset:auto!important;
  display:flex!important;
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  height:100%!important;
  min-height:100%!important;
  max-height:100%!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:6px!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:hidden!important;
}
body:not(.prebattle) .hq-advisor-field-slot .advisor-card,
body:not(.prebattle) .hq-advisor-field-slot .advisor-image-only,
body:not(.prebattle) .hq-advisor-field-slot .advisor-portrait{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  height:100%!important;
  min-height:100%!important;
  max-height:100%!important;
}
body:not(.prebattle) .hq-advisor-field-slot .advisor-empty{
  width:100%!important;
  height:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  color:#e4ddff!important;
  font-weight:900!important;
  letter-spacing:.04em!important;
}

/* 본진 카드도 버프 대상 강조를 일반 필드와 동일하게 보이게 한다. */
body:not(.prebattle) .hq-field-slot.supportable{
  outline:3px solid #58e2d0!important;
  box-shadow:0 0 0 5px #58e2d02e,0 0 20px #58e2d033!important;
}
body:not(.prebattle) .hq-field-slot.buff-cancel-source,
body:not(.prebattle) .hq-field-slot .support-buff-caster{
  outline:3px solid #ffd867!important;
  box-shadow:0 0 0 4px #ffd86730,0 0 18px #ffd86744!important;
}

/* 5) 모바일: 하단 아군 본진 이미지 박스는 제거하고, 핸드는 화면 맨 아래에 고정한다. */
body.ui-mode-mobile:not(.prebattle) .mobile-ally-hq-mount,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-ally-hq-mount{
  display:none!important;
  visibility:hidden!important;
  position:static!important;
  width:0!important;
  min-width:0!important;
  max-width:0!important;
  height:0!important;
  min-height:0!important;
  max-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
}

@media (max-width:850px){
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount{
    display:block!important;
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    transform:none!important;
    width:100%!important;
    max-width:none!important;
    z-index:96!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud{
    display:block!important;
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:var(--v120-hand-height,var(--mobile-hand-float-height,174px))!important;
    width:100%!important;
    height:46px!important;
    min-height:46px!important;
    max-height:46px!important;
    padding:4px 6px!important;
    z-index:95!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .hud-status{
    display:block!important;
    height:100%!important;
    padding:0!important;
    background:transparent!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .hud-status>:not(.hud-actions){display:none!important;}
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .hud-actions{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:5px!important;
    width:100%!important;
    height:100%!important;
    min-width:0!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .hud-actions .btn{
    min-height:36px!important;
    height:36px!important;
    padding:3px 5px!important;
    font-size:10px!important;
  }
  body.ui-mode-mobile:not(.prebattle),
  body.ui-mode-mobile:not(.prebattle) .app{
    padding-bottom:calc(var(--v120-hand-height,var(--mobile-hand-float-height,174px)) + 54px + env(safe-area-inset-bottom,0px))!important;
  }
}

/* 데스크톱에서 보는 모바일 미리보기에도 같은 하단 도킹 규칙 적용. */
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount{
  display:block!important;
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  bottom:0!important;
  transform:translateX(-50%)!important;
  width:var(--mobile-play-width,430px)!important;
  max-width:var(--mobile-play-width,430px)!important;
  z-index:96!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud{
  display:block!important;
  position:fixed!important;
  left:50%!important;
  right:auto!important;
  bottom:var(--v120-hand-height,var(--mobile-hand-float-height,174px))!important;
  transform:translateX(-50%)!important;
  width:var(--mobile-play-width,430px)!important;
  height:46px!important;
  min-height:46px!important;
  max-height:46px!important;
  padding:4px 6px!important;
  z-index:95!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .hud-status{
  display:block!important;
  height:100%!important;
  padding:0!important;
  background:transparent!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .hud-status>:not(.hud-actions){display:none!important;}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .hud-actions{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:5px!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .hud-actions .btn{
  min-height:36px!important;
  height:36px!important;
  padding:3px 5px!important;
  font-size:10px!important;
}
body.ui-mode-mobile-preview:not(.prebattle),
body.ui-mode-mobile-preview:not(.prebattle) .app{
  padding-bottom:calc(var(--v120-hand-height,var(--mobile-hand-float-height,174px)) + 54px)!important;
}


/* ---- assets/css/v182_mobile_base_ratio_fix.css ---- */
/* ================================================================
   v182 — 모바일 본진 전투열 5장 기준 카드 비율 유지
   ================================================================
   본진 전투열은 모바일 화면 너비를 5등분하되, 필드 카드와 같은
   가로:세로 비율(1 : 1.767)을 사용한다. 이전 패치의 고정 높이를
   제거하여 화면이 좁아질 때 세로만 늘어나는 현상을 방지한다.
   ================================================================ */

@media (max-width:850px){
  body.ui-mode-mobile:not(.prebattle),
  body.ui-mode-mobile-preview:not(.prebattle){
    --v182-hq-card-ratio:1.767;
    --v182-hq-grid-gap:4px;
  }

  body.ui-mode-mobile:not(.prebattle) .hq-defense-lane.active,
  body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane.active{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    padding:4px 5px!important;
    overflow:hidden!important;
  }

  body.ui-mode-mobile:not(.prebattle) .hq-defense-lane .hq-battlefield-grid,
  body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane .hq-battlefield-grid{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    grid-template-rows:auto!important;
    grid-auto-rows:auto!important;
    width:min(100%,430px)!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    gap:var(--v182-hq-grid-gap)!important;
    margin:0 auto!important;
    padding:0!important;
    align-items:start!important;
    justify-content:center!important;
    overflow:visible!important;
  }

  body.ui-mode-mobile:not(.prebattle) .hq-defense-lane .hq-field-slot,
  body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane .hq-field-slot{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    aspect-ratio:1 / var(--v182-hq-card-ratio)!important;
    align-self:start!important;
  }

  body.ui-mode-mobile:not(.prebattle) .hq-defense-lane .hq-field-slot>.unit,
  body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane .hq-field-slot>.unit{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    grid-template-rows:15.2% minmax(0,1fr) 17.7%!important;
  }

  body.ui-mode-mobile:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .hq-advisor-slot,
  body.ui-mode-mobile:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor,
  body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .hq-advisor-slot,
  body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
  }

  body.ui-mode-mobile:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-card,
  body.ui-mode-mobile:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-image-only,
  body.ui-mode-mobile:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-portrait,
  body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-card,
  body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-image-only,
  body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-portrait{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
  }
}

/* 데스크톱에서 실행하는 모바일 미리보기는 창 너비가 850px보다 커도
   430px 플레이 영역을 사용하므로 동일한 5장 비율 규칙을 별도로 적용한다. */
body.ui-mode-mobile-preview:not(.prebattle){
  --v182-hq-card-ratio:1.767;
  --v182-hq-grid-gap:4px;
}
body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane.active{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  padding:4px 5px!important;
  overflow:hidden!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane .hq-battlefield-grid{
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  grid-template-rows:auto!important;
  grid-auto-rows:auto!important;
  width:min(100%,430px)!important;
  max-width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  gap:var(--v182-hq-grid-gap)!important;
  margin:0 auto!important;
  padding:0!important;
  align-items:start!important;
  justify-content:center!important;
  overflow:visible!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane .hq-field-slot{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:1 / var(--v182-hq-card-ratio)!important;
  align-self:start!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane .hq-field-slot>.unit{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:100%!important;
  grid-template-rows:15.2% minmax(0,1fr) 17.7%!important;
}


/* ---- assets/css/v186_left_unified_layout.css ---- */
/* v186 — PC 좌측 통합 전투 UI */

@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app{
    width:100%!important;
    height:100vh!important;
    min-height:720px!important;
    grid-template-columns:360px minmax(720px,1fr)!important;
    gap:4px!important;
    padding:4px!important;
    overflow:hidden!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .reference-left{
    grid-column:1!important;
    display:flex!important;
    flex-direction:column!important;
    height:calc(100vh - 8px)!important;
    min-height:0!important;
    padding:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    scrollbar-width:thin;
    background:linear-gradient(180deg,#070b0e,#0b1013 52%,#06090b)!important;
    border:1px solid #6f4d25!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel{
    grid-column:2!important;
    width:auto!important;
    min-width:0!important;
    height:calc(100vh - 8px)!important;
    min-height:0!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .reference-right{
    display:none!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-panel{order:1}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-menu-dock{order:2}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-setup-host{order:3}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host{order:4}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host{order:5}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hq-utility-section{order:6}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{order:7}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-bottom-actions{order:8}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .desktop-ui-mode-switch{order:9}
  body.unified-left-layout:not(.ui-mode-mobile-preview) #desktopOnlineMatchInfo{order:10}
  body.unified-left-layout:not(.ui-mode-mobile-preview) #desktopMatchWaitingNotice{order:11}

  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-status-frame,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-log-frame{
    display:none!important;
  }

  /* 로그인 필수 상태에서도 좌측 로그인 폼만 활성화한다. */
  body.login-required.unified-left-layout:not(.ui-mode-mobile-preview) .app{
    pointer-events:auto!important;
    user-select:auto!important;
    filter:none!important;
  }
  body.login-required.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel,
  body.login-required.unified-left-layout:not(.ui-mode-mobile-preview) .reference-left>:not(.left-auth-panel){
    pointer-events:none!important;
    user-select:none!important;
    filter:brightness(.44) saturate(.65)!important;
  }
  body.login-required.unified-left-layout:not(.ui-mode-mobile-preview) #loginModal{
    display:none!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }

  /* 간편 로그인 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-panel{
    flex:0 0 auto!important;
    padding:0 7px 7px!important;
    background:linear-gradient(180deg,#111920,#080d10)!important;
    border-bottom:1px solid #67451f!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-panel .ornate-title{
    margin:0 -7px 6px!important;
    min-height:27px!important;
    font-size:13px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-fields{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,.72fr)!important;
    gap:5px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-panel input[type="email"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-panel input[type="password"]{
    width:100%!important;
    min-width:0!important;
    height:30px!important;
    padding:4px 7px!important;
    border:1px solid #705432!important;
    border-radius:3px!important;
    background:#05090c!important;
    color:#f2eadc!important;
    font-size:11px!important;
    outline:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-panel input:focus{
    border-color:#c3924b!important;
    box-shadow:0 0 0 2px #c3924b22!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-remember{
    display:flex!important;
    align-items:center!important;
    gap:5px!important;
    margin:5px 0!important;
    color:#cfc1a8!important;
    font-size:10px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr 1fr!important;
    gap:4px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-logged-out[hidden]{display:none!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-actions .btn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-subpanel .btn{
    min-height:29px!important;
    padding:4px 5px!important;
    font-size:10px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-actions .btn.active{
    border-color:#d4a454!important;
    color:#ffe8bb!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-subpanel{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:5px!important;
    margin-top:6px!important;
    padding-top:6px!important;
    border-top:1px solid #4c351d!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-subpanel[hidden]{display:none!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-logged-in{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    min-height:36px!important;
    color:#bfe8c7!important;
    font-size:11px!important;
    font-weight:800!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-logged-in[hidden]{display:none!important}

  /* 전투 메뉴 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-menu-dock{
    flex:0 0 auto!important;
    padding:0 7px 7px!important;
    border:0!important;
    border-bottom:1px solid #5b3e20!important;
    background:#080d10!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-menu-dock>.ornate-title{
    margin:0 -7px 6px!important;
    min-height:27px!important;
    font-size:13px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .reference-topbar{
    position:static!important;
    inset:auto!important;
    display:block!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    padding:0!important;
    margin:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .top-options{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:5px!important;
    width:100%!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .top-options .btn{
    width:100%!important;
    min-width:0!important;
    min-height:31px!important;
    padding:4px!important;
    font-size:10px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .online-account-bar{
    display:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .faction-pickers{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:5px!important;
    margin-top:5px!important;
    font-size:9px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .faction-pickers span{
    min-width:0!important;
    padding:4px 5px!important;
    text-align:center!important;
    border:1px solid #46351f!important;
    background:#0b1013!important;
  }

  /* 전투 설정 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-setup-host{
    flex:0 0 auto!important;
    min-height:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-setup-host .compact-settings-holder{
    display:block!important;
    width:100%!important;
    margin:0!important;
    padding:0 7px 7px!important;
    border:0!important;
    border-bottom:1px solid #5b3e20!important;
    background:#080d10!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-setup-host .ornate-title{
    margin:0 -7px 6px!important;
    min-height:27px!important;
    font-size:13px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .formation-control>span{
    display:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .formation-inline{
    display:grid!important;
    grid-template-columns:67px minmax(0,1fr) 65px!important;
    gap:5px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .formation-inline select,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .formation-inline .btn{
    min-width:0!important;
    width:100%!important;
    height:31px!important;
    padding:3px 5px!important;
    font-size:9px!important;
  }

  /* 게임 시작 / 셔플 / 턴 종료 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host{
    display:grid!important;
    grid-template-columns:1.2fr .8fr 1fr!important;
    gap:5px!important;
    flex:0 0 auto!important;
    padding:6px 7px!important;
    border-bottom:1px solid #5b3e20!important;
    background:#0b1013!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host .btn{
    width:100%!important;
    min-width:0!important;
    min-height:32px!important;
    padding:4px!important;
    font-size:10px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host .deck-info{display:none!important}

  /* 적군/아군 본진 상태: 작게 나란히 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host{
    flex:0 0 auto!important;
    padding:6px 7px!important;
    border-bottom:1px solid #5b3e20!important;
    background:#080d10!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .battle-status-pair{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:5px!important;
    width:100%!important;
    margin:0!important;
    padding:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar{
    position:relative!important;
    display:block!important;
    min-width:0!important;
    min-height:98px!important;
    padding:0 5px 20px!important;
    border:1px solid #72502b!important;
    border-radius:4px!important;
    overflow:hidden!important;
    cursor:pointer!important;
    box-shadow:inset 0 0 14px #0009!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .enemy-quickbar{
    background:linear-gradient(180deg,#3c1718,#13090a)!important;
    border-color:#a25656!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .ally-quickbar{
    background:linear-gradient(180deg,#172a42,#08101b)!important;
    border-color:#547fb1!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar:focus,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar:hover{
    outline:none!important;
    filter:brightness(1.12)!important;
    box-shadow:inset 0 0 14px #0008,0 0 0 2px #d6ab6533!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar-title{
    height:25px!important;
    margin:0 -5px 5px!important;
    padding:5px 6px!important;
    overflow:hidden!important;
    white-space:nowrap!important;
    text-overflow:ellipsis!important;
    font-size:10px!important;
    line-height:15px!important;
    text-align:center!important;
    color:#f4e6cf!important;
    border-bottom:1px solid #ffffff22!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar-stats{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:3px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-stat{
    position:relative!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:0!important;
    min-height:29px!important;
    padding:11px 2px 2px!important;
    border:1px solid #ffffff1c!important;
    background:#05080ba6!important;
    font-size:9px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-stat::before{
    content:attr(data-stat-label)!important;
    position:absolute!important;
    top:2px!important;
    left:0!important;
    right:0!important;
    color:#aeb8c2!important;
    font-size:6px!important;
    font-weight:900!important;
    letter-spacing:.05em!important;
    text-align:center!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-stat:nth-child(4),
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-stat:nth-child(5){
    grid-column:span 1!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-icon{
    display:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-stat b{
    min-width:0!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    color:#fff!important;
    font-size:9px!important;
    line-height:1!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .hq-quickbar-hint{
    position:absolute!important;
    left:5px!important;
    right:5px!important;
    bottom:4px!important;
    color:#cfc3af!important;
    font-size:7px!important;
    text-align:center!important;
    opacity:.85!important;
  }

  /* 필요할 때만 펼치는 아군 본진/책사 기능 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hq-utility-section{
    flex:0 0 auto!important;
    padding:5px 7px 7px!important;
    border-bottom:1px solid #5b3e20!important;
    background:#070b0e!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hq-utility-section[hidden]{display:none!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hq-utility-head{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    margin-bottom:5px!important;
    color:#e9d8b8!important;
    font-size:10px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hq-utility-head .btn{
    min-height:25px!important;
    padding:2px 8px!important;
    font-size:9px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hq-utility-host .enemy-hq-row{
    display:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hq-utility-host .ally-hq-row{
    display:block!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hq-utility-host .battle-hq{
    width:100%!important;
    height:184px!important;
    min-height:184px!important;
    max-height:184px!important;
    margin:0!important;
    border-radius:5px!important;
  }

  /* 아군 핸드 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{
    flex:0 0 auto!important;
    min-height:344px!important;
    padding:0!important;
    border-bottom:1px solid #5b3e20!important;
    background:#070b0e!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:344px!important;
    min-height:344px!important;
    max-height:344px!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    border:0!important;
    background:#080c0d!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section>.ornate-title{
    display:flex!important;
    flex:0 0 28px!important;
    height:28px!important;
    min-height:28px!important;
    font-size:12px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .handbox{
    display:flex!important;
    flex:1 1 auto!important;
    min-height:0!important;
    height:auto!important;
    padding:5px!important;
    overflow:hidden!important;
    border:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .handhead{
    display:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,150px)!important;
    grid-auto-rows:150px!important;
    gap:4px!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    padding:0 2px 2px 0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    align-content:start!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    width:100%!important;
    height:150px!important;
    min-width:0!important;
    min-height:150px!important;
    max-height:150px!important;
    margin:0!important;
    grid-template-rows:24px minmax(70px,1fr) auto!important;
    border-radius:4px!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card-title-area{
    min-height:24px!important;
    padding:3px 4px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card-name-text{
    font-size:9px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card-title-grade{
    min-width:25px!important;
    padding:1px 3px!important;
    font-size:7px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card-stat-cell{
    min-height:26px!important;
    padding:2px 1px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card-stat-cell b{
    font-size:10px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card-stat-cell span{
    font-size:6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card-hover-tooltip{
    display:none!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-bottom-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:5px!important;
    flex:0 0 auto!important;
    padding:6px 7px!important;
    border-top:0!important;
    background:#080d10!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-bottom-actions .btn{
    width:100%!important;
    min-height:30px!important;
    font-size:10px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .desktop-ui-mode-switch{
    flex:0 0 auto!important;
    margin:0!important;
    padding:5px 7px!important;
  }

  /* 오른쪽 패널에 있던 보조 덱 박스는 상태 CARD 값으로 대체한다. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .right-deck-section,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .right-action-strip{
    display:none!important;
  }
}

@media (min-width:851px) and (max-height:850px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app{grid-template-columns:342px minmax(680px,1fr)!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-panel{padding-bottom:5px!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:304px!important;
    min-height:304px!important;
    max-height:304px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-rows:repeat(2,130px)!important;
    grid-auto-rows:130px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    height:130px!important;
    min-height:130px!important;
    max-height:130px!important;
  }
}

/* v187 — 화면 비율 안정화 / 전체화면 사용 억제 / 스크롤바 숨김 */
@media (min-width:851px){
  html,
  body,
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    overflow:hidden!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .app{
    width:min(1088px,calc(100vw - 16px))!important;
    max-width:1088px!important;
    height:min(920px,calc(100vh - 16px))!important;
    min-height:720px!important;
    margin:8px 0 8px 8px!important;
    padding:0!important;
    gap:8px!important;
    grid-template-columns:308px minmax(0,772px)!important;
    justify-content:start!important;
    align-items:stretch!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .reference-left,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel{
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .reference-left{
    overflow-x:hidden!important;
    overflow-y:auto!important;
    scrollbar-width:none!important;
    -ms-overflow-style:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .reference-left::-webkit-scrollbar,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .handbox::-webkit-scrollbar,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand::-webkit-scrollbar{
    width:0!important;
    height:0!important;
    display:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .handbox,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    scrollbar-width:none!important;
    -ms-overflow-style:none!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel{
    width:100%!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap{
    width:100%!important;
    max-width:100%!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout{
    width:100%!important;
    max-width:none!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:4px 6px 6px!important;
    gap:6px!important;
    grid-template-rows:122px 96px 96px 126px 96px 96px 122px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battle-row{
    min-height:0!important;
    height:100%!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane{
    padding:3px 6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots{
    min-height:0!important;
    height:100%!important;
    gap:5px!important;
    align-items:stretch!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot{
    min-height:86px!important;
    height:100%!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{
    min-height:330px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:330px!important;
    min-height:330px!important;
    max-height:330px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-rows:repeat(2,143px)!important;
    grid-auto-rows:143px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    height:143px!important;
    min-height:143px!important;
    max-height:143px!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app{
    width:min(1048px,calc(100vw - 12px))!important;
    max-width:1048px!important;
    height:min(860px,calc(100vh - 12px))!important;
    margin:6px 0 6px 6px!important;
    gap:6px!important;
    grid-template-columns:296px minmax(0,746px)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    padding:4px 5px 5px!important;
    gap:5px!important;
    grid-template-rows:114px 90px 90px 116px 90px 90px 114px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot{
    min-height:80px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:300px!important;
    min-height:300px!important;
    max-height:300px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-rows:repeat(2,128px)!important;
    grid-auto-rows:128px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    height:128px!important;
    min-height:128px!important;
    max-height:128px!important;
  }
}

/* v188 — 전투 시작 시 필드 공백/행 붕괴 수정 */
@media (min-width:851px){
  /* v187의 고정 7행 그리드 대신, 실제 표시되는 행 수에 따라 유연하게 배치 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-start!important;
    align-items:stretch!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    padding:4px 6px 6px!important;
    gap:5px!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .enemy-hq-row{
    flex:0 0 84px!important;
    min-height:84px!important;
    height:84px!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    flex:0 0 72px!important;
    min-height:72px!important;
    height:72px!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"]{
    flex:1 1 0!important;
    min-height:84px!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane{
    flex:0 0 110px!important;
    min-height:110px!important;
    height:110px!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battle-row{
    width:100%!important;
    min-height:0!important;
    box-sizing:border-box!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane{
    padding:3px 6px!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    gap:5px!important;
    align-items:stretch!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot{
    height:100%!important;
    min-height:74px!important;
    max-height:none!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .unit{
    height:100%!important;
    min-height:0!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .enemy-hq-row{
    flex-basis:78px!important;
    min-height:78px!important;
    height:78px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    flex-basis:66px!important;
    min-height:66px!important;
    height:66px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane{
    flex-basis:96px!important;
    min-height:96px!important;
    height:96px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"]{
    min-height:76px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot{
    min-height:68px!important;
  }
}

/* v189 — 핸드/필드 카드 크기 통일 + 전투열 높이 정렬 + 본진진영 스크롤바 제거 */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v189-card-w:92px;
    --v189-card-h:124px;
    --v189-card-gap:6px;
    --v189-hand-title-h:28px;
  }

  /* 아군 핸드: 6장이 한 화면에 정확히 보이는 3x2 고정 비율 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{
    min-height:calc(var(--v189-hand-title-h) + (var(--v189-card-h) * 2) + var(--v189-card-gap) + 14px)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:calc(var(--v189-hand-title-h) + (var(--v189-card-h) * 2) + var(--v189-card-gap) + 14px)!important;
    min-height:calc(var(--v189-hand-title-h) + (var(--v189-card-h) * 2) + var(--v189-card-gap) + 14px)!important;
    max-height:calc(var(--v189-hand-title-h) + (var(--v189-card-h) * 2) + var(--v189-card-gap) + 14px)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section>.ornate-title{
    flex:0 0 var(--v189-hand-title-h)!important;
    height:var(--v189-hand-title-h)!important;
    min-height:var(--v189-hand-title-h)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .handbox{
    padding:6px!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-columns:repeat(3,var(--v189-card-w))!important;
    grid-template-rows:repeat(2,var(--v189-card-h))!important;
    grid-auto-rows:var(--v189-card-h)!important;
    justify-content:center!important;
    align-content:start!important;
    gap:var(--v189-card-gap)!important;
    width:100%!important;
    height:100%!important;
    padding:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    scrollbar-width:none!important;
    -ms-overflow-style:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    width:var(--v189-card-w)!important;
    min-width:var(--v189-card-w)!important;
    max-width:var(--v189-card-w)!important;
    height:var(--v189-card-h)!important;
    min-height:var(--v189-card-h)!important;
    max-height:var(--v189-card-h)!important;
    margin:0!important;
  }

  /* 전투 보드: 본진을 제외한 모든 전투열 높이를 균일하게 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-start!important;
    align-items:stretch!important;
    gap:6px!important;
    padding:4px 6px 6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .enemy-hq-row{
    flex:0 0 84px!important;
    min-height:84px!important;
    height:84px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    flex:1 1 0!important;
    min-height:92px!important;
    height:auto!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battle-row{
    width:100%!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane{
    padding:3px 6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane .label{
    font-size:12px!important;
    font-weight:800!important;
  }

  /* 전투 필드 카드 크기를 핸드 카드와 동일하게 통일 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    justify-content:center!important;
    align-items:stretch!important;
    align-content:center!important;
    gap:var(--v189-card-gap)!important;
    width:100%!important;
    min-height:0!important;
    overflow:hidden!important;
    scrollbar-width:none!important;
    -ms-overflow-style:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots::-webkit-scrollbar,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid::-webkit-scrollbar{
    width:0!important;
    height:0!important;
    display:none!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    grid-template-columns:repeat(4,var(--v189-card-w))!important;
    width:max-content!important;
    max-width:100%!important;
    margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    grid-template-columns:repeat(3,var(--v189-card-w))!important;
    width:max-content!important;
    max-width:100%!important;
    margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    grid-template-columns:repeat(2,var(--v189-card-w))!important;
    width:max-content!important;
    max-width:100%!important;
    margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    grid-template-columns:repeat(5,var(--v189-card-w))!important;
    width:max-content!important;
    max-width:100%!important;
    margin:0 auto!important;
    padding:0!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:var(--v189-card-w)!important;
    min-width:var(--v189-card-w)!important;
    max-width:var(--v189-card-w)!important;
    height:var(--v189-card-h)!important;
    min-height:var(--v189-card-h)!important;
    max-height:var(--v189-card-h)!important;
    margin:0!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .unit{
    height:100%!important;
    min-height:0!important;
    grid-template-rows:22px minmax(0,1fr) 22px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .uimg{
    height:100%!important;
    min-height:0!important;
  }

  /* 본진 진영 내부 스크롤바 제거 및 높이 안정화 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-defense-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .enemy-hq-defense-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .ally-hq-defense-lane{
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .enemy-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .ally-hq-defense-lane .hq-battlefield-grid{
    height:var(--v189-card-h)!important;
    min-height:var(--v189-card-h)!important;
    max-height:var(--v189-card-h)!important;
    border:0!important;
    border-radius:6px!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-defense-lane .hq-field-slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .enemy-hq-defense-lane .hq-field-slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .ally-hq-defense-lane .hq-field-slot{
    border-width:1px!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v189-card-w:88px;
    --v189-card-h:118px;
    --v189-card-gap:5px;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .enemy-hq-row{
    flex-basis:78px!important;
    min-height:78px!important;
    height:78px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    min-height:86px!important;
  }
}

/* v190 — 전투열 높이·좌측 버튼 통일·본진상태 가독성·카드선 정리 */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v190-card-w:88px;
    --v190-card-h:116px;
    --v190-card-gap:6px;
    --v190-button-h:32px;
    --v190-button-fs:10px;
  }

  /* 1) 핸드 카드/전투필드 카드 공통 크기 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{
    min-height:calc(28px + (var(--v190-card-h) * 2) + var(--v190-card-gap) + 16px)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:calc(28px + (var(--v190-card-h) * 2) + var(--v190-card-gap) + 16px)!important;
    min-height:calc(28px + (var(--v190-card-h) * 2) + var(--v190-card-gap) + 16px)!important;
    max-height:calc(28px + (var(--v190-card-h) * 2) + var(--v190-card-gap) + 16px)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-columns:repeat(3,var(--v190-card-w))!important;
    grid-template-rows:repeat(2,var(--v190-card-h))!important;
    grid-auto-rows:var(--v190-card-h)!important;
    gap:var(--v190-card-gap)!important;
    justify-content:center!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    width:var(--v190-card-w)!important;
    min-width:var(--v190-card-w)!important;
    max-width:var(--v190-card-w)!important;
    height:var(--v190-card-h)!important;
    min-height:var(--v190-card-h)!important;
    max-height:var(--v190-card-h)!important;
  }

  /* 2) 전투필드 전투열 높이 확대 — 카드 하단 잘림 방지 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    gap:5px!important;
    padding:4px 6px 6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .enemy-hq-row{
    flex:0 0 84px!important;
    min-height:84px!important;
    height:84px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    flex:1 1 0!important;
    min-height:126px!important;
    height:auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane{
    padding:18px 6px 5px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane .label{
    top:3px!important;
    left:8px!important;
    font-size:12px!important;
    line-height:1!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    gap:var(--v190-card-gap)!important;
    justify-content:center!important;
    align-items:stretch!important;
    align-content:center!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{grid-template-columns:repeat(4,var(--v190-card-w))!important;width:max-content!important;margin:0 auto!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{grid-template-columns:repeat(3,var(--v190-card-w))!important;width:max-content!important;margin:0 auto!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{grid-template-columns:repeat(2,var(--v190-card-w))!important;width:max-content!important;margin:0 auto!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{grid-template-columns:repeat(5,var(--v190-card-w))!important;width:max-content!important;max-width:100%!important;margin:0 auto!important;padding:0!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:var(--v190-card-w)!important;
    min-width:var(--v190-card-w)!important;
    max-width:var(--v190-card-w)!important;
    height:var(--v190-card-h)!important;
    min-height:var(--v190-card-h)!important;
    max-height:var(--v190-card-h)!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .unit{
    height:100%!important;
    min-height:0!important;
    grid-template-rows:24px minmax(0,1fr) 28px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .uimg{
    height:100%!important;
    min-height:0!important;
  }

  /* 3) 좌측 버튼 높이/글씨크기 통일 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .top-options .btn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .formation-inline .btn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .formation-inline select,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host .btn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-bottom-actions .btn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-login-host .btn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .auth-actions .btn{
    height:var(--v190-button-h)!important;
    min-height:var(--v190-button-h)!important;
    max-height:var(--v190-button-h)!important;
    padding:4px 8px!important;
    font-size:var(--v190-button-fs)!important;
    line-height:1.1!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .top-options .btn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-bottom-actions .btn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host .btn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .formation-inline .btn{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
  }

  /* 4) 본진 상태 박스 가독성 향상 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar{
    min-height:112px!important;
    padding:0 6px 23px!important;
    border-radius:5px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar-title{
    height:28px!important;
    margin:0 -6px 6px!important;
    padding:6px 6px!important;
    font-size:11px!important;
    font-weight:900!important;
    line-height:16px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar-stats{
    gap:4px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-stat{
    min-height:34px!important;
    padding:13px 2px 3px!important;
    font-size:10px!important;
    border-radius:3px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-stat::before{
    top:2px!important;
    font-size:7px!important;
    color:#cad4de!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-stat b{
    font-size:12px!important;
    font-weight:1000!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .hq-quickbar-hint{
    font-size:8px!important;
    bottom:5px!important;
  }

  /* 5) 아이템 카드 능력치 표기: 공/방/체 +수치 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .card-stat-grid{
    grid-template-columns:1fr!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .card-stat-cell{
    border-right:0!important;
    border-bottom:1px solid rgba(255,255,255,.12)!important;
    justify-content:flex-start!important;
    padding:0 6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .card-stat-cell:last-child{
    border-bottom:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .card-stat-cell b{
    font-size:11px!important;
    color:#fff2bd!important;
    letter-spacing:.01em!important;
  }

  /* 6) 카드 테두리 얇게, 사용 가능 상태도 굵기 동일 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .hq-field-slot .base-unit{
    border-width:1px!important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.06),0 2px 7px rgba(0,0,0,.55)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card.grade-border-SSS,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .unit.grade-border-SSS,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .base-unit.grade-border-SSS,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card.grade-border-SS,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .unit.grade-border-SS,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .base-unit.grade-border-SS,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card.grade-border-S,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .unit.grade-border-S,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .base-unit.grade-border-S,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card.grade-border-RR,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .unit.grade-border-RR,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .base-unit.grade-border-RR,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card.grade-border-R,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .unit.grade-border-R,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .base-unit.grade-border-R,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card.grade-border-U,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .unit.grade-border-U,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .base-unit.grade-border-U,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card.grade-border-C,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .unit.grade-border-C,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .base-unit.grade-border-C{
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.05),0 2px 7px rgba(0,0,0,.55)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.affordable,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.actionable-card:not(.opening-hand-card){
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.14),0 0 10px rgba(255,255,255,.08),0 2px 7px rgba(0,0,0,.55)!important;
    transform:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.affordable{
    border-color:var(--card-accent,#d6e5f8)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.actionable-card:not(.opening-hand-card){
    border-color:color-mix(in srgb,var(--card-accent,#9de3aa) 78%, white 22%)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.affordable:not(.selected)::after{
    inset:1px!important;
    border-width:1px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .slot.valid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .slot.supportable,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .slot.movable,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .slot.attackable{
    outline:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .slot.valid{box-shadow:inset 0 0 0 1px #9fd9ff,0 0 8px rgba(159,217,255,.30)!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .slot.supportable{box-shadow:inset 0 0 0 1px #a8efc2,0 0 8px rgba(168,239,194,.28)!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .slot.movable{box-shadow:inset 0 0 0 1px #f6d88a,0 0 8px rgba(246,216,138,.28)!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .slot.attackable{box-shadow:inset 0 0 0 1px #ffaaa0,0 0 8px rgba(255,170,160,.30)!important}

  /* 7) 본진 진영 내부 스크롤 방지 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .enemy-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .ally-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .hq-defense-lane .hq-battlefield-grid{
    height:var(--v190-card-h)!important;
    min-height:var(--v190-card-h)!important;
    max-height:var(--v190-card-h)!important;
    overflow:hidden!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v190-card-w:84px;
    --v190-card-h:110px;
    --v190-card-gap:5px;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    min-height:120px!important;
  }
}

/* v191 — 전투열 카드 위치 재정렬 / 카드 비율 2:3.1 고정 / 좌우 빈 공간 축소 */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v191-card-w:78px;
    --v191-card-h:121px; /* 2 : 3.1 비율 */
    --v191-card-gap:6px;
    --v191-lane-label-h:16px;
  }

  /* 핸드 카드도 동일 비율 고정 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{
    min-height:calc(28px + (var(--v191-card-h) * 2) + var(--v191-card-gap) + 16px)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:calc(28px + (var(--v191-card-h) * 2) + var(--v191-card-gap) + 16px)!important;
    min-height:calc(28px + (var(--v191-card-h) * 2) + var(--v191-card-gap) + 16px)!important;
    max-height:calc(28px + (var(--v191-card-h) * 2) + var(--v191-card-gap) + 16px)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-columns:repeat(3,var(--v191-card-w))!important;
    grid-template-rows:repeat(2,var(--v191-card-h))!important;
    grid-auto-rows:var(--v191-card-h)!important;
    gap:var(--v191-card-gap)!important;
    justify-content:center!important;
    align-content:start!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    width:var(--v191-card-w)!important;
    min-width:var(--v191-card-w)!important;
    max-width:var(--v191-card-w)!important;
    height:var(--v191-card-h)!important;
    min-height:var(--v191-card-h)!important;
    max-height:var(--v191-card-h)!important;
    aspect-ratio:2 / 3.1!important;
  }

  /* 전투 보드: 행과 카드 위치 재정렬 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    gap:4px!important;
    padding:4px 4px 6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .enemy-hq-row{
    flex:0 0 82px!important;
    min-height:82px!important;
    height:82px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    flex:1 1 0!important;
    min-height:137px!important;
    height:auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battle-row{
    width:100%!important;
    box-sizing:border-box!important;
    min-height:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane{
    padding:16px 3px 3px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane .label{
    top:2px!important;
    left:6px!important;
    font-size:12px!important;
    line-height:1!important;
  }

  /* 카드가 열 내부에서 중앙에 뜨지 않도록 상단 정렬하고, 좌우 빈 여백은 최소화 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    display:flex!important;
    width:100%!important;
    height:auto!important;
    min-height:var(--v191-card-h)!important;
    max-height:none!important;
    justify-content:space-between!important;
    align-items:flex-start!important;
    align-content:flex-start!important;
    gap:var(--v191-card-gap)!important;
    padding:0!important;
    margin:0!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4>.slot{flex:0 0 var(--v191-card-w)!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3>.slot{flex:0 0 var(--v191-card-w)!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2>.slot{flex:0 0 var(--v191-card-w)!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid>.hq-field-slot{flex:0 0 var(--v191-card-w)!important}

  /* 카드 비율 2:3.1 고정 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:var(--v191-card-w)!important;
    min-width:var(--v191-card-w)!important;
    max-width:var(--v191-card-w)!important;
    height:var(--v191-card-h)!important;
    min-height:var(--v191-card-h)!important;
    max-height:var(--v191-card-h)!important;
    aspect-ratio:2 / 3.1!important;
    margin:0!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot .base-unit{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .unit{
    grid-template-rows:22px minmax(0,1fr) 25px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .uimg{
    height:100%!important;
    min-height:0!important;
  }

  /* 본진 진영도 같은 규칙으로 정렬 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .enemy-hq-defense-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .ally-hq-defense-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .hq-defense-lane{
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .enemy-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .ally-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .hq-defense-lane .hq-battlefield-grid{
    min-height:var(--v191-card-h)!important;
    height:var(--v191-card-h)!important;
    max-height:var(--v191-card-h)!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v191-card-w:75px;
    --v191-card-h:116px;
    --v191-card-gap:5px;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    min-height:132px!important;
  }
}

/* v191 — 전투열 카드 위치 재정렬 / 2:3.1 비율 고정 / 좌우 여백 제거 */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v191-card-w:80px;
    --v191-card-h:124px; /* 2 : 3.1 비율 */
    --v191-card-gap:6px;
    --v191-lane-pad-x:4px;
    --v191-lane-pad-top:18px;
  }

  /* 핸드 카드도 동일 비율로 고정 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{
    min-height:calc(28px + (var(--v191-card-h) * 2) + var(--v191-card-gap) + 16px)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:calc(28px + (var(--v191-card-h) * 2) + var(--v191-card-gap) + 16px)!important;
    min-height:calc(28px + (var(--v191-card-h) * 2) + var(--v191-card-gap) + 16px)!important;
    max-height:calc(28px + (var(--v191-card-h) * 2) + var(--v191-card-gap) + 16px)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-columns:repeat(3,var(--v191-card-w))!important;
    grid-template-rows:repeat(2,var(--v191-card-h))!important;
    grid-auto-rows:var(--v191-card-h)!important;
    gap:var(--v191-card-gap)!important;
    justify-content:space-between!important;
    align-content:start!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    width:var(--v191-card-w)!important;
    min-width:var(--v191-card-w)!important;
    max-width:var(--v191-card-w)!important;
    height:var(--v191-card-h)!important;
    min-height:var(--v191-card-h)!important;
    max-height:var(--v191-card-h)!important;
  }

  /* 전투열 높이와 위치를 카드 비율 기준으로 재정렬 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    gap:4px!important;
    padding:4px 4px 6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    flex:0 0 auto!important;
    min-height:calc(var(--v191-card-h) + var(--v191-lane-pad-top) + 8px)!important;
    height:auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-defense-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .enemy-hq-defense-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .ally-hq-defense-lane{
    padding:var(--v191-lane-pad-top) var(--v191-lane-pad-x) 4px!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane .label,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-defense-lane .label,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .enemy-hq-defense-lane .label,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .ally-hq-defense-lane .label{
    top:2px!important;
    left:6px!important;
    font-size:12px!important;
    line-height:1!important;
  }

  /* 열 내부 좌우 여백 제거: 컨테이너 전체를 사용하고 카드군을 좌우 끝까지 분산 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    width:100%!important;
    max-width:none!important;
    min-height:var(--v191-card-h)!important;
    height:var(--v191-card-h)!important;
    padding:0!important;
    margin:0!important;
    justify-content:space-between!important;
    align-items:stretch!important;
    align-content:stretch!important;
    gap:var(--v191-card-gap)!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    display:grid!important;
    grid-template-columns:repeat(4,var(--v191-card-w))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    display:grid!important;
    grid-template-columns:repeat(3,var(--v191-card-w))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    display:grid!important;
    grid-template-columns:repeat(2,var(--v191-card-w))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    display:grid!important;
    grid-template-columns:repeat(5,var(--v191-card-w))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:var(--v191-card-w)!important;
    min-width:var(--v191-card-w)!important;
    max-width:var(--v191-card-w)!important;
    height:var(--v191-card-h)!important;
    min-height:var(--v191-card-h)!important;
    max-height:var(--v191-card-h)!important;
    aspect-ratio:2 / 3.1!important;
    margin:0!important;
    justify-self:stretch!important;
    align-self:stretch!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .base-unit{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
  }

  /* 본진 진영도 동일 비율/정렬로 맞춤 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .enemy-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .ally-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .hq-defense-lane .hq-battlefield-grid{
    height:var(--v191-card-h)!important;
    min-height:var(--v191-card-h)!important;
    max-height:var(--v191-card-h)!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v191-card-w:76px;
    --v191-card-h:118px;
    --v191-card-gap:5px;
  }
}

/* v192 — 카드 2.5:3.5 비율 / 핸드 이름 표시 / 아이템 표기 / 전투열 여백 재조정 */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v192-card-w:84px;
    --v192-card-h:117.6px; /* 2.5 : 3.5 = 5 : 7 */
    --v192-card-gap:6px;
  }

  /* 핸드 카드: 비율 고정 + 이름 잘림 완화 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{
    min-height:calc(28px + (var(--v192-card-h) * 2) + var(--v192-card-gap) + 18px)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:calc(28px + (var(--v192-card-h) * 2) + var(--v192-card-gap) + 18px)!important;
    min-height:calc(28px + (var(--v192-card-h) * 2) + var(--v192-card-gap) + 18px)!important;
    max-height:calc(28px + (var(--v192-card-h) * 2) + var(--v192-card-gap) + 18px)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-columns:repeat(3,var(--v192-card-w))!important;
    grid-template-rows:repeat(2,var(--v192-card-h))!important;
    grid-auto-rows:var(--v192-card-h)!important;
    gap:var(--v192-card-gap)!important;
    justify-content:space-between!important;
    align-content:start!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    width:var(--v192-card-w)!important;
    min-width:var(--v192-card-w)!important;
    max-width:var(--v192-card-w)!important;
    height:var(--v192-card-h)!important;
    min-height:var(--v192-card-h)!important;
    max-height:var(--v192-card-h)!important;
    aspect-ratio:2.5 / 3.5!important;
    grid-template-rows:30px minmax(0,1fr) 28px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-title-area{
    grid-template-columns:minmax(0,1fr) auto auto!important;
    height:30px!important;
    min-height:30px!important;
    max-height:30px!important;
    padding:2px 4px!important;
    align-items:start!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-name-text{
    white-space:normal!important;
    overflow:hidden!important;
    text-overflow:clip!important;
    display:-webkit-box!important;
    -webkit-line-clamp:2!important;
    -webkit-box-orient:vertical!important;
    line-height:1.03!important;
    font-size:10px!important;
    word-break:keep-all!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-ready-badge,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-title-grade{
    align-self:center!important;
  }

  /* 모든 아이템 핸드 카드 표기: 공/방/체 + 지력,매력(괄호) */
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .card-stat-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .item-bonus-summary-cell{
    grid-column:1 / -1!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:2px!important;
    padding:2px 3px!important;
    border-right:0!important;
    background:rgba(255,255,255,.03)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .item-bonus-summary-cell b{
    font-size:12px!important;
    line-height:1!important;
    color:#fff2bd!important;
    letter-spacing:.02em!important;
    white-space:nowrap!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .item-bonus-summary-cell span{
    display:block!important;
    font-size:8px!important;
    line-height:1!important;
    color:#d8dfe8!important;
    white-space:nowrap!important;
  }

  /* 전투열: 카드 위 이름 줄용 여백 제거 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    gap:4px!important;
    padding:4px 4px 6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    min-height:calc(var(--v192-card-h) + 4px)!important;
    height:auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-defense-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .enemy-hq-defense-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .ally-hq-defense-lane{
    padding:2px 0 2px!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .lane .label,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-defense-lane .label,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .enemy-hq-defense-lane .label,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .ally-hq-defense-lane .label{
    top:1px!important;
    left:6px!important;
    font-size:11px!important;
    line-height:1!important;
    padding:0!important;
    margin:0!important;
    pointer-events:none!important;
    opacity:.92!important;
  }

  /* 전투열 카드 비율 고정 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:var(--v192-card-w)!important;
    min-width:var(--v192-card-w)!important;
    max-width:var(--v192-card-w)!important;
    height:var(--v192-card-h)!important;
    min-height:var(--v192-card-h)!important;
    max-height:var(--v192-card-h)!important;
    aspect-ratio:2.5 / 3.5!important;
  }

  /* 전투열: 5장 기준, 좌우 여백은 카드 0.5장씩 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    padding:0!important;
    margin:0 auto!important;
    max-width:none!important;
    height:var(--v192-card-h)!important;
    min-height:var(--v192-card-h)!important;
    gap:var(--v192-card-gap)!important;
    align-items:stretch!important;
    align-content:stretch!important;
    justify-content:center!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    width:calc((var(--v192-card-w) * 6) + (var(--v192-card-gap) * 4))!important;
    grid-template-columns:repeat(5,var(--v192-card-w))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    width:calc((var(--v192-card-w) * 5) + (var(--v192-card-gap) * 3))!important;
    grid-template-columns:repeat(4,var(--v192-card-w))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    width:calc((var(--v192-card-w) * 4) + (var(--v192-card-gap) * 2))!important;
    grid-template-columns:repeat(3,var(--v192-card-w))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    width:calc((var(--v192-card-w) * 3) + (var(--v192-card-gap) * 1))!important;
    grid-template-columns:repeat(2,var(--v192-card-w))!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .enemy-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .ally-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .hq-defense-lane .hq-battlefield-grid{
    height:var(--v192-card-h)!important;
    min-height:var(--v192-card-h)!important;
    max-height:var(--v192-card-h)!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v192-card-w:80px;
    --v192-card-h:112px;
    --v192-card-gap:5px;
  }
}


/* ---- assets/css/v193_card_ratio_hand_gap_formation_width.css ---- */
/* v193 — 카드 2.8:4.0 비율 / 핸드 카드 무간격 / 전투진영 6장 폭·하단 밀착 */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v193-card-w:84px;
    --v193-card-h:120px; /* 2.8 : 4.0 */
    --v193-field-gap:6px;
    --v193-hand-gap:0px;
    --v193-hand-section-h:286px;
    --v193-formation-w:534px; /* 84px × 6 + 6px × 5 */
    --v193-five-card-w:444px;
    --v193-four-card-w:354px;
    --v193-three-card-w:264px;
    --v193-two-card-w:174px;
    --v193-lane-h:124px; /* 카드 120px + 상단 2px + 상·하단 테두리 */
  }

  /* 핸드: 2.8 x 4.0 비율, 가로·세로 카드 사이 여백 제거 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{
    min-height:var(--v193-hand-section-h)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:var(--v193-hand-section-h)!important;
    min-height:var(--v193-hand-section-h)!important;
    max-height:var(--v193-hand-section-h)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-columns:repeat(3,var(--v193-card-w))!important;
    grid-template-rows:repeat(2,var(--v193-card-h))!important;
    grid-auto-rows:var(--v193-card-h)!important;
    column-gap:0!important;
    row-gap:0!important;
    gap:0!important;
    justify-content:center!important;
    align-content:start!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    width:var(--v193-card-w)!important;
    min-width:var(--v193-card-w)!important;
    max-width:var(--v193-card-w)!important;
    height:var(--v193-card-h)!important;
    min-height:var(--v193-card-h)!important;
    max-height:var(--v193-card-h)!important;
    margin:0!important;
    aspect-ratio:2.8 / 4!important;
  }

  /* 전투 카드도 핸드와 동일한 2.8 x 4.0 비율 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:var(--v193-card-w)!important;
    min-width:var(--v193-card-w)!important;
    max-width:var(--v193-card-w)!important;
    height:var(--v193-card-h)!important;
    min-height:var(--v193-card-h)!important;
    max-height:var(--v193-card-h)!important;
    margin:0!important;
    aspect-ratio:2.8 / 4!important;
  }

  /* 전투진영 박스: 카드 6장 + 카드 사이 간격 5개가 정확히 들어가는 폭 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    align-items:center!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    width:var(--v193-formation-w)!important;
    min-width:var(--v193-formation-w)!important;
    max-width:var(--v193-formation-w)!important;
    height:var(--v193-lane-h)!important;
    min-height:var(--v193-lane-h)!important;
    max-height:var(--v193-lane-h)!important;
    flex:0 0 var(--v193-lane-h)!important;
    align-self:center!important;
    padding:2px 0 0!important;
    margin-left:auto!important;
    margin-right:auto!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  /* 카드 하단과 전투진영 박스 하단을 밀착 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    height:var(--v193-card-h)!important;
    min-height:var(--v193-card-h)!important;
    max-height:var(--v193-card-h)!important;
    padding:0!important;
    gap:var(--v193-field-gap)!important;
    align-items:stretch!important;
    align-content:stretch!important;
    justify-content:center!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    display:grid!important;
    grid-template-columns:repeat(5,var(--v193-card-w))!important;
    width:var(--v193-five-card-w)!important;
    min-width:var(--v193-five-card-w)!important;
    max-width:var(--v193-five-card-w)!important;
    margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    display:grid!important;
    grid-template-columns:repeat(4,var(--v193-card-w))!important;
    width:var(--v193-four-card-w)!important;
    min-width:var(--v193-four-card-w)!important;
    max-width:var(--v193-four-card-w)!important;
    margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    display:grid!important;
    grid-template-columns:repeat(3,var(--v193-card-w))!important;
    width:var(--v193-three-card-w)!important;
    min-width:var(--v193-three-card-w)!important;
    max-width:var(--v193-three-card-w)!important;
    margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    display:grid!important;
    grid-template-columns:repeat(2,var(--v193-card-w))!important;
    width:var(--v193-two-card-w)!important;
    min-width:var(--v193-two-card-w)!important;
    max-width:var(--v193-two-card-w)!important;
    margin:0 auto!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .enemy-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .ally-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .hq-defense-lane .hq-battlefield-grid{
    height:var(--v193-card-h)!important;
    min-height:var(--v193-card-h)!important;
    max-height:var(--v193-card-h)!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v193-card-w:80px;
    --v193-card-h:114.2857px; /* 2.8 : 4.0 */
    --v193-field-gap:5px;
    --v193-hand-section-h:274.5714px;
    --v193-formation-w:505px; /* 80px × 6 + 5px × 5 */
    --v193-five-card-w:420px;
    --v193-four-card-w:335px;
    --v193-three-card-w:250px;
    --v193-two-card-w:165px;
    --v193-lane-h:118.2857px;
  }
}


/* ---- assets/css/v195_status_cardeffect_square.css ---- */
/* v196 — 상태표시 단일 박스 / 카드 연출효과 패널 / 카드 3.3:4.8 / 라운딩 제거 */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app{
    grid-template-columns:414px minmax(720px,1fr)!important; /* 기존 360px 대비 15% 확장 */
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v193-card-w:84px;
    --v193-card-h:122.1818px; /* 3.3 : 4.8 */
    --v193-field-gap:6px;
    --v193-hand-gap:0px;
    --v193-hand-section-h:302px;
    --v193-formation-w:534px; /* 카드 6장 + 간격 5개 */
    --v193-five-card-w:444px;
    --v193-four-card-w:354px;
    --v193-three-card-w:264px;
    --v193-two-card-w:174px;
    --v193-lane-h:126.1818px;
  }

  /* 핸드: 3.3 x 4.8 비율, 가로·세로 카드 사이 여백 제거 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{min-height:var(--v193-hand-section-h)!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:var(--v193-hand-section-h)!important;min-height:var(--v193-hand-section-h)!important;max-height:var(--v193-hand-section-h)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-columns:repeat(3,var(--v193-card-w))!important;grid-template-rows:repeat(2,var(--v193-card-h))!important;grid-auto-rows:var(--v193-card-h)!important;
    column-gap:0!important;row-gap:0!important;gap:0!important;justify-content:center!important;align-content:start!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    width:var(--v193-card-w)!important;min-width:var(--v193-card-w)!important;max-width:var(--v193-card-w)!important;
    height:var(--v193-card-h)!important;min-height:var(--v193-card-h)!important;max-height:var(--v193-card-h)!important;
    margin:0!important;aspect-ratio:3.3 / 4.8!important;
  }

  /* 전투 카드도 핸드와 동일한 3.3 x 4.8 비율 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:var(--v193-card-w)!important;min-width:var(--v193-card-w)!important;max-width:var(--v193-card-w)!important;
    height:var(--v193-card-h)!important;min-height:var(--v193-card-h)!important;max-height:var(--v193-card-h)!important;
    margin:0!important;aspect-ratio:3.3 / 4.8!important;
  }

  /* 전투진영 박스: 카드 6장 + 카드 사이 간격 5개가 정확히 들어가는 폭 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{align-items:center!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    width:var(--v193-formation-w)!important;min-width:var(--v193-formation-w)!important;max-width:var(--v193-formation-w)!important;
    height:var(--v193-lane-h)!important;min-height:var(--v193-lane-h)!important;max-height:var(--v193-lane-h)!important;
    flex:0 0 var(--v193-lane-h)!important;align-self:center!important;padding:2px 0 0!important;margin-left:auto!important;margin-right:auto!important;overflow:hidden!important;box-sizing:border-box!important;
  }

  /* 카드 하단과 전투진영 박스 하단 밀착 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    height:var(--v193-card-h)!important;min-height:var(--v193-card-h)!important;max-height:var(--v193-card-h)!important;
    padding:0!important;gap:var(--v193-field-gap)!important;align-items:stretch!important;align-content:stretch!important;justify-content:center!important;overflow:hidden!important;box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    display:grid!important;grid-template-columns:repeat(5,var(--v193-card-w))!important;
    width:var(--v193-five-card-w)!important;min-width:var(--v193-five-card-w)!important;max-width:var(--v193-five-card-w)!important;margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    display:grid!important;grid-template-columns:repeat(4,var(--v193-card-w))!important;
    width:var(--v193-four-card-w)!important;min-width:var(--v193-four-card-w)!important;max-width:var(--v193-four-card-w)!important;margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    display:grid!important;grid-template-columns:repeat(3,var(--v193-card-w))!important;
    width:var(--v193-three-card-w)!important;min-width:var(--v193-three-card-w)!important;max-width:var(--v193-three-card-w)!important;margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    display:grid!important;grid-template-columns:repeat(2,var(--v193-card-w))!important;
    width:var(--v193-two-card-w)!important;min-width:var(--v193-two-card-w)!important;max-width:var(--v193-two-card-w)!important;margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .enemy-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .ally-hq-defense-lane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .hq-defense-lane .hq-battlefield-grid{
    height:var(--v193-card-h)!important;min-height:var(--v193-card-h)!important;max-height:var(--v193-card-h)!important;
  }

  /* 좌측 순서: 효과창 -> 양측본진 -> 전투조작 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-section{order:4!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host{order:5!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host{order:6!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hq-utility-section{order:7!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{order:8!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-bottom-actions{order:9!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .desktop-ui-mode-switch{order:10!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) #desktopOnlineMatchInfo{order:11!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) #desktopMatchWaitingNotice{order:12!important;}

  /* 양측 상태 표시: 한 개의 외곽 박스 안에 적/아군 반반 배치 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host{
    padding:6px 7px!important;
    background:#080d10!important;
    border-bottom:1px solid #5b3e20!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .battle-status-pair{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:0!important;
    margin:0!important;
    padding:0!important;
    width:100%!important;
    border:1px solid #7a532c!important;
    background:linear-gradient(180deg,#0e1418,#080b0f)!important;
    box-shadow:0 8px 24px #0008,inset 0 0 0 1px #000!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar{
    min-width:0!important;
    min-height:78px!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    cursor:default!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .enemy-quickbar{
    background:linear-gradient(180deg,#351517,#12090a)!important;
    border-right:1px solid #7a532c!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .ally-quickbar{
    background:linear-gradient(180deg,#122946,#08111c)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar:hover,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar:focus{filter:none!important;outline:none!important;box-shadow:none!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar-title{
    display:flex!important;align-items:center!important;gap:4px!important;height:28px!important;margin:0!important;padding:0 8px!important;
    border-bottom:1px solid #ffffff22!important;font-size:12px!important;font-weight:900!important;line-height:1!important;color:#e8edf2!important;
    text-align:left!important;letter-spacing:-.01em!important;white-space:nowrap!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .enemy-quickbar .hq-quickbar-title{color:#ffdbde!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .ally-quickbar .hq-quickbar-title{color:#dbeaff!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar-stats{
    display:flex!important;align-items:center!important;gap:8px!important;padding:8px 8px 9px!important;flex-wrap:wrap!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-stat{
    position:relative!important;display:inline-flex!important;align-items:center!important;justify-content:flex-start!important;gap:3px!important;
    min-width:0!important;min-height:0!important;padding:0!important;border:0!important;background:transparent!important;font-size:12px!important;color:#f6f7fb!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-stat::before{display:none!important;content:none!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-icon{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:auto!important;min-width:10px!important;font-size:13px!important;line-height:1!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quick-stat b{color:#fff!important;font-size:12px!important;font-weight:900!important;line-height:1!important;white-space:nowrap!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .enemy-quickbar .hq-quick-stat.turn{display:none!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host .hq-quickbar-hint{display:none!important;}

  /* 일반 카드 연출효과 패널 — 고정 크기 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-section{
    padding:0 7px 7px!important;background:#080d10!important;border-bottom:1px solid #5b3e20!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-head{
    display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;
    padding:6px 8px!important;border:1px solid #6e4926!important;border-bottom:0!important;background:linear-gradient(180deg,#1d1710,#0b0a09)!important;
    color:#f1e3c8!important;font-size:12px!important;font-weight:900!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-head small{color:#bba88b!important;font-size:9px!important;font-weight:700!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-body{
    height:186px!important;min-height:186px!important;max-height:186px!important;overflow:hidden!important;
    padding:8px!important;border:1px solid #6e4926!important;background:linear-gradient(180deg,#0d1318,#090d10)!important;
    box-shadow:inset 0 0 0 1px #000!important;color:#d8e0ea!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-card{display:grid!important;grid-template-columns:1fr!important;gap:6px!important;height:100%!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-title{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important;color:#fff3da!important;min-height:18px!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-title b{font-size:13px!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-type{flex:0 0 auto!important;padding:2px 6px!important;border:1px solid #7a5b33!important;background:#15110c!important;color:#f6dfb4!important;font-size:9px!important;font-weight:900!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-note{color:#8fbaff!important;font-size:9px!important;font-weight:800!important;line-height:1.2!important;min-height:12px!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-effect-empty{display:flex!important;align-items:center!important;justify-content:center!important;height:100%!important;text-align:center!important;color:#9daaba!important;font-size:10px!important;line-height:1.6!important;padding:0 8px!important;}

  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-scene-grid{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:repeat(2,1fr)!important;gap:6px!important;flex:1 1 auto!important;min-height:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-scene-item{
    display:grid!important;grid-template-columns:58px minmax(0,1fr)!important;gap:6px!important;align-items:center!important;
    min-height:0!important;padding:5px!important;border:1px solid #284157!important;background:linear-gradient(180deg,#0f1c29,#0a121b)!important;overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-scene-thumb{
    width:58px!important;height:48px!important;border:1px solid #4c647e!important;background:#0b1016!important;overflow:hidden!important;display:flex!important;align-items:center!important;justify-content:center!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-scene-thumb img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-scene-thumb.no-image{background:linear-gradient(180deg,#1a2736,#101821)!important;color:#9db8d5!important;font-size:11px!important;font-weight:900!important;letter-spacing:-.02em!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-scene-meta{min-width:0!important;display:grid!important;gap:4px!important;align-content:center!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-scene-kind{color:#ffe7bf!important;font-size:10px!important;font-weight:900!important;line-height:1!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-scene-effect{color:#d5e4f3!important;font-size:10px!important;font-weight:700!important;line-height:1.25!important;word-break:keep-all!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important;}

  /* 전투필드에서 전투열 외 공간 여백 축소/제거 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel{padding:0!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap{
    padding:0!important;display:flex!important;justify-content:center!important;align-items:stretch!important;overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout{
    width:var(--v193-formation-w)!important;min-width:var(--v193-formation-w)!important;max-width:var(--v193-formation-w)!important;
    margin:0 auto!important;padding:0!important;display:block!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    width:var(--v193-formation-w)!important;min-width:var(--v193-formation-w)!important;max-width:var(--v193-formation-w)!important;
    margin:0 auto!important;padding:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .river{
    width:var(--v193-formation-w)!important;min-width:var(--v193-formation-w)!important;max-width:var(--v193-formation-w)!important;margin:0 auto!important;
  }

  /* 카드 모서리 라운딩 제거 + 3.3:4.8 비율 고정 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .cimg,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .cstats,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-title-area,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .base-unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .default-art,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .art,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .grade,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .buff,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .typeicon{border-radius:0!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{aspect-ratio:3.3 / 4.8!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{aspect-ratio:3.3 / 4.8!important;}
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app{grid-template-columns:414px minmax(680px,1fr)!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v193-card-w:80px;
    --v193-card-h:116.3636px; /* 3.3 : 4.8 */
    --v193-field-gap:5px;
    --v193-hand-section-h:292px;
    --v193-formation-w:505px;
    --v193-five-card-w:420px;
    --v193-four-card-w:335px;
    --v193-three-card-w:250px;
    --v193-two-card-w:165px;
    --v193-lane-h:120.3636px;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-body{height:176px!important;min-height:176px!important;max-height:176px!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-scene-item{grid-template-columns:52px minmax(0,1fr)!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-scene-thumb{width:52px!important;height:42px!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .river{
    width:var(--v193-formation-w)!important;min-width:var(--v193-formation-w)!important;max-width:var(--v193-formation-w)!important;
  }
}


/* ---- assets/css/v197_layout_animation.css ---- */
/* v197 — 좌측 폭 5% 확장 / 연출 애니메이션 무대 / 좌측 순서 / 전투필드 여백 제거 */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app{
    grid-template-columns:435px minmax(720px,1fr)!important; /* v196 414px에서 약 5% 확장 */
  }

  /* 요청 순서: 효과창 → 적·아군 본진 → 아군 핸드 → 항복·셔플·턴종료 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-panel{order:1!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-menu-dock{order:2!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-setup-host{order:3!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-section{order:4!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host{order:5!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host{order:6!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host{order:7!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hq-utility-section{order:8!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-utility-action-row{order:9!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) #desktopOnlineMatchInfo{order:10!important;}
  body.unified-left-layout:not(.ui-mode-mobile-preview) #desktopMatchWaitingNotice{order:11!important;}

  /* 설정 / 규칙확인 / PC / 모바일 한 줄, 카드관리 버튼과 동일한 높이 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-utility-action-row{
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:5px!important;
    width:100%!important;
    padding:7px!important;
    border-top:1px solid #5b3e20!important;
    border-bottom:1px solid #5b3e20!important;
    background:#080d10!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-utility-action-row .btn{
    width:100%!important;
    min-width:0!important;
    height:42px!important;
    min-height:42px!important;
    max-height:42px!important;
    box-sizing:border-box!important;
    padding:0 3px!important;
    font-size:10px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-utility-action-row #settingsBtn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-utility-action-row #rulesBtn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-utility-action-row .btn[data-ui-mode]{
    height:42px!important;
    min-height:42px!important;
    max-height:42px!important;
    box-sizing:border-box!important;
    padding:4px 3px!important;
    font-size:10px!important;
    line-height:1!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-bottom-actions,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .desktop-ui-mode-switch{
    display:none!important;
  }

  /* 연출효과 창: 크기는 고정하고 실제 애니메이션 무대로 사용 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-body{
    height:186px!important;
    min-height:186px!important;
    max-height:186px!important;
    padding:6px!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-card{
    display:grid!important;
    grid-template-rows:20px minmax(0,1fr) 25px!important;
    gap:4px!important;
    height:100%!important;
    min-height:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-title{
    min-height:20px!important;
    height:20px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage{
    position:relative!important;
    min-height:0!important;
    overflow:hidden!important;
    isolation:isolate!important;
    border:1px solid #314e68!important;
    background:radial-gradient(circle at 50% 42%,#162a3c,#070c11 72%)!important;
    box-shadow:inset 0 0 18px #000!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene{
    position:absolute!important;
    inset:0!important;
    left:0!important;
    top:0!important;
    right:0!important;
    bottom:0!important;
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    max-width:none!important;
    max-height:none!important;
    margin:0!important;
    z-index:1!important;
    border-radius:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene .scene-label{
    left:5px!important;
    right:5px!important;
    bottom:4px!important;
    padding:3px 5px!important;
    font-size:9px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene .scene-effect-caption{
    top:5px!important;
    left:5px!important;
    right:5px!important;
    gap:2px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene .scene-title-big{
    padding:2px 7px!important;
    font-size:11px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene .scene-title-small{
    padding:2px 6px!important;
    font-size:8px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage-badge{
    position:absolute!important;
    top:5px!important;
    left:5px!important;
    z-index:20!important;
    display:flex!important;
    align-items:center!important;
    gap:5px!important;
    padding:3px 6px!important;
    border:1px solid #ffffff3a!important;
    background:#03070cd9!important;
    color:#fff4da!important;
    font-size:9px!important;
    font-weight:900!important;
    pointer-events:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage-badge span{
    color:#9ed0ff!important;
    font-weight:800!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-scene-tabs{
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:4px!important;
    min-height:25px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-scene-tab{
    height:25px!important;
    min-height:25px!important;
    padding:2px 3px!important;
    border:1px solid #35485b!important;
    border-radius:0!important;
    background:#0b141d!important;
    color:#aebdca!important;
    font-size:9px!important;
    font-weight:900!important;
    cursor:pointer!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-scene-tab.active{
    border-color:#c58b43!important;
    background:linear-gradient(180deg,#3b2814,#171008)!important;
    color:#ffe7bd!important;
    box-shadow:inset 0 0 0 1px #000!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-effect-empty{
    height:100%!important;
    border:1px solid #314e68!important;
    background:radial-gradient(circle at 50% 42%,#162a3c,#070c11 72%)!important;
  }

  /* 전투열 박스 바깥 여백 제거: 전투판은 전투열 묶음 크기에 정확히 맞춤 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel{
    align-items:center!important;
    padding:0!important;
    background:transparent!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap{
    flex:0 0 auto!important;
    width:var(--v193-formation-w)!important;
    min-width:var(--v193-formation-w)!important;
    max-width:var(--v193-formation-w)!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0 auto!important;
    padding:0!important;
    overflow:visible!important;
    background:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    width:var(--v193-formation-w)!important;
    min-width:var(--v193-formation-w)!important;
    max-width:var(--v193-formation-w)!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-start!important;
    align-items:stretch!important;
    gap:0!important;
    background:transparent!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane{
    margin:0!important;
    border-radius:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .bottom-hud{
    width:100%!important;
    align-self:stretch!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app{
    grid-template-columns:435px minmax(680px,1fr)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-body{
    height:176px!important;
    min-height:176px!important;
    max-height:176px!important;
  }
}


/* ---- assets/css/v198_action_effect_card_fill.css ---- */
/* v198 — 좌측 폭 복원 / 실제 카드 동작 연출만 표시 / 효과창 50% 확대 / 핸드·전투열 카드 높이 밀착 */
@media (min-width:851px){
  /* v197의 5% 확장을 취소하고 v196 폭으로 복원 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app{
    grid-template-columns:414px minmax(720px,1fr)!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview){
    /* 핸드 박스 내부 높이(302 - 제목 28 - 상하 패딩 10)를 두 줄이 정확히 채우도록 조정 */
    --v193-card-h:132px;
    --v193-card-w:90.75px; /* 3.3 : 4.8 */
    --v193-field-gap:6px;
    --v193-hand-gap:0px;
    --v193-hand-section-h:302px;
    --v193-formation-w:574.5px; /* 90.75 × 6 + 6 × 5 */
    --v193-five-card-w:477.75px;
    --v193-four-card-w:381px;
    --v193-three-card-w:284.25px;
    --v193-two-card-w:187.5px;
    --v193-lane-h:134px; /* 카드 132 + 상하 테두리 */
  }

  /* 연출효과창 높이 50% 확대: 186px → 279px */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-body{
    height:279px!important;
    min-height:279px!important;
    max-height:279px!important;
    padding:6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-card.action-view-mode{
    display:grid!important;
    grid-template-rows:24px minmax(0,1fr)!important;
    gap:5px!important;
    height:100%!important;
    min-height:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-title{
    min-height:24px!important;
    height:24px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage{
    min-height:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-scene-tabs{
    display:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-effect-empty{
    height:100%!important;
    border:1px solid #314e68!important;
    background:radial-gradient(circle at 50% 42%,#111d27,#070c11 72%)!important;
    color:#7f93a5!important;
  }

  /* 핸드 카드 두 줄이 핸드 카드 박스의 세로 높이를 정확히 채움 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:var(--v193-hand-section-h)!important;
    min-height:var(--v193-hand-section-h)!important;
    max-height:var(--v193-hand-section-h)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .handbox{
    padding:5px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-columns:repeat(3,var(--v193-card-w))!important;
    grid-template-rows:repeat(2,var(--v193-card-h))!important;
    grid-auto-rows:var(--v193-card-h)!important;
    gap:0!important;
    padding:0!important;
    justify-content:center!important;
    align-content:stretch!important;
    overflow-x:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    width:var(--v193-card-w)!important;
    min-width:var(--v193-card-w)!important;
    max-width:var(--v193-card-w)!important;
    height:var(--v193-card-h)!important;
    min-height:var(--v193-card-h)!important;
    max-height:var(--v193-card-h)!important;
    margin:0!important;
    aspect-ratio:3.3 / 4.8!important;
  }

  /* 전투필드 카드도 핸드와 같은 크기, 전투열은 카드와 테두리만 남김 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:var(--v193-card-w)!important;
    min-width:var(--v193-card-w)!important;
    max-width:var(--v193-card-w)!important;
    height:var(--v193-card-h)!important;
    min-height:var(--v193-card-h)!important;
    max-height:var(--v193-card-h)!important;
    margin:0!important;
    aspect-ratio:3.3 / 4.8!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    width:var(--v193-formation-w)!important;
    min-width:var(--v193-formation-w)!important;
    max-width:var(--v193-formation-w)!important;
    height:var(--v193-lane-h)!important;
    min-height:var(--v193-lane-h)!important;
    max-height:var(--v193-lane-h)!important;
    flex:0 0 var(--v193-lane-h)!important;
    padding:0!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    height:var(--v193-card-h)!important;
    min-height:var(--v193-card-h)!important;
    max-height:var(--v193-card-h)!important;
    padding:0!important;
    align-items:stretch!important;
    align-content:stretch!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    grid-template-columns:repeat(5,var(--v193-card-w))!important;
    width:var(--v193-five-card-w)!important;
    min-width:var(--v193-five-card-w)!important;
    max-width:var(--v193-five-card-w)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    grid-template-columns:repeat(4,var(--v193-card-w))!important;
    width:var(--v193-four-card-w)!important;
    min-width:var(--v193-four-card-w)!important;
    max-width:var(--v193-four-card-w)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    grid-template-columns:repeat(3,var(--v193-card-w))!important;
    width:var(--v193-three-card-w)!important;
    min-width:var(--v193-three-card-w)!important;
    max-width:var(--v193-three-card-w)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    grid-template-columns:repeat(2,var(--v193-card-w))!important;
    width:var(--v193-two-card-w)!important;
    min-width:var(--v193-two-card-w)!important;
    max-width:var(--v193-two-card-w)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .river,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap{
    width:var(--v193-formation-w)!important;
    min-width:var(--v193-formation-w)!important;
    max-width:var(--v193-formation-w)!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app{
    grid-template-columns:414px minmax(680px,1fr)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    /* 낮은 화면: 292 - 제목 28 - 상하 패딩 10 = 254px → 카드 127px × 2 */
    --v193-card-h:127px;
    --v193-card-w:87.3125px;
    --v193-field-gap:5px;
    --v193-hand-section-h:292px;
    --v193-formation-w:548.875px;
    --v193-five-card-w:456.5625px;
    --v193-four-card-w:364.25px;
    --v193-three-card-w:271.9375px;
    --v193-two-card-w:179.625px;
    --v193-lane-h:129px;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-body{
    height:264px!important;
    min-height:264px!important;
    max-height:264px!important;
  }
}


/* ---- assets/css/v199_user_layout_adjustments.css ---- */

/* v199 — 사용자 요청 반영: 전투메뉴 단순화 · 카드관리 이동 · 상대찾기 버튼 배치 */

@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .online-account-bar,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .faction-pickers{
    display:none!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .top-card-actions{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .top-card-actions #matchmakingBtn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .top-card-actions #cardManagerBtn{
    display:none!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-logged-in{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) repeat(2,minmax(72px,auto))!important;
    gap:6px!important;
    align-items:center!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-logged-in #leftAuthStateText{
    min-width:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-logged-in #cardManagerBtn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-logged-in #leftLogoutBtn{
    width:100%!important;
    min-width:72px!important;
    height:31px!important;
    min-height:31px!important;
    max-height:31px!important;
    padding:4px 8px!important;
    font-size:10px!important;
    font-weight:900!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-logged-in #cardManagerBtn{
    border-color:#7c5cff!important;
    background:linear-gradient(180deg,#4932a8,#281568)!important;
    color:#f5efff!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host .deck-info{
    display:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host #matchmakingBtn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host #battleControlBtn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host #shuffleBtn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host #endTurnBtn{
    order:initial!important;
    width:100%!important;
    min-width:0!important;
    min-height:32px!important;
    height:32px!important;
    max-height:32px!important;
    padding:4px 6px!important;
    font-size:10px!important;
    font-weight:900!important;
  }
}

#matchmakingBtn{white-space:nowrap!important;}

/* 모바일 표기 정리 */
#mobileMatchmakingBtn{white-space:nowrap!important;}


/* ---- assets/css/v200_battle_scroll_layout_fix.css ---- */

/* v200 — 전투 화면 스크롤 · 좌측폭 축소 · 카드상점/본진 타이틀 보정 */

@media (min-width:851px){
  /* 좌측 화면 폭 3% 축소 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app{
    grid-template-columns:349px minmax(720px,1fr)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .reference-left,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .boardwrap{
    scrollbar-width:none!important;
    -ms-overflow-style:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .reference-left::-webkit-scrollbar,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel::-webkit-scrollbar,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .boardwrap::-webkit-scrollbar{
    width:0!important;
    height:0!important;
    display:none!important;
  }

  /* 좌측 박스/버튼 폭 정렬 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .reference-left > section,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .reference-left > div{
    box-sizing:border-box!important;
    width:100%!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-menu-dock,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-panel,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-setup-host .compact-settings-holder,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-combat-controls-host,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-battle-status-host,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-section,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-bottom-actions,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .desktop-ui-mode-switch,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #desktopOnlineMatchInfo{
    width:100%!important;
    box-sizing:border-box!important;
  }

  /* 전투 화면이 한 화면에 다 안 보이면 세로 스크롤 이동 가능(스크롤바 숨김) */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel{
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .boardwrap{
    flex:0 0 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding-bottom:12px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout>.board{
    padding-bottom:12px!important;
    box-sizing:border-box!important;
  }

  /* 아군 본진열 하단 잘림 방지 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout>.board > #allyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #allyBaseDefenseLane{
    margin-bottom:10px!important;
    padding-bottom:6px!important;
  }

  /* 카드상점/부스터팩 높이 통일 */
  .card-shop-box,
  #boosterPackModal .modalbox{
    height:min(92vh, 860px)!important;
    max-height:min(92vh, 860px)!important;
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }
  #boosterPackGrid,
  .card-shop-grid{
    flex:1 1 auto!important;
    overflow:auto!important;
  }

  /* 아군 본진 타이틀 우측에 턴 표시 */
  #allyHqQuickBar .hq-quickbar-title{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:8px!important;
  }
  #allyHqQuickBar .hq-quick-stat.turn{
    display:none!important;
  }
  #allyHqQuickBar .hq-quickbar-turn-inline{
    flex:0 0 auto!important;
    display:inline-flex!important;
    align-items:center!important;
    gap:4px!important;
    padding:1px 6px!important;
    border:1px solid rgba(255,255,255,.2)!important;
    border-radius:999px!important;
    background:rgba(0,0,0,.28)!important;
    color:#f4e6cf!important;
    font-size:9px!important;
    font-weight:900!important;
    line-height:1.2!important;
    white-space:nowrap!important;
  }

  /* 일반카드 연출효과 안내문/구분선 제거 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-head{
    display:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-section{
    padding-top:6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-body .card-effect-empty{
    display:none!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app{
    grid-template-columns:402px minmax(680px,1fr)!important;
  }
}


/* ---- assets/css/v201_mobile_pc_tuning.css ---- */

/* v201 — 카드상점/부스터 동일 높이 · 카드연출창 축소 · 모바일 전투열/상태 보정 */

/* 공통: 카드 상점/부스터팩 모달 높이 동일 */
.card-shop-box,
#boosterPackModal .modalbox{
  height:min(92vh,860px)!important;
  max-height:min(92vh,860px)!important;
}
.top-card-actions .btn,
#mobileDeckMenu .mobile-menu-actions .btn{
  min-height:31px!important;
  height:31px!important;
  max-height:31px!important;
}

/* PC: 카드 연출창 10% 축소 + 전투열 카드 하단 가림 보정 */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-body{
    height:251px!important;
    min-height:251px!important;
    max-height:251px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane:not(.hq-defense-lane),
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .hq-defense-lane.active{
    height:auto!important;
    min-height:calc(var(--v193-card-h,132px) + 14px)!important;
    padding-top:3px!important;
    padding-bottom:5px!important;
    overflow:visible!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.unit{
    overflow:visible!important;
  }
}
@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-body{
    height:238px!important;
    min-height:238px!important;
    max-height:238px!important;
  }
}

/* 모바일 실기기 + PC 미리보기 공통 보정 */
@media (max-width:850px){
  :root{
    --v201-mobile-gap:2px;
    --v201-mobile-side:8px;
    --v201-mobile-card-w:calc((100vw - (var(--v201-mobile-side) * 2) - (var(--v201-mobile-gap) * 4)) / 5);
    --v201-mobile-card-h:calc(var(--v201-mobile-card-w) * 48 / 33);
    --v201-mobile-hand-height:calc(var(--v201-mobile-card-h) + 28px);
    --v201-mobile-status-h:68px;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-combat-summary,
  body.ui-mode-mobile:not(.prebattle) #enemyHqMount,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-mount,
  body.ui-mode-mobile:not(.prebattle) .enemy-hq-row,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-combat-summary,
  body.ui-mode-mobile-preview:not(.prebattle) #enemyHqMount,
  body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-mount,
  body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row{
    display:none!important;
  }

  body.ui-mode-mobile:not(.prebattle) .battlefield-layout>.board,
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout>.board{
    gap:4px!important;
  }
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout>.board>.lane:not(.hq-defense-lane),
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout>.board>.lane:not(.hq-defense-lane),
  body.ui-mode-mobile:not(.prebattle) .hq-defense-lane.active,
  body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane.active{
    box-sizing:border-box!important;
    min-height:calc(var(--v201-mobile-card-h) + 10px)!important;
    height:auto!important;
    padding:3px 4px 5px!important;
    overflow:visible!important;
  }

  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slots,
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .hq-battlefield-grid,
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .hq-battlefield-grid{
    width:100%!important;
    max-width:100%!important;
    margin:0 auto!important;
    gap:var(--v201-mobile-gap)!important;
    padding:0!important;
    justify-content:space-between!important;
    align-items:stretch!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slots.n5,
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots.n5,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .hq-battlefield-grid,
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .hq-battlefield-grid{
    grid-template-columns:repeat(5,var(--v201-mobile-card-w))!important;
  }
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slots.n4,
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots.n4{grid-template-columns:repeat(4,var(--v201-mobile-card-w))!important;}
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slots.n3,
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots.n3{grid-template-columns:repeat(3,var(--v201-mobile-card-w))!important;}
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slots.n2,
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots.n2{grid-template-columns:repeat(2,var(--v201-mobile-card-w))!important;}

  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slot,
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slot,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .hq-field-slot,
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .hq-field-slot,
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card{
    width:var(--v201-mobile-card-w)!important;
    min-width:var(--v201-mobile-card-w)!important;
    max-width:var(--v201-mobile-card-w)!important;
    height:var(--v201-mobile-card-h)!important;
    min-height:var(--v201-mobile-card-h)!important;
    max-height:var(--v201-mobile-card-h)!important;
    aspect-ratio:33 / 48!important;
    overflow:visible!important;
  }
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slot>.unit,
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slot>.unit,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .hq-field-slot>.unit,
  body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .hq-field-slot>.unit{
    overflow:visible!important;
  }

  /* 핸드도 동일 크기 */
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount{
    height:var(--v201-mobile-hand-height)!important;
    min-height:var(--v201-mobile-hand-height)!important;
    max-height:var(--v201-mobile-hand-height)!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand,
  body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand{
    height:var(--v201-mobile-card-h)!important;
    min-height:var(--v201-mobile-card-h)!important;
    max-height:var(--v201-mobile-card-h)!important;
    gap:var(--v201-mobile-gap)!important;
    padding:0 var(--v201-mobile-side)!important;
    justify-content:flex-start!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  /* 모바일 상태를 버튼 위에 표시하고 버튼은 더 작게 */
  body.ui-mode-mobile:not(.prebattle) .bottom-hud,
  body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud{
    display:grid!important;
    grid-template-rows:26px 34px!important;
    gap:4px!important;
    height:var(--v201-mobile-status-h)!important;
    min-height:var(--v201-mobile-status-h)!important;
    max-height:var(--v201-mobile-status-h)!important;
    padding:4px 6px!important;
    bottom:var(--v201-mobile-hand-height)!important;
    overflow:hidden!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .mobile-bottom-status-row,
  body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .mobile-bottom-status-row{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:4px!important;
    width:100%!important;
    height:26px!important;
    min-height:26px!important;
    max-height:26px!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .mini-quickbar,
  body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .mini-quickbar{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:3px!important;
    min-width:0!important;
    padding:2px 4px!important;
    border:1px solid rgba(255,255,255,.12)!important;
    border-radius:6px!important;
    background:rgba(0,0,0,.34)!important;
    overflow:hidden!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .mini-quickbar-label,
  body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .mini-quickbar-label{font-size:8px!important;}
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .mini-quick-stat,
  body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .mini-quick-stat{font-size:7px!important;gap:1px!important;}
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .mini-quick-stat b,
  body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .mini-quick-stat b{font-size:8px!important;}
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .hud-status,
  body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .hud-status{
    display:block!important;
    height:34px!important;
    padding:0!important;
    background:transparent!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .hud-status>:not(.hud-actions),
  body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .hud-status>:not(.hud-actions){display:none!important;}
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .hud-actions,
  body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .hud-actions{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:4px!important;
    width:100%!important;
    height:34px!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud .hud-actions .btn,
  body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .hud-actions .btn{
    min-height:30px!important;
    height:30px!important;
    max-height:30px!important;
    padding:2px 4px!important;
    font-size:9px!important;
  }
  body.ui-mode-mobile:not(.prebattle),
  body.ui-mode-mobile:not(.prebattle) .app,
  body.ui-mode-mobile-preview:not(.prebattle),
  body.ui-mode-mobile-preview:not(.prebattle) .app{
    padding-bottom:calc(var(--v201-mobile-hand-height) + var(--v201-mobile-status-h) + 8px + env(safe-area-inset-bottom,0px))!important;
  }
}

/* PC에서 보는 모바일 미리보기 폭 기준 동일 계산 */
body.ui-mode-mobile-preview:not(.prebattle){
  --v201-mobile-gap:2px;
  --v201-mobile-side:8px;
  --v201-mobile-card-w:calc((var(--mobile-play-width,430px) - (var(--v201-mobile-side) * 2) - (var(--v201-mobile-gap) * 4)) / 5);
  --v201-mobile-card-h:calc(var(--v201-mobile-card-w) * 48 / 33);
  --v201-mobile-hand-height:calc(var(--v201-mobile-card-h) + 28px);
  --v201-mobile-status-h:68px;
}


/* PC에서 모바일 미리보기에도 동일 레이아웃 강제 */
body.ui-mode-mobile-preview:not(.prebattle) .mobile-combat-summary,
body.ui-mode-mobile-preview:not(.prebattle) #enemyHqMount,
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-mount,
body.ui-mode-mobile-preview:not(.prebattle) .enemy-hq-row{display:none!important;}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout>.board{gap:4px!important;}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout>.board>.lane:not(.hq-defense-lane),
body.ui-mode-mobile-preview:not(.prebattle) .hq-defense-lane.active{box-sizing:border-box!important;min-height:calc(var(--v201-mobile-card-h) + 10px)!important;height:auto!important;padding:3px 4px 5px!important;overflow:visible!important;}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .hq-battlefield-grid{width:100%!important;max-width:100%!important;margin:0 auto!important;gap:var(--v201-mobile-gap)!important;padding:0!important;justify-content:space-between!important;align-items:stretch!important;overflow:visible!important;box-sizing:border-box!important;}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots.n5,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .hq-battlefield-grid{grid-template-columns:repeat(5,var(--v201-mobile-card-w))!important;}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots.n4{grid-template-columns:repeat(4,var(--v201-mobile-card-w))!important;}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots.n3{grid-template-columns:repeat(3,var(--v201-mobile-card-w))!important;}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots.n2{grid-template-columns:repeat(2,var(--v201-mobile-card-w))!important;}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slot,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .hq-field-slot,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card{width:var(--v201-mobile-card-w)!important;min-width:var(--v201-mobile-card-w)!important;max-width:var(--v201-mobile-card-w)!important;height:var(--v201-mobile-card-h)!important;min-height:var(--v201-mobile-card-h)!important;max-height:var(--v201-mobile-card-h)!important;aspect-ratio:33 / 48!important;overflow:visible!important;}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount{height:var(--v201-mobile-hand-height)!important;min-height:var(--v201-mobile-hand-height)!important;max-height:var(--v201-mobile-hand-height)!important;}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand{height:var(--v201-mobile-card-h)!important;min-height:var(--v201-mobile-card-h)!important;max-height:var(--v201-mobile-card-h)!important;gap:var(--v201-mobile-gap)!important;padding:0 var(--v201-mobile-side)!important;justify-content:flex-start!important;overflow:hidden!important;box-sizing:border-box!important;}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud{display:grid!important;grid-template-rows:26px 34px!important;gap:4px!important;height:var(--v201-mobile-status-h)!important;min-height:var(--v201-mobile-status-h)!important;max-height:var(--v201-mobile-status-h)!important;padding:4px 6px!important;bottom:var(--v201-mobile-hand-height)!important;overflow:hidden!important;}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .mobile-bottom-status-row{display:grid!important;grid-template-columns:1fr 1fr!important;gap:4px!important;width:100%!important;height:26px!important;min-height:26px!important;max-height:26px!important;}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .mini-quickbar{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:3px!important;min-width:0!important;padding:2px 4px!important;border:1px solid rgba(255,255,255,.12)!important;border-radius:6px!important;background:rgba(0,0,0,.34)!important;overflow:hidden!important;}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .mini-quickbar-label{font-size:8px!important;}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .mini-quick-stat{font-size:7px!important;gap:1px!important;}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .mini-quick-stat b{font-size:8px!important;}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .hud-status{display:block!important;height:34px!important;padding:0!important;background:transparent!important;}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .hud-status>:not(.hud-actions){display:none!important;}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .hud-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px!important;width:100%!important;height:34px!important;}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud .hud-actions .btn{min-height:30px!important;height:30px!important;max-height:30px!important;padding:2px 4px!important;font-size:9px!important;}
body.ui-mode-mobile-preview:not(.prebattle),
body.ui-mode-mobile-preview:not(.prebattle) .app{padding-bottom:calc(var(--v201-mobile-hand-height) + var(--v201-mobile-status-h) + 8px)!important;}


/* ---- assets/css/v202_mobile_field_width_fix.css ---- */

/* v202 — 모바일 전투열 오른쪽 잘림 최종 보정 */

@media (max-width:850px){
  body.ui-mode-mobile:not(.prebattle),
  body.ui-mode-mobile:not(.prebattle) .app,
  body.ui-mode-mobile:not(.prebattle) .battle-panel,
  body.ui-mode-mobile:not(.prebattle) .boardwrap,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout>.board{
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:100%!important;
    overflow-x:hidden!important;
  }

  body.ui-mode-mobile:not(.prebattle) .boardwrap,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout>.board{
    width:100%!important;
    margin-left:0!important;
    margin-right:0!important;
    padding-left:2px!important;
    padding-right:2px!important;
  }

  body.ui-mode-mobile:not(.prebattle) .battlefield-layout>.board>.lane,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout>.board>.hq-defense-lane{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin-left:0!important;
    margin-right:0!important;
    padding-left:3px!important;
    padding-right:3px!important;
    overflow:hidden!important;
  }

  /* 모든 전투열은 5장 기준 폭을 공유한다. 4/3/2칸 열도 같은 카드 폭 유지 */
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slots,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slots.n5,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slots.n4,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slots.n3,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slots.n2,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .hq-battlefield-grid{
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    grid-auto-columns:minmax(0,1fr)!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    gap:2px!important;
    margin:0!important;
    padding:0!important;
    justify-content:stretch!important;
    overflow:hidden!important;
  }

  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slot,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .hq-field-slot{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    aspect-ratio:33 / 48!important;
    margin:0!important;
  }
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .slot>.unit,
  body.ui-mode-mobile:not(.prebattle) .battlefield-layout .hq-field-slot>.unit{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    margin:0!important;
  }

  /* 핸드도 정확히 5장이 화면 폭 안에 들어가도록 재계산 */
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount,
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount .right-hand-section,
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount .handbox,
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand{
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand{
    display:flex!important;
    gap:2px!important;
    padding-left:3px!important;
    padding-right:3px!important;
    overflow:hidden!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card{
    box-sizing:border-box!important;
    flex:0 0 calc((100% - 8px) / 5)!important;
    width:calc((100% - 8px) / 5)!important;
    min-width:0!important;
    max-width:calc((100% - 8px) / 5)!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    aspect-ratio:33 / 48!important;
    margin:0!important;
  }
}

/* PC에서 실행하는 모바일 미리보기에도 같은 폭 계산 적용 */
body.ui-mode-mobile-preview:not(.prebattle),
body.ui-mode-mobile-preview:not(.prebattle) .app,
body.ui-mode-mobile-preview:not(.prebattle) .battle-panel,
body.ui-mode-mobile-preview:not(.prebattle) .boardwrap,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout>.board{
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:100%!important;
  overflow-x:hidden!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .boardwrap,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout>.board{
  width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  padding-left:2px!important;
  padding-right:2px!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout>.board>.lane,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout>.board>.hq-defense-lane{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  padding-left:3px!important;
  padding-right:3px!important;
  overflow:hidden!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots.n5,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots.n4,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots.n3,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slots.n2,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .hq-battlefield-grid{
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:repeat(5,minmax(0,1fr))!important;
  grid-auto-columns:minmax(0,1fr)!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  gap:2px!important;
  margin:0!important;
  padding:0!important;
  justify-content:stretch!important;
  overflow:hidden!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slot,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .hq-field-slot{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:33 / 48!important;
  margin:0!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .slot>.unit,
body.ui-mode-mobile-preview:not(.prebattle) .battlefield-layout .hq-field-slot>.unit{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:100%!important;
  min-height:0!important;
  max-height:100%!important;
  margin:0!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount .right-hand-section,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount .handbox,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand{
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand{
  display:flex!important;
  gap:2px!important;
  padding-left:3px!important;
  padding-right:3px!important;
  overflow:hidden!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card{
  box-sizing:border-box!important;
  flex:0 0 calc((100% - 8px) / 5)!important;
  width:calc((100% - 8px) / 5)!important;
  min-width:0!important;
  max-width:calc((100% - 8px) / 5)!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  aspect-ratio:33 / 48!important;
  margin:0!important;
}


/* ---- assets/css/v203_mobile_hand_window_fix.css ---- */

/* v203 — 모바일(특히 PC의 모바일 미리보기) 하단 핸드창 폭/크기 복원 */

/* 실기기 모바일은 기존 5장 맞춤을 유지하되, 핸드 카드 높이가 과도하게 커지지 않게 안전 상한 적용 */
@media (max-width:850px){
  body.ui-mode-mobile:not(.prebattle){
    --v203-mobile-hand-card-w:min(calc((100vw - 14px) / 5), 82px);
    --v203-mobile-hand-card-h:calc(var(--v203-mobile-hand-card-w) * 48 / 33);
    --v203-mobile-hand-dock-h:calc(var(--v203-mobile-hand-card-h) + 30px);
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount{
    width:100%!important;
    left:0!important;
    right:0!important;
    transform:none!important;
    height:var(--v203-mobile-hand-dock-h)!important;
    min-height:var(--v203-mobile-hand-dock-h)!important;
    max-height:var(--v203-mobile-hand-dock-h)!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount .right-hand-section,
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount .handbox,
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand{
    height:var(--v203-mobile-hand-card-h)!important;
    min-height:var(--v203-mobile-hand-card-h)!important;
    max-height:var(--v203-mobile-hand-card-h)!important;
    padding-left:3px!important;
    padding-right:3px!important;
  }
  body.ui-mode-mobile:not(.prebattle) .mobile-hand-mount #hand.hand .card{
    flex:0 0 var(--v203-mobile-hand-card-w)!important;
    width:var(--v203-mobile-hand-card-w)!important;
    min-width:var(--v203-mobile-hand-card-w)!important;
    max-width:var(--v203-mobile-hand-card-w)!important;
    height:var(--v203-mobile-hand-card-h)!important;
    min-height:var(--v203-mobile-hand-card-h)!important;
    max-height:var(--v203-mobile-hand-card-h)!important;
  }
  body.ui-mode-mobile:not(.prebattle) .bottom-hud{
    bottom:var(--v203-mobile-hand-dock-h)!important;
  }
  body.ui-mode-mobile:not(.prebattle),
  body.ui-mode-mobile:not(.prebattle) .app{
    padding-bottom:calc(var(--v203-mobile-hand-dock-h) + var(--v201-mobile-status-h,68px) + 8px + env(safe-area-inset-bottom,0px))!important;
  }
}

/* PC에서 모바일 미리보기: 하단 도크는 전체 폭이 아니라 모바일 플레이 폭(약 418px)을 사용 */
body.ui-mode-mobile-preview:not(.prebattle){
  --v203-preview-hand-card-w:calc((var(--mobile-play-width,418px) - 14px) / 5);
  --v203-preview-hand-card-h:calc(var(--v203-preview-hand-card-w) * 48 / 33);
  --v203-preview-hand-dock-h:calc(var(--v203-preview-hand-card-h) + 30px);
}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount{
  left:50%!important;
  right:auto!important;
  transform:translateX(-50%)!important;
  width:var(--mobile-play-width,418px)!important;
  min-width:var(--mobile-play-width,418px)!important;
  max-width:var(--mobile-play-width,418px)!important;
  height:var(--v203-preview-hand-dock-h)!important;
  min-height:var(--v203-preview-hand-dock-h)!important;
  max-height:var(--v203-preview-hand-dock-h)!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount .right-hand-section,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount .handbox,
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand{
  width:var(--mobile-play-width,418px)!important;
  min-width:var(--mobile-play-width,418px)!important;
  max-width:var(--mobile-play-width,418px)!important;
  box-sizing:border-box!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand{
  height:var(--v203-preview-hand-card-h)!important;
  min-height:var(--v203-preview-hand-card-h)!important;
  max-height:var(--v203-preview-hand-card-h)!important;
  padding-left:3px!important;
  padding-right:3px!important;
  overflow:hidden!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .mobile-hand-mount #hand.hand .card{
  flex:0 0 var(--v203-preview-hand-card-w)!important;
  width:var(--v203-preview-hand-card-w)!important;
  min-width:var(--v203-preview-hand-card-w)!important;
  max-width:var(--v203-preview-hand-card-w)!important;
  height:var(--v203-preview-hand-card-h)!important;
  min-height:var(--v203-preview-hand-card-h)!important;
  max-height:var(--v203-preview-hand-card-h)!important;
}
body.ui-mode-mobile-preview:not(.prebattle) .bottom-hud{
  left:50%!important;
  right:auto!important;
  transform:translateX(-50%)!important;
  width:var(--mobile-play-width,418px)!important;
  min-width:var(--mobile-play-width,418px)!important;
  max-width:var(--mobile-play-width,418px)!important;
  bottom:var(--v203-preview-hand-dock-h)!important;
}
body.ui-mode-mobile-preview:not(.prebattle),
body.ui-mode-mobile-preview:not(.prebattle) .app{
  padding-bottom:calc(var(--v203-preview-hand-dock-h) + var(--v201-mobile-status-h,68px) + 8px)!important;
}


/* ---- assets/css/v204_mobile_gap_status_art.css ---- */
/* v205 — 모바일/모바일 미리보기 전투필드·핸드 밀착 + 본진 상태 상단 이미지 UI */

/* 실제 모바일: 핸드는 문서 흐름에 두고, 과거 고정 도크용 예약 여백을 제거한다. */
@media (max-width:850px){
  body.ui-mode-mobile,
  body.ui-mode-mobile .app{
    margin-bottom:0!important;
    padding-bottom:calc(var(--mobile-action-height,58px) + 4px + env(safe-area-inset-bottom,0px))!important;
  }
  body.ui-mode-mobile .battle-panel,
  body.ui-mode-mobile .boardwrap,
  body.ui-mode-mobile .battlefield-layout,
  body.ui-mode-mobile .battlefield-layout>.board,
  body.ui-mode-mobile .mobile-ally-hq-mount,
  body.ui-mode-mobile .mobile-hand-mount{
    margin-top:0!important;
    margin-bottom:0!important;
    padding-bottom:0!important;
  }
  body.ui-mode-mobile .battle-panel{
    gap:0!important;
    row-gap:0!important;
  }
  body.ui-mode-mobile .boardwrap{
    padding-bottom:2px!important;
  }
  body.ui-mode-mobile .mobile-ally-hq-mount{
    margin:0!important;
  }
  body.ui-mode-mobile .mobile-hand-mount{
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    right:auto!important;
    top:auto!important;
    bottom:auto!important;
    transform:none!important;
    width:100%!important;
    margin:0!important;
    scroll-margin-top:0!important;
  }
}

/* PC에서 보는 모바일 미리보기는 viewport가 850px보다 크므로 별도 규칙이 필요하다.
   핸드를 fixed에서 일반 흐름으로 되돌려 전투필드 바로 아래에 붙인다. */
body.ui-mode-mobile-preview,
body.ui-mode-mobile-preview .app{
  margin-bottom:0!important;
  padding-bottom:calc(var(--mobile-action-height,58px) + 4px)!important;
}
body.ui-mode-mobile-preview .battle-panel,
body.ui-mode-mobile-preview .boardwrap,
body.ui-mode-mobile-preview .battlefield-layout,
body.ui-mode-mobile-preview .battlefield-layout>.board,
body.ui-mode-mobile-preview .mobile-ally-hq-mount,
body.ui-mode-mobile-preview .mobile-hand-mount{
  margin-top:0!important;
  margin-bottom:0!important;
  padding-bottom:0!important;
}
body.ui-mode-mobile-preview .battle-panel{
  gap:0!important;
  row-gap:0!important;
}
body.ui-mode-mobile-preview .boardwrap{
  padding-bottom:2px!important;
}
body.ui-mode-mobile-preview .mobile-ally-hq-mount{
  margin:0 auto!important;
}
body.ui-mode-mobile-preview .mobile-hand-mount{
  position:relative!important;
  inset:auto!important;
  left:auto!important;
  right:auto!important;
  top:auto!important;
  bottom:auto!important;
  transform:none!important;
  width:var(--mobile-play-width,418px)!important;
  min-width:var(--mobile-play-width,418px)!important;
  max-width:var(--mobile-play-width,418px)!important;
  margin:0 auto!important;
  z-index:20!important;
  box-shadow:none!important;
  scroll-margin-top:0!important;
}
body.ui-mode-mobile-preview .bottom-hud{
  bottom:0!important;
}

.status-top-art-section{
  margin-top:18px;
  border-top:1px solid rgba(255,255,255,.08);
  padding-top:18px;
}
.status-top-art-preview-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:14px;
  margin-top:12px;
}
.status-top-art-preview-box{
  background:#081523;
  border:1px solid rgba(255,210,120,.28);
  border-radius:14px;
  padding:10px;
}
.status-top-art-preview-title{font-weight:800;margin-bottom:8px;color:#f6d08a}
.status-top-art-preview{
  position:relative;
  min-height:112px;
  border-radius:12px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg,#451114,#0d1a2b 72%);
}
.status-top-art-preview.mobile{min-height:78px;background:linear-gradient(180deg,#182433,#0f1624 72%)}
.status-top-art-preview .mock-title,
.status-top-art-preview .mock-stats,
.status-top-art-preview .mock-mini-label,
.status-top-art-preview .mock-mini-stats{position:relative;z-index:2}
.status-top-art-preview .mock-title{padding:56px 12px 4px;font-size:15px;font-weight:800}
.status-top-art-preview .mock-stats{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;padding:0 12px 12px;font-size:12px;color:#fff}
.status-top-art-preview.mobile .mock-mini-label{padding:28px 8px 2px;font-size:11px;font-weight:800}
.status-top-art-preview.mobile .mock-mini-stats{display:flex;gap:7px;padding:0 8px 8px;font-size:9px}
.status-top-art-preview .status-top-art-layer,
.hq-quickbar .status-top-art-layer,
.mini-quickbar .status-top-art-layer{
  position:absolute;
  background-repeat:no-repeat;
  pointer-events:none;
  z-index:1;
}
.status-top-art-preview .status-top-art-layer{left:10px;right:10px;top:8px;height:44px;opacity:.98;filter:drop-shadow(0 3px 8px rgba(0,0,0,.28));}
.status-top-art-preview.mobile .status-top-art-layer{left:6px;right:6px;top:4px;height:22px}
.hq-quickbar{position:relative;overflow:hidden}
.hq-quickbar.has-status-top-art{padding-top:54px!important}
.hq-quickbar .status-top-art-layer{left:8px;right:8px;top:6px;height:42px;opacity:.98;filter:drop-shadow(0 3px 7px rgba(0,0,0,.32));}
.mini-quickbar{position:relative;overflow:hidden}
.mini-quickbar.has-status-top-art{padding-top:11px!important}
.mini-quickbar .status-top-art-layer{left:3px;right:3px;top:2px;height:10px;opacity:.95;filter:drop-shadow(0 2px 5px rgba(0,0,0,.28));}
.status-top-art-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin-top:12px}
.status-top-art-controls .other-image-adjust-panel{height:100%}
.status-top-art-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.status-top-art-help{font-size:12px;opacity:.8;margin-top:6px}


/* ---- assets/css/v205_effect_title_animation_tuning.css ---- */
/* v205 — 효과 제목과 실제 움직임이 더 직접적으로 연결되도록 연출 보강 */
.hq-card-scene .scene-energy,
.hq-card-scene .scene-particles{will-change:transform,opacity,filter}

.hq-card-scene.fx-beam .scene-energy{animation:v205BeamColumn 1.35s cubic-bezier(.12,.76,.2,1) forwards!important;transform-origin:50% 100%}
.hq-card-scene.fx-flare .scene-energy{animation:v205FlareBurst 1.1s ease-out forwards!important}
.hq-card-scene.fx-lightning .scene-energy{animation:v205LightningFlash 1.05s steps(2,end) forwards!important}
.hq-card-scene.fx-fire .scene-energy{animation:v205FireLift 1.45s ease-out forwards!important;transform-origin:50% 100%}
.hq-card-scene.fx-ice .scene-energy{animation:v205FreezeSpread 1.45s ease-out forwards!important;transform-origin:50% 50%}
.hq-card-scene.fx-smoke .scene-energy{animation:v205SmokeDrift 1.7s ease-out forwards!important;filter:blur(5px)}
.hq-card-scene.fx-petals .scene-energy{animation:v205PetalBreeze 1.55s ease-in-out forwards!important}
.hq-card-scene.fx-shadow .scene-energy{animation:v205ShadowVortex 1.55s cubic-bezier(.3,.05,.2,1) forwards!important}
.hq-card-scene.fx-holy .scene-energy{animation:v205HolyDescend 1.45s ease-out forwards!important;transform-origin:50% 0}
.hq-card-scene.fx-shock .scene-energy{animation:v205ShockImpact 1.05s cubic-bezier(.16,.7,.2,1) forwards!important}
.hq-card-scene.fx-runes .scene-energy{animation:v205RuneSpin 1.65s linear forwards!important}
.hq-card-scene.fx-blood .scene-energy{animation:v205BloodPulse 1.45s ease-out forwards!important}
.hq-card-scene.fx-warcry .scene-energy{animation:v205WarcryWave 1.25s ease-out forwards!important}
.hq-card-scene.fx-dragon .scene-energy{animation:v205DragonCoil 1.7s cubic-bezier(.18,.72,.22,1) forwards!important}
.hq-card-scene.fx-ascend .scene-energy{animation:v205AscendLift 1.65s ease-out forwards!important;transform-origin:50% 100%}
.hq-card-scene.fx-requiem .scene-energy{animation:v205RequiemCollapse 1.75s cubic-bezier(.34,.02,.18,1) forwards!important}

.hq-card-scene.fx-lightning{animation:v205LightningStage 1.05s steps(2,end) forwards!important}
.hq-card-scene.fx-shock{animation:v205ShockStage 1.05s ease-out forwards!important}
.hq-card-scene.fx-warcry{animation:v205WarcryStage 1.25s ease-out forwards!important}
.hq-card-scene.fx-ice{box-shadow:inset 0 0 34px rgba(170,239,255,.8)!important}
.hq-card-scene.fx-fire{box-shadow:inset 0 -28px 45px rgba(255,55,0,.55)!important}
.hq-card-scene.fx-holy{box-shadow:inset 0 0 42px rgba(255,232,144,.5)!important}
.hq-card-scene.fx-shadow,.hq-card-scene.fx-requiem{box-shadow:inset 0 0 48px rgba(0,0,0,.92)!important}

@keyframes v205BeamColumn{0%{opacity:0;transform:scaleX(.18) scaleY(.05);filter:brightness(3)}28%{opacity:1;transform:scaleX(.42) scaleY(1.18);filter:brightness(2.2)}70%{opacity:.95;transform:scaleX(.72) scaleY(1)}100%{opacity:0;transform:scaleX(1.05) scaleY(.96);filter:brightness(1)}}
@keyframes v205FlareBurst{0%{opacity:0;transform:scale(.08) rotate(-25deg);filter:brightness(4)}38%{opacity:1;transform:scale(1.2) rotate(8deg);filter:brightness(2.4)}100%{opacity:0;transform:scale(2.2) rotate(22deg);filter:brightness(1)}}
@keyframes v205LightningFlash{0%,16%,36%{opacity:0;transform:skewX(-12deg) scaleY(.25)}8%,25%,48%{opacity:1;transform:skewX(8deg) scaleY(1.25);filter:brightness(3.5)}100%{opacity:0;transform:skewX(0) scaleY(1)}}
@keyframes v205FireLift{0%{opacity:.15;transform:translateY(45%) scale(.65);filter:saturate(1.2)}55%{opacity:1;transform:translateY(-4%) scale(1.15);filter:saturate(2.2) brightness(1.5)}100%{opacity:0;transform:translateY(-45%) scale(.9);filter:saturate(1)}}
@keyframes v205FreezeSpread{0%{opacity:0;transform:scale(.06) rotate(12deg);filter:blur(6px) brightness(2.5)}48%{opacity:1;transform:scale(1.05) rotate(0);filter:blur(0) brightness(1.7)}100%{opacity:.2;transform:scale(1.28);filter:blur(1px) brightness(1)}}
@keyframes v205SmokeDrift{0%{opacity:0;transform:translate(-18%,28%) scale(.55)}50%{opacity:.95;transform:translate(4%,-2%) scale(1.25)}100%{opacity:0;transform:translate(22%,-24%) scale(1.55)}}
@keyframes v205PetalBreeze{0%{opacity:0;transform:translate(18%,-25%) rotate(-10deg) scale(.7)}48%{opacity:1;transform:translate(-5%,5%) rotate(8deg) scale(1.05)}100%{opacity:0;transform:translate(-24%,34%) rotate(24deg) scale(1.18)}}
@keyframes v205ShadowVortex{0%{opacity:0;transform:scale(1.6) rotate(-120deg);filter:brightness(2)}60%{opacity:1;transform:scale(.78) rotate(35deg);filter:brightness(.7)}100%{opacity:0;transform:scale(.08) rotate(180deg);filter:brightness(.25)}}
@keyframes v205HolyDescend{0%{opacity:0;transform:translateY(-55%) scaleX(.25);filter:brightness(3)}42%{opacity:1;transform:translateY(0) scaleX(.85);filter:brightness(2)}100%{opacity:0;transform:translateY(18%) scaleX(1.15);filter:brightness(1)}}
@keyframes v205ShockImpact{0%{opacity:0;transform:scale(.05)}28%{opacity:1;transform:scale(.35);filter:brightness(3)}100%{opacity:0;transform:scale(2.4);filter:brightness(1)}}
@keyframes v205RuneSpin{0%{opacity:0;transform:scale(.35) rotate(-160deg);filter:brightness(2.2)}45%{opacity:1;transform:scale(1.05) rotate(8deg)}100%{opacity:0;transform:scale(1.18) rotate(150deg);filter:brightness(.8)}}
@keyframes v205BloodPulse{0%{opacity:0;transform:scale(.45);filter:brightness(2.4)}30%{opacity:1;transform:scale(1.18)}52%{transform:scale(.92)}72%{transform:scale(1.08)}100%{opacity:0;transform:scale(1.3);filter:brightness(.7)}}
@keyframes v205WarcryWave{0%{opacity:0;transform:scaleX(.05) scaleY(.55)}36%{opacity:1;transform:scaleX(1.3) scaleY(1.05);filter:brightness(2)}100%{opacity:0;transform:scaleX(2.5) scaleY(.7);filter:brightness(1)}}
@keyframes v205DragonCoil{0%{opacity:0;transform:translate(-28%,25%) scale(.35) rotate(-35deg)}52%{opacity:1;transform:translate(5%,-5%) scale(1.12) rotate(8deg);filter:brightness(1.8)}100%{opacity:0;transform:translate(30%,-28%) scale(1.38) rotate(28deg)}}
@keyframes v205AscendLift{0%{opacity:0;transform:translateY(50%) scale(.55);filter:brightness(2.5)}48%{opacity:1;transform:translateY(-5%) scale(1.05)}100%{opacity:0;transform:translateY(-62%) scale(.82);filter:brightness(1)}}
@keyframes v205RequiemCollapse{0%{opacity:0;transform:scale(1.7) rotate(-18deg);filter:blur(5px) brightness(2)}55%{opacity:1;transform:scale(.72) rotate(8deg);filter:blur(0) brightness(.85)}100%{opacity:0;transform:scale(.02) rotate(42deg);filter:blur(8px) brightness(.2)}}
@keyframes v205LightningStage{0%,18%,38%{filter:brightness(.65)}8%,28%,48%{filter:brightness(2.6)}100%{filter:brightness(1)}}
@keyframes v205ShockStage{0%,100%{transform:translate(0)}22%{transform:translate(-6px,2px)}32%{transform:translate(7px,-2px)}44%{transform:translate(-4px,1px)}58%{transform:translate(3px,-1px)}}
@keyframes v205WarcryStage{0%,100%{transform:scale(1)}28%{transform:scale(1.035)}38%{transform:scale(.985)}50%{transform:scale(1.02)}72%{transform:scale(1)}}

@media (prefers-reduced-motion:reduce){
  .hq-card-scene,.hq-card-scene *{animation-duration:.001ms!important;animation-iteration-count:1!important}
}


/* ---- assets/css/v208_card_effect_idle_art_server.css ---- */
/* v208 — 카드 연출창 기본 이미지 R2/Firestore 서버 저장 UI */
.left-card-effect-body.card-effect-idle-art-host,
.card-effect-idle-preview{
  position:relative!important;
  overflow:hidden!important;
  isolation:isolate;
}
.left-card-effect-body>.card-effect-idle-art-layer,
.card-effect-idle-preview>.card-effect-idle-art-layer{
  position:absolute!important;
  inset:0!important;
  z-index:50!important;
  display:block;
  overflow:hidden;
  pointer-events:none;
  background:transparent;
}
.left-card-effect-body>.card-effect-idle-art-layer[hidden],
.card-effect-idle-preview>.card-effect-idle-art-layer[hidden]{display:none!important;}
.card-effect-idle-art-image{
  position:absolute!important;
  display:block!important;
  max-width:none!important;
  max-height:none!important;
  min-width:0!important;
  min-height:0!important;
  object-fit:fill!important;
  object-position:center!important;
  transform:translate(-50%,-50%)!important;
  transform-origin:center center!important;
  user-select:none!important;
  -webkit-user-drag:none!important;
}
.left-card-effect-body.show-card-effect-idle-art>.card-effect-empty{visibility:hidden!important;}

.card-effect-idle-art-settings{
  padding:14px 16px 16px;
  border-top:1px solid #4a3926;
  background:linear-gradient(180deg,#0d141d,#080c12);
}
.card-effect-idle-settings-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:11px;
}
.card-effect-idle-settings-head b{color:#f3d39d;font-size:14px;}
.card-effect-idle-settings-head span{max-width:360px;color:#9eacba;font-size:10px;line-height:1.4;text-align:right;}
.card-effect-idle-preview-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.card-effect-idle-preview-box{
  min-width:0;
  padding:9px;
  border:1px solid #33485f;
  background:#09121d;
}
.card-effect-idle-preview-title{margin-bottom:7px;color:#d9e8f8;font-size:10px;font-weight:900;}
.card-effect-idle-preview{
  height:126px;
  border:1px solid #314e68;
  background:radial-gradient(circle at 50% 42%,#162a3c,#070c11 72%);
  box-shadow:inset 0 0 18px #000;
  cursor:copy;
}
.card-effect-idle-preview.mobile{height:92px;}
.card-effect-idle-preview.is-dragover{outline:2px solid #efc46f;outline-offset:-3px;}
.card-effect-idle-preview-guide{
  position:absolute;
  left:50%;
  top:50%;
  z-index:2;
  width:calc(100% - 20px);
  transform:translate(-50%,-50%);
  color:#9daaba;
  font-size:9px;
  font-weight:800;
  line-height:1.45;
  text-align:center;
}
.card-effect-idle-preview.has-card-effect-idle-art .card-effect-idle-preview-guide{display:none;}
.card-effect-idle-status{
  margin-top:9px;
  padding:8px 10px;
  border:1px solid #384758;
  background:#080e15;
  color:#a9b5c2;
  font-size:10px;
  font-weight:800;
}
.card-effect-idle-status.registered{border-color:#3f7958;background:#0b1912;color:#a9e7bd;}
.card-effect-idle-controls{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:10px;
}
.card-effect-idle-adjust-panel{
  display:grid;
  gap:7px;
  min-width:0;
  padding:10px;
  border:1px solid #35485b;
  background:#0b141e;
}
.card-effect-idle-adjust-panel>b{color:#fff0ca;font-size:11px;}
.card-effect-idle-adjust-panel label{
  display:grid;
  grid-template-columns:66px minmax(0,1fr) 42px;
  align-items:center;
  gap:6px;
  min-width:0;
  color:#cbd9e6;
  font-size:9px;
  font-weight:800;
}
.card-effect-idle-adjust-panel label.is-disabled{opacity:.43;}
.card-effect-idle-adjust-panel input[type="range"]{min-width:0;width:100%;}
.card-effect-idle-adjust-panel output{color:#9ed0ff;text-align:right;font-size:9px;font-weight:900;}
.card-effect-idle-adjust-panel .card-effect-idle-link-toggle{
  grid-template-columns:auto 1fr;
  grid-column:1/-1;
  color:#f0d5a3;
}
.card-effect-idle-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:11px;
}
.card-effect-idle-help{margin-top:8px;color:#8f9dad;font-size:9px;line-height:1.5;}

/* 이전 잘못된 본진 상태 이미지 기능은 숨김 */
#statusTopArtSection,
.hq-quickbar>.status-top-art-layer,
.mini-quickbar>.status-top-art-layer{display:none!important;}
.hq-quickbar.has-status-top-art,
.mini-quickbar.has-status-top-art{padding-top:initial!important;}

@media(max-width:700px){
  .card-effect-idle-settings-head{display:grid;align-items:start;}
  .card-effect-idle-settings-head span{text-align:left;}
  .card-effect-idle-preview-grid,
  .card-effect-idle-controls{grid-template-columns:1fr;}
  .card-effect-idle-preview{height:110px;}
  .card-effect-idle-preview.mobile{height:86px;}
}

.card-effect-idle-status.server-synced{border-color:#4f9c68!important;box-shadow:inset 0 0 0 1px rgba(79,156,104,.18);}
.card-effect-idle-actions .btn:disabled{opacity:.55;cursor:wait;}


/* ---- assets/css/v212_shop_deck_card_widen.css ---- */
/* ================================================================
   v213 — 항목7: 카드상점 · 덱편집 카드 폭 확대 및 가로:세로 = 2.5 : 4.375 비율 통일
   (2.5:4.375 = 4:7과 동일 비율 — 배율 70)
   - 카드 이름이 잘리던 원인(고정 max-width:45%+font-size:9px, 말줄임 처리)을
     제거하고 이름이 줄바꿈되며 온전히 보이도록 한다.
   - 카드 상점·덱편집 카드 모두 --collection-card-width/height 변수를
     가로:세로 = 2.5:4.375 비율로 통일해 사용한다(기존 JS 자동측정값보다 우선 적용).
   - 이 파일은 항상 마지막에 로드되어 기존 game.css의 좁은 폭/말줄임 규칙을 덮어쓴다.
   ================================================================ */

:root{
  --collection-card-width:175px !important;
  --collection-card-height:306.25px !important;
  --collection-card-title-height:48px !important;
  --collection-card-art-height:174.25px !important;
  --collection-card-stats-height:34px !important;
  --collection-card-desc-height:50px !important;
}

/* 이름이 잘리던 규칙(45% 폭 제한 + 9px 축소 + 말줄임)을 모두 해제하고 줄바꿈으로 전체 표시 */
.collection-card-heading .collection-card-name,
.collection-card-title b,
.collection-card-title .collection-card-name{
  max-width:100% !important;
  width:100% !important;
  font-size:13px !important;
  line-height:1.18 !important;
  white-space:normal !important;
  overflow:visible !important;
  text-overflow:unset !important;
  display:block !important;
}
.collection-card-title{
  min-height:var(--collection-card-title-height) !important;
  align-items:center !important;
}
.collection-card-heading{
  width:100% !important;
}
/* 항목7: 덱편집 카드도 카드상점과 동일하게 상단에 이름·등급만 표시하고, 국가/점수/보유수량 등
   부가 메타 텍스트는 상단에서 숨긴다(정보 자체는 카드 하단·바깥 보유수량 표시에 남아 있음). */
.collection-card-heading small{
  display:none !important;
}
.collection-card-title>em{
  font-size:11px !important;
}

@media(min-width:851px){
  .deck-builder-list,.deck-builder-list.selected,.card-shop-grid{
    grid-template-columns:repeat(auto-fill,var(--collection-card-width)) !important;
    justify-content:start !important;
  }
}

@media(max-width:850px){
  :root{
    --collection-card-width:150px !important;
    --collection-card-height:262.5px !important;
    --collection-card-title-height:42px !important;
    --collection-card-art-height:148px !important;
    --collection-card-stats-height:30px !important;
    --collection-card-desc-height:42.5px !important;
  }
  .deck-builder-list,.deck-builder-list.selected,.card-shop-grid{
    grid-template-columns:repeat(auto-fill,var(--collection-card-width)) !important;
    justify-content:start !important;
  }
}

@media(max-width:560px){
  :root{
    --collection-card-width:144px !important;
    --collection-card-height:252px !important;
    --collection-card-title-height:40px !important;
    --collection-card-art-height:142px !important;
    --collection-card-stats-height:28px !important;
    --collection-card-desc-height:42px !important;
  }
  .collection-card-heading small{display:none !important;}
}

.deck-builder-visual-card,.card-shop-grid .shop-card{
  width:var(--collection-card-width) !important;
  min-width:var(--collection-card-width) !important;
  max-width:var(--collection-card-width) !important;
  height:var(--collection-card-height) !important;
  min-height:var(--collection-card-height) !important;
  max-height:var(--collection-card-height) !important;
  grid-template-rows:var(--collection-card-title-height) var(--collection-card-art-height) var(--collection-card-stats-height) var(--collection-card-desc-height) !important;
}
.deck-builder-visual-card>.collection-card-title,.card-shop-grid .shop-card>.collection-card-title{
  height:var(--collection-card-title-height) !important;
  min-height:var(--collection-card-title-height) !important;
}
.deck-builder-visual-card>.collection-card-art,.card-shop-grid .shop-card>.collection-card-art{
  height:var(--collection-card-art-height) !important;
  min-height:var(--collection-card-art-height) !important;
  max-height:var(--collection-card-art-height) !important;
}
.deck-builder-visual-card>.collection-five-stats,.card-shop-grid .shop-card>.collection-five-stats{
  height:var(--collection-card-stats-height) !important;
  min-height:var(--collection-card-stats-height) !important;
  max-height:var(--collection-card-stats-height) !important;
  font-size:11px !important;
}
.deck-builder-visual-card>.collection-extra,.card-shop-grid .shop-card>.collection-extra{
  height:var(--collection-card-desc-height) !important;
  min-height:var(--collection-card-desc-height) !important;
  max-height:var(--collection-card-desc-height) !important;
  font-size:10.5px !important;
}


/* ---- assets/css/v214_deckeditor_layout.css ---- */
/* ================================================================
   v214 — 덱 편집 UI 재배치 (PC 데스크톱, min-width:851px 기준)
   1) 덱 요약 문구("장수/지략가/병사/아이템/스킬/점수")를 "아군 덱 편집" 제목 옆으로 이동
   2) 랜덤 구성 비율 + "비율대로 랜덤 구성" 버튼을 카드 검색창 옆으로 이동,
      덱 이름 입력창·카드 검색창 폭을 줄여 공간 확보
   3) 보유 최대치 재설정 / 덱초기화 / 현재덱삭제 / 저장 버튼을 닫기 버튼 옆으로
      작게 이동 (기존 하단 전용 액션바 제거)
   4) 카드 목록 · 현재 덱 두 패널만 본문에 노출 (요약/비율/액션바는 모두 상단으로 이동)
   5) 덱 편집 창 전체 폭을 약 30% 축소하고, 카드도 동일 비율(70%)로 축소
   6) 카드 목록은 1줄에 5장, 현재 덱은 1줄에 4장 고정 표시
   이 파일은 항상 마지막에 로드되어 game.css/v212의 기존 규칙을 덮어쓴다.
   ================================================================ */

@media(min-width:851px){

  /* ---- 1) 헤드: 제목+요약문구 / 액션버튼 소형화 ---- */
  .deck-builder-head{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:10px!important;
    flex-wrap:wrap!important;
  }
  .deck-builder-head-title{
    display:flex!important;
    align-items:baseline!important;
    flex-wrap:wrap!important;
    gap:6px 14px!important;
    min-width:0!important;
  }
  .deck-builder-head-title h2{margin:0!important;font-size:16px!important;white-space:nowrap!important;}
  .deck-builder-head-title .deck-builder-summary{
    padding:0!important;
    border:0!important;
    background:none!important;
    color:#cdbb9e!important;
    font-size:11px!important;
    text-align:left!important;
    white-space:normal!important;
  }
  .deck-builder-head-title .deck-builder-summary b{font-size:12px!important;}
  .deck-builder-head-actions{
    display:flex!important;
    align-items:center!important;
    gap:6px!important;
    flex-wrap:wrap!important;
  }
  .btn.small{
    font-size:10px!important;
    padding:4px 9px!important;
    min-height:0!important;
    border-radius:6px!important;
  }

  /* ---- 2) 툴바: 덱이름/검색창 폭 축소 + 랜덤구성비율·버튼을 검색창 옆으로 ---- */
  .deck-builder-toolbar{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:end!important;
    gap:8px!important;
  }
  .deck-builder-toolbar>label{flex:0 0 auto!important;min-width:0!important;}
  #deckBuilderName{width:110px!important;min-width:0!important;flex:0 0 110px!important;}
  .deck-builder-search-cluster{
    display:flex!important;
    align-items:end!important;
    gap:8px!important;
    flex:1 1 320px!important;
    flex-wrap:wrap!important;
  }
  #deckBuilderSearch{width:110px!important;min-width:0!important;flex:0 0 110px!important;}
  .deck-auto-ratio-inline{
    display:flex!important;
    align-items:end!important;
    gap:6px!important;
    flex-wrap:wrap!important;
    padding:4px 8px!important;
    border:1px solid #40301f!important;
    background:#0d1115!important;
    border-radius:4px!important;
  }
  .deck-auto-ratio-inline label{
    display:grid!important;
    gap:2px!important;
    font-size:8px!important;
    color:#cdbb9e!important;
  }
  .deck-auto-ratio-inline input[type=number]{
    width:36px!important;
    min-height:24px!important;
    padding:2px 4px!important;
    background:#111925!important;
    color:#e8edf5!important;
    border:1px solid #45556e!important;
  }
  .deck-auto-ratio-inline .btn{white-space:nowrap!important;align-self:end!important;}

  /* ---- 5)+6) 창 30% 축소 + 카드 5열(목록)/4열(현재 덱) 고정 ----
     카드 크기 변수는 #deckBuilderModal 안에서만 재정의되어 카드상점(다른 모달)에는
     영향을 주지 않는다. */
  #deckBuilderModal{
    --collection-card-width:122.5px;
    --collection-card-height:214.375px;
    --collection-card-title-height:33.6px;
    --collection-card-art-height:121.975px;
    --collection-card-stats-height:23.8px;
    --collection-card-desc-height:35px;
  }
  .deck-builder-box{width:min(1230px,96vw)!important;}
  .deck-builder-main{
    grid-template-columns:662px 528px!important;
    gap:8px!important;
  }
  .deck-builder-list{
    grid-template-columns:repeat(5,var(--collection-card-width))!important;
    gap:6px!important;
    justify-content:start!important;
  }
  .deck-builder-list.selected{
    grid-template-columns:repeat(4,var(--collection-card-width))!important;
    gap:6px!important;
  }
}


/* ---- assets/css/v215_battle_ui_layout.css ---- */
/* v215 — 전투 메뉴 단순화 / 설정 라벨 확대 / 카드 20% 확대 / 전투열 좌측 밀착 */

/* 모바일에서는 기존 전투 설정 제목을 유지한다. */
.v215-setup-labels .v215-desktop-setup-label{display:none;}
.v215-setup-labels .v215-mobile-setup-title{display:inline;}

@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    /* v198 최종 높이 132px의 120%, 비율 2.5 : 3.5 */
    --v215-card-h:158.4px;
    --v215-card-w:113.142857px;
    --v215-field-gap:6px;
    --v215-hand-section-h:355px;
    --v215-formation-w:708.857142px;
    --v215-five-card-w:589.714285px;
    --v215-four-card-w:470.571428px;
    --v215-three-card-w:351.428571px;
    --v215-two-card-w:232.285714px;
    --v215-lane-h:162px;
    --hand-card-width:var(--v215-card-w);
    --hand-card-height:var(--v215-card-h);
  }

  /* 왼쪽 UI 폭을 고정해 3장의 핸드 카드가 내부 폭을 정확히 채우게 한다. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app[style]{
    grid-template-columns:352px minmax(720px,1fr)!important;
    column-gap:0!important;
    gap:0!important;
  }

  /* 1) '전투 메뉴' 제목 줄과 외곽 박스를 제거한다. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-menu-dock{
    padding:0 5px 5px!important;
    border:0!important;
    border-bottom:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-menu-dock>.ornate-title{
    display:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .reference-topbar{
    margin:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .top-card-actions{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:5px!important;
    width:100%!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .top-card-actions #cardShopBtn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .top-card-actions #boosterPackBtn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .top-card-actions #cardManagerBtn{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-width:0!important;
    height:36px!important;
    min-height:36px!important;
    max-height:36px!important;
    padding:4px 5px!important;
    font-size:11px!important;
    font-weight:900!important;
    line-height:1.1!important;
    white-space:nowrap!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .top-card-actions #cardManagerBtn{
    border-color:#7c5cff!important;
    background:linear-gradient(180deg,#4932a8,#281568)!important;
    color:#f5efff!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-auth-logged-in{
    grid-template-columns:minmax(0,1fr) minmax(72px,auto)!important;
  }

  /* 관리자 권한이 없거나 hidden 상태이면 기존 접근 제어를 유지한다. */
  html:not(.is-card-admin) body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .top-card-actions #cardManagerBtn,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .top-card-actions #cardManagerBtn[hidden]{
    display:none!important;
  }
  html:not(.is-card-admin) body.unified-left-layout:not(.ui-mode-mobile-preview) #leftMenuMount .top-card-actions{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  /* 2) 전투진영 / 덱설정 / 덱편집 라벨 및 조작 글씨 확대 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .v215-setup-labels{
    display:grid!important;
    grid-template-columns:82px minmax(0,1fr) 76px!important;
    align-items:center!important;
    gap:5px!important;
    height:34px!important;
    min-height:34px!important;
    padding:0 7px!important;
    margin:0 -7px 6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .v215-setup-labels .v215-mobile-setup-title{
    display:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .v215-setup-labels .v215-desktop-setup-label{
    display:block!important;
    min-width:0!important;
    color:#f3d39d!important;
    font-size:15px!important;
    font-weight:950!important;
    line-height:1!important;
    text-align:center!important;
    letter-spacing:-.04em!important;
    white-space:nowrap!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .formation-inline{
    grid-template-columns:82px minmax(0,1fr) 76px!important;
    gap:5px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .formation-inline select,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .formation-inline .btn{
    height:35px!important;
    min-height:35px!important;
    max-height:35px!important;
    padding:3px 5px!important;
    font-size:12px!important;
    font-weight:900!important;
  }

  /* 카드 애니메이션 박스: 최신 PC 높이 251px에서 5% 축소 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-body{
    height:238.45px!important;
    min-height:238.45px!important;
    max-height:238.45px!important;
  }

  /* 3) 핸드 카드 20% 확대, 2.5 : 3.5 비율, 핸드 영역을 빈틈없이 채움 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:var(--v215-hand-section-h)!important;
    min-height:var(--v215-hand-section-h)!important;
    max-height:var(--v215-hand-section-h)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .handbox{
    padding:5px!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    display:grid!important;
    grid-template-columns:repeat(3,var(--v215-card-w))!important;
    grid-template-rows:repeat(2,var(--v215-card-h))!important;
    grid-auto-rows:var(--v215-card-h)!important;
    width:100%!important;
    height:316.8px!important;
    min-height:316.8px!important;
    max-height:316.8px!important;
    gap:0!important;
    padding:0!important;
    margin:0!important;
    justify-content:start!important;
    align-content:start!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card{
    width:var(--v215-card-w)!important;
    min-width:var(--v215-card-w)!important;
    max-width:var(--v215-card-w)!important;
    height:var(--v215-card-h)!important;
    min-height:var(--v215-card-h)!important;
    max-height:var(--v215-card-h)!important;
    margin:0!important;
    aspect-ratio:2.5 / 3.5!important;
    border-radius:0!important;
  }

  /* 전투필드 카드도 핸드와 같은 크기와 비율로 통일 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:var(--v215-card-w)!important;
    min-width:var(--v215-card-w)!important;
    max-width:var(--v215-card-w)!important;
    height:var(--v215-card-h)!important;
    min-height:var(--v215-card-h)!important;
    max-height:var(--v215-card-h)!important;
    margin:0!important;
    padding:0!important;
    aspect-ratio:2.5 / 3.5!important;
    border-radius:0!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.unit{
    width:100%!important;
    height:100%!important;
    min-width:0!important;
    min-height:0!important;
    max-width:none!important;
    max-height:none!important;
    border-radius:0!important;
    overflow:hidden!important;
  }

  /* 확대된 카드에 맞춰 모든 전투열 박스와 슬롯 그리드를 재계산 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    width:var(--v215-formation-w)!important;
    min-width:var(--v215-formation-w)!important;
    max-width:var(--v215-formation-w)!important;
    height:var(--v215-lane-h)!important;
    min-height:var(--v215-lane-h)!important;
    max-height:var(--v215-lane-h)!important;
    flex:0 0 var(--v215-lane-h)!important;
    padding:1px 0 0!important;
    margin-left:0!important;
    margin-right:0!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    height:var(--v215-card-h)!important;
    min-height:var(--v215-card-h)!important;
    max-height:var(--v215-card-h)!important;
    padding:0!important;
    gap:var(--v215-field-gap)!important;
    align-items:stretch!important;
    align-content:stretch!important;
    justify-content:center!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    display:grid!important;
    grid-template-columns:repeat(5,var(--v215-card-w))!important;
    width:var(--v215-five-card-w)!important;
    min-width:var(--v215-five-card-w)!important;
    max-width:var(--v215-five-card-w)!important;
    margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    display:grid!important;
    grid-template-columns:repeat(4,var(--v215-card-w))!important;
    width:var(--v215-four-card-w)!important;
    min-width:var(--v215-four-card-w)!important;
    max-width:var(--v215-four-card-w)!important;
    margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    display:grid!important;
    grid-template-columns:repeat(3,var(--v215-card-w))!important;
    width:var(--v215-three-card-w)!important;
    min-width:var(--v215-three-card-w)!important;
    max-width:var(--v215-three-card-w)!important;
    margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    display:grid!important;
    grid-template-columns:repeat(2,var(--v215-card-w))!important;
    width:var(--v215-two-card-w)!important;
    min-width:var(--v215-two-card-w)!important;
    max-width:var(--v215-two-card-w)!important;
    margin:0 auto!important;
  }

  /* 4) 전투열 박스를 왼쪽 게임창에 바로 붙임 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    margin-left:0!important;
    margin-right:auto!important;
    padding-left:0!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.river{
    width:var(--v215-formation-w)!important;
    min-width:var(--v215-formation-w)!important;
    max-width:var(--v215-formation-w)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    align-items:flex-start!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app[style]{
    grid-template-columns:352px minmax(720px,1fr)!important;
  }
  /* 낮은 화면에서 기존 238px 기준으로 동일하게 5% 축소 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-body{
    height:226.1px!important;
    min-height:226.1px!important;
    max-height:226.1px!important;
  }
}


/* ---- assets/css/v216_card_ratio_effect_readability.css ---- */
/* v216 — 카드 2.7:4.2 비율 / 본진 하단 보정 / 연출 절제 / 카드 정보 가독성 */

/* 연출 내부의 문자·설명 오버레이는 표시하지 않는다. */
.hq-card-scene .scene-label,
.hq-card-scene .scene-effect-caption,
.left-card-effect-stage-badge{display:none!important}

/* 카드 애니메이션 박스는 원본 이미지를 확대·크롭하지 않고 자연 크기 이하로 표시한다. */
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene:not(.fx-none) img{
  inset:0!important;
  margin:auto!important;
  width:auto!important;
  height:auto!important;
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
  transform-origin:center!important;
  animation:v216NaturalPreview 1.35s ease-out forwards!important;
}
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene.holding img{
  animation:none!important;
  transform:translate(0,0) scale(1)!important;
}

.left-card-effect-stage .hq-card-scene.left-effect-preview-scene.fx-none img{
  inset:0!important;
  margin:auto!important;
  width:auto!important;
  height:auto!important;
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
  animation:none!important;
  transform:translate(0,0) scale(1)!important;
  filter:none!important;
}
@keyframes v216NaturalPreview{
  0%{opacity:0;transform:translateY(8px) scale(.98);filter:brightness(.82)}
  34%{opacity:1;transform:translateY(0) scale(1);filter:brightness(1.08)}
  100%{opacity:1;transform:translateY(0) scale(1);filter:none}
}

/* 공통: 과도한 반짝임을 줄이고 최대 4개의 입자만 사용한다. */
.hq-card-scene .scene-particles{filter:none!important;opacity:.62!important}
.hq-card-scene .scene-particles i:nth-child(n+5){display:none!important}

/* 연출 없음: 이미지만 정적으로 표시하고 모든 시각 효과를 제거한다. */
.hq-card-scene.fx-none{background:#070b10!important;animation:none!important;filter:none!important}
.hq-card-scene.fx-none img{
  animation:none!important;
  opacity:1!important;
  transform:scale(var(--scene-scale,1))!important;
  filter:none!important;
}
.hq-card-scene.fx-none .scene-shade,
.hq-card-scene.fx-none .scene-energy,
.hq-card-scene.fx-none .scene-particles,
.hq-card-scene.fx-none::before,
.hq-card-scene.fx-none::after{display:none!important;content:none!important}

/* 끝부분에 반복되던 원형 파동과 기본 스킬 룬 문자 제거 */
.hq-card-scene.summon::before,
.hq-card-scene.summon::after,
.hq-card-scene.tactic::before,
.hq-card-scene.tactic::after,
.hq-card-scene.death::before,
.hq-card-scene.death::after{display:none!important;content:none!important}

/* 텍스트·문자 기호 기반 효과 제거 */
.hq-card-scene.fx-ice::after,
.hq-card-scene.fx-petals::before,
.hq-card-scene.fx-holy::after,
.hq-card-scene.fx-runes::before,
.hq-card-scene.fx-runes::after,
.hq-card-scene.fx-warcry::before,
.hq-card-scene.fx-dragon::before,
.hq-card-scene.fx-requiem::before{content:none!important;display:none!important}

/* 화염: 화면 아래에서 불길이 번져 올라오는 형태로 단순화 */
.hq-card-scene.fx-fire .scene-particles{display:none!important}
.hq-card-scene.fx-fire::before{
  content:''!important;
  display:block!important;
  position:absolute!important;
  z-index:4!important;
  left:-8%!important;
  right:-8%!important;
  top:auto!important;
  bottom:-32%!important;
  height:82%!important;
  background:
    radial-gradient(ellipse at 10% 100%,#fff0a3 0 4%,#ff9b24 5% 11%,#d9340d 12% 22%,transparent 23%),
    radial-gradient(ellipse at 30% 100%,#fff0a3 0 5%,#ff8a1d 6% 13%,#c9230b 14% 25%,transparent 26%),
    radial-gradient(ellipse at 52% 100%,#fff4b3 0 5%,#ff9b24 6% 14%,#e12c0c 15% 26%,transparent 27%),
    radial-gradient(ellipse at 74% 100%,#fff0a3 0 4%,#ff7e18 5% 12%,#c62009 13% 24%,transparent 25%),
    radial-gradient(ellipse at 92% 100%,#fff0a3 0 4%,#ff9b24 5% 11%,#d9340d 12% 22%,transparent 23%);
  filter:blur(2px) saturate(1.35)!important;
  mix-blend-mode:screen!important;
  transform-origin:50% 100%!important;
  animation:v216FireRise 1.55s cubic-bezier(.2,.72,.2,1) forwards!important;
}
.hq-card-scene.fx-fire::after{
  content:''!important;
  display:block!important;
  position:absolute!important;
  z-index:3!important;
  inset:0!important;
  background:linear-gradient(0deg,#d92b008f 0%,#ff6b002e 44%,transparent 72%)!important;
  animation:v216FireGlow 1.55s ease-out forwards!important;
}
@keyframes v216FireRise{
  0%{opacity:0;transform:translateY(36%) scaleY(.45)}
  28%{opacity:.94}
  72%{opacity:.82;transform:translateY(-12%) scaleY(1.18)}
  100%{opacity:0;transform:translateY(-34%) scaleY(1.4)}
}
@keyframes v216FireGlow{0%{opacity:0}28%{opacity:.82}78%{opacity:.48}100%{opacity:0}}

/* 전장의 함성: 글자·원형파 대신 출진 시 먼지와 전진 기류를 표현 */
.hq-card-scene.fx-warcry{animation:v216WarcryPush 1.35s ease-out forwards!important}
.hq-card-scene.fx-warcry::before{
  content:''!important;
  display:block!important;
  position:absolute!important;
  z-index:5!important;
  inset:42% -18% -18%!important;
  background:
    linear-gradient(168deg,transparent 0 22%,#e8c17b66 23% 26%,transparent 27% 42%,#b77b3d55 43% 47%,transparent 48%),
    linear-gradient(12deg,transparent 0 28%,#f2d29a55 29% 32%,transparent 33% 58%,#98602d55 59% 63%,transparent 64%);
  filter:blur(2px)!important;
  transform-origin:50% 100%!important;
  animation:v216WarDust 1.3s ease-out forwards!important;
}
.hq-card-scene.fx-warcry::after{
  content:''!important;
  display:block!important;
  position:absolute!important;
  z-index:4!important;
  inset:0!important;
  background:linear-gradient(90deg,#100a0699,transparent 25% 75%,#100a0699),linear-gradient(0deg,#a3642638,transparent 58%)!important;
  animation:v216WarVignette 1.35s ease-out forwards!important;
}
.hq-card-scene.fx-warcry .scene-particles i{
  display:block!important;
  top:auto!important;
  bottom:5%!important;
  width:15px!important;
  height:5px!important;
  border:0!important;
  border-radius:45%!important;
  background:#d4ad72!important;
  box-shadow:none!important;
  animation:v216DustDrift 1.25s ease-out forwards!important;
}
.hq-card-scene.fx-warcry .scene-particles i:nth-child(1){left:12%!important}
.hq-card-scene.fx-warcry .scene-particles i:nth-child(2){left:36%!important;animation-delay:.08s!important}
.hq-card-scene.fx-warcry .scene-particles i:nth-child(3){left:62%!important;animation-delay:.16s!important}
.hq-card-scene.fx-warcry .scene-particles i:nth-child(4){left:84%!important;animation-delay:.23s!important}
@keyframes v216WarcryPush{0%{transform:translateX(-2%);filter:brightness(.72)}28%{transform:translateX(1.2%);filter:brightness(1.15)}100%{transform:none;filter:none}}
@keyframes v216WarDust{0%{opacity:0;transform:translateY(28%) scale(.75)}35%{opacity:.8}100%{opacity:0;transform:translateY(-38%) scale(1.35)}}
@keyframes v216WarVignette{0%{opacity:0}30%{opacity:.8}100%{opacity:0}}
@keyframes v216DustDrift{0%{opacity:0;transform:translate(0,20px) scale(.4)}30%{opacity:.72}100%{opacity:0;transform:translate(26px,-115px) scale(1.5)}}

/* 꽃잎 효과를 우아한 낙엽 효과로 변경 */
.hq-card-scene.fx-petals .scene-energy{background:linear-gradient(180deg,#e7c98a1f,transparent 40%,#8e5a2629)!important}
.hq-card-scene.fx-petals .scene-particles{display:block!important;opacity:.85!important}
.hq-card-scene.fx-petals .scene-particles i{
  display:block!important;
  top:-18%!important;
  width:10px!important;
  height:17px!important;
  border:0!important;
  border-radius:80% 18% 75% 22%!important;
  background:linear-gradient(145deg,#e7b65b,#9b4f1d 72%)!important;
  box-shadow:0 1px 2px #1d0d0680!important;
  animation:v216LeafFall 1.85s cubic-bezier(.22,.58,.35,1) forwards!important;
}
.hq-card-scene.fx-petals .scene-particles i:nth-child(1){left:12%!important;--leaf-x:42px;--leaf-r:210deg}
.hq-card-scene.fx-petals .scene-particles i:nth-child(2){left:35%!important;--leaf-x:-28px;--leaf-r:-170deg;animation-delay:.18s!important}
.hq-card-scene.fx-petals .scene-particles i:nth-child(3){left:62%!important;--leaf-x:34px;--leaf-r:190deg;animation-delay:.08s!important}
.hq-card-scene.fx-petals .scene-particles i:nth-child(4){left:84%!important;--leaf-x:-38px;--leaf-r:-225deg;animation-delay:.28s!important}
@keyframes v216LeafFall{
  0%{opacity:0;transform:translate(0,-12px) rotate(0) scale(.7)}
  18%{opacity:.95}
  62%{opacity:.9;transform:translate(calc(var(--leaf-x) * .5),58vh) rotate(calc(var(--leaf-r) * .55)) scale(1)}
  100%{opacity:0;transform:translate(var(--leaf-x),118vh) rotate(var(--leaf-r)) scale(.92)}
}

/* 충격파는 원형 대신 지면을 가르는 수평 파동으로 표현 */
.hq-card-scene.fx-shock::before,
.hq-card-scene.fx-shock::after{
  content:''!important;
  display:block!important;
  position:absolute!important;
  z-index:5!important;
  left:50%!important;
  top:auto!important;
  bottom:13%!important;
  width:22%!important;
  height:5px!important;
  border:0!important;
  border-radius:0!important;
  background:linear-gradient(90deg,transparent,#d8f4ff,#7dcfe8,#d8f4ff,transparent)!important;
  box-shadow:0 0 13px #7fdcff!important;
  animation:v216GroundShock 1.05s ease-out forwards!important;
}
.hq-card-scene.fx-shock::after{animation-delay:.12s!important}
.hq-card-scene.fx-shock .scene-particles{display:none!important}
@keyframes v216GroundShock{0%{opacity:0;transform:translateX(-50%) scaleX(.15)}28%{opacity:.95}100%{opacity:0;transform:translateX(-50%) scaleX(5.2)}}

/* 룬·혼백의 마지막 원형 연출 제거 */
.hq-card-scene.fx-runes .scene-particles,
.hq-card-scene.fx-requiem::after{display:none!important;content:none!important}

@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    /* v215 가로 113.142857px의 105%, 비율 2.7 : 4.2 */
    --v216-card-w:118.8px;
    --v216-card-h:184.8px;
    --v216-card-gap:6px;
    --v216-hand-h:369.6px;
    --v216-hand-w:356.4px;
    --v216-hand-section-h:408px;
    --v216-formation-w:742.8px;
    --v216-five-card-w:618px;
    --v216-four-card-w:493.2px;
    --v216-three-card-w:368.4px;
    --v216-two-card-w:243.6px;
    --v216-lane-h:198px;
    --hand-card-width:var(--v216-card-w);
    --hand-card-height:var(--v216-card-h);
    --tcg-card-head:31px;
    --tcg-card-stat:38px;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .app,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app[style]{
    grid-template-columns:382px minmax(760px,1fr)!important;
    column-gap:0!important;
    gap:0!important;
  }

  /* 핸드 카드와 전투필드 카드: 2.7 : 4.2 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:var(--v216-hand-section-h)!important;
    min-height:var(--v216-hand-section-h)!important;
    max-height:var(--v216-hand-section-h)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .handbox{padding:5px!important;overflow:hidden!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    display:grid!important;
    grid-template-columns:repeat(3,var(--v216-card-w))!important;
    grid-template-rows:repeat(2,var(--v216-card-h))!important;
    grid-auto-rows:var(--v216-card-h)!important;
    width:var(--v216-hand-w)!important;
    min-width:var(--v216-hand-w)!important;
    max-width:var(--v216-hand-w)!important;
    height:var(--v216-hand-h)!important;
    min-height:var(--v216-hand-h)!important;
    max-height:var(--v216-hand-h)!important;
    gap:0!important;
    padding:0!important;
    margin:0!important;
    justify-content:start!important;
    align-content:start!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    box-sizing:border-box!important;
    width:var(--v216-card-w)!important;
    min-width:var(--v216-card-w)!important;
    max-width:var(--v216-card-w)!important;
    height:var(--v216-card-h)!important;
    min-height:var(--v216-card-h)!important;
    max-height:var(--v216-card-h)!important;
    margin:0!important;
    padding:0!important;
    aspect-ratio:2.7 / 4.2!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.unit{
    width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;overflow:hidden!important;
  }

  /* 카드 이름·공방체·병과·능력 정보를 더 크게 표시 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-title-area,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .card-title-area{
    padding:4px 5px!important;gap:3px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-name-text,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .field-unit-name{
    font-size:14px!important;font-weight:1000!important;letter-spacing:-.04em!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-title-grade,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .field-grade{
    min-width:25px!important;height:20px!important;font-size:10px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span{
    position:relative!important;
    display:grid!important;
    grid-template-rows:12px 1fr!important;
    place-items:center!important;
    padding:2px 1px!important;
    font-size:17px!important;
    font-weight:1000!important;
    color:#fff!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell b{font-size:17px!important;line-height:1!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell::before,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span::before{
    display:block!important;font-size:9px!important;font-weight:1000!important;line-height:1!important;color:#e5c78d!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell:nth-child(1)::before,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span:nth-child(1)::before{content:'공격'}
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell:nth-child(2)::before,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span:nth-child(2)::before{content:'방어'}
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell:nth-child(3)::before,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span:nth-child(3)::before{content:'체력'}

  body.unified-left-layout:not(.ui-mode-mobile-preview) .general-class-hand-badge,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .soldier-class-hand-icon,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit-class-icon{
    position:absolute!important;
    left:4px!important;
    right:auto!important;
    bottom:5px!important;
    z-index:12!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:auto!important;
    min-width:0!important;
    max-width:62px!important;
    height:21px!important;
    padding:2px 6px!important;
    border:1px solid #d8b676aa!important;
    border-radius:4px!important;
    background:#080b10e8!important;
    color:#ffe6b0!important;
    font-size:10px!important;
    font-weight:1000!important;
    line-height:1!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .card-ability-label,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .unit-ability-label{
    position:absolute!important;
    z-index:13!important;
    left:5px!important;
    right:5px!important;
    top:5px!important;
    display:block!important;
    padding:3px 5px!important;
    border:1px solid #9eb8d066!important;
    border-radius:3px!important;
    background:#06101bdd!important;
    color:#eff8ff!important;
    font-size:10px!important;
    font-weight:950!important;
    line-height:1.15!important;
    text-align:center!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    text-shadow:0 1px 2px #000!important;
  }

  /* 확대된 카드에 맞춰 전투열 폭과 높이를 재계산 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > #allyBaseDefenseLane{
    box-sizing:border-box!important;
    width:var(--v216-formation-w)!important;
    min-width:var(--v216-formation-w)!important;
    max-width:var(--v216-formation-w)!important;
    height:var(--v216-lane-h)!important;
    min-height:var(--v216-lane-h)!important;
    max-height:var(--v216-lane-h)!important;
    flex:0 0 var(--v216-lane-h)!important;
    padding:2px 0 4px!important;
    margin:0!important;
    overflow:visible!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    box-sizing:border-box!important;
    height:var(--v216-card-h)!important;
    min-height:var(--v216-card-h)!important;
    max-height:var(--v216-card-h)!important;
    padding:0!important;
    gap:var(--v216-card-gap)!important;
    align-items:stretch!important;
    align-content:stretch!important;
    justify-content:center!important;
    overflow:visible!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    grid-template-columns:repeat(5,var(--v216-card-w))!important;
    width:var(--v216-five-card-w)!important;min-width:var(--v216-five-card-w)!important;max-width:var(--v216-five-card-w)!important;margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    grid-template-columns:repeat(4,var(--v216-card-w))!important;
    width:var(--v216-four-card-w)!important;min-width:var(--v216-four-card-w)!important;max-width:var(--v216-four-card-w)!important;margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    grid-template-columns:repeat(3,var(--v216-card-w))!important;
    width:var(--v216-three-card-w)!important;min-width:var(--v216-three-card-w)!important;max-width:var(--v216-three-card-w)!important;margin:0 auto!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    grid-template-columns:repeat(2,var(--v216-card-w))!important;
    width:var(--v216-two-card-w)!important;min-width:var(--v216-two-card-w)!important;max-width:var(--v216-two-card-w)!important;margin:0 auto!important;
  }

  /* 본진 전투열 하단 카드가 잘리지 않도록 별도 여유 확보 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) #enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #allyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .hq-defense-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .enemy-hq-defense-lane{
    padding-bottom:6px!important;
    overflow:visible!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #enemyBaseDefenseLane .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #allyBaseDefenseLane .hq-battlefield-grid{
    overflow:visible!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.river{
    width:var(--v216-formation-w)!important;
    min-width:var(--v216-formation-w)!important;
    max-width:var(--v216-formation-w)!important;
    overflow:visible!important;
  }
}

@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app[style]{grid-template-columns:382px minmax(760px,1fr)!important}
}

@media (min-width:851px){
  /* 전투필드의 능력 배지는 상단의 버프·스킬·정찰 표식과 겹치지 않게 하단 정보열 위에 배치한다. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .unit-ability-label{
    top:auto!important;
    bottom:31px!important;
    left:5px!important;
    right:5px!important;
    font-size:11px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-ability-label{
    font-size:11px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .general-class-hand-badge,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .soldier-class-hand-icon,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit-class-icon{
    font-size:11px!important;
  }
}


/* ---- assets/css/v217_effect_dropdown_fix.css ---- */
/* v217 — 연출효과 드롭다운을 모달 바깥 고정 레이어로 표시 */
.scene-effect-native-select{
  cursor:pointer!important;
  position:relative!important;
  z-index:2!important;
}
.scene-effect-dropdown-menu{
  position:fixed;
  display:none;
  box-sizing:border-box;
  min-width:220px;
  padding:6px;
  overflow-y:auto;
  overscroll-behavior:contain;
  border:1px solid #8eb7df;
  border-radius:9px;
  background:linear-gradient(180deg,#13243a 0%,#08111e 100%);
  box-shadow:0 18px 45px #000d,0 0 0 1px #ffffff12 inset;
  z-index:2147483000;
  scrollbar-width:thin;
  scrollbar-color:#577ca2 #08111e;
}
.scene-effect-dropdown-menu.open{display:block}
.scene-effect-dropdown-option{
  display:flex;
  align-items:center;
  width:100%;
  min-height:36px;
  margin:0 0 3px;
  padding:8px 10px;
  border:1px solid transparent;
  border-radius:6px;
  background:transparent;
  color:#eaf4ff;
  font-size:12px;
  font-weight:800;
  line-height:1.25;
  text-align:left;
  cursor:pointer;
}
.scene-effect-dropdown-option:last-child{margin-bottom:0}
.scene-effect-dropdown-option:hover,
.scene-effect-dropdown-option:focus-visible{
  border-color:#75b9ef;
  background:#1b3a59;
  outline:none;
}
.scene-effect-dropdown-option[aria-selected="true"]{
  border-color:#e7bd6b;
  background:linear-gradient(90deg,#59401d,#24364a);
  color:#fff3ce;
}
.scene-effect-dropdown-option:disabled{opacity:.42;cursor:not-allowed}
.scene-effect-dropdown-backdrop{
  position:fixed;
  inset:0;
  display:none;
  z-index:2147482999;
  background:transparent;
}
.scene-effect-dropdown-backdrop.open{display:block}
@media(max-width:760px){
  .scene-effect-dropdown-menu{
    min-width:0;
    border-radius:10px;
  }
  .scene-effect-dropdown-option{min-height:42px;font-size:13px}
}


/* ---- assets/css/v218_compact_faction_cards.css ---- */
/* =====================================================================
   v218 — 1/4 축소 대응 심플 국가별 카드 디자인
   위(청색) · 촉(녹색) · 오(적색) · 기타(보라색)
   핵심 정보 우선순위: 이름 > EN > 등급 > 이미지 > 공격/방어/체력
   ===================================================================== */

:root{
  --v218-gold:#d8b85d;
  --v218-gold-soft:#f1d98d;
  --v218-ink:#070a0e;
  --v218-stat-h:30px;
}

/* 국가 팔레트 */
#hand.hand .card.wei,.battlefield-layout .unit.wei,.faction-wei{
  --v218-main:#174f91;--v218-deep:#071d39;--v218-soft:#5f9bdd;--v218-glyph:'魏';
}
#hand.hand .card.shu,.battlefield-layout .unit.shu,.faction-shu{
  --v218-main:#216b3b;--v218-deep:#082715;--v218-soft:#6daf79;--v218-glyph:'蜀';
}
#hand.hand .card.wu,.battlefield-layout .unit.wu,.faction-wu{
  --v218-main:#8f241f;--v218-deep:#360806;--v218-soft:#d45a50;--v218-glyph:'吳';
}
#hand.hand .card.other,.battlefield-layout .unit.other,.faction-other,
#hand.hand .card.item,#hand.hand .card.tactic{
  --v218-main:#5c2d79;--v218-deep:#1d092c;--v218-soft:#9b67bb;--v218-glyph:'群';
}

/* 전투 핸드 + 필드 카드 공통 */
#hand.hand .card,
.battlefield-layout .unit{
  border:2px solid var(--v218-gold)!important;
  border-radius:9px!important;
  background:var(--v218-deep,#111)!important;
  box-shadow:0 3px 9px #000b,inset 0 0 0 1px rgba(255,255,255,.13)!important;
  isolation:isolate!important;
}

#hand.hand .card .card-title-area,
.battlefield-layout .unit .card-title-area{
  grid-template-columns:minmax(0,1fr) auto!important;
  padding:2px 5px 2px 7px!important;
  border-bottom:1px solid var(--v218-gold)!important;
  background:linear-gradient(180deg,var(--v218-main,#394552),var(--v218-deep,#131921))!important;
  box-shadow:inset 0 -1px rgba(0,0,0,.35)!important;
}

#hand.hand .card .card-name-text,
.battlefield-layout .unit .field-unit-name{
  color:#fff!important;
  font-family:"Malgun Gothic","Apple SD Gothic Neo",sans-serif!important;
  font-size:12px!important;
  font-weight:1000!important;
  letter-spacing:-.055em!important;
  text-align:center!important;
  text-shadow:0 1px 2px #000!important;
}

#hand.hand .card .card-title-grade,
.battlefield-layout .unit .field-grade{
  min-width:25px!important;
  height:17px!important;
  padding:0 4px!important;
  border:1px solid var(--v218-gold-soft)!important;
  border-radius:4px!important;
  background:#15100be8!important;
  color:#ffe992!important;
  font-size:9px!important;
  font-weight:1000!important;
  box-shadow:none!important;
  text-shadow:0 1px #000!important;
}

#hand.hand .card .cimg,
.battlefield-layout .unit .uimg{
  background:linear-gradient(180deg,var(--v218-deep,#0d1218),#05070a)!important;
}

/* 그림 가장자리만 어둡게 처리해 작은 카드에서도 얼굴·실루엣이 선명하게 보이도록 함 */
#hand.hand .card .cimg::after,
.battlefield-layout .unit .uimg::after,
.collection-card-art::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:3;
  pointer-events:none;
  background:linear-gradient(180deg,rgba(0,0,0,.04) 52%,rgba(0,0,0,.62) 100%),linear-gradient(90deg,rgba(0,0,0,.20),transparent 18%,transparent 82%,rgba(0,0,0,.20));
}

/* 국가 문양: 장식 대신 한 글자만 크게 */
#hand.hand .card .cimg::before,
.battlefield-layout .unit .uimg::before,
.faction-wei .collection-card-art::before,
.faction-shu .collection-card-art::before,
.faction-wu .collection-card-art::before,
.faction-other .collection-card-art::before{
  content:var(--v218-glyph,'群');
  position:absolute;
  right:4px;
  top:4px;
  z-index:8;
  display:grid;
  place-items:center;
  width:20px;
  height:20px;
  border:1px solid var(--v218-gold-soft);
  border-radius:50%;
  background:color-mix(in srgb,var(--v218-deep,#111) 88%,transparent);
  color:#fff4c3;
  font-family:"Malgun Myeongjo","Batang",serif;
  font-size:12px;
  font-weight:1000;
  line-height:1;
  text-shadow:0 1px 2px #000;
  box-shadow:0 1px 4px #000b;
  pointer-events:none;
}

/* 기존 우측 하단 아이콘 묶음을 이미지 전체 오버레이로 전환 */
#hand.hand .card .card-bottom-icons,
.battlefield-layout .unit .unit-bottom-icons{
  inset:0!important;
  right:auto!important;
  bottom:auto!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  z-index:10!important;
}

/* 카드 종류 아이콘 */
#hand.hand .card .card-bottom-icons>span:first-child,
.battlefield-layout .unit .unit-bottom-icons>span:first-child{
  position:absolute!important;
  left:4px!important;
  bottom:4px!important;
  display:grid!important;
  place-items:center!important;
  width:20px!important;
  height:20px!important;
  border:1px solid var(--v218-gold-soft)!important;
  border-radius:5px!important;
  background:rgba(5,7,10,.86)!important;
  color:#fff!important;
  font-size:12px!important;
  text-shadow:none!important;
}

/* EN 비용 */
#hand.hand .card .card-ap-icon,
.battlefield-layout .unit .unit-bottom-icons>span:last-child{
  position:absolute!important;
  left:4px!important;
  top:4px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:29px!important;
  height:24px!important;
  padding:0 4px!important;
  border:2px solid var(--v218-gold-soft)!important;
  border-radius:999px!important;
  background:var(--v218-deep,#111)!important;
  color:#fff!important;
  font-size:0!important;
  font-weight:1000!important;
  text-shadow:none!important;
  box-shadow:0 2px 5px #000b!important;
}
#hand.hand .card .card-ap-icon::before,
.battlefield-layout .unit .unit-bottom-icons>span:last-child::before{
  content:attr(data-en) ' EN';
  font-size:10px;
  line-height:1;
  white-space:nowrap;
}

/* 작은 카드에서는 중복 부가 아이콘과 문구를 정리 */
#hand.hand .card .card-bottom-icons>span:not(:first-child):not(.card-ap-icon),
.battlefield-layout .unit .unit-bottom-icons>span:not(:first-child):not(:last-child),
#hand.hand .card .card-ability-label,
#hand.hand .card .hand-buff-provider-badge,
#hand.hand .card .general-class-hand-badge,
#hand.hand .card .soldier-class-hand-icon,
.battlefield-layout .unit .unit-ability-label,
.battlefield-layout .unit .unit-class-icon,
.battlefield-layout .unit .unit-buff-box,
.battlefield-layout .unit .unit-skill-box,
.battlefield-layout .unit .unit-scout-badge{
  display:none!important;
}

/* 공격/방어/체력: 숫자를 최대한 크게, 의미는 작은 아이콘으로만 표시 */
#hand.hand .card .cstats,
.battlefield-layout .unit .stats{
  border-top:1px solid var(--v218-gold)!important;
  background:var(--v218-deep,#10161d)!important;
}
#hand.hand .card .card-stat-cell,
.battlefield-layout .unit .stats span{
  position:relative!important;
  gap:2px!important;
  border-right:1px solid color-mix(in srgb,var(--v218-gold) 70%,transparent)!important;
  background:linear-gradient(180deg,color-mix(in srgb,var(--v218-main,#333) 82%,#000),var(--v218-deep,#111))!important;
  color:#fff!important;
  font-size:13px!important;
  font-weight:1000!important;
  text-shadow:0 1px 2px #000!important;
}
#hand.hand .card .card-stat-cell b{font-size:14px!important;line-height:1!important}
#hand.hand .card .card-stat-cell::before,
.battlefield-layout .unit .stats span::before{
  color:#ffe48b;
  font-size:9px;
  font-weight:1000;
  line-height:1;
}
#hand.hand .card .card-stat-cell:nth-child(1)::before,
.battlefield-layout .unit .stats span:nth-child(1)::before{content:'⚔'}
#hand.hand .card .card-stat-cell:nth-child(2)::before,
.battlefield-layout .unit .stats span:nth-child(2)::before{content:'◆'}
#hand.hand .card .card-stat-cell:nth-child(3)::before,
.battlefield-layout .unit .stats span:nth-child(3)::before{content:'♥';color:#ff7777}

/* 사용 가능 상태는 글자 대신 녹색 점으로 축소 */
#hand.hand .card .card-ready-badge{
  position:absolute!important;
  left:4px!important;
  top:50%!important;
  width:7px!important;
  min-width:7px!important;
  height:7px!important;
  padding:0!important;
  border:1px solid #d7ffd7!important;
  border-radius:50%!important;
  background:#40d861!important;
  color:transparent!important;
  overflow:hidden!important;
  box-shadow:0 0 6px #4cff72!important;
}

/* 아이템/전술은 국가 공용(기타) 보라색으로 명확히 구분 */
#hand.hand .card.item,
#hand.hand .card.tactic{
  --v218-main:#5c2d79;--v218-deep:#1d092c;--v218-soft:#9b67bb;--v218-glyph:'策';
}
#hand.hand .card.utility-card .cimg::before{content:'策'}

/* 덱 편집기 / 상점 카드에도 동일 국가색 적용 */
.deck-builder-visual-card,
.card-shop-grid .shop-card{
  border:2px solid var(--v218-gold)!important;
  border-radius:8px!important;
  background:var(--v218-deep,#101216)!important;
  box-shadow:0 3px 8px #0009,inset 0 0 0 1px rgba(255,255,255,.10)!important;
}
.deck-builder-visual-card>.collection-card-title,
.card-shop-grid .shop-card>.collection-card-title{
  background:linear-gradient(180deg,var(--v218-main,#3c2d25),var(--v218-deep,#17110e))!important;
  border-bottom:1px solid var(--v218-gold)!important;
}
.collection-card-title .collection-card-name,
.collection-card-title>b{
  color:#fff!important;
  font-size:11px!important;
  font-weight:1000!important;
  letter-spacing:-.045em!important;
  text-shadow:0 1px 2px #000!important;
}
.collection-card-title>em{
  border:1px solid var(--v218-gold-soft)!important;
  background:#15100be8!important;
  color:#ffe992!important;
  border-radius:4px!important;
  font-size:8px!important;
}
.deck-builder-visual-card>.collection-card-art,
.card-shop-grid .shop-card>.collection-card-art{
  background:var(--v218-deep,#101216)!important;
}
.collection-card-icons{
  inset:0!important;
  right:auto!important;
  bottom:auto!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  z-index:10!important;
}
.collection-card-icons .collection-type-icon,
.collection-card-icons>span:first-child{
  position:absolute!important;
  left:4px!important;
  bottom:4px!important;
  display:grid!important;
  place-items:center!important;
  width:19px!important;
  height:19px!important;
  border:1px solid var(--v218-gold-soft)!important;
  border-radius:5px!important;
  background:rgba(5,7,10,.86)!important;
  color:#fff!important;
  font-size:11px!important;
}
.collection-card-icons .collection-en-icon,
.collection-card-icons>span:last-child{
  position:absolute!important;
  left:4px!important;
  top:4px!important;
  min-width:27px!important;
  height:22px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0 4px!important;
  border:2px solid var(--v218-gold-soft)!important;
  border-radius:999px!important;
  background:var(--v218-deep,#111)!important;
  color:#fff!important;
  font-size:0!important;
  text-shadow:none!important;
}
.collection-card-icons .collection-en-icon::before,
.collection-card-icons>span:last-child::before{content:attr(data-en) ' EN';font-size:9px;line-height:1;white-space:nowrap}
.collection-card-icons>span:not(:first-child):not(:last-child){display:none!important}
.deck-builder-visual-card>.collection-five-stats,
.card-shop-grid .shop-card>.collection-five-stats{
  border-top:1px solid var(--v218-gold)!important;
  border-bottom:0!important;
  background:linear-gradient(180deg,var(--v218-main,#303640),var(--v218-deep,#121820))!important;
  color:#fff!important;
  font-size:11px!important;
  font-weight:1000!important;
  letter-spacing:.02em!important;
  text-shadow:0 1px 2px #000!important;
}
.collection-stat-core{font-size:12px!important;color:#fff!important}
.collection-stat-mind{font-size:8px!important;color:#ffeaa0!important}
.deck-builder-visual-card>.collection-extra,
.card-shop-grid .shop-card>.collection-extra{
  background:#090c10!important;
  color:#d9dee6!important;
  border-top:1px solid rgba(255,255,255,.10)!important;
}

/* 1/4급 소형 카드에서 다시 한 번 간결화 */
@media (max-width:850px){
  #hand.hand .card .card-name-text,
  .battlefield-layout .unit .field-unit-name{font-size:9px!important}
  #hand.hand .card .card-title-grade,
  .battlefield-layout .unit .field-grade{min-width:20px!important;height:14px!important;font-size:7px!important;padding:0 2px!important}
  #hand.hand .card .cimg::before,
  .battlefield-layout .unit .uimg::before{width:16px;height:16px;font-size:9px;right:3px;top:3px}
  #hand.hand .card .card-ap-icon,
  .battlefield-layout .unit .unit-bottom-icons>span:last-child{left:3px!important;top:3px!important;min-width:24px!important;height:19px!important;border-width:1px!important}
  #hand.hand .card .card-ap-icon::before,
  .battlefield-layout .unit .unit-bottom-icons>span:last-child::before{font-size:8px!important}
  #hand.hand .card .card-bottom-icons>span:first-child,
  .battlefield-layout .unit .unit-bottom-icons>span:first-child{left:3px!important;bottom:3px!important;width:16px!important;height:16px!important;font-size:9px!important}
  #hand.hand .card .card-stat-cell,
  .battlefield-layout .unit .stats span{font-size:9px!important;padding:0!important}
  #hand.hand .card .card-stat-cell b{font-size:10px!important}
  #hand.hand .card .card-stat-cell::before,
  .battlefield-layout .unit .stats span::before{font-size:7px!important}
}

/* color-mix 미지원 브라우저용 기본값 */
@supports not (background:color-mix(in srgb,#000 50%,#fff)){
  #hand.hand .card .cimg::before,.battlefield-layout .unit .uimg::before,
  .faction-wei .collection-card-art::before,.faction-shu .collection-card-art::before,
  .faction-wu .collection-card-art::before,.faction-other .collection-card-art::before{background:rgba(8,10,14,.88)}
  #hand.hand .card .card-stat-cell,.battlefield-layout .unit .stats span{background:var(--v218-deep,#111)!important}
}


/* ---- assets/css/v219_field_card_polish.css ---- */
/* =====================================================================
   v219 — 전투필드 4건 보정
   1) 전투열(라인) 박스가 화면 오른쪽으로 잘리는 문제 방지
   2) 핸드 · 전투필드 카드 5% 축소
   3) EN 원형 배지: "N EN" → 숫자만
   4) 카드 등급 배지: 등급별 색상 구분
   5) 하단 공격/방어/체력: 문구 제거, 숫자만 표시
   ===================================================================== */

/* ---------- 1) 전투열 우측 잘림 방지 ---------- */
/* v216이 강제한 minmax(760px,1fr) 최소폭이 실제 창 폭보다 넓을 때
   .boardwrap의 overflow-x:hidden(v200)과 맞물려 오른쪽이 통째로
   화면 밖으로 밀려나 보이지 않는 현상이 원인. 최소폭을 카드 축소분에
   맞춰 줄이고, 혹시 남는 초과분은 잘리지 않고 스크롤되도록 안전장치를 둔다. */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app[style]{
    grid-template-columns:382px minmax(716px,1fr)!important;
  }
}
@media (min-width:851px) and (max-height:900px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app[style]{
    grid-template-columns:382px minmax(716px,1fr)!important;
  }
}
body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel,
body.unified-left-layout:not(.ui-mode-mobile-preview) .boardwrap{
  overflow-x:auto!important;
}

/* ---------- 2) 핸드 · 전투필드 카드 5% 축소 ---------- */
/* v216이 정의한 카드 크기 변수(--v216-card-w 등)를 그대로 재정의하면
   핸드·전투열·본진 5칸 등 이를 참조하는 모든 규칙에 자동 반영된다. */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v216-card-w:112.86px;
    --v216-card-h:175.56px;
    --v216-hand-h:351.12px;
    --v216-hand-w:338.58px;
    --v216-hand-section-h:389.12px;
    --v216-formation-w:705.66px;
    --v216-five-card-w:588.3px;
    --v216-four-card-w:469.44px;
    --v216-three-card-w:350.58px;
    --v216-two-card-w:231.72px;
    --v216-lane-h:188.1px;
  }
}

/* ---------- 3) EN 원형 배지: 숫자만 ---------- */
#hand.hand .card .card-ap-icon::before,
.battlefield-layout .unit .unit-bottom-icons>span:last-child::before,
.collection-card-icons .collection-en-icon::before,
.collection-card-icons>span:last-child::before{
  content:attr(data-en)!important;
}

/* ---------- 4) 카드 등급 배지: 등급별 색상 ---------- */
#hand.hand .card .card-title-grade.grade-SSS,
.battlefield-layout .unit .field-grade.grade-SSS,
.collection-card-title>em.grade-SSS{border-color:var(--grade-sss)!important;color:var(--grade-sss)!important}
#hand.hand .card .card-title-grade.grade-SS,
.battlefield-layout .unit .field-grade.grade-SS,
.collection-card-title>em.grade-SS{border-color:var(--grade-ss)!important;color:var(--grade-ss)!important}
#hand.hand .card .card-title-grade.grade-S,
.battlefield-layout .unit .field-grade.grade-S,
.collection-card-title>em.grade-S{border-color:var(--grade-s)!important;color:var(--grade-s)!important}
#hand.hand .card .card-title-grade.grade-RR,
.battlefield-layout .unit .field-grade.grade-RR,
.collection-card-title>em.grade-RR{border-color:var(--grade-rr)!important;color:var(--grade-rr)!important}
#hand.hand .card .card-title-grade.grade-R,
.battlefield-layout .unit .field-grade.grade-R,
.collection-card-title>em.grade-R{border-color:var(--grade-r)!important;color:var(--grade-r)!important}
#hand.hand .card .card-title-grade.grade-U,
.battlefield-layout .unit .field-grade.grade-U,
.collection-card-title>em.grade-U{border-color:var(--grade-u)!important;color:var(--grade-u)!important}
#hand.hand .card .card-title-grade.grade-C,
.battlefield-layout .unit .field-grade.grade-C,
.collection-card-title>em.grade-C{border-color:var(--grade-c)!important;color:var(--grade-c)!important}

/* ---------- 5) 하단 공격/방어/체력: 문구 제거, 숫자만 ---------- */
/* v216이 ::before로 "공격"/"방어"/"체력" 글자를 넣던 규칙(더 높은 우선순위로
   v218의 아이콘 시도를 계속 이겨왔음)을 동일 선택자+!important로 무력화. */
body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell::before,
body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span::before,
#hand.hand .card .card-stat-cell::before,
.battlefield-layout .unit .stats span::before{
  content:none!important;
  display:none!important;
}
body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell,
body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span{
  grid-template-rows:1fr!important;
}


/* ---- assets/css/v220_en_badge_unify.css ---- */
/* =====================================================================
   v220 — 원형 배지 통합 + 이미지 미등록 카드 처리
   1) 카드 우측 상단의 국가 문양 원 → EN(필요 행동력) 숫자로 대체
   2) 기존 좌측 상단 EN 원형 배지는 완전히 제거(중복 표시 정리)
   ※ 이미지가 등록되지 않은 카드를 빈 칸으로 두는 처리와, 이미지 등록 시
     Cloudflare 1일 요청 한도가 급격히 소모되던 문제의 원인 제거는
     assets/js/game.js(cardVisual, getAutoFolderCardImageInfo)에서 처리했다.
   ===================================================================== */

/* ---------- 1) 국가 문양 원 → EN 숫자 ---------- */
#hand.hand .card .cimg::before,
.battlefield-layout .unit .uimg::before,
.faction-wei .collection-card-art::before,
.faction-shu .collection-card-art::before,
.faction-wu .collection-card-art::before,
.faction-other .collection-card-art::before,
.collection-card-art::before{
  content:attr(data-en)!important;
  font-family:"Malgun Gothic","Apple SD Gothic Neo",sans-serif!important;
  font-size:11px!important;
  font-weight:1000!important;
}
#hand.hand .card.utility-card .cimg::before{content:attr(data-en)!important}
@media (max-width:850px){
  #hand.hand .card .cimg::before,
  .battlefield-layout .unit .uimg::before{font-size:9px!important}
}

/* ---------- 2) 기존 EN 원형 배지 삭제 ---------- */
#hand.hand .card .card-ap-icon,
.battlefield-layout .unit .unit-bottom-icons>span:last-child,
.collection-card-icons .collection-en-icon,
.collection-card-icons>span:last-child{
  display:none!important;
}


/* ---- assets/css/v221_affordable_name_highlight.css ---- */
/* =====================================================================
   v221 — 사용 가능 카드 표시 방식 변경
   기존: 카드 이름 옆에 "가능" 배지(v218에서 작은 초록 점으로 축소돼 있었음)
   변경: 배지를 완전히 삭제하고, 대신 카드 이름 글자색과 이름이 있는
        상단 박스(제목 영역) 배경색이 초록빛으로 바뀌어 사용 가능 여부를 표시
   ===================================================================== */

#hand.hand .card .card-ready-badge{display:none!important}

#hand.hand .card.affordable .card-title-area{
  background:linear-gradient(180deg,#2f8f52,#0d3a20)!important;
  border-bottom-color:#8ff0ae!important;
}
#hand.hand .card.affordable .card-name-text{
  color:#eeffee!important;
  text-shadow:0 0 6px #4cff72,0 1px 2px #000!important;
}


/* ---- assets/css/v222_field_layout_fix.css ---- */
/* =====================================================================
   v222 — 전투필드 3건 보정
   1) 전투열 "추가효과" 배너가 카드 이름을 가리던 문제 → 배너 전용 공간을
      확보해 카드 내용과 겹치지 않게 이동
   2) 카드 중간 특수능력 표시를 더 간결하게(작은 글씨/여백)
   3) 전투열에서 카드 높이가 슬롯보다 커서 아래쪽이 잘리는 문제 방지
   ===================================================================== */

/* ---------- 3-a) 카드 높이가 슬롯보다 커서 잘리는 문제: box-sizing 정리 ---------- */
/* .unit에 box-sizing:border-box가 빠져 있어 테두리(border)만큼 실제 렌더링
   높이가 슬롯(overflow:hidden)보다 커져 아래쪽 몇 px가 잘리고 있었을 가능성이
   높음 — 슬롯과 동일하게 border-box로 맞춰 테두리가 높이에 포함되게 한다. */
.battlefield-layout .slot,
.battlefield-layout .hq-field-slot,
.battlefield-layout .unit{
  box-sizing:border-box!important;
}

@media (min-width:851px){
  /* ---------- 3-b) 모든 전투열에 기본 여유 높이 추가 ---------- */
  /* 카드·슬롯 자체 크기는 그대로 두고, 라인(칸 전체) 높이만 살짝 늘려
     빠듯했던 여유 공간을 넉넉하게 만든다. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane[data-row]{
    height:calc(var(--v216-lane-h, 198px) + 6px)!important;
    min-height:calc(var(--v216-lane-h, 198px) + 6px)!important;
    max-height:calc(var(--v216-lane-h, 198px) + 6px)!important;
    flex:0 0 calc(var(--v216-lane-h, 198px) + 6px)!important;
  }

  /* ---------- 1) 추가효과 배너: 카드 위 전용 공간으로 이동 ---------- */
  /* 위 3-b 규칙과 선택자 특이도가 같으므로, 더 늘려야 하는 이 규칙을
     파일 안에서 나중에 두어 synergy-active 라인에서 우선 적용되게 한다.
     배너가 뜬 라인만 높이를 한 번 더 늘려 카드를 밀어내지 않고 그 위에
     배너 전용 공간을 확보한다(다른 라인/카드 크기는 영향 없음). */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board > .lane.synergy-active{
    height:calc(var(--v216-lane-h, 198px) + 15px)!important;
    min-height:calc(var(--v216-lane-h, 198px) + 15px)!important;
    max-height:calc(var(--v216-lane-h, 198px) + 15px)!important;
    flex:0 0 calc(var(--v216-lane-h, 198px) + 15px)!important;
    padding-top:17px!important;
  }
}
.lane .lane-synergy-tag{
  top:1px!important;
  padding:1px 7px!important;
  font-size:8px!important;
  line-height:1.3!important;
  max-width:70%!important;
}

/* ---------- 2) 특수능력 표시(카드 중간) 간결화 ---------- */
/* v216의 body 접두 선택자가 v218의 숨김 시도를 특이도로 계속 이겨 표시는
   유지되고 있었음(카드 이름과 별개 위치이긴 하나 박스가 크고 눈에 띔) —
   동일 체인에 위치·크기만 훨씬 간결하게 다시 정의(표시 자체는 유지). */
body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .unit-ability-label{
  display:block!important;
  position:absolute!important;
  top:auto!important;
  bottom:29px!important;
  left:4px!important;
  right:4px!important;
  z-index:13!important;
  padding:1px 4px!important;
  border:1px solid #9eb8d055!important;
  border-radius:3px!important;
  background:#06101bb8!important;
  color:#eff8ff!important;
  font-size:8px!important;
  font-weight:850!important;
  line-height:1.25!important;
  text-align:center!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  text-shadow:0 1px 2px #000!important;
}


/* ---- assets/css/v223_hand_field_badge_fix.css ---- */
/* =====================================================================
   v223 — 3건 재보정
   1) "가능" 배지가 계속 보인다는 재보고 → 선택자 특이도를 v216과 동일한
      body 접두 체인까지 끌어올려 어떤 상황에서도 반드시 이기도록 강화
   2) 사용 가능 카드의 이름/이름박스 밝은색 표시도 동일하게 특이도 강화
   3) 전투필드(전투열)에 배치된 유닛은 우측 상단 EN 숫자 원을 표시하지 않음
      (핸드 카드에서는 계속 표시 — 손패에서 낼 때만 필요한 정보이므로)
   ===================================================================== */

/* ---------- 1) '가능' 배지 삭제(강화) ---------- */
body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-ready-badge,
#hand.hand .card .card-ready-badge{
  display:none!important;
  content:none!important;
}

/* ---------- 2) 사용 가능 카드: 이름/이름박스 밝은색(강화) ---------- */
body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.affordable .card-title-area,
#hand.hand .card.affordable .card-title-area{
  background:linear-gradient(180deg,#2f8f52,#0d3a20)!important;
  border-bottom-color:#8ff0ae!important;
}
body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.affordable .card-name-text,
#hand.hand .card.affordable .card-name-text{
  color:#eeffee!important;
  text-shadow:0 0 6px #4cff72,0 1px 2px #000!important;
}

/* ---------- 3) 전투필드 유닛: EN 숫자 원 숨김(핸드 카드는 그대로 표시) ---------- */
.battlefield-layout .unit .uimg::before{
  content:none!important;
  display:none!important;
}


/* ---- assets/css/v224_sample_card_entry_fix.css ---- */
/* =====================================================================
   v224 — 샘플 시트형 카드 / EN 테두리 표시 / 필드 잘림 방지 / 등장 방식
   ===================================================================== */

:root{
  --v224-card-ratio:2.5 / 3.5;
  --v224-gold:#c8a45c;
  --v224-gold-bright:#ffe7a0;
  --v224-black:#07090c;
  --v224-paper:#d8ccb2;
}

/* ---------------------------------------------------------------------
   1~4, 8~9. 샘플 시트 비율과 전투필드 크기
   기존의 세로로 긴 2.7:4.2 카드보다 짧게 만들어 전투열 하단이 잘리지 않는다.
   --------------------------------------------------------------------- */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v216-card-w:102px;
    --v216-card-h:143px;
    --v216-hand-h:286px;
    --v216-hand-w:306px;
    --v216-hand-section-h:324px;
    --v216-formation-w:651px;
    --v216-five-card-w:534px;
    --v216-four-card-w:426px;
    --v216-three-card-w:318px;
    --v216-two-card-w:210px;
    --v216-lane-h:151px;
    --hand-card-width:var(--v216-card-w);
    --hand-card-height:var(--v216-card-h);
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:var(--v216-hand-section-h)!important;
    min-height:var(--v216-hand-section-h)!important;
    max-height:var(--v216-hand-section-h)!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-rows:repeat(2,var(--v216-card-h))!important;
    grid-auto-rows:var(--v216-card-h)!important;
    height:var(--v216-hand-h)!important;
    min-height:var(--v216-hand-h)!important;
    max-height:var(--v216-hand-h)!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane[data-row],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.hq-defense-lane{
    height:var(--v216-lane-h)!important;
    min-height:var(--v216-lane-h)!important;
    max-height:var(--v216-lane-h)!important;
    flex-basis:var(--v216-lane-h)!important;
    padding:3px 0 5px!important;
    overflow:visible!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane.synergy-active{
    height:calc(var(--v216-lane-h) + 14px)!important;
    min-height:calc(var(--v216-lane-h) + 14px)!important;
    max-height:calc(var(--v216-lane-h) + 14px)!important;
    flex-basis:calc(var(--v216-lane-h) + 14px)!important;
    padding-top:17px!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .hq-battlefield-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .hq-field-slot{
    height:var(--v216-card-h)!important;
    min-height:var(--v216-card-h)!important;
    max-height:var(--v216-card-h)!important;
  }
}

#hand.hand .card,
.battlefield-layout .unit{
  box-sizing:border-box!important;
  aspect-ratio:var(--v224-card-ratio)!important;
  display:grid!important;
  grid-template-rows:22px minmax(0,1fr) 25px!important;
  border:2px solid var(--v224-gold)!important;
  border-radius:5px!important;
  background:var(--v218-deep,#10151b)!important;
  overflow:hidden!important;
  box-shadow:0 3px 9px #000c,inset 0 0 0 1px #f6dda42b!important;
}

#hand.hand .card.utility-card{
  grid-template-rows:22px minmax(0,1fr) 36px!important;
}

.battlefield-layout .slot,
.battlefield-layout .hq-field-slot,
.battlefield-layout .slot>.unit,
.battlefield-layout .hq-field-slot>.unit{
  box-sizing:border-box!important;
  min-height:0!important;
  max-height:none!important;
}
.battlefield-layout .slot>.unit,
.battlefield-layout .hq-field-slot>.unit{
  width:100%!important;
  height:100%!important;
}

/* ---------------------------------------------------------------------
   샘플 시트형 상단: 종류 리본 + 한 줄 카드명
   --------------------------------------------------------------------- */
#hand.hand .card .card-title-area,
.battlefield-layout .unit .card-title-area{
  position:relative!important;
  display:grid!important;
  grid-template-columns:31px minmax(0,1fr)!important;
  align-items:center!important;
  gap:2px!important;
  min-height:22px!important;
  height:22px!important;
  padding:0 4px 0 0!important;
  border-bottom:1px solid var(--v224-gold)!important;
  background:linear-gradient(180deg,var(--v218-main,#394552),var(--v218-deep,#131921))!important;
  overflow:hidden!important;
}

#hand.hand .card .card-kind-ribbon,
.battlefield-layout .unit .card-kind-ribbon{
  align-self:stretch;
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:31px;
  padding:0 3px;
  color:#f8f3e7;
  background:color-mix(in srgb,var(--v218-main,#38506c) 76%,#0a0d12);
  border-right:1px solid #d7bd7a88;
  clip-path:polygon(0 0,100% 0,86% 100%,0 100%);
  font-size:7.5px;
  font-weight:950;
  line-height:1;
  white-space:nowrap;
  text-shadow:0 1px 2px #000;
}

#hand.hand .card .card-name-text,
.battlefield-layout .unit .field-unit-name{
  display:block!important;
  min-width:0!important;
  width:100%!important;
  padding:0 2px!important;
  color:#fff!important;
  font-family:"Malgun Gothic","Apple SD Gothic Neo",sans-serif!important;
  font-size:11px!important;
  font-weight:950!important;
  line-height:1!important;
  letter-spacing:-.055em!important;
  text-align:center!important;
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
  text-shadow:0 1px 2px #000!important;
  transform-origin:center!important;
}

/* 기존 제목줄 등급은 완전히 제거. v224 등급은 이미지 좌측 상단에 표시한다. */
#hand.hand .card .card-title-area>.card-title-grade,
.battlefield-layout .unit .card-title-area>.field-grade{
  display:none!important;
}

#hand.hand .card .cimg,
.battlefield-layout .unit .uimg{
  position:relative!important;
  min-height:0!important;
  overflow:hidden!important;
  border:0!important;
  background:linear-gradient(180deg,var(--v218-deep,#10151b),#050608)!important;
}

#hand.hand .card .card-image-grade,
.battlefield-layout .unit .card-image-grade{
  position:absolute!important;
  z-index:15!important;
  left:4px!important;
  top:4px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:22px!important;
  height:17px!important;
  padding:0 4px!important;
  border:0!important;
  border-radius:2px!important;
  background:#071018d6!important;
  color:#fff0a5!important;
  font-size:9px!important;
  font-weight:1000!important;
  line-height:1!important;
  text-shadow:0 1px 2px #000,0 0 4px currentColor!important;
  box-shadow:none!important;
}

#hand.hand .card .card-kind-strip,
.battlefield-layout .unit .card-kind-strip{
  position:absolute!important;
  z-index:14!important;
  left:50%!important;
  bottom:3px!important;
  transform:translateX(-50%)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:48px!important;
  max-width:70%!important;
  height:14px!important;
  padding:0 7px!important;
  border:1px solid #d2b56d99!important;
  border-radius:2px!important;
  background:#07090cda!important;
  color:#f5e4bd!important;
  font-size:7.5px!important;
  font-weight:950!important;
  line-height:1!important;
  white-space:nowrap!important;
  text-shadow:0 1px 2px #000!important;
}

/* 샘플 시트처럼 종류 아이콘 대신 하단 종류 띠를 사용한다. */
#hand.hand .card .card-bottom-icons>span:first-child,
.battlefield-layout .unit .unit-bottom-icons>span:first-child{
  display:none!important;
}

/* 등급별 색 */
#hand.hand .card .card-image-grade.grade-SSS,
.battlefield-layout .unit .card-image-grade.grade-SSS{color:var(--grade-sss,#ffd861)!important}
#hand.hand .card .card-image-grade.grade-SS,
.battlefield-layout .unit .card-image-grade.grade-SS{color:var(--grade-ss,#d9a0ff)!important}
#hand.hand .card .card-image-grade.grade-S,
.battlefield-layout .unit .card-image-grade.grade-S{color:var(--grade-s,#ffdf7a)!important}
#hand.hand .card .card-image-grade.grade-RR,
.battlefield-layout .unit .card-image-grade.grade-RR{color:var(--grade-rr,#a9e8ff)!important}
#hand.hand .card .card-image-grade.grade-R,
.battlefield-layout .unit .card-image-grade.grade-R{color:var(--grade-r,#a9d4ff)!important}
#hand.hand .card .card-image-grade.grade-U,
.battlefield-layout .unit .card-image-grade.grade-U{color:var(--grade-u,#cfdae8)!important}
#hand.hand .card .card-image-grade.grade-C,
.battlefield-layout .unit .card-image-grade.grade-C{color:var(--grade-c,#d0d0d0)!important}

/* ---------------------------------------------------------------------
   EN: 사용 가능 박스 제거 + 충족 시 카드 테두리만 밝게
   --------------------------------------------------------------------- */
#hand.hand .card .card-ready-badge{
  display:none!important;
  content:none!important;
}
#hand.hand .card.affordable .card-title-area{
  background:linear-gradient(180deg,var(--v218-main,#394552),var(--v218-deep,#131921))!important;
  border-bottom-color:var(--v224-gold)!important;
}
#hand.hand .card.affordable .card-name-text{
  color:#fff!important;
  text-shadow:0 1px 2px #000!important;
}
#hand.hand .card.affordable{
  border-color:var(--v224-gold-bright)!important;
  box-shadow:0 0 0 1px #fff3ba,0 0 12px 3px #ffd96b99,inset 0 0 10px #fff2a52b!important;
  filter:brightness(1.09) saturate(1.06)!important;
}
#hand.hand .card.affordable.selected{
  outline-color:#fff6c7!important;
  box-shadow:0 0 0 2px #fff6c7,0 0 16px 5px #ffd96baa!important;
}

/* EN 위치: 장수/지략가/병사는 좌하단, 아이템/전술은 우하단 */
#hand.hand .card .card-ap-icon{
  left:4px!important;
  right:auto!important;
  top:auto!important;
  bottom:3px!important;
  z-index:16!important;
  min-width:25px!important;
  height:20px!important;
  padding:0 4px!important;
  border:1px solid #f0d58a!important;
  border-radius:3px 8px 3px 3px!important;
  background:#07111bdd!important;
}
#hand.hand .card.utility-card .card-ap-icon{
  left:auto!important;
  right:4px!important;
  border-radius:8px 3px 3px 3px!important;
}
#hand.hand .card .card-ap-icon::before{
  content:'EN ' attr(data-en)!important;
  font-size:8px!important;
  font-style:italic!important;
  white-space:nowrap!important;
}

/* 전투필드 EN은 이전 요구사항대로 숨긴다. */
.battlefield-layout .unit .unit-ap-icon,
.battlefield-layout .unit .uimg::before{
  display:none!important;
  content:none!important;
}

/* ---------------------------------------------------------------------
   하단 능력치 / 아이템·전술 설명. 글자가 칸 밖으로 가려지지 않게 자동 축소 대상.
   --------------------------------------------------------------------- */
#hand.hand .card .cstats,
.battlefield-layout .unit .stats{
  height:25px!important;
  min-height:25px!important;
  padding:0!important;
  border-top:1px solid var(--v224-gold)!important;
  background:var(--v224-paper)!important;
  color:#111!important;
}
#hand.hand .card .card-stat-grid,
.battlefield-layout .unit .stats{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:0!important;
  height:100%!important;
}
#hand.hand .card .card-stat-cell,
.battlefield-layout .unit .stats span{
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:center!important;
  gap:2px!important;
  min-width:0!important;
  height:100%!important;
  padding:0 2px!important;
  border-right:1px solid #4b3922aa!important;
  background:linear-gradient(180deg,#e6dcc5,#bcae91)!important;
  color:#15120d!important;
  font-size:8px!important;
  font-weight:900!important;
  line-height:1!important;
  text-shadow:none!important;
  white-space:nowrap!important;
}
#hand.hand .card .card-stat-cell:last-child,
.battlefield-layout .unit .stats span:last-child{border-right:0!important}
#hand.hand .card .card-stat-cell b{
  font-size:13px!important;
  color:#111!important;
  line-height:1!important;
}
#hand.hand .card .card-stat-cell::before,
.battlefield-layout .unit .stats span::before{
  display:inline!important;
  color:#19150e!important;
  font-size:7px!important;
  font-weight:950!important;
  line-height:1!important;
}
#hand.hand .card .card-stat-cell:nth-child(1)::before,
.battlefield-layout .unit .stats span:nth-child(1)::before{content:'공격'!important}
#hand.hand .card .card-stat-cell:nth-child(2)::before,
.battlefield-layout .unit .stats span:nth-child(2)::before{content:'방어'!important}
#hand.hand .card .card-stat-cell:nth-child(3)::before,
.battlefield-layout .unit .stats span:nth-child(3)::before{content:'체력'!important}

#hand.hand .card .card-effect-text{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  height:36px!important;
  min-height:36px!important;
  padding:3px 5px!important;
  border-top:1px solid var(--v224-gold)!important;
  background:linear-gradient(180deg,#13171b,#07090c)!important;
  color:#f2eee5!important;
  font-size:8.5px!important;
  font-weight:750!important;
  line-height:1.18!important;
  text-align:center!important;
  word-break:keep-all!important;
  overflow:visible!important;
}
#hand.hand .card .card-effect-text>span{
  display:block!important;
  width:100%!important;
  max-height:100%!important;
  overflow:visible!important;
}

/* 부가 배지는 샘플 카드 본문을 가리지 않도록 숨긴다. */
#hand.hand .card .card-ability-label,
#hand.hand .card .hand-buff-provider-badge,
#hand.hand .card .general-class-hand-badge,
#hand.hand .card .soldier-class-hand-icon,
.battlefield-layout .unit .unit-ability-label,
.battlefield-layout .unit .unit-class-icon,
.battlefield-layout .unit .unit-buff-box,
.battlefield-layout .unit .unit-skill-box,
.battlefield-layout .unit .unit-scout-badge{
  display:none!important;
}

/* 자동 글자 맞춤 JS가 계산한 크기를 우선한다. */
.card-name-text[data-v224-fit],
.field-unit-name[data-v224-fit]{font-size:var(--v224-fit-size,11px)!important}
.card-effect-text[data-v224-fit]{font-size:var(--v224-effect-fit-size,8.5px)!important}

/* 모바일에서도 한 줄 이름과 샘플 비율 유지 */
@media (max-width:850px){
  #hand.hand .card,
  .battlefield-layout .unit{
    aspect-ratio:var(--v224-card-ratio)!important;
    grid-template-rows:18px minmax(0,1fr) 21px!important;
  }
  #hand.hand .card.utility-card{grid-template-rows:18px minmax(0,1fr) 31px!important}
  #hand.hand .card .card-title-area,
  .battlefield-layout .unit .card-title-area{height:18px!important;min-height:18px!important;grid-template-columns:26px minmax(0,1fr)!important}
  #hand.hand .card .card-kind-ribbon,
  .battlefield-layout .unit .card-kind-ribbon{min-width:26px!important;font-size:6px!important}
  #hand.hand .card .card-name-text,
  .battlefield-layout .unit .field-unit-name{font-size:8px!important}
  #hand.hand .card .card-image-grade,
  .battlefield-layout .unit .card-image-grade{min-width:18px!important;height:14px!important;font-size:7px!important;left:3px!important;top:3px!important}
  #hand.hand .card .card-kind-strip,
  .battlefield-layout .unit .card-kind-strip{height:12px!important;min-width:38px!important;font-size:6px!important;bottom:2px!important}
  #hand.hand .card .cstats,
  .battlefield-layout .unit .stats{height:21px!important;min-height:21px!important}
  #hand.hand .card .card-stat-cell,
  .battlefield-layout .unit .stats span{font-size:6px!important;padding:0 1px!important}
  #hand.hand .card .card-stat-cell b{font-size:9px!important}
  #hand.hand .card .card-stat-cell::before,
  .battlefield-layout .unit .stats span::before{font-size:5.5px!important}
  #hand.hand .card .card-effect-text{height:31px!important;min-height:31px!important;padding:2px 3px!important;font-size:6.5px!important}
  #hand.hand .card .card-ap-icon{min-width:21px!important;height:16px!important;bottom:2px!important}
  #hand.hand .card .card-ap-icon::before{font-size:6.5px!important}
}

/* ---------------------------------------------------------------------
   6~7. 연출 설정의 카드 등장 방식
   --------------------------------------------------------------------- */
.event-image-effect-line label,
.batch-scene-shuttle-card>label{
  min-width:0!important;
}
.event-image-effect-line select[id$="SceneEntry"],
.batch-scene-shuttle-card select[id$="Entry"]{
  border-color:#a9874d!important;
  background:#11161d!important;
  color:#f1dfb8!important;
}

/* 기본 페이드 */
.hq-card-scene.entry-steady:not(.holding):not(.leaving) .scene-entry-motion{
  animation:v224EntrySteady .85s ease-out both!important;
}
@keyframes v224EntrySteady{
  0%{opacity:0;filter:brightness(.75) blur(2px);transform:translate3d(0,8px,0)}
  100%{opacity:1;filter:none;transform:translate3d(0,0,0)}
}

/* 크기 변화 없이 충격에 흔들림 */
.hq-card-scene.entry-impact:not(.holding):not(.leaving) .scene-entry-motion{
  animation:v224EntryImpact .78s cubic-bezier(.2,.72,.24,1) both!important;
}
@keyframes v224EntryImpact{
  0%{opacity:0;filter:brightness(.65);transform:translate3d(0,0,0)}
  22%{opacity:1;filter:brightness(1.35);transform:translate3d(-8px,1px,0) rotate(-.7deg)}
  37%{transform:translate3d(7px,-1px,0) rotate(.6deg)}
  52%{transform:translate3d(-5px,0,0) rotate(-.4deg)}
  68%{transform:translate3d(3px,0,0) rotate(.2deg)}
  100%{opacity:1;filter:none;transform:translate3d(0,0,0) rotate(0)}
}

/* 좌우로 펼쳐짐 */
.hq-card-scene.entry-unfold:not(.holding):not(.leaving) .scene-entry-motion{
  animation:v224EntryUnfold .92s cubic-bezier(.2,.76,.2,1) both!important;
}
@keyframes v224EntryUnfold{
  0%{opacity:.15;clip-path:inset(0 49% 0 49%);filter:brightness(1.7) blur(2px);transform:none}
  55%{opacity:1;clip-path:inset(0 8% 0 8%);filter:brightness(1.15);transform:none}
  100%{opacity:1;clip-path:inset(0 0 0 0);filter:none;transform:none}
}

/* 화면 가장자리의 잔상이 중앙으로 모임 */
.hq-card-scene.entry-suck:not(.holding):not(.leaving) .scene-entry-motion{
  animation:v224EntrySuck 1s cubic-bezier(.14,.72,.18,1) both!important;
}
@keyframes v224EntrySuck{
  0%{opacity:0;filter:blur(18px) brightness(2.2);transform:translate3d(34px,-20px,0) skewX(-8deg)}
  38%{opacity:.8;filter:blur(7px) brightness(1.55);transform:translate3d(-10px,7px,0) skewX(3deg)}
  68%{opacity:1;filter:blur(2px) brightness(1.18);transform:translate3d(3px,-2px,0) skewX(0)}
  100%{opacity:1;filter:none;transform:translate3d(0,0,0)}
}

/* 중앙의 작은 원에서 카드가 드러남 */
.hq-card-scene.entry-emerge:not(.holding):not(.leaving) .scene-entry-motion{
  animation:v224EntryEmerge .95s cubic-bezier(.18,.78,.2,1) both!important;
}
@keyframes v224EntryEmerge{
  0%{opacity:0;clip-path:circle(0 at 50% 50%);filter:brightness(2) blur(4px);transform:none}
  52%{opacity:1;clip-path:circle(48% at 50% 50%);filter:brightness(1.25) blur(1px);transform:none}
  100%{opacity:1;clip-path:circle(75% at 50% 50%);filter:none;transform:none}
}

.hq-card-scene .scene-entry-motion{
  position:absolute;
  inset:0;
  z-index:0;
  display:block;
  overflow:hidden;
  transform-origin:center;
  will-change:transform,opacity,filter,clip-path;
}

.hq-card-scene .scene-shade,
.hq-card-scene .scene-energy,
.hq-card-scene .scene-particles,
.hq-card-scene .scene-effect-caption,
.hq-card-scene .scene-label{
  z-index:1;
}

.hq-card-scene.holding .scene-entry-motion,
.hq-card-scene.leaving .scene-entry-motion{
  clip-path:none!important;
  opacity:1!important;
  filter:none!important;
  transform:none!important;
}
.hq-card-scene.holding img{
  clip-path:none!important;
  opacity:1!important;
  filter:none!important;
  transform:scale(var(--scene-scale,1))!important;
}

@media (prefers-reduced-motion:reduce){
  .hq-card-scene[class*="entry-"] .scene-entry-motion{animation:none!important;clip-path:none!important;opacity:1!important;filter:none!important;transform:none!important}
}

/* ---------------------------------------------------------------------
   v224 데스크톱 우선순위 보호
   이전 버전의 body 접두 !important 규칙보다 높은 우선순위로 샘플 시트
   디자인과 자동 글자 맞춤을 확정한다.
   --------------------------------------------------------------------- */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.unit{
    box-sizing:border-box!important;
    aspect-ratio:2.5 / 3.5!important;
    display:grid!important;
    grid-template-rows:22px minmax(0,1fr) 25px!important;
    border:2px solid var(--v224-gold)!important;
    border-radius:5px!important;
    background:var(--v218-deep,#10151b)!important;
    overflow:hidden!important;
    box-shadow:0 3px 9px #000c,inset 0 0 0 1px #f6dda42b!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card.utility-card{
    grid-template-rows:22px minmax(0,1fr) 36px!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-title-area,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .card-title-area{
    position:relative!important;
    display:grid!important;
    grid-template-columns:31px minmax(0,1fr)!important;
    align-items:center!important;
    gap:2px!important;
    min-height:22px!important;
    height:22px!important;
    padding:0 4px 0 0!important;
    border-bottom:1px solid var(--v224-gold)!important;
    background:linear-gradient(180deg,var(--v218-main,#394552),var(--v218-deep,#131921))!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-name-text,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .field-unit-name{
    display:block!important;
    min-width:0!important;
    width:100%!important;
    padding:0 2px!important;
    color:#fff!important;
    font-size:11px!important;
    font-weight:950!important;
    line-height:1!important;
    letter-spacing:-.055em!important;
    text-align:center!important;
    white-space:nowrap!important;
    overflow:visible!important;
    text-overflow:clip!important;
    transform-origin:center!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-name-text[data-v224-fit],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .field-unit-name[data-v224-fit]{
    font-size:var(--v224-fit-size,11px)!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-image-grade,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .card-image-grade.field-grade{
    position:absolute!important;
    z-index:15!important;
    left:4px!important;
    right:auto!important;
    top:4px!important;
    bottom:auto!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:22px!important;
    width:auto!important;
    height:17px!important;
    padding:0 4px!important;
    border:0!important;
    border-radius:2px!important;
    background:#071018d6!important;
    font-size:9px!important;
    font-weight:1000!important;
    line-height:1!important;
    box-shadow:none!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .cstats,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats{
    display:block!important;
    height:25px!important;
    min-height:25px!important;
    padding:0!important;
    border-top:1px solid var(--v224-gold)!important;
    background:var(--v224-paper)!important;
    color:#111!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-grid,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:1fr!important;
    gap:0!important;
    height:100%!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:center!important;
    gap:2px!important;
    min-width:0!important;
    height:100%!important;
    padding:0 2px!important;
    border-right:1px solid #4b3922aa!important;
    background:linear-gradient(180deg,#e6dcc5,#bcae91)!important;
    color:#15120d!important;
    font-size:8px!important;
    font-weight:900!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell b{
    font-size:13px!important;
    color:#111!important;
    line-height:1!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell::before,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span::before{
    display:inline!important;
    color:#19150e!important;
    font-size:7px!important;
    font-weight:950!important;
    line-height:1!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell:nth-child(1)::before,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span:nth-child(1)::before{content:'공격'!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell:nth-child(2)::before,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span:nth-child(2)::before{content:'방어'!important}
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell:nth-child(3)::before,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span:nth-child(3)::before{content:'체력'!important}

  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-effect-text{
    display:flex!important;
    height:36px!important;
    min-height:36px!important;
    padding:3px 5px!important;
    font-size:var(--v224-effect-fit-size,8.5px)!important;
    line-height:1.18!important;
    overflow:visible!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-ready-badge{
    display:none!important;
    content:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.affordable .card-title-area{
    background:linear-gradient(180deg,var(--v218-main,#394552),var(--v218-deep,#131921))!important;
    border-bottom-color:var(--v224-gold)!important;
    box-shadow:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.affordable .card-name-text{
    color:#fff!important;
    text-shadow:0 1px 2px #000!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.affordable{
    border-color:var(--v224-gold-bright)!important;
    box-shadow:0 0 0 1px #fff3ba,0 0 12px 3px #ffd96b99,inset 0 0 10px #fff2a52b!important;
    filter:brightness(1.09) saturate(1.06)!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-ability-label,
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .hand-buff-provider-badge,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .general-class-hand-badge,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .soldier-class-hand-icon,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .unit-ability-label,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .unit-class-icon,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .unit-buff-box,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .unit-skill-box,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .unit-scout-badge{
    display:none!important;
  }
}


/* ---- assets/css/v225_card_ui_request.css ---- */
/* =====================================================================
   v225 — 핸드/전투필드 카드 UI 요청 반영
   1) 공격·방어·체력 문구 제거, 숫자 확대
   2) 사용 가능 초록 박스 제거, 카드 전체 밝은 외곽선으로 표시
   3) 핸드 카드 사이 1px 간격
   4) 핸드/필드 상단 카드명·종류 표기 통일
   5) 이미지 위 종류 표시 띠 제거
   6) PC 좌측창 5% 확대, 핸드/필드 카드 15% 확대
   ===================================================================== */

/* ---------- 공통: 이미지 위 종류 표시 띠 제거 ---------- */
#hand.hand .card .card-kind-strip,
.mobile-hand-mount #hand.hand .card .card-kind-strip,
.battlefield-layout .unit .card-kind-strip{
  display:none!important;
  content:none!important;
}

/* ---------- 공통: 공격/방어/체력 글자 제거 ---------- */
body #hand.hand .card .card-stat-cell::before,
body .mobile-hand-mount #hand.hand .card .card-stat-cell::before,
body .battlefield-layout .unit .stats span::before{
  display:none!important;
  content:none!important;
}
body #hand.hand .card .card-stat-cell,
body .mobile-hand-mount #hand.hand .card .card-stat-cell,
body .battlefield-layout .unit .stats span{
  grid-template-rows:1fr!important;
}

/* ---------- 공통: 사용 가능 문구/초록 박스 완전 제거 ---------- */
#hand.hand .card .card-ready-badge,
#hand.hand .card .card-ready-label,
.mobile-hand-mount #hand.hand .card .card-ready-badge,
.mobile-hand-mount #hand.hand .card .card-ready-label{
  display:none!important;
  content:none!important;
}
#hand.hand .card.actionable-card:not(.opening-hand-card)::before,
.mobile-hand-mount #hand.hand .card.actionable-card:not(.opening-hand-card)::before{
  display:none!important;
  content:none!important;
}

/* 사용 가능 상태는 상단 색상 변경 없이 카드 전체 외곽선으로만 표시 */
#hand.hand .card.affordable .card-title-area,
#hand.hand .card.actionable-card .card-title-area,
.mobile-hand-mount #hand.hand .card.affordable .card-title-area,
.mobile-hand-mount #hand.hand .card.actionable-card .card-title-area{
  background:linear-gradient(180deg,var(--v218-main,#394552),var(--v218-deep,#131921))!important;
  border-bottom-color:var(--v224-gold,#d8bb72)!important;
  box-shadow:none!important;
}
#hand.hand .card.affordable .card-name-text,
#hand.hand .card.actionable-card .card-name-text,
.mobile-hand-mount #hand.hand .card.affordable .card-name-text,
.mobile-hand-mount #hand.hand .card.actionable-card .card-name-text{
  color:#fff!important;
  text-shadow:0 1px 2px #000!important;
}
#hand.hand .card.affordable,
#hand.hand .card.actionable-card,
.mobile-hand-mount #hand.hand .card.affordable,
.mobile-hand-mount #hand.hand .card.actionable-card{
  border-color:#fff2a0!important;
  box-shadow:0 0 0 2px #fff8cf,0 0 16px 5px #ffe36fad,inset 0 0 12px #fff4b83d!important;
  filter:brightness(1.12) saturate(1.08)!important;
}

/* ---------- 상단 카드명/종류: 핸드와 전투필드 완전 통일 ---------- */
#hand.hand .card .card-title-area,
.mobile-hand-mount #hand.hand .card .card-title-area,
.battlefield-layout .unit .card-title-area{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr)!important;
  align-items:center!important;
  gap:2px!important;
  height:24px!important;
  min-height:24px!important;
  max-height:24px!important;
  padding:0 4px 0 0!important;
  overflow:hidden!important;
}
#hand.hand .card .card-kind-ribbon,
.mobile-hand-mount #hand.hand .card .card-kind-ribbon,
.battlefield-layout .unit .card-kind-ribbon{
  align-self:stretch!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:34px!important;
  padding:0 3px!important;
  font-size:8px!important;
  font-weight:950!important;
  line-height:1!important;
  white-space:nowrap!important;
}
#hand.hand .card .card-name-text,
.mobile-hand-mount #hand.hand .card .card-name-text,
.battlefield-layout .unit .field-unit-name{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  padding:0 2px!important;
  font-size:12px!important;
  font-weight:950!important;
  line-height:1!important;
  letter-spacing:-.05em!important;
  text-align:center!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}

/* ---------- PC: 좌측창 +5%, 카드 +15% ---------- */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    /* v224 실제 표시값(112.86 × 175.56)의 115% */
    --v216-card-w:129.789px;
    --v216-card-h:201.894px;
    --v216-card-gap:6px;
    --v216-hand-w:391.367px;       /* 3장 + 1px 간격 2개 */
    --v216-hand-h:404.788px;       /* 2줄 + 1px 간격 */
    --v216-hand-section-h:444px;
    --v216-formation-w:811.509px;
    --v216-five-card-w:672.945px;
    --v216-four-card-w:537.156px;
    --v216-three-card-w:401.367px;
    --v216-two-card-w:265.578px;
    --v216-lane-h:216.315px;
    --hand-card-width:var(--v216-card-w);
    --hand-card-height:var(--v216-card-h);
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .app,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app[style]{
    /* 기존 382px의 약 105% */
    grid-template-columns:401px minmax(822px,1fr)!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .right-hand-section{
    height:var(--v216-hand-section-h)!important;
    min-height:var(--v216-hand-section-h)!important;
    max-height:var(--v216-hand-section-h)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host .handbox{
    padding:0!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand{
    grid-template-columns:repeat(3,var(--v216-card-w))!important;
    grid-template-rows:repeat(2,var(--v216-card-h))!important;
    grid-auto-rows:var(--v216-card-h)!important;
    width:var(--v216-hand-w)!important;
    min-width:var(--v216-hand-w)!important;
    max-width:var(--v216-hand-w)!important;
    height:var(--v216-hand-h)!important;
    min-height:var(--v216-hand-h)!important;
    max-height:var(--v216-hand-h)!important;
    gap:1px!important;
    padding:0!important;
    margin:0!important;
    justify-content:start!important;
    align-content:start!important;
    overflow:hidden!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:var(--v216-card-w)!important;
    min-width:var(--v216-card-w)!important;
    max-width:var(--v216-card-w)!important;
    height:var(--v216-card-h)!important;
    min-height:var(--v216-card-h)!important;
    max-height:var(--v216-card-h)!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.unit{
    grid-template-rows:24px minmax(0,1fr) 31px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card.utility-card{
    grid-template-rows:24px minmax(0,1fr) 42px!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .cstats,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats{
    height:31px!important;
    min-height:31px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .stats span{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    padding:0 2px!important;
    font-size:19px!important;
    font-weight:1000!important;
    line-height:1!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-stat-cell b{
    font-size:19px!important;
    font-weight:1000!important;
    line-height:1!important;
  }
}

/* ---------- 모바일/미리보기: 숫자만 더 선명하게, 카드 간 얇은 간격 ---------- */
@media (max-width:850px){
  .mobile-hand-mount #hand.hand{gap:1px!important}
  .mobile-hand-mount #hand.hand .card-stat-cell b,
  .battlefield-layout .unit .stats span{
    font-size:12px!important;
    font-weight:1000!important;
  }
}
body.ui-mode-mobile-preview .mobile-hand-mount #hand.hand{gap:1px!important}
body.ui-mode-mobile-preview .mobile-hand-mount #hand.hand .card-stat-cell b,
body.ui-mode-mobile-preview .battlefield-layout .unit .stats span{
  font-size:12px!important;
  font-weight:1000!important;
}


/* ---- assets/css/v226_card_ui_effect_fix.css ---- */
/* =====================================================================
   v226 — 카드 헤더, 전투열, 아이템 수치, 연출 화면 보정
   ===================================================================== */

/* 1) 핸드 카드의 종류/이름 순서를 전투필드와 동일하게 고정한다.
   game.css의 오래된 grid-column 규칙이 핸드 이름을 첫 칸으로 보내던 문제 보정. */
#hand.hand .card .card-title-area>.card-kind-ribbon,
.mobile-hand-mount #hand.hand .card .card-title-area>.card-kind-ribbon{
  grid-column:1!important;
  grid-row:1!important;
  order:0!important;
}
#hand.hand .card .card-title-area>.card-name-text,
.mobile-hand-mount #hand.hand .card .card-title-area>.card-name-text{
  grid-column:2!important;
  grid-row:1!important;
  order:1!important;
}

/* 2) PC 전투열 오른쪽 테두리가 잘리지 않도록 표시 여유를 확보한다. */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app[style]{
    grid-template-columns:401px minmax(838px,1fr)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel{
    box-sizing:border-box!important;
    padding-right:10px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap{
    box-sizing:border-box!important;
    margin-left:auto!important;
    margin-right:auto!important;
    overflow:visible!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.river{
    box-sizing:border-box!important;
  }
}

/* 3) 아이템은 공격/방어/체력 증가값만 0, +2, +3 형식으로 표시한다. */
#hand.hand .card.item-stat-card{
  grid-template-rows:var(--v226-card-head,25.2px) minmax(0,1fr) 31px!important;
}
#hand.hand .card.item-stat-card .cstats{
  display:block!important;
  min-height:31px!important;
  height:31px!important;
  max-height:31px!important;
}
#hand.hand .card.item-stat-card .card-stat-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  height:100%!important;
}
#hand.hand .card.item-stat-card .item-bonus-cell b{
  display:block!important;
  font-size:19px!important;
  font-weight:1000!important;
  line-height:1!important;
  letter-spacing:0!important;
  white-space:nowrap!important;
}

/* 4) 실제 카드 연출 화면을 관리자 미리보기 프레임과 같은 320 × 170 크기로 표시. */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-body{
    box-sizing:border-box!important;
    height:212px!important;
    min-height:212px!important;
    max-height:212px!important;
    padding:6px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-card.action-view-mode{
    grid-template-columns:320px!important;
    grid-template-rows:24px 170px!important;
    justify-content:center!important;
    align-content:start!important;
    gap:5px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage{
    box-sizing:border-box!important;
    width:320px!important;
    min-width:320px!important;
    max-width:320px!important;
    height:170px!important;
    min-height:170px!important;
    max-height:170px!important;
    justify-self:center!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage>.hq-card-scene.left-effect-preview-scene{
    width:320px!important;
    min-width:320px!important;
    max-width:320px!important;
    height:170px!important;
    min-height:170px!important;
    max-height:170px!important;
  }
}

/* 5) 개별 연출 설정은 프레임 위의 '실제 본진 크기 미리보기' 제목 박스를 표시하지 않는다. */
#batchSettingsModal[data-settings-mode="individual"] .event-image-setting .event-hq-preview-frame>.hq-title,
#batchSettingsModal[data-settings-mode="individual"] .event-image-setting .event-hq-preview-frame>.hq-subtitle{
  display:none!important;
}

/* 6) 카드 종류·이름 글씨 확대, 상단 이름표시 칸 5% 확대(24px → 25.2px). */
:root{--v226-card-head:25.2px}
#hand.hand .card .card-title-area,
.mobile-hand-mount #hand.hand .card .card-title-area,
.battlefield-layout .unit .card-title-area{
  grid-template-columns:36px minmax(0,1fr)!important;
  height:var(--v226-card-head)!important;
  min-height:var(--v226-card-head)!important;
  max-height:var(--v226-card-head)!important;
}
#hand.hand .card .card-kind-ribbon,
.mobile-hand-mount #hand.hand .card .card-kind-ribbon,
.battlefield-layout .unit .card-kind-ribbon{
  min-width:36px!important;
  font-size:9px!important;
}
#hand.hand .card .card-name-text,
.mobile-hand-mount #hand.hand .card .card-name-text,
.battlefield-layout .unit .field-unit-name{
  font-size:13px!important;
  letter-spacing:-.045em!important;
}

@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.unit{
    grid-template-rows:var(--v226-card-head) minmax(0,1fr) 31px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card.utility-card:not(.item-stat-card){
    grid-template-rows:var(--v226-card-head) minmax(0,1fr) 42px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-kind-ribbon,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .card-kind-ribbon{
    font-size:9px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-name-text,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .field-unit-name{
    font-size:13px!important;
  }
}

@media (max-width:850px){
  .mobile-hand-mount #hand.hand .card .card-title-area,
  .battlefield-layout .unit .card-title-area{
    grid-template-columns:32px minmax(0,1fr)!important;
  }
  .mobile-hand-mount #hand.hand .card .card-kind-ribbon,
  .battlefield-layout .unit .card-kind-ribbon{
    min-width:32px!important;
    font-size:8px!important;
  }
  .mobile-hand-mount #hand.hand .card .card-name-text,
  .battlefield-layout .unit .field-unit-name{
    font-size:10px!important;
  }
  .mobile-hand-mount #hand.hand .card.item-stat-card .item-bonus-cell b{
    font-size:12px!important;
  }
}

/* 높은 특이도의 이전 패치 규칙보다 우선 적용되도록 최종 확정값을 다시 선언한다. */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-title-area,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .card-title-area{
    grid-template-columns:36px minmax(0,1fr)!important;
    height:var(--v226-card-head)!important;
    min-height:var(--v226-card-head)!important;
    max-height:var(--v226-card-head)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-kind-ribbon,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .card-kind-ribbon{
    grid-column:1!important;
    grid-row:1!important;
    min-width:36px!important;
    font-size:9px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card .card-name-text,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battlefield-layout .unit .field-unit-name{
    grid-column:2!important;
    grid-row:1!important;
    font-size:13px!important;
    letter-spacing:-.045em!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .cstats{
    display:block!important;
    height:31px!important;
    min-height:31px!important;
    max-height:31px!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .item-bonus-cell b{
    display:block!important;
    font-size:19px!important;
    font-weight:1000!important;
    line-height:1!important;
  }
}

@media (max-width:850px){
  body #hand.hand .card .card-title-area,
  body .mobile-hand-mount #hand.hand .card .card-title-area,
  body .battlefield-layout .unit .card-title-area{
    height:var(--v226-card-head)!important;
    min-height:var(--v226-card-head)!important;
    max-height:var(--v226-card-head)!important;
  }
  body .mobile-hand-mount #hand.hand .card .card-kind-ribbon{
    grid-column:1!important;
    grid-row:1!important;
  }
  body .mobile-hand-mount #hand.hand .card .card-name-text{
    grid-column:2!important;
    grid-row:1!important;
  }
}


/* ---- assets/css/v227_layout_perf_manager_fix.css ---- */
/* =====================================================================
   v227 — 전투필드 잘림, 초기 로딩, 카드관리 단일 크기 슬라이더 보정
   ===================================================================== */

/* 1) 카드관리: 가로/세로 분리 슬라이더 대신 단일 크기 슬라이더만 표시 */
#cardManagerModal .manager-unified-scale-label{
  grid-template-columns:74px minmax(0,1fr) 42px!important;
}
#cardManagerModal .manager-hidden-scale-axis{
  display:none!important;
}
#cardManagerModal .manager-preview-dual-label small{
  font-size:10px;
  color:#c6b28d;
  font-weight:700;
}

/* 2) PC 전투필드: 오른쪽 전투열 카드가 잘리지 않도록 슬롯 폭 계산을 유연화 */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v227-field-gap:4px;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel{
    padding-right:0!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap{
    padding-right:8px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    width:100%!important;
    min-width:0!important;
    padding-right:4px!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.river{
    width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    box-sizing:border-box!important;
    justify-content:stretch!important;
    gap:var(--v227-field-gap)!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.unit{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }
}


/* ---- assets/css/v228_battlefield_loading_rules_fix.css ---- */
/* =====================================================================
   v228 — 전투열 실제 폭 복구 + 카드 비율 유지
   원인: 현재 HTML에서는 본진이 board 안으로 이동했지만 예전의 2열
   battlefield-layout(필드 + 우측 레일) 규칙이 남아 보이지 않는 빈 우측 열이
   약 23~25%의 폭을 계속 차지하고 있었다. board를 단일 열 전체 폭으로 복구한다.
   ===================================================================== */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap{
    width:100%!important;
    min-width:0!important;
    padding-left:6px!important;
    padding-right:6px!important;
    overflow-x:hidden!important;
    box-sizing:border-box!important;
  }

  /* 삭제된 우측 레일을 위한 빈 grid 열을 제거한다. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    padding:0!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    grid-column:1/-1!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    padding-left:4px!important;
    padding-right:4px!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }

  /* 전투열은 전체 폭을 쓰되 카드 자체는 기존 2.5:3.89 크기를 유지한다. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.hq-battle-row,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.hq-defense-lane{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    display:grid!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    padding:0!important;
    margin:0!important;
    gap:var(--v216-card-gap,6px)!important;
    justify-content:space-evenly!important;
    justify-items:center!important;
    align-items:stretch!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    grid-template-columns:repeat(5,minmax(0,var(--v216-card-w,129.789px)))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    grid-template-columns:repeat(4,minmax(0,var(--v216-card-w,129.789px)))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    grid-template-columns:repeat(3,minmax(0,var(--v216-card-w,129.789px)))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    grid-template-columns:repeat(2,minmax(0,var(--v216-card-w,129.789px)))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:var(--v216-card-w,129.789px)!important;
    min-width:var(--v216-card-w,129.789px)!important;
    max-width:var(--v216-card-w,129.789px)!important;
    height:var(--v216-card-h,201.894px)!important;
    min-height:var(--v216-card-h,201.894px)!important;
    max-height:var(--v216-card-h,201.894px)!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.base-unit{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    box-sizing:border-box!important;
  }
}


/* ---- assets/css/v229_battlefield_right_clip_fix.css ---- */
/* =====================================================================
   v229 — PC 전투필드 우측 전투열/카드 잘림 최종 보정

   원인:
   - .battle-panel이 가운데 정렬 상태인데 .boardwrap에 이전 버전의
     max-width가 남아 있어, 전투 패널의 실제 가로 공간을 전부 사용하지 못함.
   - 고정 카드 폭을 가진 슬롯 그리드가 좁은 화면에서 몇 px 넘치면
     오른쪽 마지막 슬롯/카드가 overflow에 의해 잘릴 수 있었음.
   ===================================================================== */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    box-sizing:border-box!important;
    overflow-x:hidden!important;
  }

  /* 이전 카드 폭 계산에서 남은 max-width와 자동 좌우 여백을 완전히 제거 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap{
    flex:1 1 auto!important;
    align-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    padding-left:6px!important;
    padding-right:6px!important;
    box-sizing:border-box!important;
    overflow-x:hidden!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    align-self:stretch!important;
    box-sizing:border-box!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    padding-left:4px!important;
    padding-right:4px!important;
    align-items:stretch!important;
    overflow-x:visible!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.hq-battle-row,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.hq-defense-lane{
    align-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.enemy-hq-row,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.ally-hq-row{
    align-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
  }

  /* v216/v225의 행별 고정 formation 폭보다 높은 구체성으로 덮어쓴다. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>#enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane[data-row="e1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane[data-row="e2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane[data-row="neutral"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.neutral-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane[data-row="a2"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane[data-row="a1"],
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>#allyBaseDefenseLane{
    align-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
  }

  /*
     슬롯 컨테이너는 사용 가능한 폭보다 커지지 않는다.
     넓을 때는 기존 카드 크기를 유지하고, 좁을 때만 각 열이 균등 축소된다.
  */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    --v229-field-gap:var(--v216-card-gap,6px);
    width:100%!important;
    min-width:0!important;
    margin-left:auto!important;
    margin-right:auto!important;
    padding:0!important;
    gap:var(--v229-field-gap)!important;
    justify-content:center!important;
    justify-items:stretch!important;
    align-items:stretch!important;
    box-sizing:border-box!important;
    overflow-x:visible!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    width:100%!important;
    min-width:0!important;
    max-width:calc((var(--v216-card-w,129.789px) * 5) + (var(--v229-field-gap) * 4))!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    width:100%!important;
    min-width:0!important;
    max-width:calc((var(--v216-card-w,129.789px) * 4) + (var(--v229-field-gap) * 3))!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    width:100%!important;
    min-width:0!important;
    max-width:calc((var(--v216-card-w,129.789px) * 3) + (var(--v229-field-gap) * 2))!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    width:100%!important;
    min-width:0!important;
    max-width:calc((var(--v216-card-w,129.789px) * 2) + var(--v229-field-gap))!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.base-unit{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
}


/* ---- assets/css/v230_battlefield_full_width_hidden_scroll.css ---- */
/* =====================================================================
   v230 — 전투필드 우측 잘림 + 숨김 스크롤 최종 보정

   1) 핸드 카드와 전투필드 카드의 폭/높이를 동일한 v216 변수로 고정한다.
   2) 이전 v229의 1fr 슬롯 축소 규칙을 제거하고 카드가 찌그러지지 않게 한다.
   3) boardwrap/layout/board에 남은 height:100% + overflow:hidden 조합을 해제한다.
   4) battle-panel만 세로 스크롤 컨테이너로 사용하고 스크롤바는 숨긴다.
   ===================================================================== */
@media (min-width:851px){
  /* 이전 낮은 화면용 app 폭(1048px)과 최신 401px + 822px 열의 충돌 제거 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app[style]{
    display:grid!important;
    grid-template-columns:401px minmax(0,1fr)!important;
    column-gap:0!important;
    gap:0!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:100vh!important;
    min-height:720px!important;
    margin:0!important;
    padding:4px!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  /* 실제 스크롤 담당: 전투 패널 하나만 사용 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:calc(100vh - 8px)!important;
    min-height:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:contain!important;
    touch-action:pan-y!important;
    scrollbar-width:none!important;
    -ms-overflow-style:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel::-webkit-scrollbar{
    width:0!important;
    height:0!important;
    display:none!important;
  }

  /* 중첩 overflow/고정 높이를 해제하여 전체 보드 높이가 패널 스크롤에 반영되게 한다. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap{
    position:relative!important;
    flex:0 0 auto!important;
    align-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:8px 6px 20px!important;
    gap:6px!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }

  /* 모든 행의 오른쪽 테두리가 board 안쪽에서 끝나도록 고정한다. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.hq-battle-row,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.hq-defense-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.enemy-hq-row,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.ally-hq-row,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>#enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>#allyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane[data-row]{
    align-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane{
    overflow:visible!important;
  }

  /* 핸드와 필드가 반드시 같은 카드 크기를 사용하도록 공통 변수로 고정 */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    flex:0 0 var(--v216-card-w,129.789px)!important;
    width:var(--v216-card-w,129.789px)!important;
    min-width:var(--v216-card-w,129.789px)!important;
    max-width:var(--v216-card-w,129.789px)!important;
    height:var(--v216-card-h,201.894px)!important;
    min-height:var(--v216-card-h,201.894px)!important;
    max-height:var(--v216-card-h,201.894px)!important;
    aspect-ratio:2.7 / 4.2!important;
    box-sizing:border-box!important;
  }

  /* 슬롯 그리드는 카드 자체를 줄이지 않고 필요한 고정 폭만 차지한다. */
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    --v230-field-gap:2px;
    display:grid!important;
    height:var(--v216-card-h,201.894px)!important;
    min-height:var(--v216-card-h,201.894px)!important;
    max-height:var(--v216-card-h,201.894px)!important;
    padding:0!important;
    gap:var(--v230-field-gap)!important;
    justify-content:center!important;
    justify-items:center!important;
    align-items:stretch!important;
    align-content:stretch!important;
    margin-left:auto!important;
    margin-right:auto!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    grid-template-columns:repeat(5,var(--v216-card-w,129.789px))!important;
    width:calc((var(--v216-card-w,129.789px) * 5) + (var(--v230-field-gap) * 4))!important;
    min-width:calc((var(--v216-card-w,129.789px) * 5) + (var(--v230-field-gap) * 4))!important;
    max-width:calc((var(--v216-card-w,129.789px) * 5) + (var(--v230-field-gap) * 4))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    grid-template-columns:repeat(4,var(--v216-card-w,129.789px))!important;
    width:calc((var(--v216-card-w,129.789px) * 4) + (var(--v230-field-gap) * 3))!important;
    min-width:calc((var(--v216-card-w,129.789px) * 4) + (var(--v230-field-gap) * 3))!important;
    max-width:calc((var(--v216-card-w,129.789px) * 4) + (var(--v230-field-gap) * 3))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    grid-template-columns:repeat(3,var(--v216-card-w,129.789px))!important;
    width:calc((var(--v216-card-w,129.789px) * 3) + (var(--v230-field-gap) * 2))!important;
    min-width:calc((var(--v216-card-w,129.789px) * 3) + (var(--v230-field-gap) * 2))!important;
    max-width:calc((var(--v216-card-w,129.789px) * 3) + (var(--v230-field-gap) * 2))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    grid-template-columns:repeat(2,var(--v216-card-w,129.789px))!important;
    width:calc((var(--v216-card-w,129.789px) * 2) + var(--v230-field-gap))!important;
    min-width:calc((var(--v216-card-w,129.789px) * 2) + var(--v230-field-gap))!important;
    max-width:calc((var(--v216-card-w,129.789px) * 2) + var(--v230-field-gap))!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.base-unit{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    box-sizing:border-box!important;
  }
}


/* ---- assets/css/v231_battlefield_compact_width_scroll.css ---- */
/* =====================================================================
   v231 — 전투필드 폭을 5장 기준으로 축소 + 숨김 스크롤 유지

   목적
   1) v230에서 화면 전체로 넓어진 우측 전투영역을 다시 축소한다.
   2) 우측 전투필드는 카드 5장이 딱 들어가는 폭만 확보한다.
   3) 핸드 카드와 전투필드 카드 크기는 동일하게 유지한다.
   4) 세로 스크롤은 유지하되 스크롤바는 계속 숨긴다.
   ===================================================================== */
@media (min-width:851px){
  body.unified-left-layout:not(.ui-mode-mobile-preview){
    --v231-field-gap:2px;
    --v231-left-col-w:401px;
    /* 5장의 동일 카드 + 4개의 2px 간격 + lane padding 16px + board padding 12px + 여유 1px */
    --v231-battle-col-w:685px;
    --v231-app-w:1094px;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .app,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .app[style]{
    display:grid!important;
    grid-template-columns:var(--v231-left-col-w) var(--v231-battle-col-w)!important;
    column-gap:0!important;
    gap:0!important;
    width:var(--v231-app-w)!important;
    min-width:var(--v231-app-w)!important;
    max-width:var(--v231-app-w)!important;
    height:100vh!important;
    min-height:720px!important;
    margin:0!important;
    padding:4px!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel{
    width:var(--v231-battle-col-w)!important;
    min-width:var(--v231-battle-col-w)!important;
    max-width:var(--v231-battle-col-w)!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    height:calc(100vh - 8px)!important;
    min-height:0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:contain!important;
    touch-action:pan-y!important;
    scrollbar-width:none!important;
    -ms-overflow-style:none!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel::-webkit-scrollbar{
    width:0!important;
    height:0!important;
    display:none!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .boardwrap{
    position:relative!important;
    flex:0 0 auto!important;
    align-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:8px 6px 20px!important;
    gap:6px!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.hq-battle-row,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.hq-defense-lane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.enemy-hq-row,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.ally-hq-row,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>#enemyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>#allyBaseDefenseLane,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout>.board>.lane[data-row]{
    align-self:stretch!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    box-sizing:border-box!important;
    overflow:visible!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .left-hand-host #hand.hand .card,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    flex:0 0 var(--v216-card-w,129.789px)!important;
    width:var(--v216-card-w,129.789px)!important;
    min-width:var(--v216-card-w,129.789px)!important;
    max-width:var(--v216-card-w,129.789px)!important;
    height:var(--v216-card-h,201.894px)!important;
    min-height:var(--v216-card-h,201.894px)!important;
    max-height:var(--v216-card-h,201.894px)!important;
    aspect-ratio:2.7 / 4.2!important;
    box-sizing:border-box!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    display:grid!important;
    height:var(--v216-card-h,201.894px)!important;
    min-height:var(--v216-card-h,201.894px)!important;
    max-height:var(--v216-card-h,201.894px)!important;
    padding:0!important;
    gap:var(--v231-field-gap)!important;
    justify-content:center!important;
    justify-items:center!important;
    align-items:stretch!important;
    align-content:stretch!important;
    margin-left:auto!important;
    margin-right:auto!important;
    overflow:visible!important;
    box-sizing:border-box!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n5,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-battlefield-grid{
    grid-template-columns:repeat(5,var(--v216-card-w,129.789px))!important;
    width:calc((var(--v216-card-w,129.789px) * 5) + (var(--v231-field-gap) * 4))!important;
    min-width:calc((var(--v216-card-w,129.789px) * 5) + (var(--v231-field-gap) * 4))!important;
    max-width:calc((var(--v216-card-w,129.789px) * 5) + (var(--v231-field-gap) * 4))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n4{
    grid-template-columns:repeat(4,var(--v216-card-w,129.789px))!important;
    width:calc((var(--v216-card-w,129.789px) * 4) + (var(--v231-field-gap) * 3))!important;
    min-width:calc((var(--v216-card-w,129.789px) * 4) + (var(--v231-field-gap) * 3))!important;
    max-width:calc((var(--v216-card-w,129.789px) * 4) + (var(--v231-field-gap) * 3))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n3{
    grid-template-columns:repeat(3,var(--v216-card-w,129.789px))!important;
    width:calc((var(--v216-card-w,129.789px) * 3) + (var(--v231-field-gap) * 2))!important;
    min-width:calc((var(--v216-card-w,129.789px) * 3) + (var(--v231-field-gap) * 2))!important;
    max-width:calc((var(--v216-card-w,129.789px) * 3) + (var(--v231-field-gap) * 2))!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slots.n2{
    grid-template-columns:repeat(2,var(--v216-card-w,129.789px))!important;
    width:calc((var(--v216-card-w,129.789px) * 2) + var(--v231-field-gap))!important;
    min-width:calc((var(--v216-card-w,129.789px) * 2) + var(--v231-field-gap))!important;
    max-width:calc((var(--v216-card-w,129.789px) * 2) + var(--v231-field-gap))!important;
  }

  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot{
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.unit,
  body.unified-left-layout:not(.ui-mode-mobile-preview) .battle-panel .battlefield-layout .hq-field-slot>.base-unit{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    box-sizing:border-box!important;
  }
}


/* ---- assets/css/v232_requested_features.css ---- */
/* v232 — 요청 기능 표시 */
/* 아이템 카드는 공/방/체 문구 없이 +값/0만 3칸에 표시 */
#hand.hand .card.item-stat-card .card-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
#hand.hand .card.item-stat-card .item-bonus-cell::before,#hand.hand .card.item-stat-card .item-bonus-cell::after{content:none!important;display:none!important}
#hand.hand .card.item-stat-card .item-bonus-cell b{font-size:15px!important;line-height:1!important;white-space:nowrap!important}

/* 장착 아이템: 카드 왼쪽 세로 아이콘 */
.unit,.advisor-card,.base-unit{position:relative!important}
.equipped-item-rail{position:absolute;left:3px;top:34px;z-index:75;display:flex;flex-direction:column;gap:4px;pointer-events:auto}
.advisor-card>.equipped-item-rail{top:7px;left:5px}
.base-unit>.equipped-item-rail{top:5px;left:5px}
.equipped-item-icon{display:grid;place-items:center;width:25px;height:25px;padding:0;border:1px solid rgba(255,255,255,.78);border-radius:50%;background:rgba(5,10,17,.9);box-shadow:0 2px 7px rgba(0,0,0,.7),inset 0 0 8px rgba(255,255,255,.08);color:#fff;font-size:15px;line-height:1;cursor:pointer;transition:transform .15s ease,filter .15s ease}
.equipped-item-icon svg{width:16px;height:16px;display:block;fill:currentColor}
.equipment-popover-icon svg{width:17px;height:17px;display:block;fill:currentColor}
.equipped-item-icon:hover,.equipped-item-icon:focus-visible{transform:scale(1.12);filter:brightness(1.22);outline:2px solid rgba(255,224,143,.9);outline-offset:1px}
.equipped-weapon{background:linear-gradient(145deg,rgba(94,25,20,.96),rgba(26,7,7,.96))}
.equipped-armor{background:linear-gradient(145deg,rgba(25,60,105,.96),rgba(8,20,42,.96))}
.equipped-mount{background:linear-gradient(145deg,rgba(86,58,21,.96),rgba(29,18,6,.96))}
.equipment-info-popover{position:fixed;z-index:10050;width:260px;max-width:calc(100vw - 16px);padding:9px;border:1px solid #d8b36b;border-radius:10px;background:linear-gradient(180deg,#172233,#090e16);box-shadow:0 14px 36px rgba(0,0,0,.72);color:#f6f2e8;font-size:12px}
.equipment-info-popover[hidden]{display:none!important}
.equipment-popover-title{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:1px 2px 7px;border-bottom:1px solid rgba(255,255,255,.14)}
.equipment-popover-title b{font-size:13px;color:#ffe7ad}
.equipment-popover-title button{width:24px;height:24px;border:0;border-radius:50%;background:#ffffff17;color:#fff;cursor:pointer}
.equipment-popover-row{display:grid;grid-template-columns:30px 1fr;gap:8px;align-items:center;padding:8px 6px;border-radius:7px}
.equipment-popover-row.active{background:rgba(255,211,117,.13);outline:1px solid rgba(255,211,117,.28)}
.equipment-popover-icon{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#05080e;border:1px solid #ffffff42;font-size:16px}
.equipment-popover-row b{display:block;color:#fff;font-size:12px}
.equipment-popover-row small{display:block;margin-top:2px;color:#becce0;font-size:10px}

/* 실제 카드 사용 연출은 개별 연출 미리보기의 크기/X/Y를 그대로 적용 */
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene img{position:absolute!important;inset:0!important;margin:0!important;width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;object-fit:cover!important;object-position:var(--scene-x,50%) var(--scene-y,50%)!important;transform-origin:var(--scene-x,50%) var(--scene-y,50%)!important}
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene.fx-none img,.left-card-effect-stage .hq-card-scene.left-effect-preview-scene.holding img{animation:none!important;transform:scale(var(--scene-scale,1))!important;opacity:1!important;filter:none!important}

/* 개별 연출 설정 미리보기 화면만 기존보다 10% 확대 */
#batchSettingsModal[data-settings-mode="individual"] .event-hq-preview-frame{width:var(--individual-stage-hq-width,352px)!important;height:var(--individual-stage-hq-height,187px)!important;min-height:var(--individual-stage-hq-height,187px)!important}
#batchSettingsModal[data-settings-mode="individual"] .event-image-preview.event-hq-live-preview{min-height:calc(var(--individual-stage-hq-height,187px) + 12px)!important}

@media(max-width:850px){
 .equipped-item-rail{left:2px;top:29px;gap:3px}.equipped-item-icon{width:22px;height:22px;font-size:13px}
 .equipment-info-popover{width:238px}
}

/* v233 — 누락 로드 보완 및 아이템/연출 세부 수정 */
#hand.hand .card.item-stat-card{grid-template-rows:20px minmax(0,1fr) auto!important;}
#hand.hand .card.item-stat-card .cimg{height:100%!important;min-height:0!important;max-height:none!important;padding:0!important;margin:0!important;border-bottom:1px solid #3d3024!important;background:#16110c!important;}
#hand.hand .card.item-stat-card .cimg img,#hand.hand .card.item-stat-card .cimg .default-art{display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;}
#hand.hand .card.item-stat-card .cstats{display:block!important;padding:3px!important;}
#hand.hand .card.item-stat-card .card-stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:2px!important;}
#hand.hand .card.item-stat-card .card-stat-cell{display:flex!important;align-items:center!important;justify-content:center!important;min-height:30px!important;padding:3px 1px!important;}
#hand.hand .card.item-stat-card .card-stat-cell::before,#hand.hand .card.item-stat-card .card-stat-cell::after,#hand.hand .card.item-stat-card .card-stat-cell:nth-child(1)::before,#hand.hand .card.item-stat-card .card-stat-cell:nth-child(2)::before,#hand.hand .card.item-stat-card .card-stat-cell:nth-child(3)::before{content:none!important;display:none!important;}
#hand.hand .card.item-stat-card .item-bonus-cell b{font-size:14px!important;line-height:1!important;white-space:nowrap!important;color:#fff0bf!important;}
#hand.hand .card.item-stat-card .item-bonus-cell span{display:none!important;}
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene img,.battlefield-card-scene img,.battle-hq .hq-card-scene img{position:absolute!important;inset:0!important;margin:0!important;width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;object-fit:cover!important;object-position:var(--scene-x,50%) var(--scene-y,50%)!important;transform-origin:var(--scene-x,50%) var(--scene-y,50%)!important;}
.hq-card-scene.preview-static img,.left-card-effect-stage .hq-card-scene.left-effect-preview-scene.fx-none img,.left-card-effect-stage .hq-card-scene.left-effect-preview-scene.holding img{animation:none!important;transform:scale(var(--scene-scale,1))!important;opacity:1!important;filter:none!important;}

/* v234 — 카드 연출 화면을 카드관리 미리보기와 동일한 크롭/표시 방식으로 강제 */
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion{
  inset:0!important;
  clip-path:none!important;
  opacity:1!important;
  filter:none!important;
  transform:none!important;
}
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene img,
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion>img{
  position:absolute!important;
  inset:0!important;
  margin:0!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:cover!important;
  object-position:var(--scene-x,50%) var(--scene-y,50%)!important;
  transform-origin:var(--scene-x,50%) var(--scene-y,50%)!important;
  animation:none!important;
  filter:none!important;
  opacity:1!important;
  transform:scale(var(--scene-scale,1))!important;
}

/* v234 — 아이템 카드 하단 수치 가독성 및 이미지 꽉 채우기 */
#hand.hand .card.item-stat-card .cstats{
  display:block!important;
  padding:3px!important;
  background:linear-gradient(180deg,#15110c,#0d0906)!important;
}
#hand.hand .card.item-stat-card .card-stat-cell{
  background:linear-gradient(180deg,rgba(52,35,18,.94),rgba(22,13,7,.96))!important;
  border:1px solid rgba(183,139,76,.55)!important;
  border-radius:4px!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06)!important;
}
#hand.hand .card.item-stat-card .card-stat-cell::before,
#hand.hand .card.item-stat-card .card-stat-cell::after,
#hand.hand .card.item-stat-card .card-stat-cell:nth-child(1)::before,
#hand.hand .card.item-stat-card .card-stat-cell:nth-child(2)::before,
#hand.hand .card.item-stat-card .card-stat-cell:nth-child(3)::before{
  content:none!important;
  display:none!important;
}
#hand.hand .card.item-stat-card .item-bonus-cell b{
  color:#f4d38c!important;
  text-shadow:0 1px 2px rgba(0,0,0,.9)!important;
  font-weight:900!important;
}
#hand.hand .card.item-stat-card .cimg{
  padding:0!important;
  overflow:hidden!important;
}
#hand.hand .card.item-stat-card .cimg img,
#hand.hand .card.item-stat-card .cimg .default-art{
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  transform:scale(1.035)!important;
  transform-origin:center center!important;
}

/* v234 — 연출창을 카드관리 미리보기와 더 가깝게, 아이템 카드 가독성/밀착 보강 */
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage{
  width:var(--individual-stage-hq-width,352px)!important;
  min-width:var(--individual-stage-hq-width,352px)!important;
  max-width:var(--individual-stage-hq-width,352px)!important;
  height:var(--individual-stage-hq-height,187px)!important;
  min-height:var(--individual-stage-hq-height,187px)!important;
  max-height:var(--individual-stage-hq-height,187px)!important;
  background:#02050a!important;
}
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage>.hq-card-scene.left-effect-preview-scene{
  width:100%!important;min-width:0!important;max-width:none!important;
  height:100%!important;min-height:0!important;max-height:none!important;
  background:#02050a!important;
}
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene img{
  object-fit:contain!important;
  background:#02050a!important;
}
#hand.hand .card.item-stat-card{
  overflow:hidden!important;
  gap:0!important;
  padding:0!important;
  box-sizing:border-box!important;
}
#hand.hand .card.item-stat-card .cimg{
  padding:0!important;
  margin:0!important;
  background:#15110c!important;
}
#hand.hand .card.item-stat-card .cimg img,#hand.hand .card.item-stat-card .cimg .default-art{
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
}
#hand.hand .card.item-stat-card .cstats{
  display:block!important;
  padding:4px!important;
  background:linear-gradient(180deg,#1d1710,#120d08)!important;
}
#hand.hand .card.item-stat-card .card-stat-grid{gap:2px!important;}
#hand.hand .card.item-stat-card .card-stat-cell{
  min-height:28px!important;
  padding:3px 1px!important;
  background:linear-gradient(180deg,#2c2114,#171108)!important;
  border:1px solid #7b5a28!important;
}
#hand.hand .card.item-stat-card .card-stat-cell b{
  color:#f2d48e!important;
  text-shadow:0 1px 2px rgba(0,0,0,.85)!important;
}

/* v234 — 아이템 카드 하단/라벨 제거 및 연출 프리뷰 동기화 보강 */
body #hand.hand .card.item-stat-card{grid-template-rows:20px minmax(0,1fr) 32px!important;align-items:stretch!important;}
body #hand.hand .card.item-stat-card .cimg{align-self:stretch!important;justify-self:stretch!important;height:auto!important;min-height:0!important;max-height:none!important;padding:0!important;margin:0!important;border-bottom:1px solid #3d3024!important;background:#16110c!important;overflow:hidden!important;}
body #hand.hand .card.item-stat-card .cstats{display:block!important;align-self:stretch!important;min-height:32px!important;max-height:32px!important;height:32px!important;padding:2px!important;margin:0!important;background:linear-gradient(180deg,#2f2545,#221a31)!important;overflow:hidden!important;}
body #hand.hand .card.item-stat-card .card-stat-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:2px!important;height:100%!important;align-items:stretch!important;}
body #hand.hand .card.item-stat-card .card-stat-cell,body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .card-stat-cell{display:flex!important;align-items:center!important;justify-content:center!important;min-height:0!important;height:100%!important;padding:0 1px!important;}
body #hand.hand .card.item-stat-card .card-stat-cell::before,body #hand.hand .card.item-stat-card .card-stat-cell::after,body #hand.hand .card.item-stat-card .card-stat-cell:nth-child(1)::before,body #hand.hand .card.item-stat-card .card-stat-cell:nth-child(2)::before,body #hand.hand .card.item-stat-card .card-stat-cell:nth-child(3)::before,body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .card-stat-cell::before,body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .card-stat-cell::after,body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .card-stat-cell:nth-child(1)::before,body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .card-stat-cell:nth-child(2)::before,body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .card-stat-cell:nth-child(3)::before{content:none!important;display:none!important;}
body #hand.hand .card.item-stat-card .item-bonus-cell b,body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .item-bonus-cell b{display:block!important;font-size:13px!important;line-height:1!important;white-space:nowrap!important;color:#e8d496!important;text-shadow:none!important;}
body #hand.hand .card.item-stat-card .item-bonus-cell span{display:none!important;}
body #hand.hand .card.item-stat-card .card-image-grade{top:3px!important;left:3px!important;}

/* 실제 카드 연출 창도 관리자 미리보기와 같은 프레임/이미지 배치 규칙을 사용 */
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage{background:#04080e!important;}
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene{background:#04080e!important;}
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion{position:absolute!important;inset:0!important;overflow:hidden!important;transform:none!important;clip-path:none!important;opacity:1!important;filter:none!important;}
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene img{position:absolute!important;inset:0!important;margin:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:cover!important;object-position:var(--scene-x,50%) var(--scene-y,50%)!important;transform-origin:var(--scene-x,50%) var(--scene-y,50%)!important;animation:none!important;filter:none!important;opacity:1!important;transform:scale(var(--scene-scale,1))!important;}
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-shade,
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-energy,
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-particles{display:none!important;}

/* v235 — 아이템 숫자 검정색 및 체력 3번째 칸 강제 표시 */
body #hand.hand .card.item-stat-card .item-bonus-cell b,
body.unified-left-layout:not(.ui-mode-mobile-preview) #hand.hand .card.item-stat-card .item-bonus-cell b,
body.ui-mode-mobile #hand.hand .card.item-stat-card .item-bonus-cell b,
body.ui-mode-mobile-preview #hand.hand .card.item-stat-card .item-bonus-cell b{
  color:#111!important;
  text-shadow:none!important;
  font-weight:950!important;
}
/* 오래된 item/advisor 규칙이 마지막(체력) 셀을 두 칸 폭으로 보내고 아래로 밀던 문제 수정 */
body #hand.hand .card .card-stat-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-flow:column!important;
}
body #hand.hand .card .card-stat-cell,
body #hand.hand .card .card-stat-cell:last-child,
body #hand.hand .card.item .card-stat-cell:last-child,
body #hand.hand .card.item-stat-card .card-stat-cell:last-child,
body #hand.hand .card.advisor-card-hand .card-stat-cell:last-child{
  grid-column:auto!important;
  grid-row:auto!important;
  min-width:0!important;
  overflow:visible!important;
}
body #hand.hand .card:not(.utility-card) .cstats{overflow:visible!important;}
body #hand.hand .card:not(.utility-card) .card-stat-grid{overflow:visible!important;}
body #hand.hand .card:not(.utility-card) .card-stat-cell b{
  display:block!important;
  min-width:0!important;
  overflow:visible!important;
}


/* ---- assets/css/v236_requested_features.css ---- */
/* v236 — 카드상점 이름 확대/중앙 정렬, 카드별 연출 토글 */
#cardShopGrid .shop-card .collection-card-title,
#cardShopGrid .shop-card .collection-card-name{
  width:100%!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
}
#cardShopGrid .shop-card .collection-card-title b,
#cardShopGrid .shop-card .collection-card-name{
  font-size:clamp(15px,1.05vw,20px)!important;
  line-height:1.15!important;
  font-weight:950!important;
  letter-spacing:-.02em!important;
  text-align:center!important;
}
.individual-animation-toggle{
  display:inline-flex!important;align-items:center;gap:7px;padding:8px 11px;
  border:1px solid rgba(196,151,75,.55);border-radius:8px;background:rgba(30,22,13,.72);
  font-weight:800;white-space:nowrap;
}
.individual-animation-toggle input,#mgrCardAnimationEnabled{accent-color:#d29a42;}


/* ---- assets/css/v239_balance_skills.css ---- */
.v239-advisor-skill-wrap{display:contents}
.poison-status-badge{position:absolute;right:4px;bottom:24px;z-index:9;padding:2px 5px;border-radius:999px;background:rgba(75,20,105,.9);color:#fff;font-size:10px;font-weight:800;box-shadow:0 1px 4px rgba(0,0,0,.45)}


/* ---- assets/css/v240_rank_icons_battle_result.css ---- */
/* 삼국지 TCG v240 — 카드 이미지 하단 역할/병과 아이콘 + 전투결과 */
.v240-art-shell{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;line-height:0}
.v240-art-shell>.card-art-img,.v240-art-shell>.unit-art-img,.v240-art-shell>.configured-default-art,.v240-art-shell>.auto-folder-art,.v240-art-shell>.default-art{width:100%!important;height:100%!important;display:block!important;object-fit:cover!important}
.v240-role-icons{position:absolute;left:5px;bottom:5px;z-index:9;display:inline-flex;align-items:center;gap:2px;min-height:20px;padding:2px 5px;border-radius:7px;background:rgba(5,8,12,.80);border:1px solid rgba(255,226,157,.78);box-shadow:0 1px 4px rgba(0,0,0,.65);font-size:14px;line-height:1;pointer-events:none;white-space:nowrap}
.v240-role-glyph{display:inline-flex;align-items:center;justify-content:center;min-width:15px;height:16px;line-height:16px;filter:drop-shadow(0 1px 1px rgba(0,0,0,.8))}
.card .v240-role-icons{left:4px;bottom:4px;font-size:13px;min-height:18px;padding:2px 4px}
.uimg .v240-role-icons,.base-unit-art .v240-role-icons{left:3px;bottom:3px;font-size:11px;min-height:16px;padding:1px 3px;border-radius:5px}
.collection-card-art .v240-role-icons{left:5px;bottom:5px;font-size:13px}
.manager-preview .v240-art-shell,.card-zoom-art .v240-art-shell,.advisor-portrait .v240-art-shell,.roster-art .v240-art-shell,.base-unit-art .v240-art-shell{width:100%!important;height:100%!important}
.card-zoom-art .v240-art-shell{min-height:430px}
#endText{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center}
#endText>b{font-size:32px;line-height:1.1}
#endText>span{font-size:14px;font-weight:700;opacity:.9}
#endText[data-result="win"]>b{color:#ffe39a}
#endText[data-result="lose"]>b{color:#ffb0a8}
#endText[data-result="draw"]>b{color:#d5d8df}
@media(max-width:760px){
  .v240-role-icons{left:3px;bottom:3px;font-size:11px;min-height:16px;padding:1px 3px;gap:1px}
  .card-zoom-art .v240-art-shell{min-height:340px}
}


/* ---- assets/css/v241_requested_patch.css ---- */
/* v241 — 사용자 요청: 연출창 텍스트 제거/이미지 꽉 채움, 상점·덱 아이콘 정리, 랜덤 비율 글씨 확대, 전술 이펙트 강화 */

/* 1) 실제 애니메이션 화면만 텍스트를 숨기고 이미지가 박스를 가득 채우도록 한다.
   카드 원본/카드관리 이미지 비율·레이아웃 값은 건드리지 않는다. */
.left-card-effect-card.action-view-mode .left-card-effect-title,
.left-card-effect-stage-badge,
.left-card-effect-stage .hq-card-scene .scene-label,
.left-card-effect-stage .hq-card-scene .scene-effect-caption,
.battlefield-card-scene .scene-label,
.battlefield-card-scene .scene-effect-caption,
.battle-hq .hq-card-scene:not(.stage-preview) .scene-label,
.battle-hq .hq-card-scene:not(.stage-preview) .scene-effect-caption{
  display:none!important;
}
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-card.action-view-mode,
.left-card-effect-card.action-view-mode{
  grid-template-rows:minmax(0,1fr)!important;
  gap:0!important;
}
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage,
.left-card-effect-stage{
  padding:0!important;
  overflow:hidden!important;
  background:#04080e!important;
}
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage>.hq-card-scene.left-effect-preview-scene,
.left-card-effect-stage>.hq-card-scene.left-effect-preview-scene{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
}
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion,
.battlefield-card-scene .scene-entry-motion,
.battle-hq .hq-card-scene:not(.stage-preview) .scene-entry-motion{
  position:absolute!important;
  inset:0!important;
  overflow:hidden!important;
  clip-path:none!important;
}
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene img,
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion>img,
.battlefield-card-scene img,
.battlefield-card-scene .scene-entry-motion>img,
.battle-hq .hq-card-scene:not(.stage-preview) img,
.battle-hq .hq-card-scene:not(.stage-preview) .scene-entry-motion>img{
  position:absolute!important;
  inset:0!important;
  margin:0!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:cover!important;
  object-position:var(--scene-x,50%) var(--scene-y,50%)!important;
  transform-origin:var(--scene-x,50%) var(--scene-y,50%)!important;
}
/* 이전 버전에서 PC 연출창의 오버레이를 숨기던 규칙을 되돌려 실제 효과는 보이게 한다. */
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-shade,
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-energy,
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-particles{
  display:block!important;
}

/* 2) 덱 편집 UI */
.deck-builder-name-input{min-width:170px!important}
.deck-auto-ratio-inline,
.deck-auto-ratio-inline label,
.deck-auto-ratio-inline button{
  font-size:14px!important;
}
.deck-auto-ratio-inline label{
  font-weight:900!important;
  color:#f7e6b5!important;
}
.deck-auto-ratio-inline input{
  font-size:15px!important;
  font-weight:900!important;
  min-height:31px!important;
}

/* 3) 덱편집/카드상점 좌하단 병과 아이콘 중복 제거.
   v240 cardVisual 내부 역할/병과 아이콘만 남기며 EN 표시는 유지한다. */
.deck-builder-visual-card .collection-card-icons .collection-type-icon,
.deck-builder-visual-card .collection-card-icons .collection-soldier-icon,
.card-shop-grid .collection-card-icons .collection-type-icon,
.card-shop-grid .collection-card-icons .collection-soldier-icon{
  display:none!important;
}

/* 4) 화공 지속 중 카드 하단에 실제 불꽃이 일렁이는 느낌 */
.unit.v241-burning .uimg{
  box-shadow:0 0 0 1px #ffcc7730,0 0 22px #ff7b2d66!important;
}
.unit.v241-burning .uimg::before{
  content:'';
  position:absolute;
  left:3%;right:3%;bottom:-1px;height:31%;
  pointer-events:none;z-index:12;
  background:
    radial-gradient(ellipse at 12% 100%,#fff7c7 0 7%,#ffc14d 11%,#ff6e20 25%,transparent 45%),
    radial-gradient(ellipse at 35% 100%,#fff3ac 0 8%,#ffa936 14%,#ff4d14 33%,transparent 51%),
    radial-gradient(ellipse at 60% 100%,#fff8c7 0 7%,#ffc54b 13%,#ff6c1d 29%,transparent 49%),
    radial-gradient(ellipse at 82% 100%,#ffeaa0 0 7%,#ff9a2a 14%,#ff4718 32%,transparent 50%),
    radial-gradient(ellipse at 96% 100%,#fff2aa 0 6%,#ffb23a 13%,#ff5b18 30%,transparent 48%);
  filter:drop-shadow(0 0 9px #ff8a2a);
  animation:v241FireLick .72s ease-in-out infinite alternate;
}
.unit.v241-burning .uimg::after{
  content:'';
  position:absolute;
  left:7%;right:7%;bottom:14%;height:34%;
  pointer-events:none;z-index:11;
  background:linear-gradient(180deg,transparent,#ffb34a55 52%,#ff541c2d 100%);
  filter:blur(7px);
  animation:v241HeatWave .2s linear infinite alternate;
}
@keyframes v241FireLick{from{transform:translateY(7%) scaleY(.84) skewX(-1deg)}to{transform:translateY(-7%) scaleY(1.18) skewX(1deg)}}
@keyframes v241HeatWave{from{transform:skewX(-1.4deg) translateX(-1px)}to{transform:skewX(1.4deg) translateX(1px)}}

/* 낙뢰: 번개 직격 후 카드 주위를 감싸는 감전 아크 */
.v241-electric-arc{
  position:fixed;width:104px;height:104px;pointer-events:none;z-index:10003;
  transform:translate(-50%,-50%);
}
.v241-electric-arc::before,.v241-electric-arc::after{
  content:'';position:absolute;inset:7px;border-radius:50%;
  border:2px solid rgba(210,248,255,.92);
  box-shadow:0 0 10px #fff,0 0 24px #70d8ff,inset 0 0 16px #b5edff;
  clip-path:polygon(50% 0,60% 19%,80% 8%,72% 37%,100% 48%,75% 61%,91% 86%,61% 76%,50% 100%,39% 75%,10% 88%,25% 60%,0 50%,26% 39%,14% 12%,40% 22%);
  animation:v241ElectricArc .72s steps(2,end) forwards;
}
.v241-electric-arc::after{inset:20px;opacity:.8;animation-delay:.07s;transform:rotate(25deg)}
@keyframes v241ElectricArc{0%{opacity:0;transform:scale(.25) rotate(-20deg)}18%{opacity:1}55%{opacity:.92}100%{opacity:0;transform:scale(1.35) rotate(28deg)}}

/* 화공: 카드 위로 터지는 화염 */
.v241-fire-burst{
  position:fixed;width:132px;height:132px;pointer-events:none;z-index:10003;
  transform:translate(-50%,-50%);
}
.v241-fire-burst::before,.v241-fire-burst::after{
  content:'';position:absolute;left:50%;bottom:4px;width:112px;height:112px;transform:translateX(-50%);
  background:radial-gradient(circle at 50% 88%,#fff7c8 0 8%,#ffc54b 16%,#ff6a1e 35%,rgba(142,15,0,.45) 56%,transparent 74%);
  filter:drop-shadow(0 0 12px #ff6a1d);
  clip-path:polygon(50% 0,60% 13%,69% 28%,82% 15%,76% 43%,95% 37%,84% 60%,100% 73%,76% 70%,84% 98%,61% 82%,50% 100%,38% 82%,15% 98%,24% 70%,0 73%,17% 59%,6% 38%,24% 43%,17% 15%,31% 28%,39% 13%);
  animation:v241FireBurst .86s ease-out forwards;
}
.v241-fire-burst::after{width:62px;height:84px;bottom:18px;opacity:.86;animation-delay:.06s}
@keyframes v241FireBurst{0%{opacity:0;transform:translateX(-50%) scale(.3) translateY(14px)}22%{opacity:1}100%{opacity:0;transform:translateX(-50%) scale(1.35) translateY(-22px)}}

/* 강풍: 대상 카드 주위에 두 겹의 돌풍 + 카드 흔들림 */
.v241-gust{
  position:fixed;width:164px;height:96px;pointer-events:none;z-index:10003;
  transform:translate(-50%,-50%);
}
.v241-gust::before,.v241-gust::after{
  content:'';position:absolute;inset:0;border-radius:50%;
  border-top:4px solid rgba(222,250,255,.98);
  border-bottom:4px solid rgba(105,190,231,.76);
  border-left:5px solid transparent;border-right:5px solid transparent;
  filter:drop-shadow(0 0 8px #86ddff);
  animation:v241GustSpin .84s ease-out forwards;
}
.v241-gust::after{inset:17px 12px 20px 18px;opacity:.82;animation-delay:.05s}
@keyframes v241GustSpin{0%{opacity:0;transform:rotate(-55deg) scale(.2)}22%{opacity:1}100%{opacity:0;transform:rotate(205deg) scale(1.2)}}
.unit.v241-wind-hit{animation:v241WindHit .56s ease-out}
@keyframes v241WindHit{0%{transform:translateX(0)}18%{transform:translateX(-8px) rotate(-1.2deg)}40%{transform:translateX(10px) rotate(1.5deg)}68%{transform:translateX(-4px)}100%{transform:translateX(0)}}


/* ---- assets/css/v242_animation_fill_fix.css ---- */
/* v242 — 애니메이션 연출창 텍스트 완전 제거 + 박스 꽉 채우기 */

/* 연출창 내부 텍스트/배지 완전 숨김 */
.left-card-effect-title,
.left-card-effect-title *,
.left-card-effect-stage-badge,
.left-card-effect-stage .scene-label,
.left-card-effect-stage .scene-effect-caption{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  max-height:0!important;
  overflow:hidden!important;
}

/* 연출 박스 내부 여백 제거 */
.left-card-effect-body{
  padding:0!important;
}
.left-card-effect-card.action-view-mode,
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-card.action-view-mode{
  display:grid!important;
  grid-template-rows:minmax(0,1fr)!important;
  gap:0!important;
  height:100%!important;
  min-height:0!important;
  padding:0!important;
  margin:0!important;
}
.left-card-effect-stage,
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage{
  position:relative!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  background:#04080e!important;
  line-height:0!important;
}

/* 실제 연출 장면이 박스를 완전히 채우도록 오버스캔 적용 */
.left-card-effect-stage > .hq-card-scene.left-effect-preview-scene,
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage > .hq-card-scene.left-effect-preview-scene{
  position:absolute!important;
  inset:-2px!important;
  width:calc(100% + 4px)!important;
  height:calc(100% + 4px)!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  overflow:hidden!important;
}
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion{
  position:absolute!important;
  inset:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  clip-path:none!important;
}
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene img,
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion > img{
  position:absolute!important;
  inset:0!important;
  margin:0!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:cover!important;
  object-position:var(--scene-x,50%) var(--scene-y,50%)!important;
  transform-origin:var(--scene-x,50%) var(--scene-y,50%)!important;
}


/* ---- assets/css/v243_advisor_name_effect_gap_fix.css ---- */
/* v243 — 책사 이름 잘림 수정 + 연출창 이미지/박스선 여백 완전 제거 */

/* 1) 책사 이름이 아래쪽에서 잘리지 않도록 배지 높이/행간 보정 */
.battle-hq .hq-advisor-slot .advisor-slot-badge,
body.ui-mode-mobile .hq-advisor-slot .advisor-slot-badge,
body.ui-mode-mobile-preview .hq-advisor-slot .advisor-slot-badge{
  box-sizing:border-box!important;
  min-height:22px!important;
  height:22px!important;
  padding:2px 5px 4px!important;
  display:flex!important;
  align-items:flex-end!important;
  justify-content:center!important;
  gap:4px!important;
  overflow:hidden!important;
}
.battle-hq .hq-advisor-slot .advisor-slot-badge b,
body.ui-mode-mobile .hq-advisor-slot .advisor-slot-badge b,
body.ui-mode-mobile-preview .hq-advisor-slot .advisor-slot-badge b{
  display:block!important;
  width:100%!important;
  line-height:1.18!important;
  padding-bottom:1px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  text-align:center!important;
  font-size:10px!important;
}
.battle-hq .hq-advisor-slot .advisor-slot-badge span,
body.ui-mode-mobile .hq-advisor-slot .advisor-slot-badge span,
body.ui-mode-mobile-preview .hq-advisor-slot .advisor-slot-badge span{
  line-height:1.1!important;
}

/* 2) 연출 사진과 연출 박스선 사이의 모든 여백 제거 */
.left-card-effect-section,
.left-card-effect-body,
.left-card-effect-card.action-view-mode,
.left-card-effect-stage{
  padding:0!important;
}
.left-card-effect-stage,
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage{
  margin:0!important;
  border:0!important;
  outline:0!important;
  overflow:hidden!important;
  background:#000!important;
}
.left-card-effect-stage > .hq-card-scene.left-effect-preview-scene,
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage > .hq-card-scene.left-effect-preview-scene{
  position:absolute!important;
  inset:-4px!important;
  width:calc(100% + 8px)!important;
  height:calc(100% + 8px)!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  overflow:hidden!important;
}
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion{
  position:absolute!important;
  inset:-2px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  overflow:hidden!important;
}
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene img,
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion > img{
  position:absolute!important;
  inset:-4px!important;
  width:calc(100% + 8px)!important;
  height:calc(100% + 8px)!important;
  margin:0!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:cover!important;
  object-position:var(--scene-x,50%) var(--scene-y,50%)!important;
  transform-origin:var(--scene-x,50%) var(--scene-y,50%)!important;
}
/* 내부 효과 레이어가 가장자리에 여백처럼 보이지 않도록 동일하게 맞춤 */
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-shade,
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-energy,
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-particles{
  position:absolute!important;
  inset:0!important;
  margin:0!important;
}


/* ---- assets/css/v244_hq_advisor_lane_labels_fix.css ---- */
/* v244 — 본진 책사 카드 높이/이름 표시 + 아군 전투열 문구 정리 */

/*
 * 본진 진영의 5번째 칸으로 reparent 된 책사 슬롯은 더 이상 .battle-hq 하위가 아니다.
 * 따라서 본진 책사칸 자체를 기준으로 슬롯/카드/초상화를 열박스 높이에 정확히 맞춘다.
 */
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot{
  position:relative!important;
  align-self:stretch!important;
  padding:0!important;
  overflow:hidden!important;
}
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot > .hq-advisor-slot,
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot > .advisor{
  position:relative!important;
  inset:auto!important;
  display:block!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  height:100%!important;
  min-height:100%!important;
  max-height:100%!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:inherit!important;
  overflow:hidden!important;
  background:transparent!important;
}
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-card,
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-image-only{
  position:relative!important;
  display:block!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  height:100%!important;
  min-height:100%!important;
  max-height:100%!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  overflow:hidden!important;
}

/* 책사 이미지는 이름 배지 때문에 줄어들지 않고 카드 박스 전체 높이를 사용한다. */
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-portrait{
  position:absolute!important;
  inset:0!important;
  display:block!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  height:100%!important;
  min-height:100%!important;
  max-height:100%!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  overflow:hidden!important;
}
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-portrait > img,
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-portrait > .default-art,
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-portrait > svg,
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-portrait .v240-art-shell,
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-portrait .v240-art-shell > img{
  display:block!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-width:100%!important;
  max-width:100%!important;
  height:100%!important;
  min-height:100%!important;
  max-height:100%!important;
  margin:0!important;
  padding:0!important;
  object-fit:cover!important;
  object-position:center top!important;
}

/* 본진 책사 이름은 카드 안쪽 하단 오버레이로 고정해 잘리지 않게 표시한다. */
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-slot-badge{
  position:absolute!important;
  left:0!important;
  right:0!important;
  top:auto!important;
  bottom:0!important;
  z-index:20!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  height:24px!important;
  min-height:24px!important;
  max-height:24px!important;
  margin:0!important;
  padding:3px 5px 4px!important;
  overflow:hidden!important;
  background:linear-gradient(180deg,rgba(4,7,11,.18),rgba(4,7,11,.96))!important;
  border:0!important;
  border-top:1px solid rgba(213,170,98,.8)!important;
}
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-slot-badge b{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  color:#fff3d5!important;
  font-size:10px!important;
  font-weight:900!important;
  line-height:16px!important;
  text-align:center!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body:not(.prebattle) .hq-defense-lane .hq-advisor-field-slot .advisor-slot-badge span{
  display:none!important;
}


/* ---- assets/css/v245_action_buff_animation_rules.css ---- */
/* 삼국지 TCG v245 — 버프 아이콘 + 애니메이션 박스 꽉 채움 */

/* 버프 장수 전용 아이콘: 카드 이미지 우측 하단, 기존 좌하단 병과 아이콘/좌상단 EN과 분리 */
.v245-art-shell{
  position:relative!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  overflow:hidden!important;
  line-height:0!important;
}
.v245-art-shell>.v240-art-shell,
.v245-art-shell>img,
.v245-art-shell>.configured-default-art,
.v245-art-shell>.auto-folder-art,
.v245-art-shell>.default-art{
  width:100%!important;
  height:100%!important;
  display:block!important;
}
.v245-action-icon-rail{
  position:absolute!important;
  right:4px!important;
  bottom:4px!important;
  z-index:34!important;
  display:inline-flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:3px!important;
  pointer-events:none!important;
  line-height:1!important;
}
.v245-buff-skill-icon{
  display:grid!important;
  place-items:center!important;
  width:20px!important;
  height:20px!important;
  min-width:20px!important;
  padding:0!important;
  border:1px solid rgba(127,242,220,.95)!important;
  border-radius:6px!important;
  background:rgba(5,66,59,.92)!important;
  color:#d9fff8!important;
  box-shadow:0 1px 4px rgba(0,0,0,.8)!important;
  font-size:14px!important;
  font-weight:1000!important;
  text-shadow:0 1px 2px #000!important;
}
/* 예전 상단 '버프' 글자 배지는 중복 표시하지 않음 */
.battlefield-layout .unit .unit-buff-box,
#hand.hand .card .hand-buff-provider-badge{display:none!important;}

/* 작은 전투 카드에서도 아이콘끼리 겹치지 않도록 축소 */
.battlefield-layout .unit .v245-action-icon-rail{right:3px!important;bottom:3px!important;gap:2px!important;}
.battlefield-layout .unit .v245-buff-skill-icon{width:16px!important;height:16px!important;min-width:16px!important;font-size:11px!important;border-radius:4px!important;}
.base-unit-art .v245-action-icon-rail{right:3px!important;bottom:3px!important;}
.base-unit-art .v245-buff-skill-icon{width:17px!important;height:17px!important;min-width:17px!important;font-size:11px!important;}
@media(max-width:850px){
  .v245-action-icon-rail{right:3px!important;bottom:3px!important;}
  .v245-buff-skill-icon{width:17px!important;height:17px!important;min-width:17px!important;font-size:11px!important;border-radius:4px!important;}
}

/* 카드 애니메이션 화면: 박스와 이미지 사이 여백 0 */
.left-card-effect-body,
.left-card-effect-card.action-view-mode,
.left-card-effect-stage{
  padding:0!important;
  margin:0!important;
  gap:0!important;
}
.left-card-effect-stage,
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage{
  position:relative!important;
  width:100%!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
  border:0!important;
  outline:0!important;
  background:#000!important;
  line-height:0!important;
}
.left-card-effect-stage>.hq-card-scene.left-effect-preview-scene,
body.unified-left-layout:not(.ui-mode-mobile-preview) .left-card-effect-stage>.hq-card-scene.left-effect-preview-scene{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  outline:0!important;
  box-shadow:none!important;
  overflow:hidden!important;
}
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  overflow:hidden!important;
}
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene img,
.left-card-effect-stage .hq-card-scene.left-effect-preview-scene .scene-entry-motion>img{
  position:absolute!important;
  inset:0!important;
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-width:100%!important;
  min-height:100%!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  object-fit:cover!important;
  object-position:var(--scene-x,50%) var(--scene-y,50%)!important;
  transform-origin:var(--scene-x,50%) var(--scene-y,50%)!important;
}


/* ---- assets/css/v246_buff_target_filter_rules.css ---- */
/* 삼국지 TCG v246 — 공격/버프 동시 타깃, 버프 필터, 덱 비율 입력 폭 */

/* 공격 가능 적 카드: 어두운 레이아웃에서도 카드 자체가 확실히 밝아지게 */
.slot.attackable.v246-bright-attack-target,
body.unified-left-layout:not(.ui-mode-mobile-preview) .slot.attackable.v246-bright-attack-target{
  outline:3px solid #ff5f67!important;
  outline-offset:2px!important;
  box-shadow:0 0 0 3px rgba(255,75,86,.42),0 0 24px rgba(255,68,82,.9),inset 0 0 18px rgba(255,88,96,.28)!important;
  background:rgba(126,16,26,.24)!important;
}
.slot.attackable.v246-bright-attack-target .unit{
  filter:brightness(1.3) saturate(1.24)!important;
  box-shadow:0 0 18px rgba(255,92,99,.9),0 6px 14px rgba(0,0,0,.55)!important;
}

/* 버프 가능 아군 카드: 공격 대상과 명확하게 구별되는 밝은 청록색 */
.slot.supportable.v246-bright-buff-target,
body.unified-left-layout:not(.ui-mode-mobile-preview) .slot.supportable.v246-bright-buff-target,
.hq-field-slot.supportable.v246-bright-buff-target{
  outline:3px solid #62ffe1!important;
  outline-offset:2px!important;
  box-shadow:0 0 0 3px rgba(75,255,221,.42),0 0 25px rgba(73,255,219,.88),inset 0 0 18px rgba(88,255,222,.25)!important;
  background:rgba(17,122,105,.2)!important;
}
.slot.supportable.v246-bright-buff-target .unit,
.hq-field-slot.supportable.v246-bright-buff-target .unit{
  filter:brightness(1.32) saturate(1.18)!important;
  box-shadow:0 0 19px rgba(86,255,226,.88),0 6px 14px rgba(0,0,0,.5)!important;
}
.slot.supportable.v246-bright-buff-target::before,
.hq-field-slot.supportable.v246-bright-buff-target::before{
  content:'버프 가능'!important;
  background:rgba(0,92,78,.96)!important;
  border-color:#7affea!important;
  color:#edfffb!important;
  box-shadow:0 0 10px rgba(87,255,226,.55)!important;
}

/* 버프 필터 */
#deckBuilderBuffFilter,#cardShopBuffFilter{min-width:92px!important;}
.deck-builder-toolbar .v246-buff-filter-label,
.card-shop-toolbar .v246-buff-filter-label{white-space:nowrap!important;}

/* 랜덤 비율 입력: 100도 잘리지 않도록 기존 36px 강제폭보다 넓게 */
.deck-auto-ratio-inline input[type=number],
#deckRatioGeneral,#deckRatioAdvisor,#deckRatioItem,#deckRatioTactic{
  width:58px!important;
  min-width:58px!important;
  max-width:68px!important;
  padding-left:7px!important;
  padding-right:7px!important;
  box-sizing:border-box!important;
  text-align:center!important;
  font-variant-numeric:tabular-nums!important;
}
#deckBuilderAutoBtn{min-width:58px!important;}

@media(max-width:850px){
  .deck-auto-ratio-inline input[type=number],
  #deckRatioGeneral,#deckRatioAdvisor,#deckRatioItem,#deckRatioTactic{width:60px!important;min-width:60px!important;}
  #deckBuilderBuffFilter,#cardShopBuffFilter{min-width:0!important;width:100%!important;}
}

/* 본진 책사 슬롯의 신규 버프 버튼 */
#allyAdvisorConsole .v246-advisor-buff-skill{
  border-color:#62ffe1!important;
  box-shadow:inset 0 0 12px rgba(70,255,220,.12),0 0 8px rgba(70,255,220,.18)!important;
}
#allyAdvisorConsole .v246-advisor-buff-skill:not(:disabled) b{color:#bffff3!important;}

/* 필터 폴백: 브라우저/레이아웃 CSS가 hidden 표시를 덮어써도 강제로 숨김 */
.v246-filter-hidden{display:none!important;}


/* ---- assets/css/v251_score_badge_deck_ratio.css ---- */
/* =====================================================================
   v251 — 카드 점수 배지(EN 원 옆 작은 원) + 스킬 편집 화면 개선 스타일
   ===================================================================== */

/* ---------- 1) 카드 점수 배지: EN 원(우측 상단, right:4px) 왼쪽에 나란히 표시 ---------- */
.collection-card-art{ position:relative; }
.collection-score-badge{
  position:absolute;
  right:27px;
  top:4px;
  z-index:9;
  display:grid;
  place-items:center;
  width:20px;
  height:20px;
  border-radius:50%;
  border:1px solid var(--v218-gold-soft,#c6a25a);
  background:color-mix(in srgb, var(--v218-deep,#111) 88%, transparent);
  color:#9be27a;
  font-family:"Malgun Gothic","Apple SD Gothic Neo",sans-serif;
  font-size:11px;
  font-weight:1000;
  line-height:1;
  text-shadow:0 1px 2px #000;
  pointer-events:none;
}
@media (max-width:850px){
  .collection-score-badge{ right:24px; top:3px; width:16px; height:16px; font-size:9px; }
}

/* ---------- 2) 스킬 편집 화면: 상단 툴바(검색·전체 초기화) ---------- */
#skillEditorModal .manager-head-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.skill-editor-search{
  padding:6px 10px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(0,0,0,.25);
  color:inherit;
  font-size:13px;
  min-width:180px;
}
.skill-editor-summary{
  padding:4px 16px 0;
  font-size:12px;
  opacity:.75;
}

/* ---------- 3) 탭: 스킬 개수·수정 개수 함께 표시 ---------- */
#skillEditorModal .skill-editor-tabs button{ display:flex; flex-direction:column; align-items:center; gap:2px; line-height:1.2; }
#skillEditorModal .skill-editor-tabs button small{ font-size:10px; opacity:.75; font-weight:400; }
#skillEditorModal .skill-editor-tabs button.active small{ opacity:.9; }

/* ---------- 4) 등급(티어)별 그룹 헤더 ---------- */
.skill-tier-group{ display:flex; flex-direction:column; gap:8px; margin-bottom:4px; }
.skill-tier-group-head{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 2px 2px;
  border-bottom:1px solid rgba(255,255,255,.1);
}
.skill-tier-group-head small{ opacity:.65; font-size:11px; }

/* ---------- 5) 스킬 카드: 수정됨 표시 ---------- */
.skill-edit-card{ position:relative; transition:border-color .15s; }
.skill-edit-card.modified{ border-color:#c6a25a; background:rgba(198,162,90,.08); }
.skill-modified-dot{
  font-size:10px;
  padding:1px 6px;
  border-radius:999px;
  background:rgba(198,162,90,.25);
  border:1px solid #c6a25a;
  color:#f2d9a0;
  margin-left:2px;
}
.skill-edit-noparam{ opacity:.6; font-size:12px; }
.skill-editor-empty{ padding:24px 12px; text-align:center; opacity:.7; font-size:13px; }


/* ---- assets/css/v252_score_badge_below_en.css ---- */
/* =====================================================================
   v252 — 카드 점수 배지 위치 조정
   카드 점수는 우측 상단 행동력(EN) 원 바로 아래에 더 작은 원으로 표시한다.
   v251의 점수 계산/마크업은 그대로 사용하고 위치·크기만 덮어쓴다.
   ===================================================================== */
.collection-score-badge{
  right:6px;
  top:27px;
  width:15px;
  height:15px;
  border-width:1px;
  font-size:8px;
  line-height:1;
}

@media (max-width:850px){
  .collection-score-badge{
    right:5px;
    top:23px;
    width:12px;
    height:12px;
    font-size:7px;
  }
}


/* ---- assets/css/v257_skill_enhancement.css ---- */
.sss-effect-panel{display:none!important}
#boosterPackModal .modalbox{max-width:1080px;width:min(96vw,1080px);max-height:90vh;overflow:auto}

/* v256 — 연의 기반 통합 스킬 / 부스터 강화 */
.v256-unified-skill-field{border:1px solid rgba(198,162,90,.34);background:rgba(198,162,90,.06);padding:10px;border-radius:10px}
.v256-unified-skill-field label small{opacity:.65;margin-left:6px;font-weight:400}
.v256-skill-info{font-size:12px;line-height:1.55;margin-top:7px;padding:8px 10px;border-radius:8px;background:rgba(0,0,0,.18)}
.v256-skill-info span{opacity:.72}
.v256-booster-tabs{display:flex;gap:8px;padding:10px 14px 0}
.v256-booster-tabs .active{box-shadow:0 0 0 1px rgba(255,255,255,.15) inset}
.v256-enhancement-panel{display:none;padding:12px 14px 16px}
.v256-enhancement-panel.active{display:block}
.v256-enhance-toolbar{display:flex;gap:8px;margin-bottom:10px}
.v256-enhance-toolbar input{flex:1;min-width:160px}
.v256-enhance-toolbar input,.v256-enhance-toolbar select{padding:8px 10px;border-radius:8px;border:1px solid rgba(255,255,255,.18);background:rgba(0,0,0,.22);color:inherit}
.v256-enhance-layout{display:grid;grid-template-columns:minmax(250px,38%) 1fr;gap:12px;min-height:430px}
.v256-enhance-card-list{overflow:auto;max-height:62vh;border:1px solid rgba(255,255,255,.12);border-radius:10px;padding:6px;background:rgba(0,0,0,.12)}
.v256-enhance-card-row{width:100%;display:grid;grid-template-columns:1fr auto;grid-template-areas:"name grade" "name owned";align-items:center;gap:2px 8px;text-align:left;padding:9px 10px;margin:0 0 5px;border-radius:9px;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.035);color:inherit;cursor:pointer}
.v256-enhance-card-row:hover,.v256-enhance-card-row.selected{border-color:#c6a25a;background:rgba(198,162,90,.13)}
.v256-enhance-card-row>span:first-child{grid-area:name;display:flex;flex-direction:column;gap:3px}
.v256-enhance-card-row small{font-size:10.5px;opacity:.65}
.v256-enhance-card-row .v256-grade{grid-area:grade;font-weight:900;color:#f0c96c;text-align:right}
.v256-enhance-card-row .v256-owned{grid-area:owned;font-size:10.5px;opacity:.75;text-align:right}
.v256-enhance-detail{border:1px solid rgba(255,255,255,.13);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:10px;background:rgba(0,0,0,.12)}
.v256-enhance-detail-inner{flex:1}
.v256-detail-title{display:flex;justify-content:space-between;align-items:center;padding-bottom:9px;border-bottom:1px solid rgba(255,255,255,.12);font-size:17px}
.v256-detail-title span{font-weight:900;color:#f0c96c}
.v256-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}
.v256-detail-grid>div{display:flex;flex-direction:column;gap:4px;padding:9px;border-radius:8px;background:rgba(255,255,255,.04)}
.v256-detail-grid .full{grid-column:1/-1}
.v256-detail-grid small{opacity:.65}
.v256-detail-grid b{font-size:12.5px;line-height:1.55}
.v256-detail-grid em{font-style:normal;color:#80d99a}
.v256-rule-box{margin-top:10px;padding:10px;border:1px solid rgba(198,162,90,.35);border-radius:9px;display:flex;flex-wrap:wrap;gap:7px 12px;align-items:center;background:rgba(198,162,90,.07);font-size:12px}
.v256-rule-box b{font-size:15px;color:#f0c96c}
.v256-rule-box strong{color:#82e49b}
.v256-rule-box small{flex-basis:100%;opacity:.72}
.v256-rule-box.max{border-color:rgba(255,215,80,.4)}
.v256-material{margin-top:9px;font-size:12px;opacity:.88}
.v256-enhance-result{border-radius:10px;padding:11px;border:1px solid rgba(255,255,255,.13);background:rgba(0,0,0,.16);font-size:12px}
.v256-enhance-result:empty{display:none}
.v256-enhance-result.success{border-color:rgba(80,220,120,.45);background:rgba(80,220,120,.08)}
.v256-enhance-result.fail{border-color:rgba(240,95,95,.42);background:rgba(240,95,95,.07)}
.v256-result-head{font-size:18px;font-weight:900;margin-bottom:7px}
.v256-enhance-result.success .v256-result-head{color:#82e49b}
.v256-enhance-result.fail .v256-result-head{color:#ff9a9a}
.v256-result-line{display:flex;justify-content:space-between;padding:4px 0;border-bottom:1px dashed rgba(255,255,255,.08)}
.v256-result-line span{opacity:.7}
.v256-result-skill{padding:7px 0;display:grid;grid-template-columns:60px 1fr;gap:5px}
.v256-result-skill>span{opacity:.7}
.v256-result-skill small{grid-column:2;opacity:.72}
.v256-arrow{color:#f0c96c;padding:0 4px}
.v256-result-material{text-align:right;margin-top:6px;opacity:.7}
.v256-empty{padding:25px 10px;text-align:center;opacity:.65;line-height:1.6}
@media(max-width:760px){
  .v256-enhance-layout{grid-template-columns:1fr;min-height:0}
  .v256-enhance-card-list{max-height:34vh}
  .v256-enhance-detail{min-height:360px}
  .v256-detail-grid{grid-template-columns:1fr}
  .v256-detail-grid .full{grid-column:auto}
  .v256-enhance-toolbar{flex-direction:column}
}

/* v257 — 관리자 강화 테스트 / 일반 사용자 강화 가능 대상 필터 */
.v257-enhance-role-note{flex-basis:100%;font-size:11px;line-height:1.5;padding:7px 9px;border-radius:8px;border:1px solid rgba(198,162,90,.28);background:rgba(198,162,90,.07);opacity:.9}
.v257-enhance-role-note b{color:#f0c96c}
#v257EnhanceResetBtn{border-color:rgba(255,180,90,.34)}
html:not(.is-card-admin) #v257EnhanceResetBtn{display:none!important}
@media(max-width:760px){.v257-enhance-role-note{flex-basis:auto}}


/* ---- assets/css/v258_owned_enhancement_shop_filters.css ---- */
/* v258 — 강화 카드 보유 표시 / 카드상점 필터 */
.shop-card,.deck-builder-visual-card,.v258-owned-card{position:relative!important}
.v258-enhancement-bookmark{
  position:absolute;z-index:18;left:7px;top:-1px;
  display:flex;align-items:center;justify-content:center;
  min-width:49px;height:23px;padding:0 7px 4px;
  box-sizing:border-box;border-radius:0 0 7px 7px;
  background:linear-gradient(180deg,#f7d77a,#9f6d18 82%);
  color:#201300;font-size:9px;font-weight:950;letter-spacing:-.2px;
  text-shadow:0 1px 0 rgba(255,255,255,.35);
  box-shadow:0 2px 6px rgba(0,0,0,.48),0 0 0 1px rgba(255,230,140,.35) inset;
  pointer-events:none;white-space:nowrap;
}
.v258-enhancement-bookmark:after{content:"";position:absolute;left:50%;bottom:-6px;transform:translateX(-50%);border-left:8px solid transparent;border-right:8px solid transparent;border-top:7px solid #9f6d18}
.v258-enhancement-bookmark.is-test{background:linear-gradient(180deg,#b9d6ff,#48658d 82%);color:#081321}.v258-enhancement-bookmark.is-test:after{border-top-color:#48658d}
.v258-enhanced-card{
  border-color:#e5bc4f!important;
  box-shadow:0 0 0 2px rgba(229,188,79,.48) inset,0 0 10px rgba(229,188,79,.32)!important;
}
.v258-normal-card{box-shadow:none}

/* 카드상점: 점수는 두 자리 숫자 정도 폭, 보유 필터 추가 */
.card-shop-toolbar{
  grid-template-columns:108px 96px 78px 82px 58px 82px minmax(150px,1fr) 78px!important;
}
.card-shop-toolbar .card-shop-point-filter{width:58px!important;min-width:58px!important}
.card-shop-toolbar .card-shop-point-filter select{width:52px!important;min-width:52px!important;padding-left:5px!important;padding-right:16px!important;text-align:center!important}
.card-shop-toolbar .card-shop-ownership-filter{width:82px!important;min-width:82px!important}
.shop-owned-outside{white-space:nowrap!important;font-size:10px!important}

/* 부스터팩 > 보유카드 */
.v258-owned-panel{display:none;padding:12px 14px 16px}.v258-owned-panel.active{display:block}
.v258-owned-toolbar{display:grid;grid-template-columns:105px minmax(170px,1fr) 88px;gap:8px;align-items:end;margin-bottom:8px}
.v258-owned-toolbar label{display:grid;gap:4px;font-size:11px}.v258-owned-toolbar select,.v258-owned-toolbar input{width:100%;min-width:0;padding:8px 9px;border-radius:8px;border:1px solid rgba(255,255,255,.18);background:rgba(0,0,0,.22);color:inherit;box-sizing:border-box}
.v258-owned-count{height:34px;border:1px solid rgba(255,255,255,.14);border-radius:8px;display:flex;align-items:center;justify-content:center;gap:5px;font-size:11px}.v258-owned-count b{font-size:17px;color:#f0c96c}
.v258-owned-guide{padding:8px 10px;margin-bottom:9px;border-radius:8px;background:rgba(198,162,90,.07);border:1px solid rgba(198,162,90,.22);font-size:11px;line-height:1.5;opacity:.88}
.v258-owned-grid{display:grid;grid-template-columns:repeat(6,minmax(120px,1fr));gap:9px;align-items:start;max-height:62vh;overflow:auto;padding:4px}
.v258-owned-entry{display:grid;gap:5px;min-width:0}
.v258-owned-card{display:grid;grid-template-rows:46px 145px auto minmax(42px,auto);overflow:hidden;min-height:270px;border:1px solid rgba(255,255,255,.16);border-radius:10px;background:rgba(12,12,14,.92);box-sizing:border-box}
.v258-owned-card>.collection-card-title{grid-row:1}.v258-owned-card>.collection-card-art{grid-row:2;height:145px!important;min-height:145px!important}.v258-owned-card>.collection-five-stats{grid-row:3}.v258-owned-card>.collection-extra{grid-row:4;min-height:42px!important}
.v258-owned-meta{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:4px 6px;border-radius:7px;background:rgba(0,0,0,.28);font-size:10px}.v258-owned-meta b{color:#e7d4a5}.v258-owned-entry:has(.v258-enhanced-card) .v258-owned-meta b{color:#f0c96c}

@media(max-width:1100px){.card-shop-toolbar{grid-template-columns:100px 90px 74px 78px 58px 78px minmax(130px,1fr) 74px!important}.v258-owned-grid{grid-template-columns:repeat(4,minmax(120px,1fr))}}
@media(max-width:760px){.card-shop-toolbar{grid-template-columns:repeat(3,minmax(0,1fr))!important}.card-shop-toolbar .card-shop-point-filter,.card-shop-toolbar .card-shop-ownership-filter{width:auto!important;min-width:0!important}.card-shop-toolbar .card-shop-point-filter select{width:100%!important;min-width:0!important}.v258-owned-toolbar{grid-template-columns:1fr 1fr}.v258-owned-count{grid-column:1/-1}.v258-owned-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.v258-enhancement-bookmark{left:5px;min-width:45px;font-size:8px}}
@media(max-width:430px){.card-shop-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))!important}.v258-owned-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.v258-owned-card{min-height:235px;grid-template-rows:42px 118px auto minmax(38px,auto)}.v258-owned-card>.collection-card-art{height:118px!important;min-height:118px!important}}


/* ---- assets/css/v259_economy_collection_admin.css ---- */
/* v259 — 강화 차수 탭 / 계정 보유카드 / GP·BP / 관리자 도구 */
.v258-enhancement-bookmark{
  left:auto!important;right:4px!important;top:44px!important;bottom:auto!important;
  min-width:28px!important;width:auto!important;height:14px!important;padding:0 4px!important;
  border-radius:4px!important;font-size:7px!important;line-height:14px!important;letter-spacing:-.2px!important;
  background:linear-gradient(180deg,#f7d77a,#9f6d18)!important;color:#201300!important;
  box-shadow:0 1px 4px rgba(0,0,0,.55),0 0 0 1px rgba(255,230,140,.32) inset!important;
}
.v258-enhancement-bookmark:after{display:none!important}
.v258-enhancement-bookmark.is-test{background:linear-gradient(180deg,#b9d6ff,#48658d)!important;color:#081321!important}
@media(max-width:850px){.v258-enhancement-bookmark{right:3px!important;top:37px!important;min-width:24px!important;height:12px!important;padding:0 3px!important;font-size:6px!important;line-height:12px!important}}

.v259-wallet{display:inline-flex;align-items:center;gap:5px;margin-left:auto;margin-right:5px;padding:4px 6px;border:1px solid rgba(221,183,91,.35);border-radius:7px;background:rgba(0,0,0,.22);font-size:9px;white-space:nowrap}
.v259-wallet span{display:inline-flex;gap:2px}.v259-wallet b{color:#f1cc71;font-size:10px}.v259-wallet.compact{margin:0 6px}
.left-auth-logged-in{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.left-auth-logged-in[hidden]{display:none!important}

.v259-deck-ownership-filter{min-width:88px}
.deck-builder-toolbar{grid-template-columns:repeat(6,minmax(98px,1fr))!important}

.card-shop-head{display:flex;align-items:center}.v259-my-cards-btn{margin-left:auto}.v259-my-cards-btn+#closeCardShopBtn{margin-left:6px}
.v259-my-cards-box{width:min(1320px,96vw)!important;max-height:90vh!important}
.v259-my-cards-toolbar{display:grid;grid-template-columns:120px minmax(180px,1fr) 120px;gap:8px;align-items:end;padding:10px 12px}
.v259-my-cards-toolbar label{display:grid;gap:4px;font-size:11px}.v259-my-cards-toolbar input,.v259-my-cards-toolbar select{width:100%;box-sizing:border-box;padding:7px 8px;border-radius:7px;border:1px solid rgba(255,255,255,.16);background:rgba(0,0,0,.25);color:inherit}
.v259-my-cards-toolbar>div{height:34px;display:flex;align-items:center;justify-content:center;gap:5px;border:1px solid rgba(255,255,255,.13);border-radius:7px}.v259-my-cards-toolbar b{color:#f0c96c}
.v259-my-cards-grid{display:grid;grid-template-columns:repeat(6,minmax(125px,1fr));gap:9px;max-height:68vh;overflow:auto;padding:8px 12px 16px}
.v259-my-card-entry{display:grid;gap:5px;min-width:0}.v259-my-card{position:relative;display:grid;grid-template-rows:46px 145px auto minmax(42px,auto);overflow:hidden;min-height:270px;border:1px solid rgba(255,255,255,.16);border-radius:10px;background:rgba(12,12,14,.92)}
.v259-my-card>.collection-card-title{grid-row:1}.v259-my-card>.collection-card-art{grid-row:2;height:145px!important;min-height:145px!important}.v259-my-card>.collection-five-stats{grid-row:3}.v259-my-card>.collection-extra{grid-row:4;min-height:42px!important}
.v259-my-card-count{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:5px 6px;border-radius:7px;background:rgba(0,0,0,.3);font-size:10px}.v259-my-card-count b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v259-my-card-count span{white-space:nowrap;color:#e8cf94}

.v259-booster-costs{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:9px 0 6px}.v259-booster-card small{display:block;line-height:1.45;opacity:.78;font-size:9px}

.v259-admin-box{width:min(940px,95vw)!important;max-height:90vh!important}.v259-admin-grid{display:grid;grid-template-columns:minmax(230px,1fr) auto;gap:10px;padding:12px}.v259-admin-grid>label{display:grid;gap:4px}.v259-admin-grid select,.v259-admin-grid input{width:100%;box-sizing:border-box;padding:8px;border-radius:7px;border:1px solid rgba(255,255,255,.16);background:rgba(0,0,0,.25);color:inherit}.v259-admin-target-info{grid-column:1/-1;padding:8px 10px;border-radius:7px;background:rgba(198,162,90,.08);border:1px solid rgba(198,162,90,.22)}.v259-admin-grid fieldset{min-width:0;border:1px solid rgba(255,255,255,.15);border-radius:9px;padding:10px;display:grid;grid-template-columns:1fr 120px;gap:8px}.v259-admin-grid fieldset legend{padding:0 6px;color:#f0c96c;font-weight:900}.v259-admin-grid fieldset label{display:grid;gap:4px}.v259-admin-actions{grid-column:1/-1;display:flex;gap:7px}.v259-admin-actions .btn{flex:1}

@media(max-width:1100px){.deck-builder-toolbar{grid-template-columns:repeat(4,minmax(95px,1fr))!important}.v259-my-cards-grid{grid-template-columns:repeat(4,minmax(120px,1fr))}}
@media(max-width:760px){.v259-wallet{margin-left:0}.deck-builder-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))!important}.v259-my-cards-toolbar{grid-template-columns:1fr 1fr}.v259-my-cards-toolbar>div{grid-column:1/-1}.v259-my-cards-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.v259-admin-grid{grid-template-columns:1fr}.v259-admin-target-info,.v259-admin-grid fieldset{grid-column:1}.v259-admin-grid fieldset{grid-template-columns:1fr}.v259-admin-actions{grid-column:1}.v259-booster-costs{grid-template-columns:1fr}}


/* ---- assets/css/v260_ui_refine.css ---- */
/* v260 — 계정바/강화탭/덱편집 UI 정리 */

/* 1) 로그아웃 + GP/BP를 한 줄에 유지 */
.online-account-bar,
.left-auth-logged-in{
  flex-wrap:nowrap!important;
  gap:4px!important;
  align-items:center!important;
}
#logoutBtn,#leftLogoutBtn{
  width:auto!important;
  min-width:50px!important;
  max-width:none!important;
  flex:0 0 auto!important;
  padding:4px 7px!important;
  font-size:10px!important;
  line-height:1.15!important;
  white-space:nowrap!important;
}
.left-auth-logged-in #leftAuthStateText{flex:1 1 auto!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.v259-wallet,.v259-wallet.compact{flex:0 0 auto!important;margin:0 2px 0 0!important;padding:3px 5px!important;gap:4px!important;font-size:9px!important;white-space:nowrap!important}

/* 2) 강화 탭: 카드 이미지 우측 점수 원 바로 아래 */
.collection-card-art>.v258-enhancement-bookmark{
  left:auto!important;
  right:0!important;
  top:44px!important;
  bottom:auto!important;
  min-width:28px!important;
  height:15px!important;
  padding:0 5px!important;
  border-radius:5px 0 0 5px!important;
  font-size:8px!important;
  line-height:15px!important;
  font-weight:950!important;
  letter-spacing:-.35px!important;
  color:#fff!important;
  text-shadow:0 1px 2px rgba(0,0,0,.75)!important;
  box-shadow:0 2px 5px rgba(0,0,0,.52),inset 0 0 0 1px rgba(255,255,255,.18)!important;
  pointer-events:none!important;
}
.collection-card-art>.v258-enhancement-bookmark:after{display:none!important}
/* 1차 = 청동, 2차 = 백은, 3차 = 황금, 4차 이상 = 자수정/백금 */
.collection-card-art>.v258-enhancement-bookmark[data-enhance-count="1"]{
  background:linear-gradient(135deg,#a76532,#6f391c)!important;
  border:1px solid #d89a66!important;
}
.collection-card-art>.v258-enhancement-bookmark[data-enhance-count="2"]{
  background:linear-gradient(135deg,#dce5ed,#7f94a5 68%,#536675)!important;
  border:1px solid #eef6ff!important;
  color:#10202c!important;
  text-shadow:0 1px 0 rgba(255,255,255,.4)!important;
}
.collection-card-art>.v258-enhancement-bookmark[data-enhance-count="3"]{
  background:linear-gradient(135deg,#fff1a5,#d5a426 58%,#89610f)!important;
  border:1px solid #ffe88a!important;
  color:#291b00!important;
  text-shadow:0 1px 0 rgba(255,255,255,.35)!important;
  box-shadow:0 2px 6px rgba(0,0,0,.5),0 0 7px rgba(255,205,73,.35)!important;
}
.collection-card-art>.v258-enhancement-bookmark.v260-enhance-tier-high{
  background:linear-gradient(135deg,#f0eaff,#a987d8 45%,#5b3a87 78%,#d7c5ff)!important;
  border:1px solid #e6d7ff!important;
  box-shadow:0 2px 7px rgba(0,0,0,.5),0 0 8px rgba(185,145,255,.42)!important;
}

/* 카드상점에서는 강화 카드 외형/탭을 절대 표시하지 않는다. */
#cardShopGrid .v258-enhancement-bookmark{display:none!important}
#cardShopGrid .v258-enhanced-card,
#cardShopGrid .shop-card{
  box-shadow:none!important;
}

/* 3) 덱 편집: 필터/입력 폭 컴팩트화 */
#deckBuilderModal .v246-buff-filter-label{width:62px!important;min-width:62px!important;max-width:62px!important}
#deckBuilderModal #deckBuilderBuffFilter{width:62px!important;min-width:62px!important;max-width:62px!important;padding-left:5px!important;padding-right:16px!important}
#deckBuilderModal #deckRatioGeneral,
#deckBuilderModal #deckRatioAdvisor,
#deckBuilderModal #deckRatioItem,
#deckBuilderModal #deckRatioTactic{
  width:44px!important;
  min-width:44px!important;
  max-width:44px!important;
  padding-left:3px!important;
  padding-right:3px!important;
  text-align:center!important;
  box-sizing:border-box!important;
}
#deckBuilderModal #deckBuilderSearch{
  width:92px!important;
  min-width:92px!important;
  max-width:92px!important;
  flex:0 0 92px!important;
  padding-left:6px!important;
  padding-right:6px!important;
}
#deckBuilderModal .deck-builder-search-cluster{flex:0 1 auto!important}
#deckBuilderModal .deck-auto-ratio-inline{gap:4px!important;padding:4px 6px!important}

@media(max-width:850px){
  .collection-card-art>.v258-enhancement-bookmark{right:-1px!important;top:37px!important;min-width:24px!important;height:13px!important;padding:0 4px!important;font-size:7px!important;line-height:13px!important}
  #deckBuilderModal .v246-buff-filter-label,#deckBuilderModal #deckBuilderBuffFilter{width:60px!important;min-width:60px!important;max-width:60px!important}
  #deckBuilderModal #deckRatioGeneral,#deckBuilderModal #deckRatioAdvisor,#deckBuilderModal #deckRatioItem,#deckBuilderModal #deckRatioTactic{width:43px!important;min-width:43px!important;max-width:43px!important}
  #deckBuilderModal #deckBuilderSearch{width:88px!important;min-width:88px!important;max-width:88px!important;flex-basis:88px!important}
}


/* ---- assets/css/v261_enhanced_variants_images.css ---- */
/* v261 — 강화 변형 카드/강화 이미지 관리자 */
.v261-variant-chip{position:absolute;left:7px;bottom:7px;z-index:8;display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:20px;padding:0 7px;border-radius:999px;background:rgba(17,24,39,.86);border:1px solid rgba(255,255,255,.32);color:#fff;font-size:10px;font-weight:900;letter-spacing:-.02em;box-shadow:0 2px 7px rgba(0,0,0,.3);pointer-events:none}
.v261-deck-enhanced .v261-variant-chip,.deck-builder-visual-card.v258-enhanced-card .v261-variant-chip{background:linear-gradient(135deg,#6f4b11,#d4af37 55%,#fff1a8);color:#211704;border-color:#ffe69a}
.v261-deck-base .deck-owned-outside small:first-child{color:#cbd5e1}.v261-deck-enhanced .deck-owned-outside small:first-child{color:#f7d774}

.v261-enhancement-image-manager{margin:10px 0 12px;padding:10px;border:1px solid rgba(212,175,55,.42);border-radius:12px;background:rgba(15,23,42,.58)}
.v261-enh-image-title{display:flex;flex-direction:column;gap:2px;margin-bottom:8px}.v261-enh-image-title b{font-size:13px;color:#f6d783}.v261-enh-image-title small{font-size:10px;color:#aeb8ca;line-height:1.45}
.v261-enh-image-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.v261-enh-image-slot{min-width:0;padding:7px;border:1px solid rgba(148,163,184,.25);border-radius:10px;background:rgba(2,6,23,.52)}
.v261-enh-image-preview{position:relative;aspect-ratio:3/4;border-radius:8px;overflow:hidden;background:#111827;border:1px solid rgba(255,255,255,.12);display:flex;align-items:center;justify-content:center}.v261-enh-image-preview img{width:100%;height:100%;object-fit:cover;display:block}.v261-enh-image-preview>span{position:absolute;right:5px;bottom:5px;padding:2px 5px;border-radius:5px;background:rgba(0,0,0,.72);color:#fff;font-size:10px;font-weight:900}.v261-no-image{font-size:10px;color:#64748b}
.v261-enh-image-actions{display:flex;gap:4px;align-items:center;margin-top:6px}.v261-enh-image-actions .manager-upload-label{flex:1;margin:0;padding:5px 6px;font-size:10px;text-align:center}.v261-enh-image-actions .btn{padding:5px 7px;font-size:10px}.v261-enh-image-slot>small{display:block;margin-top:5px;min-height:24px;font-size:9px;line-height:1.3;color:#94a3b8}
@media(max-width:760px){.v261-enh-image-grid{grid-template-columns:1fr}.v261-enh-image-preview{aspect-ratio:16/8}.v261-enh-image-preview img{object-position:center 28%}}


/* ---- assets/css/v262_starter_decks_episode.css ---- */
/* v262 — 기본덱 설정 / 가입 스타터덱 / 빠른편집 숫자폭·에피소드 */
.v262-starter-signup-label{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted,#b9b3a6)}
.v262-starter-signup-label select{flex:1;min-width:0}
.v262-starter-signup-note{font-size:11px;line-height:1.35;opacity:.82}
.v262-base-deck-box{width:min(1120px,94vw);max-width:1120px}
.v262-base-toolbar{display:flex;align-items:end;gap:8px;flex-wrap:wrap;margin:10px 0 12px}
.v262-base-toolbar label{display:grid;gap:4px;font-size:12px}
.v262-base-toolbar input{width:130px}
.v262-base-summary{margin-left:auto;padding:7px 10px;border:1px solid rgba(166,215,164,.38);border-radius:8px;background:rgba(30,80,38,.22);font-size:12px;white-space:nowrap}
.v262-base-summary.invalid{border-color:rgba(239,116,116,.55);background:rgba(95,26,26,.24)}
.v262-base-main{display:grid;grid-template-columns:1fr 1fr;gap:12px;min-height:460px}
.v262-base-main>section{min-width:0;border:1px solid rgba(255,255,255,.12);border-radius:10px;padding:10px;background:rgba(0,0,0,.16)}
.v262-base-main h3{margin:0 0 8px;font-size:14px}
.v262-base-list{height:430px;overflow:auto;display:flex;flex-direction:column;gap:5px;padding-right:3px}
.v262-base-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 8px;border:1px solid rgba(255,255,255,.1);border-radius:7px;background:rgba(255,255,255,.035)}
.v262-base-row>div:first-child{min-width:0;display:grid;gap:2px}.v262-base-row b{font-size:12px}.v262-base-row small{font-size:10px;opacity:.75}
.v262-base-step{display:flex;align-items:center;gap:5px;flex:0 0 auto}.v262-base-step b{min-width:20px;text-align:center}
.quick-stats-table .qs-stat-number{width:5.2ch!important;min-width:5.2ch!important;max-width:5.2ch!important;padding-left:4px!important;padding-right:2px!important}
.quick-stats-table .qs-episode{width:8.5ch!important;min-width:8.5ch!important;padding-left:4px!important;padding-right:3px!important}
.quick-stats-toolbar #quickStatsEpisode{min-width:74px}
@media(max-width:800px){.v262-base-main{grid-template-columns:1fr}.v262-base-list{height:300px}.v262-base-summary{margin-left:0}.v262-base-deck-box{width:96vw}}


/* ---- assets/css/v263_starter_inventory_deck_return.css ---- */
/* v263 — 미강화 라벨 제거 / 기본덱 선택 표시 정리 */
.v263-base-owned-meta{justify-content:flex-end!important}
.v261-deck-base .v261-variant-chip{display:none!important}
.v261-deck-base .deck-owned-outside small:first-child:empty{display:none!important}
#battleDeckSelect option[value^="default:"]{font-weight:700}


/* ---- assets/css/v264_policy_decks_results.css ---- */
/* v264 — GP/BP + 로그아웃 컴팩트 / 저장덱 명시 조작 */
#leftLogoutBtn,#logoutBtn{
  flex:0 0 4.8em!important;
  width:4.8em!important;
  min-width:4.8em!important;
  max-width:4.8em!important;
  padding-left:.3em!important;
  padding-right:.3em!important;
  white-space:nowrap!important;
}
.left-auth-logged-in .v259-wallet{margin-left:auto!important;margin-right:4px!important}
.v259-wallet[hidden]{display:none!important}
#v264DeckLoadBtn{white-space:nowrap}
#deckBuilderClearSavedBtn:disabled,#v264DeckLoadBtn:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:760px){
  #leftLogoutBtn,#logoutBtn{flex-basis:4.8em!important;width:4.8em!important;min-width:4.8em!important;max-width:4.8em!important}
}


/* ---- assets/css/v265_episode_boosters_nickname.css ---- */
/* v265 — 로그인 ID/닉네임 + 에피소드 부스터팩 */
.left-auth-logged-in #leftAuthStateText{flex:0 0 auto!important}
.v265-login-id{border:0;background:transparent;color:#f0cf7b;padding:2px 3px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:underline;text-underline-offset:2px;cursor:pointer;font:inherit}
.v265-login-id:hover{color:#ffe5a2}.online-user-chip.v265-clickable-user{cursor:pointer;text-decoration:underline;text-underline-offset:2px}
.v265-booster-card{overflow:hidden}.v265-pack-cover{width:100%;aspect-ratio:16/9;border-radius:9px;overflow:hidden;background:rgba(0,0,0,.35);border:1px solid rgba(232,196,108,.24);display:flex;align-items:center;justify-content:center;margin-bottom:9px}
.v265-pack-cover img{width:100%;height:100%;object-fit:cover;display:block}.v265-pack-cover-empty{display:grid;place-content:center;text-align:center;background:radial-gradient(circle at 50% 35%,rgba(182,132,43,.35),rgba(14,10,8,.92))}.v265-pack-cover-empty b{font-size:26px;color:#f0cf7b}.v265-pack-cover-empty span{font-size:10px;opacity:.76;letter-spacing:.12em}
.v265-pack-head{display:flex;gap:7px;align-items:flex-start;justify-content:space-between}.v265-pack-head h3{min-width:0}.v265-visibility{flex:0 0 auto;padding:3px 7px;border-radius:999px;font-size:9px;font-weight:900}.v265-visibility.public{background:#285d3b;color:#d7ffe2}.v265-visibility.private{background:#5e3030;color:#ffd7d7}.v265-pack-factions{font-size:10px;opacity:.82;line-height:1.5}.v265-booster-card.is-private{outline:1px dashed rgba(255,130,130,.32)}
.v265-pack-admin-box{width:min(1180px,96vw)!important;max-height:92vh!important;overflow:auto}.v265-pack-admin-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 12px;border-bottom:1px solid rgba(255,255,255,.1)}.v265-pack-admin-toolbar span{font-size:10px;opacity:.8}.v265-overflow-note{margin:10px 12px 0;padding:8px 10px;border:1px solid rgba(232,196,108,.24);border-radius:8px;background:rgba(232,196,108,.07);font-size:10px;line-height:1.5}.v265-overflow-note b{color:#f1cc71}
.v265-pack-admin-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:12px}.v265-pack-admin-card{min-width:0;border:1px solid rgba(232,196,108,.28);border-radius:11px;background:rgba(18,14,11,.9);padding:10px;display:grid;gap:8px}.v265-cover-editor{display:grid;gap:5px;cursor:pointer;font-size:10px;text-align:center;color:#f0cf7b}.v265-cover-editor .v265-pack-cover{margin:0}.v265-pack-admin-fields{display:grid;grid-template-columns:1fr 95px;gap:7px}.v265-pack-admin-fields label{display:grid;gap:4px;font-size:10px}.v265-pack-admin-fields input,.v265-pack-admin-fields select{width:100%;box-sizing:border-box;padding:7px;border-radius:7px;border:1px solid rgba(255,255,255,.16);background:rgba(0,0,0,.25);color:inherit}.v265-pack-admin-meta{display:flex;gap:7px;align-items:center;flex-wrap:wrap;font-size:10px}.v265-pack-admin-meta b{color:#f0cf7b}.v265-pack-admin-card details{font-size:10px}.v265-pack-admin-card summary{cursor:pointer;color:#dfc78c}.v265-pack-card-list{display:grid;grid-template-columns:1fr 1fr;gap:3px 8px;max-height:170px;overflow:auto;padding:7px 2px}.v265-pack-card-list span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v265-pack-admin-actions{display:flex;justify-content:flex-end}.v265-pack-admin-actions .btn{min-width:88px}
@media(max-width:980px){.v265-pack-admin-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:680px){.v265-login-id{max-width:120px}.v265-pack-admin-grid{grid-template-columns:1fr}.v265-pack-admin-fields{grid-template-columns:1fr}.v265-pack-card-list{grid-template-columns:1fr}}

/* v270 — 공개 부스터 다중 개봉 + 순차 카드 공개 */
.v270-booster-purchase{display:grid;gap:8px;margin:10px 0 7px}
.v270-booster-currency{display:grid;gap:5px;padding:7px;border:1px solid rgba(232,196,108,.16);border-radius:8px;background:rgba(255,255,255,.025)}
.v270-booster-currency>b{font-size:10px;color:#ead7a5}
.v270-booster-counts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
.v270-booster-counts .btn{min-width:0;padding:7px 5px;font-size:9px;white-space:nowrap}
.v270-booster-result-box{width:min(780px,94vw);max-width:780px}
.v270-booster-reveal-stage{min-height:460px;display:flex;align-items:center;justify-content:center;padding:16px 4px}
.v270-booster-reveal-card{width:min(310px,76vw);aspect-ratio:5/7;border:1px solid rgba(232,196,108,.42);border-radius:14px;overflow:hidden;background:linear-gradient(180deg,#211b12,#0c0b0a);box-shadow:0 18px 50px rgba(0,0,0,.48);display:flex;flex-direction:column;animation:v270CardReveal .28s ease-out}
@keyframes v270CardReveal{from{opacity:0;transform:translateY(12px) scale(.96)}to{opacity:1;transform:none}}
.v270-booster-reveal-image{flex:1;min-height:0;background:#090909;overflow:hidden}
.v270-booster-reveal-image img{display:block;width:100%;height:100%;object-fit:cover}
.v270-booster-reveal-image.is-empty{background:transparent}
.v270-booster-reveal-info{padding:12px 14px 14px;text-align:center;border-top:1px solid rgba(255,255,255,.08)}
.v270-booster-reveal-info h3{margin:4px 0 3px;font-size:22px}
.v270-booster-reveal-info p{margin:0;font-size:11px;opacity:.72}
.v270-booster-grade{display:inline-flex;padding:3px 8px;border-radius:999px;background:rgba(255,255,255,.08);font-size:11px;font-weight:900}
.v270-booster-result-actions{display:flex;justify-content:center;margin:0 0 10px}
.v270-booster-result-actions .btn{min-width:150px}
.v270-booster-result-strip{display:flex;gap:5px;overflow:auto;padding:7px 2px 2px}
.v270-booster-mini{flex:0 0 auto;min-width:86px;max-width:120px;padding:6px 7px;border:1px solid rgba(255,255,255,.08);border-radius:7px;opacity:.32;display:grid;gap:2px}
.v270-booster-mini.revealed{opacity:1;border-color:rgba(232,196,108,.35)}
.v270-booster-mini span,.v270-booster-mini em{font-size:8px;opacity:.7;font-style:normal}.v270-booster-mini b{font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.v270-card-art-empty{background:none!important;background-image:none!important;box-shadow:none!important;visibility:hidden!important}
@media(max-width:760px){.v270-booster-counts{grid-template-columns:repeat(2,minmax(0,1fr))}.v270-booster-reveal-stage{min-height:390px}.v270-booster-reveal-card{width:min(280px,80vw)}}
.v270-booster-mini:not(.revealed) b,.v270-booster-mini:not(.revealed) em{visibility:hidden}
.v270-booster-mini:not(.revealed)::after{content:'미공개';font-size:8px;opacity:.55}


/* v271 — 부스터 개봉 버튼 가시성 강화 */
.v271-booster-purchase{display:grid!important;visibility:visible!important;opacity:1!important;overflow:visible!important;margin-top:12px!important;padding-top:10px;border-top:1px solid rgba(240,207,123,.22)}
.v271-booster-action-title{display:block;font-size:12px;font-weight:900;color:#f5d77f;letter-spacing:.02em;margin-bottom:1px}
.v271-booster-purchase .v270-booster-currency{display:grid!important;visibility:visible!important;opacity:1!important}
.v271-booster-purchase .v270-booster-counts{display:grid!important;visibility:visible!important;opacity:1!important}
.v271-booster-purchase .v270-booster-counts .btn{display:inline-flex!important;align-items:center;justify-content:center!important;min-height:34px!important;font-size:10px!important;font-weight:800!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important}
@media(max-width:760px){.v271-booster-purchase .v270-booster-counts .btn{min-height:38px!important;font-size:11px!important}}


/* ---- assets/css/v272_booster_controls_hardfix.css ---- */
/* v272 — booster controls hard fix. Loaded with a new filename to bypass stale caches. */
#boosterPackGrid .v270-booster-purchase,
#boosterPackGrid .v271-booster-purchase{display:none!important}
#boosterPackGrid .v272-booster-controls{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  box-sizing:border-box;
  width:100%;
  margin:10px 0 14px;
  padding:12px;
  border:2px solid rgba(224,177,70,.88);
  border-radius:10px;
  background:linear-gradient(180deg,rgba(38,28,13,.98),rgba(19,15,11,.98));
  box-shadow:0 0 0 1px rgba(255,222,137,.10) inset,0 6px 18px rgba(0,0,0,.24);
}
#boosterPackGrid .v272-booster-title{
  display:flex!important;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin:0 0 10px;
  color:#ffe29a;
  font-size:14px;
  font-weight:900;
  letter-spacing:.02em;
}
#boosterPackGrid .v272-booster-admin-badge{
  padding:3px 7px;
  border:1px solid rgba(255,217,109,.58);
  border-radius:999px;
  color:#fff0bc;
  font-size:10px;
  white-space:nowrap;
}
#boosterPackGrid .v272-booster-row{
  display:grid!important;
  grid-template-columns:72px minmax(0,1fr);
  align-items:center;
  gap:8px;
  margin-top:7px;
}
#boosterPackGrid .v272-booster-row-label{
  color:#f6ddb0;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}
#boosterPackGrid .v272-booster-buttons{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
}
#boosterPackGrid .v272-booster-btn{
  display:inline-flex!important;
  visibility:visible!important;
  opacity:1!important;
  min-width:0!important;
  min-height:36px!important;
  align-items:center!important;
  justify-content:center!important;
  padding:7px 6px!important;
  border:1px solid rgba(224,177,70,.72)!important;
  background:rgba(44,34,19,.96)!important;
  color:#ffe7a7!important;
  font-size:11px!important;
  font-weight:900!important;
  line-height:1.15!important;
  white-space:normal!important;
  cursor:pointer!important;
  pointer-events:auto!important;
}
#boosterPackGrid .v272-booster-btn:hover{filter:brightness(1.18)}
#boosterPackGrid .v272-booster-btn.is-gp{background:rgba(58,43,15,.98)!important}
#boosterPackGrid .v272-booster-btn.is-bp{background:rgba(20,39,59,.98)!important;border-color:rgba(114,174,230,.70)!important;color:#d9efff!important}
@media(max-width:760px){
  #boosterPackGrid .v272-booster-controls{padding:10px}
  #boosterPackGrid .v272-booster-row{grid-template-columns:1fr;gap:5px}
  #boosterPackGrid .v272-booster-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}
  #boosterPackGrid .v272-booster-btn{min-height:40px!important;font-size:12px!important}
}


/* ---- assets/css/v274_booster_shop_patch.css ---- */
/* v273 — compact booster layout / pack detail / public-shop indicator */
#boosterPackGrid .booster-card.v273-compact-pack{
  display:grid!important;
  grid-template-columns:minmax(120px,30%) minmax(0,1fr)!important;
  column-gap:16px!important;
  row-gap:8px!important;
  align-items:start!important;
  overflow:visible!important;
}
#boosterPackGrid .booster-card.v273-compact-pack > .v265-pack-cover,
#boosterPackGrid .booster-card.v273-compact-pack > .pack-art{
  grid-column:1!important;
  grid-row:1 / span 30!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  align-self:start!important;
  position:relative!important;
}
#boosterPackGrid .booster-card.v273-compact-pack > :not(.v265-pack-cover):not(.pack-art){grid-column:2!important;min-width:0}
#boosterPackGrid .v273-pack-cover{cursor:pointer!important;position:relative!important;outline:none}
#boosterPackGrid .v273-pack-cover:hover{border-color:rgba(245,211,124,.82)!important;filter:brightness(1.05)}
.v273-cover-hint{position:absolute;left:6px;right:6px;bottom:6px;z-index:2;display:block;padding:5px 7px;border-radius:6px;background:rgba(4,4,4,.78);color:#f8e6b5;font-size:9px;font-style:normal;text-align:center;line-height:1.2;pointer-events:none}
.v273-pack-composition{display:grid;gap:7px;padding:10px;border:1px solid rgba(232,196,108,.20);border-radius:9px;background:rgba(255,255,255,.025)}
.v273-composition-title{display:flex;align-items:center;justify-content:space-between;gap:8px}.v273-composition-title b{font-size:12px;color:#f2d27f}.v273-composition-title span{font-size:9px;opacity:.7}
.v273-grade-summary,.v273-detail-grade-summary{display:flex;gap:5px;flex-wrap:wrap}.v273-grade-chip{display:inline-flex;gap:4px;align-items:center;padding:3px 7px;border:1px solid rgba(255,255,255,.12);border-radius:999px;background:rgba(0,0,0,.18);font-size:9px}.v273-grade-chip b{color:#f3d27e}
.v273-composition-list,.v273-detail-composition{display:grid;gap:4px}.v273-composition-row{display:grid;grid-template-columns:34px minmax(0,1fr);gap:7px;align-items:start;font-size:9px;line-height:1.45}.v273-composition-row>b{color:#f0cf7b}.v273-composition-row>span{opacity:.86;overflow-wrap:anywhere}.v273-composition-empty{font-size:10px;opacity:.65}
.v273-view-pack-btn{justify-self:start!important;min-height:30px!important;padding:5px 10px!important;font-size:10px!important}
#boosterPackGrid .v272-booster-controls{margin:0!important}

.v273-pack-detail-box{width:min(1180px,96vw)!important;max-width:1180px!important;max-height:92vh!important;overflow:auto!important}
.v273-pack-detail-hero{display:grid;grid-template-columns:minmax(150px,30%) minmax(0,1fr);gap:16px;align-items:start;padding:12px 0 16px;border-bottom:1px solid rgba(232,196,108,.18)}
.v273-detail-cover-wrap .v265-pack-cover{width:100%;margin:0;position:relative;cursor:default}.v273-detail-cover-wrap .v273-cover-hint{display:none}
.v273-detail-summary{display:grid;gap:10px;min-width:0}.v273-detail-composition{padding:9px;border:1px solid rgba(255,255,255,.09);border-radius:8px;background:rgba(255,255,255,.02)}
.v273-detail-booster-controls{display:grid;gap:8px;padding:10px;border:1px solid rgba(224,177,70,.48);border-radius:9px;background:rgba(37,28,14,.72)}
.v273-detail-booster-title{font-size:12px;font-weight:900;color:#f4d47f}.v273-detail-booster-row{display:grid;grid-template-columns:72px minmax(0,1fr);gap:8px;align-items:center}.v273-detail-booster-row>b{font-size:10px;color:#ead7a5}.v273-detail-booster-row>div{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.v273-detail-booster-row .btn{min-width:0!important;padding:7px 5px!important;font-size:9px!important;white-space:normal!important}
.v273-pack-detail-section{padding-top:14px}.v273-pack-detail-section>h3{margin:0 0 10px;color:#f1d17b;font-size:14px}
.v273-pack-detail-cards{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.v273-pack-card-tile{position:relative;min-width:0}.v273-pack-card-tile .shop-card{width:100%;box-sizing:border-box}.v273-pack-card-rank{position:absolute;left:5px;top:5px;z-index:7;min-width:22px;padding:3px 5px;border-radius:999px;background:rgba(0,0,0,.76);border:1px solid rgba(239,204,111,.42);font-size:9px;text-align:center;color:#f5dc9a}.v273-pack-card-caption{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:4px;align-items:center;margin-top:4px;font-size:9px}.v273-pack-card-caption>b{color:#f2d17b}.v273-pack-card-caption>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v273-pack-card-caption>em{font-style:normal;opacity:.65}

/* 관리자 에피소드 부스터 편집: 표지 자체 클릭은 사용자용 상세 화면. 업로드는 문구 클릭. */
#v265PackAdminGrid .v273-admin-cover-preview{cursor:pointer!important;position:relative!important}
#v265PackAdminGrid .v265-cover-editor>span{position:relative;z-index:3;display:inline-block;padding:4px 7px;border:1px solid rgba(232,196,108,.25);border-radius:6px;cursor:pointer}

/* 일반 사용자는 실제 공개+발매 완료 카드만 표시한다는 안내를 상점 헤더에 추가할 수 있도록 여백 확보 */
html:not(.is-card-admin) #cardShopModal .card-shop-head::after{content:'일반 유저: 공개 카드만 표시';display:inline-flex;align-items:center;margin-left:8px;padding:3px 7px;border:1px solid rgba(232,196,108,.24);border-radius:999px;color:#d9c58f;font-size:9px;white-space:nowrap}
html.is-card-admin #cardShopModal .card-shop-head::after{content:'관리자: 전체 카드 표시';display:inline-flex;align-items:center;margin-left:8px;padding:3px 7px;border:1px solid rgba(232,196,108,.24);border-radius:999px;color:#f0d47d;font-size:9px;white-space:nowrap}

@media(max-width:900px){
  .v273-pack-detail-cards{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(max-width:760px){
  #boosterPackGrid .booster-card.v273-compact-pack{grid-template-columns:minmax(92px,30%) minmax(0,1fr)!important;column-gap:10px!important}
  .v273-composition-row{grid-template-columns:28px minmax(0,1fr);font-size:8px}.v273-cover-hint{font-size:8px;padding:4px}
  .v273-pack-detail-hero{grid-template-columns:minmax(100px,30%) minmax(0,1fr);gap:10px}.v273-detail-booster-row{grid-template-columns:1fr}.v273-detail-booster-row>div{grid-template-columns:repeat(2,minmax(0,1fr))}.v273-pack-detail-cards{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:520px){
  #boosterPackGrid .booster-card.v273-compact-pack{grid-template-columns:minmax(82px,30%) minmax(0,1fr)!important;column-gap:8px!important;padding:10px!important}
  .v273-pack-composition{padding:7px}.v273-composition-list{max-height:110px;overflow:auto}.v273-pack-detail-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  html:not(.is-card-admin) #cardShopModal .card-shop-head::after,html.is-card-admin #cardShopModal .card-shop-head::after{display:none}
}
/* 오른쪽 정보 흐름: 팩 제목 → 기본 정보 → 구성 → 개봉 버튼 → 확률 */
#boosterPackGrid .booster-card.v273-compact-pack > .v265-pack-head{order:1}
#boosterPackGrid .booster-card.v273-compact-pack > p{order:2}
#boosterPackGrid .booster-card.v273-compact-pack > .v265-pack-factions{order:3}
#boosterPackGrid .booster-card.v273-compact-pack > .v273-pack-composition{order:4}
#boosterPackGrid .booster-card.v273-compact-pack > .v272-booster-controls{order:5}
#boosterPackGrid .booster-card.v273-compact-pack > small{order:6}

/* ================================================================
   v274 — 부스터 구성/결과 카드는 카드 상점과 동일한 DOM·크기·내용 사용
   .card-shop-grid + .shop-card-entry + .shop-card 규칙을 그대로 상속한다.
   ================================================================ */
#v273PackDetailCards.v274-booster-card-grid,
#v274BoosterResultGrid.v274-booster-results-grid{
  flex:none!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  box-sizing:border-box!important;
}
.v274-booster-result-box{
  width:min(1180px,96vw)!important;
  max-width:1180px!important;
  max-height:92vh!important;
  overflow:auto!important;
}
.v274-booster-result-box #v270BoosterResultProgress{
  color:#d9c58f!important;
}
/* 결과는 획득 배열 순서를 그대로 DOM 순서로 출력한다. 별도 다음/한장 공개 UI 없음. */
#v274BoosterResultGrid .shop-card-entry,
#v273PackDetailCards .shop-card-entry{
  order:initial!important;
}


/* ---- assets/css/v267_game_modes_scenario.css ---- */
/* v267 — 게임 모드 선택 / 시나리오 진행 */
.v267-mode-box{width:min(900px,94vw);max-width:900px}
.v267-mode-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:14px}
.v267-mode-card{display:flex;flex-direction:column;gap:12px;padding:18px;border:1px solid rgba(214,176,103,.38);border-radius:12px;background:rgba(17,20,27,.92);min-height:280px}
.v267-mode-card.scenario{background:linear-gradient(145deg,rgba(37,22,19,.96),rgba(17,20,27,.96))}
.v267-mode-card h3{margin:0;font-size:20px}.v267-mode-card p{margin:0;color:#c9c2b4;line-height:1.5}
.v267-mode-card label{display:grid;gap:6px;font-weight:800}.v267-mode-card select{width:100%}
.v267-mode-card .btn{margin-top:auto;width:100%}
.v267-mode-desc{padding:10px 12px;border-radius:8px;background:rgba(255,255,255,.055);color:#d8d2c6;font-size:13px;line-height:1.55}
.v267-scenario-progress{display:grid;gap:5px;padding:13px 14px;border:1px solid rgba(230,181,86,.42);border-radius:9px;background:rgba(126,72,24,.16)}
.v267-scenario-progress b{font-size:19px;color:#f0c66e}.v267-scenario-progress span{font-size:13px;color:#ddd2bd}
.v267-mode-note{margin-top:14px;padding:10px 12px;border-radius:8px;background:rgba(112,126,158,.12);font-size:12px;color:#bbbfc9}
@media(max-width:720px){.v267-mode-grid{grid-template-columns:1fr}.v267-mode-card{min-height:0;padding:14px}.v267-mode-box{max-height:90vh;overflow:auto}}


/* ---- assets/css/v269_conquest_campaign.css ---- */
/* v269 — 정복 지도 시각 강화 + 주요 거점 성채 + 스토리 이미지 */
#v267GameModeModal .v267-mode-grid{grid-template-columns:repeat(auto-fit,minmax(240px,1fr));}
#v267GameModeModal .v267-mode-box{width:min(1200px,96vw);max-width:1200px;}
.v267-mode-card.conquest{background:linear-gradient(145deg,rgba(19,28,22,.96),rgba(17,20,27,.96));}
.v268-locked-faction{padding:10px 12px;border:1px solid rgba(214,176,103,.38);border-radius:8px;background:rgba(255,255,255,.04);font-weight:800;}
.v268-gate-badge{color:#ffb347;}

.v268-path-box{width:min(1120px,97vw);max-width:1120px;}

/* 지도(SVG) — 밝은 고서 지도 스타일 */
.v268-map-wrap{margin-top:10px;border:1px solid rgba(230,181,86,.5);border-radius:12px;overflow:hidden;background:#2c2114;box-shadow:0 6px 22px rgba(0,0,0,.4),inset 0 0 40px rgba(0,0,0,.35);}
.v268-map-svg{display:block;width:100%;height:auto;max-height:66vh;}
.v268-map-frame-outer{fill:none;stroke:#e6b556;stroke-width:3;}
.v268-map-frame-inner{fill:none;stroke:rgba(230,181,86,.45);stroke-width:1;}
.v268-map-region-label{fill:#3a2c18;font-size:18px;font-weight:900;letter-spacing:3px;opacity:.52;text-anchor:middle;pointer-events:none;text-transform:uppercase;}
.v268-map-river{fill:none;stroke:#5fa0c9;stroke-width:4;opacity:.55;stroke-linecap:round;}
.v268-map-river2{opacity:.5;}
.v268-map-route-full{fill:none;stroke:#8a7a5c;stroke-width:2;stroke-dasharray:6 6;opacity:.6;}
.v268-map-route-done{fill:none;stroke:#e6b556;stroke-width:4;opacity:.95;filter:drop-shadow(0 0 4px rgba(230,181,86,.6));}
.v268-map-compass{pointer-events:none;}
.v268-map-compass circle{fill:rgba(255,255,255,.05);stroke:#e6b556;stroke-width:1.5;opacity:.7;}
.v268-map-compass-needle{fill:#e6b556;opacity:.85;}
.v268-map-compass-n{fill:#e6b556;font-size:13px;font-weight:900;text-anchor:middle;opacity:.85;}
.v268-map-node{cursor:pointer;}
.v268-map-node circle{stroke-width:3;transition:r .12s ease,filter .12s ease,stroke-width .12s ease;}
.v268-map-node:hover circle{filter:brightness(1.35);}
.v268-map-node:hover .v268-map-label{fill:#fff3d6;}
.v268-map-label-halo{font-size:15px;font-weight:900;stroke:#241a0e;stroke-width:4;paint-order:stroke;text-anchor:middle;pointer-events:none;}
.v268-map-label{font-size:15px;font-weight:900;fill:#f0e8d6;text-anchor:middle;pointer-events:none;}
.v268-map-order{font-size:11px;font-weight:900;fill:#241a0e;text-anchor:middle;pointer-events:none;}
.v268-map-check{font-size:15px;font-weight:900;fill:#0e2312;text-anchor:middle;pointer-events:none;}
.v268-map-gate-icon{font-size:17px;fill:#ffcf6e;text-anchor:middle;pointer-events:none;filter:drop-shadow(0 0 3px rgba(255,180,50,.7));}
/* 경로 미포함 성: 흐린 점 */
.v268-map-off .v268-map-node-circle{fill:url(#v268NodeDim);stroke:#4a3c26;}
.v268-map-off .v268-map-label,.v268-map-off .v268-map-label-halo{font-size:12px;opacity:.74;}
/* 아직 잠긴 목표: 회청색 */
.v268-map-locked .v268-map-node-circle{fill:url(#v268NodeGrey);stroke:#2c3742;}
/* 다음 목표: 금색 + 맥동 링 */
.v268-map-current .v268-map-node-circle{fill:url(#v268NodeGold);stroke:#fff3d6;}
.v268-map-ring{fill:none;stroke:#e6b556;stroke-width:2;opacity:.6;animation:v268PulseRing 1.6s ease-out infinite;}
@keyframes v268PulseRing{0%{opacity:.72;stroke-width:3;}100%{opacity:0;stroke-width:1;}}
.v268-map-current .v268-map-node-circle{animation:v268PulseGlow 1.6s ease-in-out infinite;}
@keyframes v268PulseGlow{0%,100%{filter:drop-shadow(0 0 2px rgba(230,181,86,.6));}50%{filter:drop-shadow(0 0 10px rgba(255,210,120,.95));}}
.v268-map-current .v268-map-label{fill:#ffe3a0;font-weight:900;}
/* 함락 완료: 초록 + 체크 */
.v268-map-done .v268-map-node-circle{fill:url(#v268NodeGreen);stroke:#c8f0cc;}
.v268-map-done .v268-map-label{fill:#c8f0cc;}
/* 최고 관문: 두꺼운 금테 */
.v268-map-gate .v268-map-node-circle{stroke-width:3.5;stroke:#ffcf6e;}
/* 선택된 노드 강조 */
.v268-map-selected .v268-map-node-circle{stroke:#fff;stroke-width:4;}
.v268-map-legend{display:flex;flex-wrap:wrap;gap:14px;margin-top:9px;padding:8px 12px;border-radius:8px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.07);font-size:11px;color:#c9c2b4;align-items:center;}
.v268-legend-dot{display:inline-block;width:11px;height:11px;border-radius:50%;margin-right:5px;vertical-align:-1px;}
.v268-legend-current{background:#e6b556;box-shadow:0 0 5px rgba(230,181,86,.7);}
.v268-legend-done{background:#4c8f5a;}
.v268-legend-locked{background:#4a5866;}
.v268-legend-off{background:#6b5c3e;}
.v268-legend-star{color:#ffcf6e;font-weight:900;}
.v268-map-info{margin-top:9px;padding:11px 13px;border-radius:8px;border:1px solid rgba(230,181,86,.28);background:rgba(255,255,255,.03);font-size:12px;line-height:1.65;color:#d8d2c6;min-height:20px;}
.v268-map-info b{color:#f0e8d6;}
.v268-map-action-btn{margin-top:9px;width:100%;font-weight:900;}

.v268-path-list{display:grid;gap:6px;max-height:22vh;overflow:auto;margin-top:10px;}
.v268-path-row{display:grid;grid-template-columns:32px 1.1fr 1fr 1.3fr auto auto;gap:10px;align-items:center;padding:9px 11px;border:1px solid rgba(255,255,255,.08);border-radius:8px;font-size:12px;background:rgba(255,255,255,.02);}
.v268-path-step{font-weight:900;color:#e6b556;text-align:center;}
.v268-path-name{font-weight:800;color:#f0e8d6;}
.v268-path-gen{color:#c9c2b4;}
.v268-path-tag{color:#9aa3b5;font-size:11px;}
.v268-path-reward{color:#f0c66e;white-space:nowrap;}
.v268-path-status{font-weight:800;text-align:right;white-space:nowrap;}
.v268-path-row.v268-done{opacity:.6;border-color:rgba(120,200,120,.4);}
.v268-path-row.v268-done .v268-path-status{color:#8fd18f;}
.v268-path-row.v268-current{border-color:#e6b556;background:rgba(230,181,86,.14);}
.v268-path-row.v268-current .v268-path-status{color:#f0c66e;}
.v268-path-row.v268-locked{opacity:.42;}
.v268-path-row.v268-locked .v268-path-status{color:#9aa3b5;}

@media(max-width:720px){
  .v268-path-row{grid-template-columns:1fr;gap:3px;}
  .v268-path-status{text-align:left;}
}


/* v269 — 주요 거점/스토리 이미지 시각 강화 */
.v269-map-major .v268-map-node-circle{stroke-width:4;filter:drop-shadow(0 2px 5px rgba(0,0,0,.55));}
.v269-map-castle{pointer-events:none;filter:drop-shadow(0 2px 2px rgba(0,0,0,.65));}
.v269-map-castle use{fill:#f1cf83;stroke:#2b1b0e;stroke-width:.8;paint-order:stroke;}
.v268-map-done.v269-map-major .v269-map-castle use{fill:#bfe7c4;}
.v268-map-locked.v269-map-major .v269-map-castle use{fill:#aeb8c2;}
.v268-map-off.v269-map-major .v269-map-castle use{fill:#b7a77f;opacity:.8;}
.v269-map-story-mark{pointer-events:none;filter:drop-shadow(0 1px 2px rgba(0,0,0,.7));}
.v269-map-story-mark rect{fill:#f2d58e;stroke:#2a1d0f;stroke-width:1;}
.v269-map-story-mark circle,.v269-map-story-mark path{fill:#6d4f27;stroke:none;}
.v269-legend-castle{color:#f1cf83;font-weight:900;}
.v269-legend-story{color:#f2d58e;font-weight:800;}

.v269-map-detail{display:grid;grid-template-columns:minmax(260px,.9fr) minmax(300px,1.1fr);gap:14px;align-items:stretch;}
.v269-map-detail-copy{display:flex;flex-direction:column;gap:5px;min-width:0;}
.v269-city-title{font-size:16px;line-height:1.35;}
.v269-city-title b{color:#fff0c9;}
.v269-city-castle{font-size:18px;filter:drop-shadow(0 1px 2px rgba(0,0,0,.5));}
.v269-city-tag{color:#b9c1cc;}
.v269-story-panel{min-width:0;border-left:1px solid rgba(230,181,86,.18);padding-left:14px;display:flex;flex-direction:column;gap:8px;justify-content:center;}
.v269-story-image{position:relative;width:100%;height:234px;padding:0;border:1px solid rgba(230,181,86,.38);border-radius:10px;overflow:hidden;background:#17120c;cursor:zoom-in;box-shadow:0 5px 16px rgba(0,0,0,.28);}
.v269-story-image img{display:block;transition:filter .22s ease;}
.v269-story-image:hover img{filter:brightness(1.08);}
.v269-story-image.v269-story-draggable{cursor:grab;}
.v269-story-image.v269-story-draggable:active{cursor:grabbing;}
.v269-story-image.v269-story-conquered img{filter:grayscale(1);}
.v269-story-image.v269-story-conquered:hover img{filter:grayscale(1) brightness(1.08);}
.v269-story-conquered-badge{position:absolute;left:7px;bottom:7px;z-index:2;padding:3px 8px;border-radius:999px;background:rgba(0,0,0,.72);border:1px solid rgba(232,196,108,.4);color:#e7dcc0;font-size:10px;font-weight:800;letter-spacing:.03em;pointer-events:none;}
.v269-story-lightbox-card img.v269-conquered-photo{filter:grayscale(1);}
.v269-story-layout-editor{display:grid;gap:6px;padding:9px 0 2px;border-top:1px dashed rgba(230,181,86,.22);margin-top:2px;}
.v269-story-layout-title{font-size:11px;font-weight:900;color:#f0cf7b;}
.v269-story-layout-row{display:grid;grid-template-columns:64px 1fr 42px;gap:8px;align-items:center;font-size:10px;color:#d8d2c6;}
.v269-story-layout-row input[type="range"]{width:100%;}
.v269-story-layout-actions{display:flex;gap:7px;padding-top:2px;}
.v269-story-layout-actions .btn{padding:6px 10px;font-size:10px;}
.v269-story-layout-hint{font-size:9px;opacity:.65;}
.v269-story-empty{min-height:82px;border:1px dashed rgba(230,181,86,.3);border-radius:10px;display:flex;align-items:center;justify-content:center;text-align:center;padding:12px;color:#9e978b;background:rgba(0,0,0,.12);}
.v269-story-admin{display:flex;gap:7px;align-items:center;flex-wrap:wrap;padding-top:2px;}
.v269-story-admin .btn{padding:7px 10px;font-size:11px;}
.v269-story-admin span{font-size:10px;color:#8f98a7;}
.v269-story-lightbox{position:fixed;inset:0;z-index:10050;display:none;align-items:center;justify-content:center;padding:28px;background:rgba(5,5,7,.88);backdrop-filter:blur(5px);}
.v269-story-lightbox.show{display:flex;}
.v269-story-lightbox-card{max-width:min(1100px,92vw);max-height:88vh;border:1px solid rgba(230,181,86,.5);border-radius:14px;overflow:hidden;background:#15110c;box-shadow:0 18px 70px rgba(0,0,0,.65);}
.v269-story-lightbox-card img{display:block;max-width:92vw;max-height:82vh;object-fit:contain;background:#090806;}
.v269-story-lightbox-title{padding:10px 14px;text-align:center;font-weight:900;color:#f1d69e;}
.v269-story-lightbox-close{position:fixed;right:24px;top:18px;width:42px;height:42px;border:1px solid rgba(255,255,255,.24);border-radius:50%;background:rgba(0,0,0,.45);color:white;font-size:30px;line-height:36px;cursor:pointer;}

@media(max-width:820px){
  .v268-map-label,.v268-map-label-halo{font-size:13px;}
  .v268-map-off .v268-map-label,.v268-map-off .v268-map-label-halo{font-size:11px;}
  .v269-map-detail{grid-template-columns:1fr;}
  .v269-story-panel{border-left:0;border-top:1px solid rgba(230,181,86,.18);padding-left:0;padding-top:10px;}
  .v269-story-image{height:281px;}
}


/* ---- assets/css/v275_card_zoom_layer_fix.css ---- */
/* v275 — 카드 확대 모달이 부스터 상세/결과 모달 뒤로 밀리는 문제 수정 */
#v273BoosterDetailModal,
#v270BoosterResultModal{
  z-index:14000!important;
}

#cardImageZoomModal.card-image-zoom-modal{
  z-index:2147483000!important;
  isolation:isolate;
}
#cardImageZoomModal.card-image-zoom-modal.show{
  display:flex!important;
}
#cardImageZoomModal .card-image-zoom-box{
  position:relative!important;
  z-index:2!important;
}

/* 확대 중에는 뒤쪽 부스터 카드 툴팁이 위로 겹치지 않도록 한다. */
#cardImageZoomModal.show ~ .card-function-tooltip,
body.v275-card-zoom-open .card-function-tooltip{
  display:none!important;
}


/* ---- assets/css/v276_booster_pack_flip.css ---- */
/* ================================================================
   v276 — 부스터팩 첫 화면 단순화 + 순차 카드 플립 공개
   1) 부스터 첫 화면: 팩 표지/팩명/에피소드만 표시
   2) 개봉 결과: 카드 뒷면 -> 앞면을 획득 순서대로 자동 플립
   ================================================================ */

/* ---------- 부스터팩 첫 화면 ---------- */
#boosterPackGrid.v276-booster-picker{
  display:grid!important;
  grid-template-columns:repeat(auto-fill,minmax(180px,1fr))!important;
  gap:14px!important;
  align-items:start!important;
}
#boosterPackGrid .booster-card.v276-simple-pack{
  display:grid!important;
  grid-template-columns:1fr!important;
  grid-template-rows:auto auto auto!important;
  gap:7px!important;
  align-items:start!important;
  padding:10px!important;
  min-width:0!important;
  cursor:pointer!important;
  overflow:hidden!important;
  border:1px solid rgba(232,196,108,.25)!important;
  border-radius:11px!important;
  background:rgba(18,14,11,.9)!important;
  transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease!important;
}
#boosterPackGrid .booster-card.v276-simple-pack:hover,
#boosterPackGrid .booster-card.v276-simple-pack:focus-visible{
  transform:translateY(-2px)!important;
  border-color:rgba(245,211,124,.72)!important;
  box-shadow:0 10px 24px rgba(0,0,0,.28)!important;
  outline:none!important;
}
#boosterPackGrid .booster-card.v276-simple-pack > *{
  display:none!important;
  grid-column:1!important;
}
#boosterPackGrid .booster-card.v276-simple-pack > .v265-pack-cover,
#boosterPackGrid .booster-card.v276-simple-pack > .pack-art{
  display:flex!important;
  grid-row:1!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  aspect-ratio:16/9!important;
  position:relative!important;
}
#boosterPackGrid .booster-card.v276-simple-pack > .v265-pack-head{
  display:block!important;
  grid-row:2!important;
  margin:0!important;
}
#boosterPackGrid .booster-card.v276-simple-pack > .v265-pack-head h3{
  display:block!important;
  margin:0!important;
  font-size:13px!important;
  line-height:1.35!important;
  color:#f2d27f!important;
  text-align:center!important;
}
#boosterPackGrid .booster-card.v276-simple-pack > .v265-pack-head .v265-visibility{
  display:none!important;
}
#boosterPackGrid .booster-card.v276-simple-pack > p{
  display:block!important;
  grid-row:3!important;
  margin:0!important;
  padding:0!important;
  font-size:10px!important;
  line-height:1.35!important;
  text-align:center!important;
  color:#d8c79d!important;
}
#boosterPackGrid .booster-card.v276-simple-pack .v273-cover-hint{
  display:none!important;
}

/* ---------- 개봉 결과: 순차 플립 ---------- */

/* 결과 DOM이 래핑되기 전 카드 앞면이 순간 노출되지 않도록 숨긴다. */
#v274BoosterResultGrid > .shop-card-entry{visibility:hidden!important;}
#v274BoosterResultGrid.v276-flip-grid{
  perspective:1200px!important;
  align-items:start!important;
}
#v274BoosterResultGrid .v276-flip-card{
  position:relative!important;
  width:var(--collection-card-width,175px)!important;
  min-width:var(--collection-card-width,175px)!important;
  max-width:var(--collection-card-width,175px)!important;
  height:calc(var(--collection-card-height,306.25px) + 28px)!important;
  min-height:calc(var(--collection-card-height,306.25px) + 28px)!important;
  perspective:1000px!important;
  transform:translateZ(0);
}
#v274BoosterResultGrid .v276-flip-inner{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  transform-style:preserve-3d!important;
  transform:rotateY(180deg)!important;
  transition:transform .62s cubic-bezier(.2,.72,.16,1)!important;
}
#v274BoosterResultGrid .v276-flip-card.is-revealed .v276-flip-inner{
  transform:rotateY(0deg)!important;
}
#v274BoosterResultGrid .v276-card-back,
#v274BoosterResultGrid .v276-card-front{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  backface-visibility:hidden!important;
  -webkit-backface-visibility:hidden!important;
  overflow:hidden!important;
}
#v274BoosterResultGrid .v276-card-front{
  transform:rotateY(0deg)!important;
}
#v274BoosterResultGrid .v276-card-back{
  transform:rotateY(180deg)!important;
}
#v274BoosterResultGrid .v276-card-front > .shop-card-entry{
  margin:0!important;
}
#v274BoosterResultGrid .v276-card-back{
  display:grid!important;
  place-items:center!important;
  box-sizing:border-box!important;
  padding:10px!important;
  border:1px solid rgba(232,196,108,.58)!important;
  border-radius:9px!important;
  background:
    radial-gradient(circle at 50% 42%,rgba(213,169,73,.25),transparent 34%),
    repeating-linear-gradient(45deg,rgba(235,202,119,.055) 0 7px,transparent 7px 14px),
    linear-gradient(160deg,#24190e 0%,#0e0b09 52%,#191008 100%)!important;
  box-shadow:inset 0 0 0 4px rgba(0,0,0,.42),inset 0 0 0 6px rgba(230,193,102,.18),0 12px 30px rgba(0,0,0,.34)!important;
}
#v274BoosterResultGrid .v276-card-back::before{
  content:'三國志'!important;
  display:grid!important;
  place-items:center!important;
  width:76%!important;
  aspect-ratio:1!important;
  border:1px solid rgba(238,207,125,.38)!important;
  border-radius:50%!important;
  color:#f0cf7b!important;
  font-size:26px!important;
  font-weight:900!important;
  letter-spacing:.1em!important;
  text-indent:.1em!important;
  text-shadow:0 2px 8px rgba(0,0,0,.65)!important;
  box-shadow:inset 0 0 28px rgba(218,167,62,.1)!important;
}
#v274BoosterResultGrid .v276-card-back::after{
  content:'TCG BOOSTER'!important;
  position:absolute!important;
  left:0!important;
  right:0!important;
  bottom:18px!important;
  text-align:center!important;
  color:rgba(244,221,164,.72)!important;
  font-size:9px!important;
  font-weight:800!important;
  letter-spacing:.18em!important;
}
#v274BoosterResultGrid .v276-flip-card.is-revealed{
  animation:v276RevealPop .42s ease-out both;
}
@keyframes v276RevealPop{
  0%{filter:brightness(.82)}
  55%{filter:brightness(1.18)}
  100%{filter:none}
}

@media(max-width:760px){
  #boosterPackGrid.v276-booster-picker{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}
  #boosterPackGrid .booster-card.v276-simple-pack{padding:8px!important}
  #boosterPackGrid .booster-card.v276-simple-pack > .v265-pack-head h3{font-size:11px!important}
  #v274BoosterResultGrid .v276-card-back::before{font-size:21px!important}
}
@media(max-width:420px){
  #boosterPackGrid.v276-booster-picker{grid-template-columns:1fr 1fr!important;gap:7px!important}
  #boosterPackGrid .booster-card.v276-simple-pack > .v265-pack-head h3{font-size:10px!important}
  #boosterPackGrid .booster-card.v276-simple-pack > p{font-size:9px!important}
}

@media(prefers-reduced-motion:reduce){
  #v274BoosterResultGrid .v276-flip-inner{transition-duration:.01ms!important}
  #v274BoosterResultGrid .v276-flip-card.is-revealed{animation:none!important}
}


/* ---- assets/css/v277_booster_list_editor.css ---- */
/* v277 — 관리자 부스터팩 LIST 편집 모드 */
#v277BoosterEditModeBtn{margin-left:auto}
#boosterPackModal.v277-editing #boosterPackGrid .booster-card.v276-simple-pack{border-color:rgba(105,184,255,.55)!important;box-shadow:inset 0 0 0 1px rgba(105,184,255,.12)!important}
#boosterPackGrid .booster-card.v276-simple-pack > .v277-pack-edit-btn{display:none!important;grid-row:4!important;margin-top:2px!important;justify-content:center!important;width:100%!important;position:relative!important;z-index:3!important}
#boosterPackGrid.v277-admin-list-edit .booster-card.v276-simple-pack > .v277-pack-edit-btn{display:flex!important}
#boosterPackGrid.v277-admin-list-edit .booster-card.v276-simple-pack{grid-template-rows:auto auto auto auto!important}
#boosterPackGrid.v277-admin-list-edit .booster-card.v276-simple-pack > .v265-pack-cover,#boosterPackGrid.v277-admin-list-edit .booster-card.v276-simple-pack > .pack-art{pointer-events:none!important}

.v277-editor-box{width:min(1240px,96vw)!important;max-height:92vh!important;overflow:auto!important}
.v277-editor-layout{display:grid;grid-template-columns:310px minmax(0,1fr);gap:14px;padding:14px}
.v277-editor-side,.v277-editor-main{border:1px solid rgba(232,196,108,.18);border-radius:11px;background:rgba(255,255,255,.025);padding:12px;min-width:0}
.v277-editor-side{display:grid;align-content:start;gap:9px}.v277-editor-side h3,.v277-editor-main h3{margin:0 0 3px;color:#f0cf7b;font-size:13px}
.v277-editor-side>label{display:grid;gap:4px;font-size:10px}.v277-editor-side input,.v277-editor-side select,.v277-card-filters input,.v277-card-filters select{width:100%;box-sizing:border-box;padding:8px;border-radius:7px;border:1px solid rgba(255,255,255,.16);background:rgba(0,0,0,.28);color:inherit}
.v277-editor-cover{width:100%;aspect-ratio:16/9;border:1px solid rgba(232,196,108,.3);border-radius:9px;overflow:hidden;background:#0e0b09}.v277-editor-cover img{width:100%;height:100%;object-fit:cover;display:block}.v277-cover-empty{height:100%;display:grid;place-content:center;text-align:center;background:radial-gradient(circle at 50% 35%,rgba(182,132,43,.35),rgba(14,10,8,.92))}.v277-cover-empty b{font-size:28px;color:#f0cf7b}.v277-cover-empty span{font-size:10px;opacity:.7}
.v277-rate-group{display:grid;gap:5px;padding:8px;border:1px solid rgba(255,255,255,.09);border-radius:8px}.v277-rate-group>b{font-size:11px;color:#f2d783}.v277-rate-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.v277-rate-field{display:grid;grid-template-columns:33px 1fr 14px;align-items:center;gap:4px;font-size:9px}.v277-rate-field input{padding:6px!important;text-align:right}.v277-rate-field em{font-style:normal;opacity:.65}.v277-rate-remain{font-size:9px;opacity:.75}.v277-rate-remain.is-invalid{color:#ff8b8b;opacity:1;font-weight:800}.v277-rate-note{font-size:9px;line-height:1.45;opacity:.68}
.v277-card-config-head{display:flex;gap:12px;align-items:end;justify-content:space-between;margin-bottom:8px}.v277-card-filters{display:grid;grid-template-columns:minmax(160px,1fr) 100px 90px;gap:6px;min-width:min(520px,65%)}.v277-card-bulk{display:flex;gap:6px;margin-bottom:8px}.v277-card-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;max-height:610px;overflow:auto;padding-right:3px}.v277-card-row{display:grid;grid-template-columns:20px 40px 34px minmax(0,1fr);gap:5px;align-items:center;padding:7px;border:1px solid rgba(255,255,255,.08);border-radius:7px;background:rgba(0,0,0,.16);font-size:9px;cursor:pointer}.v277-card-row:hover{border-color:rgba(232,196,108,.35)}.v277-card-row input{margin:0}.v277-card-row .v277-grade{font-weight:900;color:#f0cf7b}.v277-card-row .v277-faction{opacity:.72}.v277-card-row b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v277-card-row small{grid-column:4;font-size:8px;opacity:.45;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.v277-editor-actions{display:flex;justify-content:flex-end;gap:7px;padding:0 14px 14px}.v277-editor-actions .btn{min-width:110px}
.v277-editing .v276-simple-pack{cursor:pointer!important}
@media(max-width:900px){.v277-editor-layout{grid-template-columns:1fr}.v277-editor-side{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.v277-editor-side h3,.v277-editor-cover,.v277-rate-note{grid-column:1/-1}.v277-card-list{grid-template-columns:1fr}.v277-card-filters{min-width:0;width:100%;grid-template-columns:1fr 90px 80px}.v277-card-config-head{align-items:stretch;flex-direction:column}}
@media(max-width:600px){.v277-editor-side{grid-template-columns:1fr}.v277-editor-cover,.v277-editor-side h3,.v277-rate-note{grid-column:auto}.v277-card-filters{grid-template-columns:1fr 1fr}.v277-card-filters input{grid-column:1/-1}.v277-editor-layout{padding:8px}.v277-editor-side,.v277-editor-main{padding:9px}}


/* ---- assets/css/v278_booster_cover_zoom.css ---- */
/* ================================================================
   v278 — 부스터팩 표지 2.5:3.5 비율 통일 + 구성/개봉 글씨 확대
          + 관리자 LIST 편집 모드 표지 확대·위치 조정 UI
   ================================================================ */

/* ---------- 표지 비율: 목록 첫 화면 + 상세화면 + 관리자 편집 미리보기 공통 ---------- */
.v265-pack-cover,
#boosterPackGrid .booster-card.v276-simple-pack > .v265-pack-cover,
#boosterPackGrid .booster-card.v276-simple-pack > .pack-art,
.v273-detail-cover-wrap .v265-pack-cover,
.v277-editor-cover{
  aspect-ratio:2.5/3.5 !important;
}
.v277-editor-cover{position:relative;}
.v277-editor-cover.v278-dragging{cursor:grabbing !important;}

/* ---------- 카드 구성 텍스트 확대 ---------- */
.v273-pack-detail-section>h3{font-size:18px !important;}
.v273-composition-title b{font-size:15px !important;}
.v273-composition-title span{font-size:11px !important;}
.v273-grade-summary .v273-grade-chip,
.v273-detail-grade-summary .v273-grade-chip{font-size:12px !important;padding:4px 9px !important;}
.v273-composition-row,
.v273-detail-composition .v273-composition-row{font-size:12px !important;line-height:1.55 !important;}
.v273-pack-card-caption{font-size:11px !important;}
.v273-pack-card-caption>b{font-size:12px !important;}
.v273-view-pack-btn{font-size:12px !important;padding:7px 12px !important;}

/* ---------- 개봉 버튼 텍스트 확대 ---------- */
.v273-detail-booster-title{font-size:15px !important;}
.v273-detail-booster-row>b{font-size:13px !important;}
.v273-detail-booster-row .btn{font-size:13px !important;padding:9px 6px !important;}

@media(max-width:640px){
  .v273-pack-detail-section>h3{font-size:16px !important;}
  .v273-detail-booster-row .btn{font-size:12px !important;}
}

/* ---------- 관리자 표지 확대/위치 편집 컨트롤 ---------- */
.v278-cover-layout-box{display:grid;gap:6px;margin-top:8px;padding:9px 0 2px;border-top:1px dashed rgba(232,196,108,.28);}
.v278-cover-layout-title{font-size:11px;font-weight:900;color:#f0cf7b;}
.v278-cover-layout-row{display:grid;grid-template-columns:56px 1fr 42px;gap:8px;align-items:center;font-size:10px;color:#d8d2c6;}
.v278-cover-layout-row input[type="range"]{width:100%;}
.v278-cover-layout-actions{display:flex;gap:7px;padding-top:2px;}
.v278-cover-layout-actions .btn{padding:6px 10px;font-size:10px;}
.v278-cover-layout-hint{font-size:9px;opacity:.65;}


/* ---- v280 user-request patch: scroll performance / booster balance / image byte size ---- */
/* Off-screen list items are skipped by the renderer until they approach the viewport. */
#boosterPackGrid > .booster-card,
#quickStatsRows > tr,
#managerCardList > .manager-card-row,
#v277CardList > .v277-card-row,
.card-shop-grid > .shop-card-entry,
.v274-booster-card-grid > .shop-card-entry{
  content-visibility:auto;
  contain-intrinsic-size:auto 220px;
}
#quickStatsRows > tr{contain-intrinsic-size:auto 76px;}
#managerCardList > .manager-card-row{contain-intrinsic-size:auto 84px;}
#v277CardList > .v277-card-row{contain-intrinsic-size:auto 44px;}

.v280-booster-balance{
  display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;
  margin:7px 0 3px;padding:7px 9px;border:1px solid rgba(232,196,108,.22);
  border-radius:8px;background:rgba(0,0,0,.18);font-size:11px;font-weight:800;
}
.v280-booster-balance .v280-balance-label{opacity:.7;font-weight:700}
.v280-booster-balance b{color:#f2d783;font-size:12px}
.v280-booster-balance .v280-sep{opacity:.35}

.qs-image-thumb{position:relative!important;overflow:hidden!important}
.v280-image-bytes{
  position:absolute;right:3px;bottom:3px;z-index:4;max-width:calc(100% - 6px);
  padding:2px 4px;border-radius:4px;background:rgba(0,0,0,.78);color:#fff;
  font-size:8px;line-height:1.1;font-weight:800;letter-spacing:-.02em;white-space:nowrap;
  pointer-events:none;text-shadow:0 1px 2px rgba(0,0,0,.8)
}
.v280-image-bytes.is-large{background:rgba(137,34,34,.9);color:#fff1f1}
.v280-image-bytes.is-medium{background:rgba(122,82,17,.9);color:#fff6db}

/* Make the already-supported cover layout feature explicit in the admin editor. */
.v278-cover-layout-title::after{content:' · 크기/위치 조정';font-weight:700;opacity:.72}
#v277EditorCover img,.v265-cover-editor .v265-pack-cover img{will-change:transform,object-position}

@media(max-width:640px){
  .v280-booster-balance{font-size:10px;padding:6px}.v280-booster-balance b{font-size:11px}
}
