:root {
  --gold: #d9b45a;
  --gold-dim: #8d7437;
  --ink: #e9e2cf;
  --ink-dim: #a39c8a;
  --panel: rgba(14, 12, 10, 0.86);
  --panel-edge: #5a4a2a;
  --hp: #c62a22;
  --mp: #2a5fd0;
  --exp: #d6b43a;
  --danger: #ff5545;
  --good: #7ed957;
  font-family: Tahoma, Verdana, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--ink); user-select: none; }
#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }
#ui .passthru { pointer-events: none; }

.browser-fullscreen {
  position: fixed; top: 8px; right: 8px; z-index: 100001;
  display: grid; place-items: center; width: 30px; height: 30px; padding: 6px;
  border: 1px solid #b3935266; border-radius: 6px; color: #ead9af;
  background: #111722db; box-shadow: 0 2px 8px #0006;
  opacity: .72; transition: opacity .15s, border-color .15s;
}
.browser-fullscreen:hover, .browser-fullscreen:focus-visible { opacity: 1; border-color: #e4c47a; }
.browser-fullscreen svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

button, .btn {
  font: inherit; color: var(--ink); cursor: pointer;
  background: linear-gradient(#3a2f1b, #1c160c); border: 1px solid var(--gold-dim);
  padding: 8px 18px; border-radius: 3px; letter-spacing: .04em;
  box-shadow: inset 0 1px 0 rgba(255,230,160,.15), 0 2px 6px rgba(0,0,0,.6);
}
button:hover, .btn:hover { border-color: var(--gold); color: #fff6d8; background: linear-gradient(#4b3d22, #231b0e); }
button:disabled { opacity: .4; cursor: default; }
button.primary { border-color: var(--gold); color: #ffe9a8; }
input[type=text] {
  font: inherit; color: var(--ink); background: rgba(0,0,0,.6); border: 1px solid var(--gold-dim);
  padding: 8px 10px; border-radius: 3px; outline: none; width: 100%;
}
input[type=text]:focus { border-color: var(--gold); }

.panel {
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.8), 0 8px 30px rgba(0,0,0,.7), inset 0 0 30px rgba(120,90,30,.08);
}
.panel h2, .panel h3 { margin: 0 0 10px; color: var(--gold); font-weight: 600; letter-spacing: .06em; }

/* ---------- Title / character select ---------- */
.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 35%, rgba(60,40,15,.55), rgba(0,0,0,.92) 70%), #050403;
}
.logo {
  font-family: "Trajan Pro", "Cinzel", Georgia, serif; font-size: clamp(42px, 8vw, 96px); letter-spacing: .18em;
  color: transparent; background: linear-gradient(#fff3c4, #d9b45a 45%, #6b5020 100%); -webkit-background-clip: text; background-clip: text;
  text-shadow: 0 0 40px rgba(217,180,90,.25); margin: 0;
}
.subtitle { color: var(--ink-dim); letter-spacing: .5em; text-transform: uppercase; font-size: 13px; margin: 6px 0 36px; }
.charlist { width: min(560px, 92vw); display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; max-height: 40vh; overflow: auto; }
.charrow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; }
.charrow:hover, .charrow.sel { border-color: var(--gold); }
.charrow .nm { font-size: 18px; color: #fff3cf; flex: 1; }
.charrow .meta { color: var(--ink-dim); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.classgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; width: min(760px, 94vw); margin: 12px 0 16px; }
.classcard { padding: 12px; cursor: pointer; text-align: center; }
.classcard.sel { border-color: var(--gold); box-shadow: 0 0 18px rgba(217,180,90,.35); }
.classcard .cn { color: #fff0c0; font-weight: 600; }
.classcard .cd { color: var(--ink-dim); font-size: 12px; margin-top: 4px; }
.hint { color: var(--ink-dim); font-size: 12px; margin-top: 18px; text-align: center; line-height: 1.6; }

/* ---------- Loading ---------- */
.loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 12vh;
  background: radial-gradient(ellipse at 50% 40%, rgba(50,35,12,.6), #000 75%); }
.loading .mapname { font-family: Tahoma, Verdana, sans-serif; font-size: 34px; color: var(--gold); letter-spacing: .12em; margin-bottom: 18px; }
.bar { width: min(520px, 80vw); height: 10px; background: rgba(0,0,0,.7); border: 1px solid var(--gold-dim); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7a5a1c, #e8c56a); transition: width .15s; }
.loading .what { margin-top: 8px; color: var(--ink-dim); font-size: 12px; height: 16px; }

/* ---------- HUD ---------- */
.hud-player { position: fixed; left: 14px; top: 14px; width: 290px; padding: 10px 12px; }
.hud-player .nm { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.hud-player .nm b { color: #fff0c0; }
.gauge { position: relative; height: 16px; background: rgba(0,0,0,.75); border: 1px solid #000; margin: 3px 0; border-radius: 2px; overflow: hidden; }
.gauge > i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transition: width .12s; }
.gauge > span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 16px; text-shadow: 0 1px 2px #000; }
.gauge.hp > i { background: linear-gradient(#e2473d, #8e1510); }
.gauge.mp > i { background: linear-gradient(#4f86f0, #1b3d8f); }
.gauge.sm { height: 10px; } .gauge.sm > span { line-height: 10px; font-size: 9px; }
.hud-target { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); width: 330px; padding: 8px 12px; text-align: center; }
.hud-target .nm { font-size: 14px; margin-bottom: 4px; }
.hud-target .lv { color: var(--ink-dim); font-size: 12px; }
.hud-exp { position: fixed; left: 0; right: 0; bottom: 0; height: 8px; background: rgba(0,0,0,.8); border-top: 1px solid #000; }
.hud-exp > i { display: block; height: 100%; background: linear-gradient(#f2d565, #8a6d18); width: 0; }
.hud-exp > span { position: absolute; right: 8px; bottom: 10px; font-size: 11px; color: var(--ink-dim); text-shadow: 0 1px 2px #000; }
.hotbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 4px; padding: 6px; }
.slot { position: relative; width: 46px; height: 46px; background: rgba(0,0,0,.65); border: 1px solid #4a3c22; border-radius: 3px; overflow: hidden; cursor: pointer; }
.slot:hover { border-color: var(--gold); }
.slot .key { position: absolute; left: 3px; top: 1px; font-size: 10px; color: var(--ink-dim); text-shadow: 0 1px 1px #000; }
.slot .lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 9px; padding: 2px; color: #f3e6c2; }
.slot .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.7); }
.slot .cdt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; text-shadow: 0 0 4px #000; }
.slot.nomp .lbl { color: #7a8bd0; }
.minimap { position: fixed; right: 14px; top: 14px; width: 200px; padding: 6px; }
.minimap canvas { display: block; width: 188px; height: 188px; background: #0b0a08; border-radius: 2px; }
.minimap .mn { text-align: center; font-size: 12px; color: var(--gold); margin-bottom: 4px; }
.minimap .co { text-align: center; font-size: 10px; color: var(--ink-dim); margin-top: 3px; }
.chatlog { position: fixed; left: 14px; bottom: 26px; width: 420px; max-height: 190px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  font-size: 12px; line-height: 1.45; text-shadow: 0 1px 2px #000, 0 0 3px #000; pointer-events: none; }
.chatlog .l-sys { color: #f2d77c; } .chatlog .l-dmg { color: #ff9b87; } .chatlog .l-exp { color: #9fe07c; } .chatlog .l-item { color: #86c7ff; } .chatlog .l-err { color: #ff6b5a; }
.floaters { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.floater { position: absolute; font-weight: 800; font-size: 20px; text-shadow: 0 0 3px #000, 0 2px 2px #000; white-space: nowrap; transform: translate(-50%, -50%); }
.floater.dmg-out { color: #fff2a8; } .floater.dmg-in { color: #ff5a4a; } .floater.crit { color: #ffcc33; font-size: 28px; } .floater.heal { color: #7ef08a; } .floater.miss { color: #c9c9c9; font-size: 16px; } .floater.exp { color: #b5f07a; font-size: 15px; }
.nameplates { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.nameplate { position: absolute; transform: translate(-50%, -100%); font-size: 12px; text-shadow: 0 0 3px #000, 0 1px 2px #000; white-space: nowrap; text-align: center; }
.nameplate .hpb { width: 60px; height: 4px; margin: 2px auto 0; background: rgba(0,0,0,.7); border: 1px solid #000; }
.nameplate .hpb > i { display: block; height: 100%; background: #d23a2e; }
.nameplate.npc { color: #9fd6ff; } .nameplate.mon { color: #ffe8b0; } .nameplate.mon.aggr { color: #ff9c8a; } .nameplate.player { color: #fff; }
.window { position: fixed; min-width: 280px; padding: 12px 14px; }
.window .close { position: absolute; right: 6px; top: 4px; padding: 0 8px; font-size: 16px; background: none; border: none; box-shadow: none; }
.statgrid { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 12px; font-size: 13px; align-items: center; }
.statgrid .k { color: var(--ink-dim); } .statgrid button { padding: 0 6px; }
.maplist { max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: 3px; }
.maplist button { text-align: left; padding: 5px 10px; }
.deathbox { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); padding: 20px 28px; text-align: center; }
.toast { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); font-family: Georgia, serif; font-size: 30px; color: var(--gold); text-shadow: 0 0 12px #000, 0 2px 3px #000; pointer-events: none; transition: opacity .6s; }
.fps { position: fixed; right: 14px; bottom: 14px; font: 11px monospace; color: #9a9; pointer-events: none; text-shadow: 0 1px 1px #000; }
.help { position: fixed; right: 14px; top: 250px; width: 200px; padding: 8px 10px; font-size: 11px; line-height: 1.6; color: var(--ink-dim); }
.help b { color: var(--ink); }

/* =====================================================================================================
   Dekaron HUD + windows (src/ui/hud.js, src/ui/windows.js). Layout follows script/ui/game2 window scripts
   (1024x768 reference, pixel sizes kept 1:1). Elements get class "art" once their original sprite is
   painted; the rules below are the CSS fallback look until then.
   ===================================================================================================== */
#ui .dk-hit { pointer-events: auto; }
.dk-hud, .dk-winlayer, .dk-top { position: fixed; inset: 0; font: 11px Tahoma, Verdana, "Segoe UI", sans-serif; color: #fff; }
.dk-hud { z-index: 1; } .dk-winlayer { z-index: 7; } .dk-top { z-index: 9; }
.dk-hud .hidden, .dk-winlayer .hidden { display: none !important; }
.dk-hud .art, .dk-winlayer .art { background-repeat: no-repeat; }
.dk-plates, .dk-floaters { position: fixed; inset: 0; overflow: hidden; }

/* ---------- EXP bar (ui_mainmenuwnd pan_exp: screen bottom, 12 px) ---------- */
.dk-expbar { position: fixed; left: 0; right: 0; bottom: 0; height: 12px; display: flex; z-index: 3; }
.dk-exp-l { width: 351px; height: 12px; flex: none; }
.dk-exp-c { flex: 1; height: 12px; }
.dk-exp-r { width: 173px; height: 12px; flex: none; }
.dk-expbar:not(.art) > .dk-exp-l:not(.art), .dk-expbar > .dk-exp-c:not(.art), .dk-expbar > .dk-exp-r:not(.art) { background: linear-gradient(#2b2720, #0d0c0a); border-top: 1px solid #5a4a2a; }
.dk-exp-fill { position: absolute; left: 0; top: 4px; height: 5px; width: 0; }
.dk-exp-fill:not(.art) { background: linear-gradient(#7fd0ff, #1f6bd1); }
.dk-exp-grid { position: absolute; left: 0; right: 0; top: 3px; height: 6px; opacity: .85; }
.dk-exp-text { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap; padding: 2px 8px;
  background: rgba(0,0,0,.75); border: 1px solid #5a4a2a; color: #e8dcb6; opacity: 0; transition: opacity .15s; pointer-events: none; }
.dk-expbar:hover .dk-exp-text { opacity: 1; }

/* ---------- quick-slot bar (ui_quickslotwnd, 44x48 cells) ---------- */
.dk-quick { position: fixed; left: 0; bottom: 9px; height: 48px; display: flex; z-index: 4; }
.dk-q-front { width: 3px; height: 48px; flex: none; }
.dk-q-front:not(.art) { background: #3a3222; }
.dk-q-rear { position: relative; width: 51px; height: 48px; flex: none; }
.dk-q-rear:not(.art) { background: linear-gradient(#2a241a, #120f0a); border: 1px solid #4a3c22; }
.dk-q-btn { position: absolute; left: 4px; width: 11px; height: 11px; cursor: pointer; }
.dk-q-up { top: 4px; } .dk-q-down { top: 33px; }
.dk-q-page { display: none; } /* lbl_controltype sits under the HP window in the original layout */
.dk-q-btn2 { position: absolute; left: 18px; width: 17px; height: 23px; cursor: pointer; }
.dk-q-set { top: 1px; } .dk-q-lock { top: 24px; }
.dk-q-btn2:not(.art) { border: 1px solid #6a5630; background: #2a2418; }
.dk-slot { position: relative; width: 44px; height: 48px; flex: none; cursor: pointer; }
.dk-slot:not(.art) { background: rgba(10,9,7,.85); border: 1px solid #4a3c22; }
.dk-slot-icon { position: absolute; left: 2px; top: 4px; width: 40px; height: 40px; background-size: 100% 100%; }
.dk-slot-lbl { position: absolute; left: 2px; top: 4px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 9px; line-height: 10px; color: #f3e6c2; overflow: hidden; padding: 1px; }
.dk-slot-cool { position: absolute; left: 2px; top: 4px; width: 40px; height: 40px; }
.dk-slot-cdt { position: absolute; left: 2px; top: 4px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  font: bold 15px Tahoma, sans-serif; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.dk-slot-key { position: absolute; left: 4px; top: 4px; font: bold 10px Tahoma, sans-serif; color: #fff; text-shadow: 1px 1px 0 #000, -1px 0 0 #000, 0 -1px 0 #000; pointer-events: none; }
.dk-slot-over, .dk-slot-press { position: absolute; left: 0; top: 2px; width: 44px; height: 44px; display: none; pointer-events: none; }
.dk-slot:hover .dk-slot-over { display: block; }
.dk-slot.pressed .dk-slot-press, .dk-slot:active .dk-slot-press { display: block; }
.dk-slot-over:not(.art) { border: 1px solid #f3d27a; }
.dk-slot-press:not(.art) { border: 1px solid #fff; background: rgba(255,255,255,.12); }
.dk-slot.nomp .dk-slot-icon { filter: grayscale(1) brightness(.55) sepia(.4) hue-rotate(185deg) saturate(2.2); }
.dk-slot.nomp .dk-slot-key { color: #8fb1ff; }
.dk-slot.locked .dk-slot-icon { filter: grayscale(1) brightness(.4); }
.dk-slot.drop { outline: 1px solid #ffd76a; outline-offset: -3px; }
.dk-slot-cnt { position: absolute; right: 4px; bottom: 5px; font: bold 10px Tahoma, sans-serif; color: #fff; text-shadow: 1px 1px 0 #000, -1px 0 0 #000; pointer-events: none; }
.dk-slot.item .dk-slot-lbl { background: radial-gradient(circle at 50% 40%, #6a2a22, #2a0f0c 70%); color: #ffd9c8; font-weight: bold; }
.dk-slot.nostock .dk-slot-lbl, .dk-slot.nostock .dk-slot-icon { filter: grayscale(1) brightness(.5); }
.dk-slot.empty { cursor: default; }

/* ---------- HP / MP window (ui_hpwnd 287x80) ---------- */
.dk-hpwnd { position: fixed; left: 484px; bottom: 9px; width: 287px; height: 80px; z-index: 5; }
.dk-hp-caption { position: absolute; left: 58px; top: -3px; height: 12px; font-size: 10px; color: #e6cf8f; text-shadow: 0 0 2px #000, 1px 1px 0 #000; white-space: nowrap; }
.dk-hp-bg { position: absolute; left: 0; top: 10px; width: 287px; height: 70px; }
.dk-hp-bg:not(.art) { background: linear-gradient(#26221b, #0e0c09); border: 1px solid #5a4a2a; border-radius: 3px; }
.dk-pb { position: absolute; background-size: 100% 100%; }
.dk-pb-shield { left: 8px; top: 7px; height: 5px; width: 0; }
.dk-pb-hp { left: 43px; top: 17px; height: 10px; width: 233px; }
.dk-pb-mp { left: 43px; top: 32px; height: 10px; width: 233px; }
.dk-pb-hp:not(.art) { background: linear-gradient(#e2473d, #8e1510); }
.dk-pb-mp:not(.art) { background: linear-gradient(#4f86f0, #1b3d8f); }
.dk-pb-shield:not(.art) { background: #3fcf4a; }
.dk-lbl { position: absolute; white-space: nowrap; overflow: hidden; text-shadow: 1px 1px 0 #000, 0 0 2px #000; line-height: 12px; }
.dk-lbl-hp, .dk-lbl-mp { left: 41px; width: 233px; height: 12px; text-align: center; font-weight: bold; }
.dk-lbl-hp { top: 16px; } .dk-lbl-mp { top: 31px; }
.dk-hp-class { position: absolute; left: 9px; top: 17px; width: 27px; height: 25px; }
.dk-hp-lvl { left: 3px; top: 51px; width: 42px; height: 13px; text-align: center; }
.dk-hp-name { left: 58px; top: 51px; width: 131px; height: 13px; text-align: center; color: #fff4d0; }
.dk-hp-exp { left: 202px; top: 51px; width: 73px; height: 13px; text-align: center; font-weight: bold; color: #cfe8ff; }
.dk-hpwnd.low .dk-pb-hp { animation: dk-lowhp 0.9s ease-in-out infinite; }
@keyframes dk-lowhp { 50% { filter: brightness(1.8); } }

/* ---------- target plate (ui_targetpop pan_bg 196x49 at center top) ---------- */
.dk-target { position: fixed; left: calc(50% - 98px); top: 31px; width: 196px; height: 49px; z-index: 5; }
.dk-tgt-plate { position: absolute; left: 0; top: 0; width: 196px; height: 49px; background-size: 100% 100%; }
.dk-target.boss .dk-tgt-plate { left: -21px; top: -10px; width: 217px; height: 59px; }
.dk-tgt-plate:not(.art) { background: linear-gradient(#26221b, #0e0c09); border: 1px solid #6a5630; border-radius: 3px; }
.dk-tgt-name { position: absolute; left: 16px; top: 3px; width: 127px; height: 14px; text-align: center; font-weight: bold; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 #000; }
.dk-tgt-level { position: absolute; left: 0; top: 49px; width: 196px; text-align: center; font-size: 10px; text-shadow: 1px 1px 0 #000, 0 0 3px #000; color: #ddd; }
.dk-tgt-hp { position: absolute; left: 18px; top: 22px; width: 144px; height: 11px; background-size: 100% 100%; }
.dk-tgt-hp:not(.art) { background: linear-gradient(#e2473d, #8e1510); }
.dk-tgt-hptext { position: absolute; left: 18px; top: 22px; width: 144px; height: 11px; line-height: 11px; text-align: center; font-size: 9px; color: #fff; text-shadow: 1px 1px 0 #000; }
.dk-tgt-close { position: absolute; left: 146px; top: 5px; width: 13px; height: 14px; cursor: pointer; }
.dk-tgt-close:not(.art)::after { content: "x"; color: #caa; font-size: 10px; }
.dk-tgt-aggro { position: absolute; left: 10px; top: 11px; width: 13px; height: 13px; border-radius: 50%; display: none; pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #ff9a88, #c01a0a 60%, #500 100%); box-shadow: 0 0 6px #f30; }
.dk-tgt-aggro.on { display: block; }
.dk-target.npc .dk-tgt-hp, .dk-target.npc .dk-tgt-hptext { display: none; }
.dk-tgt-status { position: absolute; left: 12px; top: 62px; display: flex; gap: 0; }
.dk-tgt-status .dk-st { width: 22px; height: 22px; }
.dk-buffs { position: fixed; left: 486px; bottom: 110px; display: flex; gap: 2px; z-index: 5; }
.dk-st { position: relative; width: 30px; height: 30px; }
.dk-st-icon { position: absolute; inset: 0; background-size: 100% 100%; border: 1px solid rgba(0,0,0,.8);
  display: flex; align-items: center; justify-content: center; font-weight: bold; color: #fff; }
.dk-st-icon:not(.art) { background: radial-gradient(circle, #3a5a8a, #10203a); }
.dk-st-time { position: absolute; left: -4px; right: -4px; bottom: -12px; text-align: center; font-size: 9px; color: #fff; text-shadow: 1px 1px 0 #000, -1px 0 0 #000; }
.dk-st.ending .dk-st-icon { animation: dk-blinkop .5s steps(2, jump-none) infinite; }
@keyframes dk-blinkop { 50% { opacity: .35; } }
.dk-target.npc .dk-tgt-level { color: #e6cf8f; }
.dk-target.dead .dk-tgt-name { color: #888 !important; }

/* ---------- minimap (ui_minimapwnd 182x230, right top) ---------- */
.dk-mini { position: fixed; right: 0; top: 0; width: 182px; height: 230px; z-index: 5; }
.dk-mini.collapsed { height: 54px; }
.dk-mini.collapsed .dk-mm-panel { display: none; }
.dk-mm-top { position: absolute; left: 0; top: 0; width: 181px; height: 54px; }
.dk-mm-top:not(.art) { background: linear-gradient(#2a251c, #0e0c09); border: 1px solid #5a4a2a; border-radius: 3px; }
.dk-mm-sun { position: absolute; left: 11px; top: 13px; width: 38px; height: 31px; pointer-events: none; }
.dk-mm-name { position: absolute; left: 57px; top: 11px; width: 108px; height: 15px; line-height: 15px; text-align: center; font-weight: bold; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 0 #000; }
.dk-mm-pos { position: absolute; left: 57px; top: 36px; width: 76px; height: 15px; line-height: 15px; text-align: center; color: #fff; text-shadow: 1px 1px 0 #000; }
.dk-mm-btn { position: absolute; top: 34px; width: 15px; height: 19px; cursor: pointer; }
.dk-mm-btn:not(.art) { background: #2a2418; border: 1px solid #6a5630; color: #e8d9a8; font: bold 11px/17px Tahoma, sans-serif; text-align: center; }
.dk-mm-zin { left: 135px; } .dk-mm-zout { left: 150px; } .dk-mm-toggle { left: 165px; }
.dk-mm-zin:not(.art)::after { content: "+"; } .dk-mm-zout:not(.art)::after { content: "-"; } .dk-mm-toggle:not(.art)::after { content: "^"; }
.dk-mm-btn.art:hover { filter: brightness(1.3); }
.dk-mm-panel { position: absolute; left: 19px; top: 54px; width: 162px; height: 162px; }
.dk-mm-bg { position: absolute; left: 1px; top: 1px; width: 160px; height: 160px; }
.dk-mm-bg:not(.art) { background: #1c1a12; }
.dk-mm-canvas { position: absolute; left: 2px; top: 2px; width: 158px; height: 158px; }
.dk-mm-border { position: absolute; left: 0; top: 0; width: 162px; height: 162px; pointer-events: none; }
.dk-mm-border:not(.art) { border: 2px solid #5a4a2a; }

/* ---------- menu column (ui_mainmenuwnd, 76 px wide, right bottom) ---------- */
.dk-menu { position: fixed; right: 0; bottom: 57px; width: 76px; display: flex; flex-direction: column; z-index: 4; }
.dk-menu-panel { position: relative; width: 76px; flex: none; }
.dk-menu-top { height: 38px; } .dk-menu-mid { height: 263px; margin-top: -7px; } .dk-menu-bot { height: 38px; margin-top: -8px; }
.dk-menu-panel:not(.art) { background: linear-gradient(90deg, #1c1810, #0b0a07); border: 1px solid #4a3c22; }
.dk-menu-btn { position: absolute; width: 30px; height: 31px; cursor: pointer; }
.dk-menu-btn:not(.art) { background: #2c261a; border: 1px solid #6a5630; }
.dk-menu-btn.off { filter: grayscale(.85) brightness(.5); cursor: default; }

/* ---------- chat / system log ---------- */
.dk-chat { position: fixed; left: 4px; bottom: 64px; width: 380px; height: 178px; z-index: 3; }
.dk-chat-tabs { position: absolute; left: 0; top: 0; height: 17px; display: flex; gap: 2px; }
.dk-chat-tab { height: 17px; padding: 0 9px; line-height: 16px; font-size: 10px; color: #b9ad8c; cursor: pointer;
  background: rgba(0,0,0,.55); border: 1px solid #3c3222; border-bottom: none; border-radius: 3px 3px 0 0; }
.dk-chat-tab.on { color: #fff2c8; background: rgba(40,33,20,.85); border-color: #7a6232; }
.dk-chat-lines { position: absolute; left: 0; right: 0; top: 17px; bottom: 21px; overflow-y: auto; overflow-x: hidden; padding: 3px 6px;
  background: rgba(0,0,0,.32); border: 1px solid rgba(90,74,42,.5); scrollbar-width: thin; scrollbar-color: #5a4a2a transparent;
  line-height: 15px; text-shadow: 1px 1px 0 #000; user-select: text; }
.dk-line { white-space: pre-wrap; word-break: break-word; }
.dk-line.l-sys { color: #ffe08a; } .dk-line.l-dmg { color: #ffae8a; } .dk-line.l-exp { color: #a6f08a; }
.dk-line.l-item { color: #8fd0ff; } .dk-line.l-err { color: #ff6b5a; } .dk-line.l-chat { color: #fff; }
.dk-chat[data-filter="combat"] .dk-line:not(.l-dmg) { display: none; }
.dk-chat[data-filter="system"] .dk-line.l-dmg, .dk-chat[data-filter="system"] .dk-line.l-chat { display: none; }
.dk-chat-input { position: absolute; left: 0; right: 0; bottom: 0; height: 20px; width: 100% !important; padding: 1px 6px !important; font: 11px Tahoma, sans-serif !important;
  color: #fff !important; background: rgba(0,0,0,.8) !important; border: 1px solid #5a4a2a !important; border-radius: 0 !important; opacity: .35; }
.dk-chat-input.art { background-color: transparent !important; }
.dk-chat.typing .dk-chat-input, .dk-chat-input:focus { opacity: 1; }

/* ---------- toast / map title / level-up flash / death ---------- */
.dk-toast { position: fixed; left: 50%; top: 148px; transform: translateX(-50%); z-index: 8; text-align: center; white-space: nowrap;
  font: 26px Tahoma, Verdana, sans-serif; color: #f2d37a; letter-spacing: .08em; text-shadow: 0 0 10px #000, 0 2px 3px #000; }
.dk-maptitle { width: 512px; height: 85px; display: flex; align-items: center; justify-content: center; }
.dk-maptitle.art span { display: none; }
.dk-flash { position: fixed; inset: 0; z-index: 9; background: radial-gradient(ellipse at 50% 55%, rgba(255,226,140,.55), rgba(255,190,60,.18) 35%, transparent 65%); }
.dk-flash-text { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font: bold 44px Tahoma, Verdana, sans-serif; letter-spacing: .12em;
  color: #fff3c0; text-shadow: 0 0 18px #ffb400, 0 0 6px #ff7a00, 0 3px 3px #000; }
.dk-death { position: fixed; left: 50%; top: 40%; width: 232px; height: 182px; transform: translate(-50%, -50%); z-index: 10; text-align: center; background-size: 100% 100%; }
.dk-death:not(.art) { background: linear-gradient(#26221b, #0e0c09); border: 1px solid #6a5630; border-radius: 4px; }
.dk-death-title { position: absolute; left: 28px; top: 3px; width: 174px; height: 14px; font-weight: bold; color: #f3e3b3; }
.dk-death-msg { position: absolute; left: 0; top: 52px; width: 232px; font-size: 13px; font-weight: bold; color: #ff8a70; text-shadow: 1px 1px 0 #000; }
.dk-death-sub { position: absolute; left: 14px; right: 14px; top: 78px; color: #d8cfb8; line-height: 15px; }
.dk-death-btn { position: absolute; left: 56px; top: 134px; width: 120px; }

/* ---------- misc ---------- */
.dk-fps { position: fixed; left: 6px; top: 4px; font: 10px Consolas, monospace; color: #9fc79f; text-shadow: 1px 1px 0 #000; z-index: 3; }
.dk-help { position: fixed; left: 4px; top: 18px; width: 214px; z-index: 3; background: rgba(0,0,0,.55); border: 1px solid #4a3c22; border-radius: 3px; }
.dk-help-head { display: flex; justify-content: space-between; padding: 3px 8px; cursor: pointer; color: #e6cf8f; font-weight: bold; }
.dk-help-arrow::after { content: "\25B2"; font-size: 8px; }
.dk-help.collapsed .dk-help-arrow::after { content: "\25BC"; }
.dk-help.collapsed .dk-help-body { display: none; }
.dk-help-body { padding: 2px 8px 6px; color: #cfc6b0; line-height: 15px; }
.dk-help-line { display: flex; justify-content: space-between; gap: 8px; }
.dk-help-line b { color: #fff; font-weight: bold; white-space: nowrap; }
.dk-help-line span { text-align: right; }

/* ---------- floating combat text + name plates ---------- */
.dk-float { position: absolute; left: 0; top: 0; white-space: nowrap; font: bold 20px Tahoma, Verdana, sans-serif; will-change: transform, opacity;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 0 0 4px #000; pointer-events: none; }
.dk-float.dmg-out { color: #ffe36b; }
.dk-float.dmg-in { color: #ff4a36; }
.dk-float.crit { color: #ff9a1a; font-size: 30px; }
.dk-float.heal { color: #6cff7e; }
.dk-float.miss { color: #d8d8d8; font-size: 16px; font-style: italic; }
.dk-float.exp { color: #b8ff6a; font-size: 14px; }
.dk-float.heal.mp { color: #6fb6ff; }
.dk-float.guard { color: #9fc4ff; font-size: 16px; }
.dk-float.dot { color: #e6a0ff; font-size: 15px; }
.dk-plate { position: absolute; left: 0; top: 0; text-align: center; white-space: nowrap; font: 11px Tahoma, Verdana, sans-serif; pointer-events: none;
  padding: 0 3px; border: 4px solid transparent; text-shadow: 1px 1px 0 #000; will-change: transform; }
.dk-plate:not(.art) { background: rgba(0,0,0,.8); background-clip: padding-box; }
.dk-plate-title:empty { display: none; }
.dk-plate.npc .dk-plate-name { color: #9be7ff; }
.dk-plate.npc .dk-plate-title { color: #e6cf8f; }
.dk-plate.player .dk-plate-name { color: #ffffff; }
/* Guild tag above a player's name; hidden while the player has no guild. */
.dk-plate-guild { font-size: 10px; color: #7cff7c; }
.dk-plate-guild:empty { display: none; }
.dk-plate.mon.boss .dk-plate-name { font-weight: bold; font-size: 12px; }
.dk-plate.targeted .dk-plate-name { font-weight: bold; }
.dk-plate-hp { width: 56px; height: 5px; margin: 2px auto 0; background: rgba(0,0,0,.7); border: 1px solid #000; display: none; }
.dk-plate-hp.on { display: block; }
.dk-plate-hp > i { display: block; height: 100%; width: 100%; background: linear-gradient(#ff6a50, #a8140c); }

/* ---------- windows ---------- */
.dk-winlayer { z-index: 7; }
.dk-win { position: fixed; display: flex; flex-direction: column; min-height: 90px; max-height: calc(100vh - 20px); color: #e8e2d0; }
.dk-win-bg { position: absolute; inset: 0; pointer-events: none; }
.dk-win-bg.art { background: rgba(0,0,0,.28) !important; background-clip: content-box !important; }
.dk-win-bg:not(.art) { background: rgba(16,14,11,.94); border: 1px solid #6a5630; border-radius: 4px; box-shadow: 0 8px 30px rgba(0,0,0,.7); }
.dk-win-head { position: relative; height: 28px; flex: none; display: flex; align-items: center; justify-content: center; cursor: move; }
.dk-win-title { font-weight: bold; color: #f6e7b8; letter-spacing: .04em; text-shadow: 1px 1px 0 #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 60px); }
.dk-win-close { position: absolute; right: 9px; top: 5px; width: 19px; height: 19px; cursor: pointer; }
.dk-win-close:not(.art)::after { content: "\2715"; color: #e8d9a8; font-size: 13px; line-height: 19px; display: block; text-align: center; }
.dk-win-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 8px 16px 18px; scrollbar-width: thin; scrollbar-color: #6a5630 transparent; }
.dk-btn { display: inline-flex; align-items: center; justify-content: center; height: 20px; min-width: 65px; padding: 0 10px; cursor: pointer; user-select: none;
  color: #f3e6c4; font-weight: bold; text-shadow: 1px 1px 0 #000; background-size: 100% 100%; white-space: nowrap; }
.dk-btn:not(.art) { background: linear-gradient(#4a3d24, #1d170d); border: 1px solid #8d7437; border-radius: 2px; }
.dk-btn:hover { color: #fff; }
.dk-btn.off { filter: grayscale(1) brightness(.6); cursor: default; }
.dk-plus { min-width: 20px; width: 20px; padding: 0; }
.dk-sect { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 5px; padding-bottom: 2px; color: #e6c46e; font-weight: bold;
  border-bottom: 1px solid rgba(160,130,70,.45); }
.dk-sect:first-child { margin-top: 2px; }
.dk-empty { color: #9a927e; padding: 10px; text-align: center; }
.dk-input { font: 11px Tahoma, sans-serif; color: #fff; background: rgba(0,0,0,.6); border: 1px solid #6a5630; padding: 3px 6px; outline: none; }
.dk-input:focus { border-color: #d9b45a; }
.dk-range { accent-color: #d9b45a; width: 130px; }
.dk-check { accent-color: #d9b45a; margin: 0 6px 0 0; }

/* character */
.dk-ch-head { display: flex; align-items: center; gap: 10px; }
.dk-ch-icon { width: 27px; height: 25px; flex: none; }
.dk-ch-name { font-size: 14px; font-weight: bold; color: #fff4d0; }
.dk-ch-class { color: #cdbf98; }
.dk-ch-exp { margin-top: 8px; }
.dk-ch-expbar { height: 7px; background: #0a0908; border: 1px solid #4a3c22; }
.dk-ch-expbar > i { display: block; height: 100%; width: 0; background: linear-gradient(#8ad6ff, #1f6bd1); }
.dk-ch-exptext { margin-top: 2px; color: #b8d8f0; font-size: 10px; text-align: right; }
.dk-ch-points.has { color: #7cff6a; }
.dk-ch-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.dk-ch-stat { display: flex; align-items: center; gap: 6px; }
.dk-ch-key { width: 30px; color: #cdbf98; font-weight: bold; }
.dk-ch-val { flex: 1; text-align: right; color: #fff; font-weight: bold; }
.dk-ch-derived { display: flex; flex-direction: column; gap: 2px; }
.dk-ch-drow { display: flex; justify-content: space-between; }
.dk-ch-drow > span:first-child { color: #b9ad8c; }
.dk-ch-dval { color: #fff; }
.dk-ch-foot { display: flex; flex-direction: column; gap: 3px; color: #cfc6b0; }
.dk-dil { color: #ffd76a; font-weight: bold; }

/* skills */
.dk-win[data-win="skills"] .dk-win-body, .dk-win[data-win="map"] .dk-win-body { display: flex; flex-direction: column; overflow: hidden; }
.dk-sk-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; padding-right: 3px; scrollbar-width: thin; scrollbar-color: #6a5630 transparent; }
.dk-sk-row { display: flex; align-items: center; gap: 8px; padding: 4px; border: 1px solid rgba(90,74,42,.55); background: rgba(0,0,0,.35); cursor: pointer; }
.dk-sk-row:hover { border-color: #a88a4a; background: rgba(60,48,26,.4); }
.dk-sk-row.picked { border-color: #ffd76a; box-shadow: inset 0 0 8px rgba(255,215,106,.35); }
.dk-sk-row.locked { opacity: .62; }
.dk-sk-icon { width: 40px; height: 40px; flex: none; background-size: 100% 100%; border: 1px solid #000; cursor: grab; }
.dk-sk-icon:not(.art) { background: #1a1712; }
.dk-sk-icon.grey { filter: grayscale(1) brightness(.6); }
.dk-sk-text { flex: 1; min-width: 0; }
.dk-sk-top { display: flex; justify-content: space-between; gap: 6px; }
.dk-sk-name { font-weight: bold; color: #fff2c8; }
.dk-sk-lvl { color: #9fd0ff; font-size: 10px; white-space: nowrap; }
.dk-sk-info { color: #cdbf98; font-size: 10px; margin-top: 1px; }
.dk-sk-desc { color: #a9a08a; font-size: 10px; margin-top: 1px; line-height: 12px; max-height: 24px; overflow: hidden; }
.dk-sk-foot { flex: none; margin-top: 8px; }
.dk-sk-foot-row { display: flex; justify-content: space-between; color: #e6c46e; font-weight: bold; margin-bottom: 4px; }
.dk-sk-sp { color: #7cff6a; }
.dk-sk-mini { display: flex; gap: 3px; }
.dk-mini-slot { position: relative; width: 31px; height: 31px; background: rgba(0,0,0,.6); border: 1px solid #5a4a2a; cursor: pointer; }
.dk-mini-slot.target { border-color: #ffd76a; animation: dk-blink 1s ease-in-out infinite; }
.dk-mini-slot.drop { border-color: #fff; }
.dk-mini-icon { position: absolute; inset: 1px; background-size: 100% 100%; }
.dk-mini-icon.item { display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: bold; color: #ffd9c8;
  background: radial-gradient(circle at 50% 40%, #6a2a22, #2a0f0c 70%); }
.dk-mini-slot > span { position: absolute; left: 2px; top: 0; font-size: 9px; font-weight: bold; text-shadow: 1px 1px 0 #000; }
.dk-sk-hint { margin-top: 5px; color: #9a927e; font-size: 10px; line-height: 12px; }
@keyframes dk-blink { 50% { box-shadow: 0 0 6px #ffd76a; } }

/* inventory */
.dk-inv-grid { display: grid; grid-template-columns: repeat(8, 40px); gap: 2px; justify-content: center; }
.dk-inv-cell { position: relative; width: 40px; height: 40px; background: linear-gradient(#15130f, #0a0908); border: 1px solid #3c3222; overflow: hidden; }
.dk-inv-cell.full { background: linear-gradient(#3a3020, #1a150c); border-color: #7a6232; cursor: pointer; }
.dk-inv-cell.full:hover { border-color: #ffd76a; }
.dk-inv-cell.g-magic .dk-inv-name { color: #7fb8ff; } .dk-inv-cell.g-magic { border-color: #3a68b0; }
.dk-inv-cell.g-noble .dk-inv-name { color: #ffe070; } .dk-inv-cell.g-noble { border-color: #b09030; }
.dk-inv-cell.g-divine .dk-inv-name { color: #ff8ae0; } .dk-inv-cell.g-divine { border-color: #b04a98; }
.dk-inv-name { position: absolute; inset: 2px; font-size: 8px; line-height: 9px; color: #f3e6c2; text-align: center; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dk-inv-count { position: absolute; right: 2px; bottom: 0; font-size: 9px; font-weight: bold; color: #fff; text-shadow: 1px 1px 0 #000; }
.dk-inv-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding: 4px 6px; background: rgba(0,0,0,.4); border: 1px solid #4a3c22; }
.dk-dil-ico { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2a8, #d9a520 60%, #7a5a10); color: #5a3a00; font-size: 9px; line-height: 14px; text-align: center; }
.dk-inv-used { color: #9a927e; }
.dk-inv-hint { margin-top: 5px; color: #9a927e; font-size: 10px; }

/* world map */
.dk-map-cur { color: #cdbf98; margin-bottom: 6px; }
.dk-map-top { display: flex; flex-direction: column; gap: 5px; flex: none; }
.dk-tabs { display: flex; gap: 2px; }
.dk-tab { flex: 1; height: 22px; line-height: 22px; text-align: center; cursor: pointer; color: #b9ad8c; background-size: 100% 100%; white-space: nowrap; font-size: 10px; }
.dk-tab:not(.art) { background: #1b1711; border: 1px solid #4a3c22; }
.dk-tab.on { color: #fff2c8; font-weight: bold; filter: brightness(1.35); }
.dk-map-list { flex: 1; min-height: 0; overflow-y: auto; margin-top: 6px; display: flex; flex-direction: column; gap: 1px; scrollbar-width: thin; scrollbar-color: #6a5630 transparent; }
.dk-map-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; cursor: pointer; background: rgba(0,0,0,.3); border: 1px solid transparent; }
.dk-map-row:hover { background: rgba(80,64,32,.45); border-color: #a88a4a; }
.dk-map-row.current { border-color: #ffd76a; }
.dk-map-row.current .dk-map-name::after { content: "  (here)"; color: #ffd76a; font-size: 10px; }
.dk-map-name { color: #fff2c8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-map-lv { color: #9fd0ff; white-space: nowrap; font-size: 10px; }
.dk-map-lv.bad { color: #ff7a60; }

/* options */
.dk-opt-row { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.dk-opt-label { width: 96px; color: #cdbf98; }
.dk-opt-val { width: 38px; text-align: right; color: #fff; }
.dk-opt-check { cursor: pointer; color: #e8e2d0; }
.dk-opt-buttons { display: flex; justify-content: center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }

/* NPC dialog */
.dk-npc-title { color: #e6c46e; font-style: italic; text-align: center; margin-bottom: 6px; }
.dk-npc-greet { white-space: pre-wrap; line-height: 16px; font-size: 12px; color: #fff; padding: 8px 10px; background: rgba(0,0,0,.4); border: 1px solid #4a3c22; min-height: 64px; }
.dk-npc-opts { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.dk-npc-opt { padding: 4px 8px; color: #9be7ff; cursor: pointer; border: 1px solid transparent; }
.dk-npc-opt:hover { color: #fff; background: rgba(80,64,32,.45); border-color: #a88a4a; }
.dk-npc-msg { margin-top: 6px; color: #ffcf8a; min-height: 14px; }
