/* Dark Slayer — 다크 고딕 게임 UI */

/* 한글 픽셀 폰트 (Galmuri11, SIL OFL 1.1) — DOM UI 와 Phaser 캔버스 텍스트 공용 */
@font-face {
  font-family: 'GameUI';
  src: url('../assets/fonts/Galmuri11.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'GameUI';
  src: url('../assets/fonts/Galmuri11-Bold.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'GameNum';
  src: url('../assets/fonts/Galmuri11-Bold.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}

:root {
  --gold: #c8a44a;
  --gold-bright: #ffd24a;
  --gold-dark: #7a5c1e;
  --bronze: #5a4426;
  --bronze-dark: #32260f;
  --blood: #8a1a1a;
  --panel-bg: #140e1c;
  --panel-border: #3a2c1a;
  --inset-dark: rgba(0, 0, 0, 0.55);
  --text: #d8cdb8;
  --dim: #8a8074;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0a0710;
  font-family: 'GameUI', 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: var(--text);
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game-root { position: fixed; inset: 0; }
#game-root canvas { display: block; }

#ui-root { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui-root > * { pointer-events: auto; }

#loading {
  position: fixed; inset: 0; z-index: 500;
  background: #0a0710;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
#loading .loading-title {
  font-size: clamp(28px, 6vw, 44px); font-weight: 900; letter-spacing: 7px;
  color: var(--gold-bright);
  text-shadow: 0 0 26px rgba(255, 180, 60, 0.4);
}
#loading-bar {
  width: min(320px, 70vw); height: 10px;
  background: rgba(255,255,255,0.07); border: 1px solid var(--panel-border);
  border-radius: 6px; overflow: hidden;
}
#loading-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #8a5a16, #ffd24a);
  transition: width 0.15s;
}
#loading-text { color: var(--dim); font-size: 12px; }

#error-overlay {
  display: none; position: fixed; left: 8px; bottom: 8px; z-index: 9999;
  max-width: 60vw; max-height: 30vh; overflow: auto;
  background: rgba(80, 10, 10, 0.92); color: #ffd0d0;
  font: 11px/1.5 monospace; padding: 8px 10px; border-radius: 6px;
  pointer-events: none;
}

/* ══════════ 상단 HUD ══════════ */
#hud-top-left {
  position: absolute; top: 10px; left: 10px;
  display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;
}
.chip {
  display: flex; align-items: center; gap: 8px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 80, 30, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(28, 19, 36, 0.94), rgba(10, 7, 16, 0.94));
  border: 1px solid #050308;
  box-shadow:
    0 0 0 1px var(--bronze-dark),
    0 0 0 2px rgba(200, 164, 74, 0.16),
    inset 0 1px 0 rgba(255, 220, 150, 0.1),
    0 3px 10px rgba(0,0,0,0.45);
  border-radius: 7px; padding: 6px 10px;
  font-size: 12px;
  width: fit-content;
}
#chip-class { font-size: 22px; }
#chip-name { font-weight: 700; color: var(--gold-bright); font-size: 13px; }
#res-chip b { color: var(--gold-bright); font-weight: 600; }
#res-chip span { display: inline-flex; gap: 3px; align-items: center; }
#zone-chip { flex-direction: column; align-items: flex-start; gap: 4px; min-width: 170px; }
#zone-name { font-weight: 700; font-size: 12px; color: #e8d8b8; }
#zone-progress {
  position: relative; width: 100%; height: 12px;
  background: rgba(0,0,0,0.65); border-radius: 6px; overflow: hidden;
  border: 1px solid #2a2018;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.7);
}
#zone-progress-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(180deg, #b07aff 0%, #8a4aff 45%, #6a3aff 100%);
  box-shadow: 0 0 6px rgba(138, 90, 255, 0.6);
  transition: width 0.3s;
}
#zone-progress::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(20% - 1px), rgba(0,0,0,0.5) calc(20% - 1px) 20%);
}
#zone-progress-text {
  position: absolute; inset: 0; text-align: center;
  font-size: 9px; line-height: 12px; color: #fff; text-shadow: 0 1px 2px #000;
}

/* 현재 목표 칩 — zone-chip 3부 구조 미러 (금색 진행바), 클릭 시 연관 패널 */
#goal-chip { align-items: center; min-width: 170px; pointer-events: auto; cursor: pointer; }
#goal-chip:hover { box-shadow: 0 0 0 1px var(--bronze-dark), 0 0 0 2px rgba(255, 210, 100, 0.4), 0 3px 10px rgba(0,0,0,0.45); }
#goal-icon { font-size: 18px; }
#goal-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
#goal-text { font-weight: 700; font-size: 12px; color: #ffd76a; }
#goal-progress {
  position: relative; width: 100%; height: 12px;
  background: rgba(0,0,0,0.65); border-radius: 6px; overflow: hidden;
  border: 1px solid #2a2018;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.7);
}
#goal-progress-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(180deg, #ffd76a 0%, #d8a63a 50%, #b8862a 100%);
  box-shadow: 0 0 6px rgba(255, 200, 90, 0.5);
  transition: width 0.3s;
}
#goal-progress-text {
  position: absolute; inset: 0; text-align: center;
  font-size: 9px; line-height: 12px; color: #fff; text-shadow: 0 1px 2px #000;
}

#hud-top-right {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 8px; align-items: flex-start;
  pointer-events: none; /* 빈 영역은 캔버스 클릭 통과 */
}
#hud-top-right .menu-btn { pointer-events: auto; }
/* 메뉴 기둥 래퍼 — 토글 버튼 + 버튼 목록 */
#menu-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#menu-toggle {
  pointer-events: auto;
  width: 40px; height: 28px; font-size: 15px; line-height: 1;
  color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(32, 22, 42, 0.94), rgba(14, 9, 20, 0.95));
  border: 1px solid #050308; border-radius: 9px; cursor: pointer;
  box-shadow: 0 0 0 2px var(--bronze-dark), inset 0 1px 0 rgba(255,220,150,0.12), 0 3px 8px rgba(0,0,0,0.5);
  transition: all 0.12s;
}
#menu-toggle:hover { box-shadow: 0 0 0 2px var(--gold), 0 0 10px rgba(200,164,74,0.4); }
#menu-toggle:active { transform: scale(0.94); }
/* 접힘 — 버튼 목록을 숨기고 토글만 남긴다 (세로 공간 확보) */
#menu-wrap.collapsed #menu-btns {
  max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0;
  margin: 0; overflow: hidden; pointer-events: none;
  border-width: 0; box-shadow: none;
}
#menu-btns {
  max-height: 600px; opacity: 1;
  transition: max-height 0.25s ease, opacity 0.18s ease, padding 0.25s ease;
}
#minimap {
  border: 1px solid #050308; border-radius: 8px;
  background: rgba(8, 6, 12, 0.82);
  box-shadow:
    0 0 0 2px var(--bronze-dark),
    0 0 0 3px #06040a,
    0 0 0 4px rgba(200, 164, 74, 0.22),
    0 6px 18px rgba(0,0,0,0.55),
    inset 0 0 24px rgba(0,0,0,0.6);
}
/* 메뉴 기둥 — 청동 프레임 패널 안에 버튼이 박힌 형태 */
#menu-btns {
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 6px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 80, 30, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(32, 22, 42, 0.92), rgba(14, 9, 20, 0.94));
  border: 1px solid #050308; border-radius: 12px;
  box-shadow:
    0 0 0 2px var(--bronze-dark),
    0 0 0 3px #06040a,
    0 0 0 4px rgba(200, 164, 74, 0.22),
    0 8px 22px rgba(0,0,0,0.55),
    inset 0 1px 0 rgba(255, 220, 150, 0.1);
}
#menu-btns::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle 4px at 50% 3px, var(--gold) 1.5px, rgba(200,164,74,0.3) 2.5px, transparent 4px),
    radial-gradient(circle 4px at 50% calc(100% - 3px), var(--gold) 1.5px, rgba(200,164,74,0.3) 2.5px, transparent 4px);
}
.menu-btn {
  position: relative;
  width: 40px; height: 40px; font-size: 18px;
  background:
    radial-gradient(circle at 50% 26%, #342544, #181020 78%);
  border: 1px solid #050308; border-radius: 9px;
  box-shadow:
    0 0 0 1px var(--bronze-dark),
    inset 0 1px 0 rgba(255, 220, 150, 0.14),
    inset 0 -2px 5px rgba(0,0,0,0.55),
    0 3px 8px rgba(0,0,0,0.45);
  cursor: pointer; transition: all 0.12s;
  text-shadow: 0 2px 3px rgba(0,0,0,0.7);
}
.menu-btn:hover {
  box-shadow:
    0 0 0 1px var(--gold),
    inset 0 1px 0 rgba(255, 220, 150, 0.18),
    inset 0 -2px 5px rgba(0,0,0,0.5),
    0 0 12px rgba(200, 164, 74, 0.45);
  transform: translateY(-1px) scale(1.04);
}
.menu-btn:active { transform: translateY(0) scale(0.96); }

/* ══════════ 보스 바 ══════════ */
#boss-bar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(520px, 60vw); text-align: center;
  pointer-events: none;
}
#boss-name { font-size: 15px; color: #ffb0d8; text-shadow: 0 2px 4px #000; margin-bottom: 4px; }
#boss-name b { color: #ff6ab0; }
#boss-name::before, #boss-name::after { content: ' ◆ '; color: rgba(255, 106, 176, 0.55); font-size: 10px; vertical-align: 2px; }
#boss-hp {
  position: relative;
  height: 16px; background: rgba(0,0,0,0.72);
  border: 1px solid #050308; border-radius: 8px; overflow: hidden;
  box-shadow:
    0 0 0 1px #5a2040,
    0 0 0 2px rgba(255, 90, 150, 0.18),
    0 3px 12px rgba(0,0,0,0.5),
    inset 0 1px 3px rgba(0,0,0,0.8);
}
#boss-hp-fill {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(180deg, #ff6a9a 0%, #d82060 40%, #8a1040 100%);
  box-shadow: 0 0 10px rgba(255, 58, 122, 0.55);
  transition: width 0.2s;
}
#boss-hp::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), transparent 45%),
    repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0,0,0,0.4) calc(10% - 1px) 10%);
}

/* ══════════ 하단 HUD ══════════ */
#hud-bottom {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 14px;
  z-index: 70; /* 터치 조이스틱 존(60)보다 위 — 물약/스킬 버튼 탭 보장 */
  pointer-events: none; /* 빈 영역은 캔버스 클릭 통과 */
}
#hud-bottom .skill-slot, #hud-bottom .potion-btn, #hud-bottom #auto-btn { pointer-events: auto; }
.orb {
  position: relative; width: 92px; height: 92px;
  border-radius: 50%; overflow: hidden;
  border: 2px solid #0a0710;
  background: radial-gradient(circle at 35% 30%, #241a28, #0c0810);
  box-shadow:
    0 0 0 3px var(--bronze),
    0 0 0 5px #0a0710,
    0 0 0 6px rgba(200, 164, 74, 0.35),
    0 10px 28px rgba(0,0,0,0.75),
    inset 0 0 20px rgba(0,0,0,0.85);
}
/* 오브별 주변광 — 생명은 핏빛, 마나는 푸른빛이 바닥에 스민다 */
.orb.hp { box-shadow:
    0 0 0 3px var(--bronze), 0 0 0 5px #0a0710, 0 0 0 6px rgba(200, 164, 74, 0.35),
    0 10px 28px rgba(0,0,0,0.75), 0 0 26px rgba(255, 60, 40, 0.22),
    inset 0 0 20px rgba(0,0,0,0.85); }
.orb.mp { box-shadow:
    0 0 0 3px var(--bronze), 0 0 0 5px #0a0710, 0 0 0 6px rgba(200, 164, 74, 0.35),
    0 10px 28px rgba(0,0,0,0.75), 0 0 26px rgba(70, 110, 255, 0.22),
    inset 0 0 20px rgba(0,0,0,0.85); }
.orb-fill {
  position: absolute; bottom: 0; left: 0; right: 0; height: 100%;
  transition: height 0.25s;
}
/* 액체 표면 하이라이트 — 차오른 높이의 윗면이 빛난다 */
.orb-fill::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45) 30%, rgba(255,255,255,0.45) 70%, transparent);
}
.orb.hp .orb-fill { background: linear-gradient(180deg, #ff6a55, #c81e1e 45%, #6e0a0a); }
.orb.mp .orb-fill { background: linear-gradient(180deg, #6a96ff, #2a4ad8 45%, #0e1e6e); }
.orb.hp.low .orb-fill { animation: hp-pulse 0.8s infinite; }
.orb.hp.shielded { border-color: #7ab8ff; box-shadow: 0 0 14px rgba(120, 180, 255, 0.5); }
@keyframes hp-pulse { 50% { filter: brightness(1.5); } }
/* 유리 림 라이트 — 구체 가장자리의 반사 */
.orb-rim {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.22),
    inset 0 -6px 12px rgba(0, 0, 0, 0.55),
    inset -4px 0 10px rgba(0, 0, 0, 0.3);
}
.orb-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff; text-shadow: 0 2px 3px #000, 0 0 8px rgba(0,0,0,0.8);
}
.orb-gloss {
  position: absolute; top: 7%; left: 15%; width: 48%; height: 30%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.38), transparent 70%);
  border-radius: 50%; pointer-events: none;
  transform: rotate(-12deg);
}

#hud-center { display: flex; flex-direction: column; align-items: center; }
/* 컨트롤 플레이트 — 스킬/물약/경험치를 하나의 청동 패널 위에 (D2 스타일) */
#hud-plate {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 11px 16px 10px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 80, 30, 0.2), transparent 58%),
    linear-gradient(180deg, rgba(36, 25, 46, 0.94), rgba(17, 11, 24, 0.95) 55%, rgba(10, 6, 15, 0.96));
  border: 1px solid #050308;
  border-radius: 15px;
  box-shadow:
    0 0 0 2px var(--bronze-dark),
    0 0 0 3px #06040a,
    0 0 0 4px rgba(200, 164, 74, 0.28),
    0 12px 32px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255, 220, 150, 0.12);
}
/* 코너 골드 리벳 */
#hud-plate::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle 4px at 8px 8px, var(--gold) 1.5px, rgba(200,164,74,0.35) 2.5px, transparent 4px),
    radial-gradient(circle 4px at calc(100% - 8px) 8px, var(--gold) 1.5px, rgba(200,164,74,0.35) 2.5px, transparent 4px),
    radial-gradient(circle 4px at 8px calc(100% - 8px), var(--gold) 1.5px, rgba(200,164,74,0.35) 2.5px, transparent 4px),
    radial-gradient(circle 4px at calc(100% - 8px) calc(100% - 8px), var(--gold) 1.5px, rgba(200,164,74,0.35) 2.5px, transparent 4px);
}
#exp-bar {
  position: relative;
  width: 100%; height: 9px; background: rgba(0,0,0,0.7);
  border: 1px solid #0a0710; border-radius: 5px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(200, 164, 74, 0.25), inset 0 1px 3px rgba(0,0,0,0.8);
}
#exp-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #7a52f0, #b88aff 60%, #d8b8ff);
  box-shadow: 0 0 8px rgba(160, 110, 255, 0.6);
  transition: width 0.3s;
}
/* 초월 모드 (만렙 이후) — 금빛 게이지로 전환 */
#exp-bar.paragon #exp-fill {
  background: linear-gradient(90deg, #c8912a, #ffd24a 60%, #ffedb0);
  box-shadow: 0 0 8px rgba(255, 210, 74, 0.65);
}
/* 10% 구간 눈금 */
#exp-ticks {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0, 0, 0, 0.55) calc(10% - 1px) 10%);
}

#skill-bar { display: grid; grid-template-columns: repeat(6, max-content); gap: 8px; } /* 2줄 12슬롯 */
.skill-slot {
  position: relative; width: 54px; height: 54px;
  background:
    linear-gradient(160deg, rgba(255, 235, 200, 0.07), transparent 38%),
    radial-gradient(circle at 50% 30%, #34243f, #150d1c 78%);
  border: 1px solid #050308; border-radius: 10px;
  box-shadow:
    0 0 0 2px var(--bronze),
    0 0 0 3px #0a0710,
    0 0 0 4px rgba(200, 164, 74, 0.16),
    inset 0 2px 6px rgba(0,0,0,0.7),
    inset 0 -1px 0 rgba(255, 220, 150, 0.08),
    0 4px 10px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  transition: box-shadow 0.12s, transform 0.1s;
}
.skill-slot:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 2px var(--gold),
    0 0 0 3px #0a0710,
    0 0 0 4px rgba(255, 210, 74, 0.25),
    inset 0 2px 6px rgba(0,0,0,0.7),
    0 0 14px rgba(255, 210, 74, 0.45),
    0 6px 12px rgba(0,0,0,0.5);
}
.skill-slot:active { transform: translateY(0) scale(0.95); }
.skill-icon { font-size: 24px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.7)); }
.skill-key {
  position: absolute; top: 0; left: 0;
  padding: 1px 5px 2px 4px;
  font-size: 10px; font-weight: 800; color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(40, 28, 14, 0.95), rgba(22, 14, 8, 0.9));
  border-right: 1px solid rgba(200, 164, 74, 0.4);
  border-bottom: 1px solid rgba(200, 164, 74, 0.4);
  border-radius: 0 0 7px 0;
  text-shadow: 0 1px 2px #000;
}
.skill-mp {
  position: absolute; bottom: 1px; right: 4px;
  font-size: 9px; font-weight: 700; color: #8aaaff;
  text-shadow: 0 1px 2px #000;
}
.skill-cd {
  position: absolute; bottom: 0; left: 0; right: 0; height: 0%;
  background: rgba(10, 6, 16, 0.84);
  border-top: 1px solid rgba(255, 210, 74, 0.55);
  pointer-events: none;
}

#bottom-row { display: flex; gap: 8px; align-items: center; }
.potion-btn {
  position: relative; width: 46px; height: 38px;
  background:
    radial-gradient(circle at 50% 70%, rgba(255, 90, 70, 0.18), transparent 65%),
    linear-gradient(180deg, #2a1d30, #140d18);
  border: 1px solid #050308; border-radius: 9px;
  box-shadow:
    0 0 0 1px var(--bronze-dark),
    inset 0 1px 0 rgba(255, 220, 150, 0.1),
    inset 0 -2px 4px rgba(0,0,0,0.5);
  font-size: 16px; cursor: pointer; overflow: hidden;
  color: var(--text);
  transition: all 0.12s;
}
#potion-mp {
  background:
    radial-gradient(circle at 50% 70%, rgba(80, 120, 255, 0.18), transparent 65%),
    linear-gradient(180deg, #2a1d30, #140d18);
}
.potion-btn:hover { box-shadow: 0 0 0 1px var(--gold), inset 0 1px 0 rgba(255, 220, 150, 0.12), 0 0 9px rgba(200, 164, 74, 0.3); }
.potion-btn:active { transform: scale(0.94); }
.potion-count {
  position: absolute; bottom: 0; right: 0;
  min-width: 15px; padding: 1px 4px 2px;
  font-size: 10px; font-weight: 800; color: #ffe9c8;
  background: rgba(12, 8, 6, 0.88);
  border-left: 1px solid rgba(200, 164, 74, 0.35);
  border-top: 1px solid rgba(200, 164, 74, 0.35);
  border-radius: 7px 0 0 0;
  text-shadow: 0 1px 2px #000; text-align: center;
}
/* 물약 단축키 칩 — 스킬 슬롯과 같은 문법 */
.potion-key {
  position: absolute; top: 0; left: 0;
  padding: 1px 5px 2px 4px;
  font-size: 9px; font-weight: 800; color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(40, 28, 14, 0.95), rgba(22, 14, 8, 0.9));
  border-right: 1px solid rgba(200, 164, 74, 0.4);
  border-bottom: 1px solid rgba(200, 164, 74, 0.4);
  border-radius: 0 0 7px 0;
  text-shadow: 0 1px 2px #000;
}
.potion-cd {
  position: absolute; bottom: 0; left: 0; right: 0; height: 0%;
  background: rgba(0,0,0,0.7); pointer-events: none;
}
.ammo-chip {
  display: inline-flex; align-items: center; gap: 3px;
  height: 38px; padding: 0 9px;
  background: linear-gradient(180deg, #2a1d30, #140d18);
  border: 1px solid #050308; border-radius: 9px;
  box-shadow: 0 0 0 1px var(--bronze-dark), inset 0 1px 0 rgba(255, 220, 150, 0.08);
  font-size: 13px;
}
.ammo-chip span { font-size: 12px; font-weight: 700; color: #d8e8c0; }
.ammo-chip.ammo-empty span { color: #ff6a5a; }
.combo-chip {
  display: inline-flex; align-items: center;
  height: 38px; padding: 0 9px;
  background: linear-gradient(180deg, #2a1d30, #140d18);
  border: 1px solid #050308; border-radius: 9px;
  box-shadow: 0 0 0 1px var(--bronze-dark), inset 0 1px 0 rgba(255, 220, 150, 0.08);
}
.combo-chip span { font-size: 13px; font-weight: 700; letter-spacing: 2px; color: #b09ad8; }
.combo-chip.combo-full span { color: #d8a8ff; text-shadow: 0 0 6px rgba(216, 168, 255, 0.6); }
#auto-btn {
  height: 38px; padding: 0 18px;
  font-size: 13px; font-weight: 800; letter-spacing: 2px;
  color: #b0a088;
  background:
    linear-gradient(160deg, rgba(255, 235, 200, 0.06), transparent 40%),
    linear-gradient(180deg, #2a1d30, #140d18);
  border: 1px solid #050308; border-radius: 19px;
  box-shadow:
    0 0 0 1px var(--bronze-dark),
    inset 0 1px 0 rgba(255, 220, 150, 0.12),
    inset 0 -2px 4px rgba(0,0,0,0.5);
  cursor: pointer; transition: all 0.15s;
  text-shadow: 0 1px 2px #000;
}
#auto-btn:hover { box-shadow: 0 0 0 1px var(--gold), inset 0 1px 0 rgba(255, 220, 150, 0.14), 0 0 10px rgba(200, 164, 74, 0.35); color: #e8d8b8; }
#auto-btn.active {
  color: #1a1006; background: linear-gradient(180deg, #ffd24a, #c89a2a);
  border-color: #ffe9a0; box-shadow: 0 0 16px rgba(255, 210, 74, 0.55);
  text-shadow: none;
  animation: auto-glow 1.6s infinite;
}
@keyframes auto-glow { 50% { box-shadow: 0 0 26px rgba(255, 210, 74, 0.85); } }

/* ══════════ 토스트/플래시 ══════════ */
#toasts {
  position: absolute; top: 70px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(14, 10, 20, 0.92); border: 1px solid var(--panel-border);
  padding: 8px 18px; border-radius: 18px; font-size: 13px;
  opacity: 0; transform: translateY(-8px); transition: all 0.3s;
  max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.gold { border-color: var(--gold); color: var(--gold-bright); }
.toast.red { border-color: #8a2a2a; color: #ff9a8a; }
.toast.purple { border-color: #6a3a9a; color: #d8b0ff; }

#vignette {
  position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 50;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(160, 10, 10, 0.55) 100%);
}
#vignette.hurt { animation: hurt-flash 0.4s ease-out; }
@keyframes hurt-flash { 0% { opacity: 1; } 100% { opacity: 0; } }

#gold-flash {
  position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 50;
  background: radial-gradient(ellipse at center, rgba(255, 220, 120, 0.22), transparent 70%);
}
#gold-flash.show { animation: gold-flash-anim 0.8s ease-out; }
@keyframes gold-flash-anim { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ══════════ 패널 ══════════ */
.hidden { display: none !important; }

#panel-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 2, 8, 0.6); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
/* 패널 오픈 pop — 열림만 애니, 닫힘은 즉시 (입력 지연 방지) */
@keyframes panel-pop {
  from { transform: scale(0.96); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}
#panel-box.pop { animation: panel-pop 140ms ease-out; }

#panel-box {
  position: relative;
  width: min(860px, 94vw); max-height: 88vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(90, 60, 25, 0.16), transparent 55%),
    linear-gradient(180deg, #1a1224, #100a16 40%, #0d0812);
  border: 1px solid #060409; border-radius: 10px;
  box-shadow:
    0 0 0 2px var(--bronze-dark),
    0 0 0 3px #06040a,
    0 0 0 4px rgba(200, 164, 74, 0.28),
    0 24px 70px rgba(0,0,0,0.85),
    inset 0 1px 0 rgba(255, 220, 150, 0.1);
  display: flex; flex-direction: column;
  overflow: hidden;
  word-break: keep-all; /* 패널 전반 한국어 어절 단위 줄바꿈 */
}
/* 코너 장식 (네 귀퉁이 골드 포인트) */
#panel-box::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background:
    radial-gradient(circle 5px at 9px 9px, var(--gold) 2px, rgba(200,164,74,0.35) 3px, transparent 5px),
    radial-gradient(circle 5px at calc(100% - 9px) 9px, var(--gold) 2px, rgba(200,164,74,0.35) 3px, transparent 5px),
    radial-gradient(circle 5px at 9px calc(100% - 9px), var(--gold) 2px, rgba(200,164,74,0.35) 3px, transparent 5px),
    radial-gradient(circle 5px at calc(100% - 9px) calc(100% - 9px), var(--gold) 2px, rgba(200,164,74,0.35) 3px, transparent 5px);
}
#panel-head {
  position: relative;
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 18px 12px;
  background: linear-gradient(180deg, rgba(70, 46, 20, 0.5), rgba(30, 20, 12, 0.15) 80%, transparent);
  border-bottom: 1px solid rgba(0,0,0,0.6);
}
#panel-head::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 164, 74, 0.55) 18%, rgba(200, 164, 74, 0.55) 82%, transparent);
}
#panel-title {
  font-size: 17px; font-weight: 800; color: var(--gold-bright); letter-spacing: 1.5px;
  text-shadow: 0 0 14px rgba(255, 190, 70, 0.35), 0 2px 2px #000;
}
#panel-close {
  width: 30px; height: 30px; border-radius: 8px;
  background: transparent; border: 1px solid var(--panel-border);
  color: var(--dim); font-size: 14px; cursor: pointer;
}
#panel-close:hover { color: #fff; border-color: #8a2a2a; }
#panel-content { padding: 14px 18px; overflow-y: auto; }

.btn {
  padding: 8px 16px; border-radius: 7px; cursor: pointer;
  background: linear-gradient(180deg, #3c2c48, #221630 55%, #190f24);
  border: 1px solid #060409; color: var(--text);
  box-shadow:
    0 0 0 1px #51405f,
    inset 0 1px 0 rgba(255, 235, 200, 0.14),
    inset 0 -2px 4px rgba(0,0,0,0.5),
    0 2px 5px rgba(0,0,0,0.45);
  font-size: 13px; font-family: inherit;
  transition: all 0.12s;
}
.btn:hover:not(:disabled) {
  box-shadow:
    0 0 0 1px var(--gold),
    inset 0 1px 0 rgba(255, 235, 200, 0.18),
    inset 0 -2px 4px rgba(0,0,0,0.5),
    0 0 10px rgba(200, 164, 74, 0.35);
  transform: translateY(-1px);
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-primary { background: linear-gradient(180deg, #2a4a2e, #16281a); border-color: #3a6a42; }
.btn-danger { background: linear-gradient(180deg, #4a2026, #281014); border-color: #6a3038; }
.btn-forge {
  background: linear-gradient(180deg, #6a4a16, #3a280c); border-color: #c8a44a;
  color: #ffe9b0; font-weight: 700; font-size: 14px; padding: 11px 22px;
}
.btn-forge:hover:not(:disabled) { box-shadow: 0 0 14px rgba(200, 164, 74, 0.4); }

.dim { color: var(--dim); font-size: 0.92em; }
.center-note { text-align: center; margin: 8px 0; }
.box-title {
  display: flex; align-items: center;
  font-weight: 800; color: var(--gold-bright); margin-bottom: 9px; font-size: 13px;
  letter-spacing: 1.5px; text-shadow: 0 1px 2px #000;
}
/* 제목 좌측 장식 마름모 + 우측으로 잦아드는 라인 */
.box-title::before {
  content: '◆'; font-size: 8px; color: var(--bronze); margin-right: 7px;
}
.box-title::after {
  content: ''; flex: 1; height: 1px; margin-left: 10px;
  background: linear-gradient(90deg, rgba(200, 164, 74, 0.45), transparent 85%);
}
/* wrap + 제목 불수축: 제목(flex:1 min-width:0)이 내용 폭 이하로 줄면 안의 용량 게이지가
   박스 밖으로 넘쳐 도구줄(정렬/일괄판매) 위에 겹쳐 그려진다 — 좁으면 도구줄을 아랫줄로 내린다 */
.box-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; gap: 7px 10px; flex-wrap: wrap; }
.box-title-row .box-title { margin-bottom: 0; flex: 1 0 auto; }

/* 패널 스크롤바 — 청동 손잡이 (잘린 듯한 인상 제거) */
#panel-content::-webkit-scrollbar, .inv-grid::-webkit-scrollbar { width: 9px; }
#panel-content::-webkit-scrollbar-track, .inv-grid::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.35); border-radius: 5px;
}
#panel-content::-webkit-scrollbar-thumb, .inv-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6a5236, #4a3826);
  border-radius: 5px; border: 1px solid #0a0710;
}
#panel-content::-webkit-scrollbar-thumb:hover, .inv-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8a6a42, #5a4630);
}

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab {
  padding: 7px 16px; border-radius: 7px 7px 0 0; cursor: pointer;
  background: linear-gradient(180deg, rgba(40, 28, 50, 0.5), rgba(16, 10, 22, 0.5));
  border: 1px solid #1c1426; border-bottom: none;
  color: var(--dim); font-size: 13px; font-family: inherit;
  text-shadow: 0 1px 2px #000;
}
.tab.active {
  background: linear-gradient(180deg, rgba(120, 86, 30, 0.4), rgba(60, 42, 16, 0.18));
  color: var(--gold-bright); border-color: var(--gold-dark);
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.18), 0 0 10px rgba(200, 164, 74, 0.18);
}

/* ── 인벤토리 ── */
/* 좌측 열: pd-layout 고정폭 합(슬롯 60×2 + 프리뷰 150 + gap 14) + 박스 패딩 26 이 들어가는 폭 */
.inv-layout { display: grid; grid-template-columns: 332px 1fr; gap: 24px; }
/* 장착 장비와 가방을 별도 패널 박스로 분리 — 영역 혼동 방지 */
.inv-equip, .inv-bag {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 80, 30, 0.08), transparent 50%),
    rgba(0, 0, 0, 0.28);
  border: 1px solid #3a2c46;
  border-radius: 12px;
  padding: 12px;
  align-self: start;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.06), 0 4px 14px rgba(0,0,0,0.25);
}
/* 박스 코너 골드 포인트 */
.inv-equip::before, .inv-bag::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 12px;
  background:
    radial-gradient(circle 3.5px at 7px 7px, rgba(200,164,74,0.8) 1.2px, transparent 3.5px),
    radial-gradient(circle 3.5px at calc(100% - 7px) 7px, rgba(200,164,74,0.8) 1.2px, transparent 3.5px),
    radial-gradient(circle 3.5px at 7px calc(100% - 7px), rgba(200,164,74,0.8) 1.2px, transparent 3.5px),
    radial-gradient(circle 3.5px at calc(100% - 7px) calc(100% - 7px), rgba(200,164,74,0.8) 1.2px, transparent 3.5px);
}

/* 인벤토리 패널 — 고정 높이 + 가방 내부 스크롤 (행 잘림 방지) */
#panel-box[data-panel="inventory"] { height: min(86vh, 780px); }
#panel-box[data-panel="inventory"] #panel-content { display: flex; flex-direction: column; min-height: 0; }
#panel-box[data-panel="inventory"] .inv-layout { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); }
#panel-box[data-panel="inventory"] .inv-bag {
  display: flex; flex-direction: column; min-height: 0; max-height: 100%;
  align-self: stretch; overflow: hidden; box-sizing: border-box;
}
#panel-box[data-panel="inventory"] .inv-grid { flex: 1; min-height: 0; max-height: none; }
#panel-box[data-panel="inventory"] .inv-equip { overflow-y: auto; max-height: 100%; box-sizing: border-box; }

/* 가방 용량 게이지 */
.cap-wrap { display: inline-flex; align-items: center; gap: 7px; margin-left: 9px; vertical-align: 1px; }
.cap-bar {
  width: 90px; height: 7px; border-radius: 4px; overflow: hidden;
  background: rgba(0,0,0,0.6); border: 1px solid #0a0710;
  box-shadow: 0 0 0 1px rgba(200, 164, 74, 0.2);
}
.cap-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8a6a3a, #c8a44a); }
.cap-num { font-size: 11px; color: var(--dim); font-weight: 600; }
.cap-wrap.full .cap-bar i { background: linear-gradient(90deg, #b03030, #ff5a4a); }
.cap-wrap.full .cap-num { color: #ff7a6a; }

/* 판매 휴지통 — 드래그 중 강조 */
.trash-zone {
  display: flex; align-items: center; gap: 9px;
  margin-top: 10px; padding: 9px 13px;
  border: 1.5px dashed #4a3040; border-radius: 10px;
  background: rgba(40, 14, 18, 0.25);
  font-size: 12px; color: #b09098;
  opacity: 0.6; transition: all 0.15s;
}
.trash-zone .trash-ico { font-size: 17px; filter: grayscale(0.4); }
.trash-zone b { color: #d8a0a0; }
.trash-zone .dim { font-size: 11px; }
.drag-live .trash-zone {
  opacity: 1; border-color: #a04050;
  background: rgba(70, 18, 24, 0.4);
  box-shadow: 0 0 12px rgba(200, 50, 60, 0.25), inset 0 0 14px rgba(200, 50, 60, 0.12);
}
.trash-zone.drop-ok {
  opacity: 1; border-color: #ff5a4a; border-style: solid;
  background: rgba(110, 24, 28, 0.55);
  box-shadow: 0 0 18px rgba(255, 70, 60, 0.45), inset 0 0 18px rgba(255, 70, 60, 0.2);
}
.trash-zone.drop-ok .trash-ico { filter: none; transform: scale(1.15); }
.equip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* ── 페이퍼돌 장비 배치 (중앙 캐릭터 + 좌우 슬롯) ── */
.pd-layout {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 60px;
  grid-template-areas:
    "helmet preview amulet"
    "weapon preview armor"
    "gloves preview belt"
    "ring1  boots   ring2";
  gap: 7px; justify-items: center; align-items: center;
}
.pd-preview {
  grid-area: preview; align-self: stretch; justify-self: stretch;
  min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 60% 14% at 50% 76%, rgba(138, 90, 255, 0.22), transparent),
    radial-gradient(ellipse 38% 8% at 50% 76%, rgba(190, 150, 255, 0.18), transparent),
    radial-gradient(circle at 50% 38%, #2c1e36, #120a18 75%);
  border: 1px solid #3a2c46; border-radius: 12px; padding: 10px 4px; gap: 2px;
  box-shadow: inset 0 0 24px rgba(0,0,0,0.5);
}
.pd-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 120px; }
.pd-stage .spr-icon { filter: drop-shadow(0 6px 6px rgba(0,0,0,0.55)); }
.pd-snap {
  width: 150px; height: 150px; max-width: 100%; image-rendering: pixelated;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,0.55));
}
.pd-w { position: absolute; right: -26px; bottom: 6px; transform: rotate(8deg); }
.pd-fallback { font-size: 52px; }
.pd-name { font-size: 13px; font-weight: 700; color: var(--gold-bright); }
.pd-sub { font-size: 10px; }
.pda-helmet { grid-area: helmet; } .pda-amulet { grid-area: amulet; }
.pda-weapon { grid-area: weapon; } .pda-armor { grid-area: armor; }
.pda-gloves { grid-area: gloves; } .pda-belt { grid-area: belt; }
.pda-ring1 { grid-area: ring1; } .pda-boots { grid-area: boots; } .pda-ring2 { grid-area: ring2; }
.pd-layout .item-cell { width: 58px; height: 58px; }
.item-cell {
  position: relative; aspect-ratio: 1; min-height: 52px;
  background: rgba(0,0,0,0.4); border: 2px solid #2c2218; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.1s;
}
.item-cell:hover { transform: scale(1.06); z-index: 2; }
.item-cell.empty { cursor: default; opacity: 0.5; }
.item-cell.empty:hover { transform: none; }
/* 드래그 앤 드롭 장착/해제 */
.item-cell[draggable="true"] { cursor: grab; }
.item-cell.dragging { opacity: 0.4; }
.item-cell.drop-ok {
  border-color: #5aff7a;
  box-shadow: 0 0 10px rgba(90, 255, 122, 0.45), inset 0 0 8px rgba(90, 255, 122, 0.2);
}
.inv-grid.drop-ok { outline: 2px dashed rgba(90, 255, 122, 0.5); outline-offset: 2px; border-radius: 8px; }
.cell-icon { font-size: 23px; }
.cell-ghost { font-size: 20px; opacity: 0.25; }
.cell-slot-name { position: absolute; bottom: 3px; font-size: 8px; color: var(--dim); }
.cell-enh {
  position: absolute; top: 2px; right: 4px;
  font-size: 10px; font-weight: 800; color: var(--gold-bright); text-shadow: 0 1px 2px #000;
}
/* 가방 헤더 골드 잔고 — HUD 축약과 달리 전액 표시 */
.inv-gold { margin-left: 10px; font-size: 12px; font-weight: 800; color: var(--gold-bright); white-space: nowrap; }
.cell-sock { position: absolute; bottom: 2px; left: 4px; font-size: 8px; color: #8ad4ff; }

/* 등급별 셀 — 테두리 + 은은한 바닥광 (배경에도 등급 기운이 깔린다) */
.rarity-none { border-color: #2c2218; }
.rarity-common { border-color: #6a6a6a; }
.rarity-magic {
  border-color: #3a5acc; box-shadow: inset 0 0 8px rgba(94, 139, 255, 0.2);
  background: radial-gradient(circle at 50% 78%, rgba(94, 139, 255, 0.14), transparent 65%), rgba(0,0,0,0.4);
}
.rarity-rare {
  border-color: #c8a42a; box-shadow: inset 0 0 8px rgba(255, 210, 74, 0.22);
  background: radial-gradient(circle at 50% 78%, rgba(255, 210, 74, 0.13), transparent 65%), rgba(0,0,0,0.4);
}
.rarity-epic {
  border-color: #8a3acc; box-shadow: inset 0 0 9px rgba(179, 74, 255, 0.3);
  background: radial-gradient(circle at 50% 78%, rgba(179, 74, 255, 0.16), transparent 65%), rgba(0,0,0,0.4);
}
.rarity-unique {
  border-color: #cc6a1a; box-shadow: inset 0 0 10px rgba(255, 138, 42, 0.35);
  background: radial-gradient(circle at 50% 78%, rgba(255, 138, 42, 0.17), transparent 65%), rgba(0,0,0,0.4);
}
.rarity-mythic {
  border-color: #cc2a2a; box-shadow: inset 0 0 12px rgba(255, 59, 59, 0.45);
  background: radial-gradient(circle at 50% 78%, rgba(255, 59, 59, 0.18), transparent 65%), rgba(0,0,0,0.4);
  animation: mythic-glow 1.8s infinite;
}
@keyframes mythic-glow { 50% { box-shadow: inset 0 0 18px rgba(255, 59, 59, 0.7); } }

.rarity-set {
  border-color: #1da838; box-shadow: inset 0 0 9px rgba(46, 232, 74, 0.3);
  background: radial-gradient(circle at 50% 78%, rgba(46, 232, 74, 0.14), transparent 65%), rgba(0,0,0,0.4);
}
.rarity-text-common { color: #c8c8c8; }
.rarity-text-magic { color: #5e8bff; }
.rarity-text-rare { color: #ffd24a; }
.rarity-text-epic { color: #b34aff; }
.rarity-text-set { color: #2ee84a; }
.rarity-text-unique { color: #ff8a2a; }
.rarity-text-mythic { color: #ff3b3b; }

/* 픽셀 아이콘 (7Soul 496 icons, CC0) — 컨텍스트별 크기 */
.px-icon { width: 32px; height: 32px; image-rendering: pixelated; vertical-align: middle; pointer-events: none; }
.skill-icon .px-icon { width: 34px; height: 34px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.6)); }
.cell-icon .px-icon { width: 36px; height: 36px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.55)); }
.cell-ghost .px-icon { width: 30px; height: 30px; opacity: 0.9; filter: grayscale(1) brightness(0.8); }
.node-ico .px-icon { width: 26px; height: 26px; }
.tree-title .px-icon { width: 20px; height: 20px; margin-right: 2px; }
.alloc-ico .px-icon { width: 24px; height: 24px; }
.tt-icon .px-icon { width: 36px; height: 36px; }
.potion-btn .px-icon, .ammo-chip .px-icon { width: 22px; height: 22px; }
.gem-ico .px-icon { width: 30px; height: 30px; }
.sock-gem .px-icon, .gem-btn .px-icon { width: 18px; height: 18px; }
.shop-ico .px-icon { width: 30px; height: 30px; }
.touch-skill .px-icon { width: 30px; height: 30px; }
.char-portrait .spr-icon { filter: drop-shadow(0 3px 4px rgba(0,0,0,0.5)); }

/* 시트 스프라이트 아이템 아이콘 */
.spr-icon {
  display: inline-block; vertical-align: middle;
  background-image: url('../assets/sprites/dungeon-tileset.png');
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

/* 세트 툴팁 */
.tt-set { border-top: 1px solid rgba(46, 232, 74, 0.25); padding-top: 6px; }
.tt-set-name { color: #2ee84a; font-weight: 700; font-size: 12px; margin-bottom: 3px; }
.tt-set-piece { font-size: 11px; color: #5a6a5c; padding-left: 4px; }
.tt-set-piece.have { color: #9ae8a8; }
.tt-set-bonus { font-size: 11px; color: #5a6a5c; margin-top: 2px; }
.tt-set-bonus.active { color: #2ee84a; }

.inv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 6px; max-height: 46vh; overflow-y: auto; padding: 2px;
}
.inv-tools { display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sell-threshold {
  background: #1e1426; border: 1px solid #4a3a56; color: var(--text);
  border-radius: 7px; padding: 4px 6px; font-size: 12px; font-family: inherit; cursor: pointer;
}
.sell-threshold:hover { border-color: var(--gold); }
.sell-charm-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--dim); cursor: pointer; user-select: none;
  white-space: nowrap;
}
.sell-charm-toggle input { accent-color: var(--gold); cursor: pointer; margin: 0; }
.sell-charm-toggle:hover { color: var(--text); }
.inv-detail { margin-top: 12px; min-height: 120px; }
.detail-empty { color: var(--dim); text-align: center; padding: 28px 0; font-size: 13px; }
.detail-tt { background: rgba(0,0,0,0.4); border: 1px solid var(--panel-border); border-radius: 10px; padding: 10px 12px; }
.detail-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ── 툴팁 ── */
#tooltip {
  position: fixed; z-index: 300; pointer-events: none;
  width: 270px; padding: 11px 13px;
  background: rgba(10, 7, 16, 0.97);
  border: 1px solid #4a3a26; border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.8);
  font-size: 12px;
  word-break: keep-all; /* 한국어 어절 단위 줄바꿈 */
}
/* 스탯/스킬 호버 툴팁 */
.tt-stat-line { padding: 2px 0; color: #cfc8e0; }
.tt-stat-line b, .tt-skill-meta b { color: #7ab8ff; }
.tt-main-note { color: var(--gold-bright); font-size: 11px; }
.tt-skill-meta { font-size: 11px; color: var(--dim); padding: 5px 0 2px; }
.tt-skill-desc { color: #d8d0c0; line-height: 1.5; padding-top: 3px; }
.tt-head { display: flex; gap: 9px; align-items: center; margin-bottom: 6px; }
.tt-icon { font-size: 26px; }
.tt-name { font-weight: 800; font-size: 14px; }
.tt-sub { font-size: 10px; color: var(--dim); }
.tt-classreq { font-size: 10px; color: #b09ad8; padding: 2px 0 4px; }
.tt-classreq.unmet { color: #ff6a5a; }
.tt-section { border-top: 1px solid rgba(120, 100, 70, 0.25); padding: 6px 0; }
.tt-base { color: #e8e0d0; font-weight: 600; }
.tt-enh { color: var(--gold-bright); font-size: 10px; }
.tt-affix { padding: 1px 0; }
.roll-low { color: #9a9288; }
.roll-mid { color: #b8c8e8; }
.roll-high { color: #7ab8ff; }
.roll-perfect { color: #ffd24a; text-shadow: 0 0 6px rgba(255, 210, 74, 0.4); }
.roll-signature { color: #ff8a2a; }
.tt-proc { color: #ffd76a; } /* 발동 효과 — 시그니처 계열 금색 */
.tt-socket { font-size: 11px; padding: 1px 0; }
.tt-socket.empty { color: #8a96b8; }
.tt-socket.locked { color: #55504a; }
.tt-gem-eff { color: #8ad4a0; font-size: 10px; }
.tt-lore { font-style: italic; color: #b09a72; font-size: 11px; padding: 6px 0; border-top: 1px solid rgba(120, 100, 70, 0.25); }
.tt-compare-title { font-size: 10px; color: var(--dim); margin-bottom: 2px; }
.diff-up { color: #5aff7a; }
.diff-down { color: #ff6a5a; }
.tt-equipped-mark { margin-top: 6px; font-size: 10px; color: var(--gold); }
.tt-value { margin-top: 6px; font-size: 10px; color: var(--dim); }

/* ── 캐릭터 ── */
.char-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.char-portrait {
  width: 64px; height: 64px; font-size: 36px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, #2c1e36, #140c1c);
  border: 2px solid var(--gold); border-radius: 12px;
}
.char-name { font-size: 19px; font-weight: 800; color: var(--gold-bright); }
.char-sub { font-size: 12px; color: var(--dim); margin: 2px 0; }
.char-passive { font-size: 12px; color: #a0d8b0; }
.char-stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 5px; margin-bottom: 14px;
}
.stat-row {
  display: flex; justify-content: space-between;
  background: rgba(0,0,0,0.32); padding: 6px 11px; border-radius: 7px; font-size: 12px;
}
.stat-row b { color: #fff; }

/* ── 캐릭터 창: 좌(스탯 분배) / 우(상세 수치) ── */
.char-layout { display: grid; grid-template-columns: 250px 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 700px) { .char-layout { grid-template-columns: 1fr; } }
.char-alloc {
  background: rgba(0,0,0,0.28); border: 1px solid #3a2c46;
  border-radius: 10px; padding: 12px;
}
.alloc-pts { font-weight: 400; font-size: 12px; color: var(--dim); float: right; }
.alloc-pts.pts-avail { color: var(--gold-bright); }
.alloc-pts.pts-avail b { color: var(--gold-bright); font-size: 14px; }
.alloc-row {
  display: flex; align-items: center; gap: 7px;
  background: rgba(0,0,0,0.35); border: 1px solid transparent;
  padding: 9px 10px; border-radius: 8px; margin-bottom: 6px; font-size: 13px;
}
.alloc-row.main-stat { border-color: var(--gold); background: rgba(120, 90, 20, 0.18); }
.alloc-ico { font-size: 17px; }
.alloc-name { flex: 1; }
.main-tag {
  font-size: 10px; color: var(--gold-bright); border: 1px solid var(--gold);
  border-radius: 4px; padding: 1px 4px; margin-left: 3px;
  white-space: nowrap; display: inline-block; /* '주스탯' 세로 줄바꿈 방지 */
}
.alloc-val { font-size: 16px; color: #fff; min-width: 36px; text-align: right; }
.alloc-bonus { color: #5e8bff; font-size: 11px; }
.btn-alloc { padding: 4px 8px; font-size: 12px; min-width: 34px; }
.alloc-tools { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.alloc-tools .btn { white-space: nowrap; flex: 1 1 auto; } /* 버튼 내 줄바꿈 금지 — 좁으면 버튼째 다음 줄로 */
.alloc-row { cursor: help; }
.alloc-hint { font-size: 11px; margin-top: 10px; line-height: 1.5; word-break: keep-all; }
.alloc-hint b { color: #e8d8b8; }
.char-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
@media (max-width: 700px) { .char-detail { grid-template-columns: 1fr; } }
.stat-group {
  background: rgba(0,0,0,0.28); border: 1px solid #3a2c46;
  border-radius: 10px; padding: 10px 12px;
}
.stat-group .stat-row { background: none; padding: 4px 2px; border-bottom: 1px solid rgba(255,255,255,0.05); border-radius: 0; }
.stat-group .stat-row:last-child { border-bottom: none; }
.stat-group-title { font-weight: 700; color: #e8d8b8; font-size: 13px; margin-bottom: 6px; }

/* ── 스킬트리 ── */
.skills-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.skills-pts { font-size: 14px; }
.skills-pts b { font-size: 18px; color: var(--dim); }
.skills-pts b.pts-avail { color: var(--gold-bright); }
.skill-trees { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 10px; }
@media (max-width: 760px) { .skill-trees { grid-template-columns: 1fr; } }

/* 트리 탭 (한 화면에 한 트리) */
.tree-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tree-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 8px; cursor: pointer; font-family: inherit; font-size: 14px;
  color: var(--dim); border-radius: 8px;
  background: linear-gradient(180deg, rgba(34, 24, 44, 0.6), rgba(14, 9, 20, 0.6));
  border: 1px solid #060409;
  box-shadow: 0 0 0 1px #2c2138, inset 0 1px 0 rgba(255,255,255,0.04);
  transition: all 0.12s;
}
.tree-tab:hover { color: var(--text); }
.tree-tab.active {
  color: var(--gold-bright); font-weight: 700;
  background: linear-gradient(180deg, rgba(120, 86, 30, 0.35), rgba(50, 34, 14, 0.25));
  box-shadow: 0 0 0 1px var(--gold-dark), inset 0 1px 0 rgba(255, 220, 150, 0.15), 0 0 12px rgba(200, 164, 74, 0.2);
  text-shadow: 0 0 8px rgba(255, 190, 70, 0.3);
}
.tree-tab-ico .px-icon { width: 22px; height: 22px; }
.tree-tab-pts { font-size: 11px; color: var(--dim); }
.tree-tab-pts.on { color: #9ae8a8; }

/* 트리 그래프 — 소켓 노드 + 연결선 + 상세 패널 */
.tree-wrap { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
@media (max-width: 760px) { .tree-wrap { flex-direction: column; align-items: center; } }
.tree-graph {
  position: relative; flex: none;
  background:
    radial-gradient(ellipse at 50% 12%, rgba(90, 60, 25, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(26, 17, 36, 0.7), rgba(8, 5, 12, 0.7));
  border: 1px solid #060409; border-radius: 10px;
  box-shadow: 0 0 0 1px var(--bronze-dark), inset 0 1px 0 rgba(255, 220, 150, 0.06);
}
.tree-links { position: absolute; inset: 0; pointer-events: none; }
.tree-links line { stroke: #3a2c46; stroke-width: 3; }
.tree-links line.on {
  stroke: var(--gold); stroke-width: 3;
  filter: drop-shadow(0 0 3px rgba(255, 200, 80, 0.5));
}
.tier-tag {
  position: absolute; right: 8px; font-size: 9px; color: #6a5a7a;
  pointer-events: none; text-shadow: 0 1px 2px #000;
}
.tier-tag.open { color: #9ae8a8; }

.sock {
  position: absolute; width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #2c1f38, #130c1c 78%);
  border: 1px solid #050308; border-radius: 10px;
  box-shadow: 0 0 0 2px var(--bronze-dark), inset 0 2px 6px rgba(0,0,0,0.7);
  cursor: pointer; transition: box-shadow 0.12s, transform 0.12s;
}
.sock .px-icon { width: 34px; height: 34px; }
.sock:hover { transform: scale(1.07); z-index: 3; }
.sock.learned {
  box-shadow: 0 0 0 2px var(--gold-dark), inset 0 2px 6px rgba(0,0,0,0.6), 0 0 10px rgba(200, 164, 74, 0.3);
}
.sock.avail:not(.learned) {
  box-shadow: 0 0 0 2px #4a6a3e, inset 0 2px 6px rgba(0,0,0,0.6), 0 0 9px rgba(110, 200, 90, 0.3);
  animation: sock-avail 1.6s infinite;
}
@keyframes sock-avail { 50% { box-shadow: 0 0 0 2px #6a9a55, inset 0 2px 6px rgba(0,0,0,0.6), 0 0 14px rgba(110, 200, 90, 0.5); } }
.sock.locked { filter: grayscale(0.85) brightness(0.55); }
.sock.selected {
  box-shadow: 0 0 0 2px var(--gold-bright), inset 0 2px 6px rgba(0,0,0,0.55), 0 0 16px rgba(255, 210, 74, 0.5);
  z-index: 2;
}
.sock.sock-ult { border-radius: 50%; }
.sock.sock-ult.learned { box-shadow: 0 0 0 2px #c8503a, 0 0 0 4px rgba(200, 80, 58, 0.3), inset 0 2px 6px rgba(0,0,0,0.6), 0 0 16px rgba(255, 110, 70, 0.4); }
.sock-rank {
  position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 700; color: var(--text);
  background: linear-gradient(180deg, #2a1e34, #140d1c);
  border: 1px solid var(--bronze-dark); border-radius: 7px; padding: 0 5px;
  text-shadow: 0 1px 2px #000; white-space: nowrap;
}
.sock-rank.maxed { color: var(--gold-bright); border-color: var(--gold-dark); }

/* ── 초월 성좌판 — 스킬트리 보드 재사용 + 성좌 전용 변형 ── */
.const-board {
  background:
    radial-gradient(circle at 20% 25%, rgba(140, 100, 220, 0.10), transparent 42%),
    radial-gradient(circle at 75% 60%, rgba(90, 140, 255, 0.07), transparent 46%),
    radial-gradient(circle at 50% 30%, #191226, #0c0814 80%);
}
.const-board .sock.cnode { width: 56px; height: 56px; border-radius: 50%; }
.const-board .sock.cnode-keystone { width: 66px; height: 66px; }
.const-board .sock.cnode-keystone.learned {
  box-shadow: 0 0 0 2px #b06aff, 0 0 0 4px rgba(176, 106, 255, 0.3), inset 0 2px 6px rgba(0,0,0,0.6), 0 0 18px rgba(176, 106, 255, 0.5);
}
.const-board .sock.cnode-major.learned {
  box-shadow: 0 0 0 2px #6a9aff, inset 0 2px 6px rgba(0,0,0,0.6), 0 0 12px rgba(106, 154, 255, 0.45);
}
.const-board.const-complete .tree-links line.on {
  stroke: var(--gold-bright);
  filter: drop-shadow(0 0 4px rgba(255, 210, 74, 0.7));
  animation: const-glow 2.2s infinite;
}
@keyframes const-glow { 50% { filter: drop-shadow(0 0 9px rgba(255, 220, 110, 0.95)); } }
.const-launch { width: 100%; margin: 6px 0; }
.const-launch.pts-avail {
  border-color: var(--gold-dark);
  box-shadow: 0 0 10px rgba(255, 210, 74, 0.25);
  animation: sock-avail 1.6s infinite;
}

.skill-detail {
  flex: 1; min-width: 230px; align-self: stretch;
  background: linear-gradient(180deg, rgba(20, 13, 28, 0.85), rgba(8, 5, 12, 0.85));
  border: 1px solid #060409; border-radius: 10px; padding: 13px 14px;
  box-shadow: 0 0 0 1px #2c2138, inset 0 1px 0 rgba(255,255,255,0.04);
}
.skill-detail .node-desc { margin-top: 9px; font-size: 12px; }
.skill-detail .node-tools { margin-top: 12px; }
.sd-req { font-size: 11px; margin-top: 8px; padding: 5px 8px; border-radius: 6px; background: rgba(0,0,0,0.3); }
.sd-req.bad { color: #ff9a8a; border: 1px solid rgba(170, 60, 50, 0.4); }
.sd-req.ok { color: #9ae8a8; border: 1px solid rgba(80, 160, 90, 0.35); }
.skill-tree {
  background: linear-gradient(180deg, rgba(34, 22, 44, 0.55), rgba(8, 5, 12, 0.55) 130px), rgba(0,0,0,0.3);
  border: 1px solid #060409; border-radius: 9px; padding: 10px;
  box-shadow: 0 0 0 1px var(--bronze-dark), inset 0 1px 0 rgba(255, 220, 150, 0.06);
}
.tree-head {
  margin: -10px -10px 8px; padding: 10px 12px 8px;
  background: linear-gradient(180deg, rgba(90, 60, 24, 0.35), transparent);
  border-bottom: 1px solid rgba(200, 164, 74, 0.25);
  border-radius: 9px 9px 0 0;
}
.tree-title {
  font-weight: 800; font-size: 14px; color: var(--gold-bright);
  text-shadow: 0 0 10px rgba(255, 190, 70, 0.3), 0 1px 2px #000;
}
.tree-pts { float: right; font-size: 12px; color: #9ae8a8; }
.tree-theme { font-size: 11px; margin-top: 2px; }
.tier-divider {
  display: flex; align-items: center; gap: 8px;
  text-align: center; font-size: 10px; color: #6a5a7a;
  margin: 10px 0 7px;
}
.tier-divider::before, .tier-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(160, 130, 80, 0.4));
}
.tier-divider::after { background: linear-gradient(90deg, rgba(160, 130, 80, 0.4), transparent); }
.tier-divider.open { color: #9ae8a8; }
.skill-node {
  background: linear-gradient(180deg, rgba(20, 13, 28, 0.85), rgba(8, 5, 12, 0.85));
  border: 1px solid #060409;
  box-shadow: 0 0 0 1px #2c2138, inset 0 1px 0 rgba(255,255,255,0.04);
  border-radius: 8px; padding: 8px 9px; margin-bottom: 7px;
  transition: box-shadow 0.12s;
}
.skill-node.learned {
  box-shadow: 0 0 0 1px var(--gold-dark), inset 0 1px 0 rgba(255, 220, 150, 0.08), 0 0 9px rgba(200, 164, 74, 0.18);
}
.skill-node.locked { opacity: 0.45; filter: grayscale(0.6); }
.node-row { display: flex; gap: 9px; align-items: center; }
.node-ico {
  font-size: 18px; width: 36px; height: 36px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 32%, #2a1d36, #100a18 78%);
  border: 1px solid #050308; border-radius: 50%;
  box-shadow: 0 0 0 1px var(--bronze-dark), inset 0 2px 5px rgba(0,0,0,0.65);
}
.skill-node.learned .node-ico {
  box-shadow: 0 0 0 1px var(--gold-dark), inset 0 2px 5px rgba(0,0,0,0.6), 0 0 8px rgba(255, 200, 80, 0.3);
}
.node-info { flex: 1; }
.node-name { font-size: 13px; font-weight: 700; }
.node-kind {
  font-size: 9px; color: #ffb86a; border: 1px solid #8a6a3a;
  border-radius: 4px; padding: 0 4px; margin-left: 3px; vertical-align: 1px;
}
.node-kind.passive { color: #8ab8ff; border-color: #3a5a8a; }
.node-pips { display: flex; gap: 3px; margin-top: 3px; }
.node-pips i {
  width: 13px; height: 5px; border-radius: 2px;
  background: #2a2034; border: 1px solid #443454;
}
.node-pips i.on { background: var(--gold-bright); border-color: var(--gold); }
.node-desc { font-size: 11px; margin-top: 5px; line-height: 1.45; }
.node-meta { font-size: 10px; margin-top: 3px; }
.node-tools { display: flex; gap: 5px; margin-top: 7px; align-items: center; flex-wrap: wrap; }
.slot-assign { display: inline-flex; gap: 3px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.slot-assign-label { font-size: 11px; margin-right: 3px; }
.slot-btn { padding: 3px 7px; font-size: 11px; min-width: 24px; }
.slot-btn.current { background: var(--gold); color: #1a1020; font-weight: 800; border-color: var(--gold-bright); }
.skill-slot.skill-empty { opacity: 0.55; border-style: dashed; }
.char-skills { margin-bottom: 12px; }
.skill-row { display: flex; gap: 9px; padding: 6px 0; font-size: 12px; align-items: flex-start; }
.skill-ico { font-size: 20px; }
.char-record { font-size: 12px; }
.record-row { color: var(--dim); padding: 2px 0; }

/* ── 대장간 ── */
.forge-layout { display: grid; grid-template-columns: 250px 1fr; gap: 14px; }
.forge-items { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.forge-item-row {
  display: flex; gap: 7px; align-items: center;
  padding: 7px 9px; border-radius: 7px; cursor: pointer;
  border: 1px solid transparent; font-size: 12px;
}
.forge-item-row:hover { background: rgba(255,255,255,0.05); }
.forge-item-row.selected { border-color: var(--gold); background: rgba(200, 164, 74, 0.1); }
.fi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-eq { font-size: 9px; color: var(--gold); border: 1px solid var(--gold); border-radius: 4px; padding: 1px 4px; }
.forge-target-tt { background: rgba(0,0,0,0.35); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 12px; }
.enh-rates { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.rate-row { display: grid; grid-template-columns: 88px 1fr 52px; gap: 8px; align-items: center; font-size: 12px; }
.rate-bar { height: 9px; background: rgba(0,0,0,0.5); border-radius: 5px; overflow: hidden; }
.rate-bar i { display: block; height: 100%; }
.rate-row.ok i { background: #3adc6a; } .rate-row.ok b { color: #3adc6a; }
.rate-row.keep i { background: #8a96b8; } .rate-row.keep b { color: #8a96b8; }
.rate-row.down i { background: #ff9a3a; } .rate-row.down b { color: #ff9a3a; }
.rate-row.destroy i { background: #ff3a3a; } .rate-row.destroy b { color: #ff3a3a; }
.forge-cost { font-size: 13px; margin-bottom: 10px; }
.forge-cost b { color: var(--gold-bright); }
.protect-row { display: flex; gap: 7px; align-items: center; font-size: 12px; margin-bottom: 12px; cursor: pointer; }
.enh-result { margin-top: 12px; font-size: 15px; font-weight: 800; text-align: center; min-height: 24px; }
.enh-result.success { color: #3adc6a; animation: pop 0.4s; }
.enh-result.keep { color: #8a96b8; }
.enh-result.down { color: #ff9a3a; animation: shake 0.4s; }
.enh-result.destroy { color: #ff3a3a; animation: shake 0.5s; }
.forge-max { text-align: center; color: var(--gold-bright); font-size: 15px; padding: 20px; }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.socket-box { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.socket-row {
  display: flex; gap: 9px; align-items: center; flex-wrap: wrap;
  background: rgba(0,0,0,0.32); padding: 8px 11px; border-radius: 8px; font-size: 12px;
}
.sock-gem { font-weight: 700; }
.sock-empty { color: #8a96b8; }
.gem-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.punch-box { background: rgba(0,0,0,0.3); padding: 12px; border-radius: 9px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.gem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 9px; }
.gem-card {
  background: rgba(0,0,0,0.32); border: 1px solid var(--panel-border);
  border-radius: 10px; padding: 10px; text-align: center;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.gem-ico { font-size: 26px; }
.gem-name { font-weight: 700; font-size: 12px; }
.gem-count { color: var(--gold-bright); font-size: 12px; }
.gem-effs { font-size: 10px; line-height: 1.5; }

/* ── 상점 ── */
.shop-wallet { margin-bottom: 12px; font-size: 13px; }
.shop-wallet b { color: var(--gold-bright); }
.shop-body { display: flex; flex-direction: column; gap: 8px; }
.shop-row {
  display: flex; gap: 11px; align-items: center;
  background: rgba(0,0,0,0.3); padding: 9px 13px; border-radius: 9px;
}
.shop-ico { font-size: 22px; }
.shop-info { flex: 1; display: flex; flex-direction: column; font-size: 13px; }
.gamble-desc { font-size: 13px; margin-bottom: 12px; line-height: 1.6; }
.gamble-result { margin-top: 14px; }
.gamble-reveal { font-size: 16px; font-weight: 800; margin-bottom: 8px; animation: pop 0.5s; }

/* ── 지옥 균열 카운트다운 ── */
#rift-timer {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  font-family: GameUI, sans-serif; font-size: 32px; font-weight: 800;
  color: var(--gold-bright);
  text-shadow: 0 2px 6px #000, 0 0 20px rgba(255, 120, 40, 0.5);
  z-index: 60; pointer-events: none;
}
#rift-timer.hidden { display: none; }
#rift-timer.urgent { color: #ff5a3a; animation: rift-pulse 1s infinite; }
@keyframes rift-pulse {
  50% { transform: translateX(-50%) scale(1.14); opacity: 0.8; }
}

/* ── 지역 ── */
.act-header {
  display: flex; gap: 10px; align-items: baseline;
  margin: 18px 2px 9px; padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 200, 120, 0.18);
  font-size: 14px;
}
.act-header b { color: var(--gold-bright); letter-spacing: 0.5px; }
.act-header .dim { font-size: 11px; flex: 1; }
.act-progress { font-size: 11px; color: var(--dim); white-space: nowrap; }
/* 거점 마을 카드 — 사냥터 목록 사이에서 안식처답게 따뜻한 톤 */
.town-card {
  display: flex; gap: 11px; align-items: center;
  background: linear-gradient(180deg, rgba(64, 46, 22, 0.32), rgba(30, 20, 12, 0.4));
  border: 1px solid rgba(200, 164, 74, 0.35); border-radius: 11px;
  padding: 9px 14px; margin-bottom: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.08);
}
.town-card.locked { opacity: 0.5; }
.town-card .town-ico { font-size: 21px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.6)); }
.town-card .town-info { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.town-card .town-info b { color: #ffe2a8; }
.town-card .town-info .dim { font-size: 11px; }
.town-card .town-go { min-width: 86px; }
.zone-card {
  background: rgba(0,0,0,0.32); border: 1px solid var(--panel-border);
  border-radius: 11px; padding: 12px 15px; margin-bottom: 10px;
}
.zone-card.locked { opacity: 0.55; }
.zone-head { display: flex; gap: 9px; align-items: baseline; font-size: 14px; }
.zone-clear { font-size: 10px; color: var(--gold-bright); }
.zone-desc { font-size: 11px; margin: 4px 0 9px; }
.zone-stages { display: flex; gap: 5px; flex-wrap: wrap; }
.stage-btn {
  min-width: 34px; height: 30px; border-radius: 7px; cursor: pointer;
  background: #1e1426; border: 1px solid #4a3a56; color: var(--text); font-size: 12px;
}
.stage-btn:hover:not(.disabled) { border-color: var(--gold); }
.stage-btn.boss { border-color: #8a3050; color: #ff8ab0; }
.stage-btn.disabled { opacity: 0.3; cursor: default; }
/* 특별상인 패널 */
.merchant-greet {
  font-size: 12px; color: #e8c89a; font-style: italic;
  padding: 9px 13px; margin-bottom: 9px;
  background: rgba(60, 42, 16, 0.3); border-left: 3px solid var(--gold); border-radius: 0 9px 9px 0;
}
.merchant-row { border: 1px solid rgba(200, 164, 74, 0.3); }
.merchant-row.sold-out { opacity: 0.4; }
.merchant-row.sold-out .shop-ico { filter: grayscale(1); }
/* 참(부적) 툴팁 소지 효과 안내 */
.tt-charm-note {
  font-size: 11px; color: #8ad8e8;
  padding: 5px 0; border-top: 1px dashed rgba(138, 216, 232, 0.3);
}

/* 지옥 균열 카드 */
.zone-card.rift-card {
  border-color: #7a2414;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 60, 20, 0.13), transparent 55%),
    rgba(20, 4, 2, 0.55);
  box-shadow: inset 0 0 24px rgba(180, 30, 10, 0.12);
}
.rift-key-word { color: #ff6a4a; font-weight: 700; }

/* 결전의 성소 카드 — 황금톤 (균열의 붉은톤과 구분) */
.zone-card.sanctum-card {
  border-color: #7a5a14;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(255, 200, 60, 0.13), transparent 55%),
    rgba(20, 14, 2, 0.55);
  box-shadow: inset 0 0 24px rgba(180, 130, 10, 0.12);
}
.sanctum-card .rift-keys b { color: #ffd24a; }
.sanctum-card .stage-btn.rift-enter { border-color: #8a6a18; color: #ffe9b0; }
.sanctum-card .stage-btn.rift-enter:hover:not(.disabled) { border-color: #ffd24a; box-shadow: 0 0 10px rgba(255, 200, 60, 0.35); }

/* ══════════ 보물상자 개봉 연출 (뱀서식) ══════════ */
#chest-overlay {
  position: fixed; inset: 0; z-index: 12000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 3, 12, 0);
  opacity: 0; transition: opacity 0.35s ease, background 0.35s ease;
}
#chest-overlay.visible { opacity: 1; background: rgba(6, 3, 12, 0.78); backdrop-filter: blur(3px); }
#chest-overlay.jackpot.opened { background: rgba(20, 6, 8, 0.84); }
#chest-fx { position: absolute; inset: 0; pointer-events: none; }

/* 회전 광선 — 상자 뒤 원형 그라디언트 부챗살 */
.chest-beams {
  position: absolute; left: 50%; top: 50%; width: 660px; height: 660px;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    rgba(255, 210, 74, 0.22) 0deg, transparent 24deg, rgba(255, 210, 74, 0.14) 48deg, transparent 72deg,
    rgba(255, 210, 74, 0.22) 96deg, transparent 120deg, rgba(255, 210, 74, 0.14) 144deg, transparent 168deg,
    rgba(255, 210, 74, 0.22) 192deg, transparent 216deg, rgba(255, 210, 74, 0.14) 240deg, transparent 264deg,
    rgba(255, 210, 74, 0.22) 288deg, transparent 312deg, rgba(255, 210, 74, 0.14) 336deg, transparent 360deg);
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 68%);
  mask-image: radial-gradient(circle, #000 0%, transparent 68%);
  animation: chest-beams-spin 14s linear infinite;
  pointer-events: none;
}
#chest-overlay.jackpot .chest-beams {
  background: conic-gradient(
    rgba(255, 59, 59, 0.26) 0deg, transparent 24deg, rgba(255, 210, 74, 0.2) 48deg, transparent 72deg,
    rgba(179, 74, 255, 0.22) 96deg, transparent 120deg, rgba(255, 210, 74, 0.2) 144deg, transparent 168deg,
    rgba(255, 59, 59, 0.26) 192deg, transparent 216deg, rgba(255, 210, 74, 0.2) 240deg, transparent 264deg,
    rgba(179, 74, 255, 0.22) 288deg, transparent 312deg, rgba(255, 210, 74, 0.2) 336deg, transparent 360deg);
}
@keyframes chest-beams-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* 버스트 순간 화이트 플래시 */
.chest-flash {
  position: absolute; inset: 0; background: #fff8e0; opacity: 0; pointer-events: none;
  transition: opacity 0.12s ease;
}
.chest-flash.show { opacity: 0.82; transition: opacity 0.05s ease; }

.chest-stage {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: min(92vw, 760px);
}
.chest-title {
  font-size: 26px; font-weight: 800; letter-spacing: 6px; color: var(--gold-bright, #ffd24a);
  text-shadow: 0 0 18px rgba(255, 210, 74, 0.55), 0 2px 0 #000;
  animation: pop 0.4s ease;
}
#chest-overlay.jackpot .chest-title { color: #ff5a5a; text-shadow: 0 0 22px rgba(255, 59, 59, 0.7), 0 2px 0 #000; }

.chest-box {
  position: relative; z-index: 2;
  filter: drop-shadow(0 0 18px rgba(255, 210, 74, 0.45));
  animation: chest-drop 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
.chest-box .chest-emoji { font-size: 96px; line-height: 1; }
#chest-overlay.charging .chest-box { animation: chest-shake 0.36s linear infinite; }
#chest-overlay.opened .chest-box {
  animation: pop 0.45s ease;
  filter: drop-shadow(0 0 30px rgba(255, 210, 74, 0.85)) brightness(1.25);
}
@keyframes chest-drop { 0% { transform: translateY(-140px) scale(0.6); opacity: 0; } 70% { transform: translateY(8px) scale(1.05); opacity: 1; } 100% { transform: translateY(0) scale(1); } }
@keyframes chest-shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-4px, 1px) rotate(-3deg); }
  40% { transform: translate(4px, -1px) rotate(3deg); }
  60% { transform: translate(-3px, -1px) rotate(-2.4deg); }
  80% { transform: translate(3px, 1px) rotate(2.4deg); }
}

/* 보상 카드 — 릴 순환(?) → 등급색 확정 */
.chest-cards { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; z-index: 2; min-height: 10px; }
.chest-card {
  width: 118px; min-height: 128px; border-radius: 12px; padding: 12px 8px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  background: rgba(10, 6, 18, 0.88); border: 2px solid #3a2c46; text-align: center;
}
.chest-card.cycling .chest-card-q {
  font-size: 40px; font-weight: 800; color: #8a7aa0;
  animation: chest-cycle 0.34s linear infinite;
}
@keyframes chest-cycle {
  0% { color: #c8c8c8; transform: translateY(-3px); }
  25% { color: #5e8bff; }
  50% { color: #b34aff; transform: translateY(3px); }
  75% { color: #ff8a2a; }
  100% { color: #c8c8c8; transform: translateY(-3px); }
}
.chest-card.revealed {
  border-color: var(--rarity, #ffd24a);
  box-shadow: 0 0 14px color-mix(in srgb, var(--rarity, #ffd24a) 55%, transparent), inset 0 0 12px rgba(0, 0, 0, 0.5);
  animation: pop 0.32s ease;
}
.chest-card.chest-rarity-mythic { animation: pop 0.32s ease, mythic-glow 1.8s infinite; }
.chest-card-icon { font-size: 30px; line-height: 1; }
.chest-card-icon img { width: 44px; height: 44px; image-rendering: pixelated; }
.chest-card-name { font-size: 11px; line-height: 1.35; word-break: keep-all; }
.chest-card-grade { font-size: 10px; font-weight: 800; letter-spacing: 2px; opacity: 0.9; }

.chest-gold {
  z-index: 2; font-size: 22px; color: var(--gold-bright, #ffd24a); font-weight: 800;
  text-shadow: 0 0 12px rgba(255, 210, 74, 0.5), 0 2px 0 #000;
  animation: pop 0.3s ease;
}
.chest-extra { z-index: 2; font-size: 13px; color: #b8a8d0; animation: pop 0.3s ease; }

.chest-done {
  z-index: 2; margin-top: 6px; min-width: 180px; padding: 11px 26px;
  font-family: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
  color: #1a0e02; background: linear-gradient(180deg, #ffe08a, #d8a83a);
  border: 1px solid #ffe9b0; border-radius: 10px;
  box-shadow: 0 0 16px rgba(255, 210, 74, 0.45);
  animation: pop 0.35s ease;
}
.chest-done:hover { filter: brightness(1.1); }
.chest-skip {
  position: absolute; top: 18px; right: 22px; z-index: 3;
  font-family: inherit; font-size: 12px; color: #b8a8d0; cursor: pointer;
  background: rgba(10, 6, 18, 0.7); border: 1px solid #3a2c46; border-radius: 8px; padding: 7px 12px;
}
.chest-skip:hover { color: #fff; border-color: #6a5a80; }

/* 사냥터 탭 — 특수 던전 입장 가능 신호 점 배지 */
.zones-tabs { position: sticky; top: 0; z-index: 3; background: rgba(14, 8, 20, 0.92); padding: 6px 0; margin-top: -4px; }
.tab-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #ffd24a; margin-left: 6px; vertical-align: 2px;
  box-shadow: 0 0 6px rgba(255, 210, 74, 0.8);
}
.rift-row { align-items: center; }
.rift-keys { font-size: 12px; color: var(--dim); margin-right: 6px; }
.rift-keys b { color: #ff6a4a; font-size: 14px; }

/* ── 심연 타락도 다이얼 ── */
.abyss-corr-dial { margin: 8px 0 2px; }
.abyss-corr-stepper { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.abyss-corr-val { min-width: 88px; text-align: center; color: var(--dim); }
.abyss-corr-val.hot { color: #ff5a6a; text-shadow: 0 0 8px rgba(255, 60, 90, 0.5); }
.abyss-corr-preview { color: #ff9a8a; }

.stage-btn.rift-enter {
  min-width: 0; padding: 0 14px;
  border-color: #8a3018; color: #ffb09a; font-weight: 700;
}
.stage-btn.rift-enter:hover:not(.disabled) { border-color: #ff5a2a; box-shadow: 0 0 10px rgba(255, 80, 30, 0.35); }

/* ── 설정 ── */
.set-row {
  display: flex; gap: 13px; align-items: center; justify-content: space-between;
  background: rgba(0,0,0,0.3); padding: 10px 14px; border-radius: 9px; margin-bottom: 8px;
  font-size: 13px;
}
.set-row input[type=range] { width: 180px; accent-color: var(--gold); }
.set-row input.set-text {
  width: 180px; background: #1e1426; border: 1px solid #4a3a56; color: var(--text);
  border-radius: 7px; padding: 6px 9px; font-size: 13px; font-family: inherit;
}
.set-row input.set-text:focus { border-color: var(--gold); outline: none; }
.help-box { background: rgba(0,0,0,0.3); padding: 12px 14px; border-radius: 9px; margin: 12px 0; font-size: 12px; line-height: 1.7; }
#panel-content .btn { margin-right: 8px; margin-top: 4px; }

/* ══════════ 랭킹(전투력) ══════════ */
.lb-mycard {
  background: radial-gradient(ellipse at 50% 0%, rgba(200,164,74,0.12), transparent 60%), rgba(0,0,0,0.34);
  border: 1px solid #3a2c46; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255,220,150,0.06);
}
.lb-mytitle { font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lb-mytitle .dim { font-size: 11px; }
.lb-power { font-size: 18px; color: var(--gold-bright); margin-top: 6px; }
.lb-power b { font-size: 22px; }
.lb-break { font-size: 11px; margin-top: 3px; }
.lb-joinbox, .lb-list { background: rgba(0,0,0,0.28); border: 1px solid #3a2c46; border-radius: 12px; padding: 12px; }
.lb-tabs { display: flex; gap: 8px; margin: 2px 0 10px; }

/* ── 업적 · 도감 ── */
.menu-btn { position: relative; }
.menu-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  background: #d43a2a; color: #fff; border-radius: 8px; font-size: 10px; font-style: normal;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 1px solid #0a0710; pointer-events: none;
}
/* 방금 해금된 메뉴의 NEW 표시 — 기존 카운트 배지(우상단)와 겹치지 않게 좌하단 금색 */
.menu-badge.unlock-badge {
  top: auto; right: auto; bottom: -4px; left: -4px;
  background: linear-gradient(180deg, #ffd76a, #b8862a); color: #1a1206; font-weight: 700;
}
.ach-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 8px;
  background: rgba(0,0,0,0.28); border: 1px solid #3a2c46; border-radius: 10px;
}
.ach-row.ach-ready { border-color: var(--gold, #c8a44a); box-shadow: 0 0 8px rgba(200, 164, 74, 0.25); }
.ach-row.ach-done { opacity: 0.55; }
.ach-ico { font-size: 22px; }
.ach-info { flex: 1; min-width: 0; }
.ach-info .dim { font-size: 12px; }
.ach-num { font-size: 11px; }
.ach-bar { height: 6px; background: rgba(0,0,0,0.6); border-radius: 3px; overflow: hidden; margin: 4px 0 2px; }
.ach-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7a52f0, #b88aff); }
.ach-check { color: #6fdc6f; font-size: 18px; }
.codex-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin-top: 10px;
}
.codex-cell {
  background: rgba(0,0,0,0.28); border: 1px solid #3a2c46; border-radius: 8px;
  padding: 7px 9px; display: flex; flex-direction: column; gap: 2px; font-size: 12px;
}
.codex-cell .dim { font-size: 11px; }
.codex-cell.codex-unknown { opacity: 0.45; }
.codex-cell.codex-master { border-color: var(--gold, #c8a44a); }
.lb-joinbox .dim { font-size: 12px; margin: 4px 0 10px; }
.lb-joinrow { display: flex; gap: 8px; align-items: center; }
.lb-joinrow input.set-text {
  flex: 1; background: #1e1426; border: 1px solid #4a3a56; color: var(--text);
  border-radius: 7px; padding: 7px 10px; font-size: 13px; font-family: inherit;
}
.lb-joinrow input.set-text:focus { border-color: var(--gold); outline: none; }
.lb-loading { padding: 18px 0; text-align: center; }
.lb-row {
  display: grid; grid-template-columns: 36px 28px 1fr auto auto; gap: 8px; align-items: center;
  padding: 8px 6px; border-bottom: 1px solid rgba(120,90,140,0.14); font-size: 13px;
}
.lb-row:last-child { border-bottom: none; }
.lb-rank { text-align: center; font-weight: 800; color: var(--gold-bright); }
.lb-cls { text-align: center; }
.lb-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-meta { font-size: 11px; }
.lb-score { font-weight: 800; color: var(--gold-bright); }
.lb-me {
  background: radial-gradient(ellipse at 50% 50%, rgba(200,164,74,0.16), transparent 75%);
  border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(200,164,74,0.4);
}
/* 순위표 행 탭 → 캐릭터 열람 모달 */
.lb-row.lb-click { cursor: pointer; transition: background 0.1s; }
.lb-row.lb-click:hover { background: rgba(200, 164, 74, 0.08); border-radius: 8px; }
.lb-gap { text-align: center; padding: 4px 0; letter-spacing: 4px; }

/* 구글 로그인 버튼 — 브랜드 톤(흰 배경) */
.lb-google-btn {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 10px;
  background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 700;
}
.lb-google-btn:hover { background: #f4f4f4; }
.lb-google-btn:disabled { opacity: 0.6; }
.lb-google-btn .g-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; font-weight: 800; font-size: 12px;
  background: conic-gradient(from -45deg, #ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0);
  color: #fff; text-shadow: 0 0 2px rgba(0,0,0,0.4);
}
/* 닉네임 중복확인 결과 */
.lb-nick-check { font-size: 12px; margin-top: 6px; min-height: 16px; }
.lb-nick-check.good { color: #5aff7a; }
.lb-nick-check.bad { color: #ff6a6a; }
/* 로그인 계정 정보/로그아웃 */
.lb-account {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px; font-size: 12px;
}

/* ══════════ 사망/모달 ══════════ */
#death-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: radial-gradient(ellipse, rgba(60, 0, 0, 0.55), rgba(10, 0, 0, 0.85));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
}
.death-title { font-size: 34px; font-weight: 900; color: #ff4a3a; text-shadow: 0 4px 18px #000; animation: pop 0.6s; }
.death-sub { font-size: 14px; color: #ffb0a0; }

#modal-backdrop {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(4, 2, 8, 0.75); display: flex; align-items: center; justify-content: center;
}
#modal-box {
  width: min(420px, 92vw); max-height: 80vh; overflow-y: auto;
  background: var(--panel-bg); border: 2px solid var(--gold);
  border-radius: 14px; padding: 22px;
  box-shadow: 0 0 50px rgba(200, 164, 74, 0.25);
  text-align: center;
}
.modal-title { font-size: 19px; font-weight: 800; color: var(--gold-bright); margin-bottom: 11px; }

/* ── 랭킹 캐릭터 열람 모달 ── */
.inspect-sub { font-size: 12px; margin: -7px 0 8px; }
.inspect-badges {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  font-size: 13px; margin-bottom: 12px;
}
.inspect-badges b, .inspect-stats b { color: var(--gold-bright); }
.inspect-body { margin-bottom: 12px; }
.inspect-pd { margin-bottom: 10px; }
.inspect-empty { padding: 22px 0; font-size: 13px; line-height: 1.6; }
.inspect-stats { font-size: 11px; margin-bottom: 5px; }
.inspect-detail { margin-top: 10px; text-align: left; }
.inspect-detail .detail-tt { font-size: 12px; }
.off-desc { font-size: 13px; margin-bottom: 13px; }
.off-grid {
  display: grid; grid-template-columns: auto auto; gap: 6px 16px;
  justify-content: center; font-size: 14px; margin-bottom: 13px;
}
.off-grid b { color: var(--gold-bright); text-align: left; }
.off-grid div { text-align: right; color: var(--dim); }
.off-items { max-height: 130px; overflow-y: auto; margin-bottom: 14px; font-size: 12px; }
.off-item { padding: 2px 0; }

/* ══════════ 직업 선택 ══════════
   배너형 세로 리스트 — 카드는 직업명 + 한 줄 특징만, 선택 시 플레이버 확장.
   직업 고유색은 인라인 CSS 변수(--accent 계열, main.js)로 주입된다. */
#class-select {
  position: fixed; inset: 0; z-index: 400;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(120, 40, 20, 0.25), transparent 55%),
    radial-gradient(ellipse at 50% 110%, rgba(60, 20, 90, 0.3), transparent 55%),
    #0a0710;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 13px; padding: 18px; overflow-y: auto;
}
.cs-title {
  font-size: clamp(34px, 7vw, 58px); font-weight: 900; letter-spacing: 8px;
  color: var(--gold-bright);
  text-shadow: 0 0 30px rgba(255, 180, 60, 0.45), 0 4px 12px #000;
}
.cs-sub { color: var(--dim); font-size: 13px; margin-top: -8px; }
.cs-rule {
  display: flex; align-items: center; gap: 10px;
  width: min(460px, 94vw); color: var(--gold); font-size: 12px; opacity: 0.85;
}
.cs-rule::before, .cs-rule::after { content: ''; flex: 1; height: 1px; }
.cs-rule::before { background: linear-gradient(90deg, transparent, var(--bronze)); }
.cs-rule::after { background: linear-gradient(90deg, var(--bronze), transparent); }
.cs-cards { display: flex; flex-direction: column; gap: 9px; width: min(460px, 94vw); }
.cs-card {
  --accent: var(--gold);
  --accent-bright: var(--gold-bright);
  --accent-dim: rgba(200, 164, 74, 0.16);
  --accent-glow: rgba(200, 164, 74, 0.4);
  position: relative; display: flex; align-items: center; gap: 13px;
  padding: 11px 15px 11px 13px;
  background:
    linear-gradient(105deg, var(--accent-dim), transparent 45%),
    linear-gradient(180deg, rgba(33, 22, 45, 0.92), rgba(13, 8, 19, 0.94));
  border: 1px solid #060409; border-radius: 11px;
  box-shadow: 0 0 0 1px var(--bronze-dark), inset 0 1px 0 rgba(255, 220, 150, 0.06), 0 4px 12px rgba(0, 0, 0, 0.45);
  cursor: pointer; overflow: hidden;
  transition: transform 0.16s, box-shadow 0.16s, opacity 0.2s, filter 0.2s;
  animation: cs-in 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
}
.cs-card:nth-child(1) { animation-delay: 0.04s; }
.cs-card:nth-child(2) { animation-delay: 0.09s; }
.cs-card:nth-child(3) { animation-delay: 0.14s; }
.cs-card:nth-child(4) { animation-delay: 0.19s; }
.cs-card:nth-child(5) { animation-delay: 0.24s; }
.cs-card:nth-child(6) { animation-delay: 0.29s; }
@keyframes cs-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .cs-card { animation: none; } }
/* 왼쪽 직업색 세로 스트립 */
.cs-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent 90%); opacity: 0.85;
}
.cs-card:hover {
  transform: translateX(3px);
  box-shadow: 0 0 0 1px var(--gold), inset 0 1px 0 rgba(255, 220, 150, 0.1), 0 0 14px var(--accent-glow);
}
.cs-card.selected {
  box-shadow: 0 0 0 1px var(--gold-bright), inset 0 1px 0 rgba(255, 220, 150, 0.12), 0 0 20px var(--accent-glow);
}
/* 하나를 고르면 나머지는 어둠 속으로 */
.cs-cards.has-pick .cs-card:not(.selected) { opacity: 0.5; filter: saturate(0.5); }
/* 다이아 룬 엠블럼 */
.cs-emblem {
  flex: 0 0 auto; width: 44px; height: 44px; margin: 3px 5px;
  transform: rotate(45deg); border-radius: 9px;
  background: radial-gradient(circle at 35% 30%, var(--accent-dim), rgba(0, 0, 0, 0.55)), #140b1e;
  border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6), 0 0 10px var(--accent-dim);
  transition: box-shadow 0.18s, border-color 0.18s;
}
.cs-emblem .cs-icon {
  transform: rotate(-45deg); font-size: 23px;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.cs-card.selected .cs-emblem {
  border-color: var(--gold-bright);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6), 0 0 16px var(--accent-glow);
}
.cs-body { flex: 1; min-width: 0; text-align: left; }
.cs-name { font-size: 17px; font-weight: 700; color: var(--gold-bright); letter-spacing: 1px; }
.cs-tag { font-size: 12px; color: var(--accent-bright); margin-top: 3px; }
/* 플레이버 — 선택된 카드에서만 펼쳐진다 */
.cs-flavor {
  max-height: 0; opacity: 0; overflow: hidden; margin-top: 0;
  font-size: 11px; color: var(--text); line-height: 1.5;
  transition: max-height 0.25s ease, opacity 0.25s ease, margin-top 0.25s ease;
}
.cs-card.selected .cs-flavor { max-height: 52px; opacity: 1; margin-top: 5px; }
/* 선택 표식 — 빈 룬 슬롯이 직업색으로 점등 */
.cs-pick {
  flex: 0 0 auto; width: 13px; height: 13px; margin-right: 3px;
  transform: rotate(45deg); border-radius: 3px;
  border: 1px solid var(--bronze); transition: all 0.18s;
}
.cs-card.selected .cs-pick {
  background: var(--accent); border-color: var(--gold-bright);
  box-shadow: 0 0 10px var(--accent-glow);
}
.cs-name-row { display: flex; gap: 9px; width: min(460px, 94vw); }
#cs-name {
  flex: 1; min-width: 0; padding: 11px 14px; font-size: 14px; font-family: inherit;
  background: rgba(0,0,0,0.5); border: 1px solid var(--panel-border);
  border-radius: 9px; color: #fff; outline: none;
}
#cs-name:focus { border-color: var(--gold); }
#cs-start { flex: 0 0 auto; }

/* ── 캐릭터 선택 (로스터) ── */
.cs-roster {
  display: flex; flex-direction: column; gap: 10px;
  width: min(440px, 92vw); margin-bottom: 18px;
}
.cr-card {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; cursor: pointer;
  background: linear-gradient(180deg, rgba(34, 23, 44, 0.85), rgba(14, 9, 20, 0.85));
  border: 1px solid #060409; border-radius: 10px;
  box-shadow: 0 0 0 1px var(--bronze-dark), inset 0 1px 0 rgba(255, 220, 150, 0.07), 0 4px 12px rgba(0,0,0,0.45);
  transition: all 0.12s;
}
.cr-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--gold), inset 0 1px 0 rgba(255, 220, 150, 0.1), 0 0 16px rgba(200, 164, 74, 0.3);
}
.cr-icon { font-size: 30px; }
.cr-info { flex: 1; text-align: left; }
.cr-name { font-size: 15px; font-weight: 700; color: var(--gold-bright); }
.cr-sub { font-size: 11px; margin-top: 2px; }
.cr-del {
  width: 34px; height: 34px; font-size: 14px; cursor: pointer;
  background: transparent; border: 1px solid #3a2026; border-radius: 8px;
  opacity: 0.6; transition: all 0.12s;
}
.cr-del:hover { opacity: 1; border-color: #8a2a2a; background: rgba(110, 25, 25, 0.3); }

/* ══════════ 터치 컨트롤 ══════════ */
#joystick { display: none; }
#touch-skills { display: none; }
body.touch #joystick {
  display: block; position: fixed; left: 0; bottom: 0;
  width: 45vw; height: 46vh; z-index: 60;
}
#joy-base {
  position: absolute; left: 30px; bottom: 110px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 2px solid rgba(255,255,255,0.14);
  opacity: 0.55; transition: opacity 0.2s;
}
#joy-base.active { opacity: 0.95; }
#joy-stick {
  position: absolute; left: 50%; top: 50%; margin: -26px 0 0 -26px;
  width: 52px; height: 52px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5a4a6a, #241a30);
  border: 2px solid rgba(255, 220, 150, 0.35);
}
body.touch #touch-skills {
  display: grid; position: fixed; right: 18px; bottom: 130px; z-index: 60;
  grid-template-columns: repeat(3, 52px); gap: 8px; /* 12슬롯 — 3열 4행 */
}
.touch-skill {
  position: relative; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(20, 14, 30, 0.8); border: 2px solid #4a3a26;
  font-size: 21px; overflow: hidden;
}
.touch-skill .skill-cd { border-radius: 0; }

/* ══════════ 모바일 레이아웃 ══════════ */
@media (max-width: 760px) {
  .inv-layout, .forge-layout { grid-template-columns: 1fr; gap: 14px; }
  #panel-box { max-height: 92vh; width: 96vw; }
  /* 모바일 인벤토리: 단일 컬럼이라 고정 높이 대신 패널 스크롤 사용 */
  #panel-box[data-panel="inventory"] { height: 92vh; }
  #panel-box[data-panel="inventory"] #panel-content { display: block; }
  #panel-box[data-panel="inventory"] .inv-equip { overflow: visible; max-height: none; }

  /* ── 모바일 인벤토리 압축 ── 좁은 화면에 맞춰 장착/도구/가방 재배치 */
  /* 장착 패널: 페이퍼돌 슬롯을 작게(48px), 프리뷰도 축소해 세로 높이 절감 */
  .inv-equip .pd-layout { grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 5px; }
  .inv-equip .pd-layout .item-cell { width: 46px; height: 46px; min-height: 46px; }
  .inv-equip .pd-stage { min-height: 78px; }
  .inv-equip .pd-snap { width: 96px; height: 96px; }
  .inv-equip .pd-fallback { font-size: 40px; }
  .inv-equip .pd-preview { padding: 6px 2px; }
  /* 상세 영역: 빈 "아이템을 선택하세요" 공백을 최소화 (선택 시 내용만큼 늘어남) */
  .inv-detail { margin-top: 8px; min-height: 0; }
  .detail-empty { padding: 10px 0; font-size: 12px; }

  /* 도구줄: 제목과 분리해 아래 줄로 내리고, 버튼/셀렉트가 두 줄로 자연스럽게 감싸지게 */
  #panel-box[data-panel="inventory"] .box-title-row { flex-wrap: wrap; gap: 7px; }
  #panel-box[data-panel="inventory"] .box-title-row .box-title { flex: 1 0 100%; }
  .inv-tools { flex-wrap: wrap; gap: 6px 8px; width: 100%; }
  .inv-tools .sell-threshold { flex: 1 1 auto; min-width: 96px; }
  .inv-tools .btn-sm { flex: 0 0 auto; }
  .sell-charm-toggle { flex: 1 1 auto; }

  /* 가방 그리드: 셀을 키우고(56px) 손가락 터치 면적 확보, 높이는 화면의 절반 */
  .inv-grid {
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 7px; max-height: 42vh;
  }
  #panel-box[data-panel="inventory"] .inv-grid { max-height: 42vh; }

  .trash-zone .dim { display: none; }
  .cs-card { padding: 9px 12px 9px 11px; }
  .cs-emblem { width: 40px; height: 40px; }
  .cs-emblem .cs-icon { font-size: 21px; }
  #boss-bar { width: 76vw; }
}

/* ══════════ 터치 기기 전용 HUD 재배치 ══════════
   데스크톱 HUD(중앙 거대 스킬바 플레이트)와 터치 컨트롤(조이스틱/터치스킬)이
   겹쳐 화면을 가리는 문제 해결: 모바일은 터치 컨트롤만 쓰고,
   거대 플레이트는 숨긴 뒤 HP/MP 오브·물약·AUTO만 화면 모서리에 작게 고정한다. */
body.touch #hud-center { display: none; }      /* 거대 스킬바 플레이트 숨김 */
body.touch #hud-bottom {
  position: static; transform: none; display: contents; /* 자식(오브)을 개별 고정 배치 */
}
/* HP/MP 오브 — 화면 양 하단 모서리에 고정, 항상 보이게 */
body.touch .orb {
  position: fixed; bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  width: 62px; height: 62px; z-index: 75; pointer-events: none;
}
body.touch .orb.hp { left: calc(8px + env(safe-area-inset-left, 0px)); }
body.touch .orb.mp { right: calc(8px + env(safe-area-inset-right, 0px)); }
body.touch .orb-text { font-size: 12px; }

/* 물약 + AUTO — HP 오브 위쪽에 세로로 작게 (좌하단 군집) */
body.touch #mobile-actions {
  display: flex; flex-direction: column; gap: 7px; align-items: center;
  position: fixed; left: calc(10px + env(safe-area-inset-left, 0px));
  bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 76;
}
#mobile-actions { display: none; }
#mobile-actions .potion-btn { width: 46px; height: 46px; }
#mobile-actions #m-auto-btn {
  width: 46px; height: 30px; font-size: 11px; font-weight: 800;
  color: var(--gold-bright); letter-spacing: 0.5px;
  background: radial-gradient(circle at 50% 30%, #34243f, #150d1c 80%);
  border: 1px solid #050308; border-radius: 9px;
  box-shadow: 0 0 0 2px var(--bronze-dark), inset 0 1px 0 rgba(255,220,150,0.14), 0 3px 8px rgba(0,0,0,0.5);
}
#mobile-actions #m-auto-btn.active {
  color: #fff; box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(200,164,74,0.5), inset 0 1px 0 rgba(255,220,150,0.2);
}

/* 터치 스킬 — 우하단, 오브와 안 겹치게 위로 올리고 2행 그리드 유지 */
body.touch #touch-skills {
  right: calc(8px + env(safe-area-inset-right, 0px));
  bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  grid-template-columns: repeat(3, 50px); gap: 7px;
}
.touch-skill { width: 50px; height: 50px; font-size: 20px; }

/* 조이스틱 — 좌하단, 오브/물약 위쪽 공간 확보 */
body.touch #joy-base { left: 22px; bottom: 150px; width: 112px; height: 112px; }

/* 상단 정보 — 작고 컴팩트하게 (가독성 우선) */
body.touch #hud-top-left { transform: scale(0.82); transform-origin: top left; gap: 4px; }
body.touch #minimap { width: 84px; height: 84px; }
body.touch #menu-btns { padding: 5px 4px; gap: 4px; }
body.touch .menu-btn { width: 34px; height: 34px; font-size: 15px; }

/* 매우 좁은 화면(소형 폰)에서 한 단계 더 축소 */
@media (max-width: 430px) {
  body.touch .orb { width: 54px; height: 54px; }
  body.touch #touch-skills { grid-template-columns: repeat(3, 46px); gap: 6px; }
  body.touch .touch-skill { width: 46px; height: 46px; font-size: 18px; }
  body.touch #hud-top-left { transform: scale(0.74); }
}

/* ── 클라우드 세이브 충돌 선택 모달 ── */
/* z-index 600: 동기화는 로딩 오버레이(500) 표시 중에 일어나므로 그 위에 떠야 한다 */
.cf-backdrop {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(4, 2, 8, 0.8);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.cf-box {
  width: min(460px, 94vw); max-height: 86vh; overflow-y: auto;
  background: var(--panel-bg); border: 2px solid var(--gold);
  border-radius: 14px; padding: 22px;
  box-shadow: 0 0 50px rgba(200, 164, 74, 0.28); text-align: center;
}
.cf-title { font-size: 19px; font-weight: 800; color: var(--gold-bright); margin-bottom: 11px; }
.cf-desc { font-size: 13px; line-height: 1.6; margin-bottom: 16px; color: var(--text); }
.cf-warn { color: #ff9a6a; }
.cf-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cf-side {
  background: rgba(0, 0, 0, 0.3); border: 2px solid var(--panel-border);
  border-radius: 12px; padding: 14px 10px; cursor: pointer;
  color: var(--text); transition: border-color .12s, transform .08s, background .12s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.cf-side:hover { border-color: var(--gold); background: rgba(200, 164, 74, 0.08); }
.cf-side:active { transform: scale(0.97); }
.cf-side-label { font-size: 13px; font-weight: 700; color: var(--gold-bright); }
.cf-side-icon { font-size: 38px; line-height: 1; margin: 4px 0; }
.cf-side-name { font-size: 13px; font-weight: 700; }
.cf-side-sub { font-size: 12px; color: var(--dim); }
.cf-side-time { font-size: 11px; color: var(--dim); }
.cf-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  background: var(--gold); color: #1a1206; border-radius: 6px;
  padding: 1px 6px; vertical-align: middle; margin-left: 2px;
}
.cf-hint { font-size: 11px; margin-top: 14px; }

/* ══════════ 결투장 (PvP) ══════════ */
/* 상대 목록/전적 행 — 버튼 개수가 가변이라 그리드 대신 flex */
.pvp-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 6px; border-bottom: 1px solid rgba(120, 90, 140, 0.14); font-size: 13px;
}
.pvp-row:last-child { border-bottom: none; }
.pvp-row .lb-nick { flex: 1; min-width: 72px; }
.pvp-row .btn { margin: 0; }
.pvp-dir { font-size: 11px; flex-shrink: 0; }
.pvp-outcome { font-weight: 800; flex-shrink: 0; }
.pvp-outcome.good { color: #5aff7a; }
.pvp-outcome.bad { color: #ff6a5a; }
.pvp-new {
  background: radial-gradient(ellipse at 50% 50%, rgba(212, 58, 42, 0.14), transparent 75%);
  border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(212, 58, 42, 0.35);
}

/* ── 결투장 씬 HUD — 게임 HUD 를 숨기고 전용 오버레이만 노출 ── */
body.arena-mode #hud-top-left, body.arena-mode #hud-top-right, body.arena-mode #hud-bottom,
body.arena-mode #boss-bar, body.arena-mode #rift-timer,
body.arena-mode #joystick, body.arena-mode #touch-skills, body.arena-mode #mobile-actions {
  display: none !important;
}
#arena-hud { position: fixed; inset: 0; pointer-events: none; z-index: 150; }
.arena-top {
  display: flex; align-items: flex-start; justify-content: center; gap: 14px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 0;
}
.arena-side { flex: 1; max-width: 340px; }
.arena-side.right { text-align: right; }
.arena-name { font-size: 13px; font-weight: 700; margin-bottom: 5px; text-shadow: 0 1px 2px #000; }
.arena-name.me { color: var(--gold-bright); }
.arena-vs {
  font-size: 20px; font-weight: 900; color: var(--gold-bright); letter-spacing: 1px;
  text-shadow: 0 0 12px rgba(200, 164, 74, 0.6), 0 1px 2px #000; padding-top: 12px;
}
.arena-bar {
  height: 13px; background: rgba(0, 0, 0, 0.55); border: 1px solid #3a2c46;
  border-radius: 7px; overflow: hidden;
}
.arena-bar i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(180deg, #e0523a, #8a1f14);
  transition: width 0.12s linear;
}
.arena-bar.flip i { margin-left: auto; } /* 우측 바는 오른쪽에서 줄어든다 */
.arena-controls {
  position: absolute; left: 0; right: 0;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex; justify-content: center; gap: 10px; pointer-events: auto;
}
.arena-honor { margin-top: 8px; font-size: 14px; }
.arena-honor .good { color: #5aff7a; }
.arena-honor .bad { color: #ff6a5a; }

/* ── 라이브(수동 조작) 결투 — 스킬바 ── */
.arena-bar.mana { height: 7px; margin-top: 3px; }
.arena-bar.mana i { background: linear-gradient(180deg, #4a7ae0, #1f3a8a); }
.arena-skillbar {
  position: absolute; left: 0; right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex; justify-content: center; gap: 8px; pointer-events: auto;
}
.arena-skill {
  position: relative; width: 54px; height: 54px; border-radius: 10px;
  background: rgba(12, 8, 20, 0.82); border: 1px solid #4a3a5c;
  color: var(--text); font-size: 22px; cursor: pointer; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.06s, border-color 0.12s;
}
.arena-skill:active { transform: scale(0.94); }
.arena-skill.off { opacity: 0.45; }
.arena-skill-icon { pointer-events: none; line-height: 1; }
.arena-skill-key {
  position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 800;
  color: var(--gold-bright); text-shadow: 0 1px 2px #000; pointer-events: none;
}
.arena-skill-mp {
  position: absolute; bottom: 2px; right: 4px; font-size: 10px; font-weight: 700;
  color: #7ab0ff; text-shadow: 0 1px 2px #000; pointer-events: none;
}
.arena-potion .arena-skill-mp { color: #ff9a8a; }
.arena-skill-cd {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: rgba(0, 0, 0, 0.62); pointer-events: none;
}

/* ══════════════ 경매장 ══════════════ */
#panel-box[data-panel="auction"] { height: min(86vh, 780px); }
#panel-box[data-panel="auction"] #panel-content { display: flex; flex-direction: column; min-height: 0; }
.auc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }

.auc-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auc-sort {
  background: #1e1426; border: 1px solid #4a3a56; color: var(--text);
  border-radius: 7px; padding: 5px 8px; font-size: 12px; font-family: inherit; cursor: pointer;
}
.auc-sort:hover { border-color: var(--gold); }

.auc-slot-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.auc-slot-chips::-webkit-scrollbar { display: none; }
.auc-chip {
  flex: 0 0 auto; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  background: rgba(0,0,0,0.3); border: 1px solid #3a2c46; color: var(--dim);
  font-size: 12px; font-family: inherit;
}
.auc-chip.active {
  background: linear-gradient(180deg, rgba(120, 86, 30, 0.4), rgba(60, 42, 16, 0.18));
  color: var(--gold-bright); border-color: var(--gold-dark);
}

.auc-list, .mail-list {
  flex: 1; min-height: 0; overflow-y: auto;
  background: rgba(0,0,0,0.28); border: 1px solid #3a2c46; border-radius: 12px; padding: 10px 12px;
}
.auc-empty { text-align: center; padding: 22px 0; }
.auc-count-note { font-size: 11px; margin-bottom: 6px; }

/* 그룹 (같은 이름 묶음) */
.auc-group { margin-bottom: 6px; }
.auc-group-head {
  display: flex; gap: 8px; align-items: center; cursor: pointer;
  background: rgba(0,0,0,0.3); padding: 8px 11px; border-radius: 9px;
  border: 1px solid rgba(120,90,140,0.18); font-size: 13px;
}
.auc-group-head:hover { border-color: var(--gold-dark); }
.auc-caret { color: var(--dim); font-size: 11px; transition: transform 0.15s; }
.auc-group.open .auc-caret { transform: rotate(90deg); }
.auc-group-ico { font-size: 16px; }
.auc-group-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auc-group-cnt { font-size: 11px; flex: 1; }
.auc-price { font-weight: 800; color: var(--gold-bright); white-space: nowrap; font-size: 12px; }
.auc-group-items { margin: 4px 0 4px 14px; padding-left: 10px; border-left: 1px solid #3a2c46; }

/* 매물 행 */
.auc-row {
  display: flex; gap: 10px; align-items: center;
  padding: 7px 9px; margin-bottom: 5px; border-radius: 8px;
  background: rgba(0,0,0,0.24); border: 1px solid rgba(120,90,140,0.14); font-size: 13px;
}
.auc-row.sold-out { opacity: 0.4; }
.auc-row.sold-out .shop-ico { filter: grayscale(1); }
.auc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.auc-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auc-info .dim { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auc-seller { font-size: 11px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auc-mine-mark { font-size: 11px; white-space: nowrap; }
.auc-buy { white-space: nowrap; }
.auc-remain.urgent { color: #ff5a3a; }

/* 판매 등록 */
.auc-sell-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px 1fr; gap: 18px; }
.auc-sell-bag { display: flex; flex-direction: column; min-height: 0; }
.auc-sell-bag .inv-grid { flex: 1; min-height: 0; max-height: none; }
.auc-form {
  display: flex; flex-direction: column; gap: 10px; align-self: start;
  background: rgba(0,0,0,0.28); border: 1px solid #3a2c46; border-radius: 12px; padding: 14px;
}
.auc-sel-preview { display: flex; gap: 10px; align-items: center; font-size: 13px; min-height: 44px; }
.auc-sel-preview .dim { font-size: 11px; }
.auc-price-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.auc-price-input {
  width: 130px; background: #1e1426; border: 1px solid #4a3a56; color: var(--text);
  border-radius: 7px; padding: 7px 10px; font-size: 13px; font-family: GameNum, inherit;
}
.auc-price-input:focus { border-color: var(--gold); outline: none; }
.auc-fee-preview { font-size: 12px; background: rgba(0,0,0,0.3); border-radius: 8px; padding: 8px 10px; }
.auc-fee-preview b { color: var(--gold-bright); }
.auc-hint { font-size: 11px; line-height: 1.5; }
.auc-warn { color: #ffb04a; }
.auc-reg-btn { margin-top: 2px; }
.item-cell.sel-ring { outline: 2px solid var(--gold-bright); outline-offset: -1px; }

/* 내 매물 실적 위젯 */
.auc-stats .lb-mytitle b { color: var(--gold-bright); }

/* 우편함 */
.mail-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid rgba(120,90,140,0.18);
}
.mail-row {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 9px; margin-bottom: 5px; border-radius: 8px;
  background: rgba(0,0,0,0.24); border: 1px solid rgba(120,90,140,0.14); font-size: 13px;
}
.mail-ico { font-size: 20px; }
.mail-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mail-desc { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auc-gold-amt { color: var(--gold-bright); }

/* 모바일 */
@media (max-width: 760px) {
  #panel-box[data-panel="auction"] { height: 92vh; }
  .auc-sell-layout { grid-template-columns: 1fr; }
  .auc-sell-bag .inv-grid { max-height: 34vh; }
  .auc-seller { display: none; }
  .auc-toolbar { gap: 6px; }
}

/* ── 인트로 시네마틱 오버레이 (부팅 시 1회, 탭 스킵) ── */
#intro-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: #0a0710;
  display: flex; align-items: center; justify-content: center;
  opacity: 1; transition: opacity 0.45s ease;
}
#intro-overlay.intro-out { opacity: 0; pointer-events: none; }
#intro-video { width: 100%; height: 100%; object-fit: cover; }
.intro-skip {
  position: absolute; bottom: max(22px, env(safe-area-inset-bottom, 22px)); left: 0; right: 0;
  text-align: center; font-size: 13px; letter-spacing: 0.08em;
  color: rgba(240,225,200,0.55); text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  animation: introSkipPulse 2.2s ease-in-out infinite;
}
@keyframes introSkipPulse { 0%,100% { opacity: 0.35; } 50% { opacity: 0.8; } }

/* ══════════════ 프리미엄 상자 (가챠) ══════════════ */
.pchest-card {
  border: 1px solid rgba(179, 74, 255, 0.25); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px; background: rgba(30, 18, 46, 0.55);
}
.pchest-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pchest-head b { flex: 1; }
.pchest-pity { font-size: 11px; color: #b9a6d8; margin-bottom: 6px; }
.pchest-pity .bar { display: inline-block; width: 110px; height: 6px; vertical-align: middle;
  background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; margin: 0 6px; }
.pchest-pity .bar i { display: block; height: 100%; background: linear-gradient(90deg, #b34aff, #ffd24a); }
.pchest-btns { display: flex; gap: 8px; }
.pchest-btns .btn { flex: 1; }
.pchest-badge { font-size: 10px; color: #ffd24a; margin-left: 4px; }
.pchest-odds { font-size: 11px; color: #b9a6d8; line-height: 1.7; padding: 8px 10px;
  background: rgba(0,0,0,0.25); border-radius: 8px; margin-top: 8px; }
.pchest-odds table { width: 100%; border-collapse: collapse; }
.pchest-odds td { padding: 1px 4px; }
.pchest-odds td:last-child { text-align: right; color: #e8dcc8; }

/* 3택1 선택 오버레이 */
#gacha-choice-overlay {
  position: fixed; inset: 0; z-index: 260; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 3, 12, 0.82); backdrop-filter: blur(3px);
}
.gacha-choice-box {
  max-width: 920px; width: calc(100% - 32px); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(34, 22, 52, 0.98), rgba(18, 10, 30, 0.98));
  border: 1px solid rgba(179, 74, 255, 0.4); border-radius: 14px; padding: 16px;
}
.gacha-cards { display: flex; gap: 10px; margin: 12px 0; align-items: stretch; }
.gacha-card { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 10px;
  background: rgba(0,0,0,0.25); }
.gacha-card.rarity-mythic { border-color: rgba(255, 90, 90, 0.55); }
.gacha-card.rarity-unique { border-color: rgba(255, 210, 74, 0.55); }
.gacha-card-head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.gacha-card-tip { flex: 1; font-size: 11px; overflow-y: auto; max-height: 42vh; }
.gacha-card-tip .item-tooltip { position: static; display: block; max-width: none; }
.gacha-actions { display: flex; justify-content: center; }
@media (max-width: 720px) { .gacha-cards { flex-direction: column; } .gacha-card-tip { max-height: 22vh; } }
