/* ===== 꼬마 전쟁 스타일 ===== */
:root {
  --bg: #0f1420; --bg2: #161d2d; --panel: #1b2335; --panel2: #222c42; --line: #2e3a55;
  --text: #e8ecf4; --muted: #8b96ad; --accent: #ff7a2f; --accent2: #ffb347;
  --red: #ff5a4a; --blue: #4aa3ff; --ok: #3fd07a; --gold: #ffcf4a;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: 'Pretendard', system-ui, sans-serif; color: var(--text); background: var(--bg);
  background-image: radial-gradient(circle at 20% 0%, #24304d 0, transparent 45%), radial-gradient(circle at 90% 100%, #2d1f2a 0, transparent 40%);
  background-attachment: fixed; user-select: none;
}
button { font-family: inherit; cursor: pointer; border: 0; color: inherit; background: none; }
input { font-family: inherit; }
small { color: var(--muted); font-weight: 400; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- 공용 ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 9px; font-weight: 700; font-size: 14px; transition: .15s; }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-primary { background: linear-gradient(180deg, var(--accent2), var(--accent)); color: #241200; box-shadow: 0 3px 0 #b44c10; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--panel2); border: 1px solid var(--line); }
.btn-ghost:hover { background: #2b3752; }
.btn-start { background: linear-gradient(180deg, #5ff09a, #23b35c); color: #04210f; box-shadow: 0 3px 0 #17803f; font-size: 16px; padding: 12px 28px; }
.btn-start:hover { filter: brightness(1.08); }
.btn-mini { font-size: 12px; padding: 4px 9px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); font-weight: 600; }
.btn-mini:hover { background: #2f3c5a; }
.btn-mini.danger { border-color: #7a2c2c; color: #ff9a8a; }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--panel2); color: var(--text); }
.panel { background: rgba(27, 35, 53, .92); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.panel-head h3 { font-size: 15px; }
.panel-actions { display: flex; gap: 8px; }
.hero-img { border-radius: 10px; border: 2px solid #555; background: #2a3248; object-fit: cover; display: block; flex-shrink: 0; }
.hero-img.mystery { filter: brightness(0) invert(.3); }
.trait { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 99px; margin-right: 4px; }
.trait.cost { border-color: var(--cc); color: var(--cc); }
.bar { display: block; height: 7px; background: #0b0f18; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ok); transition: width .25s; }
.bar.sp > i { background: var(--blue); }
.bar.xp > i { background: #7c6cff; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 13px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #241200; }
.full { width: 100%; }
input, .field input { width: 100%; padding: 10px 12px; background: #0e1320; border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-size: 14px; outline: none; }
input:focus { border-color: var(--accent); }
em { font-style: normal; }

/* ---------- 토스트/모달 ---------- */
#toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 9px; background: #232d45; border: 1px solid var(--line); font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: tin .2s; transition: .3s; }
.toast-error { border-color: #a33; background: #3a1d22; }
.toast-ok { border-color: #2b8a52; background: #173326; }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }
.modal-back { position: fixed; inset: 0; background: rgba(5, 8, 14, .7); display: grid; place-items: center; z-index: 500; animation: fade .15s; backdrop-filter: blur(3px); }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(420px, 94vw); max-height: 90vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal.wide { width: min(640px, 96vw); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; display: flex; gap: 8px; align-items: center; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.confirm-text { font-size: 15px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.mode-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }   /* · 176 모드 4종 → 2x2 */
.mode-pick-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px; border-radius: 10px; background: var(--panel2); border: 2px solid var(--line); }
.mode-pick-btn i { font-size: 24px; color: var(--mc); }
.mode-pick-btn small { font-size: 10px; letter-spacing: 1px; }
.mode-pick-btn.on { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 18%, var(--panel2)); }
.mode-pick-btn:disabled { opacity: .3; cursor: not-allowed; }
.mode-desc { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5; }

/* ---------- 타이틀 ---------- */
#title-screen { min-height: 100vh; display: grid; place-items: center; position: relative; overflow: hidden; padding: 20px; }
.title-heroes { position: absolute; inset: 0; display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 30px; opacity: .22; filter: blur(1px); }
.title-heroes .float { animation: float 4s ease-in-out infinite; }
.title-heroes .float:nth-child(2n) { animation-delay: -2s; }
@keyframes float { 50% { transform: translateY(-14px); } }
.title-card { position: relative; text-align: center; background: rgba(15, 20, 32, .85); border: 1px solid var(--line); border-radius: 20px; padding: 40px 44px; width: min(480px, 100%); backdrop-filter: blur(6px); }
.title-sub { letter-spacing: 4px; font-size: 12px; color: var(--muted); }
.title-logo { font-size: 58px; font-weight: 900; letter-spacing: 2px; line-height: 1.1; margin: 6px 0; text-shadow: 0 4px 0 #000; }
.title-logo span, .logo-sm span { color: var(--accent); }
.title-tag { color: var(--muted); margin-bottom: 26px; font-size: 14px; }
#nick-form { display: flex; flex-direction: column; gap: 10px; }
#nick-form input { text-align: center; font-size: 18px; padding: 18px 14px; min-height: 60px; width: 100%; box-sizing: border-box; border-radius: 12px; }   /* · 180 닉네임 입력칸 세로로 크게 */
#nick-form .btn { justify-content: center; }
.title-legal { margin-top: 22px; font-size: 11px; color: #6b7590; line-height: 1.5; }

/* ---------- 상단바 ---------- */
#top-bar { display: flex; align-items: center; gap: 20px; padding: 12px 22px; background: rgba(12, 16, 26, .9); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(6px); }
.logo-sm { font-size: 20px; font-weight: 900; white-space: nowrap; }
.logo-sm small { font-size: 11px; }
#top-bar h2 { font-size: 17px; flex: 1; display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top-nav { margin-left: auto; display: flex; gap: 6px; }
.nav-btn { padding: 8px 13px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); }
.nav-btn:hover { background: var(--panel2); color: var(--text); }

/* ---------- 로비 ---------- */
#lobby { display: grid; grid-template-columns: 1fr 320px; gap: 16px; padding: 18px 22px; max-width: 1400px; margin: 0 auto; }
#mode-cards { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1200px) { #mode-cards { grid-template-columns: repeat(2, 1fr); } }
.mode-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; border-radius: 14px; cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--mc) 26%, var(--panel)) 0%, var(--panel) 70%); border: 1px solid color-mix(in srgb, var(--mc) 45%, var(--line)); transition: .15s; }
.mode-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px color-mix(in srgb, var(--mc) 25%, transparent); }
.mode-ico { position: absolute; right: -6px; top: -6px; font-size: 92px; color: var(--mc); opacity: .16; }
.mode-card small { letter-spacing: 2px; font-size: 11px; color: var(--mc); font-weight: 700; }
.mode-card h2 { font-size: 24px; font-weight: 900; }
.mode-card p { font-size: 13px; color: #b9c2d6; line-height: 1.5; margin-top: 4px; }
.mode-subs { display: flex; gap: 5px; flex-wrap: wrap; }
.mode-subs span { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: rgba(0,0,0,.3); color: #dde3ef; }
.btn-mode { background: var(--mc); color: #0d0d0d; align-self: flex-start; margin-top: auto; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.btn-mode:hover { filter: brightness(1.1); }
.tabs { display: flex; gap: 4px; }
.tab { padding: 7px 14px; border-radius: 8px; font-weight: 700; font-size: 14px; color: var(--muted); }
.tab.on { background: var(--panel2); color: var(--mc, var(--text)); box-shadow: inset 0 -2px 0 var(--mc, var(--accent)); }
.room-head, .room-row { display: grid; grid-template-columns: 52px 104px 1fr 150px 60px 70px; align-items: center; gap: 10px; }
.room-head { font-size: 12px; color: var(--muted); padding: 0 12px 8px; border-bottom: 1px solid var(--line); }
#room-panel { display: flex; flex-direction: column; min-height: 0; }
#room-list { list-style: none; overflow: auto; flex: 1 1 0; height: 0; min-height: 470px; }   /* 오른쪽 열 높이만큼 끝까지 채움 */
.room-row { padding: 10px 12px; border-bottom: 1px solid rgba(46, 58, 85, .5); cursor: pointer; font-size: 14px; }
.room-row:hover { background: var(--panel2); }
.room-row.playing { opacity: .55; }
.room-no { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.mode-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--mc); background: color-mix(in srgb, var(--mc) 15%, transparent); border: 1px solid color-mix(in srgb, var(--mc) 40%, transparent); padding: 3px 9px; border-radius: 99px; justify-self: start; }
.room-title { font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-title small { display: block; font-size: 12px; margin-top: 2px; }
.room-title .fa-lock { color: var(--gold); }
.room-host { display: flex; align-items: center; gap: 7px; font-size: 13px; overflow: hidden; white-space: nowrap; }
.room-host .hero-img { border-width: 1px; border-radius: 6px; }
.room-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.room-count.full { color: var(--red); }
.st-wait { color: var(--ok); font-size: 13px; font-weight: 700; }
.st-play { color: var(--red); font-size: 13px; font-weight: 700; }
.st-ready { color: var(--ok); font-weight: 800; }
.st-host { color: var(--gold); font-weight: 800; }
.empty-row { text-align: center; padding: 40px; color: var(--muted); }
#lobby-side { display: flex; flex-direction: column; gap: 16px; }
.pf-top { display: flex; gap: 12px; align-items: center; }
.pf-top > div { flex: 1; }
.pf-nick { font-size: 17px; }
.pf-lv { margin-left: 6px; font-size: 12px; background: var(--accent); color: #241200; padding: 2px 7px; border-radius: 99px; font-weight: 800; }
.exp-bar { height: 7px; background: #0b0f18; border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.exp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7c6cff, #b48cff); }
.pf-peso { margin: 12px 0 8px; font-weight: 700; color: var(--gold); }
.pf-rec { list-style: none; font-size: 13px; display: flex; flex-direction: column; gap: 5px; }
.pf-rec li { display: flex; justify-content: space-between; background: var(--bg2); padding: 6px 10px; border-radius: 7px; }
.pf-rec span { font-weight: 700; }
.pf-fav { font-size: 12px; color: var(--muted); margin-top: 10px; }
#lobby-chat { display: flex; flex-direction: column; flex: 1; min-height: 260px; }
.chat-log { flex: 1; overflow: auto; font-size: 13px; line-height: 1.6; background: var(--bg2); border-radius: 8px; padding: 8px 10px; min-height: 140px; max-height: 300px; user-select: text; }
.chat-log b { color: var(--accent2); margin-right: 4px; }
.chat-log .sys { color: #8fd3a5; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; }
.chat-form .btn { padding: 9px 12px; }

/* ---------- 대기방 ---------- */
#waiting-room { display: grid; grid-template-columns: 1fr 320px; gap: 16px; padding: 18px 22px; max-width: 1400px; margin: 0 auto; }
#slot-panel { min-height: 280px; }
.slots ul { list-style: none; display: grid; gap: 8px; }
.slots.solo ul { grid-template-columns: repeat(4, 1fr); }
.slots.solo.n2 ul { grid-template-columns: repeat(2, 1fr); }
.slots.solo.n1 ul, .slots.solo.n3 ul { grid-template-columns: repeat(3, 1fr); }
.slots.team { display: grid; grid-template-columns: 1fr 50px 1fr; align-items: start; }
.slots.team .team-col ul { grid-template-columns: 1fr 1fr; }
.team-col h4 { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 8px; margin-bottom: 8px; }
.team-col.red h4 { background: rgba(255, 90, 74, .18); color: var(--red); }
.team-col.blue h4 { background: rgba(74, 163, 255, .18); color: var(--blue); }
.vs { font-weight: 900; font-size: 22px; text-align: center; padding-top: 60px; color: var(--muted); }
.slot { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; min-height: 76px; }
.slot.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.slot.red { border-left: 3px solid var(--red); }
.slot.blue { border-left: 3px solid var(--blue); }
.slot.empty { justify-content: center; flex-direction: column; gap: 4px; color: #4f5a75; border-style: dashed; }
.slot-info { flex: 1; min-width: 0; }
.slot-info b { display: block; font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.slot-info small { font-size: 12px; }
.host-ico { color: var(--gold); margin-right: 4px; }
.bot-tag { font-size: 10px; background: #3a4766; padding: 1px 5px; border-radius: 4px; color: #b8c4e0; }
.slot-state { font-size: 12px; }
.slot .kick { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; font-size: 11px; }
.slot-trio { display: flex; gap: 2px; }
.slot-trio .hero-img { border-width: 1px; border-radius: 6px; }
#room-side { grid-row: span 2; display: flex; flex-direction: column; gap: 16px; }
.ri-mode { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--mc) 16%, var(--bg2)); border: 1px solid color-mix(in srgb, var(--mc) 40%, transparent); margin-bottom: 10px; }
.ri-mode i { font-size: 28px; color: var(--mc); }
.ri-mode small { display: block; font-size: 10px; letter-spacing: 2px; color: var(--mc); font-weight: 700; }
.ri-opts { list-style: none; font-size: 14px; }
.ri-opts li { display: flex; justify-content: space-between; padding: 6px 2px; border-bottom: 1px solid rgba(46,58,85,.5); }
.ri-opts span { color: var(--muted); }
#room-chat { flex: 1; display: flex; flex-direction: column; }
#room-chat .chat-log { max-height: none; }
#loadout h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; }
.hg-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 9px; border: 2px solid transparent; font-size: 11px; }
.hg-item:hover { background: var(--panel2); }
.hg-item.on { border-color: var(--accent); background: rgba(255, 122, 47, .12); }
.hg-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hg-item .order { position: absolute; top: 2px; right: 4px; background: var(--accent); color: #241200; width: 20px; height: 20px; border-radius: 50%; font-size: 12px; display: grid; place-items: center; }
.hero-detail { display: flex; gap: 14px; margin-top: 14px; padding: 12px; background: var(--bg2); border-radius: 10px; font-size: 13px; }
.hero-detail .traits { margin: 6px 0; }
.hero-detail .skill { color: #c8d0e0; line-height: 1.5; }
.hero-detail .skill i { color: var(--gold); }
.trio-slots { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.trio-slot { position: relative; width: 110px; height: 120px; border: 2px dashed var(--line); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #4f5a75; font-size: 12px; }
.trio-slot.filled { border-style: solid; border-color: var(--gold); background: rgba(232, 179, 61, .08); color: var(--text); }
.trio-slot > em { position: absolute; top: 4px; left: 8px; font-weight: 800; color: var(--gold); font-size: 12px; }
.trio-slot .rm { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; }
.guide-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 14px; }
.guide-list li { background: var(--bg2); padding: 12px; border-radius: 9px; display: flex; gap: 10px; align-items: center; }
.guide-list i { color: #3d9be8; font-size: 18px; width: 22px; text-align: center; }
#room-controls { grid-column: 1; display: flex; justify-content: flex-end; gap: 8px; }
.countdown { position: fixed; inset: 0; background: rgba(5,8,14,.8); z-index: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.countdown b { font-size: 140px; font-weight: 900; color: var(--accent); animation: pop .7s infinite; }
@keyframes pop { from { transform: scale(1.4); opacity: .3; } }

/* ---------- 게임 공용 ---------- */
#game-root { min-height: 100vh; }
.game { min-height: 100vh; display: flex; flex-direction: column; position: relative; }
.game-top { display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: rgba(10, 13, 22, .95); border-bottom: 2px solid var(--mc); }
.gt-mode { font-weight: 800; color: var(--mc); }
.gt-center { flex: 1; display: flex; justify-content: center; align-items: center; gap: 16px; font-size: 15px; }
.gt-center b { font-size: 20px; font-variant-numeric: tabular-nums; }
.gt-actions { display: flex; gap: 6px; }
.todo-badge { position: fixed; bottom: 6px; left: 50%; transform: translateX(-50%); opacity: .8; font-size: 12px; background: rgba(255, 179, 71, .14); border: 1px dashed var(--accent2); color: var(--accent2); padding: 6px 10px; border-radius: 8px; z-index: 40; pointer-events: none; }

/* ---------- 클래식 ---------- */
.cl-score { display: flex; justify-content: center; align-items: center; gap: 24px; padding: 8px; font-size: 16px; font-weight: 700; }
.cl-score .red { color: var(--red); } .cl-score .blue { color: var(--blue); }
.cl-score b { font-size: 26px; margin: 0 6px; }
.cl-score em { font-size: 13px; color: var(--muted); }
.boss-hp { display: flex; align-items: center; gap: 10px; }
.boss-hp .bar { width: 320px; height: 12px; } .boss-hp .bar i { background: var(--red); }
.cl-stage { position: relative; display: flex; justify-content: center; padding: 0 18px; }
#cl-canvas { width: 100%; max-width: 1100px; border-radius: 12px; border: 1px solid var(--line); background: #222; }
.cl-map-name { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); font-weight: 800; background: rgba(0,0,0,.4); padding: 3px 12px; border-radius: 99px; font-size: 13px; }
.cl-stage .todo-badge { position: absolute; bottom: 10px; }
.autochess .todo-badge { bottom: auto; top: 54px; }
.cl-bottom { display: grid; grid-template-columns: 260px 1fr; gap: 14px; padding: 14px 18px; align-items: center; }
.cl-me { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); padding: 10px; border-radius: 12px; }
.cl-me > div:last-child { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.cl-keys { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
kbd { background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 3px; padding: 1px 7px; border-radius: 5px; margin-right: 4px; color: var(--text); font-family: inherit; font-weight: 700; }
.cl-swap { grid-column: 1 / -1; }
#cl-swap-list { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.swap-btn { border-radius: 8px; border: 2px solid transparent; padding: 1px; opacity: .7; }
.swap-btn:hover { opacity: 1; }
.swap-btn.on { border-color: var(--accent); opacity: 1; }
.swap-btn .hero-img { border-width: 1px; border-radius: 6px; }

/* ---------- 오토체스 ---------- */
.ac-main { flex: 1; display: grid; grid-template-columns: 210px 1fr 210px; gap: 12px; padding: 12px; }
.ac-syn h4, .ac-players h4 { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.syn { display: grid; grid-template-columns: 20px 1fr auto 18px; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 8px; background: var(--bg2); margin-bottom: 5px; font-size: 13px; opacity: .55; cursor: help; }
.syn.on { opacity: 1; }
.syn.lv1 { box-shadow: inset 3px 0 0 #c98a4b; } .syn.lv2 { box-shadow: inset 3px 0 0 #c0c8d8; } .syn.lv3 { box-shadow: inset 3px 0 0 var(--gold); }
.syn span { display: flex; gap: 3px; font-size: 11px; }
.syn span em { color: #5a6580; } .syn span em.hit { color: var(--gold); font-weight: 800; }
.syn small { text-align: right; font-weight: 700; color: var(--text); }
.ac-center { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ac-board { position: relative; padding: 10px; background: linear-gradient(180deg, #24304a, #1a2438); border-radius: 14px; border: 1px solid var(--line); }
.enemy-half { height: 110px; border: 1px dashed #3a4766; border-radius: 10px; margin-bottom: 10px; display: grid; place-items: center; color: #4f5a75; font-weight: 700; }
.ac-board .grid { display: grid; grid-template-columns: repeat(7, 66px); gap: 5px; }
.cell { width: 66px; height: 66px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); display: grid; place-items: center; }
.cell.board:nth-child(odd) { background: rgba(255,255,255,.07); }
.dragging .cell { outline: 1px dashed rgba(255,179,71,.35); }
.ac-bench { display: grid; grid-template-columns: repeat(9, 66px); gap: 5px; padding: 8px; background: rgba(0,0,0,.25); border-radius: 12px; }
.unit { position: relative; cursor: grab; }
.unit .stars { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-size: 11px; color: #c98a4b; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.unit.star2 .stars { color: #dfe6f2; } .unit.star3 .stars { color: var(--gold); }
.unit.star2 .hero-img { box-shadow: 0 0 10px #dfe6f2; } .unit.star3 .hero-img { box-shadow: 0 0 14px var(--gold); }
.ac-cap { position: absolute; top: 10px; right: 14px; font-weight: 800; background: rgba(0,0,0,.5); padding: 3px 10px; border-radius: 99px; font-size: 13px; }
.ac-cap.over { color: var(--red); }
.ac-phase { background: var(--panel2); padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; }
.pl { display: grid; grid-template-columns: 1fr 60px 28px; gap: 6px; align-items: center; font-size: 13px; padding: 6px 8px; background: var(--bg2); border-radius: 8px; margin-bottom: 5px; }
.pl span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pl.me { box-shadow: inset 0 0 0 1px var(--accent); }
.pl.dead { opacity: .35; text-decoration: line-through; }
.pl b { text-align: right; }
.ac-shopbar { display: grid; grid-template-columns: 200px 1fr 170px; gap: 12px; padding: 10px 12px; background: rgba(10, 13, 22, .95); border-top: 1px solid var(--line); }
.ac-left, .ac-right { display: flex; flex-direction: column; gap: 6px; }
.ac-lv { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; font-size: 13px; }
.ac-btn { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.ac-btn:hover { background: #2f3c5a; }
.ac-btn em { color: var(--gold); }
.ac-btn.on { border-color: var(--gold); color: var(--gold); }
.ac-gold { font-size: 22px; font-weight: 900; color: var(--gold); text-align: center; }
.ac-odds { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; }
.ac-shop { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.shop-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 25%, var(--panel)), var(--panel)); border: 2px solid var(--cc); transition: .12s; }
.shop-card:hover { transform: translateY(-3px); }
.shop-card b { font-size: 13px; } .shop-card small { font-size: 11px; }
.shop-card em { position: absolute; top: 4px; right: 6px; font-weight: 800; color: var(--gold); font-size: 13px; }
.shop-card .owned { position: absolute; top: 4px; left: 6px; font-size: 11px; background: var(--ok); color: #04210f; border-radius: 99px; padding: 0 6px; font-weight: 800; }
.shop-card.empty { background: rgba(255,255,255,.02); border: 2px dashed var(--line); min-height: 120px; }
.ac-sell-zone { position: fixed; bottom: 0; left: 0; right: 0; height: 54px; display: none; place-items: center; background: rgba(160, 30, 30, .6); font-size: 17px; font-weight: 800; z-index: 30; }
.dragging .ac-sell-zone { display: grid; }
html.mobile .ac-sell-zone { height: 46px; font-size: 14px; padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ---------- 챔피언 ---------- */
#cp-body { flex: 1; display: flex; flex-direction: column; padding: 16px 22px; }
.cp-intro { flex: 1; display: flex; align-items: center; justify-content: center; gap: 50px; animation: fade .4s; }
.cp-side { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cp-side b { font-size: 20px; margin-top: 6px; }
.cp-vs { font-size: 48px; font-weight: 900; color: var(--gold); font-style: italic; text-shadow: 0 4px 0 #6b4a00; }
.cp-vs.big { font-size: 90px; animation: pop .8s; }
.cp-hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.cp-team { display: flex; gap: 8px; } .cp-team.right { justify-content: flex-end; flex-direction: row-reverse; }
.cp-mini { display: flex; flex-direction: column; gap: 4px; width: 50px; opacity: .8; }
.cp-mini.cur { opacity: 1; transform: scale(1.12); }
.cp-mini.cur .hero-img { border-color: var(--gold) !important; }
.cp-mini.ko { opacity: .3; filter: grayscale(1); }
.cp-mini .bar { height: 5px; }
.cp-round { text-align: center; }
.cp-round small { display: block; letter-spacing: 3px; font-size: 11px; }
.cp-round b { font-size: 34px; font-weight: 900; color: var(--gold); line-height: 1; }
.cp-round em { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cp-arena { position: relative; flex: 1; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin: 20px 0; padding: 30px; border-radius: 16px; min-height: 320px;
  background: linear-gradient(180deg, #2a2040 0%, #3a2a45 55%, #5a3b2c 56%, #3b281e 100%); border: 1px solid var(--line); }
.cp-fighter { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cp-fighter .bar.big { width: 100%; max-width: 320px; height: 16px; border: 2px solid #000; }
.cp-fighter .bar.big i { background: linear-gradient(90deg, #ffcf4a, #ff7a2f); }
.cp-fighter.right .bar.big { transform: scaleX(-1); }
.cp-name { font-weight: 800; font-size: 15px; }
.hero-img.fighter { border-radius: 20px; border-width: 3px; animation: bob 1s ease-in-out infinite; }
.hero-img.flip { transform: scaleX(-1); animation-name: bobflip; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes bobflip { 0%, 100% { transform: scaleX(-1); } 50% { transform: scaleX(-1) translateY(-6px); } }
.cp-ko { position: absolute; inset: 0; display: grid; place-items: center; font-size: 100px; font-weight: 900; color: #ff3b2f; font-style: italic; text-shadow: 0 6px 0 #000; animation: pop .5s; background: rgba(0,0,0,.35); border-radius: 16px; }
.cp-log { height: 90px; overflow: auto; font-size: 13px; color: var(--muted); background: var(--bg2); border-radius: 10px; padding: 8px 12px; }

/* ---------- 결과 ---------- */
.result-back { position: fixed; inset: 0; z-index: 700; background: rgba(5,8,14,.82); display: grid; place-items: center; animation: fade .3s; backdrop-filter: blur(4px); }
.result { width: min(420px, 94vw); text-align: center; background: var(--panel); border: 2px solid var(--mc); border-radius: 18px; padding: 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.result h2 { font-size: 52px; font-weight: 900; letter-spacing: 3px; line-height: 1; }
.result.win h2 { color: var(--gold); text-shadow: 0 4px 0 #6b4a00; }
.result.lose h2 { color: #8b96ad; }
.result-sum { font-size: 17px; font-weight: 700; }
.result-sum em { color: var(--accent); margin-left: 6px; }
.result-stats { list-style: none; width: 100%; font-size: 14px; }
.result-stats li { display: flex; justify-content: space-between; padding: 6px 4px; border-bottom: 1px solid rgba(46,58,85,.6); gap: 10px; }
.result-stats li b { text-align: right; }
.result-stats span { color: var(--muted); }
.result-reward { display: flex; gap: 16px; font-weight: 800; color: var(--gold); margin-top: 6px; }
.level-up { font-weight: 900; color: #b48cff; font-size: 18px; animation: pop .6s; }
.result footer { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- 도감 ---------- */
#codex { display: grid; grid-template-columns: 1fr 380px; gap: 16px; padding: 18px 22px; max-width: 1300px; margin: 0 auto; }
#codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 14px; }
.cx-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 10px; border: 2px solid transparent; font-size: 12px; font-weight: 600; }
.cx-item:hover { background: var(--panel2); }
.cx-item.on { border-color: var(--accent); background: rgba(255,122,47,.1); }
#codex-detail { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; align-self: start; position: sticky; top: 76px; }
#codex-detail h2 { font-size: 24px; }
.skill-box { width: 100%; text-align: left; background: var(--bg2); padding: 12px; border-radius: 10px; font-size: 13px; line-height: 1.6; }
.skill-box b { color: var(--gold); }
.skill-box em { color: var(--accent2); font-weight: 700; }
.stat-list { list-style: none; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 13px; }
.stat-list li { display: flex; justify-content: space-between; background: var(--bg2); padding: 6px 10px; border-radius: 7px; }
.stat-list span { color: var(--muted); }
.syn-desc { width: 100%; text-align: left; font-size: 12px; color: var(--muted); line-height: 1.6; }
.syn-desc b { color: var(--text); margin-right: 4px; }

/* ---------- 반응형 ---------- */
@media (max-width: 1100px) {
  #lobby, #waiting-room, #codex { grid-template-columns: 1fr; }
  #room-list { flex: none; height: auto; min-height: 0; max-height: 470px; }
  #mode-cards { grid-template-columns: 1fr; }
  #room-side { grid-row: auto; }
  .slots.solo ul { grid-template-columns: repeat(2, 1fr); }
  .ac-main { grid-template-columns: 1fr; }
  .ac-board .grid, .ac-bench { grid-template-columns: repeat(7, 48px); }
  .ac-bench { grid-template-columns: repeat(9, 40px); }
  .cell { width: 48px; height: 48px; }
  .ac-bench .cell { width: 40px; height: 40px; }
  .ac-shopbar { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .room-head { display: none; }
  .room-row { grid-template-columns: 40px 1fr 50px; }
  .room-row .mode-badge, .room-row .room-host, .room-row .room-status { display: none; }
  .guide-list { grid-template-columns: 1fr; }
}

/* ===== 3D 인게임 (KayKit) ===== */
.g3d { height: 100vh; overflow: hidden; }
.champion.g3d .b-btns { top: 96px; }
.b-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #0b0f18; }
.battle-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.battle-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.b-float { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: 18px; color: #fff; text-shadow: 0 2px 0 #000, 0 0 6px #000; animation: bfloat .9s ease-out forwards; white-space: nowrap; }
.b-float.dmg-me { color: var(--gold); font-size: 22px; }
.b-float.dmg-hurt { color: var(--red); }
.b-float.guard { color: #9fc8ff; font-size: 14px; }
.b-float.skill { color: var(--accent2); font-size: 20px; }
.b-float.heal { color: var(--ok); }
@keyframes bfloat { 0% { opacity: 0; margin-top: 0; } 15% { opacity: 1; } 100% { opacity: 0; margin-top: -46px; } }
.b-tag { position: absolute; transform: translate(-50%, -100%); text-align: center; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; white-space: nowrap; }
.b-tag .hp { display: block; width: 54px; height: 5px; margin: 2px auto 0; background: #000a; border-radius: 3px; overflow: hidden; }
.b-tag .hp > i { display: block; height: 100%; background: var(--ok); }
.b-tag.red { color: #ffb0a8; } .b-tag.red .hp > i { background: var(--red); }
.b-tag.blue { color: #a8d2ff; } .b-tag.blue .hp > i { background: var(--blue); }
.b-tag.me { color: var(--gold); } .b-tag.me .hp > i { background: var(--ok); }
.b-tag.boss { font-size: 14px; color: #ff8a7a; } .b-tag.boss .hp { width: 110px; height: 8px; }
.b-tag .rs { display: block; width: 54px; height: 4px; margin: 2px auto 0; background: #000a; border-radius: 3px; overflow: hidden; }
.b-tag .rs > i { display: block; height: 100%; background: var(--gold); }
.b-hud { position: absolute; inset: 0; pointer-events: none; }
.b-hud button, .b-hud .b-btns { pointer-events: auto; }
.b-me { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 10px; align-items: center; background: #0b0f18cc; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.b-me-face { width: 56px; height: 56px; border-radius: 10px; background: var(--panel2) center/cover; overflow: hidden; }
.b-me-face img { width: 100%; height: 100%; object-fit: cover; }
.b-me-info { width: 200px; }
.b-me-name { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.b-me-hp { position: relative; }
.bar.hp.big { height: 14px; border: 1px solid #000; }
.b-me-hptxt { font-size: 11px; color: var(--muted); margin-top: 2px; }
.b-skills { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 8px; }
.b-sk { position: relative; width: 84px; padding: 6px 4px; text-align: center; background: #0b0f18cc; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; opacity: .7; }
.b-sk.ready { opacity: 1; border-color: var(--accent); box-shadow: 0 0 10px #ff7a2f55; }
.b-sk .sl { display: block; font-size: 10px; color: var(--muted); }
.b-sk .nm { display: block; font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-sk .ky { display: block; font-size: 10px; color: var(--accent2); margin-top: 2px; }
.b-sk .cd { position: absolute; left: 0; right: 0; bottom: 0; background: #000a; display: flex; align-items: center; justify-content: center; font-weight: 900; }
.b-help { position: absolute; right: 16px; bottom: 16px; font-size: 11px; color: var(--muted); background: #0b0f18aa; padding: 6px 10px; border-radius: 8px; max-width: 280px; line-height: 1.5; text-align: center; }
.b-help p { margin: 1px 0; }
.b-help kbd { font-family: inherit; font-weight: 800; color: #fff; background: #ffffff1a; border-radius: 4px; padding: 0 4px; }
.b-btns { position: absolute; right: 16px; top: 10px; display: flex; gap: 6px; }
.b-banner { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-size: 56px; font-weight: 900; font-style: italic; color: #fff; text-shadow: 0 4px 0 #000, 0 0 20px #000; opacity: 0; transform: scale(.7); transition: .25s; pointer-events: none; }
.b-banner.show { opacity: 1; transform: scale(1); }
.b-banner.win { color: var(--gold); } .b-banner.lose { color: var(--red); }
.b-banner.small { font-size: 30px; }
.b-center-msg { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); font-size: 18px; font-weight: 800; color: #fff; text-shadow: 0 2px 4px #000; text-align: center; width: max-content; max-width: min(92vw, 640px); line-height: 1.45; word-break: keep-all; }
.b-center-msg:empty { display: none; }
.b-modal { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: #000a; pointer-events: auto; }
.b-modal > section { width: min(760px, 94vw); max-height: 86vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.b-modal h3 { margin-bottom: 12px; }
.b-modal footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.b-swap-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.b-swap-grid button { position: relative; background: var(--panel2); border: 2px solid transparent; border-radius: 10px; padding: 6px; font-size: 12px; font-weight: 700; }
.b-swap-grid button img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 4px; }
.b-swap-grid button.on { border-color: var(--accent); }
.b-swap-grid button:hover { border-color: var(--accent2); }
.b-swap-grid .swap-key { position: absolute; left: 6px; top: 6px; background: #000c; border-radius: 4px; padding: 0 5px; font-size: 11px; }
.b-modal .keys { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.b-modal .keys li { display: flex; justify-content: space-between; align-items: center; background: var(--panel2); padding: 6px 10px; border-radius: 8px; }
.b-modal .keys li button { min-width: 90px; padding: 4px 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; font-weight: 700; }
.b-modal .keys li button.wait { border-color: var(--accent); color: var(--accent); animation: blink .8s infinite; }
@keyframes blink { 50% { opacity: .4; } }
.b-modal .combo { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.b-loading { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; background: #0b0f18; color: var(--muted); }
.b-loading .spinner { width: 46px; height: 46px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar.boss { width: 320px; height: 12px; } .bar.boss > i { background: var(--red); }
.sc-red { color: var(--red); font-weight: 900; } .sc-blue { color: var(--blue); font-weight: 900; }
.cp-hud3d { position: absolute; left: 0; right: 0; top: 54px; display: flex; justify-content: space-between; align-items: flex-start; padding: 0 16px; pointer-events: none; z-index: 5; }
.cp-team { display: flex; gap: 6px; }
.cp-team.right { flex-direction: row-reverse; }
.cp-team .cp-mini { width: 64px; background: #0b0f18cc; border: 2px solid var(--line); border-radius: 8px; padding: 3px; font-size: 10px; text-align: center; }
.cp-team .cp-mini img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; display: block; }
.cp-team .cp-mini.cur { border-color: var(--gold); }
.cp-team .cp-mini.ko { opacity: .35; filter: grayscale(1); }
.cp-round3d { font-weight: 900; font-size: 20px; color: var(--gold); text-shadow: 0 2px 0 #000; }
.cp-intro3d { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; gap: 40px; background: #000c; }
.cp-intro3d .cp-side { display: flex; gap: 8px; }
.cp-intro3d .cp-side img { width: 90px; height: 90px; border-radius: 10px; object-fit: cover; }

/* ===== 생존 전략 ===== */
.survival .gt-center { display: flex; gap: 16px; align-items: center; }
#sv-money { color: var(--gold); font-weight: 800; }
#sv-money .sv-raid { color: var(--ok); font-style: normal; font-size: 13px; margin-left: 6px; }
#sv-goal { font-size: 14px; color: var(--text); }
.sv-prompt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 6; background: #0b0f18e0; border: 1px solid var(--accent); border-radius: 10px; padding: 8px 16px; font-weight: 800; pointer-events: none; }
.sv-prompt small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.sv-prompt kbd, .sv-side kbd { background: var(--accent); color: #000; border-radius: 4px; padding: 1px 6px; margin-right: 6px; font-weight: 900; font-family: inherit; }
.sv-side { position: absolute; left: 16px; top: 58px; z-index: 5; display: flex; flex-direction: column; gap: 4px; background: #0b0f18cc; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; pointer-events: none; }
.sv-side small { color: var(--muted); margin-top: 2px; }
.sv-side kbd { background: var(--panel2); color: var(--text); margin-right: 2px; }
.b-tag.npc { color: #ffe9a8; } .b-tag.npc .hp { display: none; }
.b-tag.enemy { color: #ffb0a8; } .b-tag.enemy .hp > i { background: var(--red); }
.b-float.burn { color: #ff8a3a; font-size: 14px; }
.sv-modal > section.wide { width: min(880px, 95vw); }
.sv-modal h3.lose { color: var(--red); }
.sv-modal h4 { margin: 14px 0 6px; font-size: 14px; color: var(--accent2); }
.sv-wallet { color: var(--gold); font-weight: 800; margin-bottom: 8px; }
.sv-msg { background: #3fd07a22; border: 1px solid #3fd07a66; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-size: 13px; }
.sv-note { font-size: 12px; color: var(--muted); margin: 6px 0; }
.sv-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sv-item { display: flex; align-items: center; gap: 10px; background: var(--panel2); border-radius: 8px; padding: 8px 10px; }
.sv-item > i { width: 30px; height: 30px; display: grid; place-items: center; background: var(--bg2); border-radius: 6px; color: var(--accent2); flex: none; }
.sv-item > div { flex: 1; min-width: 0; }
.sv-item b { display: block; font-size: 14px; }
.sv-item small { display: block; font-size: 11px; color: var(--muted); line-height: 1.35; }
.sv-item .btn { flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.sv-item .btn small { font-size: 10px; color: inherit; opacity: .8; }
.sv-item .hero-img { border-radius: 6px; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.sv-empty { color: var(--muted); font-size: 13px; padding: 8px; list-style: none; }
.sv-eq { font-style: normal; font-size: 10px; background: var(--ok); color: #000; border-radius: 4px; padding: 0 5px; margin-right: 4px; vertical-align: middle; }
.sv-max { color: var(--gold); font-weight: 900; }
.sv-bag-up { background: var(--panel2); border-radius: 8px; padding: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sv-inv { display: grid; grid-template-columns: 1fr 1.6fr; gap: 16px; }
.sv-inv .sv-list { grid-template-columns: 1fr; }
.sv-slots { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sv-slots li { display: flex; align-items: center; gap: 8px; background: var(--panel2); padding: 8px 10px; border-radius: 8px; }
.sv-slots li b { flex: 1; } .sv-slots li em { flex: 1; color: var(--muted); font-size: 12px; }
.sv-slot-n { width: 72px; font-size: 12px; color: var(--muted); }
.sv-stat { font-size: 12px; color: var(--accent2); margin-top: 8px; }
.sv-report { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.sv-report li { display: flex; justify-content: space-between; gap: 12px; background: var(--panel2); padding: 8px 12px; border-radius: 8px; }
.sv-report li b { text-align: right; }
.sv-maps { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.sv-maps li { display: flex; align-items: center; gap: 14px; background: var(--panel2); border-left: 4px solid var(--mc); border-radius: 10px; padding: 12px 14px; }
.sv-maps li > div:nth-child(2) { flex: 1; }
.sv-maps li small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.5; }
.sv-maps li.locked { opacity: .55; }
.sv-map-ico { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--mc) 30%, transparent); color: var(--mc); }
.sv-diff { color: var(--gold); font-size: 12px; }
@media (max-width: 760px) { .sv-list, .sv-inv { grid-template-columns: 1fr; } }

/* ===== 용병 단축키 바 / 톱니바퀴 ===== */
.b-gear-btn { width: 36px; height: 36px; border-radius: 50%; background: #0b0f18cc; border: 1px solid var(--line); color: var(--text); font-size: 17px; display: grid; place-items: center; transition: transform .3s, border-color .2s; }
.b-gear-btn:hover { transform: rotate(90deg); border-color: var(--accent); color: var(--accent); }
.b-slots { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); display: flex; gap: 4px; pointer-events: auto; }
.b-slot { position: relative; width: 42px; height: 42px; border-radius: 8px; background: #0b0f18cc; border: 2px solid var(--line); display: grid; place-items: center; padding: 0; overflow: hidden; }
.b-slot .hero-img { width: 34px !important; height: 34px !important; border: 0 !important; border-radius: 5px; }
.b-slot kbd { position: absolute; left: 1px; top: 0; z-index: 1; font-size: 10px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px #000; font-family: inherit; }
.b-slot.on { border-color: var(--gold); box-shadow: 0 0 8px #ffcf4a88; }
.b-slot.rsv { border-color: #6ad8ff; box-shadow: 0 0 10px #6ad8ffaa; animation: rsvBlink .6s ease-in-out infinite alternate; }
.b-slot.rsv::after { content: '예약'; position: absolute; bottom: 0; left: 0; right: 0; font-size: 9px; font-weight: 900; background: #1a6a9acc; color: #fff; line-height: 12px; }
.b-swap-grid button.rsv { border-color: #6ad8ff; box-shadow: 0 0 10px #6ad8ffaa; }
@keyframes rsvBlink { from { opacity: 1; } to { opacity: .6; } }
.b-slot.empty { opacity: .45; color: var(--muted); font-size: 12px; }
.b-slot:hover { border-color: var(--accent); }
.slot-cfg .slot-list { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.slot-cfg .slot-list li button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; background: var(--panel2); border: 2px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 700; min-height: 86px; justify-content: center; }
.slot-cfg .slot-list li button kbd { background: var(--accent); color: #000; border-radius: 4px; padding: 0 7px; font-weight: 900; font-family: inherit; }
.slot-cfg .slot-list li.picking button { border-color: var(--accent); }
.slot-cfg .slot-list li button:hover { border-color: var(--accent2); }
.slot-cfg .muted { color: var(--muted); font-weight: 400; }
.slot-pick p { margin-bottom: 8px; font-size: 13px; }
.slot-pick kbd { background: var(--accent); color: #000; border-radius: 4px; padding: 0 6px; font-family: inherit; font-weight: 900; }
.b-swap-grid button.clear { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }
.b-swap-grid button.clear i { font-size: 22px; }
.b-swap-grid button span kbd { background: var(--accent); color: #000; border-radius: 3px; padding: 0 4px; margin-right: 4px; font-family: inherit; }
@media (max-width: 760px) { .slot-cfg .slot-list { grid-template-columns: repeat(5, 1fr); } .b-slot { width: 34px; height: 34px; } }
.slot-cfg { width: min(820px, 95vw) !important; }
.slot-cfg h3 small { margin-left: 6px; font-size: 12px; }
.slot-pick .b-swap-grid { grid-template-columns: repeat(9, 1fr); }
.slot-pick .b-swap-grid button { font-size: 11px; }
@media (max-width: 760px) { .slot-pick .b-swap-grid { grid-template-columns: repeat(5, 1fr); } }
.classic .gt-actions { margin-right: 150px; }
.b-btns { align-items: center; }

/* ===== 오토체스 3D 판 ===== */
.autochess { height: 100vh; overflow: hidden; }
.autochess .ac-main { min-height: 0; grid-template-columns: 220px 1fr 220px; }
.autochess .ac-center { min-height: 0; gap: 8px; }
.ac-arena { position: relative; flex: 1; width: 100%; min-height: 300px; border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #2a3654, #121826); border: 1px solid var(--line); }
.chess-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.chess-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.ac-drop { position: absolute; inset: 0; z-index: 3; }
.ac-drop .cell { position: absolute; background: transparent; border: 1px solid transparent; border-radius: 6px; }
.ac-drop .cell .unit { width: 100%; height: 100%; display: grid; place-items: end center; opacity: 0; }
.ac-drop .cell .unit .hero-img { width: 24px !important; height: 24px !important; opacity: .0; }
.ac-drop .cell:hover { border-color: #ffd36a88; background: #ffd36a14; }
.dragging .ac-drop .cell { border-color: #ffd36a55; background: #ffd36a10; }
.ac-drop.locked { pointer-events: none; }
.ac-drop .cell .unit .stars { display: none; }
.cu-tag { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.cu-tag .st { font-size: 9px; color: #c98a4b; text-shadow: 0 1px 2px #000; line-height: 1; }
.cu-tag .hp, .cu-tag .mp { display: block; width: 40px; height: 5px; background: #000b; border-radius: 2px; overflow: hidden; }
.cu-tag .mp { height: 3px; }
.cu-tag .hp > i, .cu-tag .mp > i { display: block; height: 100%; }
.cu-tag.me .hp > i { background: var(--ok); } .cu-tag.en .hp > i { background: var(--red); }
.cu-tag .mp > i { background: #4aa3ff; }
.cu-tag.sh .hp { box-shadow: 0 0 0 1px #fff; }
.ac-vs { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 4; background: #0b0f18cc; border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; font-size: 13px; text-align: center; white-space: nowrap; }
.ac-vs b.pvp { color: #ff8ad8; }
.ac-vs small { display: block; color: var(--muted); font-size: 11px; }
.autochess .ac-cap { top: 10px; right: 10px; left: auto; z-index: 4; }
.ac-ready { position: absolute; right: 12px; bottom: 12px; z-index: 4; background: var(--accent); color: #000; font-weight: 900; padding: 10px 18px; border-radius: 10px; box-shadow: 0 4px 0 #a34d10; }
.ac-ready:hover { filter: brightness(1.1); }
.ac-speed { position: absolute; right: 12px; bottom: 12px; z-index: 4; display: flex; gap: 4px; }
.ac-speed button { background: #0b0f18cc; border: 1px solid var(--line); padding: 5px 10px; border-radius: 6px; font-weight: 800; font-size: 12px; }
.ac-speed button.on { border-color: var(--accent); color: var(--accent); }
.ac-phase.pvp { background: #ff8ad833; color: #ff8ad8; }
.ac-banner { position: absolute; top: 38%; left: 0; right: 0; text-align: center; z-index: 5; font-size: 44px; font-weight: 900; font-style: italic; color: #fff; text-shadow: 0 4px 0 #000, 0 0 18px #000; pointer-events: none; animation: acb 1.8s forwards; }
.ac-banner.win { color: var(--gold); } .ac-banner.lose { color: var(--red); font-size: 34px; } .ac-banner.pvp { color: #ff8ad8; }
@keyframes acb { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.autochess .ac-bench { grid-template-columns: repeat(9, 58px); }
.autochess .ac-bench .cell { width: 58px; height: 58px; }
.autochess .ac-bench .hero-img { width: 48px !important; height: 48px !important; }
.ac-log { list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.ac-log li { padding: 3px 6px; border-radius: 5px; background: var(--bg2); }
.ac-log li.win { color: var(--ok); } .ac-log li.lose { color: var(--red); } .ac-log li.out { color: var(--muted); text-decoration: line-through; }
.ac-syn h4.mt { margin-top: 12px; }
.ac-rule { font-size: 11px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.ac-out-msg { color: var(--muted); }
.autochess .shop-card:disabled { opacity: .5; }
@media (max-width: 1000px) { .autochess .ac-main { grid-template-columns: 1fr; overflow: auto; } .ac-arena { min-height: 360px; } }
/* 오토체스: 하단 상점 바는 항상 3열 유지 (판·대기석 가림 방지) */
.autochess { display: flex; flex-direction: column; }
.autochess .ac-main { flex: 1; min-height: 0; }
.autochess .ac-center { display: flex; flex-direction: column; }
.autochess .ac-shopbar { grid-template-columns: 180px 1fr 150px; gap: 10px; padding: 8px 10px; flex-shrink: 0; }
.autochess .ac-shop .shop-card { min-height: 0; padding: 6px; }
.autochess .ac-shop .shop-card .hero-img { width: 44px !important; height: 44px !important; }
@media (max-width: 1100px) { .autochess .ac-main { grid-template-columns: 170px 1fr 170px; } .autochess .ac-bench { grid-template-columns: repeat(9, 48px); } .autochess .ac-bench .cell { width: 48px; height: 48px; } .autochess .ac-bench .hero-img { width: 40px !important; height: 40px !important; } }
@media (max-width: 800px) { .autochess { height: auto; overflow: auto; } .autochess .ac-main { grid-template-columns: 1fr; } .autochess .ac-shopbar { grid-template-columns: 1fr; } }
.ac-speed[hidden], .ac-ready[hidden] { display: none !important; }
.autochess .pl { grid-template-columns: 1fr 34px 26px; }

/* ===== 챔피언 토너먼트 대진표 ===== */
.cp-bracket { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; background: radial-gradient(circle at 50% 30%, #2b2a1a, #0e1018); }
.cp-bracket h3 { font-size: 24px; color: var(--gold); } .cp-bracket h3 small { font-size: 13px; color: var(--muted); margin-left: 6px; }
.bk-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 180px)); gap: 18px; align-items: stretch; }
.bk-col { display: flex; flex-direction: column; }
.bk-col h5 { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bk-col ul { list-style: none; flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 6px; }
.bk-p { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; min-height: 36px; }
.bk-p span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-p.me { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.bk-p.lost { opacity: .4; text-decoration: line-through; }
.bk-p.hl { border-color: var(--gold); background: #3a3214; }
.bk-col.r3 .bk-p { border-color: var(--gold); font-weight: 900; font-size: 15px; background: #3a3214; }
.bk-prize { list-style: none; display: flex; gap: 10px; font-size: 13px; }
.bk-prize li { background: var(--bg2); border-radius: 8px; padding: 6px 12px; } .bk-prize li b { margin-right: 6px; color: var(--muted); }
.bk-prize li.p1 { color: var(--gold); font-weight: 900; border: 1px solid var(--gold); } .bk-prize li.p1 b { color: var(--gold); }
.bk-msg { font-size: 16px; min-height: 22px; text-align: center; } .bk-msg .lose { color: var(--red); } .bk-msg .win { color: var(--gold); }
.cp-vs.big small { display: block; font-size: 16px; font-style: normal; color: #fff; text-shadow: none; }
.tourney-note { font-size: 13px; background: #3a321466; border: 1px solid #e8b33d66; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.tourney-note b { color: var(--gold); }
.result-prize { color: var(--gold); font-weight: 800; }

/* ===== 관전 ===== */
.spec-bar { position: fixed; top: 52px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 8px; background: #0b0f18e0; border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 12px; }
.spec-bar .spec-n.off { color: var(--muted); }
.spec-bar .spec-live { color: #ff6b6b; font-weight: 900; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .45; } }
.st-spec { display: inline-flex; gap: 3px; align-items: center; margin-left: 6px; font-size: 11px; color: #8ad3ff; }
.st-spec.full { color: var(--red); } .st-spec.off { color: var(--muted); }
.is-spec .ac-shopbar, .is-spec .ac-bench, .is-spec .ac-ready, .is-spec .dev-win, .is-spec .dev-lose { pointer-events: none; }
.is-spec .ac-shopbar { opacity: .55; }
@media (max-width: 900px) { .bk-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; } .bk-p span { display: none; } }
.is-spec .b-hud, .is-spec .b-btns, .is-spec .b-slots, .is-spec .b-swap-btn, .is-spec .b-gear-btn, .is-spec .dev-win, .is-spec .dev-lose { display: none !important; }
/* 탄약 / 콤보 */
.b-ammo { display: flex; align-items: center; gap: 3px; margin-top: 4px; }
.b-ammo i { width: 6px; height: 14px; border-radius: 2px; background: #ffffff22; border: 1px solid #ffffff33; }
.b-ammo i.on { background: linear-gradient(#ffe58a, #c99a2b); border-color: #ffd36a; }
.b-ammo b { font-size: 11px; margin-left: 4px; } .b-ammo em { font-size: 11px; color: var(--red); font-style: normal; margin-left: 6px; }
.b-ammo em.rl { color: #ffd36a; margin: 0; animation: blink .6s infinite; }
.b-float.combo { color: #ffd36a; font-size: 15px; font-weight: 900; font-style: italic; text-shadow: 0 2px 0 #000; }
/* 로비: 4개 모드 균일한 가로 4칸 */
#mode-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
#mode-cards .mode-card { min-height: 0; }
#mode-cards .mode-card > div { flex: 1; display: flex; flex-direction: column; gap: 6px; }
#mode-cards .mode-card p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#mode-cards .mode-card .mode-subs { display: flex; -webkit-line-clamp: unset; margin-top: auto; }
#mode-cards .mode-card .quick { margin-top: auto; width: 100%; }
@media (max-width: 1100px) { #mode-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { #mode-cards { grid-template-columns: 1fr; } }
/* 생존 상점: 페소 구매 */
.sv-buy2 { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.btn-peso { background: linear-gradient(#b48aff, #7a4ae8); color: #fff; border: 0; }
.btn-peso:disabled { opacity: .4; }
.sv-peso { color: #c9a8ff; }
.btn-peso { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.b-float.down { color: #fff2c8; font-size: 17px; font-weight: 900; font-style: italic; text-shadow: 0 2px 0 #7a4a00, 0 0 6px #000; }
.b-ammo[hidden] { display: none !important; }

/* ===== 모바일 · 태블릿 ===== */
html, body { -webkit-tap-highlight-color: transparent; }
body.touch .g3d, body.touch .b-stage { touch-action: none; -webkit-user-select: none; user-select: none; }
.m-ctrl { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.m-ctrl button, .m-joy { pointer-events: auto; touch-action: none; }
.m-joy { position: absolute; left: 0; bottom: 0; width: 42%; height: 62%; }
.m-joy-base { position: absolute; left: 110px; top: calc(100% - 120px); width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; background: radial-gradient(#ffffff18, #ffffff08 70%); border: 2px solid #ffffff40; opacity: .55; transition: opacity .15s; }
.m-joy-base.on { opacity: 1; }
.m-joy-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #c9d4ea); box-shadow: 0 3px 10px #0008; }
.m-pad { position: absolute; right: 18px; bottom: 18px; width: 210px; height: 190px; }
.m-btn { position: absolute; border-radius: 50%; border: 2px solid #ffffff55; color: #fff; font-weight: 900; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; box-shadow: 0 4px 0 #0007; backdrop-filter: blur(2px); }
.m-btn small { font-size: 9px; font-weight: 600; opacity: .8; }
.m-btn.on { transform: scale(.92); filter: brightness(1.3); }
.m-d { right: 0; bottom: 0; width: 98px; height: 98px; background: #e8503acc; font-size: 28px; }
.m-d small { font-size: 9px; margin-top: 2px; }
.m-a { right: 36px; bottom: 110px; width: 54px; height: 54px; background: #3a8ae8cc; font-size: 12px; }   /* · 173 점프: 공격 위 · 작게 */
.m-s { right: 104px; bottom: 6px; width: 66px; height: 66px; background: #5a6a88cc; }   /* · 173 방어: 공격 왼쪽 */
.m-top { position: absolute; right: 12px; top: 60px; display: flex; gap: 6px; }
.m-top button { height: 38px; padding: 0 12px; border-radius: 19px; background: #0b0f18d0; border: 1px solid var(--line); color: var(--text); font-weight: 800; font-size: 13px; }
.m-auto.on { background: linear-gradient(#5fd46a, #2e9a3a); border-color: #8ff09a; color: #fff; animation: autoGlow 1.4s infinite; }
@keyframes autoGlow { 50% { box-shadow: 0 0 14px #5fd46a; } }
.m-rotate { display: none; }
body.touch .b-help, body.touch .b-btns kbd, body.touch .b-swap-btn kbd { display: none; }
body.touch .b-sk { pointer-events: auto; cursor: pointer; opacity: .85; }
body.touch .b-sk.ready { opacity: 1; }
body.touch .b-sk .ky { display: none; }
body.touch .b-skills { left: auto; right: 236px; transform: none; bottom: 18px; flex-wrap: wrap; width: 176px; gap: 6px; }
body.touch .b-sk { width: 84px; padding: 8px 4px; }
body.touch .b-slots { bottom: auto; top: 54px; left: 12px; transform: none; flex-wrap: wrap; max-width: 50%; }
body.touch .b-me { left: 12px; bottom: auto; top: 102px; padding: 6px 10px; transform-origin: left top; }
body.touch .auto-on .m-joy, body.touch .auto-on .m-pad { opacity: .35; }
body.touch .sv-prompt { bottom: 220px; }
body.touch .champion.g3d .b-btns, body.touch .champion .m-top { top: 100px; }

/* 작은 화면 (휴대폰) */
@media (max-width: 900px), (max-height: 500px) {
  .game-top { padding: 6px 10px; gap: 8px; flex-wrap: wrap; }
  .gt-center { font-size: 12px; gap: 8px; } .gt-center b { font-size: 15px; }
  .gt-mode { font-size: 13px; }
  .gt-actions .btn { padding: 5px 8px; font-size: 12px; }
  body.touch .b-skills { right: 196px; width: 150px; }
  body.touch .b-sk { width: 72px; padding: 6px 2px; } body.touch .b-sk .nm { font-size: 11px; }
  .m-pad { transform: scale(.85); transform-origin: right bottom; }
  body.touch .b-me { transform: scale(.8); }
  .b-me-face .hero-img { width: 40px !important; height: 40px !important; }
  .b-slot { width: 32px; height: 32px; }
  .b-banner { font-size: 26px !important; }
  .b-tag { font-size: 10px; }
}
@media (max-height: 430px) {
  body.touch .b-skills { bottom: 8px; }
  .m-pad { transform: scale(.72); }
  .m-joy-base { top: calc(100% - 90px); }
  body.touch .b-me { top: 88px; transform: scale(.68); }
}
/* 모바일 세로: 위 = 게임 화면(맵 전체 보기), 아래 = 조작 콘솔 (아래에서부터 줄 단위 배치) */
html.m-portrait { --mb: calc(46px + env(safe-area-inset-bottom, 0px)); }   /* 조작 버튼을 휴대폰 하단 바 위로 올림 */
html.m-portrait .g3d { height: var(--app-h, 100dvh); }
html.m-portrait .g3d .b-stage { flex: 0 0 auto; height: min(46dvh, 100vw); }
html.m-portrait .g3d::after { content: ''; flex: 1; background: linear-gradient(#141a28, #0b0f18); border-top: 1px solid var(--line); }
html.m-portrait .game-top { flex-wrap: wrap; row-gap: 2px; padding: 4px 8px; }
html.m-portrait .gt-center { order: 3; flex-basis: 100%; }
html.m-portrait .dev-win, html.m-portrait .dev-lose { display: none; }
html.m-portrait .classic .gt-actions { margin-right: 0; }
html.m-portrait .spec-bar { top: 64px; bottom: auto; transform: translateX(-50%) scale(.8); }
/* 1줄: 조이스틱 + 버튼 */
html.m-portrait .m-joy { width: 52%; height: 190px; top: auto; bottom: 0; }
html.m-portrait .m-joy-base { left: 50%; top: 52%; }
html.m-portrait .m-pad { right: 8px; bottom: calc(var(--mb) + 8px); transform: scale(.82); transform-origin: right bottom; }
/* 2줄: 스킬 4개 */
html.m-portrait body.touch .b-skills { left: 8px; right: 8px; width: auto; bottom: calc(var(--mb) + 178px); top: auto; justify-content: center; flex-wrap: nowrap; gap: 5px; }
html.m-portrait body.touch .b-sk { flex: 1; width: auto; padding: 6px 2px; }
/* 3줄: 용병 교체 1~0 */
html.m-portrait body.touch .b-slots { left: 8px; right: 8px; top: auto; bottom: calc(var(--mb) + 232px); max-width: none; transform: none; justify-content: center; flex-wrap: nowrap; gap: 3px; }
html.m-portrait body.touch .b-slot { width: 32px; height: 32px; flex: 0 0 32px; }
/* 4줄: 내 체력(왼쪽) + 자동/전체화면/교체/설정(오른쪽) */
html.m-portrait body.touch .b-me { top: auto; bottom: calc(var(--mb) + 272px); left: 8px; transform: none; padding: 4px 8px; width: 44%; }
html.m-portrait body.touch .b-me-face { display: none; }
html.m-portrait body.touch .b-me-info { flex: 1; min-width: 0; }
html.m-portrait body.touch .b-me .bar.big { width: 100%; }
html.m-portrait .m-top { top: auto; bottom: calc(var(--mb) + 274px); right: 8px; gap: 4px; }
html.m-portrait .m-top button { height: 34px; padding: 0 10px; font-size: 12px; }
html.m-portrait .b-btns { top: auto; bottom: calc(var(--mb) + 312px); right: 8px; left: auto; transform: none; }
html.m-portrait .b-swap-btn { font-size: 11px; padding: 4px 8px; }
html.m-portrait .cp-hud3d { transform: scale(.8); transform-origin: top center; }
html.m-portrait .sv-side { transform: scale(.78); transform-origin: top left; }
html.m-portrait body.touch .sv-prompt { bottom: calc(var(--mb) + 316px); }
html.m-portrait .b-banner { top: 18% !important; font-size: 24px !important; }
html.m-portrait .b-center-msg { top: 30%; font-size: 13px; }
/* 키가 작은 휴대폰 */
@media (max-height: 720px) {
  html.m-portrait .g3d .b-stage { height: min(40dvh, 100vw); }
  html.m-portrait .m-pad { transform: scale(.7); }
  html.m-portrait .m-joy { height: 160px; }
  html.m-portrait body.touch .b-skills { bottom: calc(var(--mb) + 150px); } html.m-portrait body.touch .b-sk .sl { display: none; }
  html.m-portrait body.touch .b-slots { bottom: calc(var(--mb) + 194px); }
  html.m-portrait body.touch .b-me { bottom: calc(var(--mb) + 232px); } html.m-portrait .m-top { bottom: calc(var(--mb) + 234px); }
  html.m-portrait .b-btns { bottom: calc(var(--mb) + 270px); }
}
@keyframes fadeHint { 80% { opacity: 1; } 100% { opacity: 0; } }
/* 일반 화면 모바일 레이아웃 */
@media (max-width: 640px) {
  #top-bar { padding: 10px 12px; } .nav-btn { padding: 6px 8px; font-size: 12px; }
  #lobby { padding: 10px; gap: 10px; }
  .mode-card { padding: 14px; } .mode-card h2 { font-size: 18px; } .mode-ico { font-size: 64px; }
  .panel-head { flex-wrap: wrap; gap: 8px; } .tabs { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
  .b-modal section { max-width: 96vw; max-height: 88vh; overflow: auto; padding: 14px; }
  .b-swap-grid { grid-template-columns: repeat(4, 1fr) !important; }
  .result { width: 94vw; padding: 18px; }
  .autochess .unit.sel { outline: 3px solid var(--gold); border-radius: 8px; }
}
.autochess .unit.sel { outline: 3px solid var(--gold); border-radius: 8px; }
body.touch button, body.touch .btn { min-height: 34px; }

/* ===== 대기방 · 방 만들기: 모바일 화면 폭에 맞춤 ===== */
#waiting-room > *, #lobby > * { min-width: 0; }
/* 모바일 판정은 JS가 html.mobile 클래스로 고정 (갤럭시 퀀텀4 등 384px 폭 기준) — 화면 확대/축소로 레이아웃이 바뀌지 않음 */
html.mobile, html.mobile body { overflow-x: hidden; }
html.mobile #top-bar { gap: 8px; padding: 8px 12px; }
html.mobile #top-bar h2 { font-size: 14px; }
html.mobile #waiting-room { display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 84px; }
html.mobile #slot-panel { order: 1; min-height: 0; padding: 10px; }
html.mobile #loadout { order: 2; padding: 12px; }
html.mobile #room-side { order: 3; gap: 10px; }
html.mobile #room-chat .chat-log { max-height: 160px; min-height: 90px; }
html.mobile #room-controls { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)); background: #0b0f18f2; border-top: 1px solid var(--line); justify-content: stretch; gap: 6px; backdrop-filter: blur(6px); }
html.mobile #room-controls .btn { flex: 1; padding: 11px 6px; font-size: 13px; white-space: nowrap; justify-content: center; }
html.mobile #room-controls .btn-start { flex: 1.6; }
html.mobile .slots.team { grid-template-columns: 1fr; gap: 6px; }
html.mobile .slots.team .vs { padding: 0; font-size: 14px; }
html.mobile .slots.team .team-col ul, html.mobile .slots.solo ul { grid-template-columns: 1fr 1fr; gap: 6px; }
html.mobile .slot { min-height: 58px; padding: 7px; gap: 6px; flex-wrap: wrap; }
html.mobile .slot .hero-img { width: 38px !important; height: 38px !important; }
html.mobile .slot-trio .hero-img { width: 26px !important; height: 26px !important; }
html.mobile .slot-trio { flex-basis: 100%; }
html.mobile .slot-info b { font-size: 13px; }
html.mobile .slot-info small { font-size: 11px; }
html.mobile .slot-state { position: absolute; right: 6px; top: 4px; font-size: 11px; }
html.mobile .slot.empty { min-height: 58px; font-size: 12px; }
html.mobile .hero-grid { grid-template-columns: repeat(5, 1fr); gap: 4px; }
html.mobile .hg-item { font-size: 10px; padding: 4px 1px; }
html.mobile .hg-item .hero-img { width: 42px !important; height: 42px !important; }
html.mobile .hero-detail { flex-direction: column; gap: 8px; font-size: 12px; }
html.mobile .trio-slots { gap: 6px; flex-wrap: wrap; }
html.mobile .trio-slot { width: calc(33% - 6px); height: 96px; }
html.mobile .trio-slot .hero-img { width: 48px !important; height: 48px !important; }
html.mobile #trio-random { flex-basis: 100%; }
html.mobile .ri-opts { font-size: 13px; }
html.mobile .ri-opts li { gap: 10px; }
html.mobile .ri-opts li > :last-child { text-align: right; }
html.mobile .guide-list { grid-template-columns: 1fr; }
html.mobile .modal, html.mobile .modal.wide { width: 100vw; max-width: 100vw; max-height: 92dvh; border-radius: 16px 16px 0 0; align-self: end; }
html.mobile .modal-back { place-items: end center; }
html.mobile .modal-body { padding: 12px; }
html.mobile .mode-pick { grid-template-columns: repeat(2, 1fr); gap: 6px; }
html.mobile .mode-pick-btn { padding: 10px 4px; }
html.mobile .mode-pick-btn i { font-size: 20px; }
html.mobile .mode-pick-btn b { font-size: 13px; }
html.mobile .field { margin-bottom: 12px; }
html.mobile .chip { padding: 8px 11px; font-size: 13px; }
html.mobile .modal-foot { position: sticky; bottom: 0; background: var(--panel); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
html.mobile .modal-foot .btn { flex: 1; justify-content: center; }
html.mobile .slots ul, html.mobile .slots.team .team-col ul { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
html.mobile .slot { min-width: 0; overflow: hidden; }
html.mobile .slot.empty .add-bot { padding: 4px 10px; font-size: 11px; white-space: nowrap; }
html.mobile .slot.empty span { white-space: nowrap; }
html.mobile #slot-panel, html.mobile #room-side, html.mobile #loadout, html.mobile .panel { max-width: 100%; overflow: hidden; }
html.mobile body { width: 100vw; overflow-x: hidden; }

/* ===== 모바일 세로 v2: 스킬 글자 축소 · 조이스틱/버튼 더 위로 · 게임 화면은 남는 높이만큼 ===== */
html.m-portrait { --mb: calc(58px + env(safe-area-inset-bottom, 0px)); --console: 322px; }
html.m-portrait .g3d .b-stage { flex: 1 1 auto; height: auto; min-height: 220px; }
html.m-portrait .g3d::after { flex: 0 0 calc(var(--mb) + var(--console)); }
/* 1줄: 조이스틱 + 버튼 (위로) */
html.m-portrait .m-joy { height: 176px; bottom: calc(var(--mb) + 18px); }
html.m-portrait .m-joy-base { top: 50%; transform: scale(.9); }
html.m-portrait .m-pad { bottom: calc(var(--mb) + 30px); transform: scale(.74); }
/* 2줄: 스킬 (작은 글자) */
html.m-portrait body.touch .b-skills { bottom: calc(var(--mb) + 182px); gap: 4px; }
html.m-portrait body.touch .b-sk { padding: 4px 2px; border-radius: 8px; }
html.m-portrait body.touch .b-sk .sl { font-size: 8.5px; line-height: 1.1; }
html.m-portrait body.touch .b-sk .nm { font-size: 10.5px; line-height: 1.25; }
/* 3줄: 용병 1~0 */
html.m-portrait body.touch .b-slots { bottom: calc(var(--mb) + 224px); }
/* 4줄: 체력 + 버튼들 한 줄 */
html.m-portrait body.touch .b-me { bottom: calc(var(--mb) + 264px); width: 40%; }
html.m-portrait body.touch .b-me-name { font-size: 12px; }
html.m-portrait .m-top { bottom: calc(var(--mb) + 268px); }
html.m-portrait .b-btns { bottom: calc(var(--mb) + 268px); right: 112px; top: auto; }
html.m-portrait .b-swap-btn { width: 34px; height: 34px; padding: 0; font-size: 0; justify-content: center; }
html.m-portrait .b-swap-btn i { font-size: 14px; }
html.m-portrait .b-gear-btn { width: 34px; height: 34px; }
html.m-portrait body.touch .sv-prompt { bottom: calc(var(--mb) + 330px); }
@media (max-height: 720px) {
  html.m-portrait { --console: 300px; }
  html.m-portrait .m-pad { transform: scale(.66); bottom: calc(var(--mb) + 24px); }
  html.m-portrait .m-joy { height: 150px; }
  html.m-portrait body.touch .b-skills { bottom: calc(var(--mb) + 162px); }
  html.m-portrait body.touch .b-slots { bottom: calc(var(--mb) + 202px); }
  html.m-portrait body.touch .b-me { bottom: calc(var(--mb) + 242px); }
  html.m-portrait .m-top, html.m-portrait .b-btns { bottom: calc(var(--mb) + 246px); }
}

/* 오토체스 4성 */
.unit.star4 .stars { color: #ff7ae0; text-shadow: 0 0 6px #ff4ad0, 0 1px 2px #000; } .unit.star4 .hero-img { box-shadow: 0 0 16px #ff4ad0, 0 0 4px #fff; }
.cu-tag.s2 .st { color: #dfe6f2; } .cu-tag.s3 .st { color: var(--gold); } .cu-tag.s4 .st { color: #ff7ae0; text-shadow: 0 0 5px #ff4ad0; }
body.touch .sv-prompt { pointer-events: auto; cursor: pointer; }
body.touch .sv-prompt:active { transform: translateX(-50%) scale(.96); }

/* ===== 모바일 오토체스 (세로 384px 기준): 판 = 화면 폭 정사각형, 나머지는 압축 ===== */
html.mobile .autochess { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
html.mobile .autochess .ac-main { display: flex; flex-direction: column; gap: 4px; padding: 4px; min-height: 0; flex: 1; overflow: hidden; }
html.mobile .autochess .ac-center { order: 2; gap: 4px; flex: 1; min-height: 0; width: 100%; }
html.mobile .autochess .ac-arena { flex: 0 0 auto; width: 100%; aspect-ratio: 1 / 1.02; max-height: calc(100dvh - 330px); min-height: 0; margin: 0 auto; border-radius: 10px; }
html.mobile .autochess .ac-vs { top: 4px; padding: 3px 8px; font-size: 11px; max-width: 62%; }
html.mobile .autochess .ac-vs small { font-size: 9.5px; }
html.mobile .autochess .ac-cap { top: 4px; right: 4px; font-size: 11px; padding: 2px 7px; }
html.mobile .autochess .ac-ready { right: 6px; bottom: 6px; padding: 7px 12px; font-size: 13px; }
html.mobile .autochess .ac-speed { right: 6px; bottom: 6px; }
html.mobile .autochess .ac-banner { font-size: 30px; }
/* 시너지: 가로 스크롤 한 줄 */
html.mobile .autochess .ac-syn { order: 1; display: flex; gap: 4px; overflow-x: auto; padding: 4px; min-height: 0; flex: 0 0 auto; white-space: nowrap; border-radius: 8px; }
html.mobile .autochess .ac-syn h4, html.mobile .autochess .ac-syn .ac-log, html.mobile .autochess .ac-syn p { display: none; }
html.mobile .autochess .ac-syn .syn { display: inline-flex; gap: 4px; margin: 0; padding: 3px 7px; font-size: 11px; flex: 0 0 auto; }
html.mobile .autochess .ac-syn .syn span { display: none; }
html.mobile .autochess .ac-syn .syn:not(.on) { display: none; }
html.mobile .autochess .ac-syn:not(:has(.syn.on)) { display: none; }
/* 생존자: 가로 한 줄 */
html.mobile .autochess .ac-players { order: 3; display: flex; gap: 4px; overflow-x: auto; padding: 4px; flex: 0 0 auto; border-radius: 8px; }
html.mobile .autochess .ac-players h4, html.mobile .autochess .ac-players .ac-rule { display: none; }
html.mobile .autochess .ac-players .pl { flex: 0 0 auto; grid-template-columns: auto 26px; margin: 0; padding: 3px 7px; font-size: 11px; max-width: 120px; }
html.mobile .autochess .ac-players .pl .bar { display: none; }
/* 대기석: 9칸 한 줄 */
html.mobile .autochess .ac-bench { width: 100%; grid-template-columns: repeat(9, 1fr); gap: 3px; padding: 3px; }
html.mobile .autochess .ac-bench .cell { width: auto; height: auto; aspect-ratio: 1; }
html.mobile .autochess .ac-bench .hero-img { width: 30px !important; height: 30px !important; }
/* 상점 바 */
html.mobile .autochess .ac-shopbar { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "left right" "shop shop"; gap: 4px 6px; padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px)); }
html.mobile .autochess .ac-left { grid-area: left; gap: 3px; }
html.mobile .autochess .ac-right { grid-area: right; display: grid; grid-template-columns: auto 1fr; gap: 3px 6px; align-items: center; }
html.mobile .autochess .ac-shop { grid-area: shop; gap: 4px; }
html.mobile .autochess .ac-btn { padding: 4px 7px; font-size: 11px; min-height: 28px; }
html.mobile .autochess .ac-lv { font-size: 11px; }
html.mobile .autochess .ac-gold { font-size: 18px; }
html.mobile .autochess .ac-odds { grid-column: 1 / -1; font-size: 10px; }
html.mobile .autochess .ac-shop .shop-card { padding: 3px 2px; gap: 0; }
html.mobile .autochess .ac-shop .shop-card .hero-img { width: 34px !important; height: 34px !important; }
html.mobile .autochess .ac-shop .shop-card b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
html.mobile .autochess .ac-shop .shop-card small { display: none; }
html.mobile .autochess .ac-shop .shop-card em { font-size: 11px; }
html.mobile .autochess .mode-header, html.mobile .autochess > header { padding: 4px 8px; }

/* ===== 모바일 스킬 버튼: 크게 + 순서 (망토 · 모자 · 갑옷 · 무기) ===== */
body.touch .b-sk[data-s="cloak"] { order: 1; } body.touch .b-sk[data-s="helmet"] { order: 2; }
body.touch .b-sk[data-s="armor"] { order: 3; } body.touch .b-sk[data-s="weapon"] { order: 4; }
html.m-portrait { --console: 344px; }
html.m-portrait body.touch .b-skills { bottom: calc(var(--mb) + 180px); gap: 6px; left: 6px; right: 6px; }
html.m-portrait body.touch .b-sk { min-height: 58px; padding: 7px 3px; border-radius: 12px; border-width: 2px; display: flex; flex-direction: column; justify-content: center; }
html.m-portrait body.touch .b-sk .sl { font-size: 11px; line-height: 1.2; }
html.m-portrait body.touch .b-sk .nm { font-size: 13.5px; line-height: 1.3; }
html.m-portrait body.touch .b-sk .cd { font-size: 18px; }
html.m-portrait body.touch .b-sk:active { transform: scale(.95); }
html.m-portrait body.touch .b-slots { bottom: calc(var(--mb) + 246px); }
html.m-portrait body.touch .b-me { bottom: calc(var(--mb) + 286px); }
html.m-portrait .m-top, html.m-portrait .b-btns { bottom: calc(var(--mb) + 290px); }
html.m-portrait body.touch .sv-prompt { bottom: calc(var(--mb) + 352px); }
@media (max-height: 720px) {
  html.m-portrait { --console: 318px; }
  html.m-portrait body.touch .b-skills { bottom: calc(var(--mb) + 158px); }
  html.m-portrait body.touch .b-sk { min-height: 52px; }
  html.m-portrait body.touch .b-slots { bottom: calc(var(--mb) + 218px); }
  html.m-portrait body.touch .b-me { bottom: calc(var(--mb) + 258px); }
  html.m-portrait .m-top, html.m-portrait .b-btns { bottom: calc(var(--mb) + 262px); }
}
/* 가로 모드 터치: 스킬 조금 크게 */
html:not(.m-portrait) body.touch .b-sk { width: 92px; padding: 10px 4px; } html:not(.m-portrait) body.touch .b-skills { width: 192px; }
/* 클래식 스킬 목록 */
.sk-list { list-style: none; display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.sk-list li { display: grid; grid-template-columns: 92px 1fr; gap: 1px 8px; align-items: baseline; background: #0004; border-radius: 7px; padding: 5px 8px; font-size: 12.5px; }
.sk-list li small { grid-column: 2; color: var(--muted); line-height: 1.45; font-size: 11.5px; }
.sk-list li small em { color: var(--accent2); font-style: normal; }
.sk-list .sk-slot { color: var(--muted); font-size: 11px; white-space: nowrap; }
.sk-list .sk-slot kbd { background: var(--panel2); border-radius: 4px; padding: 0 4px; font-size: 10px; color: var(--accent2); font-family: inherit; }
.sk-list li b { color: var(--text); }
.sk-list li.hold b { color: var(--gold); font-weight: 600; font-size: 12px; }
.sk-note { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
/* ===== 생존 전략: 테트리스식 인벤토리 ===== */
.inv-tetris { grid-template-columns: auto 1fr; align-items: start; }
.inv-help { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 8px; }
.inv-help kbd { background: var(--panel2); border-radius: 3px; padding: 0 4px; font-family: inherit; }
.eq-grid { display: grid; grid-template-columns: repeat(2, calc(var(--cell) * 2 + 10px)); gap: 6px; }
.eq-slot { position: relative; min-height: calc(var(--cell) * 2 + 18px); background: repeating-linear-gradient(45deg, #ffffff06 0 6px, transparent 6px 12px), var(--bg2); border: 1px dashed #ffffff30; border-radius: 8px; padding: 14px 4px 4px; display: flex; align-items: center; justify-content: center; }
.eq-slot > span { position: absolute; top: 2px; left: 6px; font-size: 10px; color: var(--muted); }
.eq-slot[data-slot=weapon] { grid-row: span 2; }
.eq-slot .inv-it { --cell: 26px; }
.bag-grid { position: relative; background-color: #0d1220; background-image: linear-gradient(#ffffff14 1px, transparent 1px), linear-gradient(90deg, #ffffff14 1px, transparent 1px); background-size: var(--cell) var(--cell); border: 2px solid #3a4560; border-radius: 4px; box-sizing: content-box; touch-action: none; }
.inv-it { position: absolute; width: calc(var(--w) * var(--cell) - 4px); height: calc(var(--h) * var(--cell) - 4px); margin: 2px; box-sizing: border-box; border-radius: 5px; background: linear-gradient(160deg, #3b4766, #262f47); border: 1px solid #5a6890; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: grab; touch-action: none; user-select: none; overflow: hidden; text-align: center; }
.inv-it i { font-size: min(calc(var(--cell) * .55), 22px); color: var(--accent2); }
.inv-it b { font-size: 10px; line-height: 1.1; font-weight: 700; padding: 0 2px; word-break: keep-all; }
.inv-it em { position: absolute; right: 3px; top: 1px; font-size: 10px; font-style: normal; font-weight: 900; color: var(--gold); }
.inv-it.weapon { background: linear-gradient(160deg, #4a3b2a, #2f2619); border-color: #8a6a3a; }
.inv-it.rare { box-shadow: inset 0 0 0 2px #4aa3ff; } .inv-it.epic { box-shadow: inset 0 0 0 2px #b46aff; } .inv-it.gold { box-shadow: inset 0 0 0 2px #ffb020, 0 0 10px #ffb02066; }
.inv-it.lift { opacity: .3; } .inv-it.sel { outline: 2px solid var(--gold); outline-offset: -2px; z-index: 2; }
.inv-hint { position: absolute; pointer-events: none; border-radius: 4px; z-index: 3; }
.inv-hint.ok { background: #4aff8a33; border: 2px solid #4aff8a; } .inv-hint.no { background: #ff4a4a33; border: 2px solid #ff4a4a; }
.inv-ghost { position: fixed; z-index: 9999; pointer-events: none; opacity: .9; filter: drop-shadow(0 6px 10px #000a); }
.inv-ghost .inv-it { position: relative !important; margin: 0; }
.inv-acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.inv-drop { flex: 1; min-width: 120px; padding: 8px; border: 2px dashed #ff6a6a77; border-radius: 8px; color: #ff9a9a; font-size: 12px; text-align: center; }
html.mobile .inv-tetris { grid-template-columns: 1fr; gap: 8px; }
html.mobile .eq-grid { grid-template-columns: repeat(5, 1fr); }
html.mobile .eq-slot[data-slot=weapon] { grid-row: auto; }
html.mobile .eq-slot { min-height: 70px; } html.mobile .eq-slot .inv-it { --cell: 20px; }
html.mobile .inv-bag { overflow-x: auto; }
html.mobile .inv-help { display: block; margin: 2px 0 0; }
/* 생존: 스킬 장비상 */
.sv-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.sv-cur { margin: 4px 0 8px; font-size: 13px; }
.sv-item.on { outline: 2px solid var(--gold, #e8b33d); }
.eq-slot[data-slot^=sk_] { border-color: #b46aff80; }
.sv-wsk { font-style: normal; font-size: 10px; background: #b46aff33; color: #d9b8ff; border-radius: 6px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }

/* ---------- 스매쉬 · 서바이벌 · 장비창 ---------- */
.wip-badge { position: absolute; top: 10px; right: 10px; z-index: 2; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: #0009; color: #ffd36a; border: 1px solid #ffd36a88; }
.mode-card.wip h2::after { content: ''; }
.sm-pcts { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 6; pointer-events: none; }
.sm-p { min-width: 70px; text-align: center; padding: 4px 8px; border-radius: 10px; background: #000a; border: 1px solid #fff2; }
.sm-p b { display: block; font-size: 22px; font-weight: 900; color: hsl(calc(60 - var(--pct) * 60), 100%, calc(90% - var(--pct) * 35%)); text-shadow: 0 2px 0 #000; }
.sm-p small { display: block; font-size: 10px; color: #cfd6e6; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-p em { font-style: normal; font-size: 10px; color: #ff6a6a; letter-spacing: 1px; }
.sm-p.me { border-color: #ffd36a; } .sm-p.out { opacity: .35; }
.b-tag.smash .hp > i { background: hsl(calc(60 - var(--pct) * 60), 100%, 55%) !important; }
.id-panel { position: absolute; right: 12px; top: 64px; z-index: 6; display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: #000a; border: 1px solid #fff2; }
.id-panel b { color: var(--gold); } .id-panel small { color: #cfd6e6; }
.id-panel .btn-mini.on { background: #2f7a3e; border-color: #4caf50; }
#gear-panel { padding: 12px 14px; }
#gear-panel .panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.gp-hint { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.gp-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.gp-slot { position: relative; aspect-ratio: 1; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.gp-slot:hover { border-color: var(--accent); }
.gp-slot .hero-img { width: 100% !important; height: 100% !important; border: 0; border-radius: 0; }
.gp-slot kbd { position: absolute; left: 3px; top: 2px; font-size: 10px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; z-index: 1; }
.gp-slot em { position: absolute; right: 3px; bottom: 2px; font-style: normal; font-size: 10px; font-weight: 800; background: var(--accent); color: #241200; border-radius: 99px; padding: 0 5px; z-index: 1; }
.gp-slot .gp-w { position: absolute; left: 3px; bottom: 3px; font-size: 10px; color: #ffd36a; z-index: 1; }
.gp-slot.empty { color: var(--muted); }
.gp-items { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; max-height: 92px; overflow: auto; }
.gp-it { position: relative; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; background: #0b0f18; border: 1px solid var(--line); font-size: 13px; color: #cfd6e6; }
.gp-it b { position: absolute; right: 1px; bottom: 0; font-size: 8px; color: #7cf08a; }
.gp-none { color: var(--muted); font-size: 12px; }
.gp-modal h4 { margin: 4px 0 8px; font-size: 14px; } .gp-modal h4 small { color: var(--muted); font-weight: 500; }
.gp-heroes { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; max-height: 220px; overflow: auto; margin-bottom: 12px; }
.gp-h { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); }
.gp-h small { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60px; }
.gp-h.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 25%, var(--panel2)); }
.gp-h > i { font-size: 22px; height: 40px; display: grid; place-items: center; color: var(--muted); }
.gp-gear { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.gp-gear label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #cfd6e6; }
.gp-gear select { padding: 6px; border-radius: 6px; background: #0b0f18; color: var(--text); border: 1px solid var(--line); }
.pf-fav { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pe-row { display: block; margin: 6px 0; font-size: 13px; font-weight: 700; }
.pe-row input { margin-top: 4px; }
@media (max-width: 640px) {
  .gp-gear { grid-template-columns: 1fr; }
  .sm-pcts { bottom: auto; top: 54px; gap: 4px; } .sm-p { min-width: 54px; padding: 2px 5px; } .sm-p b { font-size: 16px; }
  .id-panel { top: 50px; right: 6px; left: 6px; justify-content: center; flex-wrap: wrap; font-size: 12px; }
}
@media (max-width: 640px) { #room-filter { overflow-x: auto; flex-wrap: nowrap; min-width: 0; flex: 1; } #room-filter .tab { white-space: nowrap; padding: 6px 9px; font-size: 13px; flex: none; } }

/* ---------- 채팅 위젯 ---------- */
.chat-w { display: flex; flex-direction: column; position: relative; }
.cw-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cw-head h3 { font-size: 15px; }
.cw-tabs { display: flex; gap: 2px; background: var(--bg2); border-radius: 8px; padding: 2px; }
.cw-tabs button { font-size: 11px; padding: 3px 8px; border-radius: 6px; color: var(--muted); font-weight: 700; }
.cw-tabs button.on { background: var(--panel2); color: var(--text); }
.chat-log .cm { display: flex; align-items: center; gap: 5px; margin: 1px 0; padding: 2px 4px; border-radius: 6px; flex-wrap: wrap; }
.chat-log .cm .hero-img { width: 20px !important; height: 20px !important; border-width: 1px; border-radius: 5px; flex: none; }
.cm .lv { font-style: normal; font-size: 9px; font-weight: 800; padding: 0 4px; border-radius: 4px; background: #2a3550; color: #ffd36a; }
.cm b { margin-right: 0 !important; }
.cm .tx { flex: 1; min-width: 60px; word-break: break-all; }
.cm .tx.big { font-size: 24px; line-height: 1.1; }
.cm time { font-size: 10px; color: #6f7b95; margin-left: auto; }
.cm.mine { background: rgba(255, 179, 106, .07); }
.cm.hit { background: rgba(255, 211, 106, .16); box-shadow: inset 2px 0 0 #ffd36a; }
.cm.sys { color: #8fd3a5; font-size: 12px; }
.cm.emote { color: #d8a8ff; }
.mention { color: #7ac8ff; font-weight: 700; } .mention.me { color: #ffd36a; background: #ffd36a22; border-radius: 4px; padding: 0 2px; }
.cw-new { position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--accent); color: #241200; font-weight: 800; z-index: 2; box-shadow: 0 3px 10px #0007; }
.cw-pick { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px; margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.cw-pick[hidden] { display: none; }
.cw-quick, .cw-emoji { display: flex; flex-wrap: wrap; gap: 4px; }
.cw-quick button { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); }
.cw-emoji button { font-size: 18px; width: 30px; height: 30px; border-radius: 6px; }
.cw-quick button:hover, .cw-emoji button:hover { background: #2f3c5a; }
.cw-form .cw-emo { padding: 9px 10px; }
.cw-form input { flex: 1; min-width: 0; }
#lobby-chat .cw-log { min-height: 180px; }
/* 인게임 채팅 */
.g-chat { position: fixed; left: 10px; bottom: 150px; z-index: 40; width: min(340px, 70vw); pointer-events: none; }
.g-chat .gc-log { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.g-chat .gc-m { background: #000a; border-radius: 6px; padding: 1px 6px; transition: opacity .6s; width: fit-content; max-width: 100%; }
.g-chat .gc-m.old { opacity: 0; }
.g-chat.open .gc-m { opacity: 1; }
.g-chat .cm { margin: 0; padding: 1px 0; display: flex; gap: 4px; align-items: center; color: #fff; text-shadow: 0 1px 2px #000; }
.g-chat .cm .tx.big { font-size: 20px; }
.g-chat .gc-form { display: flex; gap: 4px; margin-top: 4px; pointer-events: auto; }
.g-chat .gc-form[hidden], .g-chat .gc-quick[hidden] { display: none; }
.g-chat .gc-form input { flex: 1; padding: 6px 8px; border-radius: 6px; background: #000c; border: 1px solid var(--accent); color: #fff; }
.g-chat .gc-quick { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; pointer-events: auto; }
.g-chat .gc-quick button { font-size: 12px; padding: 3px 7px; border-radius: 99px; background: #000b; border: 1px solid #fff3; color: #fff; }
.g-chat .gc-btn { pointer-events: auto; margin-top: 4px; width: 34px; height: 34px; border-radius: 50%; background: #000a; border: 1px solid #fff3; color: #fff; font-size: 15px; }
.g-chat.open .gc-btn { background: var(--accent); color: #241200; }
@media (max-width: 640px) { .g-chat { bottom: auto; top: 96px; left: 6px; width: 62vw; } .g-chat .gc-log { font-size: 11px; } }
/* 서바이벌 파티 선택 */
.id-pick { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; background: #0009; padding: 10px; }
.id-pick-in { width: min(640px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.id-pick-in h3 { font-size: 18px; margin-bottom: 4px; } .id-pick-in h3 small { color: var(--accent); }
.id-pick-in p { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.id-party { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.id-pm { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--accent); min-height: 96px; justify-content: center; }
.id-pm small { font-size: 10px; color: var(--accent); font-weight: 800; } .id-pm b { font-size: 12px; }
.id-pm.empty { border-style: dashed; border-color: var(--line); color: var(--muted); font-size: 20px; }
.gp-h { position: relative; }
.id-no { position: absolute; left: 3px; top: 2px; font-style: normal; font-size: 11px; font-weight: 900; background: var(--accent); color: #241200; border-radius: 99px; width: 17px; height: 17px; display: grid; place-items: center; }
.id-gear { position: absolute; right: 4px; top: 4px; font-size: 10px; color: #ffd36a; }
.id-pick-in footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ---------- 생존 미니맵 · 챔피언 난입 · 서바이벌 성장 ---------- */
.sv-minimap { position: absolute; right: 10px; top: 58px; z-index: 30; padding: 4px; border-radius: 10px; background: #000a; border: 1px solid #fff3; box-shadow: 0 4px 14px #0008; line-height: 0; }
.sv-minimap canvas { width: 132px; height: auto; max-height: 132px; object-fit: contain; border-radius: 6px; cursor: zoom-in; image-rendering: pixelated; }
.sv-minimap.big canvas { width: 300px; max-height: 300px; cursor: zoom-out; }
.sv-minimap .mm-zoom { position: absolute; right: 6px; bottom: 6px; width: 20px; height: 20px; border-radius: 5px; background: #000a; color: #fff; font-size: 10px; line-height: 1; }
@media (max-width: 640px) { .sv-minimap { top: 50px; right: 6px; } .sv-minimap canvas { width: 92px; max-height: 92px; } .sv-minimap.big canvas { width: min(300px, 80vw); max-height: 60vh; } }
.cp-assist { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 6px); padding: 5px 12px; font-size: 13px; font-weight: 800; background: #ffd36a; color: #241200; border: 0; box-shadow: 0 3px 0 #0006; pointer-events: auto; }
.cp-assist kbd { background: #0003; border-radius: 4px; padding: 0 4px; margin-left: 2px; }
.cp-assist:disabled { background: #3a4258; color: #9aa4ba; box-shadow: none; }
.m-assist { background: #ffd36acc !important; color: #241200 !important; font-weight: 800; }
.m-assist:disabled { opacity: .4; }
.id-up { position: absolute; inset: 0; z-index: 70; display: grid; place-items: center; background: #000a; padding: 10px; animation: fadeIn .2s; }
.id-up section { width: min(640px, 100%); background: var(--panel); border: 2px solid var(--accent); border-radius: 14px; padding: 16px; }
.id-up.special section { border-color: #c07aff; box-shadow: 0 0 40px #c07aff55; }
.id-up h3 { font-size: 20px; display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; } .id-up h3 small { font-size: 12px; color: var(--muted); font-weight: 500; }
.id-ups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.id-ups button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); transition: .12s; }
.id-ups button:hover { transform: translateY(-3px); border-color: var(--accent); }
.id-ups button > i { font-size: 30px; color: var(--accent); } .id-up.special .id-ups button > i { color: #d8a8ff; }
.id-ups b { font-size: 14px; } .id-ups small { font-size: 11px; color: #b9c2d6; text-align: center; }
.id-ups em { position: absolute; top: 6px; right: 6px; font-style: normal; font-size: 10px; background: #2a3550; padding: 1px 6px; border-radius: 99px; }
.id-upbar { position: absolute; left: 10px; top: 64px; z-index: 6; display: flex; gap: 4px; flex-wrap: wrap; max-width: 50%; }
.id-upbar span { position: relative; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; background: #000a; border: 1px solid #ffb36a88; color: #ffb36a; font-size: 12px; }
.id-upbar span.sp { border-color: #c07aff; color: #d8a8ff; box-shadow: 0 0 8px #c07aff66; }
.id-upbar b { position: absolute; right: -3px; bottom: -3px; font-size: 9px; background: var(--accent); color: #241200; border-radius: 99px; padding: 0 3px; }
@media (max-width: 640px) { .id-ups { grid-template-columns: 1fr; } .id-ups button { flex-direction: row; text-align: left; padding: 10px; } .id-ups small { text-align: left; } .id-upbar { top: 96px; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* ---------- 타르코프식 장비창 ---------- */
.tk-modal .modal { width: min(1100px, 98vw); max-width: none; }
.tk-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; }
.tk-tab { position: relative; flex: none; width: 46px; height: 46px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.tk-tab .hero-img { width: 100% !important; height: 100% !important; border: 0; border-radius: 0; }
.tk-tab kbd { position: absolute; left: 3px; top: 1px; font-size: 10px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px #000; z-index: 1; }
.tk-tab.on { border: 2px solid var(--accent); box-shadow: 0 0 10px #ffb36a55; }
/* · 214 EX 프로필 탭 (1~0 칸에 없는 모든 용병) */
.tk-sep { flex: none; width: 2px; margin: 6px 3px; background: #f0c23a88; border-radius: 2px; }
.tk-tab .tk-n { position: absolute; right: 2px; bottom: 2px; z-index: 1; min-width: 14px; padding: 0 3px; border-radius: 7px; background: var(--accent); color: #1a1205; font: 900 10px/14px sans-serif; text-align: center; font-style: normal; }
.tk-tab.exh.on { border-style: solid; }
.tk-main { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; margin-top: 6px; }
.tk-char { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.tk-char header { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.tk-char header b { display: block; font-size: 15px; } .tk-char header small { color: var(--muted); font-size: 11px; }
.tk-eq { grid-template-columns: repeat(2, calc(var(--cell) * 2 + 14px)); }
.tk-eq .eq-slot .inv-it { --cell: 28px; }
.eq-slot.hot { border-color: #4aff8a; background: #4aff8a22; }
.tk-def { font-size: 10px; color: var(--muted); padding: 0 4px; text-align: center; }
.tk-stat { font-size: 11px; color: #cfd6e6; margin: 8px 0; max-width: calc(var(--cell) * 4 + 34px); line-height: 1.5; }
.tk-stash h4 small { color: var(--muted); font-weight: 500; }
.tk-stash { min-width: 0; overflow-x: auto; } .tk-stash .tk-grid { max-width: none; flex: none; }   /* · 218 넓은 창고: 잘리지 않고 가로 스크롤 */
.inv-it .own { position: absolute; left: 2px; bottom: 1px; font-size: 9px; font-weight: 900; background: #5ab0ff; color: #001; border-radius: 3px; padding: 0 3px; }
.tk-shop { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.tk-shop .sv-tabs { align-items: center; }
.tk-for { margin-left: auto; font-size: 12px; color: var(--muted); } .tk-for b { color: var(--accent); }
.tk-list { max-height: 240px; overflow: auto; }
.tk-list .sv-item > i { width: 32px; text-align: center; font-size: 20px; color: var(--accent2); }
.sv-item.rec { box-shadow: inset 3px 0 0 #4aff8a; }
.tk-rec { font-style: normal; font-size: 10px; background: #2f7a3e; color: #cfffd8; padding: 0 5px; border-radius: 4px; }
@media (max-width: 760px) {
  .tk-main { grid-template-columns: 1fr; }
  .tk-eq { grid-template-columns: repeat(4, 1fr); } .tk-eq .eq-slot { min-height: 64px; } .tk-eq .eq-slot .inv-it { --cell: 18px; }
  .tk-stat { max-width: none; }
  .tk-stash { overflow-x: auto; }
  .tk-for { display: none; }
}
.tk-wfix { font-size: 11px; color: #ffd36a; margin-top: 6px; } .tk-wfix small { color: var(--muted); }
.inv-it.locked { opacity: .55; filter: grayscale(.4); }
.inv-it.locked::after { content: '\f023'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; left: 3px; top: 2px; font-size: 9px; color: #ffd36a; }
/* 3웨이 디펜스 */
.id-stone { position: absolute; left: 50%; top: 108px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; background: #000b; border: 1px solid #5ad8ff88; }
.id-stone > i { color: #7ad8ff; } .id-stone b { font-size: 13px; min-width: 36px; text-align: right; }
.id-stone span { width: 180px; height: 10px; border-radius: 99px; background: #0008; overflow: hidden; } .id-stone span i { display: block; height: 100%; transition: width .2s; }
.id-party.tri { grid-template-columns: repeat(9, 1fr); gap: 4px; }
.id-party.tri .id-pm { min-height: 78px; padding: 3px; } .id-party.tri .id-pm b { font-size: 10px; }
.id-pm.l0 { border-color: #ff8a5a; } .id-pm.l1 { border-color: #5ab0ff; } .id-pm.l2 { border-color: #7aff8a; }
.id-pm.l0 small { color: #ff8a5a; } .id-pm.l1 small { color: #5ab0ff; } .id-pm.l2 small { color: #7aff8a; }
@media (max-width: 640px) { .id-party.tri { grid-template-columns: repeat(3, 1fr); } .id-stone { top: 104px; } .id-stone span { width: 110px; } }

/* 오토체스 대인원 (10~18명) */
.slots.solo.n10 ul, .slots.solo.n12 ul { grid-template-columns: repeat(4, 1fr); }
.slots.solo.n14 ul, .slots.solo.n16 ul, .slots.solo.n18 ul { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.slots.solo.n10 ul, .slots.solo.n12 ul { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.slots.solo.n14 .slot, .slots.solo.n16 .slot, .slots.solo.n18 .slot { min-width: 0; grid-template-columns: 34px minmax(0, 1fr) !important; } .slots.solo.n14 .slot .hero-img, .slots.solo.n16 .slot .hero-img, .slots.solo.n18 .slot .hero-img { width: 34px !important; height: 34px !important; } .slots.solo.n14 .slot-state, .slots.solo.n16 .slot-state, .slots.solo.n18 .slot-state { display: none; }
.slots.solo.n14 .slot, .slots.solo.n16 .slot, .slots.solo.n18 .slot { padding: 6px; font-size: 12px; }
.ac-players { max-height: 70vh; overflow: auto; }
.ac-players.many .pl { padding: 3px 6px; margin-bottom: 3px; font-size: 12px; }
.id-pm { position: relative; cursor: pointer; }
.id-pm.act { outline: 3px solid #ffd84a; box-shadow: 0 0 12px #ffd84a88; }
.id-sn { position: absolute; top: 2px; left: 4px; font-size: 10px; font-style: normal; font-weight: 900; color: #ffd84a; }
/* ===== 인게임 상단 버튼 (교체 · 설정 · 포기) — PC/모바일 공통 ===== */
.gt-actions { display: flex; gap: 6px; align-items: center; }
.gt-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; background: #1b2335; border: 1px solid var(--line); color: var(--text); font-weight: 800; font-size: 13px; white-space: nowrap; transition: .15s; }
.gt-btn:hover { border-color: var(--accent); color: var(--accent); }
.gt-btn i { font-size: 14px; }
.gt-btn kbd { font-size: 10px; padding: 0 4px; border-radius: 4px; background: #0008; color: var(--muted); }
.gt-btn.danger { background: #3a1820; border-color: #7a2a3a; color: #ff9aa8; }
.gt-btn.danger:hover { background: #5a2030; color: #fff; }
.gt-btn.b-gear-btn { width: auto; border-radius: 10px; font-size: 13px; }
.gt-btn.b-gear-btn:hover { transform: none; }
.gt-btn.b-gear-btn:hover i { transform: rotate(90deg); } .gt-btn.b-gear-btn i { transition: transform .3s; }
html.m-portrait .gt-btn, body.touch .gt-btn { height: 30px; padding: 0 9px; font-size: 12px; gap: 4px; }
html.m-portrait .gt-btn kbd, body.touch .gt-btn kbd { display: none; }
html.m-portrait .game-top .gt-actions { margin-left: auto; }
@media (max-width: 360px) { .gt-btn span { display: none; } .gt-btn { padding: 0 9px; } }
/* 장비창 칸: PC/모바일 동일 (윗줄 장비 4칸 · 아랫줄 커스텀 4칸) */
.tk-eq, html.mobile .tk-eq { grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; min-width: calc(var(--cell) * 8 + 40px); }
.tk-eq .eq-slot, html.mobile .tk-eq .eq-slot { min-height: calc(var(--cell) * 2 + 10px); padding: 16px 3px 3px; }
.tk-eq .eq-slot > span { font-size: 10px; left: 4px; right: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-eq .eq-slot .inv-it, html.mobile .tk-eq .eq-slot .inv-it { --cell: calc(var(--slotcell, 24px)); }
.tk-stat { max-width: none; }
@media (max-width: 760px) { .tk-eq, html.mobile .tk-eq { min-width: 0; } .tk-eq .eq-slot, html.mobile .tk-eq .eq-slot { min-height: 70px; } .tk-eq { --slotcell: 18px; } }
.game-top .gt-btn.b-swap-btn, .game-top .gt-btn.b-gear-btn, html.m-portrait .game-top .gt-btn.b-swap-btn, html.m-portrait .game-top .gt-btn.b-gear-btn { width: auto; height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
html.m-portrait .game-top .gt-btn, html.m-portrait .game-top .gt-btn.b-swap-btn, html.m-portrait .game-top .gt-btn.b-gear-btn { height: 30px; padding: 0 8px; font-size: 12px; }
.game-top .gt-btn i { font-size: 13px !important; }
html.m-portrait .gt-mode { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.m-portrait .game-top .gt-actions { flex: none; gap: 4px; }
.tk-enh-note { font-size: 11px; color: #cfd6e6; padding: 6px 8px; list-style: none; grid-column: 1 / -1; } .tk-enh-note b { color: #ff7a6a; }
.sv-item.rare { box-shadow: inset 3px 0 0 #4aa3ff; } .sv-item.epic { box-shadow: inset 3px 0 0 #b46aff; } .sv-item.gold { box-shadow: inset 3px 0 0 #ffb020; }
.tk-boom { color: #ff5a4a; }
/* 용병 드래그 앤 드롭 (PC) */
[data-dh][draggable="true"] { cursor: grab; }
[data-dh].dragging { opacity: .45; }
.drop-hot { outline: 2px dashed var(--accent) !important; outline-offset: 2px; background: rgba(255, 122, 47, .18) !important; }
.slot-pick.dnd .b-swap-grid button.on { opacity: .55; }
.tk-heroes { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin: 2px 0 6px; }
.tk-heroes span { width: 30px; height: 30px; border-radius: 6px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); }
.tk-heroes span.on { border-color: var(--accent); }
.tk-heroes small { color: var(--muted); font-size: 11px; margin-left: 4px; }
/* 챔피언 밴픽 */
.ban-panel { margin: 8px 0; }
.ban-panel h4 { font-size: 13px; margin-bottom: 6px; }
.ban-list { display: flex; flex-wrap: wrap; gap: 4px; }
.hg-item.banned { opacity: .4; filter: grayscale(1); pointer-events: none; }
.hg-item.banned::after, .ban-list .ban-chip::after { content: '\f05e'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; inset: 0; display: grid; place-items: center; color: #ff4a4a; font-size: 26px; }
.ban-chip { position: relative; display: inline-flex; border-radius: 8px; overflow: hidden; border: 1px solid #ff4a4a; }
.ban-mode .hg-item { border-color: #ff4a4a55; }
.ban-mode .hg-item.ban-on { border-color: #ff4a4a; background: rgba(255, 74, 74, .15); }
/* 황금 팬츠 */
.pants-h { margin-top: 10px; color: #ffc83a; }
.pants-grid { background-color: #241c08 !important; outline: 1px solid #ffc83a66; }
.gold-pants { border: 1px solid #ffc83a66; background: #2a210a66; }
.gold-pants > i { color: #ffc83a; }
.gold-pants small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
/* 생존: 소모품 바 */
.sv-usebar { position: absolute; right: 16px; top: 200px; z-index: 6; display: flex; flex-direction: column; gap: 6px; }
.sv-usebar > * { position: relative; width: 46px; height: 46px; border-radius: 10px; background: #0b0f18d8; border: 1px solid var(--line); color: #fff; display: grid; place-items: center; font-size: 18px; }
.sv-usebar button { cursor: pointer; } .sv-usebar button:active { transform: scale(.94); }
.sv-usebar [data-use=elixir] i { color: #7affb0; } .sv-usebar [data-use=defib] i { color: #ff6a8a; } .sv-usebar [data-use=amulet] i { color: #ffd84a; }
.sv-usebar b { position: absolute; right: 3px; bottom: 1px; font-size: 11px; }
.sv-usebar kbd { position: absolute; left: 2px; top: 1px; font-size: 9px; background: var(--panel2); border-radius: 3px; padding: 0 3px; }
.sv-usebar .empty { opacity: .4; }
body.touch .sv-usebar kbd { display: none; }
html.m-portrait .sv-usebar { top: 150px; right: 8px; transform: scale(.85); transform-origin: top right; }
/* 생존: 커스텀 상인 용병 교체 */
.sv-heroes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 6px; }
.sv-hero { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.sv-hero.on { border-color: var(--gold); background: #ffd84a1a; }
.sv-hero.empty { opacity: .45; cursor: default; justify-content: center; min-height: 72px; }
.sv-hero kbd { position: absolute; left: 3px; top: 2px; font-size: 10px; background: var(--bg2); border-radius: 3px; padding: 0 4px; }
.sv-hero small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sv-hero em { position: absolute; right: 2px; top: 2px; font-size: 9px; font-style: normal; background: var(--gold); color: #241200; border-radius: 3px; padding: 0 3px; }
/* MVP 창 (결과창 약식) */
.mvp-box { width: 100%; margin: 8px 0 4px; padding: 8px 10px; border-radius: 12px; background: linear-gradient(135deg, #3a2a08cc, #1a2238cc); border: 1px solid #ffd36a66; text-align: left; }
.mvp-box header { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid #ffd36a33; }
.mvp-box header img, .mvp-box header .hero-img { border-radius: 10px; box-shadow: 0 0 0 2px #ffd36a; }
.mvp-box header div { display: flex; flex-direction: column; min-width: 0; }
.mvp-box header small { color: #ffd36a; font-weight: 800; font-size: 11px; letter-spacing: 1px; }
.mvp-box header b { font-size: 16px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvp-box header em { font-style: normal; font-size: 11px; color: #c8d0e0; }
.mvp-box ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.mvp-box li { display: grid; grid-template-columns: 16px 64px 26px 1fr auto; align-items: center; gap: 6px; font-size: 12px; padding: 2px 4px; border-radius: 6px; }
.mvp-box li.me { background: #4aa3ff22; }
.mvp-box li i { color: #ffd36a; text-align: center; }
.mvp-box li span { color: #9aa6bd; }
.mvp-box li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mvp-box li em { font-style: normal; font-weight: 800; color: #ffd36a; }

/* ===== 모바일 v3: 방향키(조이스틱) 고정 · 버튼 확대 · 가로모드 창 정사각형 ===== */
body.touch .m-joy-base { opacity: .85; width: 150px; height: 150px; margin: -75px 0 0 -75px; }   /* 항상 같은 자리에 표시 */
body.touch .m-joy-knob { width: 66px; height: 66px; margin: -33px 0 0 -33px; }
body.touch .m-pad { width: 250px; height: 228px; }
body.touch .m-d { width: 118px; height: 118px; font-size: 34px; }
body.touch .m-a { right: 47px; bottom: 135px; width: 60px; height: 60px; font-size: 13px; }   /* · 173 점프 ↔ 방어 자리 교체 · 점프 작게 (스킬 버튼 오터치 방지) */
body.touch .m-s { right: 124px; bottom: 4px; width: 82px; height: 82px; font-size: 15px; }
html.m-portrait .m-pad { transform: scale(.8); }
html.m-portrait .m-joy-base { transform: none; }
@media (max-height: 720px) { html.m-portrait .m-pad { transform: scale(.74); } }
/* 가로모드(높이 낮음): 팝업 창을 정사각형으로 → 버튼이 잘리지 않게 내부 스크롤 */
@media (orientation: landscape) and (max-height: 560px) {
  body.touch .modal, body.touch .modal.wide { width: min(92vh, 94vw); height: min(92vh, 94vw); max-height: 92vh; }
  body.touch .modal-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; }
  body.touch .modal-head { padding: 8px 12px; } body.touch .modal-foot { padding: 8px 12px; flex-wrap: wrap; }
  body.touch .m-pad { transform: scale(.66); }
  body.touch .m-joy-base { top: calc(100% - 100px); transform: scale(.8); }
}
/* ===== 생존 인벤토리 v2 · 용병창 ===== */
.sv-merc > section { transform: translateY(-20px); max-height: calc(86vh - 20px); }
.inv-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 8px; }
.inv-stats span { background: var(--bg2); border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 800; display: flex; gap: 6px; align-items: center; }
.inv-stats i { color: var(--accent2); width: 14px; text-align: center; }
.inv-detail { margin-top: 10px; background: linear-gradient(160deg, #1d2438, #141a2a); border: 1px solid #3a4560; border-radius: 10px; padding: 10px; min-height: 92px; font-size: 12px; }
.inv-detail .inv-dn { display: block; font-size: 14px; margin-bottom: 2px; }
.inv-detail .inv-dn.rare { color: #7ac0ff; } .inv-detail .inv-dn.epic { color: #cf9aff; } .inv-detail .inv-dn.gold { color: #ffc84a; }
.inv-detail small { color: var(--muted); display: block; }
.inv-detail p { margin: 6px 0; line-height: 1.4; }
.inv-detail .inv-empty { color: var(--muted); text-align: center; margin-top: 18px; }
.inv-dbtn { display: flex; gap: 6px; } .inv-dbtn .btn-primary { flex: 1; }
.inv-cap { display: block; height: 5px; margin-top: 4px; border-radius: 3px; background: linear-gradient(90deg, hsl(calc(130 - var(--p) * 130), 80%, 55%) calc(var(--p) * 100%), #ffffff18 0); }
.inv-bag h4 small { margin-left: 6px; }
html.mobile .inv-detail { position: sticky; bottom: 0; z-index: 4; min-height: 0; }
.cx-side { margin-bottom: 6px; } .cx-side .chip { font-size: 14px; padding: 6px 14px; } .cx-side .chip.on[data-s=alien] { background: #7a3ac0; border-color: #7a3ac0; } .cx-side .chip.on[data-s=boss] { background: #c0392b; border-color: #c0392b; }
.cx-item.alien { border-color: #7a3ac055; } .cx-item.boss { border-color: #c0392b88; } .cx-ai-note { color: #ff8a7a; font-weight: 700; margin-top: 10px; }
.rc-mix { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; font-size: 13px; font-weight: 700; color: var(--accent2); cursor: pointer; }
.rc-mix input { width: 18px; height: 18px; accent-color: var(--accent); }
.room-count .st-spec { display: block; font-size: 10px; color: var(--ok); }
.spec-ask .spec-cnt { display: flex; gap: 10px; margin: 8px 0; } .spec-ask .spec-cnt span { background: var(--panel2); border-radius: 8px; padding: 6px 10px; font-weight: 800; }
/* 로비 장비창: 3탭 · 무기 상인 · 만랩 */
.tk-views { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.tk-view { flex: 1; min-width: 96px; padding: 7px 8px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); font-weight: 800; font-size: 12.5px; display: flex; align-items: center; gap: 5px; justify-content: center; }
.tk-view > b { background: var(--bg2); border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; font-size: 10px; }
.tk-view small { opacity: .7; }
.tk-view.on { color: #000; background: var(--accent); border-color: var(--accent); } .tk-view.on > b { background: #0003; }
.tk-view.pants.on { background: linear-gradient(135deg, #ffd84a, #e8a11a); border-color: #ffd84a; }
.tk-sub .inv-it { cursor: pointer; }
.sv-max.maxlv { background: linear-gradient(135deg, #ffd84a, #ff9a1a); color: #2a1600; padding: 4px 10px; border-radius: 99px; font-weight: 900; font-size: 12px; white-space: nowrap; box-shadow: 0 0 10px #ffb02088; }
.tk-wcur { outline: 2px solid #ffd84a66; }
.tk-lv { display: block; height: 5px; border-radius: 3px; margin-top: 4px; background: linear-gradient(90deg, #ffd84a calc(var(--p) * 100%), #ffffff18 0); }
.chess-overlay .b-float.skill { font-size: 15px; font-weight: 900; color: #ffe26a; text-shadow: 0 0 6px #000, 0 2px 0 #000; white-space: nowrap; }
/* 장비창: 고유 무기 카드 */
.tk-uw { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: linear-gradient(135deg, #3a2a14, #241a0e); border: 1px solid #a07a3a; }
.tk-uw > i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #0005; color: #ffcf6a; font-size: 18px; flex: none; }
.tk-uw > div { flex: 1; min-width: 0; } .tk-uw small { display: block; font-size: 10px; color: var(--muted); } .tk-uw small em { font-style: normal; color: #ffcf6a; margin-left: 4px; }
.tk-uw b { display: block; font-size: 13px; } .tk-uw .btn { flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.1; } .tk-uw .btn small { color: inherit; opacity: .8; }
.tk-uw.gold { box-shadow: 0 0 12px #ffb02066; }
.result-quit { color: #ff7a7a; font-weight: 800; margin: 6px 0; }
/* 시체 가방 뒤지기: 적 가방 ↔ 내 가방 */
.inv-looting { grid-template-columns: auto auto; gap: 14px; }
.inv-loot h4 { color: #d8b4ff; }
.loot-grid { border-color: #8a5acf !important; background-color: #2a1a40 !important; }
html.mobile .inv-looting { grid-template-columns: 1fr; }
html.mobile .inv-loot { overflow-x: auto; }
/* 오토체스 액션 전투 (서바이벌 엔진) */
.ac-action { position: absolute; inset: 0; z-index: 3; background: #0b0f18; }
.ac-arena.action .chess-canvas, .ac-arena.action .chess-overlay, .ac-arena.action .ac-drop { visibility: hidden; }
.ac-arena.action .ac-speed, .ac-arena.action .ac-banner, .ac-arena.action .ac-vs { z-index: 6; }
/* 모바일 오토체스: 빈 공간 제거 · 용병 구매창 크게 (점수판은 체스판 위 얇은 띠로) */
html.mobile .autochess .ac-main { gap: 3px; padding: 3px 4px 0; position: relative; }
html.mobile .autochess .ac-center { flex: 0 0 auto; gap: 3px; }
html.mobile .autochess .ac-arena { max-height: calc(100dvh - 360px); }
html.mobile .autochess .ac-players { position: absolute; left: 6px; right: 6px; top: 6px; z-index: 5; order: 0; padding: 0; gap: 3px; background: none; border: 0; pointer-events: auto; scrollbar-width: none; }
html.mobile .autochess .ac-players::-webkit-scrollbar { display: none; }
html.mobile .autochess .ac-players .pl { padding: 1px 6px; font-size: 10px; background: #0b0f18c0; border-radius: 99px; }
html.mobile .autochess .ac-vs { top: 26px; }
html.mobile .autochess .ac-cap { top: 26px; }
html.mobile .autochess .ac-shopbar { margin-top: auto; padding-top: 4px; gap: 3px 6px; }
html.mobile .autochess .ac-left, html.mobile .autochess .ac-right { gap: 2px; }
html.mobile .autochess .ac-btn { min-height: 26px; padding: 3px 7px; }
html.mobile .autochess .ac-shop .shop-card { padding: 5px 2px 4px; }
html.mobile .autochess .ac-shop .shop-card .hero-img { width: 44px !important; height: 44px !important; }
html.mobile .autochess .ac-shop .shop-card b { font-size: 12px; }
html.mobile .autochess .ac-main { flex: 1 1 0; }
html.mobile .autochess .ac-center { flex: 1 1 0; }
html.mobile .autochess .ac-arena { flex: 1 1 0; aspect-ratio: auto; max-height: none; }   /* 체스판이 남는 공간을 채움 (빈 여백 없음) */
html.mobile .autochess .ac-shopbar { flex: 0 0 auto; }

/* ===== 온라인 (· 98) ===== */
.net-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 9px; border-radius: 999px; background: rgba(0,0,0,.25); margin-right: 6px; white-space: nowrap; }
.net-state i { font-size: 8px; }
.net-state.on i { color: #4adf7a; } .net-state.off i { color: #ff6a5a; }
.net-state b { color: #fff; }
.room-no .on-dot { color: #4adf7a; font-size: 10px; margin-left: 3px; }
.ac-real { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 6px; background: #3a7aff; color: #fff; margin-left: 4px; }
html.mobile .net-state { font-size: 10px; padding: 3px 7px; }

/* 오토체스 자동 진행 표시 (· 101) */
.ac-autolog { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 4; background: rgba(10,14,24,.82); color: #ffe08a; font-weight: 800; font-size: 13px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,224,138,.35); white-space: nowrap; pointer-events: none; }
.ac-autolog:empty, .ac-autolog[hidden] { display: none; }
.ac-autolog.pop { animation: acPop .35s ease-out; }
@keyframes acPop { from { transform: translateX(-50%) scale(1.15); } to { transform: translateX(-50%) scale(1); } }
.shop-card.auto-pick { outline: 3px solid #ffe08a; outline-offset: -3px; transform: translateY(-4px); transition: transform .15s; }
html.mobile .ac-autolog { font-size: 11px; padding: 4px 10px; bottom: 6px; }

/* 오토체스 체력(플레이어) 띠 4px 아래로 (· 102) */
.autochess .ac-players { margin-top: 4px; }
html.mobile .autochess .ac-players { top: 10px; margin-top: 0; }
html.mobile .autochess .ac-vs, html.mobile .autochess .ac-cap { top: 30px; }

/* 소리 설정 (· 103) */
#snd-fab { position: fixed; right: 10px; bottom: 10px; z-index: 900; width: 38px; height: 38px; border-radius: 50%; background: rgba(12,16,26,.78); color: #ffd36a; border: 1px solid rgba(255,211,106,.4); font-size: 15px; display: grid; place-items: center; box-shadow: 0 2px 8px #0008; }
#snd-fab.muted { color: #8a93a3; border-color: #4a5262; }
#snd-pane { position: fixed; right: 10px; bottom: 56px; z-index: 901; width: 230px; background: #121826f2; border: 1px solid #2c3548; border-radius: 12px; padding: 12px 14px; color: #e6ebf4; box-shadow: 0 6px 20px #000a; }
#snd-pane[hidden] { display: none; }
#snd-pane h4 { margin: 0 0 8px; font-size: 14px; color: #ffd36a; }
#snd-pane label { display: grid; grid-template-columns: 62px 1fr 28px; align-items: center; gap: 6px; font-size: 12px; margin: 6px 0; }
#snd-pane input[type=range] { width: 100%; accent-color: #ffb43a; }
#snd-pane b { text-align: right; font-size: 11px; color: #aab3c4; }
#snd-pane .snd-mute { width: 100%; margin-top: 6px; padding: 7px; border-radius: 8px; background: #2a3346; color: #fff; font-weight: 700; font-size: 12px; }
/* 게임 중: 상단 바(포기 버튼 왼쪽)에 들어감 */
#snd-fab.in-bar { position: static; width: 32px; height: 32px; font-size: 13px; box-shadow: none; flex: 0 0 auto; }
body:has(#snd-fab.in-bar) #snd-pane { bottom: auto; top: 50px; }
.gt-actions { display: inline-flex; align-items: center; gap: 6px; }
html.mobile #snd-fab { width: 32px; height: 32px; font-size: 13px; right: 6px; bottom: 6px; }
html.mobile #snd-fab.in-bar { width: 28px; height: 28px; font-size: 12px; }
html.mobile body:has(#snd-fab.in-bar) #snd-pane { top: 44px; right: 6px; }
/* · 110 idle 파티 선택 X(로비로) + 강화 능력치 */
.id-pick-in{position:relative}
.id-close{position:absolute;top:10px;right:10px;width:34px;height:34px;border-radius:50%;border:1px solid #fff3;background:#0006;color:#fff;font-size:16px;display:grid;place-items:center;cursor:pointer;z-index:2}
.id-close:hover{background:#e0484a;border-color:#e0484a}
.id-pick-in h3{padding-right:40px}
.sv-enst{color:#ffd84a;font-weight:700}
/* · 111 */
.sk-list li.sk-custom b{color:#ffd84a}
.sk-cu{font-style:normal;font-size:10px;background:#ffd84a;color:#222;border-radius:4px;padding:0 4px;margin-left:4px;vertical-align:middle}
.ac-synrow{display:none}
html.mobile .autochess .ac-syn{display:none !important}   /* 시너지는 상대 체력 줄에 합침 */
html.mobile .autochess .ac-synrow{display:contents}
html.mobile .autochess .ac-chip{flex:0 0 auto;display:inline-flex;align-items:center;gap:3px;padding:1px 7px;font-size:10px;border-radius:99px;background:#2a3a5ac8;color:#cfe3ff;white-space:nowrap}
html.mobile .autochess .ac-chip.lv2{background:#6a4a10d0;color:#ffd84a}
html.mobile .autochess .ac-chip.lv3{background:#7a2a8ad0;color:#ffd0ff}
html.mobile .autochess .ac-sep{flex:0 0 1px;align-self:stretch;background:#fff4;margin:0 2px}
.b-ammo .b-ammo5{display:inline-flex;gap:2px;vertical-align:middle;margin-right:4px}
.b-ammo .b-ammo5 i{width:22px;height:7px;border-radius:2px;background:linear-gradient(90deg,#ffd84a var(--f),#ffffff22 var(--f));border:1px solid #0006;margin:0}
/* · 111 퀀텀2(360px)·아이폰 규격: 대기방 하단 바 2줄, 좁은 화면 축소, 노치/홈바 safe-area */
html.mobile #room-controls { flex-wrap: wrap; padding-left: calc(10px + env(safe-area-inset-left, 0px)); padding-right: calc(10px + env(safe-area-inset-right, 0px)); }
html.mobile #room-controls .btn { flex: 1 1 0; min-width: 0; }
html.mobile #room-controls .rc-mix { flex: 0 0 auto; padding: 0 4px; font-size: 11px; white-space: nowrap; }
html.mobile #room-controls .btn-start { flex: 1 1 100%; order: 9; padding: 12px 6px; font-size: 15px; }
html.mobile #waiting-room { padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px)); }
html.mobile body:has(#room-controls) #snd-fab:not(.in-bar) { bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
html.mobile header, html.mobile .top-bar { padding-top: env(safe-area-inset-top, 0px); }
@media (max-width: 370px) {
  html.mobile #room-controls .btn { font-size: 12px; padding: 9px 4px; gap: 4px; }
  html.mobile .hero-grid { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  html.mobile .hero-grid .hg-item img, html.mobile .hero-grid .hg-item .hero-img { width: 42px !important; height: 42px !important; }
  html.mobile .title-card, html.mobile .title-box { transform: scale(.9); transform-origin: center; }
  html.mobile .lobby .mode-card, html.mobile .mode-grid > * { min-height: 0; }
  html.mobile .b-sk { transform: scale(.92); transform-origin: bottom right; }
}
@media (max-height: 700px) and (orientation: portrait) {
  html.mobile .title-card, html.mobile .title-box { transform: scale(.85); }
}
/* 로비 모드 카드: 좁은 화면(퀀텀2 등)에서 컴팩트 — 설명 2줄 · 아이콘 작게 */
@media (max-width: 400px) {
  html.mobile #mode-cards .mode-card { padding: 11px 13px; gap: 6px; border-radius: 12px; }
  html.mobile #mode-cards .mode-card small { font-size: 9.5px; letter-spacing: 2px; }
  html.mobile #mode-cards .mode-card h2 { font-size: 17px; margin: 1px 0 3px; }
  html.mobile #mode-cards .mode-card p:not(.mode-subs) { font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
  html.mobile #mode-cards .mode-subs { margin: 5px 0 0; gap: 4px; } html.mobile #mode-cards .mode-subs span { font-size: 10.5px; padding: 2px 8px; }
  html.mobile #mode-cards .mode-ico { font-size: 40px; top: 6px; right: 8px; }
  html.mobile #mode-cards .btn-mode { padding: 8px 10px; font-size: 13px; margin-top: 4px; }
  html.mobile #mode-cards { gap: 9px; }
}
/* 오토체스 모바일: 시너지 + 상대 체력 = 한 줄 가로 스크롤 (줄바꿈 금지) */
html.mobile .autochess .ac-players { flex-wrap: nowrap !important; overflow-x: auto; overflow-y: hidden; white-space: nowrap; max-height: none; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
html.mobile .autochess .ac-players > * { flex-shrink: 0; }
html.mobile .autochess .ac-chip.lv0 { opacity: .65; }
html.mobile .autochess .ac-chip b { font-weight: 800; } html.mobile .autochess .ac-chip small { opacity: .7; font-size: 9px; }

/* ===== · 126 점수판 (Tab / 모바일 버튼) ===== */
.b-score { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; pointer-events: none; background: rgba(6, 10, 20, .35); }
.b-score[hidden] { display: none; }
.b-score .sc-box { pointer-events: auto; width: min(560px, 94vw); max-height: 80vh; overflow: auto; background: rgba(16, 22, 36, .94); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: 0 10px 30px #0008; }
.b-score header { font-weight: 900; font-size: 15px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.b-score header small { margin-left: auto; font-size: 11px; color: var(--muted, #9aa4b8); font-weight: 600; }
.b-score .sc-team { margin-top: 6px; }
.b-score h4 { margin: 0 0 4px; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.b-score h4 em { font-style: normal; font-size: 12px; opacity: .8; }
.b-score .sc-team.red h4 { color: #ff7a7a; } .b-score .sc-team.blue h4 { color: #7ab8ff; }
.b-score table { width: 100%; border-collapse: collapse; font-size: 13px; }
.b-score th { font-size: 11px; color: var(--muted, #9aa4b8); font-weight: 700; text-align: center; padding: 3px 4px; border-bottom: 1px solid var(--line); }
.b-score th:first-child { text-align: left; }
.b-score td { text-align: center; padding: 4px; border-bottom: 1px solid rgba(255,255,255,.05); font-weight: 800; white-space: nowrap; }
.b-score td.sc-n { text-align: left; display: flex; align-items: center; gap: 6px; }
.b-score td.sc-n b { overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.b-score tr.me td { background: rgba(255, 210, 58, .12); color: #ffe27a; }
.b-score tr.dead td { opacity: .5; }
.b-score-btn.on { border-color: var(--accent); color: var(--accent); }
@media (max-width: 520px) { .b-score .sc-box { padding: 8px; } .b-score table { font-size: 12px; } .b-score td.sc-n b { max-width: 90px; } .b-score-btn span { display: none; } }

/* 장비창: 엑스트라 슬롯 (0번 · 추후 스토리 도우미) */
.gp-slot.extra, .tk-tab.extra, .b-slot.extra, .slot-cfg .slot-list li.extra button { border: 2px dashed #f0c23a; box-shadow: 0 0 8px #f0c23a44; }
.gp-slot.extra kbd, .tk-tab.extra kbd, .b-slot.extra kbd { color: #f0c23a; }
.slot-cfg .slot-list li.extra button kbd { background: #f0c23a; }
.gp-hint .gp-ex { color: #f0c23a; }

/* 큰 피해 숫자: 크게 튀어오름 */
.b-float.big { font-size: 30px; letter-spacing: -1px; animation: bfloatBig .95s cubic-bezier(.2,1.6,.4,1) forwards; text-shadow: 0 3px 0 #000, 0 0 10px #ff8a3a; }
@keyframes bfloatBig { 0% { opacity: 0; margin-top: 0; font-size: 12px; } 12% { opacity: 1; font-size: 36px; } 30% { font-size: 30px; } 100% { opacity: 0; margin-top: -54px; } }
.cx-meas { margin: 6px 0 10px; padding: 6px 10px; border-left: 3px solid var(--gc); background: #ffffff0a; border-radius: 6px; font-size: 13px; }
.cx-meas b { color: var(--gc); }
.sv-grade { font-style: normal; font-weight: 900; font-size: 11px; margin-left: 4px; }

/* · 147 탈락 후 관전 */
.ac-late .ac-shopbar, .ac-late .ac-bench { pointer-events: none; opacity: .55; }
.ac-late .gt-center::after { content: '관전 중'; margin-left: 8px; padding: 2px 8px; border-radius: 10px; background: #3d9be8; color: #fff; font-size: 12px; font-weight: 700; }
.cp-watch { position: fixed; inset: 0; z-index: 720; display: grid; place-items: center; background: rgba(5,8,14,.72); backdrop-filter: blur(3px); }
.cp-watch-in { width: min(92vw, 380px); background: var(--panel, #1a2130); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 18px; text-align: center; }
.cp-watch-in h3 { margin: 0 0 8px; } .cp-watch-in p { margin: 0 0 14px; line-height: 1.5; } .cp-watch-in small { color: var(--muted, #9aa); }
.cp-watch-in footer { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; } .cp-watch-in em { font-style: normal; opacity: .7; }

/* · 156 장비 칸 4×2 (장비창 · 생존 전략 공통) */
.inv-eq .eq-grid { grid-template-columns: repeat(4, calc(var(--cell) * 2 + 10px)); }
.inv-eq .eq-slot[data-slot=weapon] { grid-row: auto; }
html.mobile .inv-eq .eq-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .inv-eq .eq-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .inv-eq .eq-slot { min-height: 70px; } .inv-eq .eq-slot .inv-it { --cell: 20px; } }

/* · 157 장착 칸 타일 크기 통일 (펜던트·무기도 장화처럼 2×2) · 무기 칸 고유 무기 + 보조 무기 배지 */
.eq-slot .inv-it { --w: 2 !important; --h: 2 !important; }
.eq-slot .inv-it.uw { cursor: default; }
.tk-aux { position: absolute; left: 3px; right: 3px; bottom: 3px; z-index: 2; font-size: 9px; line-height: 1.2; padding: 1px 3px; border-radius: 4px; border: 1px solid #ffd36a88; background: #2a2210ee; color: #ffd36a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
/* · 165 생존 전략: 아이템창 열린 채 탈출 카운트 표시 */
.sv-modal .sv-exitcd { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 5; padding: 6px 14px; border-radius: 999px; background: rgba(20,120,60,.92); color: #fff; font-size: 14px; pointer-events: none; box-shadow: 0 2px 10px rgba(0,0,0,.4); white-space: nowrap; }
/* · 167 피드백 · 버그 제보 창 */
.fb-form { display: flex; flex-direction: column; gap: 10px; }
.fb-type { display: flex; gap: 8px; }
.fb-type label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 6px; border-radius: 8px; background: var(--panel2); cursor: pointer; font-weight: 600; font-size: 14px; border: 2px solid transparent; }
.fb-type label:has(input:checked) { border-color: var(--accent, #f0b23a); }
.fb-type input { display: none; }
.fb-form .fb-title, .fb-form .fb-body { width: 100%; box-sizing: border-box; padding: 9px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.15); background: var(--panel2); color: var(--text); font: inherit; font-size: 14px; }
.fb-form .fb-body { resize: vertical; min-height: 110px; }
.fb-mail { margin: 0; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; word-break: break-all; }
.fb-note { color: var(--muted); font-size: 12px; }
@media (max-width: 420px) { .top-nav { gap: 2px; } }
/* · 169 시작 스플래시 (흰 배경 · 로고 2개 순서대로 팝) */
#splash-screen { position: fixed; inset: 0; z-index: 99999; background: #000; display: grid; place-items: center; cursor: pointer; transition: opacity .45s ease; }
#splash-screen.out { opacity: 0; pointer-events: none; }
#splash-screen .splash-logo { grid-area: 1 / 1; width: min(300px, 70vw); height: auto; opacity: 0; transform: scale(.3); user-select: none; -webkit-user-drag: none; }
#splash-screen .splash-logo.s1 { width: auto; height: min(340px, 52vh, 78vw); animation: splashPop 1.5s cubic-bezier(.2,1.6,.4,1) .15s forwards; }
#splash-screen .splash-logo.s2 { width: min(300px, 68vw); animation: splashPop 1.5s cubic-bezier(.2,1.6,.4,1) 1.65s forwards; }
/* · 212 소리 허용 전(모바일·첫 방문 PC): 로고 대기 + 'TOUCH TO START' → 누르면 효과음과 함께 로고 시작 */
#splash-screen:not(.go) .splash-logo.splash-logo { animation-play-state: paused; }
#splash-screen .splash-tap { grid-area: 1 / 1; align-self: center; display: none; flex-direction: column; align-items: center; gap: 8px; color: #fff; text-align: center; pointer-events: none; animation: splashTap 1.4s ease-in-out infinite; }
#splash-screen .splash-tap b { font-size: clamp(20px, 6vw, 30px); letter-spacing: .18em; font-weight: 800; }
#splash-screen .splash-tap span { font-size: 14px; opacity: .75; }
#splash-screen.wait .splash-tap { display: flex; }
@keyframes splashTap { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes splashPop {
  0% { opacity: 0; transform: scale(.3); }
  22% { opacity: 1; transform: scale(1.08); }
  34% { transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.92); }
}
/* · 169 닉네임 화면 꼬마 전쟁 로고 이미지 */
.title-logo-img { margin: -6px auto 4px; width: min(260px, 64vw); line-height: 0; animation: titleLogoIn .6s cubic-bezier(.2,1.5,.4,1) both; }
.title-logo-img img { width: 100%; height: auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)); user-select: none; -webkit-user-drag: none; }
@keyframes titleLogoIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 480px) { .title-card { padding: 26px 20px; } .title-logo-img { width: min(220px, 60vw); } .title-tag { margin-bottom: 18px; } }
@media (max-height: 640px) { .title-logo-img { width: min(170px, 46vw); } }
@media (max-height: 420px) { .title-logo-img { width: 120px; margin: -10px auto 0; } .title-card { padding: 16px 20px; } .title-tag { margin-bottom: 10px; } }
/* · 173 세로 모드: 점프는 공격 버튼 오른쪽 위 대각선에 붙여 낮게 (위쪽 스킬 줄과 겹치지 않게) */
html.m-portrait body.touch .m-a { right: -4px; bottom: 120px; width: 52px; height: 52px; font-size: 12px; }
/* · 174 방 새로고침 쿨타임 */
#btn-refresh.cd { opacity: .55; cursor: not-allowed; font-variant-numeric: tabular-nums; }
/* · 178 새로고침으로 새로 생긴 방 */
.room-row.new { animation: roomNew 1.2s ease-out; box-shadow: inset 3px 0 0 var(--accent, #f0b23a); }
.room-row.new .room-title::after { content: 'NEW'; margin-left: 6px; padding: 1px 5px; border-radius: 4px; background: var(--accent, #f0b23a); color: #1a1208; font-size: 10px; font-weight: 800; vertical-align: middle; }
@keyframes roomNew { from { background: color-mix(in srgb, var(--accent, #f0b23a) 30%, transparent); } }
/* · 182 잠수 자동 퇴장 경고 */
.afk-warn { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 9999; padding: 10px 18px; border-radius: 999px; background: rgba(200, 40, 40, .92); color: #fff; font-size: 15px; font-weight: 700; box-shadow: 0 4px 16px rgba(0,0,0,.5); pointer-events: none; white-space: nowrap; animation: afkPulse 1s ease-in-out infinite; }
.afk-warn b { font-size: 18px; }
@keyframes afkPulse { 50% { transform: translateX(-50%) scale(1.05); } }
@media (max-width: 420px) { .afk-warn { font-size: 13px; padding: 8px 12px; } }

/* · 187 갑옷 커스텀 색상 선택 · · 188 한 줄(기본 + 9색) 가로 배치 */
.tk-color { margin: 4px 0 8px; }
.tk-color small { display: block; font-size: 11px; color: #cfd6e6; margin-bottom: 4px; }
.tk-color small em { color: #8a93a8; font-style: normal; }
.tk-color.off .tk-sw { opacity: .55; }
.tk-sw { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; width: 100%; }
.tk-sw .sw, body.touch .tk-sw .sw { flex: 1 1 0; min-width: 0; max-width: 30px; min-height: 0; height: auto; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); background: var(--c, transparent); cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35); }
.tk-sw .sw.def, body.touch .tk-sw .sw.def { flex: 0 0 auto; max-width: none; aspect-ratio: auto; height: 22px; padding: 0 7px; border-radius: 11px; font-size: 10px; line-height: 1; color: #cfd6e6; background: rgba(255,255,255,.08); }
.tk-sw .sw.on, body.touch .tk-sw .sw.on, body.touch .tk-sw .sw.def.on { border-color: #ff2a2a; box-shadow: 0 0 0 2px #ff2a2a, 0 0 8px rgba(255,42,42,.7); }   /* · 215 모바일도 선택한 색상에 빨간 원 (body.touch 규칙이 테두리를 덮어쓰던 문제) */

/* · 225 용병 카테고리: 인간형 / 이종족 */
.hero-cat { grid-column: 1 / -1; flex-basis: 100%; width: 100%; margin: 6px 0 2px; font-size: 12px; font-weight: 800; color: var(--accent); display: flex; align-items: center; gap: 5px; }
.hero-cat:first-child { margin-top: 0; }
.hero-cat small { color: var(--muted, #9aa); font-weight: 600; }
.tk-cats { display: inline-flex; gap: 3px; flex: none; align-items: center; margin-right: 4px; }
.tk-cat { flex: none; height: 46px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: inherit; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tk-cat.on { border: 2px solid var(--accent); color: var(--accent); }
@media (max-width: 640px) { .tk-cat { height: 40px; padding: 0 6px; font-size: 11px; } }

/* · 228 암전: 실명 */
.battle-overlay.blind { background: radial-gradient(circle at 50% 50%, rgba(0,0,0,.35) 0%, rgba(4,0,12,.94) 45%); transition: background .2s; }
/* · 252 AI 난이도 9단계 */
#snd-pane .ai-h { margin: 12px 0 6px; } #snd-pane .ai-h small { color: #8b94a8; font-weight: 400; font-size: 11px; }
#snd-pane .ai-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
#snd-pane .ai-d { padding: 7px 0; border-radius: 8px; background: #222b3c; color: #cfd6e4; font-weight: 700; font-size: 12px; border: 1px solid #2f3a50; }
#snd-pane .ai-d.on { background: #ffb43a; color: #1a1206; border-color: #ffb43a; }
#snd-pane .ai-d.top:not(.on) { color: #ff8a6a; }
#snd-pane .ai-desc { margin: 6px 0 0; font-size: 11px; color: #aab3c4; line-height: 1.4; } #snd-pane .ai-desc b { color: #ffd36a; }
html.mobile #snd-pane { max-height: calc(100vh - 60px); overflow-y: auto; }
/* · 269 도감: 밸런스 보정 · 보스 규칙 */
.cx-bal { margin: -4px 0 8px; font-size: 12.5px; opacity: .92; } .cx-bal b.up { color: #5fd38a; } .cx-bal b.down { color: #ff8a7a; }
.cx-boss { margin: 0 0 10px; padding: 6px 10px; border-left: 3px solid #c0392b; background: #c0392b18; border-radius: 6px; font-size: 12.5px; line-height: 1.5; }
/* · 270 보스 HUD (전장 위쪽 가운데 · 기존 HUD와 별도 레이어) */
.bh-wrap { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); width: min(520px, 72%); z-index: 25; pointer-events: none; display: flex; flex-direction: column; gap: 6px; }
.ac-action .bh-wrap { top: 52px; }
.bh { background: linear-gradient(#160a10eb, #0b0f18eb); border: 1px solid #c0392b88; border-radius: 10px; padding: 5px 10px 6px; box-shadow: 0 4px 14px #0009; animation: bhIn .35s ease-out; }
.bh-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.bh-name { color: #ffd36a; font-weight: 900; letter-spacing: .5px; text-shadow: 0 1px 2px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-tag { display: none; font-size: 10px; font-weight: 900; color: #fff; background: #e0301e; border-radius: 99px; padding: 1px 7px; animation: bhPulse .8s infinite alternate; }
.bh.enr .bh-tag { display: inline-block; }
.bh-pct { margin-left: auto; font-weight: 800; color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.bh-hp { position: relative; height: 12px; border-radius: 6px; background: #2a1418; overflow: hidden; margin-top: 3px; box-shadow: inset 0 1px 3px #000a; }
.bh-hp i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.bh-lag { background: #ffe08a; transition: width .6s ease .35s; }
.bh-fill { background: linear-gradient(#ff6a4a, #c0291b); transition: width .12s; }
.bh.enr { border-color: #ff3a2a; box-shadow: 0 0 14px #ff3a2a66, 0 4px 14px #0009; }
.bh.enr .bh-fill { background: linear-gradient(#ff3a2a, #8a0a0a); animation: bhPulse .6s infinite alternate; }
.bh-sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.bh-stg { flex: 1; height: 5px; border-radius: 3px; background: #ffffff1a; overflow: hidden; }
.bh-stg i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb02a, #ffe14a); transition: width .15s; }
.bh-stl { font-style: normal; font-size: 10px; color: #ffd36a; opacity: .9; white-space: nowrap; }
.bh.grog .bh-stg i { background: #fff; animation: bhPulse .3s infinite alternate; }
.bh.grog .bh-stl { color: #fff; font-weight: 900; }
.bh.cd .bh-stg i { background: #6a7a8a; transition: none; }
.bh.cd .bh-stl { color: #9aa4ad; }
.bh.dead { opacity: .6; filter: grayscale(.6); }
.bh-warn { display: none; text-align: center; font-size: 13px; font-weight: 900; color: #fff; background: #c0291bcc; border-radius: 6px; margin-top: 4px; padding: 2px 6px; }
.bh-warn.on { display: block; animation: bhPulse .25s infinite alternate; }
@keyframes bhIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes bhPulse { from { opacity: 1; } to { opacity: .55; } }
@media (max-width: 520px) { .bh-wrap { width: 84%; top: 4px; gap: 4px; } .bh { padding: 3px 8px 4px; } .bh-top { font-size: 11px; } .bh-hp { height: 9px; } .bh-warn { font-size: 11px; } }
/* · 270 DANGER 경보 (보스 첫 등장) */
.bh-danger { position: absolute; inset: 0; z-index: 45; pointer-events: none; display: flex; flex-direction: column; justify-content: center; gap: 14px; overflow: hidden; animation: bhDgFade 2.9s forwards; }
.bh-danger::before { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 90px #ff0000; animation: bhPulse .35s infinite alternate; }
.bh-dg-band { position: relative; overflow: hidden; white-space: nowrap; background: #ffcc00; height: 30px; line-height: 30px; border-top: 4px solid #111; border-bottom: 4px solid #111; transform: rotate(-3deg) scaleX(1.15); box-shadow: 0 0 14px #000a; }
.bh-dg-band span { display: inline-block; color: #1a0000; font-weight: 900; font-size: 16px; letter-spacing: 2px; animation: bhMarq 4s linear infinite; }
.bh-dg-band.bot span { animation-direction: reverse; }
.bh-dg-mid { position: relative; text-align: center; }
.bh-dg-mid b { display: block; font-size: clamp(34px, 8vw, 72px); font-weight: 900; font-style: italic; color: #ff2a1a; letter-spacing: 4px; text-shadow: 0 0 10px #ff0000, 0 4px 0 #000, 0 0 30px #000; animation: bhFlick .2s steps(2) infinite; }
.bh-dg-mid small { display: block; margin-top: 4px; font-size: clamp(13px, 2.6vw, 18px); font-weight: 800; color: #fff; text-shadow: 0 2px 4px #000; }
@keyframes bhMarq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes bhDgFade { 0% { opacity: 0; } 6% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bhFlick { 50% { opacity: .5; } }
/* · 270 훈련장 패널 · 조작 가이드 */
.training .tr-panel { position: absolute; left: 10px; top: 10px; z-index: 20; width: 236px; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px; background: #0b0f18d9; border: 1px solid var(--line); font-size: 12px; pointer-events: auto; }
.tr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center; }
.tr-stats small { display: block; font-size: 10px; color: var(--muted); } .tr-stats b { font-size: 15px; color: #ffd36a; font-variant-numeric: tabular-nums; }
.tr-row { display: flex; gap: 4px; } .tr-row select { flex: 1; min-width: 0; background: #141a28; color: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; font-size: 12px; }
.tr-b { flex: 1; padding: 5px 6px; border-radius: 6px; background: #ffffff14; color: #fff; font-weight: 700; font-size: 12px; } .tr-b:hover { background: #ffffff26; } .tr-reset { flex: 0 0 32px; }
.tr-tg { flex-wrap: wrap; gap: 8px; } .tr-tg label { display: flex; align-items: center; gap: 3px; color: #cfd6dc; }
.tr-fold { position: absolute; right: -2px; bottom: -22px; width: 30px; height: 20px; border-radius: 0 0 6px 6px; background: #0b0f18d9; color: #fff; font-size: 11px; }
.tr-panel.fold > :not(.tr-stats):not(.tr-fold) { display: none; } .tr-panel.fold .tr-fold i { transform: rotate(180deg); }
.training .bh-wrap { left: auto; right: 10px; transform: none; width: min(420px, 48%); }
@media (max-width: 640px) { .training .tr-panel { width: 190px; padding: 6px; } .training .bh-wrap { width: calc(100% - 214px); } .tr-stats b { font-size: 13px; } }
html.m-portrait .training .tr-panel { width: 172px; font-size: 11px; } html.m-portrait .training .bh-wrap { width: calc(100% - 196px); top: 6px; }
.gd { display: flex; flex-direction: column; gap: 12px; font-size: 13px; line-height: 1.55; }
.gd h4 { font-size: 14px; margin-bottom: 4px; color: #ffd36a; display: flex; gap: 6px; align-items: center; } .gd h4 small { color: var(--muted); font-weight: 500; font-size: 11px; }
.gd ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; } .gd li { padding-left: 2px; }
.gd kbd { font-family: inherit; font-weight: 800; color: #fff; background: #ffffff1f; border-radius: 4px; padding: 0 5px; }
.gd-hero { background: #ffffff08; border-radius: 8px; padding: 8px 10px; } .gd-hero .sk-list { margin-top: 6px; }
.gd-boss { border-left: 3px solid #c0392b; padding-left: 8px; } .gd-red { color: #ff4a3a; } .gd-dim { color: var(--muted); }
.tr-stats small { white-space: nowrap; letter-spacing: -.3px; }
@media (max-width: 640px) { .tr-stats small { font-size: 9px; } .training .tr-panel.fold { width: 172px; } }
/* · 273 오토체스 상점: 공격 방식 아이콘 색 */
.shop-card .ac-at-melee { color: #ff9a6a; }
.shop-card .ac-at-ranged { color: #6ad0ff; }
.shop-card .ac-at-mage { color: #c58aff; }

/* · 279 출석체크 */
#btn-attend { position: relative; }
#btn-attend.has-dot::after { content: ''; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--red); }
.att-info { margin-bottom: 10px; font-size: 14px; }
.att-info b { color: var(--gold); }
.att-grid { list-style: none; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0 0 10px; padding: 0; }
.att-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); text-align: center; }
.att-cell small { font-size: 10px; }
.att-cell i { color: var(--gold); font-size: 15px; }
.att-cell b { font-size: 12px; }
.att-cell em { font-style: normal; font-size: 10px; color: var(--muted); }
.att-cell.big { border-color: var(--accent2); background: linear-gradient(180deg, #3a2a14, var(--panel2)); }
.att-cell.big i { color: var(--accent2); font-size: 18px; }
.att-cell.next { border-color: var(--ok); box-shadow: 0 0 0 2px rgba(63, 208, 122, .35); }
.att-cell.got { opacity: .55; }
.att-stamp { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; color: var(--red); transform: rotate(-12deg); }
.att-stamp i { color: var(--red) !important; font-size: 26px !important; }
.att-note { display: block; }
.modal-foot .btn:disabled { opacity: .5; cursor: default; }
@media (max-width: 520px) { .att-grid { gap: 4px; } .att-cell b { font-size: 10px; } .att-cell em { display: none; } }

/* · 280 로비 모바일 햄버거 메뉴 */
.nav-burger { display: none; margin-left: auto; position: relative; width: 40px; height: 40px; border-radius: 10px; font-size: 20px; color: var(--text); background: var(--panel2); border: 1px solid var(--line); }
.nav-burger.has-dot::after { content: ''; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 6px var(--red); }
@media (max-width: 640px) { #top-bar .nav-burger { display: inline-flex; align-items: center; justify-content: center; } }
html.mobile #top-bar .nav-burger { display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 640px) {
  #top-bar #lobby-nav { display: none; position: absolute; top: 100%; right: 8px; margin: 6px 0 0; flex-direction: column; gap: 2px; min-width: 180px; padding: 6px; background: rgba(16, 21, 34, .98); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
  #top-bar #lobby-nav.open { display: flex; }
  #top-bar #lobby-nav .nav-btn { text-align: left; padding: 12px 14px; font-size: 15px; white-space: nowrap; }
  #top-bar #lobby-nav .nav-btn i { width: 22px; text-align: center; margin-right: 6px; }
}
html.mobile #top-bar #lobby-nav { display: none; position: absolute; top: 100%; right: 8px; margin: 6px 0 0; flex-direction: column; gap: 2px; min-width: 180px; padding: 6px; background: rgba(16, 21, 34, .98); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
html.mobile #top-bar #lobby-nav.open { display: flex; }
html.mobile #top-bar #lobby-nav .nav-btn { text-align: left; padding: 12px 14px; font-size: 15px; white-space: nowrap; }
html.mobile #top-bar #lobby-nav .nav-btn i { width: 22px; text-align: center; margin-right: 6px; }

/* · 281 원스토어 H5 SDK / · 282 수정: 원스토어 앱 안(html.os-app)에서만 적용
   - safeArea 여백은 넣지 않음 (앱이 이미 시스템 바 아래에 게임을 띄워서 여백이 두 번 들어가 위쪽이 비었음)
   - 페이지 전체 스크롤 대신 #app 안에서 스크롤 (앱 iframe 안에서 문서 스크롤이 안 먹는 문제) */
html.os-app, html.os-app body { height: 100%; overflow: hidden; overscroll-behavior: none; }
/* 원스토어 앱이 오른쪽 위에 띄우는 메뉴 버튼(⠿)과 햄버거 버튼이 겹치지 않게 오른쪽 여백 */
html.os-app #top-bar { padding-right: 64px; }
html.os-app #app { height: 100%; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
.btn-ad { width: 100%; margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: 14px; color: #fff; background: linear-gradient(135deg, #3d6bee, #7a4dff); box-shadow: 0 4px 14px #3d6bee55; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-ad small { font-weight: 500; opacity: .85; }
.btn-ad:disabled { opacity: .45; box-shadow: none; }

/* · 283 원스토어 앱: 오른쪽 위 원스토어 메뉴 버튼(⠿)에 게임 상단 버튼(소리 · 포기 / 로비로)이 가리지 않게 */
html.os-app #app .game-top { padding-right: 64px; }
html.os-app body:has(#snd-fab.in-bar) #snd-pane { top: 62px; }
/* · 283 오토체스 상점: 다 산 칸도 카드 높이 그대로 '없음' 표시 */
.shop-card.empty { cursor: default; }
.shop-card.empty:hover { transform: none; }
.shop-card.empty .empty-slot { display: grid; place-items: center; background: transparent; border: 2px dashed var(--line); color: var(--muted); opacity: .6; width: 56px; height: 56px; }
.shop-card.empty .empty-slot i { font-size: 18px; }
.shop-card.empty b { color: var(--muted); font-weight: 600; }

/* · 284 Playgama 빌드: 브라우저 페이지 스크롤 없음 (심사 1.6.3 — #app 안에서만 스크롤) · 길게 눌러도 글자 선택 · 메뉴 없음 (1.4.5) */
html.pg-app, html.pg-app body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.pg-app #app { height: 100%; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
html.pg-app body { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
html.pg-app input, html.pg-app textarea { -webkit-user-select: text; user-select: text; }

/* · 285 언어 (한국어 / English) */
.title-logo-en { font-size: clamp(40px, 11vw, 58px); margin: 4px 0 6px; }
.title-lang { margin: 14px 0 0; }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; }
.lang-modal { width: min(320px, 92vw); }
.lang-list { display: grid; gap: 10px; }
.lang-opt { justify-content: center; font-size: 16px; padding: 12px; }
.lang-opt.on { border-color: var(--accent); color: var(--accent); }
html.lang-en .splash-tap span { display: none; }
html.lang-en .b-slot.rsv::after { content: 'RSV'; }
html.lang-en .ac-late .gt-center::after { content: 'Spectating'; }

/* · 288 대기방 슬롯: 긴 이름(영어 AI 이름 등)이 칸을 밀어내 옆 패널을 덮던 문제 → 칸은 고정 비율, 이름은 … 처리 */
.slots ul, .slots.team .team-col ul { min-width: 0; }
.slots.solo ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.slots.solo.n2 ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.slots.solo.n1 ul, .slots.solo.n3 ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.slots.team { grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr); }
.slots.team .team-col { min-width: 0; }
.slots.team .team-col ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.slots li, .slot { min-width: 0; }
.slot { overflow: hidden; }
.slot-info small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#slot-panel { min-width: 0; overflow: hidden; }
@media (max-width: 1100px) { .slots.solo ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
