:root { --gold: #e8c27a; --gold2: #b8873a; --ember: #ff7a2a; --ink: #120a06; --panel: rgba(18, 11, 7, 0.82); --line: rgba(232, 194, 122, 0.35); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; font-family: 'Cormorant Garamond', Georgia, serif; color: #f1e6d0; user-select: none; -webkit-user-select: none; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#hud, #dmg-layer, #fade, #banner, #prompt { pointer-events: none !important; }
.hidden { display: none !important; }
button { font-family: inherit; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.screen.dim { background: radial-gradient(ellipse at center, rgba(10, 6, 3, 0.72), rgba(0, 0, 0, 0.9)); backdrop-filter: blur(3px); }
#loading { background: radial-gradient(ellipse at 50% 60%, #2a1308 0%, #0b0604 60%, #000 100%); z-index: 50; transition: opacity 0.9s; }
#loading.fade { opacity: 0; }
.load-inner { text-align: center; width: min(520px, 86vw); }
.logo { font-family: 'Cinzel', serif; font-weight: 900; letter-spacing: 0.22em; font-size: 54px; color: transparent; background: linear-gradient(180deg, #fff2c8 0%, #f0b45a 45%, #b2481a 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 18px rgba(255, 120, 30, 0.45)) drop-shadow(0 3px 0 rgba(0, 0, 0, 0.6)); }
.logo.big { font-size: clamp(54px, 9vw, 120px); }
.sub { font-style: italic; font-size: 20px; color: #d8b98a; margin: 6px 0 28px; }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a2361a, #ff8a3a, #ffd48a); box-shadow: 0 0 12px #ff8a3a; transition: width 0.3s; }
.loadtxt { margin-top: 12px; font-family: 'Cinzel'; font-size: 13px; letter-spacing: 0.12em; color: #c9a77a; }
.tip { margin-top: 40px; font-style: italic; font-size: 18px; color: #bfa98a; min-height: 2em; }
#title { background: linear-gradient(180deg, rgba(0, 0, 0, 0.0) 40%, rgba(0, 0, 0, 0.65) 100%), radial-gradient(ellipse at 50% 30%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.5) 100%); }
.title-wrap { text-align: center; margin-top: -6vh; animation: rise 1.6s ease-out; }
.tagline { font-style: italic; font-size: 24px; color: #f4dcae; text-shadow: 0 2px 8px #000; margin: 4px 0 40px; }
.menu { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.mbtn { min-width: 260px; padding: 11px 26px; font-family: 'Cinzel'; font-weight: 700; font-size: 17px; letter-spacing: 0.14em; color: #f5e2bc; background: linear-gradient(180deg, rgba(60, 32, 16, 0.85), rgba(26, 13, 7, 0.9)); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; text-transform: uppercase; transition: all 0.18s; box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.12), 0 4px 18px rgba(0, 0, 0, 0.4); }
.mbtn:hover { color: #fff; border-color: var(--gold); background: linear-gradient(180deg, rgba(120, 52, 18, 0.9), rgba(52, 20, 8, 0.95)); box-shadow: 0 0 18px rgba(255, 130, 40, 0.45), inset 0 1px 0 rgba(255, 220, 160, 0.25); transform: translateY(-1px); }
.foot { margin-top: 36px; font-size: 15px; color: #c8b090; opacity: 0.8; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.panel-c { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 28px 34px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; min-width: 320px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7); }
.panel-c.wide { width: min(760px, 92vw); }
.panel-c.scroll { max-height: 86vh; overflow-y: auto; }
.panel-c h2 { font-family: 'Cinzel'; text-align: center; margin: 0 0 6px; color: var(--gold); letter-spacing: 0.15em; }
.panel-c h3 { font-family: 'Cinzel'; color: #e2b77a; margin: 12px 0 2px; font-size: 15px; letter-spacing: 0.1em; }
.panel-c p { margin: 2px 0 6px; font-size: 17px; line-height: 1.35; }
.panel-c a { color: #ffc27a; }
.panel-c label { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 19px; }
.panel-c label.chk { justify-content: flex-start; }
.panel-c select, .panel-c input[type=range] { width: 52%; accent-color: var(--ember); background: #1e120a; color: #f1e6d0; border: 1px solid var(--line); padding: 4px; font-family: inherit; font-size: 16px; }
.note { font-size: 15px; font-style: italic; color: #b9a283; }
.ctrl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 26px; font-size: 18px; }
.ctrl-grid b { display: inline-block; min-width: 140px; font-family: 'Cinzel'; font-size: 14px; color: var(--gold); }
.cr-lead { text-align: center; font-size: 19px !important; }
.cr-thanks { text-align: center; font-style: italic; margin-top: 18px !important; font-size: 20px !important; color: var(--gold); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; font-family: 'Cinzel'; }
#bars { position: absolute; left: 34px; bottom: 34px; width: 330px; }
.lvl { position: absolute; left: -12px; top: -14px; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 17px; color: #ffe2a8; background: radial-gradient(circle at 40% 35%, #6a3a18, #200e05); border: 2px solid var(--gold2); box-shadow: 0 0 12px rgba(255, 140, 40, 0.5); z-index: 2; }
.bar-row { margin-left: 34px; margin-bottom: 5px; }
.hbar { position: relative; height: 13px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(232, 194, 122, 0.45); border-radius: 2px; overflow: hidden; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.hbar.hp { height: 18px; }
.hbar i { display: block; height: 100%; transition: width 0.15s; }
.hbar.hp i { background: linear-gradient(180deg, #e2544a, #9c1d1a 60%, #6e100e); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.hbar.st i { background: linear-gradient(180deg, #d8c46a, #8a7a26); width: 100%; }
.hbar.mp i { background: linear-gradient(180deg, #5a9cff, #1d3f96); }
.hbar.st { width: 82%; height: 8px; } .hbar.mp { width: 70%; height: 8px; }
.hbar b { position: absolute; inset: 0; font-size: 11px; display: flex; align-items: center; justify-content: center; color: #fff; text-shadow: 0 1px 2px #000; font-weight: 700; letter-spacing: 0.05em; }
.hbar.low { animation: pulse-red 0.8s infinite; }
.hbar.flash { animation: flash 0.4s 2; }
@keyframes pulse-red { 50% { box-shadow: 0 0 14px #ff2a1a; } }
@keyframes flash { 50% { box-shadow: 0 0 10px #fff; border-color: #fff; } }
.xpbar { margin: 7px 0 0 34px; height: 3px; background: rgba(0, 0, 0, 0.5); width: 92%; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #b68a2a, #ffe08a); box-shadow: 0 0 6px #ffd06a; width: 0; transition: width 0.4s; }
#quick { position: absolute; right: 34px; bottom: 34px; display: flex; gap: 10px; align-items: flex-end; }
.slot { position: relative; width: 58px; height: 58px; border-radius: 6px; background: radial-gradient(circle at 50% 35%, rgba(70, 40, 20, 0.9), rgba(16, 9, 5, 0.92)); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 26px; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
.slot .key { position: absolute; left: 4px; top: 2px; font-size: 11px; color: var(--gold); }
.slot .cnt { position: absolute; right: 5px; bottom: 2px; font-size: 14px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
.slot .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.65); height: 0; }
.slot.locked { opacity: 0.25; filter: grayscale(1); }
.gold { display: flex; align-items: center; gap: 6px; font-size: 18px; color: #ffd98a; padding: 0 0 6px 8px; text-shadow: 0 1px 3px #000; }
.coin { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2b0, #e2a52a 50%, #8a5a10); box-shadow: 0 0 8px rgba(255, 200, 80, 0.6); }
#compass { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 440px; height: 34px; overflow: hidden; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.5) 20%, rgba(0, 0, 0, 0.5) 80%, transparent); -webkit-mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
#compass-strip { position: absolute; left: 50%; top: 0; height: 100%; }
.ctick { position: absolute; top: 9px; transform-origin: center; width: 30px; margin-left: -15px; text-align: center; font-size: 11px; color: rgba(240, 220, 180, 0.6); }
.ctick.major { font-size: 15px; font-weight: 700; color: #f6e4bc; top: 7px; }
.compass-needle { position: absolute; left: 50%; top: 0; width: 2px; height: 7px; background: var(--ember); margin-left: -1px; }
.cmark { position: absolute; left: 50%; top: 2px; width: 40px; margin-left: -20px; text-align: center; line-height: 1; }
.cmark b { display: block; font-size: 16px; }
.cmark span { font-size: 9px; color: #fff; }
.cmark.quest b { color: #ffd36a; text-shadow: 0 0 8px #ff9a2a; }
.cmark.shrine b { color: #888; font-size: 12px; } .cmark.shrine.lit b { color: #ff9a3a; }
#area-name { position: absolute; top: 22%; left: 0; right: 0; text-align: center; font-size: 40px; letter-spacing: 0.3em; color: #f7e6c4; text-shadow: 0 0 20px rgba(0, 0, 0, 0.9), 0 2px 4px #000; opacity: 0; font-weight: 700; }
#area-name::after { content: attr(data-fps); position: fixed; left: 8px; top: 6px; font-size: 12px; letter-spacing: 0; opacity: 0.8; }
#area-name.show { animation: area 4.5s ease-in-out; }
@keyframes area { 0% { opacity: 0; letter-spacing: 0.5em; } 18% { opacity: 1; letter-spacing: 0.3em; } 75% { opacity: 1; } 100% { opacity: 0; } }
#quest { position: absolute; right: 34px; top: 230px; width: 300px; text-align: right; text-shadow: 0 1px 3px #000, 0 0 10px rgba(0, 0, 0, 0.8); }
.qt { font-size: 15px; font-weight: 700; color: var(--gold); letter-spacing: 0.08em; }
.qt::before { content: '◆ '; color: #ffd36a; }
.qd { font-family: 'Cormorant Garamond'; font-size: 18px; color: #f3e8d4; margin-top: 3px; }
.qc { color: #ffd36a; }
#quest.pulse { animation: qpulse 1.2s; }
@keyframes qpulse { 0% { transform: translateX(20px); opacity: 0; } 100% { transform: none; opacity: 1; } }
#minimap { position: absolute; right: 30px; top: 30px; width: 180px; height: 180px; }
#minimap canvas { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6)); }
.mm-time { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 12px; color: #e8d2a8; text-shadow: 0 1px 2px #000; }
#boss { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); width: min(720px, 80vw); text-align: center; animation: rise 0.8s; }
.bname { font-size: 20px; letter-spacing: 0.15em; color: #ffe0b0; text-shadow: 0 2px 6px #000; margin-bottom: 6px; }
.bbar { position: relative; height: 14px; background: rgba(0, 0, 0, 0.65); border: 1px solid rgba(232, 160, 100, 0.6); }
.bbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #ff6a2a, #a8180c); z-index: 2; transition: width 0.1s; box-shadow: 0 0 12px rgba(255, 90, 20, 0.7); }
.bbar s { position: absolute; left: 0; top: 0; bottom: 0; background: #ffd9a0; width: 100%; z-index: 1; }
#prompt { position: absolute; left: 50%; bottom: 26%; transform: translateX(-50%); font-family: 'Cormorant Garamond'; font-size: 22px; color: #fff; text-shadow: 0 1px 3px #000, 0 0 12px rgba(0, 0, 0, 0.8); white-space: nowrap; }
kbd { display: inline-block; font-family: 'Cinzel'; font-size: 13px; font-weight: 700; padding: 2px 8px; margin-right: 6px; border-radius: 3px; color: var(--ink); background: linear-gradient(180deg, #ffe7b5, #d39a4a); box-shadow: 0 2px 0 #7a4a18; }
#toasts { position: absolute; left: 34px; bottom: 150px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.toast { font-family: 'Cormorant Garamond'; font-size: 19px; padding: 5px 14px; background: linear-gradient(90deg, rgba(20, 12, 6, 0.85), rgba(20, 12, 6, 0)); border-left: 3px solid var(--gold2); animation: tin 0.3s; transition: all 0.5s; }
.toast.out { opacity: 0; transform: translateX(-20px); }
.toast.gold { border-color: #ffd36a; color: #ffe08a; } .toast.xp { border-color: #9ad0ff; color: #cfe8ff; } .toast.warn { border-color: #d9542a; color: #ffbfa0; } .toast.good { border-color: #6ad06a; color: #d6ffd0; } .toast.boss { border-color: #ff3a1a; color: #ffb090; font-size: 22px; } .toast.info { border-color: #e8c27a; }
@keyframes tin { from { opacity: 0; transform: translateX(-20px); } }
#lockon { position: fixed; left: 0; top: 0; width: 34px; height: 34px; border: 2px solid rgba(255, 220, 160, 0.9); border-radius: 50%; box-shadow: 0 0 10px rgba(255, 150, 60, 0.8); pointer-events: none; }
#lockon::after { content: ''; position: absolute; inset: 12px; background: #ffd9a0; border-radius: 50%; }
#banner { position: fixed; top: 30%; left: 0; right: 0; text-align: center; opacity: 0; pointer-events: none; }
#banner.show { animation: banner 3.6s ease-in-out forwards; }
#banner .b1 { font-family: 'Cinzel'; font-weight: 900; font-size: clamp(30px, 5vw, 58px); letter-spacing: 0.2em; color: transparent; background: linear-gradient(180deg, #fff3d0, #f0b45a 55%, #b2481a); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 16px rgba(255, 110, 20, 0.55)) drop-shadow(0 2px 2px #000); }
#banner .b2 { font-style: italic; font-size: 24px; color: #f4e0bc; text-shadow: 0 2px 6px #000; margin-top: 4px; }
#banner::before, #banner::after { content: ''; display: block; height: 1px; width: 40%; margin: 10px auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
@keyframes banner { 0% { opacity: 0; transform: scale(1.06); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
#dmg-layer { position: fixed; inset: 0; overflow: hidden; }
.dmg { position: absolute; left: 0; top: 0; font-family: 'Cinzel'; font-weight: 900; font-size: 22px; color: #fff3d6; text-shadow: 0 0 6px #ff7a1a, 0 2px 2px #000; will-change: transform; }
.dmg.crit { font-size: 32px; color: #ffd24a; text-shadow: 0 0 12px #ff3a00, 0 2px 2px #000; }
.dmg.player { color: #ff5a4a; font-size: 20px; text-shadow: 0 2px 2px #000; }
.bubble { position: absolute; left: 0; top: 0; max-width: 280px; padding: 7px 12px; background: rgba(16, 10, 6, 0.82); border: 1px solid var(--line); border-radius: 6px; font-size: 17px; text-align: center; color: #f6ead6; }
.bubble b { display: block; font-family: 'Cinzel'; font-size: 11px; color: var(--gold); letter-spacing: 0.1em; }
/* dialogue */
#dialogue { position: fixed; left: 50%; bottom: 6vh; transform: translateX(-50%); width: min(900px, 92vw); padding: 22px 34px 18px; background: linear-gradient(180deg, rgba(20, 12, 7, 0.88), rgba(10, 6, 3, 0.94)); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7); animation: rise 0.3s; }
#dialogue::before { content: ''; position: absolute; left: 20px; right: 20px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.dname { font-family: 'Cinzel'; font-weight: 700; font-size: 18px; color: var(--gold); letter-spacing: 0.12em; margin-bottom: 8px; }
.dtext { font-size: 23px; line-height: 1.4; min-height: 3em; color: #f5ecdc; }
.dopts { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.dopt { text-align: left; background: rgba(255, 220, 160, 0.06); border: 1px solid transparent; color: #f6e2bc; font-size: 20px; padding: 6px 12px; cursor: pointer; border-radius: 3px; }
.dopt:hover { border-color: var(--line); background: rgba(255, 160, 60, 0.15); color: #fff; }
.dopt i { font-style: normal; font-family: 'Cinzel'; font-size: 13px; color: var(--ink); background: var(--gold); padding: 1px 6px; border-radius: 2px; margin-right: 8px; }
.dhint { text-align: right; font-size: 14px; color: #b89a6a; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
/* death */
#death { background: radial-gradient(ellipse at center, rgba(60, 0, 0, 0.45), rgba(0, 0, 0, 0.92)); flex-direction: column; gap: 14px; animation: fadein 1.5s; }
.death-txt { font-family: 'Cinzel'; font-weight: 900; font-size: clamp(40px, 7vw, 86px); color: #b3261a; letter-spacing: 0.18em; text-shadow: 0 0 30px rgba(255, 30, 0, 0.5); }
.death-sub { font-style: italic; font-size: 24px; color: #d8b08a; margin-bottom: 20px; }
@keyframes fadein { from { opacity: 0; } }
#fade { position: fixed; inset: 0; background: #000; opacity: 1; transition: opacity 1.4s; }
#fade.out { opacity: 0; }
#map canvas { width: min(84vh, 92vw); height: min(84vh, 92vw); border: 2px solid var(--gold2); box-shadow: 0 0 60px rgba(0, 0, 0, 0.9); border-radius: 4px; }
.map-close { position: absolute; bottom: 3vh; font-family: 'Cinzel'; color: var(--gold); font-size: 14px; }
#victory { background: radial-gradient(ellipse at center, rgba(40, 18, 6, 0.75), rgba(0, 0, 0, 0.95)); overflow-y: auto; align-items: flex-start; padding: 6vh 0; }
.vic-inner { width: min(760px, 92vw); margin: auto; text-align: center; animation: rise 2s; }
.vic-sub { font-size: 26px; font-style: italic; color: #f6dcae; }
.vic-stats { font-family: 'Cinzel'; color: var(--gold); margin: 14px 0 26px; }
.vic-credits h2 { font-family: 'Cinzel'; color: var(--gold); } .vic-credits h3 { font-family: 'Cinzel'; color: #e2b77a; font-size: 15px; } .vic-credits p { font-size: 17px; } .vic-credits a { color: #ffc27a; }
/* touch */
#touch { position: fixed; inset: 0; pointer-events: none; }
#stick { position: absolute; left: 40px; bottom: 60px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); border: 2px solid rgba(255, 220, 160, 0.3); pointer-events: auto; }
#stick i { position: absolute; left: 40px; top: 40px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 210, 150, 0.35); }
.tbtns { position: absolute; right: 24px; bottom: 40px; display: grid; grid-template-columns: repeat(4, 62px); gap: 10px; pointer-events: auto; }
.tbtns button { width: 62px; height: 62px; border-radius: 50%; font-size: 24px; color: #fff; background: rgba(40, 20, 10, 0.55); border: 2px solid rgba(255, 210, 150, 0.4); }
@media (max-width: 900px) { #bars { width: 230px; left: 18px; bottom: 210px; } #quick { right: 18px; bottom: 200px; } #minimap { transform: scale(0.7); transform-origin: top right; right: 10px; top: 10px; } #quest { top: 150px; right: 14px; width: 220px; } #compass { width: 300px; } .logo.big { letter-spacing: 0.1em; } }
