/* 등불지기 — UI. Everything lives inside #stage (1280×720 logical px), which is scaled to fit the window. */
:root {
  --bg: #1b1429; --panel: rgba(33, 24, 53, 0.95); --panel2: #2a1f44; --line: #4d3b72; --line2: #6a5596;
  --gold: #ffcf5a; --gold2: #f0a030; --text: #f6efe0; --dim: #b9a9cf; --red: #ff5a6a; --green: #7fe06a; --blue: #5fa8ff;
  --font: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0d0915; overflow: hidden; font-family: var(--font); color: var(--text); -webkit-user-select: none; user-select: none; }
#stage { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; background: #140e20; }
#game { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; display: block; }
#ui { position: absolute; inset: 0; font-size: 14px; line-height: 1.35; pointer-events: none; }
#ui > * { pointer-events: none; }
.hidden { display: none !important; }
b { font-weight: 800; }
kbd { font-family: var(--font); font-size: 11px; font-weight: 900; background: #15101f; color: var(--gold); border-radius: 5px; padding: 1px 6px; border: 1px solid #5a4780; box-shadow: 0 2px 0 #0b0812; }
.ic { width: 100%; height: 100%; display: block; pointer-events: none; }
.ic.ph { border-radius: 8px; background: linear-gradient(135deg, #7a68a8, #3c2f5e); }

.pnl { background: var(--panel); border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.07); }
.btn { pointer-events: auto; cursor: pointer; font-family: var(--font); font-weight: 900; font-size: 15px; color: #3a2408; background: linear-gradient(#ffe08a, #f3a735); border: 0; border-radius: 11px; padding: 9px 18px; box-shadow: 0 4px 0 #a6641c, 0 6px 12px rgba(0, 0, 0, 0.35); transition: transform 0.06s, filter 0.1s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a6641c; }
.btn.sub { color: var(--text); background: linear-gradient(#4a3a72, #35284f); box-shadow: 0 4px 0 #1a1229, 0 6px 12px rgba(0, 0, 0, 0.35); }
.btn.sm { font-size: 12.5px; padding: 5px 11px; border-radius: 8px; box-shadow: 0 3px 0 #a6641c; }
.btn.sub.sm { box-shadow: 0 3px 0 #1a1229; }
.btn:disabled, .btn.off { filter: grayscale(0.9) brightness(0.6); cursor: default; pointer-events: none; }

/* ---------------------------------------------------------------- HUD */
#hud > * { position: absolute; }
#st { left: 14px; top: 12px; width: 318px; height: 92px; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; pointer-events: auto; }
.pf { position: relative; width: 72px; height: 72px; flex: none; border-radius: 50%; background: radial-gradient(#5a4a86, #2a1f44); border: 3px solid var(--gold); box-shadow: 0 0 0 2px #1b1429; overflow: hidden; }
.pf canvas { width: 68px; height: 68px; display: block; }
#st-lv { position: absolute; left: 4px; top: 60px; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 12px; background: linear-gradient(#ffe08a, #f3a735); color: #3a2408; font-weight: 900; font-size: 13px; line-height: 24px; text-align: center; border: 2px solid #1b1429; }
.st-r { flex: 1; min-width: 0; }
.st-n { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; white-space: nowrap; }
.st-n b { font-size: 15px; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
.st-n span { font-size: 12px; color: var(--gold); font-weight: 800; }
.bar { position: relative; height: 16px; border-radius: 8px; background: #150f22; border: 2px solid #0e0a17; overflow: hidden; margin-top: 3px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 6px; transition: width 0.18s ease-out; }
.bar em { position: absolute; inset: 0; font-style: normal; font-size: 11px; font-weight: 900; text-align: center; line-height: 12px; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.bar.hp i { background: linear-gradient(#ff8a7a, #f0354f); }
.bar.mp { height: 14px; } .bar.mp i { background: linear-gradient(#7fd0ff, #3b7df0); } .bar.mp em { line-height: 10px; font-size: 10.5px; }
.bar.xp { height: 9px; border-width: 1.5px; } .bar.xp i { background: linear-gradient(#ffe98a, #ffa53c); } .bar.xp em { font-size: 8.5px; line-height: 6px; }
#buffs { left: 16px; top: 110px; display: flex; gap: 6px; }
.buff { position: relative; width: 36px; height: 36px; border-radius: 9px; border: 2px solid var(--gold); background: #2a1f44; overflow: hidden; pointer-events: auto; }
.buff em { position: absolute; right: 1px; bottom: 0; font-style: normal; font-size: 10.5px; font-weight: 900; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
#mm { right: 14px; top: 12px; width: 220px; padding: 6px 8px 7px; pointer-events: auto; }
#mm-n { font-weight: 900; font-size: 14px; text-align: center; color: var(--gold); margin-bottom: 4px; white-space: nowrap; }
#mmc { width: 200px; height: 86px; display: block; border-radius: 8px; background: #140e20; border: 1.5px solid #0e0a17; }
#mm-f { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; margin-top: 5px; color: var(--dim); }
#gold { color: #ffe27a; } #gold::before { content: "● "; color: #ffc93a; }
#qt { right: 14px; top: 166px; width: 236px; }
.qt-i { background: rgba(27, 20, 41, 0.72); border-left: 4px solid var(--gold); border-radius: 0 10px 10px 0; padding: 6px 10px; margin-bottom: 6px; font-size: 12.5px; }
.qt-i.rd { border-color: var(--green); background: rgba(30, 52, 38, 0.8); }
.qt-i b { display: block; font-size: 13px; margin-bottom: 1px; }
.qt-i b small { color: var(--gold); font-size: 10.5px; margin-right: 4px; }
.qt-i span { display: block; color: #d9cdea; }
.qt-i span.ok { color: var(--green); }
#hot { left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 7px; align-items: flex-end; padding: 8px 12px; background: rgba(27, 20, 41, 0.78); border: 2px solid var(--line); border-radius: 16px; pointer-events: auto; }
.hs { position: relative; width: 54px; height: 54px; border-radius: 11px; background: #1b1429; border: 2px solid #5a4780; overflow: hidden; }
.hs.atk { width: 46px; height: 46px; }
.hs.pot { width: 46px; height: 46px; border-color: #7a5a3a; }
.hs .k { position: absolute; left: 2px; top: 1px; z-index: 3; font-size: 11px; font-weight: 900; color: var(--gold); text-shadow: 0 1px 0 #000, 0 0 3px #000, 0 0 2px #000; }
.hs .n { position: absolute; right: 3px; bottom: 0; z-index: 3; font-size: 11.5px; font-weight: 900; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.hs .cd { position: absolute; inset: 0; z-index: 2; display: none; align-items: center; justify-content: center; font-weight: 900; font-size: 17px; text-shadow: 0 1px 3px #000; }
.hs.oncd .cd { display: flex; }
.hs.nomp .ic { filter: grayscale(0.85) brightness(0.55); }
.hs.rdy { animation: rdy 0.4s ease-out; }
@keyframes rdy { 0% { box-shadow: 0 0 0 0 #fff, inset 0 0 0 30px rgba(255, 255, 255, 0.7); } 100% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0), inset 0 0 0 0 rgba(255, 255, 255, 0); } }
.hs.empty { opacity: 0.55; }
.hsep { width: 2px; height: 40px; background: var(--line); margin: 0 3px 4px; border-radius: 1px; }
#menu { right: 14px; bottom: 14px; display: flex; gap: 6px; pointer-events: auto; }
.mb { position: relative; width: 44px; height: 44px; border-radius: 12px; background: rgba(33, 24, 53, 0.9); border: 2px solid var(--line); cursor: pointer; padding: 5px; transition: transform 0.08s, border-color 0.1s; }
.mb:hover { transform: translateY(-3px); border-color: var(--gold); }
.mb kbd { position: absolute; right: -4px; bottom: -6px; font-size: 9.5px; padding: 0 4px; }
.mb.dot::after { content: ""; position: absolute; right: -4px; top: -4px; width: 13px; height: 13px; border-radius: 50%; background: #ff4a5a; border: 2px solid #1b1429; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.3); } }
#log { left: 14px; bottom: 16px; width: 380px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.lg { font-size: 12.5px; font-weight: 700; text-shadow: 0 1px 2px #000, 0 0 4px #000, 0 0 2px #000; animation: lg 6s forwards; }
.lg.warn { color: #ffb0a0; } .lg.quest { color: #ffe27a; } .lg.boss { color: #ff7a9a; } .lg.sys { color: #a8e8ff; }
@keyframes lg { 0% { opacity: 0; transform: translateX(-10px); } 5% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
#boss { left: 50%; top: 14px; width: 560px; transform: translateX(-50%); text-align: center; }
#boss-n { font-size: 17px; font-weight: 900; color: #ffd0dc; text-shadow: 0 2px 0 #3a0a1c, 0 0 8px #ff3a6a; margin-bottom: 3px; }
.bar.bs { height: 20px; border-radius: 10px; border: 2.5px solid #1b0d18; background: #24101c; }
.bar.bs i { background: linear-gradient(#ff7a9a, #c81e4e); transition: width 0.12s; }
.bar.bs #b-bs2 { background: #ffe9a0; opacity: 0.55; transition: width 0.7s 0.15s; z-index: 0; }
.bar.bs #b-bs { z-index: 1; }
#banner { left: 0; right: 0; top: 150px; text-align: center; }
.bn { animation: bn 3.2s forwards; }
.bn h2 { margin: 0; font-size: 44px; font-weight: 900; letter-spacing: 1px; color: #fff6d6; text-shadow: 0 3px 0 #5a3a12, 0 0 18px rgba(255, 200, 90, 0.9), 0 6px 14px rgba(0, 0, 0, 0.6); }
.bn p { margin: 4px 0 0; font-size: 17px; font-weight: 800; color: #ffe9b0; text-shadow: 0 2px 4px #000, 0 0 6px #000; }
.bn.lv h2 { color: #fff3a0; font-size: 54px; text-shadow: 0 3px 0 #a65a10, 0 0 24px #ffb030, 0 6px 14px rgba(0, 0, 0, 0.6); }
.bn.boss h2 { color: #ffd0dc; text-shadow: 0 3px 0 #5a0a24, 0 0 22px #ff2a6a, 0 6px 14px rgba(0, 0, 0, 0.6); }
.bn.lit h2 { color: #fffbe0; font-size: 56px; text-shadow: 0 3px 0 #a65a10, 0 0 30px #ffd84a, 0 0 60px #ff9a2e; }
@keyframes bn { 0% { opacity: 0; transform: scale(1.5); } 9% { opacity: 1; transform: scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }
#combo { right: 30px; top: 392px; text-align: right; font-weight: 900; font-style: italic; }
#combo b { font-size: 40px; color: #fff3a0; text-shadow: 0 3px 0 #a65a10, 0 0 12px #ff9a2e; display: inline-block; }
#combo span { font-size: 15px; color: #ffd27a; text-shadow: 0 2px 0 #000; margin-left: 4px; }
#combo.pop b { animation: cpop 0.14s; }
@keyframes cpop { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
#xpline { left: 0; right: 0; bottom: 0; height: 4px; background: rgba(10, 6, 20, 0.7); }
#xpline i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffa53c, #ffe98a); box-shadow: 0 0 6px #ffcf5a; transition: width 0.3s; }

/* ---------------------------------------------------------------- windows */
#wins { position: absolute; inset: 0; }
.win { position: absolute; pointer-events: auto; background: var(--panel); border: 2px solid var(--line2); border-radius: 15px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08); animation: wopen 0.14s ease-out; }
@keyframes wopen { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
.wh { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 14px; cursor: grab; background: linear-gradient(#45356d, #2e2249); border-radius: 13px 13px 0 0; border-bottom: 2px solid #1d152f; }
.wh span { font-weight: 900; font-size: 15px; color: var(--gold); flex: 1; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
.wh .x { pointer-events: auto; cursor: pointer; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #c8435a; color: #fff; font-weight: 900; font-size: 12px; line-height: 24px; padding: 0; box-shadow: 0 2px 0 #7a1e30; }
.wh .x:hover { filter: brightness(1.2); }
.wb { padding: 12px; }
.slot { position: relative; width: 46px; height: 46px; border-radius: 9px; background: #1d1530; border: 2px solid #43336a; cursor: pointer; padding: 2px; }
.slot:hover { border-color: #fff; background: #2d2247; }
.slot.r1 { border-color: #5fc45f; } .slot.r2 { border-color: #5fa8ff; box-shadow: inset 0 0 8px rgba(95, 168, 255, 0.5); } .slot.r3 { border-color: #c77dff; box-shadow: inset 0 0 9px rgba(199, 125, 255, 0.6); } .slot.r4 { border-color: #ffb347; box-shadow: inset 0 0 10px rgba(255, 179, 71, 0.75); }
.slot .n { position: absolute; right: 2px; bottom: -1px; font-size: 11.5px; font-weight: 900; text-shadow: 0 1px 0 #000, 0 0 3px #000, 0 0 2px #000; }
.slot .e { position: absolute; left: 2px; top: -1px; font-size: 11px; font-weight: 900; color: #ffe27a; text-shadow: 0 1px 0 #000, 0 0 3px #000, 0 0 2px #000; }
.slot.no .ic { filter: grayscale(0.7) brightness(0.6); }
.slot.sel { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.slot.empty { cursor: default; } .slot.empty:hover { border-color: #43336a; background: #1d1530; }
.grid { display: grid; grid-template-columns: repeat(6, 46px); gap: 6px; }
.row { display: flex; align-items: center; gap: 8px; }
.sp { flex: 1; }
.gold { color: #ffe27a; font-weight: 900; } .gold::before { content: "● "; color: #ffc93a; }
.dim { color: var(--dim); } .ok { color: var(--green); } .bad { color: #ff8a8a; } .gd { color: var(--gold); }
.hint { font-size: 11.5px; color: var(--dim); margin-top: 8px; }
/* character */
.ch { display: flex; gap: 14px; }
.ch-l { width: 196px; flex: none; }
.ch-pv { position: relative; height: 190px; border-radius: 12px; background: radial-gradient(ellipse at 50% 85%, #5a4a86, #241a3c 70%); border: 2px solid #1d152f; margin-bottom: 8px; }
.ch-pv canvas { width: 192px; height: 186px; display: block; }
.ch-eq { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; justify-items: center; }
.ch-eq .slot { width: 54px; height: 54px; }
.ch-eq .slot i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; font-weight: 800; color: #6a5a8a; }
.ch-r { flex: 1; min-width: 0; }
.ch-t { font-size: 17px; font-weight: 900; } .ch-t small { display: block; font-size: 12.5px; color: var(--gold); font-weight: 800; }
.stt { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13.5px; }
.stt td { padding: 3px 4px; } .stt td:nth-child(2) { text-align: right; font-weight: 900; } .stt td:last-child { width: 30px; text-align: right; }
.stt tr.sep td { border-top: 1px solid #43336a; padding-top: 7px; }
.pl { pointer-events: auto; cursor: pointer; width: 22px; height: 22px; border-radius: 6px; border: 0; background: linear-gradient(#ffe08a, #f3a735); color: #3a2408; font-weight: 900; font-size: 15px; line-height: 20px; padding: 0; box-shadow: 0 2px 0 #a6641c; }
.pl:active { transform: translateY(2px); box-shadow: none; }
.ap { background: #3a2a14; border: 1.5px solid var(--gold); border-radius: 9px; padding: 5px 9px; margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
/* skills */
.sk-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 800; }
.sk-l { max-height: 440px; overflow-y: auto; padding-right: 4px; pointer-events: auto; }
.sk-g { font-size: 12px; font-weight: 900; color: var(--gold); margin: 8px 0 5px; padding-bottom: 3px; border-bottom: 1px solid #43336a; }
.sk-g.lock { color: #7a6a9a; }
.sk { display: flex; gap: 10px; padding: 7px; border-radius: 10px; background: #251b3d; margin-bottom: 6px; align-items: flex-start; }
.sk.lock { opacity: 0.45; }
.sk .si { width: 50px; height: 50px; flex: none; border-radius: 10px; overflow: hidden; position: relative; border: 2px solid #1d152f; }
.sk .sm { flex: 1; min-width: 0; }
.sk .sn { font-weight: 900; font-size: 14px; display: flex; gap: 6px; align-items: center; }
.sk .sn em { font-style: normal; font-size: 10.5px; font-weight: 900; padding: 1px 6px; border-radius: 6px; background: #43336a; color: #e6dcff; }
.sk .sn em.p { background: #2d5a4a; color: #b8ffd8; } .sk .sn em.b { background: #6a4a1e; color: #ffe0a0; }
.sk .sd { font-size: 12px; color: #d6cbe8; margin-top: 2px; }
.sk .sx { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.sk .sr { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.sk .lv { font-weight: 900; font-size: 13px; }
.keyb { pointer-events: auto; cursor: pointer; min-width: 28px; height: 22px; border-radius: 6px; border: 1.5px solid #6a5596; background: #15101f; color: var(--gold); font-weight: 900; font-size: 11.5px; font-family: var(--font); }
.keyb:hover { border-color: #fff; }
.keys { display: flex; gap: 4px; }
/* quests */
.q { display: flex; gap: 12px; height: 380px; }
.q-l { width: 190px; flex: none; overflow-y: auto; pointer-events: auto; }
.q-i { padding: 7px 9px; border-radius: 9px; background: #251b3d; margin-bottom: 5px; cursor: pointer; font-size: 13px; font-weight: 800; border: 2px solid transparent; }
.q-i:hover { background: #32264f; } .q-i.sel { border-color: var(--gold); }
.q-i small { display: block; font-size: 10.5px; color: var(--dim); font-weight: 800; }
.q-i.done { opacity: 0.5; } .q-i.rd small { color: var(--green); }
.q-d { flex: 1; min-width: 0; overflow-y: auto; pointer-events: auto; background: #1d1530; border-radius: 11px; padding: 12px; }
.q-d h3 { margin: 0 0 6px; font-size: 17px; color: var(--gold); }
.q-d p { margin: 0 0 8px; font-size: 13px; color: #e0d6f0; }
.q-d h4 { margin: 10px 0 4px; font-size: 12px; color: var(--dim); }
.q-d li { font-size: 13px; margin-left: -18px; } .q-d li.ok { color: var(--green); }
.rw { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; font-weight: 800; }
.rw .slot { width: 38px; height: 38px; cursor: default; }
/* world map */
.wm { position: relative; width: 892px; height: 310px; margin-bottom: 8px; border-radius: 12px; background: radial-gradient(ellipse at 30% 40%, #33264f, #1d1530 80%); border: 2px solid #1d152f; }
.wm svg { position: absolute; inset: 0; }
.wm-n { position: absolute; transform: translate(-50%, -18px); text-align: center; pointer-events: auto; cursor: default; }
.wm-n i { display: block; width: 32px; height: 32px; margin: 0 auto 4px; border-radius: 50%; background: #3c2f5e; border: 3px solid #6a5596; transition: transform 0.1s; }
.wm-n.town i { border-radius: 9px; background: #7a5a2a; border-color: var(--gold); }
.wm-n.lit i { background: radial-gradient(#fff6c0, #ffb53a); border-color: #fff3c4; box-shadow: 0 0 16px #ffcf5a; }
.wm-n.unk { opacity: 0.4; }
.wm-n.cur i { box-shadow: 0 0 0 4px #fff, 0 0 18px #fff; animation: pulse 1.2s infinite; }
.wm-n.go { cursor: pointer; } .wm-n.go:hover i { transform: scale(1.2); }
.wm-n b { display: block; font-size: 12.5px; white-space: nowrap; text-shadow: 0 1px 3px #000; }
.wm-n small { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
/* shop */
.shop { display: flex; gap: 14px; text-align: left; }
.shop-l { width: 340px; height: 380px; overflow-y: auto; pointer-events: auto; padding-right: 4px; }
.si-r { display: flex; align-items: center; gap: 9px; padding: 5px 7px; border-radius: 10px; background: #251b3d; margin-bottom: 5px; }
.si-r .slot { flex: none; cursor: default; }
.si-r .nm { flex: 1; min-width: 0; font-size: 13px; font-weight: 800; } .si-r .nm small { display: block; font-size: 11px; color: var(--dim); font-weight: 700; }
.si-r.no .nm { color: #9a8ab0; }
/* enhance */
.enh { display: flex; gap: 12px; }
.enh-l { width: 216px; height: 330px; overflow-y: auto; pointer-events: auto; }
.enh-l .grid { grid-template-columns: repeat(4, 46px); }
.enh-r { flex: 1; background: #1d1530; border-radius: 11px; padding: 12px; text-align: center; min-height: 330px; position: relative; overflow: hidden; }
.enh-r .big { width: 84px; height: 84px; margin: 4px auto 6px; border-radius: 14px; background: #2a1f44; border: 2px solid var(--line2); padding: 6px; }
.enh-r h3 { margin: 0; font-size: 16px; }
.enh-r table { margin: 8px auto; font-size: 13px; } .enh-r td { padding: 1px 8px; }
.enh-res { position: absolute; left: 0; right: 0; top: 70px; font-size: 30px; font-weight: 900; pointer-events: none; animation: enr 1.2s forwards; }
.enh-res.ok { color: #fff3a0; text-shadow: 0 3px 0 #a65a10, 0 0 22px #ffb030; } .enh-res.fail { color: #c8b8d8; text-shadow: 0 3px 0 #2a2038; }
@keyframes enr { 0% { opacity: 0; transform: scale(2); } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
.enh-r.flash { animation: enf 0.5s; } @keyframes enf { 0% { background: #fff3a0; } 100% { background: #1d1530; } }
.enh-r.shake { animation: ens 0.4s; } @keyframes ens { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* ---------------------------------------------------------------- dialog / modal */
#dlg { position: absolute; left: 50%; bottom: 96px; width: 900px; transform: translateX(-50%); pointer-events: auto; display: flex; gap: 16px; padding: 16px 20px; animation: wopen 0.16s ease-out; }
#dlg .pt { width: 132px; flex: none; text-align: center; }
#dlg .pt canvas { width: 132px; height: 132px; border-radius: 16px; background: radial-gradient(ellipse at 50% 80%, #5a4a86, #241a3c 75%); border: 2px solid var(--gold); display: block; }
#dlg .pt b { display: block; margin-top: 6px; font-size: 15px; font-weight: 900; } #dlg .pt small { color: var(--gold); font-size: 11.5px; font-weight: 800; }
#dlg .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#dlg .say { flex: 1; font-size: 16.5px; line-height: 1.6; font-weight: 700; min-height: 84px; white-space: pre-wrap; cursor: pointer; }
#dlg .opt { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#dlg .opt .btn { font-size: 14px; padding: 7px 14px; }
#dlg .opt .btn.q { background: linear-gradient(#b8f0a0, #5fc45f); box-shadow: 0 4px 0 #2d7a3a, 0 6px 12px rgba(0, 0, 0, 0.35); color: #0e2a14; }
#dlg .nx { position: absolute; right: 20px; bottom: 12px; font-size: 12px; color: var(--dim); animation: pulse 1s infinite; }
#ui > .modal { position: absolute; inset: 0; z-index: 30; background: rgba(10, 6, 20, 0.62); pointer-events: auto; display: flex; align-items: center; justify-content: center; animation: fadein 0.15s; }
#hud { position: absolute; inset: 0; z-index: 1; } #wins { z-index: 5; } #toast { z-index: 8; } #dlg { z-index: 20; } #title { z-index: 25; }
@keyframes fadein { from { opacity: 0; } }
.mbox { position: relative; padding: 22px 26px; max-width: 1100px; text-align: center; animation: wopen 0.16s ease-out; }
.mbox h2 { margin: 0 0 10px; font-size: 24px; color: var(--gold); font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
.mbox p { margin: 0 0 14px; font-size: 15.5px; line-height: 1.65; }
.mbox .acts { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }
.menu-l { display: flex; flex-direction: column; gap: 10px; width: 280px; margin: 0 auto; }
.keysx { text-align: left; font-size: 14px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; margin: 0 auto; width: fit-content; }
.keysx kbd { font-size: 12.5px; padding: 2px 8px; justify-self: start; }
.set { text-align: left; width: 340px; margin: 0 auto; font-weight: 800; }
.set label { display: flex; align-items: center; gap: 12px; margin: 10px 0; } .set label span { width: 96px; }
.set input[type="range"] { flex: 1; accent-color: #ffcf5a; pointer-events: auto; }
.set input[type="checkbox"] { width: 20px; height: 20px; accent-color: #ffcf5a; }
.set select { pointer-events: auto; flex: 1; font-family: var(--font); font-weight: 800; font-size: 14px; padding: 5px 8px; border-radius: 8px; background: #15101f; color: var(--text); border: 2px solid var(--line2); }
/* job advancement */
.jobs { display: flex; gap: 16px; }
.job { width: 300px; text-align: center; padding: 14px; border-radius: 16px; background: #251b3d; border: 2.5px solid #43336a; transition: transform 0.12s, border-color 0.12s; }
.job:hover { transform: translateY(-6px); border-color: var(--jc, #ffcf5a); }
.job canvas { width: 268px; height: 170px; border-radius: 12px; background: radial-gradient(ellipse at 50% 90%, #4e3f78, #1d1530 72%); display: block; margin: 0 auto 8px; }
.job h3 { margin: 0; font-size: 22px; color: var(--jc, #ffcf5a); font-weight: 900; }
.job .tg { font-size: 12px; font-weight: 900; color: #1b1429; background: var(--jc, #ffcf5a); display: inline-block; padding: 1px 10px; border-radius: 10px; margin: 4px 0 8px; }
.job p { font-size: 13px; line-height: 1.55; margin: 0 0 10px; color: #e0d6f0; min-height: 60px; }
.job .jsk { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.job .jsk div { width: 44px; height: 44px; border-radius: 9px; overflow: hidden; border: 2px solid #1d152f; pointer-events: auto; }
.job.one { width: 560px; }
.job.one canvas { width: 528px; height: 210px; }
/* tooltip */
#tip { position: absolute; z-index: 50; min-width: 180px; max-width: 290px; padding: 10px 12px; background: rgba(20, 14, 34, 0.97); border: 2px solid var(--line2); border-radius: 11px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6); font-size: 12.5px; }
#tip h4 { margin: 0 0 2px; font-size: 14.5px; font-weight: 900; }
#tip .ty { color: var(--dim); font-size: 11.5px; margin-bottom: 6px; }
#tip .ln { display: flex; justify-content: space-between; gap: 14px; } #tip .ln b { font-weight: 900; }
#tip .op { color: #9fe89a; }
#tip .ds { color: #d6cbe8; margin-top: 6px; line-height: 1.5; }
#tip .pr { margin-top: 6px; color: #ffe27a; font-weight: 800; }
#tip .up { color: var(--green); } #tip .dn { color: #ff8a8a; }
#tip hr { border: 0; border-top: 1px solid #43336a; margin: 6px 0; }
/* toasts (loot) */
#toast { position: absolute; right: 14px; top: 456px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.ts { display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border-radius: 22px; background: rgba(27, 20, 41, 0.88); border: 2px solid var(--line2); font-weight: 800; font-size: 13.5px; animation: ts 2.6s forwards; white-space: nowrap; }
.ts .slot { width: 30px; height: 30px; border-radius: 50%; border-width: 0; background: #3c2f5e; padding: 3px; }
@keyframes ts { 0% { opacity: 0; transform: translateY(12px) scale(0.9); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }

/* ---------------------------------------------------------------- title / create */
#title { position: absolute; inset: 0; pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(rgba(20, 12, 36, 0.25), rgba(20, 12, 36, 0.62)); }
.logo { text-align: center; margin-bottom: 34px; animation: logo 1s ease-out; }
@keyframes logo { from { opacity: 0; transform: translateY(-24px) scale(0.94); } }
.logo h1 { margin: 0; font-size: 118px; font-weight: 900; letter-spacing: 8px; line-height: 1; color: #fff3c4; background: linear-gradient(#fffbe6 20%, #ffd76a 55%, #f08a2a); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 5px 0 #6a3a12) drop-shadow(0 0 26px rgba(255, 190, 80, 0.75)) drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5)); }
.logo p { margin: 14px 0 0; font-size: 24px; font-weight: 800; letter-spacing: 10px; color: #ffe9b8; text-shadow: 0 2px 6px #000, 0 0 12px rgba(0, 0, 0, 0.8); }
.t-menu { display: flex; flex-direction: column; gap: 12px; width: 300px; }
.t-menu .btn { font-size: 19px; padding: 13px; }
.t-menu .btn small { display: block; font-size: 12px; font-weight: 800; opacity: 0.75; }
.t-foot { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 12px; color: rgba(255, 240, 210, 0.7); text-shadow: 0 1px 3px #000; }
.cr { display: flex; gap: 22px; padding: 22px 26px; text-align: left; }
.cr canvas { width: 250px; height: 300px; border-radius: 16px; background: radial-gradient(ellipse at 50% 85%, #5a4a86, #241a3c 72%); border: 2px solid var(--gold); display: block; }
.cr-r { width: 380px; }
.cr h2 { margin: 0 0 12px; color: var(--gold); font-size: 24px; font-weight: 900; }
.cr label { display: block; font-size: 12.5px; font-weight: 900; color: var(--dim); margin: 11px 0 5px; }
.cr input[type="text"] { pointer-events: auto; width: 100%; font-family: var(--font); font-size: 17px; font-weight: 800; padding: 9px 12px; border-radius: 10px; border: 2px solid var(--line2); background: #15101f; color: var(--text); outline: none; -webkit-user-select: text; user-select: text; }
.cr input[type="text"]:focus { border-color: var(--gold); }
.sw { display: flex; flex-wrap: wrap; gap: 6px; }
.sw button { pointer-events: auto; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; border: 3px solid #1b1429; box-shadow: 0 0 0 2px #43336a; padding: 0; }
.sw button.on { box-shadow: 0 0 0 3px var(--gold); transform: scale(1.1); }
.sw button.tx { width: auto; height: 30px; border-radius: 9px; padding: 0 10px; background: #2a1f44; color: var(--text); font-family: var(--font); font-weight: 800; font-size: 12.5px; }
.end p { text-align: center; max-width: 620px; }
.end .stats { display: flex; gap: 26px; justify-content: center; margin: 12px 0; font-weight: 900; font-size: 15px; } .end .stats small { display: block; color: var(--dim); font-size: 11.5px; }
::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-thumb { background: #5a4780; border-radius: 4px; } ::-webkit-scrollbar-track { background: #1d1530; border-radius: 4px; }
