﻿/* ============================================================
   전설의 검 — UI 스타일
   설계 기준 화면 1280x720 (#game-wrap), 창 크기에 맞춰 통째로 확대/축소
   ============================================================ */
:root {
  --ink: #0d1022;
  --panel: rgba(19, 23, 46, 0.94);
  --panel2: rgba(30, 36, 68, 0.9);
  --line: #3a4374;
  --line2: #566199;
  --text: #e9ecff;
  --dim: #98a1cc;
  --gold: #f6cd62;
  --gold2: #ffe9a8;
  --hp: #ee5a4f;
  --mp: #4a98f0;
  --ok: #6fd88a;
  --bad: #ff7a7a;
  --main: #6aa8ff;
  --font: "Pretendard Variable", Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", Batang, "바탕", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #07081a; overflow: hidden; }
body { font-family: var(--font); color: var(--text); user-select: none; -webkit-user-select: none; }
.hidden { display: none !important; }
.dim { color: var(--dim); }
kbd {
  display: inline-block; min-width: 18px; padding: 1px 5px; margin: 0 1px; font: 600 11px var(--font);
  color: #dfe5ff; background: #2a3158; border: 1px solid #56609a; border-bottom-width: 2px; border-radius: 5px; text-align: center; vertical-align: 1px;
}
button { font-family: var(--font); cursor: pointer; }

#stage { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(ellipse at center, #14183a 0%, #07081a 75%); }
#game-wrap { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; overflow: hidden; background: #000; box-shadow: 0 0 60px rgba(0, 0, 0, 0.7); }
#game { position: absolute; inset: 0; width: 1280px; height: 720px; display: block; }

/* ---------- 공용 버튼/창 ---------- */
.btn-main, .screen button, .win button {
  padding: 10px 22px; font-size: 15px; font-weight: 600; color: var(--text);
  background: linear-gradient(#333c72, #262d58); border: 1px solid var(--line2); border-radius: 10px;
  transition: transform .08s, filter .12s, background .12s;
}
.screen button:hover, .win button:hover { filter: brightness(1.25); }
.screen button:active, .win button:active { transform: translateY(1px); }
.btn-main { background: linear-gradient(#f6cd62, #d99a2e) !important; border-color: #ffe9a8 !important; color: #2a1c05 !important; box-shadow: 0 3px 0 #8f5f14, 0 6px 18px rgba(246, 205, 98, .25); }
.btn-sub { background: transparent !important; border-color: var(--line) !important; color: var(--dim) !important; }
button:disabled { opacity: .4; cursor: default; filter: none !important; }

.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(6, 8, 24, 0.62); z-index: 40; animation: fadeIn .14s ease-out; }
.win { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 60px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .07); animation: popIn .16s ease-out; }
.win-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; font-size: 18px; font-weight: 700; border-bottom: 1px solid var(--line); }
.win-head > span:first-child { flex: 1; }
.win-foot { padding: 10px 18px; font-size: 12px; color: var(--dim); border-top: 1px solid var(--line); }
.win-close { width: 32px; height: 32px; padding: 0 !important; font-size: 14px !important; border-radius: 8px !important; background: transparent !important; color: var(--dim) !important; }
.win-close:hover { background: #40295a !important; color: #fff !important; }
.scroll { overflow-y: auto; }
.scroll::-webkit-scrollbar, #dlg-text::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: #46508a; border-radius: 4px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { padding: 5px 12px !important; font-size: 12.5px !important; font-weight: 600; border-radius: 999px !important; background: #232a52 !important; border: 1px solid var(--line) !important; color: var(--dim) !important; }
.chips button.sel { background: #3d4a94 !important; color: #fff !important; border-color: #8a98e0 !important; }
.chips button .n { margin-left: 5px; padding: 0 6px; border-radius: 9px; background: rgba(255, 255, 255, .14); font-size: 11px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
#player-frame { position: absolute; left: 18px; top: 16px; display: flex; gap: 12px; align-items: center; padding: 10px 16px 10px 10px; background: linear-gradient(90deg, rgba(15, 18, 40, .92), rgba(15, 18, 40, .55)); border: 1px solid rgba(90, 100, 160, .55); border-radius: 44px 16px 16px 44px; backdrop-filter: blur(3px); }
.pf-portrait { position: relative; width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #46508f, #1c2148); border: 2px solid var(--gold); box-shadow: 0 0 0 3px rgba(0, 0, 0, .35); }
#pf-face { width: 64px; height: 64px; border-radius: 50%; }
#pf-level { position: absolute; right: -6px; bottom: -4px; min-width: 26px; height: 22px; padding: 0 5px; font: 800 12px/20px var(--font); text-align: center; color: #2a1c05; background: linear-gradient(#ffe9a8, #e0a53a); border: 1px solid #fff3c8; border-radius: 11px; }
.pf-body { width: 236px; }
.pf-name { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; font-size: 14px; font-weight: 700; }
#pf-title { font-size: 11.5px; font-weight: 600; color: var(--gold); }
.bar { position: relative; height: 16px; margin-bottom: 4px; background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .14); border-radius: 8px; overflow: hidden; }
.bar-fill, .bar-lag { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 7px; }
.bar-fill::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 45%; background: rgba(255, 255, 255, .22); border-radius: 7px 7px 0 0; }
.bar-lag { background: #fff3c8; opacity: .75; transition: width .5s ease-out .15s; }
.bar.hp .bar-fill { background: linear-gradient(90deg, #d8423c, #ff7d62); transition: width .12s; }
.bar.mp { height: 12px; }
.bar.mp .bar-fill { background: linear-gradient(90deg, #2f78dc, #6fc0ff); transition: width .12s; }
.bar-text { position: absolute; inset: 0; font: 700 11px/14px var(--font); text-align: center; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.bar.mp .bar-text { font-size: 9.5px; line-height: 10.5px; }
.bar.low .bar-fill { animation: lowPulse .7s infinite alternate; }
@keyframes lowPulse { to { filter: brightness(1.6); } }
.pf-row { display: flex; align-items: center; justify-content: space-between; height: 20px; margin-top: 3px; font-size: 13px; }
#gold-text { font-weight: 700; color: var(--gold2); }
#gold-text::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3c8, #f0b030 60%, #b87818); box-shadow: 0 0 0 1px #8f5f14; }
#buffs { display: flex; gap: 4px; }
#buffs .buff { padding: 1px 7px; font-size: 11px; font-weight: 700; border-radius: 9px; background: rgba(106, 168, 255, .25); border: 1px solid rgba(106, 168, 255, .6); }
#stat-badge { position: absolute; left: 22px; top: 108px; padding: 6px 14px; font-size: 12.5px; font-weight: 700; color: #2a1c05; background: linear-gradient(#ffe9a8, #e9b548); border: 1px solid #fff3c8; border-radius: 999px; animation: badge 1.2s infinite alternate; }
@keyframes badge { to { transform: translateY(-2px); box-shadow: 0 0 16px rgba(246, 205, 98, .7); } }

#mini-panel { position: absolute; right: 18px; top: 16px; width: 222px; padding: 7px; background: rgba(15, 18, 40, .88); border: 1px solid rgba(90, 100, 160, .55); border-radius: 14px; }
#mini-name { padding: 1px 4px 6px; font-size: 13px; font-weight: 700; text-align: center; color: var(--gold2); }
#minimap { display: block; width: 208px; height: 150px; border-radius: 8px; background: #0b0d1c; }
#mini-btns { display: flex; gap: 4px; margin-top: 7px; }
#mini-btns button { position: relative; flex: 1; height: 34px; padding: 0; font-size: 15px; background: #232a52; border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
#mini-btns button:hover { background: #3d4a94; }
#mini-btns kbd { position: absolute; right: -3px; bottom: -5px; min-width: 0; padding: 0 3px; font-size: 8.5px; border-bottom-width: 1px; }
#mini-btns button.alert::after { content: ""; position: absolute; left: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }

#quest-tracker { position: absolute; right: 18px; top: 262px; width: 222px; background: linear-gradient(270deg, rgba(15, 18, 40, .86), rgba(15, 18, 40, .5)); border: 1px solid rgba(90, 100, 160, .4); border-radius: 12px; font-size: 12.5px; }
.qt-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 6px 6px 12px; font-size: 11.5px; font-weight: 700; color: var(--dim); letter-spacing: .04em; }
#qt-toggle { width: 22px; height: 22px; padding: 0; background: none; border: 0; color: var(--dim); font-size: 13px; }
#quest-tracker.collapsed #qt-body { display: none; }
#quest-tracker.collapsed #qt-toggle { transform: rotate(-90deg); }
#qt-body { padding: 0 12px 9px; }
.qt { margin-top: 6px; font-weight: 700; line-height: 1.35; }
.qt.main { color: #9ccaff; }
.qt.side { color: #e9ecff; }
.qt.ready { color: var(--gold); }
.qt .qp { float: right; margin-left: 6px; font-weight: 700; color: var(--gold2); }
.qd { margin-top: 1px; font-size: 11.5px; line-height: 1.35; color: var(--dim); }
.qd .arrow { color: var(--gold); font-weight: 700; }
.qt-next { margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 11px; font-weight: 700; color: var(--dim); }

#boss-bar { position: absolute; left: 50%; top: 22px; width: 520px; transform: translateX(-50%); text-align: center; }
#boss-name { margin-bottom: 5px; font: 700 18px var(--serif); color: #ffd9d9; text-shadow: 0 2px 6px #000, 0 0 12px rgba(255, 80, 80, .6); letter-spacing: .08em; }
.bar.boss { height: 18px; border-color: rgba(255, 180, 180, .35); border-radius: 4px; }
.bar.boss .bar-fill { background: linear-gradient(90deg, #a01c3a, #ff5a6a); border-radius: 3px; transition: width .12s; }
.bar.boss .bar-lag { border-radius: 3px; }

#hotbar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 9px 11px 7px; background: rgba(15, 18, 40, .88); border: 1px solid rgba(90, 100, 160, .55); border-radius: 16px; }
#skill-bar { display: flex; gap: 7px; align-items: center; }
.slot { position: relative; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; font-size: 25px; background: linear-gradient(#2c3466, #1c2148); border: 2px solid #4f5a96; border-radius: 11px; cursor: pointer; transition: transform .08s, border-color .1s; }
.slot:hover { border-color: var(--gold); transform: translateY(-2px); }
.slot img { width: 36px; height: 36px; image-rendering: auto; pointer-events: none; }
.slot .key { position: absolute; left: -5px; top: -7px; }
.slot .cnt { position: absolute; right: 3px; bottom: 1px; font: 800 12px var(--font); color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.slot .mpc { position: absolute; right: 3px; bottom: 1px; font: 700 10px var(--font); color: #9ccaff; text-shadow: 0 1px 2px #000; }
.slot .cd { position: absolute; inset: -2px; display: none; align-items: center; justify-content: center; font: 800 15px var(--font); color: #fff; text-shadow: 0 1px 3px #000; border-radius: 11px; background: conic-gradient(rgba(8, 10, 28, .82) var(--p, 100%), rgba(8, 10, 28, .25) 0); }
.slot.nomp { filter: saturate(.3) brightness(.7); }
.slot.empty { opacity: .45; }
.slot.ready-flash { animation: readyFlash .45s; }
@keyframes readyFlash { from { box-shadow: 0 0 0 0 rgba(255, 233, 168, .9); border-color: #fff; } to { box-shadow: 0 0 0 14px rgba(255, 233, 168, 0); } }
.slot-sep { width: 1px; height: 40px; margin: 0 3px; background: var(--line); }
#exp-bar { position: relative; height: 9px; margin-top: 8px; background: rgba(0, 0, 0, .55); border-radius: 5px; overflow: hidden; }
#exp-fill { height: 100%; width: 0; background: linear-gradient(90deg, #d99a2e, #ffe9a8); border-radius: 5px; transition: width .3s; }
#exp-text { position: absolute; inset: 0; font: 700 8.5px/9px var(--font); text-align: center; color: #fff; text-shadow: 0 1px 2px #000; }

#exit-hint { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); padding: 6px 16px; font-size: 13px; font-weight: 700; color: var(--gold2); background: rgba(15, 18, 40, .85); border: 1px solid rgba(246, 205, 98, .5); border-radius: 999px; }
#exit-hint.locked { color: #ffb0b0; border-color: rgba(255, 120, 120, .5); }
#itemlog { position: absolute; left: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 4px; pointer-events: none !important; }
.itemlog-entry { padding: 4px 12px; font-size: 12.5px; font-weight: 600; background: rgba(15, 18, 40, .8); border-left: 3px solid var(--main); border-radius: 0 8px 8px 0; animation: slideIn .2s ease-out; transition: opacity .5s; }
.itemlog-entry.fade { opacity: 0; }
@keyframes slideIn { from { transform: translateX(-20px); opacity: 0; } }
#save-ind { position: absolute; right: 252px; top: 20px; padding: 4px 12px; font-size: 11.5px; color: var(--dim); background: rgba(15, 18, 40, .7); border-radius: 999px; opacity: 0; transition: opacity .4s; pointer-events: none !important; }
#save-ind.show { opacity: 1; }
body.cine #hud > *:not(#boss-bar) { opacity: 0; pointer-events: none; transition: opacity .3s; }

/* ---------- 알림 ---------- */
#toasts { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 39; pointer-events: none; width: 760px; }
.toast { max-width: 760px; padding: 8px 20px; font-size: 14.5px; font-weight: 600; text-align: center; line-height: 1.4; color: var(--text); background: rgba(13, 16, 36, .9); border: 1px solid rgba(120, 132, 200, .5); border-radius: 999px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); animation: toastIn .22s ease-out; transition: opacity .35s, transform .35s; }
.toast.gold { color: var(--gold2); border-color: rgba(246, 205, 98, .7); }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }

#banner { position: absolute; left: 0; right: 0; top: 150px; text-align: center; pointer-events: none; opacity: 0; z-index: 30; }
#banner.show { animation: banner 3.2s ease-out forwards; }
#banner-sub { font-size: 14px; font-weight: 600; letter-spacing: .5em; color: var(--gold); text-shadow: 0 2px 6px #000; }
#banner-title { margin-top: 4px; font: 800 46px var(--serif); letter-spacing: .12em; color: #fff; text-shadow: 0 3px 12px #000, 0 0 30px rgba(0, 0, 0, .8); }
.banner-line { width: 320px; height: 2px; margin: 10px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
@keyframes banner { 0% { opacity: 0; transform: translateY(12px); } 14% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }

.cine { position: absolute; left: 0; right: 0; height: 0; background: #000; z-index: 20; transition: height .35s ease; pointer-events: none; }
#cine-top { top: 0; } #cine-bot { bottom: 0; }
body.cine .cine { height: 64px; }

/* ---------- 대화 ---------- */
#dialogue { position: absolute; left: 0; right: 0; bottom: 0; z-index: 35; padding: 0 150px 26px; animation: dlgIn .18s ease-out; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(16px); } }
.dlg-box { position: relative; display: flex; gap: 18px; min-height: 148px; padding: 18px 24px 18px 18px; background: linear-gradient(rgba(21, 25, 52, .97), rgba(13, 16, 36, .97)); border: 1px solid var(--line2); border-radius: 18px; box-shadow: 0 12px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08); cursor: pointer; }
.dlg-portrait { flex: none; width: 112px; height: 112px; border-radius: 14px; background: radial-gradient(circle at 50% 30%, #4a558f, #1b2046); border: 2px solid var(--gold); overflow: hidden; }
.dlg-portrait.narr { display: none; }
#dlg-face { width: 112px; height: 112px; }
.dlg-main { flex: 1; min-width: 0; }
#dlg-name { display: inline-block; margin-bottom: 8px; padding: 2px 14px; font-size: 15px; font-weight: 800; color: #2a1c05; background: linear-gradient(#ffe9a8, #e9b548); border-radius: 999px; }
#dlg-name.narr { background: none; color: var(--gold); padding-left: 0; letter-spacing: .2em; font-size: 13px; }
#dlg-text { max-height: 132px; overflow-y: auto; font-size: 18px; line-height: 1.6; white-space: pre-wrap; word-break: keep-all; }
#dlg-text.narr { font-family: var(--serif); font-size: 19px; color: #f4f0e0; }
#dlg-text .q-title { color: var(--gold2); font-weight: 800; }
#dlg-text .q-meta { display: block; margin-top: 4px; font-size: 14.5px; color: #9ccaff; }
#dlg-text .q-rew { display: block; font-size: 14.5px; color: var(--gold2); }
#dlg-hint { position: absolute; right: 44px; bottom: 9px; font-size: 11.5px; color: var(--dim); }
#dlg-next { position: absolute; right: 20px; bottom: 9px; font-size: 13px; color: var(--gold); animation: bob .6s infinite alternate; }
@keyframes bob { to { transform: translateY(4px); } }
#dlg-choices { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; margin-bottom: 10px; }
.dlg-choice-btn { min-width: 380px; max-width: 760px; padding: 10px 18px; font-size: 15.5px; font-weight: 600; text-align: left; color: var(--text); background: rgba(24, 29, 60, .97); border: 1px solid var(--line2); border-radius: 12px; animation: slideR .18s ease-out backwards; }
.dlg-choice-btn:hover, .dlg-choice-btn.focus { background: #3d4a94; border-color: var(--gold); transform: translateX(-4px); }
.dlg-choice-btn kbd { margin-right: 9px; }
.dlg-choice-btn .tag { margin-left: 8px; padding: 1px 8px; font-size: 11px; font-weight: 700; border-radius: 9px; background: rgba(106, 168, 255, .25); color: #9ccaff; }
.dlg-choice-btn .tag.gold { background: rgba(246, 205, 98, .22); color: var(--gold2); }
@keyframes slideR { from { opacity: 0; transform: translateX(20px); } }

/* ---------- 통합 메뉴 ---------- */
.menu-win { width: 1040px; height: 600px; display: flex; flex-direction: column; }
.menu-tabs { display: flex; align-items: center; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); }
.menu-tabs button[data-tab] { padding: 10px 18px !important; font-size: 14.5px !important; background: transparent !important; border: 0 !important; border-bottom: 3px solid transparent !important; border-radius: 10px 10px 0 0 !important; color: var(--dim) !important; }
.menu-tabs button[data-tab].sel { color: #fff !important; background: rgba(90, 104, 180, .2) !important; border-bottom-color: var(--gold) !important; }
.menu-gold { margin-left: auto; margin-right: 8px; font-size: 14px; font-weight: 700; color: var(--gold2); }
.menu-body { flex: 1; min-height: 0; }
.tab { display: none; height: 100%; padding: 16px; }
.tab.sel { display: flex; gap: 16px; }
.tab > .scroll { flex: 1; }

.char-card { flex: none; width: 300px; display: flex; flex-direction: column; align-items: center; padding: 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; overflow-y: auto; }
#char-canvas { width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #4a558f, #1b2046); border: 2px solid var(--gold); }
#inv-stats { width: 100%; margin-top: 10px; font-size: 13px; }
.cs-name { text-align: center; font-size: 17px; font-weight: 800; }
.cs-title { text-align: center; margin: 2px 0 10px; font-size: 12.5px; color: var(--gold); }
.stat-row { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 8px; }
.stat-row:nth-child(odd) { background: rgba(0, 0, 0, .18); }
.stat-row .sl { flex: 1; color: var(--dim); }
.stat-row .sv { font-weight: 800; }
.stat-row .sx { font-size: 11px; color: var(--dim); }
.stat-row button { width: 24px; height: 24px; padding: 0 !important; font-size: 15px !important; border-radius: 6px !important; background: linear-gradient(#f6cd62, #d99a2e) !important; color: #2a1c05 !important; border: 0 !important; }
.sp-note { margin: 8px 0 4px; padding: 6px 10px; font-size: 12.5px; font-weight: 700; text-align: center; color: var(--gold2); background: rgba(246, 205, 98, .12); border: 1px dashed rgba(246, 205, 98, .5); border-radius: 8px; }
#inv-equipment { width: 100%; margin-top: 10px; display: flex; gap: 8px; }
.eq-slot { flex: 1; padding: 8px; text-align: center; font-size: 12px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: 10px; }
.eq-slot .ico { display: block; height: 34px; font-size: 26px; line-height: 34px; }
.eq-slot .ico img { width: 32px; height: 32px; }
.eq-slot b { display: block; font-size: 12.5px; }
.eq-slot span.s { color: var(--gold2); font-weight: 700; }

.bag { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bag-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
#inv-search { width: 190px; padding: 7px 12px; font: 13px var(--font); color: var(--text); background: #171b38; border: 1px solid var(--line); border-radius: 999px; outline: none; }
#inv-search:focus { border-color: var(--gold); }
.inv-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(9, 64px); grid-auto-rows: 64px; gap: 8px; align-content: start; padding: 4px; }
.inv-slot { position: relative; display: flex; align-items: center; justify-content: center; font-size: 29px; background: linear-gradient(#262d58, #1a1f44); border: 2px solid #3c4680; border-radius: 12px; cursor: pointer; }
.inv-slot img { width: 42px; height: 42px; pointer-events: none; }
.inv-slot:hover { border-color: #8a98e0; }
.inv-slot.sel { border-color: var(--gold); box-shadow: 0 0 12px rgba(246, 205, 98, .4); }
.inv-slot.eq { background: linear-gradient(#3a3566, #2a2450); }
.inv-slot .inv-cnt { position: absolute; right: 5px; bottom: 2px; font: 800 12.5px var(--font); text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.inv-slot .inv-eq { position: absolute; left: 3px; top: 2px; padding: 0 5px; font: 800 10px/15px var(--font); color: #2a1c05; background: var(--gold); border-radius: 6px; }
.inv-slot .inv-up { position: absolute; right: 3px; top: 1px; font: 800 12px var(--font); color: var(--ok); text-shadow: 0 1px 2px #000; }
.inv-empty { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--dim); }
.inv-detail { flex: none; display: flex; gap: 14px; align-items: center; min-height: 92px; margin-top: 10px; padding: 12px 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.inv-detail .big { flex: none; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; font-size: 34px; background: rgba(0, 0, 0, .25); border-radius: 12px; }
.inv-detail .big img { width: 48px; height: 48px; }
.inv-detail .info { flex: 1; min-width: 0; }
.inv-detail .nm { font-size: 16px; font-weight: 800; }
.inv-detail .tg { margin-left: 8px; font-size: 11.5px; color: var(--dim); font-weight: 600; }
.inv-detail .ds { margin-top: 3px; color: var(--dim); line-height: 1.4; }
.inv-detail .st { margin-top: 3px; font-weight: 700; }
.up { color: var(--ok); } .down { color: var(--bad); }
.inv-detail .acts { display: flex; gap: 6px; }
.inv-detail .acts button { padding: 8px 16px !important; font-size: 13.5px !important; }

.q-left { flex: none; width: 380px; display: flex; flex-direction: column; gap: 10px; }
#quest-list { flex: 1; min-height: 0; }
.q-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 9px 12px; font-size: 13.5px; font-weight: 600; background: rgba(0, 0, 0, .2); border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.q-item:hover { border-color: var(--line2); }
.q-item.sel { background: #2e376e; border-color: var(--gold); }
.q-item .mk { flex: none; width: 20px; text-align: center; font-weight: 800; }
.q-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-item .pg { font-size: 12px; color: var(--gold2); }
.q-item.done { opacity: .55; }
.q-right { flex: 1; min-width: 0; padding: 18px; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; overflow-y: auto; font-size: 14px; line-height: 1.6; }
.q-right h3 { margin: 0 0 4px; font-size: 20px; }
.q-right .badge { display: inline-block; margin-right: 6px; padding: 1px 10px; font-size: 11.5px; font-weight: 700; border-radius: 9px; background: rgba(106, 168, 255, .22); color: #9ccaff; }
.q-right .badge.gold { background: rgba(246, 205, 98, .2); color: var(--gold2); }
.q-right .badge.ok { background: rgba(111, 216, 138, .2); color: var(--ok); }
.q-right .badge.mode { background: rgba(200, 140, 255, .2); color: #d8b8ff; }
.q-right .sec { margin-top: 14px; font-size: 12px; font-weight: 700; color: var(--dim); letter-spacing: .06em; }
.q-right .desc { white-space: pre-wrap; word-break: keep-all; }
.q-right .prog { height: 10px; margin-top: 6px; background: rgba(0, 0, 0, .4); border-radius: 5px; overflow: hidden; }
.q-right .prog i { display: block; height: 100%; background: linear-gradient(90deg, #d99a2e, #ffe9a8); }
.q-empty { padding: 40px 10px; text-align: center; color: var(--dim); }

.list-row { display: flex; gap: 12px; align-items: center; margin-bottom: 7px; padding: 10px 14px; background: rgba(0, 0, 0, .2); border-radius: 12px; font-size: 13.5px; }
.list-row .ico { flex: none; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font-size: 25px; background: rgba(0, 0, 0, .25); border-radius: 10px; }
.list-row .ico img, .list-row .ico canvas { width: 40px; height: 40px; }
.list-row .bd { flex: 1; min-width: 0; }
.list-row .nm { font-weight: 800; font-size: 14.5px; }
.list-row .ds { color: var(--dim); font-size: 12.5px; line-height: 1.4; }
.list-row .rt { flex: none; text-align: right; font-size: 12.5px; color: var(--dim); }
.list-row .rt b { color: var(--gold2); }
.list-row.locked { opacity: .45; }
.list-row button { padding: 6px 12px !important; font-size: 13px !important; }
.sec-head { margin: 14px 0 8px; font-size: 12.5px; font-weight: 800; color: var(--gold); letter-spacing: .06em; }
.sec-head:first-child { margin-top: 0; }
#codex { flex-direction: column; }
#help-body .list-row .nm { width: 190px; flex: none; color: #9ccaff; }

/* ---------- 상점 ---------- */
.shop-win { width: 760px; height: 580px; display: flex; flex-direction: column; }
#shop-tabs { padding: 12px 18px 4px; }
#shop-list { flex: 1; min-height: 0; padding: 8px 18px 12px; }
.shop-row .pr { font-weight: 800; color: var(--gold2); }
.shop-row .pr.no { color: var(--bad); }
.shop-row .qty { display: flex; gap: 4px; }

/* ---------- 랜덤박스 ---------- */
.gamble-win { width: 520px; padding-bottom: 20px; text-align: center; }
#gamble-gold { margin: 14px 0; font-size: 13.5px; color: var(--dim); }
#gamble-machine { display: flex; justify-content: center; gap: 12px; margin: 0 auto 14px; padding: 16px; width: 380px; background: linear-gradient(#3a2a5a, #241a40); border: 2px solid var(--gold); border-radius: 16px; }
.reel { width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; font-size: 54px; background: #f4f0e6; border-radius: 12px; box-shadow: inset 0 6px 14px rgba(0, 0, 0, .35); }
.reel.spinning { animation: reel .12s infinite; }
@keyframes reel { 50% { transform: translateY(-4px); filter: blur(1px); } }
#gamble-result { min-height: 42px; margin: 0 24px 12px; font-size: 14.5px; font-weight: 600; line-height: 1.4; }

/* ---------- 월드맵 ---------- */
.map-win { width: 1020px; }
#worldmap { display: block; width: 980px; height: 520px; margin: 12px 20px 20px; border-radius: 12px; cursor: default; }
#map-hint { font-size: 12.5px; font-weight: 500; }

/* ---------- 개발자 ---------- */
.dev-win { width: 420px; }
#dev-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 14px 18px; }
#dev-list button { padding: 8px !important; font-size: 13px !important; }
.dev-row { grid-column: 1 / -1; display: flex; gap: 6px; }
.dev-row select { flex: 1; padding: 6px; font: 13px var(--font); color: var(--text); background: #171b38; border: 1px solid var(--line); border-radius: 8px; }

/* ---------- 타이틀 ---------- */
.screen { position: absolute; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#title-screen { background: radial-gradient(ellipse 60% 55% at 50% 48%, rgba(8, 10, 30, .62), rgba(8, 10, 30, .2) 70%), linear-gradient(rgba(8, 10, 30, .35), rgba(8, 10, 30, .1) 35%, rgba(8, 10, 30, .8)); }
.title-logo { text-align: center; margin-bottom: 26px; transition: margin .25s, transform .25s; }
#title-screen.sub .title-logo { margin-bottom: 8px; transform: scale(.62); }
.logo-sub { font-size: 14px; font-weight: 700; letter-spacing: .7em; color: var(--gold); text-shadow: 0 2px 8px #000; padding-left: .7em; }
#title-screen h1 { margin: 2px 0 6px; font: 900 104px var(--serif); letter-spacing: .1em; background: linear-gradient(#fff8dc 20%, #f6cd62 55%, #c9822a 90%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #5a3a10) drop-shadow(0 10px 24px rgba(0, 0, 0, .75)); }
.subtitle { margin: 0; font-size: 17px; color: #f1ecd8; text-shadow: 0 2px 8px #000; }
.title-menu { display: flex; flex-direction: column; gap: 10px; width: 300px; }
.title-menu button { padding: 13px 22px; font-size: 17px; }
.ng-step { margin-bottom: 12px; font-size: 16px; font-weight: 700; color: var(--gold2); text-shadow: 0 2px 6px #000; text-align: center; }
#newgame-panel, #slot-panel { display: flex; flex-direction: column; align-items: center; }
#class-select { display: flex; gap: 16px; }
.class-card { width: 250px; padding: 14px 16px 16px; text-align: center; background: rgba(19, 23, 46, .9); border: 2px solid var(--line); border-radius: 16px; cursor: pointer; transition: transform .12s, border-color .12s, box-shadow .12s; }
.class-card:hover { transform: translateY(-4px); border-color: var(--line2); }
.class-card.selected { border-color: var(--gold); box-shadow: 0 0 28px rgba(246, 205, 98, .35); background: rgba(34, 40, 82, .95); }
.class-prev { width: 96px; height: 96px; }
.class-card h4 { margin: 2px 0; font-size: 21px; }
.class-role { font-size: 12px; font-weight: 700; color: var(--gold); }
.class-card p { margin: 8px 0 10px; min-height: 40px; font-size: 13px; line-height: 1.5; color: var(--dim); word-break: keep-all; }
.class-bars { display: grid; grid-template-columns: 46px 1fr; gap: 5px 8px; align-items: center; font-size: 11.5px; color: var(--dim); text-align: left; }
.class-bars i { height: 7px; background: rgba(0, 0, 0, .4); border-radius: 4px; position: relative; overflow: hidden; }
.class-bars i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--v); background: linear-gradient(90deg, #d99a2e, #ffe9a8); border-radius: 4px; }
#diff-row { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13.5px; }
.diff-btn { padding: 7px 18px !important; font-size: 14px !important; border-radius: 999px !important; }
.diff-btn.selected { background: #3d4a94 !important; border-color: var(--gold) !important; color: #fff !important; }
#diff-desc { min-width: 300px; text-align: left; }
#class-actions { display: flex; gap: 12px; margin-top: 16px; }
#class-actions .btn-main { padding: 12px 46px; font-size: 17px; }
#slot-list { display: flex; flex-direction: column; gap: 10px; width: 620px; margin-bottom: 14px; }
.slot-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: rgba(19, 23, 46, .92); border: 1px solid var(--line); border-radius: 14px; }
.slot-row.empty { opacity: .6; }
.slot-row canvas { width: 56px; height: 56px; flex: none; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #46508f, #1c2148); }
.slot-info { flex: 1; text-align: left; font-size: 13px; color: var(--dim); line-height: 1.5; }
.slot-info b { display: block; font-size: 16px; color: var(--text); }
.slot-num { flex: none; width: 60px; font-size: 12px; font-weight: 800; color: var(--gold); }
.slot-del { padding: 8px 10px !important; }
.controls-hint { position: absolute; bottom: 20px; left: 0; right: 0; margin: 0; text-align: center; font-size: 12.5px; color: #c9cfee; text-shadow: 0 1px 4px #000; }

/* ---------- 일시정지/설정 ---------- */
.pause-win { width: 760px; }
.pause-cols { display: flex; gap: 22px; padding: 20px; }
.pause-btns { flex: none; width: 230px; display: flex; flex-direction: column; gap: 9px; }
.settings { flex: 1; padding: 6px 16px; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; }
.set-row { display: flex; align-items: center; gap: 10px; height: 44px; border-bottom: 1px solid rgba(255, 255, 255, .06); font-size: 13.5px; }
.set-row label { width: 110px; flex: none; color: var(--dim); font-weight: 600; }
.set-row input[type=range] { flex: 1; accent-color: var(--gold); }
.set-row > span { width: 34px; text-align: right; font-weight: 700; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { padding: 6px 13px !important; font-size: 12.5px !important; background: transparent !important; border: 0 !important; border-radius: 0 !important; color: var(--dim) !important; }
.seg button.sel { background: #3d4a94 !important; color: #fff !important; }
.set-row .btn-sub { padding: 6px 14px !important; font-size: 12.5px !important; }
.set-note { padding: 10px 0 6px; font-size: 11.5px; color: var(--dim); }

/* ---------- 쓰러짐 ---------- */
#death-screen { position: absolute; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(90, 10, 20, .35), rgba(10, 0, 4, .9)); animation: fadeIn .8s ease-out; }
.death-title { font: 900 64px var(--serif); letter-spacing: .2em; color: #ff8a8a; text-shadow: 0 4px 20px #000; }
#death-sub { margin-top: 14px; font-size: 16px; color: #f0d0d0; }

/* ---------- 엔딩 ---------- */
#ending-screen { background: radial-gradient(ellipse at 50% 20%, rgba(60, 50, 110, .96), rgba(8, 8, 26, .98)); padding: 30px 0; }
#ending-head { margin: 0 0 12px; font: 900 54px var(--serif); letter-spacing: .14em; background: linear-gradient(#fff8dc, #f6cd62 60%, #c9822a); -webkit-background-clip: text; background-clip: text; color: transparent; }
#ending-text { width: 760px; max-height: 360px; overflow-y: auto; padding: 0 20px; font: 16.5px/1.9 var(--serif); text-align: center; white-space: pre-wrap; color: #f1ecd8; mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent); }
#ending-stats { margin: 16px 0; font-size: 13.5px; line-height: 1.7; text-align: center; color: var(--dim); }
.ending-btns { display: flex; gap: 12px; }

/* ---------- 확인/로딩/툴팁 ---------- */
#confirm-modal { z-index: 150 !important; }   /* 일시정지 창(120~130) 위에 떠야 "타이틀로" 확인을 누를 수 있음 */
.confirm-win { width: 440px; padding: 26px; text-align: center; }
#confirm-msg { margin-bottom: 20px; font-size: 16px; line-height: 1.6; white-space: pre-wrap; word-break: keep-all; }
#confirm-btns { display: flex; justify-content: center; gap: 12px; }
#loading { position: absolute; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #0b0d22; transition: opacity .4s; }
#loading.done { opacity: 0; pointer-events: none; }
.load-logo { font: 900 60px var(--serif); letter-spacing: .12em; color: var(--gold); }
.load-bar { width: 300px; height: 6px; margin: 22px 0 10px; background: #1c2148; border-radius: 3px; overflow: hidden; }
#load-fill { display: block; width: 0; height: 100%; background: var(--gold); transition: width .15s; }
#load-text { font-size: 13px; color: var(--dim); }
#tooltip { position: fixed; z-index: 200; max-width: 300px; padding: 9px 13px; font: 13px/1.5 var(--font); color: var(--text); background: rgba(10, 12, 30, .97); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); pointer-events: none; }
#tooltip b { color: var(--gold2); }
#tooltip .t2 { color: var(--dim); font-size: 12px; }

body.on-title #toasts { z-index: 70; }

/* ================= 몰입 연출 / 타격감 (immersion.js) ================= */
#combo { position: absolute; left: 34px; top: 136px; display: flex; align-items: baseline; gap: 6px; opacity: 0; transform: translateX(-16px); transition: opacity .25s, transform .25s; pointer-events: none; font-style: italic; }
#combo.show { opacity: 1; transform: none; }
#combo b { font-size: 46px; font-weight: 900; color: #fff3d0; -webkit-text-stroke: 2px rgba(40, 18, 8, .85); text-shadow: 0 4px 12px rgba(0, 0, 0, .6); }
#combo span { font-size: 16px; font-weight: 800; letter-spacing: 3px; color: #ffcf7a; text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
#combo.hot b { color: #ffb36a; text-shadow: 0 0 18px rgba(255, 120, 40, .8), 0 4px 12px rgba(0, 0, 0, .6); }
#combo.bump b { animation: comboBump .18s ease-out; }
@keyframes comboBump { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }

#boss-card { position: absolute; left: 0; right: 0; top: 60%; z-index: 38; pointer-events: none; opacity: 0; display: flex; flex-direction: column; align-items: center; transition: opacity .5s; }
#boss-card.show { opacity: 1; }
#boss-card .bc-sub { font-family: var(--serif); font-size: 17px; letter-spacing: 6px; color: #c9b8e8; opacity: 0; transform: translateY(8px); transition: opacity .6s .25s, transform .6s .25s; text-shadow: 0 2px 10px #000; }
#boss-card .bc-name { font-family: var(--serif); font-size: 56px; line-height: 1.25; font-weight: 800; letter-spacing: 10px; color: #f3ecff; opacity: 0; transform: scale(1.15); transition: opacity .5s .4s, transform .5s .4s cubic-bezier(.2, .8, .2, 1); text-shadow: 0 0 24px rgba(160, 90, 255, .8), 0 4px 18px #000; }
#boss-card .bc-line { width: 0; height: 2px; margin-top: 8px; background: linear-gradient(90deg, transparent, #b98aff, transparent); transition: width .8s .5s; }
#boss-card.show .bc-sub, #boss-card.show .bc-name { opacity: 1; transform: none; }
#boss-card.show .bc-line { width: 520px; }
#boss-card.super .bc-name { text-shadow: 0 0 24px rgba(255, 90, 90, .8), 0 4px 18px #000; }
#boss-card.super .bc-line { background: linear-gradient(90deg, transparent, #ff7a7a, transparent); }
body.cine #banner { opacity: 0 !important; }

/* 분위기가 짙을 때: 알림 문체도 무겁게 */
body.grim .toast { background: rgba(8, 6, 14, .92); border-color: rgba(150, 110, 200, .35); border-radius: 3px; color: #ddd4ea; font-family: var(--serif); letter-spacing: 1px; }
body.grim .toast.gold { color: #e9d6a8; border-color: rgba(200, 160, 90, .45); }
body.grim #banner, body.grim .banner { font-family: var(--serif); }

/* ===== v3.2 UI 수정 ===== */
/* 타이틀 '설정' 버튼이 투명해 보이던 문제: 다른 메뉴 버튼과 같은 면을 갖도록 */
#title-buttons #btn-title-settings { background: rgba(19, 23, 46, .88) !important; border: 1px solid var(--line2) !important; color: var(--text) !important; }
#title-buttons #btn-title-settings:hover { border-color: var(--gold) !important; color: var(--gold2) !important; }
/* 설정창이 타이틀 화면 뒤에 열리던 문제 */
#pause-screen { z-index: 60; }
/* 새 게임·이어하기 패널: 로고를 실제로 작게 만들어(변형 대신) 아래로 쏠리지 않게 */
#title-screen.sub { justify-content: center; padding-bottom: 46px; }
#title-screen.sub .title-logo { transform: none; margin-bottom: 14px; }
#title-screen.sub .title-logo h1 { font-size: 56px; margin: 0; }
#title-screen.sub .logo-sub { font-size: 11px; }
#title-screen.sub .subtitle { display: none; }
#title-screen.sub .controls-hint { display: none; }

/* ===== v3.2 UI 수정 ===== */
/* 타이틀 '설정' 버튼이 투명하게 보이던 문제 */
#title-buttons #btn-title-settings { background: rgba(14, 18, 42, .86) !important; border: 1px solid rgba(246, 205, 98, .45) !important; color: #efe3c4 !important; backdrop-filter: blur(4px); }
#title-buttons #btn-title-settings:hover { background: rgba(28, 34, 70, .92) !important; color: #fff3cf !important; }
/* 설정창이 타이틀 화면 뒤에 열리던 문제: 항상 맨 앞 + 뒤 화면을 확실히 가림 */
#pause-screen { z-index: 120 !important; background: rgba(6, 8, 20, .62); backdrop-filter: blur(3px); }
body.on-title #pause-screen { z-index: 130 !important; }
body.settings-open #title-buttons, body.settings-open #newgame-panel, body.settings-open #slot-panel { visibility: hidden; }
/* 새 게임 화면: 전체가 아래로 쏠려 '모험 시작'과 키 안내가 붙던 문제 */
#title-screen.sub { justify-content: flex-start !important; padding-top: 34px; padding-bottom: 64px !important; }
#title-screen.sub .title-logo { margin-bottom: 6px !important; }
#title-screen.sub .title-logo h1 { font-size: 46px !important; }
#title-screen.sub .class-card { padding: 10px 14px 12px; }
#title-screen.sub .ng-step { margin-bottom: 8px; }
#newgame-panel .ng-actions, #newgame-panel > div:last-child { margin-bottom: 8px; }
#title-screen .controls-hint { position: absolute; left: 0; right: 0; bottom: 12px; margin: 0; text-align: center; }

/* 플레이 기록 창 (js/playlog.js) */
#playlog-panel { position: absolute; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; background: rgba(6, 8, 20, .7); }
#playlog-panel.show { display: flex; }
#playlog-panel .pl-win { width: 640px; max-height: 80%; display: flex; flex-direction: column; background: #151a36; border: 1px solid rgba(246, 205, 98, .45); border-radius: 14px; padding: 16px 18px; box-shadow: 0 18px 50px rgba(0, 0, 0, .6); color: #e8e4f4; }
#playlog-panel .pl-head { font-weight: 800; font-size: 16px; color: #ffe9a8; margin-bottom: 10px; }
#playlog-panel .pl-head span { font-weight: 500; font-size: 11px; color: #aab; margin-left: 8px; }
#playlog-panel .pl-body { flex: 1; overflow: auto; margin: 0; padding: 10px 12px; background: rgba(0, 0, 0, .3); border-radius: 8px; font: 12.5px/1.6 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; user-select: text; }
#playlog-panel .pl-btns { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }
#playlog-panel button { padding: 7px 16px; border-radius: 8px; border: 1px solid rgba(246, 205, 98, .5); background: #232a55; color: #ffe9a8; font-weight: 700; cursor: pointer; }
#playlog-panel .pl-copy { background: linear-gradient(#f6cd62, #d9a43a); color: #2a1a00; }
#playlog-panel .pl-note { margin-top: 8px; font-size: 11px; color: #aab; }

/* ===== 장별 그래픽 상승 (js/features/gfx_rise.js) ===== */
.ai-icon { display: inline-block; width: 1.6em; height: 1.6em; background-repeat: no-repeat; vertical-align: middle; }
body.title-hd #title-screen { background: radial-gradient(ellipse 60% 55% at 50% 48%, rgba(8, 10, 30, .45), rgba(8, 10, 30, .1) 70%), linear-gradient(rgba(8, 10, 30, .2), rgba(8, 10, 30, 0) 35%, rgba(8, 10, 30, .75)), url('assets/bg/title.jpg') center / cover no-repeat; }
body:not(.fake-end) #ending-screen { background: linear-gradient(rgba(8, 8, 26, .55), rgba(8, 8, 26, .82)), url('assets/bg/ending.jpg') center / cover no-repeat; }
#chapter-card { position: absolute; inset: 0; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .7s ease; background: #000 center / cover no-repeat; display: flex; align-items: flex-end; justify-content: center; }
#chapter-card.show { opacity: 1; }
#chapter-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,0,0,0) 45%, rgba(0,0,0,.7)); }
#chapter-card .cc-in { position: relative; margin-bottom: 70px; text-align: center; color: #fff3d0; text-shadow: 0 3px 18px rgba(0,0,0,.9); }
#chapter-card .cc-n { font-size: 20px; letter-spacing: 8px; opacity: .85; }
#chapter-card .cc-t { font-size: 46px; font-weight: 900; letter-spacing: 6px; margin-top: 6px; }

/* ===== 보스 결과 카드 (js/features/dopamine.js) ===== */
#boss-card { position: absolute; left: 50%; top: 24%; transform: translate(-50%, -20px) scale(.9); z-index: 70; pointer-events: none; opacity: 0;
  min-width: 360px; padding: 16px 26px 18px; text-align: center; border-radius: 16px; background: rgba(12, 12, 30, .9);
  border: 1px solid rgba(255, 215, 94, .55); box-shadow: 0 16px 50px rgba(0,0,0,.6), 0 0 40px rgba(255, 210, 62, .18); transition: opacity .35s, transform .35s cubic-bezier(.2, 1.4, .4, 1); }
#boss-card.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#boss-card .bc-name { font-size: 18px; font-weight: 800; color: #fff3d0; letter-spacing: 1px; }
#boss-card .bc-grade { font-size: 64px; font-weight: 900; line-height: 1.05; text-shadow: 0 0 24px currentColor; margin: 4px 0 6px; }
#boss-card .bc-rows { display: flex; gap: 14px; justify-content: center; font-size: 13px; color: #d8dcf0; }

/* ===== v4.7 ===== */
.true-end-badge { display: inline-block; font-size: 15px; letter-spacing: 6px; color: #fff3c8; padding: 3px 16px; border-radius: 14px; background: linear-gradient(90deg, rgba(246,205,98,0), rgba(246,205,98,.35), rgba(246,205,98,0)); text-shadow: 0 0 12px #ffd75e; animation: teGlow 2.4s ease-in-out infinite; }
@keyframes teGlow { 50% { text-shadow: 0 0 24px #ffd75e, 0 0 4px #fff; } }
.pg-call { margin: 14px auto 10px; max-width: 560px; padding: 12px 18px; border-radius: 14px; text-align: center; background: radial-gradient(ellipse at center, rgba(255,215,94,.18), rgba(255,215,94,.03)); border: 1px solid rgba(255,215,94,.55); box-shadow: 0 0 30px rgba(255,215,94,.25); animation: pgCall 2.6s ease-in-out infinite; }
.pg-call b { display: block; font-size: 18px; color: #ffe9a8; margin-bottom: 6px; text-shadow: 0 0 14px rgba(255,215,94,.8); }
.pg-call span { font-size: 13px; line-height: 1.6; color: #f0ead8; }
.pg-call em { font-style: normal; color: #ffd75e; font-weight: 800; }
@keyframes pgCall { 50% { box-shadow: 0 0 46px rgba(255,215,94,.5); } }
.pg-glow { position: relative; background: linear-gradient(90deg, #8a5a10, #f6cd62, #8a5a10) !important; background-size: 200% 100% !important; color: #2a1a00 !important; font-weight: 900 !important; border: 1px solid #fff3c8 !important; box-shadow: 0 0 22px rgba(255,215,94,.75) !important; animation: pgShine 2.2s linear infinite, pgPulse 1.6s ease-in-out infinite; }
.pg-glow small { display: block; font-size: 11px; font-weight: 700; opacity: .85; }
@keyframes pgShine { to { background-position: -200% 0; } }
@keyframes pgPulse { 50% { box-shadow: 0 0 38px rgba(255,215,94,1); transform: scale(1.03); } }

/* ===== 모바일 조작 (v4.7) ===== */
#mobile-ctl { position: fixed; inset: 0; z-index: 90; pointer-events: none; user-select: none; -webkit-user-select: none; touch-action: none; }
#mobile-ctl .mc-stick { position: absolute; left: calc(18px + env(safe-area-inset-left)); bottom: 22px; width: 132px; height: 132px; border-radius: 50%; background: radial-gradient(rgba(255,255,255,.10), rgba(255,255,255,.04)); border: 2px solid rgba(255,255,255,.28); pointer-events: auto; touch-action: none; }
#mobile-ctl .mc-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255,255,255,.32); border: 2px solid rgba(255,255,255,.55); box-shadow: 0 4px 12px rgba(0,0,0,.35); }
#mobile-ctl .mc-btns { position: absolute; right: calc(16px + env(safe-area-inset-right)); bottom: 18px; width: 206px; height: 190px; pointer-events: none; }
#mobile-ctl .mc-b { position: absolute; width: 50px; height: 50px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); background: rgba(20,24,48,.55); color: #fff; font: 800 17px sans-serif; pointer-events: auto; touch-action: none; padding: 0; }
#mobile-ctl .mc-b.on { background: rgba(255,215,94,.55); transform: scale(.94); }
#mobile-ctl .mc-b.big { width: 78px; height: 78px; font-size: 30px; right: 4px; bottom: 6px; background: rgba(200,70,60,.55); }
#mobile-ctl .mc-b:nth-child(2) { right: 92px; bottom: 0; } #mobile-ctl .mc-b:nth-child(3) { right: 86px; bottom: 58px; }
#mobile-ctl .mc-b:nth-child(4) { right: 34px; bottom: 92px; } #mobile-ctl .mc-b:nth-child(5) { right: 146px; bottom: 34px; }
#mobile-ctl .mc-b:nth-child(6) { right: 140px; bottom: 92px; } #mobile-ctl .mc-b:nth-child(7) { right: 88px; bottom: 132px; }
#mobile-ctl .mc-b:nth-child(8) { right: 30px; bottom: 148px; } #mobile-ctl .mc-b:nth-child(9) { right: 146px; bottom: 148px; }
#mobile-ctl .mc-menu { position: absolute; right: calc(10px + env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#mobile-ctl .mc-m { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.3); background: rgba(20,24,48,.6); font-size: 18px; pointer-events: auto; padding: 0; }
body.mobile-ctl #hint-bar { display: none !important; }
body.mobile-ctl { touch-action: none; overscroll-behavior: none; }
@media (orientation: portrait) { body.mobile-ctl::after { content: '📱 가로로 돌려 주세요'; position: fixed; left: 0; right: 0; top: 8px; text-align: center; z-index: 200; color: #fff; font: 700 14px sans-serif; text-shadow: 0 1px 4px #000; pointer-events: none; } }
#look-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 4px; }

/* 영어 모드에선 큰 제목이 이미 영문이라 위 작은 영문 부제는 숨김 */
html[lang=en] .logo-sub { display: none; }

/* 영어 제목: 굵은 글꼴 + 좁은 자간 (가는 세리프가 길고 얇아 보이던 문제) */
html[lang=en] #title-screen h1 { font-family: Georgia, 'Times New Roman', serif; font-weight: 900; font-size: clamp(44px, 7.4vw, 88px); letter-spacing: -0.015em; -webkit-text-stroke: 2.2px #f3c55c; white-space: nowrap; }
html[lang=en] #ending-head { font-family: Georgia, 'Times New Roman', serif; font-weight: 900; letter-spacing: -0.01em; -webkit-text-stroke: 1.4px #f3c55c; }
html[lang=en] .load-logo { font-family: Georgia, 'Times New Roman', serif; font-weight: 900; letter-spacing: -0.01em; }
