/* MapleStory-style interface: small draggable windows (navy frame, lime title, cyan tabs, light slot grids),
   frosted-glass menus and login screens, bottom status bar. All icons are Zenonia 5 game art (see UI.zi). */
:root {
  --f: "Malgun Gothic", "Segoe UI", Arial, sans-serif; --ft: "Arial Black", "Segoe UI Black", "Malgun Gothic", sans-serif;
  --frame1: #4b5967; --frame2: #2a343e; --edge: #161c23; --title: #e3f26a; --cy1: #5ad3ea; --cy2: #23a6c8; --cyb: #1b87a7;
  --lime1: #b9dc3c; --lime2: #83ac17; --gray1: #8e98a1; --gray2: #69737d; --panel: #e8ecef; --panel2: #f4f6f7; --slot1: #e6eaed; --slot2: #d2d8dd;
  --ink: #3c4650; --ink2: #6b7680; --ink3: #9aa4ad;
}
* { box-sizing: border-box; -webkit-user-select: none; user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; font-family: var(--f); color: var(--ink); font-size: 13px; }
#game { position: absolute; left: 50%; top: 50%; width: 1600px; height: 900px; /* real size set by Game.resize() */ transform-origin: 0 0; background: #0b1016; overflow: hidden; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; }
#ui, #winLayer, #sheetLayer, #toasts, #modalLayer, #tipLayer { position: absolute; inset: 0; pointer-events: none; }
#ui > *, #winLayer > *, #sheetLayer > *, #modalLayer > * { pointer-events: auto; }
#winLayer { z-index: 30; } #modalLayer { z-index: 50; } #tipLayer { z-index: 70; } #toasts { z-index: 60; }
.hide { display: none !important; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; padding: 0; }
svg.ico { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.12em; }
.zi { display: inline-block; background-repeat: no-repeat; image-rendering: auto; vertical-align: middle; flex: 0 0 auto; }

/* ---------------------------------------------------------------- window */
.mw { position: absolute; padding: 0 7px 7px; border-radius: 7px; background: linear-gradient(180deg, var(--frame1), var(--frame2) 70%); border: 1px solid var(--edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 1px rgba(255, 255, 255, .06), 0 6px 18px rgba(0, 0, 0, .55); color: var(--ink); }
.mw .mt { height: 30px; display: flex; align-items: center; padding: 0 3px; cursor: move; }
.mw .mt b { font: 900 13px var(--ft); color: var(--title); letter-spacing: .2px; text-shadow: 0 1px 0 #000; text-transform: uppercase; flex: 1; }
.mw .mt .x { width: 18px; height: 18px; color: #aab4bd; font-size: 15px; line-height: 16px; text-align: center; } .mw .mt .x:hover { color: #fff; }
.mw .mt .mn { width: 16px; color: #aab4bd; font-weight: 700; text-align: center; }
.mw.focus { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 1px #7d8b98, 0 8px 22px rgba(0, 0, 0, .6); }
.mw .body { position: relative; }
.mw.teal { background: linear-gradient(180deg, #46b0c8, #1f7f99); border-color: #135467; }
.mw.brown { background: linear-gradient(180deg, #5a4a3c, #3a2f26); border-color: #1d1712; }

/* tabs */
.mtabs { display: flex; gap: 3px; margin-bottom: 4px; }
.mtab { flex: 1; height: 26px; border-radius: 5px 5px 0 0; font: 700 13px var(--f); color: #cfd6dc; background: linear-gradient(180deg, #6c7680, #4b545d); border: 1px solid #333c45; border-bottom: 0;
  display: flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; text-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.mtab:hover { filter: brightness(1.12); }
.mtab.on { color: #fff; background: linear-gradient(180deg, var(--cy1), var(--cy2)); border-color: var(--cyb); }
.mtab small { font-size: 11px; opacity: .85; margin-left: 3px; }

/* light content panel */
.mpanel { background: var(--panel); border-radius: 5px; border: 1px solid #c4cbd1; box-shadow: inset 0 1px 0 #fff; padding: 8px; position: relative; }
.msub { background: var(--panel2); border: 1px solid #d3d9de; border-radius: 4px; }
.mlabel { font: 900 12px var(--ft); color: #4d5862; letter-spacing: .2px; text-transform: uppercase; }
.mnote { color: #8b959e; font-size: 12px; text-align: center; line-height: 1.5; }
.mnote em { font-style: normal; color: #4fb6d3; font-weight: 700; } .mnote strong { color: #555f69; }
.mdiv { height: 1px; background: #d3d9de; margin: 6px 0; }
.kvr { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; font-size: 13px; border-bottom: 1px dashed #d6dce1; }
.kvr span { color: #6b7680; } .kvr b { color: #3b4550; }
.kvr .up { color: #2fa7c7; } .kvr .dn { color: #e0565e; }

/* slots */
.slot { position: relative; width: 38px; height: 38px; border-radius: 4px; background: linear-gradient(180deg, var(--slot1), var(--slot2)); border: 1px solid #c1c8ce; box-shadow: inset 0 1px 0 #f7f9fa;
  display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; }
.slot:hover { border-color: #7fcde3; }
.slot.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 3px #39b3d4; }
.slot.cy { background: linear-gradient(180deg, #6fd5ec, #3fbbd9); border-color: #2a9cbc; }
.slot.empty { cursor: default; } .slot.empty:hover { border-color: #c1c8ce; }
.slot .q { position: absolute; right: 1px; bottom: 0; font: 700 10px var(--f); color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.slot .pl { position: absolute; left: 1px; top: 0; font: 700 10px var(--f); color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.slot .rar { position: absolute; inset: 0; border-radius: 3px; pointer-events: none; }
.slot .new { position: absolute; left: 0; top: 0; width: 8px; height: 8px; border-radius: 50%; background: #ff5b5b; border: 1px solid #fff; }
.slot .xx { position: absolute; right: 1px; top: -1px; font-size: 11px; color: #fff; text-shadow: 0 0 2px #000; }
.slot.lock::after { content: ""; position: absolute; inset: 0; background: rgba(230, 234, 237, .55); border-radius: 3px; }
.grid { display: grid; gap: 4px; }

/* buttons */
.mb { height: 26px; padding: 0 14px; border-radius: 13px; font: 700 13px var(--f); color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap;
  background: linear-gradient(180deg, var(--cy1), var(--cy2)); border: 1px solid var(--cyb); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 1px 2px rgba(0, 0, 0, .35); cursor: pointer; }
.mb:hover { filter: brightness(1.08); } .mb:active { transform: translateY(1px); }
.mb.gray { background: linear-gradient(180deg, var(--gray1), var(--gray2)); border-color: #555e67; }
.mb.dark { background: linear-gradient(180deg, #67727c, #4a535c); border-color: #39424a; }
.mb.lime { background: linear-gradient(180deg, var(--lime1), var(--lime2)); border-color: #6b8f12; }
.mb.white { background: #fff; color: #6b7680; text-shadow: none; border-color: #d6dce1; }
.mb.sm { height: 22px; padding: 0 10px; font-size: 12px; }
.mb.big { height: 34px; border-radius: 17px; font-size: 15px; padding: 0 26px; }
.mb.off { opacity: .45; pointer-events: none; filter: grayscale(.6); }
.mb.sq { width: 22px; height: 22px; padding: 0; border-radius: 4px; }
.pillnum { display: inline-flex; gap: 4px; } .pillnum i { width: 20px; height: 20px; border-radius: 4px; font: 700 11px var(--f); font-style: normal; display: grid; place-items: center; background: linear-gradient(180deg, #a7b1ba, #87919b); color: #fff; }
.pillnum i.on { background: linear-gradient(180deg, var(--cy1), var(--cy2)); }
.mbar { position: relative; height: 10px; border-radius: 5px; background: #cfd5da; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2); }
.mbar > i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #7fdcf0, #2aaccd); border-radius: 5px; }
.mbar.lime > i { background: linear-gradient(180deg, #d0ea5a, #93bb1e); }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #6b7680; cursor: pointer; }
.chk::before { content: ""; width: 12px; height: 12px; border: 1px solid #9aa4ad; border-radius: 2px; background: #fff; }
.chk.on::before { background: #39b3d4; border-color: #1e8eae; box-shadow: inset 0 0 0 2px #fff; }
.toggle { width: 30px; height: 14px; border-radius: 7px; background: #9aa4ad; position: relative; cursor: pointer; display: inline-block; vertical-align: middle; }
.toggle::after { content: ""; position: absolute; left: 2px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: #fff; transition: .15s; }
.toggle.on { background: #39b3d4; } .toggle.on::after { left: 18px; }
.sel-pill { height: 24px; border-radius: 12px; background: linear-gradient(180deg, #8f99a2, #737d87); color: #fff; font: 700 12px var(--f); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; cursor: pointer; }
.field { height: 26px; border-radius: 13px; background: #2b333b; color: #fff; display: flex; align-items: center; gap: 6px; padding: 0 10px; font: 700 13px var(--f); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5); }
.field b { flex: 1; text-align: right; }
input.min { height: 26px; border-radius: 13px; border: 1px solid #c4cbd1; background: #fff; padding: 0 12px; font: 13px var(--f); color: var(--ink); outline: none; -webkit-user-select: text; user-select: text; }
input[type=range].mr { -webkit-appearance: none; height: 6px; border-radius: 3px; background: #c6cdd3; outline: none; width: 100%; }
input[type=range].mr::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(180deg, var(--cy1), var(--cy2)); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); cursor: pointer; }

/* rows (quest/achievement, list windows) */
.mrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; background: linear-gradient(180deg, #56636f, #434e58); border: 1px solid #2f3842; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); color: #fff; margin-bottom: 6px; }
.mrow .ib { width: 54px; height: 54px; border-radius: 6px; background: linear-gradient(180deg, #4a5560, #353e47); border: 1px solid #222a32; display: grid; place-items: center; flex: 0 0 auto; position: relative; }
.mrow .ib .pts { position: absolute; bottom: 1px; width: 100%; text-align: center; font: 900 12px var(--ft); color: #fff; }
.mrow h4 { margin: 0; font: 700 14px var(--f); color: #fff; } .mrow p { margin: 2px 0 0; font-size: 12px; color: #b9c3cc; }
.mrow.light { background: #fff; border-color: #d3d9de; color: var(--ink); box-shadow: none; } .mrow.light h4 { color: #3c4650; } .mrow.light p { color: #8b959e; }
.mrow.done { opacity: .6; }
.mrow .mbar { background: #2a333b; height: 8px; }

/* tooltip (dark) */
.mtip { position: absolute; min-width: 230px; max-width: 300px; background: rgba(27, 36, 48, .94); border: 1px solid #5f6d7c; border-radius: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, .6); color: #e6ebef; padding: 10px 12px; font-size: 12px; pointer-events: none; }
.mtip h5 { margin: 0; text-align: center; font: 700 15px var(--f); color: #fff; } .mtip .tsub { text-align: center; color: #ffa53a; font-size: 12px; margin: 2px 0 6px; }
.mtip .tbody { display: flex; gap: 10px; align-items: flex-start; } .mtip .tico { width: 74px; height: 74px; border-radius: 4px; background: linear-gradient(180deg, #e4e8eb, #b7c0c8); display: grid; place-items: center; flex: 0 0 auto; }
.mtip .tl { line-height: 1.5; } .mtip .tl b { color: #fff; } .mtip .g { color: #8fe36a; } .mtip .r { color: #ff7a7a; } .mtip .c { color: #6fd2ff; } .mtip .o { color: #ffb13a; }
.mtip hr { border: 0; border-top: 1px dashed #5f6d7c; margin: 6px 0; }

/* popup (teal, like the slot-expansion dialog) */
.mdim { position: absolute; inset: 0; background: rgba(0, 0, 0, .35); display: grid; place-items: center; }
.mpop { width: 400px; border-radius: 9px; padding: 0 8px 10px; background: linear-gradient(180deg, #4ab6cf, #22839e); border: 1px solid #15596b; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 30px rgba(0, 0, 0, .55); }
.mpop .mt { height: 38px; display: flex; align-items: center; padding: 0 6px; } .mpop .mt b { font: 900 17px var(--f); color: #f2f46a; text-shadow: 0 1px 0 #0b3e4c; }
.mpop .pb { background: #eef3f5; border-radius: 6px; padding: 12px; color: #4b5660; font-size: 13px; line-height: 1.5; max-height: 560px; overflow: auto; }
.mpop .pcard { background: #fff; border-radius: 6px; border: 1px solid #d3dde2; padding: 10px; margin-bottom: 8px; }
.mpop .pf { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }

/* chat / system log (bottom-left) */
.chat { position: absolute; left: 6px; bottom: 74px; width: 470px; }
.chat .ln { font: 13px var(--f); color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; padding: 1px 10px; animation: cfade 9s forwards; }
.chat .ln.y { color: #ffe95c; } .chat .ln.c { color: #8ae6ff; } .chat .ln.g { color: #b6f06a; }
.chat .box { height: 30px; border-radius: 4px; background: rgba(0, 0, 0, .55); display: flex; align-items: center; padding: 0 10px; color: #fff; font-size: 13px; gap: 8px; }
.chat .box span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .chat .box b { color: #c9d1d8; font-size: 18px; cursor: pointer; }
@keyframes cfade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- bottom status bar */
.sbar { position: absolute; left: 0; right: 0; bottom: 0; height: 74px; pointer-events: none; }
.sbar > * { pointer-events: auto; }
.lvbox { position: absolute; left: 0; bottom: 14px; width: 330px; height: 36px; background: linear-gradient(90deg, rgba(0, 0, 0, .72), rgba(0, 0, 0, .45)); display: flex; align-items: baseline; gap: 10px; padding: 4px 14px; color: #fff; }
.lvbox .lv { font: 700 15px var(--f); } .lvbox .lv b { font: 700 22px var(--f); margin-left: 2px; } .lvbox .nm { font: 15px var(--f); color: #e9edf1; }
.qmenu { position: absolute; left: 340px; bottom: 15px; display: flex; gap: 3px; }
.qb { width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #46525e, #232b33 75%); border: 1px solid #0f1418; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2); display: grid; place-items: center; color: #fff; font-size: 17px; cursor: pointer; position: relative; }
.qb:hover { filter: brightness(1.25); } .qb.on { box-shadow: 0 0 0 2px #5ad3ea; }
.qb .zi { pointer-events: none; }
.hpmp { position: absolute; left: 650px; bottom: 15px; width: 200px; }
.gauge { position: relative; height: 17px; border-radius: 3px; background: #262d35; border: 1px solid #0d1115; margin-bottom: 2px; overflow: hidden; }
.gauge i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #ff7aa0, #ec3b6c 60%, #c92458); }
.gauge.mp i { background: linear-gradient(180deg, #7ff0ff, #2bc4e0 60%, #1798b8); }
.gauge span { position: absolute; inset: 0; text-align: center; font: 700 11px/17px var(--f); color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.hotbar { position: absolute; right: 8px; bottom: 13px; display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; }
.hk { position: relative; width: 34px; height: 34px; border-radius: 3px; background: linear-gradient(180deg, #3a4652, #27303a); border: 1px solid #10161c; display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.hk .kl { position: absolute; left: 1px; top: -1px; font: 700 9px var(--f); color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; z-index: 2; }
.hk .cnt { position: absolute; right: 1px; bottom: -1px; font: 700 10px var(--f); color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; z-index: 2; }
.hk .cdv { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, .6); z-index: 1; }
.hk.off .zi { filter: grayscale(1) brightness(.6); } .hk.lk { opacity: .45; }
.hk.auto::after { content: "A"; position: absolute; right: 1px; top: -1px; font: 900 9px var(--ft); color: #ffe95c; text-shadow: 0 0 2px #000; z-index: 2; }
.expbar { position: absolute; left: 0; right: 0; bottom: 0; height: 11px; background: #232a31; border-top: 1px solid #0c1014; }
.expbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(180deg, #e8f45a, #b6d31f); }
.expbar span { position: absolute; inset: 0; text-align: center; font: 700 9px/11px var(--f); color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }

/* minimap window (top-left) */
.mini { position: absolute; left: 6px; top: 6px; padding: 0 5px 5px; border-radius: 6px; background: rgba(24, 31, 39, .9); border: 1px solid #0d1116; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.mini .mh { height: 26px; display: flex; align-items: center; gap: 4px; color: #fff; font: 13px var(--f); }
.mini .mh .sq { width: 18px; height: 18px; border-radius: 3px; background: #3b4651; border: 1px solid #10161c; display: grid; place-items: center; color: #c5ced6; font: 700 13px var(--f); cursor: pointer; }
.mini .mh span { margin: 0 6px; white-space: nowrap; } .mini .mh span b { color: #ffe95c; font-weight: 400; margin-left: 6px; }
.mini canvas { display: block; border: 2px solid #c9d0d6; border-radius: 3px; }
.qhelp { position: absolute; right: 6px; top: 6px; min-width: 210px; border-radius: 6px; background: rgba(24, 31, 39, .9); border: 1px solid #0d1116; padding: 4px 10px 6px; color: #fff; }
.qhelp .qh { display: flex; align-items: center; gap: 8px; font: 900 12px var(--ft); color: #e3f26a; } .qhelp .qh i { font-style: normal; background: #3b4651; color: #fff; border-radius: 8px; padding: 0 6px; font: 700 11px var(--f); }
.qhelp .qi { font-size: 12px; color: #e6ebef; margin-top: 4px; } .qhelp .qi b { color: #ffe95c; font-weight: 400; } .qhelp .mbar { margin-top: 4px; height: 6px; background: #3a4550; }
.sidei { position: absolute; left: 14px; top: 318px; display: flex; flex-direction: column; gap: 10px; }
.sidei > div { width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; position: relative; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.sidei > div:hover { transform: scale(1.1); } .sidei .nw { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); background: #2aa6d0; color: #fff; font: 900 8px var(--ft); padding: 0 4px; border-radius: 6px; border: 1px solid #fff; }
.notice { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); text-align: center; pointer-events: none; animation: nfade 2.6s forwards; }
.notice b { display: block; font: 900 44px var(--ft); color: #ffe25c; -webkit-text-stroke: 2px #7a3b00; text-shadow: 0 3px 0 #5a2a00, 0 0 18px rgba(255, 200, 60, .6); letter-spacing: 1px; }
.notice small { display: inline-block; margin-top: 4px; font: 700 15px var(--f); color: #fff; background: rgba(0, 0, 0, .55); padding: 3px 16px; border-radius: 12px; }
@keyframes nfade { 0% { opacity: 0; transform: translate(-50%, 10px) scale(1.2); } 10% { opacity: 1; transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.nametag { position: absolute; transform: translate(-50%, 0); padding: 1px 7px; border-radius: 3px; background: rgba(0, 0, 0, .62); color: #fff; font: 12px var(--f); white-space: nowrap; pointer-events: none; }
.nametag.npc { background: rgba(0, 0, 0, .62); color: #fff; } .nametag small { display: block; text-align: center; color: #ffe95c; font-size: 11px; }
.nametag.me { background: rgba(255, 255, 255, .9); color: #2c3640; border: 1px solid #39b3d4; }
.prompt { position: absolute; transform: translate(-50%, -100%); padding: 3px 10px; border-radius: 4px; background: rgba(0, 0, 0, .7); color: #fff; font: 12px var(--f); pointer-events: none; white-space: nowrap; }
.prompt kbd { background: #39b3d4; border-radius: 3px; padding: 0 5px; margin-right: 5px; font: 700 11px var(--f); }

/* ---------------------------------------------------------------- frosted (MENU / login) */
.frost { position: absolute; border-radius: 22px; background: rgba(232, 242, 248, .72); border: 1px solid rgba(255, 255, 255, .85); box-shadow: 0 10px 40px rgba(0, 40, 70, .25), inset 0 1px 0 #fff; backdrop-filter: blur(12px) saturate(1.2); color: #5e6a74; }
.frost .ft { font: 900 17px var(--ft); color: #fff; text-shadow: 0 1px 3px rgba(40, 90, 120, .45); letter-spacing: .3px; text-transform: uppercase; padding: 18px 14px 8px; }
.fcard { background: rgba(255, 255, 255, .82); border-radius: 12px; border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 2px 8px rgba(40, 90, 120, .08); }
.fh { height: 34px; border-radius: 8px; background: linear-gradient(180deg, #54cbe8, #33b2d8); color: #fff; font: 700 15px var(--f); display: grid; place-items: center; text-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.fitem { display: flex; align-items: center; gap: 8px; padding: 5px 10px; font: 14px var(--f); color: #5e6a74; cursor: pointer; border-radius: 6px; }
.fitem:hover { background: rgba(84, 203, 232, .15); color: #2f3a44; } .fitem.dis { opacity: .4; pointer-events: none; }
.fitem span { flex: 1; font-size: 13px; } .kb { min-width: 16px; height: 16px; border-radius: 3px; background: #44c0e2; color: #fff; font: 700 10px var(--f); display: grid; place-items: center; padding: 0 3px; }
.fbtn { height: 38px; border-radius: 10px; background: rgba(255, 255, 255, .85); border: 1px solid #fff; color: #5e6a74; font: 14px var(--f); display: flex; align-items: center; gap: 8px; padding: 0 14px; cursor: pointer; }
.fbtn:hover { background: #fff; } .fbtn.purple { background: linear-gradient(180deg, #a77cf0, #8a5be0); color: #fff; } .fbtn.cyan { background: linear-gradient(180deg, #54cbe8, #33b2d8); color: #fff; }
.cbtn { height: 44px; border-radius: 22px; background: linear-gradient(180deg, #5ad3ee, #2fb4da); color: #fff; font: 15px var(--f); border: 1px solid rgba(255, 255, 255, .6); box-shadow: 0 4px 12px rgba(30, 140, 180, .35), inset 0 1px 0 rgba(255, 255, 255, .5); cursor: pointer; display: grid; place-items: center; }
.cbtn:hover { filter: brightness(1.06); } .cbtn.white { background: #fff; color: #6b7680; box-shadow: 0 4px 12px rgba(30, 90, 120, .15); }
.cbtn.huge { height: 62px; border-radius: 31px; font-size: 28px; }
.carrow { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(180deg, #54cbe8, #33b2d8); color: #fff; display: grid; place-items: center; cursor: pointer; font-weight: 700; }
.carrow:hover { filter: brightness(1.1); }
.cval { flex: 1; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .9); display: grid; place-items: center; font: 14px var(--f); color: #6b7680; }
.cval.on { background: linear-gradient(180deg, #54cbe8, #33b2d8); color: #fff; }
.swatch { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #33b2d8; }
.dpill { height: 36px; border-radius: 6px; background: rgba(40, 50, 60, .78); color: #fff; font: 14px var(--f); display: flex; align-items: center; gap: 6px; padding: 0 16px; cursor: pointer; border: 1px solid rgba(255, 255, 255, .25); }
.dpill:hover { background: rgba(40, 50, 60, .92); }
.wpill { height: 34px; border-radius: 6px; background: rgba(255, 255, 255, .78); color: #5e6a74; font: 14px var(--f); display: flex; align-items: center; gap: 6px; padding: 0 16px; cursor: pointer; border: 1px solid #fff; }
.wpill:hover { background: #fff; }
::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-thumb { background: #b4bcc3; border-radius: 3px; } ::-webkit-scrollbar-track { background: transparent; }

.mini { position: absolute; } .mmclock { position: absolute; right: 8px; bottom: 8px; padding: 1px 7px; border-radius: 3px; background: rgba(6, 12, 22, .72); border: 1px solid rgba(160, 200, 255, .25); font: 700 11px var(--f); color: #e8f1ff; pointer-events: auto; cursor: default; }

.nametag.pc { background: rgba(0, 0, 0, .55); color: #fff; } .nametag.pc small { display: block; text-align: center; color: #9fe0ff; font-size: 10px; }

/* ---- target HUD (other players) */
.tgt { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 30px 6px 6px; border-radius: 8px; background: linear-gradient(180deg, rgba(36, 46, 58, .95), rgba(20, 26, 34, .95)); border: 1px solid #0b1016; box-shadow: 0 3px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08); z-index: 30; min-width: 300px; }
.tgt .tav { width: 66px; height: 66px; border-radius: 50%; overflow: hidden; border: 2px solid #c9a84a; box-shadow: 0 0 0 2px #1a1206, 0 0 8px rgba(255, 210, 100, .35); cursor: pointer; flex: none; }
.tgt .tav:hover { border-color: #ffe27a; }
.tgt .tinfo { flex: 1; min-width: 210px; }
.tgt .tnm { font: 14px var(--f); color: #fff; display: flex; gap: 6px; align-items: baseline; } .tgt .tnm .tg { font-size: 11px; color: #9fe0ff; }
.tgt .tsub2 { font: 12px var(--f); color: #c9d4de; margin: 1px 0 4px; display: flex; gap: 4px; align-items: center; } .tgt .tlv { color: #ffe95c; font-weight: 700; } .tgt .tfem { color: #ff8fc8; }
.tgt .treb { margin-left: auto; padding: 0 6px; border-radius: 3px; background: rgba(160, 120, 255, .25); color: #d9c6ff; font-size: 11px; }
.tgt .tbar { position: relative; height: 12px; border-radius: 3px; background: #0d1218; border: 1px solid #05080b; margin-top: 3px; overflow: hidden; }
.tgt .tbar i { display: block; height: 100%; } .tgt .tbar.hp i { background: linear-gradient(180deg, #ff6b74, #c7212f); } .tgt .tbar.mp i { background: linear-gradient(180deg, #6fc8ff, #1f6fc4); }
.tgt .tbar span { position: absolute; inset: 0; text-align: center; font: 700 9px/12px var(--f); color: #fff; text-shadow: 0 0 2px #000; }
.tgt .tx { position: absolute; right: 8px; top: 5px; color: #9aa6b2; cursor: pointer; font-size: 13px; } .tgt .tx:hover { color: #fff; }
.tgtmenu { position: absolute; left: calc(50% - 150px); top: 84px; width: 170px; padding: 4px; border-radius: 6px; background: rgba(22, 29, 37, .97); border: 1px solid #070a0e; box-shadow: 0 6px 16px rgba(0, 0, 0, .5); z-index: 31; }
.tgtmenu .tmi { display: flex; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 4px; font: 13px var(--f); color: #e6edf3; cursor: pointer; }
.tgtmenu .tmi span { width: 18px; text-align: center; color: #ffd66a; } .tgtmenu .tmi:hover { background: linear-gradient(180deg, #3f8fb0, #2a6a88); }
.nametag.pc.fem { background: rgba(70, 12, 44, .6); } .nametag.pc.sel { outline: 1px solid #ffe25a; }

/* ---- title: character slot list */
.slotlist .slot-card { display: flex; align-items: center; gap: 10px; margin: 6px 12px 0; padding: 6px 10px 6px 6px; border-radius: 12px; background: rgba(255, 255, 255, .72); border: 2px solid transparent; cursor: pointer; transition: background .15s; }
.slotlist .slot-card:hover { background: rgba(255, 255, 255, .92); }
.slotlist .slot-card.on { background: #fff; border-color: #39b3d4; box-shadow: 0 2px 8px rgba(57, 179, 212, .35); }
.slotlist .slav { width: 58px; height: 64px; border-radius: 10px; overflow: hidden; background: radial-gradient(ellipse at 50% 70%, #cfeaf5, #8fc4dc); flex: none; }
.slotlist .slav.empty { display: grid; place-items: center; font: 700 28px var(--f); color: #fff; background: rgba(160, 175, 188, .55); }
.slotlist .slnm { font: 700 15px var(--f); color: #3c4650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slotlist .slsub { font: 12px var(--f); color: #7b8790; }

/* ---- story: dialogue, chapter card */
.dlg { position: absolute; inset: 0; z-index: 80; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.42)); }
.dlg-skip { position: absolute; right: 290px; bottom: 266px; padding: 5px 14px; border-radius: 16px; background: rgba(10, 16, 24, .75); color: #c9d4de; font: 700 13px var(--f); cursor: pointer; border: 1px solid rgba(255, 255, 255, .2); }
.dlg-skip:hover { color: #fff; border-color: #e3f26a; }
.dlg-box { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); width: 1040px; min-height: 220px; display: flex; gap: 16px; padding: 14px 20px 14px 14px; border-radius: 14px; background: linear-gradient(180deg, rgba(24, 38, 54, .96), rgba(12, 20, 30, .97)); border: 2px solid #2d5d7a; box-shadow: 0 10px 40px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .1); cursor: pointer; }
.dlg-pt { width: 170px; height: 200px; border-radius: 10px; overflow: hidden; border: 2px solid #1d3a50; flex: none; background: #14283a; }
.dlg-box.narr .dlg-pt { display: none; } .dlg-box.narr .dlg-tx { font-style: italic; color: #cfd9e3; } .dlg-box.narr .dlg-nm { display: none; }
.dlg-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dlg-nm { font: 700 20px var(--f); color: #ffe27a; margin: 2px 0 8px; letter-spacing: .5px; } .dlg-nm.me { color: #8ae6ff; } .dlg-nm.vil { color: #ff9a9a; }
.dlg-tx { font: 20px/1.5 var(--f); color: #f1f5f9; min-height: 90px; white-space: pre-wrap; }
.dlg-ch { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.dlg-opt { padding: 7px 14px; border-radius: 8px; background: rgba(60, 110, 150, .5); color: #fff; font: 17px var(--f); cursor: pointer; border: 1px solid rgba(140, 200, 240, .35); }
.dlg-opt:hover { background: rgba(80, 150, 200, .75); }
.dlg-nx { position: absolute; right: 22px; bottom: 12px; color: #ffe27a; font-size: 18px; animation: dlgb 1s infinite; } @keyframes dlgb { 50% { transform: translateY(4px); opacity: .6; } }
.ccard { position: absolute; inset: 0; z-index: 85; background: rgba(4, 8, 14, .94); display: grid; place-items: center; cursor: pointer; animation: ccin .8s; transition: opacity .6s; } .ccard.out { opacity: 0; }
@keyframes ccin { from { opacity: 0; } }
.ccard-in { text-align: center; } .cc-n { font: 700 18px var(--f); letter-spacing: 10px; color: #8aa4b8; } .cc-t { font: 700 62px Garamond, serif; color: #f4ead0; margin: 14px 0 10px; text-shadow: 0 0 30px rgba(255, 210, 120, .35); } .cc-s { font: italic 22px Garamond, serif; color: #c9b98a; }

/* story events: name tags step out of the shot too */
.stage .nametag { display: none !important; }

/* combat power plate */
.cpbox { position: absolute; right: 6px; top: 72px; min-width: 210px; border-radius: 6px; background: linear-gradient(180deg, rgba(40, 33, 20, .92), rgba(22, 20, 16, .92)); border: 1px solid #6b5420; padding: 3px 10px 4px; color: #fff; text-align: right; pointer-events: none; box-shadow: inset 0 1px 0 rgba(255, 220, 140, .18); }
.cpbox .cpl { font: 900 10px var(--ft); color: #e9c46a; letter-spacing: 1.5px; text-align: left; }
.cpbox .cpv { font: 800 24px var(--f); color: #ffe9a8; text-shadow: 0 1px 2px #000; line-height: 24px; }
.cpbox .cpd { font: 700 11px var(--f); height: 13px; } .cpbox .cpd.up { color: #7dff9a; } .cpbox .cpd.dn { color: #ff8a8a; }
.cpbox.pulse { animation: cpPulse .9s ease-out; } @keyframes cpPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 226, 120, .9); transform: scale(1.04); } 100% { box-shadow: 0 0 0 14px rgba(255, 226, 120, 0); transform: scale(1); } }

/* gems */
.gem { position: relative; display: inline-grid; place-items: center; vertical-align: middle; }
.gem i { position: absolute; inset: 12%; background: radial-gradient(circle at 32% 28%, #fff 0, var(--gc) 38%, rgba(0,0,0,.55) 120%); transform: rotate(45deg); border-radius: 22%; box-shadow: 0 0 6px var(--gc), inset 0 0 0 1.5px rgba(255,255,255,.55); }
.gem b { position: relative; font: 800 11px var(--f); color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.gsock { width: 108px; padding: 6px 4px; border-radius: 8px; border: 2px dashed #6f8798; background: rgba(0,0,0,.28); text-align: center; display: grid; justify-items: center; gap: 2px; }
.gsock.full { border: 2px solid #ffd27a; cursor: pointer; background: rgba(255,210,122,.1); } .gsock small { font-size: 10px; color: #cfe0ee; line-height: 1.25; }
.gstack { display: grid; justify-items: center; gap: 2px; } .gstack [data-gs] { position: relative; cursor: pointer; border-radius: 6px; padding: 2px; background: rgba(0,0,0,.25); } .gstack [data-gs]:hover { background: rgba(255,255,255,.18); }
.gstack .gn { position: absolute; right: 0; bottom: -2px; font: 700 10px var(--f); color: #fff; text-shadow: 0 0 3px #000; }
.slot .gdots { position: absolute; right: 1px; bottom: 1px; display: flex; gap: 1px; pointer-events: none; } .slot .gdots u { width: 6px; height: 6px; border-radius: 50%; border: 1px solid rgba(255,255,255,.8); }

/* ---------------------------------------------------------------- phones / tablets (body.mobile is set by Game.resize) */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
input { -webkit-user-select: text; user-select: text; }
body.mobile .mw { max-height: 548px; display: flex; flex-direction: column; }
body.mobile .mw .body { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
body.mobile .mw .mt { height: 34px; } body.mobile .mw .mt .x { width: 34px; height: 34px; font-size: 20px; line-height: 34px; }
body.mobile .mb { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; padding-left: 12px; padding-right: 12px; }
body.mobile .mb.sm { min-height: 26px; } body.mobile .mtab { min-height: 34px; display: grid; place-items: center; }
body.mobile .slot { transform-origin: center; }
body.mobile .qhelp { min-width: 170px; max-width: 300px; } body.mobile .qhelp .qi { font-size: 11px; }
body.mobile .cpbox { min-width: 170px; } body.mobile .cpbox .cpv { font-size: 20px; line-height: 20px; }
body.mobile .chat { width: 330px; bottom: 58px; } body.mobile .chat .ln { font-size: 11px; }
body.mobile .mini { transform: scale(.85); transform-origin: top left; }
body.mobile .hotbar { right: 14px; bottom: 22px; }

body.mobile .mtip { display: none; }
/* dialogue adapts to any screen width / height */
.dlg-box { width: min(1040px, calc(100% - 24px)); }
body.mobile .dlg-box { min-height: 130px; bottom: 14px; padding: 8px 14px 8px 8px; gap: 10px; }
body.mobile .dlg-pt { width: 96px; height: 116px; } body.mobile .dlg-tx { font-size: 15px; min-height: 60px; } body.mobile .dlg-nm { font-size: 16px; margin: 0 0 4px; } body.mobile .dlg-opt { font-size: 14px; padding: 5px 10px; }
body.mobile .dlg-skip { right: 20px; bottom: 160px; }

/* login over a live Eldhaven: only the NPC / player name tags stay visible */
body.showcase #ui > *:not(.nametag), body.showcase #winLayer, body.showcase #toasts, body.showcase #tipLayer { display: none !important; }
body.showcase .nametag.me { display: none !important; }
