* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #050405; font-family: Georgia, "Times New Roman", serif; color: #d8cfb8; user-select: none; }
#game { position: absolute; inset: 0; display: block; cursor: crosshair; }
.hidden { display: none !important; }
.screen { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(40,20,10,.85), rgba(0,0,0,.97)); z-index: 50; }
.title-card { max-width: 720px; text-align: center; padding: 40px; }
.title-card h1 { font-size: 64px; letter-spacing: 6px; margin: 0 0 20px; color: #e0b15c; text-shadow: 0 0 30px rgba(255,120,30,.5), 0 2px 0 #000; line-height: 1; }
.title-card h1 span { font-size: 26px; letter-spacing: 3px; color: #b09a72; font-style: italic; }
.title-card h1.gold { color: #ffd66b; } .title-card h1.red { color: #c33a2a; }
.lore { font-size: 17px; line-height: 1.5; color: #bfb39a; font-style: italic; }
.title-buttons { display: flex; gap: 20px; justify-content: center; margin: 28px 0 16px; }
button { font-family: inherit; background: linear-gradient(#3a2a1c, #1d150d); color: #e5c98a; border: 1px solid #7a5a2e; padding: 8px 14px; cursor: pointer; font-size: 14px; letter-spacing: 1px; border-radius: 3px; }
button:hover { background: linear-gradient(#57402a, #2a1e12); color: #fff0c8; }
button:disabled { opacity: .4; cursor: default; }
button.big { font-size: 20px; padding: 14px 30px; }
.hint { font-size: 13px; color: #7f745f; }

/* HUD */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
#floor-label { position: absolute; top: 12px; left: 16px; font-size: 18px; letter-spacing: 2px; color: #cdb07a; text-shadow: 0 1px 2px #000; }
#msglog { position: absolute; left: 16px; bottom: 150px; width: 420px; font-size: 14px; color: #d9d0bb; text-shadow: 0 1px 2px #000; }
#msglog div { opacity: 1; transition: opacity 1s; margin-top: 2px; }
#msglog div.fade { opacity: 0; }
#boss-bar { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); width: 520px; text-align: center; }
#boss-bar .boss-name { font-size: 18px; letter-spacing: 3px; color: #f0c070; text-shadow: 0 1px 3px #000; margin-bottom: 4px; }
#boss-bar .bar { height: 14px; border: 1px solid #8a6a3a; background: #1a0a0a; }
#boss-bar .fill { height: 100%; background: linear-gradient(#c8402a, #7a1a12); width: 100%; transition: width .15s; }
#hud-bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 130px; display: flex; align-items: flex-end; justify-content: center; gap: 12px; pointer-events: auto; }
.orb { position: relative; width: 120px; height: 120px; border-radius: 50%; border: 3px solid #4a3a26; background: #120a08; overflow: hidden; box-shadow: inset 0 0 20px #000, 0 0 12px rgba(0,0,0,.8); margin-bottom: 6px; }
.orb .orb-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; transition: height .2s; }
.orb.hp .orb-fill { background: radial-gradient(ellipse at 50% 20%, #ff6a4a, #8a1010 60%, #3a0404); }
.orb.mp .orb-fill { background: radial-gradient(ellipse at 50% 20%, #6aa8ff, #1a3a9a 60%, #071238); }
.orb .orb-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; color: #fff; text-shadow: 0 1px 2px #000; }
.orb .orb-label { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 11px; color: rgba(255,255,255,.6); letter-spacing: 2px; }
#skillbar { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 14px 6px; background: linear-gradient(#2a1e12, #120b06); border: 1px solid #5a4226; border-bottom: none; border-radius: 8px 8px 0 0; }
#skillbar .skills, #skillbar .belt { display: flex; gap: 6px; }
#skillbar .slot { position: relative; width: 52px; height: 52px; border: 1px solid #6a4e2a; background: #0b0705; border-radius: 4px; cursor: pointer; overflow: hidden; }
#skillbar .slot .key { position: absolute; top: 1px; left: 3px; font-size: 11px; color: #e0c080; z-index: 3; text-shadow: 0 1px 1px #000; }
#skillbar .slot .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.7); height: 0%; z-index: 2; }
#skillbar .slot .cost { position: absolute; bottom: 1px; right: 3px; font-size: 10px; color: #7fb0ff; z-index: 3; }
#skillbar .slot .count { position: absolute; bottom: 1px; right: 4px; font-size: 13px; color: #fff; z-index: 3; text-shadow: 0 1px 1px #000; }
#skillbar .slot.active { border-color: #f0c060; box-shadow: 0 0 8px rgba(240,190,90,.6); }
#skillbar .slot.locked { opacity: .35; }
#skillbar .slot canvas { position: absolute; inset: 0; }
#skillbar .ico { position: absolute; inset: 8px; border-radius: 40% 40% 50% 50%; }
.hp-pot { background: radial-gradient(circle at 40% 30%, #ff8a6a, #a01818 70%); }
.mp-pot { background: radial-gradient(circle at 40% 30%, #8ab8ff, #1a3aa0 70%); }
.xpbar { position: relative; width: 100%; height: 8px; border: 1px solid #5a4226; background: #050302; margin-top: 2px; }
.xpbar .fill { height: 100%; background: linear-gradient(#e8d090, #a07c30); width: 0%; }
.xpbar .lvl { position: absolute; right: 4px; top: -16px; font-size: 11px; color: #cdb07a; }
.micro-buttons { display: flex; gap: 4px; }
.micro-buttons button { padding: 2px 8px; font-size: 11px; }
.micro-buttons button.attention { border-color: #ffd66b; box-shadow: 0 0 8px rgba(255,214,107,.7); }
.stat-alert { color: #ffd66b; font-weight: bold; }

/* Panels */
#panels { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.panel { position: absolute; pointer-events: auto; background: linear-gradient(#241a10, #100a06); border: 2px solid #6a4e2a; border-radius: 6px; padding: 10px 14px 14px; box-shadow: 0 0 40px rgba(0,0,0,.8); color: #d8cfb8; }
.panel-title { font-size: 20px; letter-spacing: 3px; color: #e0b15c; margin-bottom: 8px; display: flex; justify-content: space-between; }
.panel-title .close { cursor: pointer; color: #9a8060; font-size: 16px; }
.panel-title .close:hover { color: #fff; }
.small { font-size: 12px; color: #8f8268; }
#inventory { right: 20px; top: 60px; width: 470px; }
#character { left: 20px; top: 60px; width: 360px; }
#skilltree { left: 20px; top: 60px; width: 470px; }
#vendor { left: 400px; top: 60px; width: 470px; }
#gate { left: 50%; top: 50%; transform: translate(-50%,-50%); width: 360px; text-align: center; }
#gate-floors { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.grid { display: grid; grid-template-columns: repeat(8, 52px); gap: 3px; }
.cell { width: 52px; height: 52px; background: #0b0705; border: 1px solid #3a2a1a; border-radius: 3px; position: relative; cursor: pointer; }
.cell:hover { border-color: #a08050; }
.cell canvas { position: absolute; inset: 0; }
.cell.rar-normal { border-color: #5c5648; } .cell.rar-magic { border-color: #4b6fd6; } .cell.rar-rare { border-color: #e2c545; } .cell.rar-unique { border-color: #d68c3a; box-shadow: inset 0 0 8px rgba(214,140,58,.5); }
.cell .price { position: absolute; bottom: 0; right: 2px; font-size: 10px; color: #ffd66b; text-shadow: 0 1px 1px #000; }
.paperdoll { position: relative; height: 270px; margin-bottom: 8px; background: radial-gradient(ellipse at center, #2a1c10, transparent 70%); }
.paperdoll .eq { position: absolute; width: 56px; height: 56px; }
.paperdoll .eq span { position: absolute; bottom: -14px; left: 0; right: 0; text-align: center; font-size: 10px; color: #6f634f; }
.paperdoll .eq .cell { width: 56px; height: 56px; }
.paperdoll .eq[data-slot=helm] { left: 200px; top: 4px; }
.paperdoll .eq[data-slot=amulet] { left: 270px; top: 40px; }
.paperdoll .eq[data-slot=weapon] { left: 100px; top: 80px; }
.paperdoll .eq[data-slot=chest] { left: 200px; top: 80px; }
.paperdoll .eq[data-slot=offhand] { left: 300px; top: 100px; }
.paperdoll .eq[data-slot=gloves] { left: 100px; top: 160px; }
.paperdoll .eq[data-slot=belt] { left: 200px; top: 150px; }
.paperdoll .eq[data-slot=boots] { left: 200px; top: 210px; }
.paperdoll .eq[data-slot=ring1] { left: 300px; top: 180px; }
.paperdoll .eq[data-slot=ring2] { left: 370px; top: 180px; }
.gold-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 6px; color: #ffd66b; }
.vendor-pots { display: flex; gap: 8px; margin-top: 8px; }

#tooltip { position: absolute; z-index: 60; pointer-events: none; background: rgba(8,5,3,.95); border: 1px solid #6a4e2a; padding: 8px 12px; font-size: 13px; line-height: 1.4; max-width: 300px; color: #cfc4a8; box-shadow: 0 4px 20px #000; }
#tooltip .name { font-size: 15px; margin-bottom: 4px; }
#tooltip .rar-normal { color: #e8e2d0; } #tooltip .rar-magic { color: #7f9fff; } #tooltip .rar-rare { color: #ffe066; } #tooltip .rar-unique { color: #ffa040; }
#tooltip .type { color: #8f8268; font-style: italic; }
#tooltip .aff { color: #8fa7ff; }
#tooltip .cmp { font-size: 12px; margin-top: 6px; border-top: 1px dashed #4a3a26; padding-top: 4px; color: #9a9080; }
#tooltip .up { color: #7fe07f; } #tooltip .down { color: #ff7070; }
#tooltip .sell { color: #ffd66b; margin-top: 4px; }
#tooltip .flavor { color: #a58a5a; font-style: italic; margin-top: 4px; }

#char-stats table { width: 100%; border-collapse: collapse; }
#char-stats td { padding: 3px 4px; font-size: 14px; }
#char-stats td.v { text-align: right; color: #fff; }
#char-stats button { padding: 0 8px; font-size: 14px; margin-left: 6px; }
#char-stats .section { color: #e0b15c; letter-spacing: 2px; margin-top: 8px; font-size: 12px; }

#skill-list .skill { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border: 1px solid #3a2a1a; margin-bottom: 6px; border-radius: 4px; }
#skill-list .skill canvas { flex: none; width: 48px; height: 48px; border: 1px solid #6a4e2a; }
#skill-list .skill .name { color: #e0b15c; font-size: 16px; }
#skill-list .skill .desc { font-size: 13px; color: #b8ad95; }
#skill-list .skill .rank { font-size: 12px; color: #fff; margin-top: 4px; }
#skill-list .skill .rank button { margin-left: 8px; font-size: 12px; padding: 1px 8px; }

#levelup-toast { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); font-size: 46px; letter-spacing: 8px; color: #ffe08a; text-shadow: 0 0 30px #ff9020, 0 2px 0 #000; z-index: 30; pointer-events: none; animation: toast 2.5s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -20px); } }
