:root { --gold:#d8a44a; --pink:#ff3df0; --cyan:#4cf4ff; --bg:#120a1c; --panel:rgba(18,10,28,.86); font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin:0; height:100%; background:#0c0612; overflow:hidden; overscroll-behavior:none; touch-action:none; }
#app { position:fixed; inset:0; }
#game { position:absolute; inset:0; width:100%; height:100%; image-rendering: pixelated; image-rendering: crisp-edges; display:block; }
#overlay { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
#vignette { position:absolute; inset:0; pointer-events:none; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 48%, rgba(8,2,16,.55) 100%); }
#loading { position:absolute; inset:0; background: radial-gradient(circle at 50% 40%, #2a1240, #0c0612 70%); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; color:#f4e6c8; z-index:50; transition: opacity .6s; }
#loading.done { opacity:0; pointer-events:none; }
.ld-title { font-size: clamp(26px,6vw,56px); letter-spacing:.12em; font-weight:800; color: var(--gold); text-shadow: 0 0 18px rgba(255,61,240,.6); }
.ld-title span { color: var(--pink); }
.ld-sub { opacity:.7; letter-spacing:.2em; font-size: 12px; text-transform: uppercase; }
.ld-bar { width:min(60vw,420px); height:8px; border:1px solid var(--gold); border-radius:2px; overflow:hidden; background:#0006; }
.ld-bar i { display:block; height:100%; width:0%; background: linear-gradient(90deg,var(--pink),var(--cyan)); transition: width .15s; }
#ld-label { font-size:11px; opacity:.6; }
#rotate { position:absolute; inset:0; display:none; z-index:60; background:#0c0612; color:#f4e6c8; flex-direction:column; align-items:center; justify-content:center; font-size:18px; text-align:center; gap:6px; }
#rotate div { font-size:64px; color: var(--pink); }
@media (orientation: portrait) and (pointer: coarse) { #rotate { display:flex; } }
#hud { position:absolute; inset:0; pointer-events:none; color:#f4e6c8; font-size:12px; z-index:10; }
#hud button, #hud .modal, #hud .slot, #hud select, #hud .card, #hud .stickzone, #hud .tbtns { pointer-events:auto; }
#hud button { font:inherit; color:#f4e6c8; background:rgba(40,20,60,.85); border:1px solid var(--gold); border-radius:3px; padding:6px 10px; cursor:pointer; }
#hud button:hover { background:rgba(80,30,110,.9); } #hud button.primary { background:linear-gradient(#a0307a,#601a5a); border-color:var(--pink); font-weight:700; padding:10px 16px; }
.tl { position:absolute; left:12px; top:12px; display:flex; gap:10px; align-items:flex-start; }
.portrait { position:relative; width:72px; height:72px; border:2px solid var(--gold); background:#150a20; box-shadow:0 0 12px #000a, inset 0 0 10px #000; }
.portrait img { width:100%; height:100%; object-fit:cover; image-rendering:pixelated; } .portrait b { position:absolute; right:-8px; bottom:-8px; background:#2a1240; border:2px solid var(--gold); border-radius:50%; width:26px; height:26px; display:flex; align-items:center; justify-content:center; font-size:13px; }
.bars { width:min(34vw,230px); } .bar { position:relative; height:16px; margin-bottom:4px; background:#0009; border:1px solid #000; box-shadow:0 0 0 1px #d8a44a66; overflow:hidden; }
.bar i { position:absolute; inset:0 auto 0 0; width:100%; transition:width .12s; } .bar.hp i { background:linear-gradient(#ff4a6a,#a01838); } .bar.en i { background:linear-gradient(#4cf4ff,#1a7aa8); } .bar.xp { height:6px; } .bar.xp i { background:linear-gradient(#ffd23a,#d8883a); }
.bar span { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:11px; text-shadow:0 1px 2px #000; } .name { font-weight:700; text-shadow:0 1px 3px #000; } .name em { font-weight:400; opacity:.65; font-style:normal; margin-left:4px; }
.buffs span { display:inline-block; margin:3px 4px 0 0; padding:1px 5px; background:#2a1a4acc; border:1px solid var(--cyan); color:var(--cyan); font-size:10px; text-transform:uppercase; } .buffs .bad { border-color:#ff6a3a; color:#ff6a3a; }
.tr { position:absolute; right:12px; top:12px; display:flex; flex-direction:column; align-items:flex-end; gap:6px; } #mini { width:130px; height:130px; filter:drop-shadow(0 0 8px #000); } .zonelbl { text-shadow:0 1px 3px #000; opacity:.85; } .btns { display:flex; gap:6px; }
.abil { position:absolute; left:50%; bottom:14px; transform:translateX(-50%); display:flex; gap:8px; }
.slot { position:relative; width:58px; height:58px; border:2px solid #d8a44a99; background:#120a1c; box-shadow:0 0 10px #000a; cursor:pointer; overflow:hidden; } .slot.main { width:66px; height:66px; border-color:var(--pink); } .slot img { width:100%; height:100%; image-rendering:pixelated; display:block; }
.slot .cd { position:absolute; left:0; right:0; bottom:0; height:0; background:rgba(0,0,0,.72); } .slot kbd { position:absolute; left:2px; top:1px; font:700 9px ui-monospace; background:#000a; padding:0 3px; } .slot .cost { position:absolute; right:3px; bottom:1px; color:var(--cyan); font-weight:700; text-shadow:0 1px 2px #000; }
.slot.nope img { filter:grayscale(.8) brightness(.6); } .slot.active { border-color:#fff; box-shadow:0 0 14px var(--pink); }
.boss { display:none; position:absolute; top:14px; left:50%; transform:translateX(-50%); width:min(46vw,460px); text-align:center; } .boss .bn { font-weight:800; letter-spacing:.15em; color:#ff9a8a; text-shadow:0 0 8px #f03; margin-bottom:3px; } .boss .bb { height:14px; background:#000a; border:1px solid #ff4a6a; } .boss .bb i { display:block; height:100%; background:linear-gradient(#ff3a5a,#8a1030); transition:width .15s; }
.banner { position:absolute; top:22%; left:0; right:0; text-align:center; opacity:0; text-shadow:0 2px 10px #000; } .banner.show { animation:ban 4.2s ease forwards; } .banner h2 { margin:0; font-size:clamp(22px,4.4vw,40px); letter-spacing:.2em; color:var(--gold); } .banner p { margin:6px 0; opacity:.8; } .banner small { opacity:.55; letter-spacing:.2em; text-transform:uppercase; }
@keyframes ban { 0%{opacity:0;transform:translateY(10px)} 12%,75%{opacity:1;transform:none} 100%{opacity:0} }
.toasts { position:absolute; left:50%; transform:translateX(-50%); bottom:96px; display:flex; flex-direction:column; align-items:center; gap:4px; } .toasts div { background:#120a1ccc; padding:4px 12px; border:1px solid #ffffff22; text-shadow:0 1px 2px #000; animation:tin .2s; transition:opacity .5s; } .toasts .out { opacity:0; } @keyframes tin { from{transform:translateY(8px);opacity:0} }
.obj { position:absolute; left:12px; top:100px; opacity:.8; text-shadow:0 1px 3px #000; max-width:40vw; } .obj b { color:var(--gold); }
.tip { display:none; position:fixed; z-index:30; max-width:240px; background:#0c0612f2; border:1px solid var(--gold); padding:8px 10px; pointer-events:none; line-height:1.4; } .tip b { display:block; font-size:13px; } .tip small { display:block; opacity:.7; margin-top:3px; } .tip p { margin:4px 0; } .tip .st { color:#9fe0ff; } .tip i.up { color:#6fe08a; font-style:normal; } .tip i.dn, .tip .dn { color:#ff7a7a; font-style:normal; }
.modal { display:none; position:absolute; inset:0; background:#0008; align-items:center; justify-content:center; z-index:20; } .modal.open { display:flex; }
.card { position:relative; background:var(--panel); border:2px solid var(--gold); padding:16px 18px; max-width:94vw; max-height:92vh; overflow:auto; box-shadow:0 0 40px #000, 0 0 20px #ff3df022; } .card.small { width:min(92vw,420px); display:flex; flex-direction:column; gap:10px; } .card h2 { margin:0 0 6px; letter-spacing:.2em; color:var(--gold); } .card h3 { margin:10px 0 6px; font-size:12px; opacity:.8; text-transform:uppercase; letter-spacing:.1em; } .card h3 small { opacity:.6; text-transform:none; letter-spacing:0; }
.x { position:absolute; right:8px; top:8px; } .invgrid { display:flex; gap:18px; flex-wrap:wrap; } .eqgrid { display:grid; grid-template-columns:repeat(4,52px); gap:5px; } .cells { display:grid; grid-template-columns:repeat(6,48px); gap:4px; }
.eq,.cell { width:52px; height:52px; background:#0d0716; border:1px solid #d8a44a55; display:flex; align-items:center; justify-content:center; cursor:pointer; text-align:center; font-size:8px; opacity:.95; } .cell { width:48px; height:48px; } .eq span { opacity:.4; } .eq img,.cell img { width:100%; height:100%; image-rendering:pixelated; }
.r-common{border-color:#c9c4bd} .r-uncommon{border-color:#6fe08a;box-shadow:inset 0 0 8px #6fe08a55} .r-rare{border-color:#4aa8ff;box-shadow:inset 0 0 8px #4aa8ff66} .r-epic{border-color:#c36bff;box-shadow:inset 0 0 10px #c36bff77} .r-legendary{border-color:#ff9a2e;box-shadow:inset 0 0 12px #ff9a2e99}
.stats { display:grid; grid-template-columns:1fr 1fr; gap:2px 14px; } .stats div { display:flex; justify-content:space-between; gap:8px; } .stats span { opacity:.6; } .row { display:flex; justify-content:space-between; align-items:center; } .row select { background:#2a1240; color:#f4e6c8; border:1px solid var(--gold); padding:4px; } .help,.credits { opacity:.75; line-height:1.5; font-size:11px; } .credits a { color:var(--cyan); }
.stickzone { position:absolute; top:0; bottom:0; touch-action:none; } .stickzone.l { left:0; width:42%; } .stickzone.r { right:0; width:46%; } .stick { display:none; position:fixed; width:112px; height:112px; margin:-56px 0 0 -56px; border:2px solid #ffffff55; border-radius:50%; background:#ffffff14; pointer-events:none; } .stick i { position:absolute; left:50%; top:50%; width:46px; height:46px; margin:-23px; border-radius:50%; background:#ff3df0aa; border:2px solid #fff8; }
.tbtns { position:absolute; right:10px; bottom:12px; width:200px; height:170px; pointer-events:none; } .tbtns button { position:absolute; width:56px; height:56px; border-radius:50%; font-size:10px; font-weight:700; padding:0; opacity:.9; pointer-events:auto; touch-action:none; }
.tbtns button[data-a="1"]{right:2px;bottom:92px} .tbtns button[data-a="2"]{right:66px;bottom:104px} .tbtns button[data-a="3"]{right:128px;bottom:84px} .tbtns button[data-a="4"]{right:138px;bottom:22px} .tbtns button[data-a="5"]{right:76px;bottom:2px} .tbtns .zm { width:36px; height:36px; font-size:18px; right:6px; } .tbtns .zm[data-z="1"]{bottom:150px;display:none} .tbtns .zm[data-z="-1"]{display:none}
@media (pointer: coarse) { .obj { display:none; } #mini { width:100px; height:100px; } .bars { width:30vw; } }

/* ---- Foozle RPG UI Set 1 (CC0) skin: dark-fantasy stone panels ---- */
:root { --stone:#1b1a17; --ink:#e9dcc0; }
.modal { background: radial-gradient(ellipse at center, #0006, #000c); }
.card { background: rgba(20,19,16,.94) url(/assets/ui2/Panel_1.png) center/100% 100% no-repeat; border:0; border-image: url(/assets/ui2/Panel_1.png) 70 fill / 46px / 0 stretch; padding:34px 40px; box-shadow:0 10px 60px #000; color:var(--ink); }
.card.small { padding:34px 44px; }
.card h2 { text-align:center; letter-spacing:.2em; color:#d9b56a; text-shadow:0 2px 0 #000, 0 0 12px #c0302a66; }
#hud button { background:linear-gradient(#34322c,#201f1b); border:1px solid #6b5a3a; box-shadow:inset 0 0 0 1px #000a, 0 2px 4px #000a; color:var(--ink); border-radius:2px; }
#hud button:hover { background:linear-gradient(#4a463c,#2a2824); border-color:#d9b56a; }
#hud button.primary { background:url(/assets/ui2/Accept_Button_Normal.png) center/100% 100% no-repeat; border:0; box-shadow:none; height:53px; min-width:200px; text-transform:uppercase; letter-spacing:.14em; text-shadow:0 1px 2px #000; padding:0 18px; }
#hud button.primary:hover { background:url(/assets/ui2/Accept_Button_Light.png) center/100% 100% no-repeat; }
#hud button.x { background:url(/assets/ui2/Exit_Button_Normal.png) center/100% 100% no-repeat; width:36px; height:36px; border:0; box-shadow:none; font-size:0; padding:0; right:22px; top:20px; }
#hud button.x:hover { background:url(/assets/ui2/Exit_Button_Light.png) center/100% 100% no-repeat; }
.btns button { width:48px; height:48px; padding:0; background:url(/assets/ui2/Button.png) center/100% 100% no-repeat !important; border:0 !important; box-shadow:none !important; font-size:0 !important; position:relative; }
.btns button:hover { filter:brightness(1.4); }
#b-inv::after { content:''; position:absolute; inset:7px; background:url(/assets/ui2/bag.png) center/contain no-repeat; }
#b-pause::after { content:'II'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:800; color:#d9b56a; letter-spacing:-1px; }
.eq,.cell { background:#0d0c0a; border:1px solid #5a4a30; box-shadow:inset 0 0 6px #000; }
.eq:hover,.cell:hover { border-color:#d9b56a; }

/* ---- Diablo-style HUD layout: orbs, xp strip, tab bar, objective tracker, map/journal ---- */
.abil { bottom:22px; } .tl .bar.hp, .tl .bar.en, .tl .bar.xp, .tl .name { display:none; } .tl .buffs { margin-top:4px; }
.orb { position:absolute; bottom:12px; width:104px; height:104px; border-radius:50%; overflow:hidden; border:3px solid #3a352b; box-shadow:0 0 0 2px #000, inset 0 0 18px #000, 0 0 18px #000a; background:#0a0505; }
.orb i { position:absolute; left:0; right:0; bottom:0; height:100%; transition:height .15s; } .orb.hp { left:calc(50% - 330px); } .orb.en { right:calc(50% - 330px); }
.orb.hp i { background:radial-gradient(circle at 35% 30%, #ff5a5a, #a01218 55%, #4a0508); } .orb.en i { background:radial-gradient(circle at 35% 30%, #7ff3ff, #1a8ca8 55%, #0a3a4c); }
.orb span { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font:700 15px Georgia,serif; text-shadow:0 1px 3px #000, 0 0 6px #000; }
.xpstrip { position:absolute; left:calc(50% - 215px); width:430px; bottom:6px; height:8px; background:#000b; border:1px solid #5a4a30; } .xpstrip i { display:block; height:100%; background:linear-gradient(#e7a23a,#a8601c); width:0; }
.xpstrip b { position:absolute; left:-22px; top:-6px; font:700 11px Georgia,serif; background:#1b1a17; border:1px solid #6b5a3a; border-radius:50%; width:18px; height:18px; display:flex; align-items:center; justify-content:center; }
.tabs { position:absolute; left:50%; top:8px; transform:translateX(-50%); display:flex; gap:2px; background:linear-gradient(#26241f,#141310); border:1px solid #4a4030; padding:2px 6px; pointer-events:auto; }
#hud .tabs button { background:none; border:0; box-shadow:none; font:600 11px Georgia,serif; letter-spacing:.14em; text-transform:uppercase; color:#b9a98a; padding:6px 12px; } #hud .tabs button:hover { color:#fff; background:#7a1a14aa; } .tabs kbd { display:block; font-size:8px; opacity:.6; text-align:center; letter-spacing:0; }
.track { position:absolute; right:14px; top:218px; text-align:right; max-width:260px; text-shadow:0 1px 3px #000; font-family:Georgia,serif; } .track .wt { opacity:.7; font-size:11px; } .track .wt u { text-decoration:none; background:#3a1210; border:1px solid #7a2a22; border-radius:50%; padding:0 5px; }
.track h4 { margin:8px 0 2px; font-size:15px; color:#fff; } .track h4::after { content:' ◈'; color:#d9b56a; } .track p { margin:0; font-size:12px; color:#d8caa8; } .track p::after { content:' ◆'; font-size:7px; }
.zonelbl { font-family:Georgia,serif; font-size:11px; }
.log { position:absolute; left:14px; bottom:132px; font:12px Georgia,serif; color:#d9c070; text-shadow:0 1px 2px #000; display:flex; flex-direction:column; gap:2px; max-width:34vw; }
.banner .rib { display:inline-block; min-width:300px; padding:10px 36px; background:linear-gradient(90deg,#0000,#5a1410dd 20%,#5a1410dd 80%,#0000); border-top:1px solid #a0302a; border-bottom:1px solid #a0302a; } .rib small { display:block; letter-spacing:.2em; font-size:11px; color:#e9c9a0; } .rib h3 { margin:2px 0; font:700 22px Georgia,serif; letter-spacing:.16em; }
.card.map { width:min(94vw,1040px); } .mapwrap { display:flex; gap:14px; align-items:flex-start; flex-wrap:wrap; } #mapc { background:#c9b38a; border:3px solid #3a3228; max-width:100%; }
.journal { flex:1; min-width:200px; background:#0d0c0acc; border:1px solid #4a4030; padding:10px; } .journal h3 { margin:6px 0; color:#d9b56a; letter-spacing:.2em; font:600 12px Georgia,serif; text-transform:uppercase; } .jq p { margin:2px 0 10px; font-size:12px; opacity:.85; } .hint { font-size:10px; opacity:.5; }
#hud button.wp { display:block; width:100%; text-align:left; margin-bottom:4px; background:linear-gradient(#30302a,#1c1c18); } #hud button.wp:hover { background:linear-gradient(#8a1a14,#4a0c08); }
.card.small h2 span { color:#c0302a; } #pause .card.small button:not(.primary):not(.x) { background:linear-gradient(#34322c,#201f1b); letter-spacing:.1em; text-transform:uppercase; }


/* ---- Options, confirm, death ---- */
:root { --fs:1; } #hud { font-size:calc(1em * var(--fs)); }
.modal.top { z-index:50; background:#000a; } .card.opts { width:min(94vw,640px); max-height:86vh; overflow:auto; }
.otabs { display:flex; gap:4px; margin:6px 0 10px; border-bottom:1px solid #4a4030; } #hud .otabs button { flex:1; text-transform:uppercase; letter-spacing:.14em; font:600 11px Georgia,serif; background:none; border:0; box-shadow:none; color:#9a8a6a; padding:8px 4px; border-bottom:2px solid transparent; } #hud .otabs button.on { color:#fff; border-bottom-color:#c0302a; background:#7a1a1433; }
.orow { display:flex; align-items:center; gap:10px; padding:9px 6px; border-bottom:1px solid #ffffff10; font-family:Georgia,serif; } .orow span { flex:1; } .orow b { width:32px; text-align:right; font-size:12px; opacity:.8; } .orow input[type=range] { width:46%; accent-color:#c0302a; } .orow input[type=checkbox] { width:18px; height:18px; accent-color:#c0302a; } .key { background:#222; border:1px solid #555; padding:2px 8px; font:12px Georgia,serif; }
.btnrow { display:flex; gap:10px; justify-content:center; margin-top:10px; } .card h2.dead { color:#c0302a; letter-spacing:.3em; font-size:28px; } #death { background:radial-gradient(#3a0605cc,#000d); }
#hud button.primary, .card button.primary { background:linear-gradient(#a8221a,#5a0f0b) !important; border:1px solid #d04a3a; border-image:none; color:#fff; text-transform:uppercase; letter-spacing:.14em; text-shadow:0 1px 2px #000; }

/* ---- dialogue, shop, prompts ---- */
.dlg { position:absolute; left:50%; bottom:120px; transform:translateX(-50%); width:min(92vw,640px); display:none; pointer-events:auto; background:linear-gradient(#0b0a09ee,#14100ce6); border:1px solid #6b5a3a; padding:12px 18px; font-family:Georgia,serif; z-index:30; }
.dlg.open { display:block; } .dlg .who { color:#e0cfa0; letter-spacing:.2em; text-transform:uppercase; font-size:13px; } .dlg .who small { opacity:.6; letter-spacing:.05em; text-transform:none; } .dlg p { font-size:15px; margin:8px 0 12px; color:#e8e0d0; }
.dlg .ch { display:flex; flex-direction:column; gap:5px; } #hud .dlg .ch button { text-align:left; background:linear-gradient(#2c2a25,#171612); } #hud .dlg .ch button:hover { background:linear-gradient(#8a1a14,#4a0c08); }
.ipr { position:absolute; left:50%; bottom:150px; transform:translateX(-50%); display:none; background:#000b; border:1px solid #6b5a3a; padding:4px 12px; font:13px Georgia,serif; } .ipr.show { display:block; } .ipr kbd, .tabs kbd.k { background:#333; padding:1px 6px; border:1px solid #777; }
.cred { position:absolute; left:50%; top:52px; transform:translateX(-50%); font:700 13px Georgia,serif; color:#e8c860; text-shadow:0 1px 3px #000; }
.card.shop { width:min(94vw,900px); max-height:86vh; overflow:auto; } .card.shop .cols { display:flex; gap:14px; } .card.shop .cols > div { flex:1; min-width:0; } .cr { text-align:center; color:#e8c860; margin-bottom:6px; }
.sl { display:flex; flex-wrap:wrap; align-items:center; gap:2px 8px; padding:6px; border-bottom:1px solid #ffffff12; font-family:Georgia,serif; } .sl small { flex-basis:100%; opacity:.6; font-size:11px; } .sl b { flex:1; } #hud .sl button { font-size:11px; padding:4px 10px; }
@media (pointer: coarse) { .ipr { bottom:90px; } .cred { display:none; } }

/* ---- clean pickup feed (left, scrollable) ---- */
.toasts { left:12px; transform:none; bottom:140px; align-items:flex-start; width:230px; max-height:104px; overflow-y:auto; pointer-events:auto; gap:2px; scrollbar-width:thin; background:#0008; border:1px solid #ffffff18; padding:3px; font-size:11px; font-family:Georgia,serif; }
.toasts:empty { display:none; } .toasts div { background:none; border:0; padding:1px 4px; animation:none; } .log { display:none; }
/* ---- touch layout: fixed sticks at the edges, orbs + 6 abilities centred ---- */
@media (pointer: coarse) {
  .stickzone.l { left:0; width:34%; } .stickzone.r { right:0; width:34%; }
  .stick { display:block; position:absolute; top:auto; bottom:18px; margin:0; width:112px; height:112px; } #sl { left:22px; } #sr { right:22px; left:auto; }
  .orb { width:62px; height:62px; bottom:8px; } .orb.hp { left:calc(50% - 232px); } .orb.en { right:calc(50% - 232px); } .orb span { font-size:11px; }
  .abil { bottom:10px; gap:4px; } .slot, .slot.main { width:44px; height:44px; } .slot kbd { display:none; } .slot .cost { font-size:9px; }
  .xpstrip { left:calc(50% - 160px); width:320px; bottom:2px; } .xpstrip b { display:none; } .tabs, .track, .log { display:none; } .tabs { display:flex; top:4px; } .cred { display:none; }
  .toasts { bottom:150px; width:180px; max-height:70px; left:8px; } .ipr { bottom:80px; } #hud .tabs button { padding:3px 8px; }
}
