/* 차사 : 악마사냥꾼 — 수묵 다크 판타지 UI */
:root{
  --ink:#e9e4d6; --sub:#9aa3ad; --dim:#6b7480;
  --bg:#07090d; --panel:rgba(13,17,23,.88); --panel2:rgba(20,26,33,.9);
  --line:rgba(120,180,180,.20); --line2:rgba(217,180,106,.28);
  --teal:#63d3c6; --red:#e0563c; --gold:#d9b46a; --purple:#9a7bd0;
  --serif:"AppleMyungjo","Nanum Myeongjo","Noto Serif KR","Batang",serif;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%;margin:0;background:var(--bg);overflow:hidden}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Malgun Gothic","Noto Sans KR",sans-serif;
  color:var(--ink);user-select:none;-webkit-user-select:none;
  overscroll-behavior:none;touch-action:none;
}
#app{position:fixed;inset:0;overflow:hidden}
#game{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none}
.hidden{display:none !important}
.muted{color:var(--sub)}
.kicker{font-size:11px;letter-spacing:.32em;color:var(--teal);text-transform:uppercase;margin-bottom:6px}
.kicker.danger{color:#ff7d5c}

/* ══════ 화면 공통 ══════ */
.screen{position:absolute;inset:0;z-index:20;display:flex;overflow-y:auto;overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  background:
    radial-gradient(120% 70% at 50% 0%,rgba(38,60,64,.55),transparent 60%),
    radial-gradient(90% 60% at 50% 110%,rgba(60,20,16,.45),transparent 60%),
    linear-gradient(180deg,#080b11 0%,#0a0e14 45%,#0c1015 100%);
}
.screen.overlay{background:rgba(4,6,9,.82);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);align-items:center;justify-content:center}
.lobby-inner{width:100%;max-width:520px;margin:auto;padding:calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom))}
.sel-inner{width:100%;max-width:620px;margin:auto;padding:calc(22px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom))}

/* ══════ 로비 브랜드 ══════ */
.brand{text-align:center;position:relative;margin-bottom:12px}
.dev{position:absolute;left:0;top:0;font-size:10px;letter-spacing:.14em;color:var(--dim);
  border:1px solid rgba(255,255,255,.12);border-radius:20px;padding:2px 7px}
.brand h1{font-family:var(--serif);font-size:31px;margin:8px 0 1px;letter-spacing:-.5px;
  background:linear-gradient(180deg,#f4edda 20%,#c9b58c 75%,#9a7c4e);-webkit-background-clip:text;background-clip:text;color:transparent;
  text-shadow:0 0 26px rgba(217,180,106,.18)}
.brand h1 span{font-size:22px;letter-spacing:-.5px}
.brand-sub{font-size:10px;letter-spacing:.4em;color:var(--teal);opacity:.85;margin-bottom:6px}
.tagline{font-family:var(--serif);font-size:12.5px;color:var(--sub);margin:0;letter-spacing:.02em}

/* ══════ 영혼석 ══════ */
.soulrow{display:flex;align-items:center;gap:7px;justify-content:center;margin:4px 0 10px;font-size:12.5px}
.soul-ico{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-family:var(--serif);font-size:12px;
  color:#dff7ff;background:radial-gradient(circle at 35% 30%,#7fe3ff,#2a6b8c 70%);box-shadow:0 0 12px rgba(120,220,255,.45)}
.soulrow b{font-size:16px;color:#dff7ff;font-variant-numeric:tabular-nums}
.rec{margin-left:auto;font-size:11px;color:var(--gold);opacity:.9}

/* ══════ 패널 ══════ */
.panel{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:10px;margin-bottom:9px;
  box-shadow:0 10px 26px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.03)}
.panel.narrow{width:calc(100% - 32px);max-width:400px;padding:20px;margin:auto}
.panel-h{font-size:11.5px;font-weight:700;color:var(--ink);margin-bottom:8px;display:flex;align-items:baseline;gap:6px}
.panel-h .muted{font-size:10.5px;font-weight:400}
.p-title{font-family:var(--serif);font-size:22px;margin:0 0 14px}

/* ══════ 영맥 ══════ */
.ym-list{display:flex;flex-direction:column;gap:6px}
.ym{display:flex;align-items:center;gap:9px;padding:6px 8px;border-radius:10px;background:rgba(255,255,255,.025);
  border:1px solid rgba(255,255,255,.045)}
.ym .glyph{width:27px;height:27px;flex:0 0 auto;border-radius:8px;display:grid;place-items:center;font-family:var(--serif);
  font-size:15px;color:var(--teal);background:rgba(99,211,198,.09);border:1px solid rgba(99,211,198,.22)}
.ym .body{min-width:0;flex:1}
.ym .nm{font-size:12.5px;font-weight:700;display:flex;gap:6px;align-items:baseline}
.ym .ds{font-size:10px;color:var(--sub);margin-top:0}
.ym .pips{display:flex;gap:2px;margin-top:3px}
.ym .pips i{width:9px;height:3px;border-radius:2px;background:rgba(255,255,255,.14)}
.ym .pips i.on{background:linear-gradient(90deg,var(--teal),#2f8f86);box-shadow:0 0 6px rgba(99,211,198,.6)}
.ym button{flex:0 0 auto;border:1px solid var(--line2);background:rgba(217,180,106,.08);color:var(--gold);
  border-radius:9px;padding:6px 8px;font:700 11px inherit;font-family:inherit;cursor:pointer;min-width:62px}
.ym button:disabled{opacity:.35;border-color:rgba(255,255,255,.1);color:var(--dim);background:transparent}
.ym button:active:not(:disabled){transform:scale(.96)}
.ym button .c{font-family:var(--serif);margin-right:3px}

/* ══════ 장 선택 ══════ */
.chips{display:grid;grid-template-columns:repeat(5,1fr);gap:5px}
.chip{border:1px solid rgba(255,255,255,.09);background:rgba(255,255,255,.03);border-radius:9px;
  color:var(--sub);font:700 10px inherit;font-family:inherit;padding:7px 1px;cursor:pointer;line-height:1.2;overflow:hidden}
.chip .n{display:block;font-size:12.5px;color:var(--ink);margin-bottom:1px}
.chip.on{border-color:var(--teal);background:rgba(99,211,198,.13);color:var(--teal);box-shadow:0 0 0 1px rgba(99,211,198,.25) inset,0 0 16px rgba(99,211,198,.15)}
.chip.on .n{color:#d9fff9}
.chip:disabled{opacity:.3;cursor:default}

/* ══════ 버튼 ══════ */
.big-btn{width:100%;border:1px solid rgba(217,180,106,.45);border-radius:13px;padding:11px 14px;cursor:pointer;
  background:linear-gradient(180deg,rgba(120,44,32,.9),rgba(74,20,16,.95));
  box-shadow:0 8px 22px rgba(120,30,20,.35),inset 0 1px 0 rgba(255,190,150,.25);
  color:#ffeede;font-family:inherit;display:flex;flex-direction:column;align-items:center;gap:2px}
.big-btn:active{transform:translateY(1px) scale(.995)}
.bb-main{font-family:var(--serif);font-size:19px;letter-spacing:.06em}
.bb-sub{font-size:10.5px;color:rgba(255,225,200,.65);letter-spacing:.02em}
.ghost-btn{width:100%;margin-top:10px;border:1px solid rgba(255,255,255,.13);background:transparent;color:var(--sub);
  border-radius:11px;padding:11px;font:600 12px inherit;font-family:inherit;cursor:pointer}
.ghost-btn:active{background:rgba(255,255,255,.05)}
.lobby-foot{display:flex;gap:8px;justify-content:center;font-size:9.5px;margin-top:9px}
.lobby-foot .dot{color:var(--dim)}

/* ══════ 무기/레벨업 카드 ══════ */
.wcards{display:flex;flex-direction:column;gap:10px}
.wcard{position:relative;display:flex;gap:12px;align-items:center;text-align:left;width:100%;cursor:pointer;
  background:linear-gradient(160deg,rgba(28,36,44,.95),rgba(14,19,25,.95));
  border:1px solid var(--line);border-radius:14px;padding:13px;color:var(--ink);font-family:inherit;
  box-shadow:0 8px 24px rgba(0,0,0,.35)}
.wcard:active{transform:scale(.99)}
.wcard .seal{flex:0 0 auto;width:46px;height:46px;border-radius:50%;display:grid;place-items:center;
  font-family:var(--serif);font-size:20px;color:#eafffb;background:radial-gradient(circle at 35% 30%,rgba(99,211,198,.55),rgba(20,50,52,.9));
  border:1px solid rgba(99,211,198,.45);box-shadow:0 0 16px rgba(99,211,198,.22)}
.wcard .body{flex:1;min-width:0}
.wcard .nm{font-family:var(--serif);font-size:17px;display:flex;align-items:baseline;gap:7px}
.wcard .nm .lv{font-family:-apple-system,sans-serif;font-size:10px;color:var(--teal);letter-spacing:.04em}
.wcard .ds{font-size:11.5px;color:var(--sub);margin-top:3px;line-height:1.45}
.wcard .tag{position:absolute;top:-8px;right:12px;font-size:9.5px;letter-spacing:.06em;padding:2px 7px;border-radius:20px;
  background:#1a2b2b;border:1px solid rgba(99,211,198,.4);color:var(--teal)}
.wcard.evo{background:linear-gradient(160deg,rgba(58,24,20,.95),rgba(26,14,16,.96));border-color:rgba(224,86,60,.55);
  box-shadow:0 0 0 1px rgba(224,86,60,.18) inset,0 0 26px rgba(224,86,60,.18)}
.wcard.evo .seal{background:radial-gradient(circle at 35% 30%,rgba(255,150,90,.85),rgba(120,26,14,.95));
  border-color:rgba(255,150,90,.7);box-shadow:0 0 22px rgba(255,110,60,.5)}
.wcard.evo .tag{background:#3a1410;border-color:rgba(255,150,90,.6);color:#ffb489}
.wcard.evo .nm{color:#ffd7c2}
.wcard .pips{display:flex;gap:3px;margin-top:6px}
.wcard .pips i{width:12px;height:3px;border-radius:2px;background:rgba(255,255,255,.13)}
.wcard .pips i.on{background:linear-gradient(90deg,#ffb489,var(--red));box-shadow:0 0 6px rgba(255,130,90,.6)}
.wcard .pips i.on2{background:linear-gradient(90deg,var(--teal),#2f8f86);box-shadow:0 0 6px rgba(99,211,198,.55)}

/* ══════ 선택 화면 ══════ */
.sel-h{text-align:center;margin-bottom:16px}
.sel-h h2{font-family:var(--serif);font-size:24px;margin:0 0 6px}
.sel-h p{font-size:11.5px;margin:0}
.wcard.sel{padding:16px 14px}
.wcard.sel .seal{width:54px;height:54px;font-size:24px}

/* ══════ 레벨업 오버레이 ══════ */
.lv-inner{width:100%;max-width:440px;padding:20px 16px;margin:auto;text-align:center}
.lv-inner h2{font-family:var(--serif);font-size:20px;margin:0 0 14px}
.lvcards{gap:9px}
.lvcards .wcard{padding:11px 12px}
.lvcards .wcard .seal{width:40px;height:40px;font-size:17px}
.lvcards .wcard .nm{font-size:15.5px}
.lv-foot{font-size:10.5px;margin-top:12px}

/* ══════ 인게임 HUD ══════ */
#hud{position:absolute;inset:0;z-index:10;pointer-events:none;font-variant-numeric:tabular-nums}
#xpbar{position:absolute;top:0;left:0;right:0;height:3px;background:rgba(255,255,255,.07)}
#xpbar i{display:block;height:100%;width:0%;background:linear-gradient(90deg,#2f8f86,#7ff0e2);
  box-shadow:0 0 10px rgba(127,240,226,.7);transition:width .12s linear}
.hud-top{display:flex;gap:8px;align-items:flex-start;padding:calc(8px + env(safe-area-inset-top)) 10px 0}
.hud-left{flex:1;min-width:0}
.stage-line{display:flex;align-items:center;gap:5px;font-size:11px;font-weight:700;color:#dfe8e6;
  text-shadow:0 1px 4px #000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stage-line .tag{font-size:8.5px;padding:1px 5px;border-radius:10px;background:rgba(224,86,60,.25);
  border:1px solid rgba(255,140,110,.5);color:#ffb49b;font-weight:700}
.hpwrap{display:flex;align-items:center;gap:5px;margin-top:4px}
#hpbar{width:118px;height:7px;border-radius:4px;background:rgba(0,0,0,.55);border:1px solid rgba(255,255,255,.12);overflow:hidden}
#hpbar i{display:block;height:100%;width:100%;background:linear-gradient(90deg,#8f2b1e,#e0563c 60%,#ff8a63);
  box-shadow:0 0 8px rgba(224,86,60,.6);transition:width .15s ease}
#hpTxt{font-size:9.5px;color:#ffcdbd;text-shadow:0 1px 3px #000}
.lvline{display:flex;gap:7px;font-size:9.5px;color:#cfd8d6;margin-top:3px;text-shadow:0 1px 3px #000}
.lvline #lvTag{color:var(--gold);font-weight:700}
.lvline #soulTag{color:#a9e9ff}
.hud-mid{flex:0 0 auto;text-align:center;min-width:70px}
#timer{font-size:15px;font-weight:800;letter-spacing:.04em;color:#eef6f4;text-shadow:0 0 10px rgba(0,0,0,.9),0 1px 3px #000}
#bossWrap{margin-top:3px}
#bossName{font-size:9.5px;color:#ffb49b;font-weight:700;text-shadow:0 1px 3px #000;white-space:nowrap}
#bossbar{width:104px;height:5px;margin:2px auto 0;border-radius:3px;background:rgba(0,0,0,.6);
  border:1px solid rgba(255,120,90,.5);overflow:hidden}
#bossbar i{display:block;height:100%;width:100%;background:linear-gradient(90deg,#ff7a3a,#ffd06a);
  box-shadow:0 0 10px rgba(255,140,60,.8);transition:width .12s linear}
.hud-right{flex:1;display:flex;justify-content:flex-end;gap:6px;pointer-events:auto}
.ico{width:34px;height:34px;border-radius:10px;border:1px solid rgba(255,255,255,.16);
  background:rgba(10,14,19,.6);color:#dfe8e6;font-size:13px;font-family:inherit;cursor:pointer;
  display:grid;place-items:center;backdrop-filter:blur(3px)}
.ico:active{transform:scale(.94)}
.ico.off{color:#5c6874;border-color:rgba(255,255,255,.08)}
#toast{position:absolute;left:50%;top:33%;transform:translate(-50%,-50%);text-align:center;pointer-events:none;
  font-family:var(--serif);font-size:22px;letter-spacing:.06em;color:#ffe6cf;
  text-shadow:0 0 18px rgba(255,110,60,.8),0 2px 8px #000;white-space:nowrap;animation:toastIn .35s ease}
#toast small{display:block;font-family:-apple-system,sans-serif;font-size:11px;letter-spacing:.06em;color:#a9e9ff;margin-top:4px}
@keyframes toastIn{0%{opacity:0;transform:translate(-50%,-50%) scale(.86)}100%{opacity:1;transform:translate(-50%,-50%) scale(1)}}
#joyHint{position:absolute;left:50%;bottom:26%;transform:translateX(-50%);font-size:10.5px;color:rgba(220,235,232,.55);
  letter-spacing:.08em;pointer-events:none;transition:opacity .6s;text-shadow:0 1px 4px #000}
#skillTray{position:absolute;left:10px;bottom:calc(10px + env(safe-area-inset-bottom));display:flex;gap:6px;flex-wrap:wrap;max-width:70%}
#skillTray .sc{min-width:32px;height:30px;padding:0 7px;border-radius:9px;border:1px solid rgba(255,255,255,.14);
  background:rgba(8,12,17,.62);display:flex;align-items:center;gap:4px;font-size:9px;color:#dfecea;backdrop-filter:blur(2px)}
#skillTray .sc b{font-family:var(--serif);font-size:14px;color:var(--teal);font-weight:400}
#skillTray .sc.evo{border-color:rgba(255,140,90,.6);box-shadow:0 0 12px rgba(255,110,60,.25)}
#skillTray .sc.evo b{color:#ffb489}

/* ══════ 클리어/사망 ══════ */
.clear-panel{text-align:center}
.clear-rewards{display:flex;justify-content:center;gap:18px;margin:6px 0 16px}
.clear-rewards div{font-size:11px;color:var(--sub)}
.clear-rewards b{display:block;font-size:20px;color:#dff7ff;font-family:var(--serif);margin-top:2px}
.p-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:16px}
.p-stats div{background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.06);border-radius:9px;padding:9px;font-size:10.5px;color:var(--sub)}
.p-stats b{display:block;font-size:16px;color:var(--ink);font-family:var(--serif);margin-top:1px}

/* ══════ 데스크톱 ══════ */
@media (min-width:760px){
  .hud-top{padding:14px 18px 0}
  #hpbar{width:160px;height:8px}
  #timer{font-size:18px}
  #bossbar{width:150px}
  .lobby-inner{max-width:560px}
  .brand h1{font-size:42px}
  .brand h1 span{font-size:26px}
  .wcards{gap:12px}
  .sel-inner .wcards{flex-direction:row;align-items:stretch}
  .sel-inner .wcard{flex-direction:column;align-items:flex-start;gap:10px;flex:1}
  .lvcards{flex-direction:row}
  .lvcards .wcard{flex-direction:column;align-items:flex-start;flex:1;min-height:150px}
  .lvcards .wcard .seal{width:44px;height:44px}
  #skillTray{bottom:16px;left:16px}
}
@media (max-height:700px){
  .brand h1{font-size:28px}
  .tagline{display:none}
  .panel{padding:10px;margin-bottom:9px}
  .ym{padding:6px 8px}
}
