@font-face { font-family: 'Cinzel'; font-weight: 400; src: url('assets/fonts/cinzel-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Cinzel'; font-weight: 700; src: url('assets/fonts/cinzel-latin-700-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Crimson'; font-weight: 400; src: url('assets/fonts/crimson-pro-latin-400-normal.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Crimson'; font-weight: 600; src: url('assets/fonts/crimson-pro-latin-600-normal.woff2') format('woff2'); font-display: swap; }

:root {
  --gold: #d9b56a; --gold2: #8a6a2c; --bone: #e8dcc0; --dim: #9c9179; --ink: #0b0a08;
  --warden: #e39a3c; --wild: #6fcf5a; --storm: #7d8cff;
  --hp: #c22a22; --mana: #2a5fd0; --ward: #6fe3ff;
  --panel: rgba(14, 12, 9, 0.94);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #050505; color: var(--bone); overflow: hidden; font-family: 'Crimson', Georgia, serif; font-size: 17px; user-select: none; -webkit-user-select: none; }
#view, #overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#overlay { pointer-events: none; }
.hidden { display: none !important; }
h1, h2, h3, .cz { font-family: 'Cinzel', serif; font-weight: 700; letter-spacing: 0.06em; }
#err { position: fixed; left: 8px; bottom: 8px; color: #ff7a6a; font: 12px monospace; white-space: pre-wrap; z-index: 99; max-width: 60vw; pointer-events: none; }
#ver { position: fixed; right: 8px; top: 6px; font: 11px 'Cinzel', serif; color: rgba(232, 220, 192, 0.45); z-index: 60; pointer-events: none; }

/* ---------- loading ---------- */
#loading { position: fixed; inset: 0; background: radial-gradient(ellipse at center, #14110c 0%, #030303 75%); display: flex; align-items: center; justify-content: center; z-index: 80; }
.loadBox { text-align: center; width: 360px; }
.loadTitle { font: 700 54px 'Cinzel', serif; letter-spacing: 0.2em; color: #c9632b; text-shadow: 0 0 24px rgba(255, 90, 20, 0.5); }
#loadText { color: var(--dim); margin: 10px 0 14px; font-style: italic; }
.loadBar { height: 6px; background: #1c1812; border: 1px solid #3a3020; border-radius: 3px; overflow: hidden; }
#loadFill { height: 100%; width: 0%; background: linear-gradient(90deg, #7a3d12, #f0a04a); transition: width 0.2s; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 20; zoom: var(--ui, 1); }
#topleft { position: absolute; left: 16px; top: 12px; text-shadow: 0 1px 3px #000, 0 0 8px #000; }
#zoneName { font: 700 20px 'Cinzel', serif; color: var(--gold); letter-spacing: 0.08em; }
#heroLine { color: var(--bone); font-size: 15px; opacity: 0.9; }
#petList { margin-top: 6px; display: flex; gap: 6px; }
.petChip { display: flex; align-items: center; gap: 5px; background: rgba(10, 9, 7, 0.7); border: 1px solid #3b3222; border-radius: 4px; padding: 2px 7px 2px 2px; font-size: 13px; }
.petChip img { width: 24px; height: 24px; border-radius: 3px; }
.petChip.none { opacity: 0.45; }

#targetFrame, #bossFrame { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; text-shadow: 0 1px 3px #000; }
#targetFrame { top: 14px; width: 300px; }
#bossFrame { top: 60px; width: 520px; }
#targetName { font: 700 15px 'Cinzel', serif; margin-bottom: 3px; }
#targetName.elite { color: #ffd54a; } #targetName.boss { color: #ff6a4a; }
#bossName { font: 700 20px 'Cinzel', serif; color: #ff7a52; letter-spacing: 0.1em; margin-bottom: 4px; }
.bar { height: 10px; background: rgba(0, 0, 0, 0.7); border: 1px solid #5a4a2a; border-radius: 2px; overflow: hidden; }
#bossFrame .bar { height: 16px; border-color: #8a5a2a; }
#targetHp, #bossHp { height: 100%; width: 100%; background: linear-gradient(180deg, #e2463a, #8a1712); transition: width 0.12s; }

#minimap { position: absolute; right: 14px; top: 24px; width: 200px; height: 200px; border: 1px solid #4a3d24; border-radius: 4px; background: rgba(6, 6, 5, 0.6); box-shadow: 0 0 12px rgba(0, 0, 0, 0.6); }

#toasts { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; background: linear-gradient(180deg, rgba(28, 23, 15, 0.95), rgba(12, 10, 7, 0.95)); border: 1px solid var(--gold2); border-radius: 6px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 18px rgba(217, 181, 106, 0.15); animation: toastIn 0.3s ease-out, toastOut 0.5s ease-in forwards; animation-delay: 0s, var(--life, 4s); max-width: 560px; }
.toast img { width: 52px; height: 52px; border-radius: 5px; border: 1px solid #5a4a2a; }
.toast .t1 { font: 700 17px 'Cinzel', serif; color: var(--gold); }
.toast .t2 { font-size: 15px; color: var(--bone); }
.toast.plain { padding: 6px 16px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

#levelBanner { position: absolute; left: 50%; bottom: 190px; transform: translateX(-50%); font: 700 20px 'Cinzel', serif; color: #ffe08a; padding: 8px 22px; background: rgba(20, 16, 8, 0.85); border: 1px solid var(--gold); border-radius: 6px; animation: pulse 1.2s ease-in-out infinite; text-shadow: 0 0 10px rgba(255, 200, 80, 0.6); }
@keyframes pulse { 50% { box-shadow: 0 0 26px rgba(255, 200, 80, 0.55); transform: translateX(-50%) scale(1.04); } }
#prompt { position: absolute; left: 50%; bottom: 240px; transform: translateX(-50%); font-size: 18px; padding: 6px 16px; background: rgba(10, 9, 7, 0.8); border: 1px solid #5a4a2a; border-radius: 5px; }
kbd, .kbd { display: inline-block; min-width: 24px; text-align: center; font: 700 13px 'Cinzel', serif; padding: 2px 6px; margin: 0 2px; color: #1a1408; background: linear-gradient(180deg, #f0deb0, #b89a5a); border-radius: 4px; box-shadow: 0 2px 0 #5a4520; }
#log { position: absolute; left: 16px; bottom: 150px; width: 380px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; text-shadow: 0 1px 2px #000, 0 0 6px #000; }
#log div { animation: logFade 7s forwards; }
@keyframes logFade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
#hint { position: absolute; right: 16px; bottom: 12px; font-size: 13px; color: rgba(232, 220, 192, 0.6); text-align: right; text-shadow: 0 1px 2px #000; line-height: 1.5; }

#bottom { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 14px; }
.globeWrap { position: relative; width: 124px; height: 124px; }
.globe { position: absolute; inset: 8px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 40%, #1a1512, #050404); border: 2px solid #6b5630; box-shadow: 0 0 0 2px #1a140a, 0 4px 18px rgba(0, 0, 0, 0.8), inset 0 0 18px #000; }
.globe .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; transition: height 0.12s linear; }
.globe.hp .fill { background: radial-gradient(circle at 40% 30%, #ff6a55 0%, #c22a22 45%, #5a0d0a 100%); box-shadow: 0 -2px 8px rgba(255, 120, 100, 0.5); }
.globe.mana .fill { background: radial-gradient(circle at 40% 30%, #6aa8ff 0%, #2a5fd0 45%, #0b1f5a 100%); box-shadow: 0 -2px 8px rgba(120, 170, 255, 0.5); }
.globe .glass { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.05) 28%, transparent 45%), radial-gradient(circle at 50% 110%, rgba(0, 0, 0, 0.55), transparent 60%); }
.globe .num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 16px 'Cinzel', serif; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ringBg { stroke: rgba(0, 0, 0, 0.55); }
#wardRing { stroke: var(--ward); stroke-linecap: butt; filter: drop-shadow(0 0 4px rgba(110, 230, 255, 0.8)); transition: stroke-dashoffset 0.12s linear; }
#barrierRing { stroke: #ffd76a; stroke-width: 3; filter: drop-shadow(0 0 4px rgba(255, 215, 106, 0.9)); }
.wardNum { position: absolute; left: 0; right: 0; top: -14px; text-align: center; font: 700 13px 'Cinzel', serif; color: var(--ward); text-shadow: 0 1px 3px #000; }
.globeWrap.low .globe { animation: lowHp 0.7s ease-in-out infinite; }
@keyframes lowHp { 50% { box-shadow: 0 0 0 2px #1a140a, 0 0 26px rgba(255, 40, 30, 0.9), inset 0 0 18px #000; } }

#mid { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; }
#bar { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px; background: linear-gradient(180deg, rgba(30, 25, 17, 0.92), rgba(10, 8, 6, 0.95)); border: 1px solid #5a4a2a; border-radius: 8px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.8); }
#slots { display: flex; gap: 6px; margin: 0 8px; }
.slot, .pot { position: relative; width: 64px; height: 64px; border: 1px solid #6b5630; border-radius: 6px; background: #0c0a08; overflow: hidden; box-shadow: inset 0 0 10px #000; }
.pot { width: 50px; height: 50px; }
.slot img, .pot img { width: 100%; height: 100%; display: block; }
.slot.empty img { display: none; }
.slot .key, .pot .key, .cmd .key { position: absolute; left: 3px; top: 2px; font: 700 13px 'Cinzel', serif; color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000, 0 0 6px #000; z-index: 3; }
.slot .lvl { position: absolute; right: 3px; top: 2px; font: 700 12px 'Cinzel', serif; color: #ffe08a; text-shadow: 0 0 3px #000, 0 1px 2px #000; z-index: 3; }
.slot .lvl.cap { color: #ff9a5a; }
.pot .count { position: absolute; right: 4px; bottom: 1px; font: 700 15px 'Cinzel', serif; text-shadow: 0 0 3px #000, 0 1px 2px #000; z-index: 3; }
.slot .cd, .pot .cd { position: absolute; inset: 0; background: conic-gradient(rgba(0, 0, 0, 0.78) calc(var(--cd, 0) * 360deg), transparent 0); z-index: 2; }
.slot .cdn { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 20px 'Cinzel', serif; z-index: 3; text-shadow: 0 0 4px #000; }
.slot .xp { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(0, 0, 0, 0.8); z-index: 3; }
.slot .xp i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #b88a2a, #ffe08a); }
.slot .xp.cap i { background: linear-gradient(90deg, #8a3a1a, #ff9a5a); width: 100% !important; }
.slot.nomana img { filter: grayscale(0.7) brightness(0.5) sepia(0.3) hue-rotate(190deg); }
.slot.flash { animation: slotFlash 0.9s ease-out; }
.slot.casting { border-color: #fff2c0; box-shadow: 0 0 12px rgba(255, 230, 150, 0.8); }
@keyframes slotFlash { 0% { box-shadow: 0 0 0 3px #ffe08a, 0 0 30px #ffe08a; } 100% { box-shadow: none; } }
.pot.none img { filter: grayscale(1) brightness(0.4); }
.cmd { position: relative; width: 50px; height: 50px; border: 1px solid #4a3d24; border-radius: 6px; background: #0c0a08; display: flex; align-items: flex-end; justify-content: center; }
.cmd .lbl { font-size: 11px; color: var(--dim); padding-bottom: 5px; }
.cmd.on { border-color: var(--wild); box-shadow: 0 0 10px rgba(110, 207, 90, 0.6); }
.cmd.on .lbl { color: var(--wild); }
.cmd.cdg { opacity: 0.45; }
#xpBar { position: relative; height: 12px; background: rgba(0, 0, 0, 0.75); border: 1px solid #5a4a2a; border-radius: 3px; overflow: hidden; }
#xpFill { height: 100%; width: 0%; background: linear-gradient(90deg, #6a4a9a, #c8a0ff); transition: width 0.2s; }
#xpText { position: absolute; inset: 0; text-align: center; font: 700 10px 'Cinzel', serif; line-height: 11px; text-shadow: 0 0 3px #000; }

/* ---------- full screens and panels ---------- */
#screen { position: fixed; inset: 0; z-index: 50; zoom: var(--ui, 1); display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(2px); }
#screen.title { background: #050505 center/cover no-repeat; backdrop-filter: none; }
#screen.dead { background: rgba(20, 0, 0, 0.55); }
.titleWrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 5vh; background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.75) 100%); }
.titleWrap img.logo { width: min(620px, 60vw); filter: drop-shadow(0 6px 30px rgba(0, 0, 0, 0.9)); }
.tagline { font: 400 18px 'Cinzel', serif; letter-spacing: 0.3em; color: var(--bone); text-shadow: 0 2px 6px #000; margin-top: -6px; }
.titleMenu { margin-top: auto; margin-bottom: 9vh; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.btn { font: 700 18px 'Cinzel', serif; letter-spacing: 0.12em; color: var(--bone); background: linear-gradient(180deg, rgba(40, 32, 20, 0.95), rgba(16, 13, 9, 0.95)); border: 1px solid #6b5630; border-radius: 5px; padding: 10px 34px; min-width: 300px; text-align: center; cursor: pointer; transition: all 0.12s; pointer-events: auto; }
.btn.small { min-width: 0; padding: 7px 18px; font-size: 14px; }
.btn.focus, .btn:hover { color: #fff3cf; border-color: var(--gold); box-shadow: 0 0 18px rgba(217, 181, 106, 0.45), inset 0 0 12px rgba(217, 181, 106, 0.15); transform: scale(1.03); }
.btn.disabled { opacity: 0.35; pointer-events: none; }
.foot { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: 13px; color: rgba(232, 220, 192, 0.55); }

.panel { position: relative; background: var(--panel) url('assets/art/ui_panel.webp'); background-size: 512px; border: 1px solid #6b5630; border-radius: 8px; box-shadow: 0 10px 60px rgba(0, 0, 0, 0.9), inset 0 0 60px rgba(0, 0, 0, 0.6); padding: 22px 28px; max-width: 94vw; max-height: 92vh; overflow: auto; pointer-events: auto; }
.panel h2 { margin: 0 0 4px; font-size: 26px; color: var(--gold); text-align: center; }
.panel .sub { text-align: center; color: var(--dim); margin-bottom: 16px; font-style: italic; }
.panel .keys { text-align: center; color: var(--dim); font-size: 14px; margin-top: 14px; }

/* boon cards */
.cards { display: flex; gap: 18px; justify-content: center; }
.card { width: 270px; padding: 14px 16px 16px; border: 1px solid #4a3d24; border-radius: 8px; background: linear-gradient(180deg, rgba(26, 22, 15, 0.95), rgba(9, 8, 6, 0.97)); text-align: center; cursor: pointer; transition: all 0.12s; position: relative; }
.card img { width: 110px; height: 110px; border-radius: 50%; border: 2px solid #4a3d24; margin: 4px 0 8px; }
.card .lane { font: 700 13px 'Cinzel', serif; letter-spacing: 0.2em; text-transform: uppercase; }
.card .name { font: 700 20px 'Cinzel', serif; margin: 4px 0 6px; color: #fff3cf; }
.card .text { font-size: 16px; line-height: 1.3; min-height: 86px; }
.card .rank { margin-top: 8px; font-size: 14px; color: var(--dim); }
.card .num { position: absolute; left: 10px; top: 8px; }
.card.warden .lane { color: var(--warden); } .card.wild .lane { color: var(--wild); } .card.storm .lane { color: var(--storm); }
.card.focus.warden, .card.warden:hover { border-color: var(--warden); box-shadow: 0 0 26px rgba(227, 154, 60, 0.45); transform: translateY(-6px); }
.card.focus.wild, .card.wild:hover { border-color: var(--wild); box-shadow: 0 0 26px rgba(111, 207, 90, 0.45); transform: translateY(-6px); }
.card.focus.storm, .card.storm:hover { border-color: var(--storm); box-shadow: 0 0 26px rgba(125, 140, 255, 0.5); transform: translateY(-6px); }
.card.keystone .name { color: #ffd54a; }
.card.keystone { background: linear-gradient(180deg, rgba(48, 38, 14, 0.95), rgba(12, 10, 6, 0.97)); }
.card.none { opacity: 0.35; pointer-events: none; }
.lanes { display: flex; gap: 22px; justify-content: center; margin-top: 16px; font-size: 15px; }
.lanes b.warden { color: var(--warden); } .lanes b.wild { color: var(--wild); } .lanes b.storm { color: var(--storm); }

/* journal */
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.tab { font: 700 14px 'Cinzel', serif; letter-spacing: 0.1em; padding: 6px 18px; border: 1px solid #4a3d24; border-radius: 5px; color: var(--dim); cursor: pointer; }
.tab.on { color: #fff3cf; border-color: var(--gold); background: rgba(217, 181, 106, 0.12); }
.journal { display: flex; gap: 20px; width: 980px; max-width: 90vw; }
.spellGrid { display: grid; grid-template-columns: repeat(4, 86px); gap: 10px; align-content: start; }
.sp { position: relative; width: 86px; height: 86px; border: 1px solid #4a3d24; border-radius: 6px; overflow: hidden; background: #0c0a08; cursor: pointer; }
.sp img { width: 100%; height: 100%; display: block; }
.sp.unknown img { filter: grayscale(1) brightness(0.18) contrast(1.3); }
.sp .lvl { position: absolute; right: 4px; top: 2px; font: 700 13px 'Cinzel', serif; color: #ffe08a; text-shadow: 0 0 3px #000, 0 1px 2px #000; }
.sp .slotn { position: absolute; left: 4px; top: 2px; font: 700 13px 'Cinzel', serif; color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000; }
.sp .xp { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(0, 0, 0, 0.8); }
.sp .xp i { display: block; height: 100%; background: linear-gradient(90deg, #b88a2a, #ffe08a); }
.sp .xp.cap i { background: linear-gradient(90deg, #8a3a1a, #ff9a5a); }
.sp.focus { border-color: var(--gold); box-shadow: 0 0 16px rgba(217, 181, 106, 0.6); transform: scale(1.05); z-index: 2; }
.detail { flex: 1; min-height: 400px; border-left: 1px solid #3a3020; padding-left: 20px; }
.detail h3 { margin: 0; font-size: 22px; color: #fff3cf; }
.detail .lane { font: 700 12px 'Cinzel', serif; letter-spacing: 0.2em; text-transform: uppercase; }
.detail .lane.warden { color: var(--warden); } .detail .lane.wild { color: var(--wild); } .detail .lane.storm { color: var(--storm); }
.detail p { margin: 8px 0; line-height: 1.3; }
.detail .nums { color: #cfe8a8; }
.detail .meta { color: var(--dim); font-size: 15px; }
.detail .perk { font-size: 15px; margin: 3px 0; color: var(--dim); }
.detail .perk.got { color: #ffe08a; }
.detail .perk.locked { color: #7a705c; }
.detail .capnote { margin-top: 10px; padding: 8px 10px; border: 1px solid #5a3a1a; border-radius: 5px; background: rgba(90, 40, 10, 0.25); color: #ffb98a; font-size: 15px; }
.xpLine { height: 10px; background: rgba(0, 0, 0, 0.7); border: 1px solid #5a4a2a; border-radius: 3px; overflow: hidden; margin: 4px 0 2px; }
.xpLine i { display: block; height: 100%; background: linear-gradient(90deg, #b88a2a, #ffe08a); }
.loadout { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.loadout .slot { width: 56px; height: 56px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; width: 100%; }
.stats div { display: flex; justify-content: space-between; border-bottom: 1px dotted #3a3020; padding: 3px 0; }
.stats div span:last-child { color: #fff3cf; font-weight: 600; }
.boonList { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.boonList h4 { margin: 0 0 6px; font: 700 14px 'Cinzel', serif; letter-spacing: 0.15em; }
.boonList .b { font-size: 15px; margin: 3px 0; }
.boonList .b small { color: var(--dim); display: block; line-height: 1.2; }

/* options and help */
.opts { display: flex; flex-direction: column; gap: 6px; min-width: 520px; }
.opt { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border: 1px solid #3a3020; border-radius: 5px; cursor: pointer; }
.opt.focus, .opt:hover { border-color: var(--gold); background: rgba(217, 181, 106, 0.1); }
.opt .val { font: 700 15px 'Cinzel', serif; color: #ffe08a; }
.help { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; align-items: center; max-width: 720px; }
.help .k { text-align: right; white-space: nowrap; }
.rows { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 16px; }
.bigMsg { font: 700 46px 'Cinzel', serif; letter-spacing: 0.15em; text-align: center; text-shadow: 0 0 30px rgba(0, 0, 0, 0.9); }
.bigMsg.dead { color: #b3261e; } .bigMsg.win { color: #ffd76a; }
.statLine { text-align: center; color: var(--bone); margin: 4px 0; }

@media (max-height: 760px) {
  .globeWrap { width: 100px; height: 100px; } .slot { width: 54px; height: 54px; } .pot, .cmd { width: 44px; height: 44px; }
  #minimap { width: 150px; height: 150px; }
  .card { width: 230px; } .card img { width: 80px; height: 80px; } .card .text { min-height: 70px; font-size: 15px; }
}

body.play { cursor: none; }
.sp.unknown::after { content: '?'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 700 30px 'Cinzel', serif; color: #4a4232; }
