/* 루엔 연대기 리뉴얼 — 화면 꾸밈 */
:root {
  --bg: #0c0f16; --panel: #141926; --panel2: #1b2233; --line: #2c354a; --line2: #3b4660;
  --text: #ece7da; --muted: #96a0b5; --gold: #d9b56c; --gold2: #f3d9a0;
  --hp: #d0473f; --mp: #3f86e0; --xp: #cfa64e; --good: #7fd18a; --warn: #f0a35a;
  --t0: #b9bec8; --t1: #7fd18a; --t2: #6aa8ff; --t3: #c193ff; --t4: #f3b84c;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", "AppleMyungjo", serif;
  --sans: "Pretendard", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans);
  overflow: hidden; overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; }
kbd { font: 600 10px var(--sans); color: var(--muted); border: 1px solid var(--line2); border-radius: 4px; padding: 0 4px; }

.btn { padding: 12px 20px; border-radius: 10px; font-weight: 700; border: 1px solid var(--line2); background: var(--panel2); min-height: 44px; }
.btn:active { transform: translateY(1px); }
.btn.gold { background: linear-gradient(180deg, #e6c684, #b8904a); color: #20170a; border-color: #f3d9a0; }
.btn.small { padding: 7px 12px; min-height: 34px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: default; }

/* ── 첫 화면 ─────────────────────────────────────────── */
#title { overflow-y: auto; }
.title-bg { position: fixed; inset: 0; background: url(assets/map0.webp) center/cover; filter: saturate(.9); }
.title-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,10,16,.72), rgba(8,10,16,.9) 55%, #0c0f16); }
.title-inner { position: relative; max-width: 980px; margin: 0 auto; padding: calc(28px + var(--safe-t)) 16px calc(40px + var(--safe-b)); }
.logo { text-align: center; margin-bottom: 22px; }
.logo-en { letter-spacing: .5em; font-size: 11px; color: var(--gold); }
.logo h1 { font: 900 clamp(38px, 8vw, 64px)/1.1 var(--serif); margin: 6px 0 8px; letter-spacing: .08em;
  background: linear-gradient(180deg, #fff3d6, #c99c52); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 6px 30px rgba(0,0,0,.5); }
.logo p { margin: 0; color: var(--muted); font-family: var(--serif); }
.card { background: rgba(20,25,38,.88); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-top: 14px;
  backdrop-filter: blur(8px); box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.card h2 { margin: 0 0 12px; font: 700 16px var(--serif); color: var(--gold2); letter-spacing: .06em; }
.char-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.char-item { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 12px;
  border: 1px solid var(--line2); background: var(--panel2); text-align: left; }
.char-item:hover { border-color: var(--gold); }
.char-item b { display: block; font-size: 15px; }
.char-item small { color: var(--muted); }
.char-item small.afk-tag { display: block; color: var(--gold2); margin-top: 2px; }
.class-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.class-card { position: relative; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, #1c2334, #121723);
  padding: 10px 8px 12px; text-align: center; overflow: hidden; transition: .15s; }
.class-card .sprite { margin: 0 auto 6px; }
.class-card b { display: block; font: 700 17px var(--serif); }
.class-card small { color: var(--muted); font-size: 11.5px; }
.class-card.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 10px 30px rgba(217,181,108,.18); transform: translateY(-2px); }
.create-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.create-row input { flex: 1 1 180px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line2); background: #0e121b; padding: 0 14px; outline: none; }
.create-row input:focus { border-color: var(--gold); }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.seg button { padding: 0 16px; min-height: 44px; color: var(--muted); }
.seg button.on { background: var(--panel2); color: var(--gold2); font-weight: 700; }
.form-msg { color: var(--warn); min-height: 1.3em; margin: 8px 0 0; font-size: 13px; }

/* 로그인 */
#login { max-width: 440px; margin-left: auto; margin-right: auto; }
.login-tabs { display: flex; width: 100%; margin-bottom: 12px; }
.login-tabs button { flex: 1; }
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-form input { min-height: 46px; border-radius: 10px; border: 1px solid var(--line2); background: #0e121b; padding: 0 14px; outline: none; font-size: 15px; }
.login-form input:focus { border-color: var(--gold); }
.login-note { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; line-height: 1.55; }
.account-bar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.account-bar b { color: var(--gold2); }
.pw-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pw-form input { flex: 1 1 140px; min-height: 36px; border-radius: 8px; border: 1px solid var(--line2); background: #0e121b; padding: 0 10px; user-select: text; -webkit-user-select: text; }

/* 캐릭터 그림 한 칸 잘라 보여주기 */
.sprite { background-repeat: no-repeat; image-rendering: auto; }
.face { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold); background-color: #0e121b; background-repeat: no-repeat; flex: 0 0 auto; }

/* ── 게임 화면 ───────────────────────────────────────── */
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; background: #07090d; }
#hud { position: absolute; inset: 0; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#hud > * { pointer-events: auto; }
.glass { background: rgba(13,17,26,.78); border: 1px solid rgba(120,135,165,.28); border-radius: 12px; backdrop-filter: blur(6px); }

#me-card { position: absolute; left: calc(10px + var(--safe-l)); top: calc(10px + var(--safe-t)); display: flex; gap: 10px; padding: 8px 12px 8px 8px; width: min(290px, 62vw); }
.me-info { flex: 1; min-width: 0; }
.me-name { display: flex; gap: 6px; align-items: baseline; font-size: 13.5px; font-weight: 700; margin-bottom: 4px; white-space: nowrap; overflow: hidden; }
.me-name b { color: var(--gold); font-size: 12px; }
.bar { position: relative; height: 13px; border-radius: 7px; background: #070a10; border: 1px solid rgba(255,255,255,.08); overflow: hidden; margin-top: 3px; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px; transition: width .18s; }
.bar span { position: absolute; inset: 0; font: 700 9.5px/12px var(--sans); text-align: center; text-shadow: 0 1px 2px #000; }
.bar.hp i { background: linear-gradient(180deg, #ea6a5f, #a82f2a); }
.bar.mp i { background: linear-gradient(180deg, #62a6f5, #2a62b8); }
.bar.xp { height: 5px; } .bar.xp i { background: var(--xp); }
#buffs { position: absolute; left: 8px; top: calc(100% + 6px); display: flex; gap: 5px; }
#buffs img { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--gold); }

#top-right { position: absolute; right: calc(10px + var(--safe-r)); top: calc(10px + var(--safe-t)); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none !important; }
#top-right > * { pointer-events: auto; }
.pill-row { display: flex; gap: 12px; align-items: center; padding: 6px 12px; font-size: 13px; }
.zone-name { font-family: var(--serif); color: var(--gold2); }
.coin { display: inline-flex; gap: 5px; align-items: center; font-variant-numeric: tabular-nums; }
.coin img { width: 15px; height: 15px; }
#menu { display: flex; padding: 3px; gap: 2px; }
#menu button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 46px; padding: 7px 8px 5px; border-radius: 9px; font-size: 12.5px; font-weight: 600; }
#menu button:hover { background: rgba(255,255,255,.07); }
.dot { position: absolute; right: 5px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
#quest-track { max-width: 250px; padding: 7px 11px; text-align: left; font-size: 12px; line-height: 1.45; color: var(--muted); }
#quest-track b { color: var(--text); display: block; font-size: 12.5px; }
#quest-track.done { border-color: var(--gold); } #quest-track.done b { color: var(--gold2); }

#target-card { position: absolute; left: 50%; top: calc(10px + var(--safe-t)); transform: translateX(-50%); width: min(230px, 40vw); padding: 6px 10px 8px; }
.t-name { font-size: 12.5px; font-weight: 700; display: flex; gap: 6px; justify-content: center; white-space: nowrap; }
.t-name b { color: var(--gold); }
#target-card .bar { height: 8px; }

#banner { position: absolute; left: 0; right: 0; top: 22%; text-align: center; pointer-events: none !important;
  font: 900 clamp(26px, 6vw, 44px) var(--serif); letter-spacing: .25em; color: #fff3d6; text-shadow: 0 2px 18px #000, 0 0 40px rgba(217,181,108,.5); opacity: 0; }
#banner.show { animation: banner 2.6s ease-out; }
@keyframes banner { 0% { opacity: 0; transform: translateY(12px); } 15%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }
#toasts { position: absolute; left: 50%; top: calc(70px + var(--safe-t)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: none !important; width: min(92vw, 460px); }
.toast { padding: 6px 13px; border-radius: 999px; background: rgba(10,13,20,.86); border: 1px solid var(--line2); font-size: 12.5px; animation: toast 3.2s forwards; text-align: center; }
.toast.good { border-color: rgba(127,209,138,.6); color: #c9f2cf; } .toast.warn { border-color: rgba(240,163,90,.6); color: #ffd7b0; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 8%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

#chat { position: absolute; left: calc(10px + var(--safe-l)); bottom: calc(10px + var(--safe-b)); width: 290px; padding: 6px 8px; font-size: 12px; }
#chat-log { max-height: 92px; overflow-y: auto; line-height: 1.5; color: #cfd5e2; scrollbar-width: none; }
#chat-log b { color: var(--gold2); font-weight: 600; } #chat-log .sys { color: var(--muted); } #chat-log .loot { color: #c9f2cf; }
#chat-input { width: 100%; margin-top: 4px; border: 1px solid transparent; border-radius: 7px; background: rgba(255,255,255,.05); padding: 5px 8px; outline: none; user-select: text; -webkit-user-select: text; }
#chat-input:focus { border-color: var(--gold); }

/* 행동 버튼 묶음 (오른쪽 아래) */
#actions { position: absolute; right: calc(12px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); width: 258px; height: 196px; pointer-events: none !important; }
.act { position: absolute; pointer-events: auto; border-radius: 50%; border: 2px solid rgba(160,172,200,.55); background: rgba(13,17,26,.82) center/cover no-repeat; overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,.45); touch-action: manipulation; }
.act:active { transform: scale(.94); }
.act::after { content: attr(data-key); position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%); font: 700 9px var(--sans); color: #fff; text-shadow: 0 1px 2px #000; }
.act em { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; display: grid; place-items: center; font: 700 15px var(--sans); font-style: normal; text-shadow: 0 1px 3px #000; }
.act.locked { filter: grayscale(1) brightness(.5); }
.act.nomp { filter: saturate(.3) brightness(.7); }
.attack { right: 16px; bottom: 12px; width: 84px; height: 84px; border-color: var(--gold); background: radial-gradient(circle at 35% 30%, #d7634f, #7c211c); }
.attack span { font: 800 17px var(--serif); letter-spacing: .1em; }
.skill { width: 54px; height: 54px; }
/* 기술 4개: 공격 버튼(중심 오른쪽 58·아래 54)에 바짝 붙여 반지름 76의 반원으로 — 왼쪽 아래 1번부터 오른쪽 위 4번까지 44도 간격 */
#sk0 { right: 102px; bottom: 1px; } #sk1 { right: 100px; bottom: 58px; } #sk2 { right: 59px; bottom: 97px; } #sk3 { right: 2px; bottom: 97px; }
.pot { width: 46px; height: 46px; display: grid; place-items: center; }
.pot img { width: 28px; height: 28px; object-fit: contain; }
.pot b { z-index: 1; position: absolute; right: 3px; top: 1px; font: 700 10.5px var(--sans); text-shadow: 0 1px 2px #000; background: rgba(0,0,0,.55); border-radius: 6px; padding: 0 3px; }
#btn-hp { right: 166px; bottom: 6px; } #btn-mp { right: 216px; bottom: 6px; }
.ret { right: 316px; bottom: 6px; width: 46px; height: 46px; display: grid; place-items: center; border-color: #8fd0ff;
  background: radial-gradient(circle at 40% 35%, #3a6f9e, #142a40); font: 800 11.5px var(--sans); color: #fff; }
.ret b { position: absolute; right: 1px; top: 0; font: 700 10px var(--sans); background: rgba(0,0,0,.7); border-radius: 6px; padding: 0 3px; }
.ret.empty { filter: grayscale(1) brightness(.6); }
.auto { right: 180px; bottom: 64px; width: 50px; height: 50px; font: 700 11px/1.15 var(--sans); color: var(--muted); }
.auto.on { border-color: var(--good); color: #dff7e2; background: radial-gradient(circle, #2f7a45, #153722); box-shadow: 0 0 16px rgba(127,209,138,.5); }

/* 조이스틱 (터치 기기에서만) */
#stick { display: none; position: absolute; left: calc(22px + var(--safe-l)); bottom: calc(26px + var(--safe-b)); width: 124px; height: 124px; border-radius: 50%;
  border: 2px solid rgba(180,190,215,.35); background: rgba(13,17,26,.45); touch-action: none; }
#stick i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: rgba(217,181,108,.75); box-shadow: 0 4px 12px rgba(0,0,0,.5); }

#dead { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(40,6,6,.55); backdrop-filter: grayscale(1) blur(2px); }
.dead-box { text-align: center; padding: 26px 30px; border-radius: 16px; background: rgba(13,17,26,.92); border: 1px solid #6b2a2a; max-width: 86vw; }
.dead-box h2 { font: 900 26px var(--serif); color: #ff9c92; margin: 0 0 6px; letter-spacing: .15em; }
.dead-box p { color: var(--muted); margin: 0 0 16px; font-size: 13.5px; }
#net { position: absolute; left: 50%; bottom: 40%; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: #5a1d1d; border: 1px solid #a44; font-size: 13px; }

/* ── 창(가방·상점 등) ────────────────────────────────── */
#panel-wrap { position: absolute; inset: 0; background: rgba(4,6,10,.55); display: grid; place-items: center; z-index: 20; }
#panel { width: min(760px, 94vw); max-height: min(86vh, 640px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2);
  border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.p-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #1d2436, #151a28); }
.p-head h3 { margin: 0; font: 700 17px var(--serif); color: var(--gold2); letter-spacing: .08em; flex: 1; }
.p-head .wallet { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); align-items: center; }
.p-head .wallet img { width: 15px; height: 15px; vertical-align: -2px; margin-right: 3px; }
.p-head .wallet b { color: var(--text); font-variant-numeric: tabular-nums; }
.p-close { width: 36px; height: 36px; border-radius: 9px; font-size: 20px; color: var(--muted); }
.p-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.p-tabs { display: flex; gap: 4px; padding: 8px 14px 0; border-bottom: 1px solid var(--line); }
.p-tabs button { padding: 8px 14px; border-radius: 9px 9px 0 0; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.p-tabs button.on { color: var(--gold2); background: var(--panel2); box-shadow: 0 -2px 0 var(--gold) inset; }
.p-body { padding: 14px; overflow-y: auto; flex: 1; min-height: 0; }
.p-note { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }

.bag-layout { display: grid; grid-template-columns: 250px 1fr; gap: 14px; }
.doll { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.doll .sprite { margin: 0 auto 8px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12.5px; margin-bottom: 10px; }
.stats span { color: var(--muted); } .stats b { float: right; font-variant-numeric: tabular-nums; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; align-content: start; }
.cell { position: relative; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: #0e121b center/72% no-repeat; }
.cell.empty { opacity: .45; }
.cell.sel { box-shadow: 0 0 0 2px var(--gold); }
.cell small { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; font-size: 9.5px; color: var(--muted); }
.cell .enh { position: absolute; left: 3px; top: 2px; font: 700 10.5px var(--sans); color: #ffe08a; text-shadow: 0 1px 2px #000; }
.cell .eq { position: absolute; right: 3px; top: 3px; font: 700 9px var(--sans); background: var(--gold); color: #20170a; border-radius: 4px; padding: 0 3px; }
.cell .up { position: absolute; right: 3px; bottom: 2px; color: var(--good); font-size: 11px; font-weight: 800; }
.cell.no { filter: saturate(.35) brightness(.75); }
.cell[class*="tier"] { border-width: 3px; }
.tier0 { border-color: #8a93a8; } .tier1 { border-color: #4fcf66; } .tier2 { border-color: #4f8fff; } .tier3 { border-color: #b77cff; } .tier4 { border-color: #ffbf3a; box-shadow: 0 0 10px rgba(243,184,76,.3) inset; }
.c0 { color: var(--t0); } .c1 { color: var(--t1); } .c2 { color: var(--t2); } .c3 { color: var(--t3); } .c4 { color: var(--t4); }
.detail { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.detail .cell { width: 58px; flex: 0 0 auto; }
.detail .d-info { flex: 1 1 200px; min-width: 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.detail .d-info b { font-size: 15px; display: block; }
.detail .d-info em { font-style: normal; color: var(--good); } .detail .d-info em.down { color: #ff8f85; }
.detail .d-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.list { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.row .cell { width: 50px; flex: 0 0 auto; }
.row .r-info { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.row .r-info b { display: block; font-size: 14.5px; color: var(--text); }
.row .r-btns { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.row .price { font-variant-numeric: tabular-nums; color: var(--gold2); font-weight: 700; white-space: nowrap; }
.row.locked { opacity: .55; }
.skill-ico { width: 50px; height: 50px; border-radius: 12px; border: 1px solid var(--line2); flex: 0 0 auto; background: #0e121b center/cover; }

.worldmap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.worldmap .zone.void { grid-column: 1 / -1; aspect-ratio: auto; min-height: 76px; border-color: #8a5cff; box-shadow: 0 0 14px rgba(138,92,255,.45) inset; }
.zone { position: relative; aspect-ratio: 1.25; border-radius: 12px; overflow: hidden; border: 1px solid var(--line2); background: center/cover; text-align: left; }
.zone::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.78)); }
.zone > * { position: absolute; z-index: 1; left: 9px; right: 9px; }
.zone b { bottom: 24px; font: 700 14px var(--serif); text-shadow: 0 1px 4px #000; }
.zone small { bottom: 7px; font-size: 11px; color: #d6dbe6; }
.zone .here { top: 7px; right: auto; left: 8px; background: var(--gold); color: #20170a; font: 700 10.5px var(--sans); padding: 2px 7px; border-radius: 999px; }
.zone .fee { top: 7px; left: auto; right: 8px; background: rgba(0,0,0,.65); font: 700 11px var(--sans); padding: 2px 7px; border-radius: 999px; color: var(--gold2); }
.zone.cur { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.zone.danger small { color: #ff9c92; }
button.zone:hover { border-color: var(--gold); }

.quest-box { padding: 14px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); margin-bottom: 12px; }
.quest-box h4 { margin: 0 0 4px; font: 700 16px var(--serif); color: var(--gold2); }
.quest-box p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.quest-box .bar { height: 14px; margin-bottom: 10px; } .quest-box .bar i { background: linear-gradient(180deg, #e8c77f, #b38a3f); }
.reward { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; } .reward b { color: var(--gold2); }
.chap { display: flex; justify-content: space-between; align-items: baseline; font: 700 15px var(--serif); color: var(--gold2); margin: 0 0 8px; }
.chap span { font: 600 12px var(--sans); color: var(--muted); }
.say { position: relative; padding: 10px 14px; border-radius: 12px; background: #1d2638; border: 1px solid #3c4a68; margin-bottom: 10px; }
.say b { color: #9fd0ff; font-size: 13px; } .say p { margin: 4px 0 0; color: #f1ece0; font-size: 13.5px; line-height: 1.6; }
.say.done { background: #1b2a22; border-color: #3f6b4c; } .say.done b { color: var(--good); } .say small { display: block; margin-top: 6px; color: var(--good); font-size: 11.5px; }
.row.raid { border-color: #6b3a3a; background: linear-gradient(90deg, rgba(120,30,30,.25), transparent); }
.q-list { font-size: 12.5px; color: var(--muted); line-height: 1.9; } .q-list .ok { color: var(--good); } .q-list .now { color: var(--text); font-weight: 700; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); margin-bottom: 8px; font-size: 13.5px; }
.toggle small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.keys { font-size: 12.5px; color: var(--muted); line-height: 1.9; columns: 2; margin: 6px 0 0; padding: 0; list-style: none; }
.refine-box { text-align: center; padding: 14px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); margin-bottom: 12px; }
.refine-box .big { font: 800 22px var(--serif); margin: 6px 0; } .refine-box .big em { font-style: normal; color: var(--gold2); }
.refine-box.flash-ok { animation: fok .6s; } .refine-box.flash-no { animation: fno .6s; }
@keyframes fok { 30% { box-shadow: 0 0 0 2px var(--good), 0 0 40px rgba(127,209,138,.6); } }
@keyframes fno { 30% { box-shadow: 0 0 0 2px #c0524a; transform: translateX(4px); } 60% { transform: translateX(-4px); } }

/* ── 2단계: 파티·거래·우편·제작·속성 ─────────────────── */
#party { position: absolute; left: calc(10px + var(--safe-l)); top: calc(96px + var(--safe-t)); display: flex; flex-direction: column; gap: 5px; pointer-events: none !important; }
.pm { display: flex; align-items: center; gap: 7px; padding: 4px 9px 4px 4px; border-radius: 999px; background: rgba(13,17,26,.75); border: 1px solid rgba(120,135,165,.28); width: 168px; }
.pm .face { width: 28px; height: 28px; border-width: 1px; }
.pm div { flex: 1; min-width: 0; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.pm .bar { height: 5px; margin-top: 2px; } .pm.far { opacity: .55; }
.pm b { color: var(--gold); margin-right: 3px; }
#prompt { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); padding: 14px 16px; text-align: center; width: min(320px, 88vw); border-color: var(--gold); z-index: 45; box-shadow: 0 10px 40px rgba(0,0,0,.6); background: rgba(16,20,30,.97) !important; backdrop-filter: none; }   /* 창이 열려 있어도 초대·거래 신청이 위에 보이게 */
#prompt p { margin: 0 0 12px; font-size: 14px; } #prompt p b { color: var(--gold2); }
#prompt .btn { margin: 0 4px; }
.el { position: absolute; left: 3px; bottom: 3px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 6px currentColor; background: currentColor; }
.el-pick { display: flex; gap: 6px; justify-content: center; margin: 8px 0 10px; flex-wrap: wrap; }
.el-pick button { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line2); font-weight: 700; font-size: 13px; }
.el-pick button.on { background: rgba(255,255,255,.1); border-color: currentColor; }
.cost { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; line-height: 1.5; } .cost b { color: var(--text); } .cost .lack { color: #ff8f85; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two h4 { margin: 0 0 8px; font: 700 13.5px var(--serif); color: var(--gold2); }
.offer { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--panel2); min-height: 150px; }
.offer.ok { border-color: var(--good); box-shadow: 0 0 0 1px var(--good) inset; }
.offer .gold-line { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 8px; }
.offer input { width: 110px; min-height: 34px; border-radius: 8px; border: 1px solid var(--line2); background: #0e121b; padding: 0 8px; user-select: text; -webkit-user-select: text; }
.mail { display: block; } .mail .m-top { display: flex; gap: 10px; align-items: center; }
.mail .m-gift { margin-top: 6px; font-size: 12.5px; color: var(--gold2); }
.mail.done { opacity: .55; }
.pname.pvp { color: #ff8f85; }

/* ── 3단계: 던전·일일 ─────────────────────────────── */
#dg-hud { position: absolute; left: 50%; top: calc(10px + var(--safe-t)); transform: translateX(-50%); width: min(300px, 56vw); padding: 8px 12px 9px; text-align: center; border-color: rgba(217,181,108,.55); }
#game.in-room #target-card { top: calc(118px + var(--safe-t)); }
#game.in-room #quest-track { display: none; }
@media (max-width: 1100px) {                     /* 좁은 화면: 던전 표시를 위쪽 칸들 아래로 */
  #dg-hud { top: calc(124px + var(--safe-t)); }
  #game.in-room #target-card { top: calc(214px + var(--safe-t)); }
  #game.in-room #toasts { top: calc(270px + var(--safe-t)); }
}
.dg-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.dg-top b { font-family: var(--serif); color: var(--gold2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dg-top span { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 700; }
.dg-top span.low { color: #ff8f85; }
#dg-stage { font-size: 12px; color: var(--muted); margin-top: 3px; }
#dg-boss .bar { height: 12px; margin-top: 6px; } #dg-boss .bar i { background: linear-gradient(180deg, #ff9a4a, #b8381e); }
#dg-boss.rage .bar { box-shadow: 0 0 10px rgba(255,60,40,.8); }
#dg-leave { position: absolute; right: -6px; top: calc(100% + 6px); min-height: 28px; padding: 3px 10px; font-size: 12px; background: rgba(13,17,26,.78); }
.rank { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font: 900 15px var(--serif); background: #2a3144; color: var(--muted); }
.rank.S { background: linear-gradient(180deg, #ffe7a6, #c9962f); color: #2a1a00; } .rank.A { background: linear-gradient(180deg, #b9d7ff, #4f7fc4); color: #08162b; } .rank.B { background: #3b4660; color: #dfe5f2; }
.big-rank { font: 900 96px/1 var(--serif); margin: 6px 0; text-shadow: 0 6px 30px rgba(255,200,90,.45); }
.big-rank.S { color: #ffd257; } .big-rank.A { color: #8fb8ff; } .big-rank.B { color: #c9d0de; }
.result { text-align: center; padding: 6px 0 4px; }
.result .gifts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0; }
.result .gifts span { padding: 5px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line2); font-size: 12.5px; }
.prog { height: 8px; border-radius: 5px; background: #0b0f17; overflow: hidden; margin-top: 5px; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, #c9a24f, #f0d48c); }
.attend { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
.attend div { border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); padding: 7px 2px; text-align: center; font-size: 11px; color: var(--muted); line-height: 1.35; }
.attend div b { display: block; color: var(--text); font-size: 12px; }
.attend div.got { border-color: var(--gold); background: rgba(217,181,108,.13); } .attend div.got b { color: var(--gold2); }
.attend div.today { box-shadow: 0 0 0 2px var(--gold) inset; }
.tag { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: #3a2a2a; color: #ffb3ab; margin-left: 4px; vertical-align: 1px; }

/* ── 재련 단계별 장비 칸 빛 ─────────────────────────── */
.cell.g4 { box-shadow: 0 0 0 1px rgba(140,200,255,.7) inset, 0 0 10px rgba(140,200,255,.45); }
.cell.g4 .enh { color: #bfe1ff; }
.cell.g7 { animation: g7 2.2s ease-in-out infinite; } .cell.g7 .enh { color: #e3c4ff; }
@keyframes g7 { 0%, 100% { box-shadow: 0 0 0 1px rgba(200,130,255,.7) inset, 0 0 8px rgba(200,130,255,.4); } 50% { box-shadow: 0 0 0 2px rgba(220,160,255,.95) inset, 0 0 18px rgba(200,130,255,.75); } }
.cell.g9, .cell.gx { overflow: hidden; }
.cell.g9 { animation: g9 1.8s ease-in-out infinite; } .cell.g9 .enh { color: #ffe08a; text-shadow: 0 0 6px #ffb020, 0 1px 2px #000; }
@keyframes g9 { 0%, 100% { box-shadow: 0 0 0 1px rgba(255,200,80,.8) inset, 0 0 10px rgba(255,190,60,.5); } 50% { box-shadow: 0 0 0 2px rgba(255,220,120,1) inset, 0 0 22px rgba(255,190,60,.85); } }
.cell.g9::before, .cell.gx::before { content: ""; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.55) 50%, transparent 60%); animation: shine 2.4s ease-in-out infinite; pointer-events: none; }
@keyframes shine { 0% { transform: translateX(-60%); } 60%, 100% { transform: translateX(60%); } }
.cell.gx { animation: gx 3s linear infinite; }
.cell.gx .enh { background: linear-gradient(90deg, #ff6b6b, #ffd25a, #7dff9a, #6ab8ff, #c08bff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; font-weight: 900; }
@keyframes gx { 0% { box-shadow: 0 0 0 2px #ff6b6b inset, 0 0 16px #ff6b6b; } 25% { box-shadow: 0 0 0 2px #ffd25a inset, 0 0 16px #ffd25a; } 50% { box-shadow: 0 0 0 2px #7dff9a inset, 0 0 16px #7dff9a; } 75% { box-shadow: 0 0 0 2px #6ab8ff inset, 0 0 16px #6ab8ff; } 100% { box-shadow: 0 0 0 2px #ff6b6b inset, 0 0 16px #ff6b6b; } }
@media (prefers-reduced-motion: reduce) { .cell.g7, .cell.g9, .cell.gx, .cell.g9::before, .cell.gx::before { animation: none; } }

/* ── 세트 아이템 ─────────────────────────────────────── */
.cell.setc { border-color: rgb(var(--sc)); background-color: rgba(var(--sc), .32); box-shadow: 0 0 10px rgba(var(--sc), .45); }
.cell .stag { position: absolute; left: 0; right: 0; bottom: 0; font: 800 9.5px/14px var(--sans); text-align: center; color: #0b0e14; background: rgb(var(--sc)); border-radius: 0 0 6px 6px; }
.cell .lockb { position: absolute; left: 2px; bottom: 1px; font-size: 13px; line-height: 1; filter: drop-shadow(0 1px 2px #000); }
.cell.setc .lockb { bottom: 14px; }
.cell.mark { outline: 2px dashed #ff8f85; outline-offset: -6px; }
.bulk { background: var(--panel2); border: 1px solid var(--line2); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.bulk > b { color: var(--gold2); font-size: 13.5px; }
.bulk-tiers, .bulk-opts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--gold); margin: 0; }
.bulk-tiers .chk { padding: 5px 10px; border: 2px solid currentColor; border-radius: 8px; font-weight: 700; }
.bulk-opts .chk { color: var(--text); }
.bulk-go { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.info-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.stats.big { font-size: 13.5px; gap: 7px 18px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0; }
.stats.big b { color: #fff; } .stats.big b.hi { color: var(--gold2); }
h4.sub { margin: 14px 0 8px; font: 700 14px var(--serif); color: var(--gold2); }
.haste { right: 266px; bottom: 6px; width: 46px; height: 46px; display: grid; place-items: center; border-color: #6fe08a; }
.haste img { width: 26px; height: 26px; } .haste b { z-index: 1; position: absolute; right: 1px; top: 0; font: 700 10px var(--sans); background: rgba(0,0,0,.7); border-radius: 6px; padding: 0 3px; }
.haste.on { box-shadow: 0 0 14px rgba(111,224,138,.8); } .haste.empty { filter: grayscale(1) brightness(.6); }
.hbuff { position: relative; display: inline-block; } .hbuff img { border-color: #6fe08a !important; background: #0d111a; }
.hbuff b { position: absolute; left: 0; right: 0; bottom: -12px; text-align: center; font: 700 9.5px var(--sans); color: #c9f7d2; text-shadow: 0 1px 2px #000; }
.cset { color: #6ff0cf; }
.setbox { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(var(--sc), .08); border: 1px solid rgba(var(--sc), .35); font-size: 12px; color: var(--muted); line-height: 1.6; }
.setbox b { color: rgb(var(--sc)); font-size: 12.5px; display: block; }
.setbox .on { color: var(--text); } .setbox .on::before { content: '● '; color: rgb(var(--sc)); }
.setlist { grid-column: 1 / -1; }
.toggle.slider input[type=range] { width: 150px; accent-color: var(--gold); }

/* ── 휴대폰 가로 고정 안내 ───────────────────────────── */
#rotate { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; text-align: center; padding: 24px; background: #0c0f16; }
#rotate .phone { width: 64px; height: 104px; margin: 0 auto 18px; border: 4px solid var(--gold); border-radius: 12px; animation: turn 1.8s ease-in-out infinite; }
@keyframes turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
#rotate h2 { font: 700 20px var(--serif); color: var(--gold2); margin: 0 0 8px; } #rotate p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
/* 세로로 들었을 때: 게임 화면을 돌려 가로로 (game.js orient) */
body.rot #game { inset: auto; left: 0; top: 0; transform-origin: 0 0; }
body.rot #panel-wrap { place-items: center; }
body.rot #panel { width: min(760px, 96%); max-height: 96%; border-radius: 16px; }
body.rot #quest-track { display: none; }
body.rot #actions { transform: scale(.92); transform-origin: right bottom; }
body.rot #stick { display: block; width: 108px; height: 108px; }
body.rot #target-card { top: 10px; }
body.rot #toasts { top: 52px; }

/* ── 브라우저가 화면을 강제로 어둡게 바꿔도 읽히게 ─────────────
   바탕은 원래 어둡고 불투명하게, 글자는 흰색, 막대는 밝은 테두리로 구분 */
.glass { background: #0d111a; border-color: #4a5674; }
.bar { background: #000; border-color: #6a7896; }
.bar span { color: #fff; font-size: 10.5px; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.bar.hp i { background: #ff4d40; } .bar.mp i { background: #3f9bff; } .bar.xp i { background: #ffc94a; }
.me-name, #menu button, .pill-row, #quest-track b { color: #fff; }
#menu kbd { color: #c9d2e6; border-color: #6a7896; }
.act { background-color: #0d111a; border-color: #aab6d0; }
.toast { background: #0a0d14; color: #fff; }

/* ── 휴대폰·작은 화면 ───────────────────────────────── */
@media (pointer: coarse) {
  #stick { display: block; }
  .act::after, kbd { display: none; }
  #chat { display: none; }
}
@media (max-width: 760px) {
  body:not(.rot) .class-list { grid-template-columns: repeat(5, 132px); overflow-x: auto; padding-bottom: 6px; }
  body:not(.rot) #panel-wrap { place-items: end center; }
  body:not(.rot) #panel { width: 100vw; max-height: 88vh; border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: var(--safe-b); animation: sheet .2s ease-out; }
  @keyframes sheet { from { transform: translateY(40px); opacity: .5; } }
  body:not(.rot) .bag-layout { grid-template-columns: 1fr; }
  body:not(.rot) .doll { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
  body:not(.rot) .doll .sprite { margin: 0; grid-row: span 2; }
  body:not(.rot) .slots { grid-template-columns: repeat(8, 1fr); grid-column: 1 / -1; }
  body:not(.rot) #menu button { min-width: 36px; padding: 7px 5px; }
  body:not(.rot) .two { grid-template-columns: 1fr; }
  body:not(.rot) #party { top: calc(160px + var(--safe-t)); } body:not(.rot) .pm { width: 140px; }
  body:not(.rot) #quest-track { max-width: 200px; font-size: 11.5px; }
  body:not(.rot) #target-card { top: calc(74px + var(--safe-t)); width: 200px; }
  body:not(.rot) #toasts { top: calc(122px + var(--safe-t)); }
  body:not(.rot) .keys { columns: 1; }
}
@media (max-width: 480px) {             /* 휴대폰 세로 */
  body:not(.rot) #me-card { width: min(215px, 56vw); }
  body:not(.rot) .zone-name { display: none; }
  body:not(.rot) #menu { margin-top: 30px; }
  body:not(.rot) #actions { height: 236px; }
  body:not(.rot) #btn-hp { right: 60px; bottom: 186px; } body:not(.rot) #btn-mp { right: 112px; bottom: 182px; }
  body:not(.rot) .auto { right: 162px; bottom: 132px; }
  body:not(.rot) .ret { right: 216px; bottom: 186px; }
  body:not(.rot) .haste { right: 164px; bottom: 186px; }
  body:not(.rot) #stick { left: calc(14px + var(--safe-l)); width: 116px; height: 116px; }
  body:not(.rot) .create-row .btn { flex: 1 1 auto; }
  body:not(.rot) #target-card { left: calc(10px + var(--safe-l)); transform: none; top: calc(116px + var(--safe-t)); width: 156px; }
  body:not(.rot) #dg-hud { top: calc(206px + var(--safe-t)); width: min(260px, 70vw); }
  body:not(.rot) #game.in-room #target-card { top: calc(116px + var(--safe-t)); }
  body:not(.rot) .attend { gap: 3px; } body:not(.rot) .attend div { font-size: 10px; padding: 5px 1px; }
  body:not(.rot) #quest-track { max-width: 180px; }
  body:not(.rot) #toasts { top: calc(172px + var(--safe-t)); }
}
@media (max-height: 460px) {            /* 휴대폰 가로 */
  #panel { max-height: 96vh; }
  #panel-wrap { place-items: center; }
  #panel { border-radius: 16px; width: min(760px, 96vw); }
  #quest-track { display: none; }
  #actions { transform: scale(.92); transform-origin: right bottom; }
  #stick { width: 108px; height: 108px; }
  #target-card { top: calc(10px + var(--safe-t)); }
  #toasts { top: calc(52px + var(--safe-t)); }
}

/* ── 화면 반투명 (설정에서 켜고 끔, 휴대폰은 처음부터 켜짐 · body.see-through) ──
   게임 위의 창·버튼 뒤로 게임 화면이 비쳐 보이게. 글자는 흰색 + 그림자로 또렷하게. 누르는 순간만 진하게. */
body.see-through #hud .glass { background: rgba(13,17,26,.42); border-color: rgba(150,165,195,.32); backdrop-filter: none; }
body.see-through #hud .bar { background: rgba(0,0,0,.4); border-color: rgba(150,165,195,.4); }
body.see-through #hud .me-name, body.see-through #hud #menu button, body.see-through #hud .pill-row, body.see-through #hud .t-name, body.see-through #hud #quest-track { text-shadow: 0 1px 3px #000, 0 0 2px #000; }
body.see-through #hud .act { background-color: rgba(13,17,26,.35); opacity: .72; }
body.see-through #hud .act.attack { opacity: .8; }
body.see-through #hud .act:active { opacity: 1; }
body.see-through #stick { background: rgba(13,17,26,.25); border-color: rgba(180,190,215,.3); } body.see-through #stick i { opacity: .7; }
body.see-through .toast { background: rgba(10,13,20,.55); }

/* ── 장비 품질 · 옵션 · 전투력 · 순위표 ── */
.qtag { display: inline-block; font: 700 10.5px var(--sans); font-style: normal; padding: 1px 6px; margin-right: 5px; border-radius: 4px; vertical-align: 1px; color: #111; }
.qtag.q1 { background: #4fd6e8; } .qtag.q2 { background: #ff7ad9; } .qtag.q3 { background: #ff9b3d; } .qtag.q4 { background: #ff4d4d; color: #fff; box-shadow: 0 0 8px rgba(255, 77, 77, .8); }
.cell .qgem { position: absolute; left: 3px; bottom: 3px; width: 9px; height: 9px; transform: rotate(45deg); border-radius: 2px; pointer-events: none; }
.qgem.q1 { background: #4fd6e8; } .qgem.q2 { background: #ff7ad9; } .qgem.q3 { background: #ff9b3d; box-shadow: 0 0 6px #ff9b3d; } .qgem.q4 { background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; }
.cell.qc.q3 { box-shadow: inset 0 0 14px rgba(255, 155, 61, .55); }
.cell.qc.q4 { box-shadow: inset 0 0 18px rgba(255, 77, 77, .7), 0 0 10px rgba(255, 77, 77, .45); animation: qpulse 2.2s ease-in-out infinite; }
@keyframes qpulse { 50% { box-shadow: inset 0 0 24px rgba(255, 77, 77, .9), 0 0 16px rgba(255, 77, 77, .65); } }
.opts { display: flex; flex-direction: column; gap: 1px; margin: 4px 0 2px; font-size: 12px; }
.opts.q1 { color: #8fe6f1; } .opts.q2 { color: #ffaee8; } .opts.q3 { color: #ffc189; } .opts.q4 { color: #ff8a84; }
.cpbox { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 6px; padding: 6px 10px; border-radius: 8px;
  background: linear-gradient(90deg, rgba(243, 184, 76, .18), rgba(243, 184, 76, .04)); border: 1px solid rgba(243, 184, 76, .35); }
.cpbox span { font-size: 12px; color: var(--muted); } .cpbox b { font: 700 18px var(--serif); color: var(--gold2); }
.chk.prot { display: flex; margin: 4px 0 10px; padding: 8px 10px; border-radius: 8px; background: rgba(120, 200, 140, .1); border: 1px solid rgba(120, 200, 140, .35); }
.chk.prot.none { opacity: .6; }
#keepq { margin-left: 4px; background: var(--panel2, #1c2230); color: var(--text); border: 1px solid var(--line, #3a4150); border-radius: 6px; padding: 2px 4px; font-size: 12px; }
.rklist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.rk { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); }
.rk.me { border-color: var(--gold); background: rgba(243, 184, 76, .1); }
.rk .no { width: 26px; text-align: center; font: 700 15px var(--serif); color: var(--muted); }
.rk.top1 .no { color: #ffd76a; font-size: 18px; } .rk.top2 .no { color: #d9e2ec; font-size: 17px; } .rk.top3 .no { color: #e0a070; font-size: 16px; }
.rk .who { flex: 1; min-width: 0; } .rk .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .rk .who small { color: var(--muted); font-size: 11px; }
.rk .val { font: 700 14px var(--serif); color: var(--gold2); white-space: nowrap; }

/* 게임 안 확인 창 (브라우저 기본 창 대신) */
#ask { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(4, 6, 12, .55); backdrop-filter: blur(2px); }
#ask.hidden { display: none; }
.ask-card { width: min(360px, 88%); padding: 20px 20px 16px; border-radius: 16px; text-align: center;
  background: linear-gradient(180deg, #1d2333, #131826); border: 1px solid rgba(243, 184, 76, .45); box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
.ask-card p { margin: 0 0 16px; font-size: 15px; line-height: 1.6; color: var(--text); }
.ask-card p small { color: var(--muted); font-size: 12.5px; }
.ask-card p b { color: var(--gold2); }
.ask-fee { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-weight: 700; color: var(--gold2); }
.ask-fee img { width: 16px; height: 16px; }
.ask-btns { display: flex; gap: 10px; } .ask-btns .btn { flex: 1; padding: 10px 0; font-size: 15px; }
.ask-btns .btn.danger { background: linear-gradient(180deg, #c8463e, #8e2a24); border-color: #e0675e; color: #fff; }

/* ── 변신 ── */
.mstat { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.mcard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; border-radius: 10px; cursor: pointer;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--gc) 22%, transparent), rgba(10, 13, 20, .6) 70%); border: 2px solid var(--gc); color: var(--text); font: inherit; }
.mcard.sel { box-shadow: 0 0 0 2px #fff, 0 0 16px var(--gc); }
.mcard.dim { filter: grayscale(1) brightness(.45); cursor: default; }
.mcard b { font-size: 12px; line-height: 1.25; text-align: center; } .mcard small { font-size: 10.5px; color: var(--gc); }
.mimg { width: 72px; height: 72px; background: center/contain no-repeat; }
.mimg.big { width: 120px; height: 120px; flex: none; }
.mcard .mn { position: absolute; right: 5px; top: 4px; font: 700 11px var(--sans); font-style: normal; color: var(--gold2); }
.mcard .mon { position: absolute; left: 4px; top: 4px; font: 700 10px var(--sans); font-style: normal; padding: 1px 5px; border-radius: 4px; background: var(--good, #5fd07a); color: #111; }
.mdetail { display: flex; gap: 14px; align-items: center; padding: 12px; margin-bottom: 12px; border-radius: 12px; border: 1px solid var(--gc);
  background: radial-gradient(circle at 15% 50%, color-mix(in srgb, var(--gc) 20%, transparent), rgba(10, 13, 20, .5) 60%); }
.mdetail .opts { color: var(--text); margin: 6px 0 10px; }
.goals { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; } .goals div { font-size: 13px; color: var(--muted); } .goals .on { color: var(--good); font-weight: 700; }
.odds { overflow-x: auto; } .odds table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.odds th, .odds td { padding: 6px 5px; border-bottom: 1px solid rgba(255, 255, 255, .08); text-align: center; white-space: nowrap; }
.odds th { text-align: left; font-weight: 700; } .odds th small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.hbuff.mbuff i { display: inline-block; width: 26px; height: 26px; border-radius: 50%; background: center/cover no-repeat rgba(0, 0, 0, .4); border: 2px solid var(--gc); }
.seg3 { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; } .seg3 .btn { white-space: nowrap; }
.mail-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; } .mail-top span { flex: 1; color: var(--muted); font-size: 13px; }
#askeepq { margin-left: 4px; background: var(--panel2, #1c2230); color: var(--text); border: 1px solid var(--line, #3a4150); border-radius: 6px; padding: 2px 4px; font-size: 12px; }
/* 아래 물약 버튼: 지정한 물약 이름 */
.act .ptag { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); font: 700 9.5px var(--sans); font-style: normal; white-space: nowrap;
  padding: 0 4px; border-radius: 4px; background: rgba(10, 13, 20, .85); color: var(--gold2); pointer-events: none; }
.row.picked { border-color: var(--gold); }
/* 고대 등급 (6번째) */
.tier5 { border-color: #ff5a3c; box-shadow: 0 0 12px rgba(255, 90, 60, .45) inset; }
.c5 { color: #ff7a52; }
.worldmap .zone.void.fire { filter: saturate(1.1); }

/* ── 보석 · 상점 ── */
.gemi { display: inline-block; width: 13px; height: 13px; transform: rotate(45deg) scale(.85); border-radius: 2px; vertical-align: -1px; margin-right: 4px;
  background: linear-gradient(135deg, #e6fbff, #5fd6ff 45%, #2a7bd8); box-shadow: 0 0 6px rgba(95, 214, 255, .7); }
.coin.gemc { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0; display: inline-flex; align-items: center; }
.coin.gemc b { color: #9feaff; }
.gemtag { display: inline-flex; align-items: center; font-weight: 700; color: #9feaff; margin-right: 6px; white-space: nowrap; }
.pass-top { padding: 10px 12px; border-radius: 10px; background: rgba(95, 214, 255, .07); border: 1px solid rgba(95, 214, 255, .3); margin-bottom: 10px; }
.pass-top small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.pass-list { display: flex; flex-direction: column; gap: 4px; }
.prow { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 6px; align-items: stretch; }
.prow > b { display: grid; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, .05); color: var(--muted); font: 700 14px var(--serif); }
.prow.reached > b { background: rgba(243, 184, 76, .2); color: var(--gold2); }
.pr { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; border-radius: 8px; font-size: 12px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .06); color: var(--muted); }
.pr.open { color: var(--text); } .pr.prem { border-color: rgba(95, 214, 255, .3); background: rgba(95, 214, 255, .06); }
.pr.got { opacity: .55; } .pr em { font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; }
.aura-ico { display: inline-block; width: 64px; height: 40px; background: center/contain no-repeat; margin-top: 4px; }
.rainbow { background: linear-gradient(90deg, #ff6b6b, #ffd76a, #6fe08a, #74d6ff, #c9a2ff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── 거래소 · 업적 ── */
.mkt-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.mkt-top .p-note { flex: 1; min-width: 180px; }
.mkt-filter { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.mkt-filter select, .mkt-filter input, .mkt-sell input { background: var(--panel2, #1c2230); color: var(--text); border: 1px solid var(--line, #3a4150); border-radius: 6px; padding: 4px 6px; font-size: 12.5px; }
.mkt-filter input { width: 110px; } .mkt-sell input { width: 120px; }
.mkt-sell { display: flex; gap: 10px; align-items: center; padding: 10px; margin-bottom: 10px; border-radius: 10px; border: 1px solid var(--gold); background: rgba(243, 184, 76, .07); flex-wrap: wrap; }
.mkt-sell .r-info { flex: 1; min-width: 160px; }
.titletag { color: #ffd76a; font-weight: 700; font-size: 12px; }
/* 메뉴가 13개라 좁은 화면(휴대폰 가로)에서는 단축키 표시를 빼고 촘촘하게 */
@media (max-width: 1000px), (pointer: coarse) { #menu kbd { display: none; } #menu button { min-width: 30px; padding: 6px 4px; font-size: 12px; } }

/* 월드 보스 · 핫타임 알림 줄 */
#event-bar { position: absolute; left: 50%; transform: translateX(-50%); top: calc(104px + var(--safe-t)); display: flex; flex-direction: column; gap: 4px; align-items: center; z-index: 5; max-width: 52%; }
#event-bar.hidden { display: none; }
.evb { display: block; padding: 5px 12px; border-radius: 999px; font-size: 12px; color: #fff; background: rgba(13, 17, 26, .8); border: 1px solid rgba(255, 255, 255, .15); text-align: center; font-family: inherit; }
.evb b { margin-right: 4px; }
.evb.wb { border-color: #ff6a3c; box-shadow: 0 0 12px rgba(255, 90, 60, .45); cursor: pointer; animation: evpulse 2s ease-in-out infinite; }
.evb.wb u { color: #ffd76a; }
.evb.hot { border-color: #ffd76a; color: #ffe9a8; }
@keyframes evpulse { 50% { box-shadow: 0 0 20px rgba(255, 90, 60, .75); } }

/* 혈맹 */
.ginput { background: var(--panel2, #1c2230); color: var(--text); border: 1px solid var(--line, #3a4150); border-radius: 6px; padding: 6px 8px; font-size: 13px; }
#chat-form { display: flex; gap: 4px; } #chat-form #chat-input { flex: 1; min-width: 0; }
#chat-mode { flex: none; border: 1px solid rgba(255,255,255,.2); background: rgba(13,17,26,.7); color: #cfd6e4; border-radius: 6px; padding: 0 8px; font: 700 11px var(--sans); }
#chat-mode.on { background: #2b6fb0; color: #fff; border-color: #6fb2ff; }
#chat-mode.hidden { display: none; }
.gchat b { color: #9fd4ff; } .gchat { color: #d6ebff; }
.btn.danger { border-color: #8a3a36; color: #ffb3ab; }

/* 혈맹 마크 */
.gmark { display: inline-grid; place-items: center; width: var(--gs); height: calc(var(--gs) * 1.1); margin-right: 6px; vertical-align: middle; background: var(--gc); color: #fff; font-weight: 700; font-size: calc(var(--gs) * .66); line-height: 1;
  clip-path: polygon(0 0, 100% 0, 100% 52%, 50% 100%, 0 52%); box-shadow: inset 0 0 0 2px rgba(255,225,150,.85); }
.gmark-row { display: flex; align-items: center; gap: 6px; margin: 8px 0 6px; }
.gmark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 5px; margin-top: 6px; }
.gmark-pick { height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #fff; font-size: 18px; cursor: pointer; }
.gmark-col { height: 26px; border-radius: 7px; border: 2px solid rgba(255,255,255,.2); cursor: pointer; }
.gmark-pick.on, .gmark-col.on { border-color: var(--gold2); box-shadow: 0 0 10px rgba(255,200,90,.55); }

/* 메뉴: 나가기 */
#menu .exit { color: #ffb4a8; }
#menu .exit:hover { background: rgba(200,60,50,.25); }
