:root {
  --bg: #0f0d0b; --panel: #1e1913; --panel2: #2a2219; --edge: #5a4628; --gold: #e2c06a; --gold2: #b8913e;
  --text: #e8dcc0; --dim: #9a8c70; --bad: #e05a4a; --good: #6ad07a; --blue: #6fb8ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: 'Alegreya Sans', 'Trebuchet MS', sans-serif; font-size: 15px; overflow: hidden; }
#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-family: Cinzel, serif; font-size: 28px; color: var(--gold); }
button { font-family: inherit; }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.panel { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 2px solid var(--edge); border-radius: 6px; box-shadow: 0 0 0 1px #000, inset 0 0 18px rgba(0,0,0,.6); padding: 10px; }
.ptitle { font-family: Cinzel, serif; color: var(--gold); font-size: 15px; letter-spacing: 1px; margin-bottom: 8px; border-bottom: 1px solid #3a2e1c; padding-bottom: 5px; }
.btn { background: linear-gradient(180deg, #4a3a24, #2e2416); color: var(--text); border: 1px solid #7a6038; border-radius: 4px; padding: 7px 14px; cursor: pointer; font-weight: 700; letter-spacing: .3px; }
.btn:hover { filter: brightness(1.25); border-color: var(--gold); }
.btn.gold { background: linear-gradient(180deg, #b8913e, #7a5a1e); color: #1a1208; border-color: #f0d080; }
.btn.warn { background: linear-gradient(180deg, #6a2a20, #3a1410); border-color: #a04a3a; }
.btn.big { display: block; width: 100%; padding: 12px; font-size: 17px; font-family: Cinzel, serif; margin: 8px 0 3px; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.tiny { padding: 2px 8px; font-size: 12px; }
input { background: #120f0b; border: 1px solid var(--edge); color: var(--text); padding: 8px; border-radius: 4px; font-family: inherit; font-size: 15px; }
input:focus { outline: 1px solid var(--gold2); }

/* ------------------------------------------------ login */
#ui { position: fixed; inset: 0; overflow: auto; background: radial-gradient(ellipse at 50% 20%, #2a2014 0%, #0f0d0b 70%); }
.login { max-width: 980px; margin: 0 auto; padding: 40px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.logo { grid-column: 1 / 3; text-align: center; margin-bottom: 10px; }
.logo .t1 { font-family: Cinzel, serif; font-size: 58px; font-weight: 800; color: var(--gold); letter-spacing: 8px; text-shadow: 0 3px 0 #5a3a10, 0 0 30px rgba(226,192,106,.35); }
.logo .t2 { font-family: Cinzel, serif; font-size: 34px; color: #c84a2a; letter-spacing: 14px; margin-top: -6px; text-shadow: 0 2px 0 #3a0a00; }
.logo .t3 { color: var(--dim); margin-top: 8px; font-style: italic; }
.lbox { display: flex; flex-direction: column; gap: 6px; }
.lbox label { color: var(--dim); font-size: 13px; margin-top: 6px; }
.lbox .row { display: flex; gap: 8px; margin-top: 12px; }
.lbox .row .btn { flex: 1; padding: 10px; }
.hint { color: var(--dim); font-size: 12.5px; margin-top: 6px; }
.howto h3 { font-family: Cinzel, serif; color: var(--gold); margin: 0 0 6px; }
.howto p { margin: 6px 0; line-height: 1.35; }
.credits { grid-column: 1/3; text-align: center; color: #5a4e3a; font-size: 12px; }

/* ------------------------------------------------ hub */
.hub { display: flex; flex-direction: column; height: 100%; min-height: 680px; }
.topbar { display: flex; align-items: center; gap: 18px; padding: 8px 16px; background: linear-gradient(180deg, #2a2016, #16110c); border-bottom: 2px solid var(--edge); }
.brand { font-family: Cinzel, serif; font-size: 22px; color: var(--gold); letter-spacing: 3px; font-weight: 800; }
.brand span { color: #c84a2a; }
.who { font-family: Cinzel, serif; font-size: 16px; color: var(--text); margin-left: auto; }
.gold { color: #ffd34a; font-weight: 700; font-size: 17px; }
.cols { flex: 1; display: grid; grid-template-columns: 330px 1fr 300px; gap: 10px; padding: 10px; min-height: 0; }
.col { min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.col.left { overflow: auto; }
.classes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.cls { border: 1px solid #3a2e1c; border-radius: 4px; text-align: center; cursor: pointer; padding: 2px 0 4px; background: #15110c; }
.cls:hover { border-color: var(--gold2); }
.cls.sel { border-color: var(--cc); box-shadow: 0 0 10px var(--cc) inset; }
.cls canvas { width: 48px; height: 54px; image-rendering: pixelated; }
.cls .cn { font-size: 10.5px; font-weight: 700; line-height: 1.05; }
.cls .cr { display: none; }
.cls .cm { font-size: 9.5px; color: var(--dim); }
.classinfo { margin-top: 10px; }
.ciname { font-family: Cinzel, serif; font-size: 19px; }
.cidesc { margin: 4px 0; line-height: 1.3; }
.ciskills { color: var(--gold2); font-size: 13px; }
.cipass { margin: 6px 0; font-size: 13.5px; }
.cimast { font-size: 13px; margin: 6px 0; }
.mbar { height: 6px; background: #000; border: 1px solid #3a2e1c; margin: 3px 0; }
.mbar div { height: 100%; background: linear-gradient(90deg, #8a6a2a, #f0d080); }
.ciabil { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 6px 0; }
.ciabil .ab { font-size: 12.5px; display: flex; align-items: center; gap: 5px; padding: 2px; border-radius: 3px; cursor: help; }
.ciabil .ab:hover { background: #2e2418; }
.abg { width: 24px; height: 24px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #000; font-size: 13px; }
.dollpanel .dollwrap { display: grid; grid-template-columns: 180px 1fr 1fr; gap: 10px; }
.dollcol canvas { image-rendering: pixelated; background: radial-gradient(ellipse at 50% 85%, #3a3020 0%, #15110c 70%); border: 1px solid #3a2e1c; border-radius: 4px; }
.look { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.eqslots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; align-content: start; }
.eslot { position: relative; height: 62px; border: 1px dashed #3a2e1c; border-radius: 4px; display: flex; align-items: center; justify-content: center; background: #120e0a; }
.eslot .sl { position: absolute; top: 1px; left: 3px; font-size: 9.5px; color: #5a4e3a; text-transform: uppercase; }
.eslot .item { width: 48px; height: 48px; }
.eslot .newbie { font-size: 10px; color: #7a6e56; text-align: center; padding: 0 3px; font-style: italic; }
.sets { grid-column: 1 / 5; font-size: 12px; }
.setline { color: var(--dim); } .setline.on { color: #9fe09f; }
.supplies .sub { color: var(--gold2); font-size: 13px; margin-bottom: 4px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 4px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
.item { position: relative; height: 50px; border: 1px solid #555; border-radius: 4px; background: radial-gradient(circle, #2a2218, #120e0a); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.item:hover { filter: brightness(1.3); }
.item img { width: 40px; height: 40px; image-rendering: pixelated; }
.item .q { position: absolute; right: 2px; bottom: 0; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.tabs { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabbar { display: flex; gap: 2px; border-bottom: 1px solid #3a2e1c; margin-bottom: 8px; }
.tabbar div { padding: 6px 12px; cursor: pointer; color: var(--dim); font-family: Cinzel, serif; font-size: 13px; border-radius: 4px 4px 0 0; }
.tabbar div.on { color: var(--gold); background: #2e2418; }
.tabbody { flex: 1; overflow: auto; min-height: 0; }
.bankhead { margin-bottom: 6px; }
.vcats { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.vcats div { padding: 4px 10px; border: 1px solid #3a2e1c; border-radius: 4px; cursor: pointer; font-size: 13px; }
.vcats div.on { border-color: var(--gold); color: var(--gold); }
.vrow { display: flex; align-items: center; gap: 10px; padding: 3px; border-bottom: 1px solid #241c12; }
.vrow .item { width: 46px; height: 46px; flex: none; }
.vinfo { flex: 1; }
.vbuy { display: flex; gap: 4px; align-items: center; }
.price { color: #ffd34a; font-size: 13px; margin-right: 4px; min-width: 70px; text-align: right; }
.stable { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.pet { border: 1px solid #3a2e1c; border-radius: 6px; padding: 6px; text-align: center; background: #15110c; }
.pet.bring { border-color: var(--good); box-shadow: 0 0 10px rgba(100,220,120,.3) inset; }
.pet canvas { image-rendering: pixelated; }
.pet .pn { font-weight: 700; }
.pet .btn { margin: 3px 2px 0; }
.statsrow { margin-bottom: 8px; color: var(--gold2); }
.hrow { padding: 4px 6px; border-left: 3px solid; margin-bottom: 3px; background: #15110c; font-size: 13.5px; }
.hrow.ok { border-color: var(--good); } .hrow.bad { border-color: var(--bad); }
table.lb { width: 100%; border-collapse: collapse; }
table.lb th { color: var(--gold); text-align: left; font-family: Cinzel, serif; font-size: 13px; }
table.lb td, table.lb th { padding: 4px 6px; border-bottom: 1px solid #241c12; }
.help h4 { font-family: Cinzel, serif; color: var(--gold); margin: 10px 0 4px; }
.help p { margin: 4px 0; line-height: 1.38; }
.play .party { margin-bottom: 10px; }
.pcode { font-size: 16px; margin-bottom: 6px; }
.pcode b { color: var(--gold); letter-spacing: 3px; font-size: 20px; }
.pm { padding: 3px 0; } .pm.off { opacity: .5; }
.kick { color: var(--bad); cursor: pointer; font-size: 12px; }
.join { display: flex; gap: 6px; margin: 8px 0 4px; }
.join input { width: 100px; text-transform: uppercase; letter-spacing: 3px; }
.queue { padding: 10px; border: 1px solid var(--gold2); border-radius: 6px; text-align: center; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 16px rgba(226,192,106,.4); } }
.risk { margin-top: 10px; font-size: 12.5px; color: var(--dim); }
.chat { flex: 1; display: flex; flex-direction: column; min-height: 160px; }
#hchat { flex: 1; overflow: auto; font-size: 13px; margin-bottom: 6px; }
.ctxmenu { position: fixed; z-index: 100; background: #1e1913; border: 1px solid var(--gold2); border-radius: 4px; box-shadow: 0 4px 16px #000; min-width: 160px; }
.ctxmenu .mi { padding: 7px 12px; cursor: pointer; }
.ctxmenu .mi:hover { background: #3a2e1c; }
.ctxmenu .mi.warn { color: #ff9a8a; }
.tip { position: fixed; z-index: 200; pointer-events: none; background: rgba(14,11,8,.96); border: 1px solid var(--gold2); border-radius: 4px; padding: 7px 10px; max-width: 320px; font-size: 13px; line-height: 1.35; box-shadow: 0 4px 14px #000; }
#toasts, #h-toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 150; display: flex; flex-direction: column; gap: 4px; align-items: center; pointer-events: none; }
.toast { background: rgba(20,16,10,.92); border: 1px solid var(--gold2); padding: 6px 14px; border-radius: 4px; font-size: 14px; transition: opacity .5s; text-align: center; max-width: 560px; }
.toast.err { border-color: var(--bad); color: #ffb0a0; }
.toast.fade { opacity: 0; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 120; }
.result { width: 460px; text-align: center; padding: 22px; }
.rtitle { font-family: Cinzel, serif; font-size: 32px; }
.result.ok .rtitle { color: #8fd8ff; } .result.bad .rtitle { color: var(--bad); }
.rsub { margin: 8px 0; } .rstats { color: var(--gold2); margin: 4px 0; } .rloot { margin: 8px 0; color: #ffd84a; font-size: 13.5px; } .rnote { color: #9fe09f; font-size: 13.5px; }

/* ------------------------------------------------ in-match HUD */
#game { position: fixed; inset: 0; }
#gc { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
#h-top { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); text-align: center; pointer-events: none; }
#h-timer { font-family: Cinzel, serif; font-size: 34px; font-weight: 800; color: #fff; text-shadow: 0 2px 4px #000, 0 0 2px #000; }
#h-timer.urgent { color: #ff5a4a; animation: pulse2 1s infinite; }
@keyframes pulse2 { 50% { transform: scale(1.08); } }
#h-sub { font-size: 14px; text-shadow: 0 1px 3px #000, 0 0 2px #000; color: #e8dcc0; }
#h-sub .gate { color: #8fd8ff; font-weight: 700; }
#h-mini { position: absolute; top: 8px; right: 8px; border: 2px solid var(--edge); border-radius: 50%; overflow: hidden; width: 200px; height: 200px; box-shadow: 0 0 0 1px #000, 0 2px 10px #000; background: #000; }
#h-mini canvas { width: 200px; height: 200px; }
#h-coords { position: absolute; top: 212px; right: 8px; font-size: 12px; color: var(--dim); text-shadow: 0 1px 2px #000; white-space: nowrap; }
#h-feed { position: absolute; top: 240px; right: 10px; width: 330px; text-align: right; font-size: 13.5px; pointer-events: none; }
.feedline { text-shadow: 0 1px 3px #000, 0 0 2px #000; margin-bottom: 2px; transition: opacity 1s; }
.feedline.fade { opacity: 0; }
#h-left { position: absolute; top: 10px; left: 10px; width: 300px; }
.bar { position: relative; height: 22px; background: rgba(0,0,0,.75); border: 1px solid #000; border-radius: 3px; margin-bottom: 4px; box-shadow: 0 0 0 1px var(--edge); }
.bar .fill { height: 100%; border-radius: 2px; transition: width .15s; }
.bar.hp .fill { background: linear-gradient(180deg, #e04a3a, #8a1a10); }
.bar.mana .fill { background: linear-gradient(180deg, #4a8ae8, #1a3a8a); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 13px; line-height: 21px; font-weight: 700; text-shadow: 0 1px 2px #000; }
#h-status { display: flex; flex-wrap: wrap; gap: 3px; font-size: 12px; }
#h-status span { padding: 1px 6px; border-radius: 3px; background: rgba(0,0,0,.6); }
#h-status .buff { color: #9fe09f; border: 1px solid #2a5a2a; }
#h-status .debuff { color: #ffb0a0; border: 1px solid #6a2a20; text-transform: uppercase; }
#h-status .crim { color: #ccc; border: 1px solid #888; } #h-status .murd { color: #ff5a5a; border: 1px solid #a02020; }
#h-xp { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; background: rgba(0,0,0,.8); border-top: 1px solid var(--edge); }
#h-xp .fill { height: 100%; background: linear-gradient(90deg, #3a7ad8, #8fd8ff); transition: width .2s; }
#h-xp span { position: absolute; inset: 0; text-align: center; font-size: 11.5px; line-height: 15px; font-weight: 700; text-shadow: 0 1px 2px #000; }
#h-bottom { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; align-items: flex-end; }
#h-abil, #h-cons { display: flex; gap: 6px; }
.abslot { position: relative; width: 62px; height: 62px; border: 2px solid var(--edge); border-radius: 6px; background: #120e0a; overflow: hidden; cursor: pointer; box-shadow: 0 2px 8px #000; }
.abslot.empty { opacity: .45; }
.abslot .ic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.abslot .glyph { font-size: 28px; filter: drop-shadow(0 1px 1px #000); }
.abslot .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.72); }
.abslot .key { position: absolute; top: 1px; left: 4px; font-size: 12px; font-weight: 700; text-shadow: 0 0 3px #000; }
.abslot .rank { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; font-size: 8px; color: var(--gold); text-shadow: 0 0 2px #000; letter-spacing: 1px; }
.abslot .auto { position: absolute; top: 1px; right: 3px; font-size: 8px; font-weight: 700; color: #6ad07a; display: none; }
.abslot.isauto .auto { display: block; }
.cslot { position: relative; width: 46px; height: 46px; border: 1px solid var(--edge); border-radius: 5px; background: #120e0a; cursor: pointer; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 2px 8px #000; }
.cslot img { width: 36px; height: 36px; }
.cslot.none { opacity: .4; }
.cslot .key { position: absolute; top: 0; left: 3px; font-size: 11px; font-weight: 700; text-shadow: 0 0 3px #000; }
.cslot .n { position: absolute; bottom: 0; right: 3px; font-size: 11px; font-weight: 700; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.cslot .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.65); }
#h-modes { display: grid; grid-template-columns: auto auto; gap: 3px; align-content: end; }
.mode { background: rgba(20,16,10,.85); border: 1px solid var(--edge); color: var(--text); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 3px; cursor: pointer; }
.mode.war { background: #6a1a10; border-color: #ff5a4a; color: #fff; }
#h-offers { position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%); display: none; gap: 10px; flex-wrap: wrap; justify-content: center; width: 760px; }
.otitle { width: 100%; text-align: center; font-family: Cinzel, serif; color: var(--gold); font-size: 16px; text-shadow: 0 2px 4px #000; }
.otitle a { color: #8fd8ff; cursor: pointer; text-decoration: underline; }
.offer { position: relative; width: 175px; background: linear-gradient(180deg, rgba(48,38,24,.96), rgba(22,18,12,.96)); border: 2px solid var(--gold2); border-radius: 8px; padding: 8px; cursor: pointer; text-align: center; box-shadow: 0 4px 16px #000; animation: popin .25s; }
@keyframes popin { from { transform: translateY(20px); opacity: 0; } }
.offer:hover { border-color: #fff2b0; transform: translateY(-3px); }
.offer.ab_new { border-color: #8fd8ff; }
.offer .okey { position: absolute; top: 4px; left: 7px; font-weight: 800; color: var(--gold); }
.offer .oglyph { font-size: 30px; }
.offer .oname { font-family: Cinzel, serif; font-weight: 800; font-size: 14px; color: #fff; }
.offer .otag { font-size: 11px; color: #8fd8ff; text-transform: uppercase; letter-spacing: .5px; }
.offer .odesc { font-size: 12.5px; color: #d8cdb0; margin-top: 3px; line-height: 1.25; }
#h-channel, #h-extract { position: absolute; left: 50%; transform: translateX(-50%); width: 300px; height: 20px; background: rgba(0,0,0,.8); border: 1px solid var(--gold2); border-radius: 3px; display: none; }
#h-channel { top: 58%; } #h-extract { top: calc(58% + 28px); border-color: #8fd8ff; }
#h-channel .fill { height: 100%; background: linear-gradient(90deg, #b8913e, #f0d080); }
#h-extract .fill { height: 100%; background: linear-gradient(90deg, #2a6ac8, #8fd8ff); }
#h-channel span, #h-extract span { position: absolute; inset: 0; text-align: center; font-size: 12px; font-weight: 700; line-height: 19px; text-shadow: 0 1px 2px #000; }
#h-inv { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); width: 640px; max-height: 80vh; overflow: auto; z-index: 20; }
#h-inv .x { float: right; cursor: pointer; }
.invwrap .doll { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; }
.invwrap .slot { position: relative; height: 52px; border: 1px dashed #3a2e1c; border-radius: 4px; display: flex; align-items: center; justify-content: center; cursor: pointer; background: #120e0a; }
.invwrap .slot img { width: 40px; height: 40px; image-rendering: pixelated; }
.invwrap .slot .sl { position: absolute; top: 0; left: 2px; font-size: 8px; color: #5a4e3a; text-transform: uppercase; }
.invwrap .stats { font-size: 12.5px; color: var(--gold2); margin: 8px 0; line-height: 1.4; }
.invwrap .stats .set { color: #9fe09f; }
.invwrap .pack { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.invwrap .pack .item { height: 50px; }
#h-chat { position: absolute; bottom: 130px; left: 10px; width: 360px; }
#h-chat input { width: 100%; }
@media (max-width: 1250px) { .cols { grid-template-columns: 300px 1fr 260px; } .dollpanel .dollwrap { grid-template-columns: 180px 1fr; } .supplies { grid-column: 1 / 3; } }

.grid > .dim { grid-column: 1 / -1; }
.vol { font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 4px; }
.vol input { width: 90px; padding: 0; }
/* moongate banner */
#h-banner { position: absolute; left: 50%; top: 19%; transform: translateX(-50%); text-align: center; pointer-events: none; opacity: 0; z-index: 30; }
#h-banner.show { animation: bannerIn 4.6s ease forwards; }
#h-banner .bt { font-family: Cinzel, serif; font-size: 34px; font-weight: 800; color: #bfe8ff; letter-spacing: 2px; text-shadow: 0 0 18px rgba(80,170,255,.9), 0 2px 3px #000; white-space: nowrap; }
#h-banner .bs { font-size: 16px; color: #e0f2ff; margin-top: 4px; text-shadow: 0 1px 3px #000; }
@keyframes bannerIn { 0% { opacity: 0; transform: translateX(-50%) scale(.85); } 10% { opacity: 1; transform: translateX(-50%) scale(1.04); } 16% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); } }

/* ================================================ touch devices (phones & tablets) */
html.touch, html.touch body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html.touch body { -webkit-user-select: none; user-select: none; }
html.touch input { -webkit-user-select: text; user-select: text; font-size: 16px; }
html.touch #game, html.touch #gc { touch-action: none; }
html.touch #ui { touch-action: pan-y; -webkit-overflow-scrolling: touch; }
html.touch .btn, html.touch .mode, html.touch .cslot, html.touch .abslot, html.touch .offer, html.touch .item, html.touch .tabbar div, html.touch .vcats div { touch-action: manipulation; }
/* HUD: compact top area */
html.touch #h-left { top: max(6px, env(safe-area-inset-top)); left: max(6px, env(safe-area-inset-left)); width: 200px; }
html.touch .bar { height: 17px; margin-bottom: 3px; }
html.touch .bar span { font-size: 11px; line-height: 16px; }
html.touch #h-status { font-size: 10.5px; }
html.touch #h-top { top: max(4px, env(safe-area-inset-top)); }
html.touch #h-timer { font-size: 24px; }
html.touch #h-sub { font-size: 11.5px; max-width: 46vw; }
html.touch #h-mini { width: 112px; height: 112px; top: max(6px, env(safe-area-inset-top)); right: max(6px, env(safe-area-inset-right)); }
html.touch #h-mini canvas { width: 112px; height: 112px; }
html.touch #h-coords { display: none; }
html.touch #h-feed { top: calc(max(6px, env(safe-area-inset-top)) + 118px); right: max(8px, env(safe-area-inset-right)); width: 210px; font-size: 11px; }
html.touch #h-feed .feedline:nth-last-child(n+5) { display: none; }
html.touch #h-xp { height: 12px; } html.touch #h-xp span { font-size: 10px; line-height: 11px; }
/* modes: small buttons under the health bars */
html.touch #h-modes { position: fixed; top: calc(max(6px, env(safe-area-inset-top)) + 72px); left: max(6px, env(safe-area-inset-left)); grid-template-columns: repeat(3, auto); justify-content: start; }
html.touch .mode { font-size: 10px; padding: 6px 7px; }
/* right thumb cluster: abilities (2x2), potions above, LOOT button */
html.touch #h-bottom { left: auto; transform: none; right: max(12px, env(safe-area-inset-right)); bottom: 20px; flex-direction: column; align-items: flex-end; gap: 10px; }
html.touch #h-abil { display: grid; grid-template-columns: repeat(2, 66px); gap: 10px; order: 2; }
html.touch .abslot { width: 66px; height: 66px; border-radius: 50%; border-width: 2px; }
html.touch .abslot .key { display: none; }
html.touch .abslot .auto { top: 6px; right: 50%; transform: translateX(50%); }
html.touch .abslot .rank { bottom: 6px; }
html.touch #h-cons { order: 1; gap: 6px; }
html.touch .cslot { width: 42px; height: 42px; border-radius: 50%; }
html.touch .cslot img { width: 30px; height: 30px; }
html.touch .cslot .key { display: none; }
.tbtn { display: none; }
html.touch #t-loot { display: block; position: fixed; right: calc(max(12px, env(safe-area-inset-right)) + 158px); bottom: 26px; width: 62px; height: 62px; border-radius: 50%; border: 2px solid #c8a050; background: radial-gradient(circle at 40% 35%, #6a5028, #2a1e10); color: #ffe8a0; font-family: Cinzel, serif; font-weight: 800; font-size: 12px; box-shadow: 0 2px 10px #000; }
html.touch #t-loot:active, html.touch .abslot:active, html.touch .cslot:active { transform: scale(.92); filter: brightness(1.3); }
/* floating joystick */
#t-stick { position: fixed; width: 132px; height: 132px; margin: -66px 0 0 -66px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.05), rgba(255,255,255,.12)); border: 2px solid rgba(255,230,170,.35); pointer-events: none; z-index: 5; }
#t-stick .knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, rgba(255,240,200,.9), rgba(200,160,80,.75)); box-shadow: 0 2px 8px rgba(0,0,0,.6); transform: translate(-50%, -50%); }
#t-stick.idle { opacity: .35; }
#t-stick.on { opacity: 1; }
#t-rotate { display: none; }
@media (orientation: portrait) and (max-width: 700px) {
  html.touch #t-rotate { display: flex; position: fixed; left: 50%; top: 66%; transform: translateX(-50%); z-index: 60; align-items: center; gap: 10px; background: rgba(14,11,8,.9); border: 1px solid var(--gold2); border-radius: 8px; padding: 8px 12px; text-align: left; width: 86vw; font-size: 13px; }
  html.touch #h-left { width: 40vw; max-width: 200px; }
  html.touch #h-top { left: calc(min(40vw, 200px) + 12px); right: 124px; transform: none; }
  html.touch #h-timer { font-size: 22px; }
  html.touch #h-offers { top: 30%; width: 94vw; z-index: 12; }
  html.touch .offer { width: calc(33% - 5px); }
  html.touch .offer .odesc { font-size: 10.5px; }
  html.touch #h-sub { display: none; }
  html.touch #h-feed { display: none; }
}
/* level-up cards in the middle, smaller */
html.touch #h-offers { bottom: auto; top: calc(max(4px, env(safe-area-inset-top)) + 58px); transform: translateX(-50%); width: min(540px, 52vw); gap: 5px; z-index: 8; }
html.touch .offer { width: calc(33% - 5px); padding: 5px 4px; animation: none; }
html.touch .offer .okey { display: none; }
html.touch .offer .oglyph { font-size: 22px; }
html.touch .offer .oname { font-size: 12px; } html.touch .offer .odesc { font-size: 11px; } html.touch .otitle { font-size: 13px; }
html.touch #h-channel { top: 30%; } html.touch #h-extract { top: calc(30% + 26px); }
html.touch #h-channel, html.touch #h-extract { width: 240px; }
html.touch #h-banner .bt { font-size: 22px; } html.touch #h-banner .bs { font-size: 12px; }
html.touch #h-toasts { top: 56px; } html.touch .toast { font-size: 12.5px; max-width: 80vw; }
html.touch #h-chat { bottom: auto; top: 24%; left: 50%; transform: translateX(-50%); width: min(420px, 80vw); z-index: 30; }
/* backpack on touch */
html.touch #h-inv { width: 96vw; top: 6px; max-height: 90vh; }
html.touch .invwrap .doll { grid-template-columns: repeat(6, 1fr); }
html.touch .invwrap .pack { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.tmenu { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 210; width: min(380px, 90vw); max-height: 86vh; overflow: auto; background: rgba(18,14,10,.98); border: 2px solid var(--gold2); border-radius: 8px; padding: 12px; box-shadow: 0 6px 30px #000; font-size: 13.5px; line-height: 1.35; }
.tmenu .tm-btns { display: flex; gap: 8px; margin-top: 10px; }
.tmenu .tm-btns .btn { flex: 1; padding: 11px 6px; font-size: 14px; }
.ctxmenu .tm-tip { padding: 8px 12px; border-bottom: 1px solid #3a2e1c; font-size: 13px; line-height: 1.35; max-width: 320px; }
html.touch .ctxmenu .mi { padding: 12px 14px; }
html.touch .topfull { display: inline-block; }
.topfull { display: none; }

/* ================================================ small screens: bank & login stack vertically */
@media (max-width: 900px), (max-height: 540px) {
  .login { grid-template-columns: 1fr; padding: 16px 12px; gap: 12px; }
  .logo, .credits { grid-column: auto; }
  .logo .t1 { font-size: 36px; letter-spacing: 4px; } .logo .t2 { font-size: 22px; letter-spacing: 8px; }
  .hub { height: auto; min-height: 100%; }
  .topbar { flex-wrap: wrap; gap: 6px 12px; padding: 6px 10px; }
  .brand { font-size: 16px; letter-spacing: 2px; }
  .who { margin-left: 0; }
  .vol input { width: 64px; }
  .cols { display: flex; flex-direction: column; padding: 8px; }
  .col.right { order: -1; }
  .col.left { overflow: visible; }
  .chat { min-height: 120px; max-height: 220px; }
  .tabs { min-height: 380px; }
  .dollpanel .dollwrap { grid-template-columns: 150px 1fr; }
  .supplies { grid-column: 1 / 3; }
  .result { width: 92vw; }
  .tabbar { flex-wrap: wrap; }
}
@media (max-width: 520px) { .dollpanel .dollwrap { grid-template-columns: 1fr; } .supplies { grid-column: auto; } .eqslots { grid-template-columns: repeat(4, 1fr); } }

/* phones in landscape (short screens): tighter thumb cluster */
@media (max-height: 460px) {
  html.touch #h-left { width: 170px; }
  html.touch .mode { font-size: 9px; padding: 5px 6px; }
  html.touch #h-modes { top: calc(max(6px, env(safe-area-inset-top)) + 64px); }
  html.touch #h-abil { grid-template-columns: repeat(2, 56px); gap: 8px; }
  html.touch .abslot { width: 56px; height: 56px; }
  html.touch .abslot .glyph { font-size: 22px; }
  html.touch .cslot { width: 36px; height: 36px; } html.touch .cslot img { width: 26px; height: 26px; }
  html.touch #h-cons { gap: 4px; }
  html.touch #h-bottom { bottom: 16px; gap: 7px; }
  html.touch #t-loot { width: 52px; height: 52px; font-size: 10.5px; right: calc(max(12px, env(safe-area-inset-right)) + 134px); bottom: 20px; }
  html.touch #h-mini, html.touch #h-mini canvas { width: 92px; height: 92px; }
  html.touch #h-feed { top: calc(max(6px, env(safe-area-inset-top)) + 98px); width: 180px; font-size: 10px; }
  html.touch #h-feed .feedline:nth-last-child(n+4) { display: none; }
  html.touch #h-timer { font-size: 20px; } html.touch #h-sub { font-size: 10.5px; }
  html.touch .offer .odesc { font-size: 10px; line-height: 1.15; } html.touch .offer .oname { font-size: 11px; } html.touch .offer .oglyph { font-size: 18px; } html.touch .offer .otag { font-size: 9px; }
  html.touch .otitle { font-size: 11px; }
  html.touch #t-stick { width: 112px; height: 112px; margin: -56px 0 0 -56px; } html.touch #t-stick .knob { width: 48px; height: 48px; }
  html.touch #h-toasts { top: 46px; }
}
@media (orientation: portrait) and (max-width: 700px) {
  html.touch #h-offers { top: 30%; width: 94vw; z-index: 12; }
  html.touch .offer { width: calc(33% - 5px); }
  html.touch .offer .odesc { font-size: 10.5px; }
}
@media (max-height: 360px) { html.touch .offer .odesc { display: none; } html.touch .offer { padding: 4px; } }

/* ===================== v1.4: realms, crafting, quests, social, shop, news, account ===================== */
.tabbar { flex-wrap: wrap; }
.tabbar div { padding: 5px 9px; font-size: 12.5px; position: relative; }
.badge { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 4px; border-radius: 8px; background: #c0392b; color: #fff; font-size: 10.5px; font-family: sans-serif; line-height: 16px; text-align: center; }
.crowns { color: #ffd27a; font-weight: 700; }
.link { color: #9fd0ff; cursor: pointer; text-decoration: underline; }
.mbox { width: min(460px, 92vw); max-height: 88vh; overflow: auto; }
.mbox.wide { width: min(680px, 94vw); }
.mbox label { display: block; margin: 8px 0 3px; font-size: 13px; color: var(--gold2); }
.mbox input { width: 100%; box-sizing: border-box; }
.mbox .row { display: flex; gap: 8px; margin-top: 12px; }
.rkey { font-family: monospace; font-size: 24px; letter-spacing: 2px; color: #ffe8a0; text-align: center; padding: 12px; margin: 10px 0; border: 2px dashed var(--gold2); border-radius: 6px; background: #120e0a; user-select: all; -webkit-user-select: all; }
/* realm picker */
.realms { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.realm { border: 2px solid #3a2e1c; border-radius: 6px; padding: 6px 8px; cursor: pointer; background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 18%, #15110c), #15110c); }
.realm .rn { font-family: Cinzel, serif; font-size: 13px; color: var(--rc); font-weight: 700; }
.realm .rs { font-size: 11px; color: var(--dim); }
.realm.sel { border-color: var(--rc); box-shadow: 0 0 10px color-mix(in srgb, var(--rc) 45%, transparent); }
.realm.lock { opacity: .5; filter: grayscale(.7); cursor: not-allowed; }
.rdesc { margin-bottom: 8px; }
.rdy { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: #3a2018; color: #ffb0a0; }
.rdy.on { background: #1e4a24; color: #9fffaa; }
.waitready { color: #ffd27a; font-size: 13px; margin-bottom: 6px; text-align: center; }
.btn[disabled] { opacity: .45; pointer-events: none; }
/* crafting */
.craft .cskill { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
.craft .cskill .mbar { width: 180px; }
.cmats { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.cmat { border: 1px solid #3a2e1c; border-radius: 4px; padding: 3px 8px; font-size: 12.5px; cursor: pointer; background: #15110c; }
.cmat .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--mc); margin-right: 5px; vertical-align: -1px; }
.cmat.on { border-color: var(--gold); }
.cmat.low { opacity: .55; }
.vcats.small div { font-size: 12px; padding: 3px 8px; }
.vrow.cant { opacity: .6; }
.vrow.mwrow { background: linear-gradient(90deg, rgba(58,224,192,.08), transparent); }
/* quests */
.qh { font-family: Cinzel, serif; color: var(--gold); margin: 10px 0 4px; }
.quest { border: 1px solid #3a2e1c; border-radius: 6px; padding: 7px 9px; margin-bottom: 6px; background: #15110c; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: center; }
.quest .qt { font-weight: 700; } .quest .qr { grid-column: 1; } .quest .qb { grid-column: 2; grid-row: 1 / span 3; }
.quest .qbar { position: relative; height: 14px; background: #0c0a07; border: 1px solid #3a2e1c; border-radius: 3px; overflow: hidden; }
.quest .qbar div { height: 100%; background: linear-gradient(90deg, #7a5a20, #e2c06a); }
.quest .qbar span { position: absolute; inset: 0; text-align: center; font-size: 10.5px; line-height: 13px; }
.quest.done { border-color: #6aa04a; box-shadow: 0 0 10px rgba(120,220,100,.2) inset; }
.quest.claimed { opacity: .55; }
.quest.weekly { border-color: #7a5aa0; }
.wk { background: #5a3a8a; color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 3px; }
/* social */
.social { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.social .scol label { display: block; margin: 6px 0 2px; font-size: 13px; color: var(--gold2); }
.social .row { display: flex; gap: 6px; margin: 6px 0; } .social .row input { flex: 1; min-width: 0; }
.social .sub { color: var(--gold2); font-size: 13px; margin: 8px 0 3px; }
.frow { display: flex; align-items: center; gap: 6px; padding: 4px 2px; border-bottom: 1px solid #241c12; font-size: 13px; flex-wrap: wrap; }
.frow .fbtn { margin-left: auto; display: flex; gap: 3px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #555; flex: none; } .dot.on { background: #5ae06a; } .dot.busy { background: #e0b040; }
.gname { font-family: Cinzel, serif; font-size: 18px; color: var(--gold); } .gtag { color: #9fd0ff; }
.motd { background: #120e0a; border-left: 3px solid var(--gold2); padding: 5px 8px; margin: 6px 0; font-style: italic; font-size: 13px; }
/* cosmetic shop */
.crownbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 8px; margin-bottom: 6px; border: 1px solid #6a5028; border-radius: 6px; background: linear-gradient(90deg, #2a1e10, #15110c); }
.crownbar > div:first-child { color: #ffd27a; font-size: 16px; }
.crownbar .packs { display: flex; gap: 4px; flex-wrap: wrap; }
.bonus { color: #9fffaa; font-size: 10px; }
.cosgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 6px; }
.cos { border: 1px solid #3a2e1c; border-radius: 6px; padding: 6px; text-align: center; background: #15110c; }
.cos.own { border-color: #5a7a3a; } .cos.worn { border-color: var(--gold); box-shadow: 0 0 10px rgba(226,192,106,.3); }
.cos .cprev { height: 46px; border-radius: 6px; margin-bottom: 4px; display: flex; align-items: center; justify-content: center; font-size: 26px; background: #0c0a07; color: #fff; }
.cos .cn { font-size: 12.5px; } .cos .cp { color: #ffd27a; font-size: 12px; margin: 2px 0 4px; }
/* news */
.pnote { border: 1px solid #3a2e1c; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; background: #15110c; }
.pnv { color: var(--gold); font-family: Cinzel, serif; } .pnt { font-size: 17px; font-weight: 700; margin: 2px 0 4px; }
.pns b { color: var(--gold2); } .pns ul { margin: 2px 0 6px 18px; padding: 0; } .pns li { margin: 2px 0; font-size: 13.5px; line-height: 1.35; }
.news.pop { max-height: 60vh; overflow: auto; }
/* account */
.account { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.acard { border: 1px solid #3a2e1c; border-radius: 6px; padding: 8px 10px; background: #15110c; }
.acard label { display: block; margin: 6px 0 2px; font-size: 13px; color: var(--gold2); }
.acard input, .acard select { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
/* in-match: merchant shop & emotes */
#h-shop { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, 94vw); max-height: 80vh; overflow: auto; z-index: 40; }
#h-shop .x, #h-emotes .x { float: right; cursor: pointer; }
.shoplist { margin-top: 6px; }
.srow { display: flex; align-items: center; gap: 8px; padding: 4px; border-bottom: 1px solid #241c12; }
.srow .sic { width: 40px; height: 40px; flex: none; } .srow .sic img { width: 40px; height: 40px; }
.srow .sname { flex: 1; font-size: 13px; } .srow .stier { font-size: 11px; }
.srow .sprice { color: #ffd34a; font-size: 13px; min-width: 70px; text-align: right; }
.srow.sold { opacity: .45; }
#h-shop .gold { color: #ffd34a; }
#h-emotes { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 40; width: min(420px, 92vw); }
.emogrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.emo { background: #15110c; border: 1px solid #3a2e1c; border-radius: 6px; color: #fff; padding: 6px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.emo span { font-size: 22px; } .emo small { font-size: 10px; color: var(--dim); }
.emo:hover { border-color: var(--gold); }
.pressed { filter: brightness(1.4); transform: scale(.94); }
html.touch #game .mode, html.touch #game .abslot, html.touch #game .cslot, html.touch #t-loot, html.touch #game .offer, html.touch #h-shop button, html.touch .emo { touch-action: none; }
@media (max-width: 760px) { .social { grid-template-columns: 1fr; } .realms { grid-template-columns: 1fr 1fr; } }
select { background: #120e0a; color: inherit; border: 1px solid #5a4628; border-radius: 4px; padding: 4px 6px; font: inherit; }
/* dropping items */
.dragghost { position: fixed; z-index: 300; pointer-events: none; width: 40px; height: 40px; opacity: .9; border: 2px solid var(--gold); border-radius: 4px; background: rgba(20,16,10,.85); }
.dragghost img { width: 36px; height: 36px; }
.dragghost.willdrop { border-color: #ff8a5a; box-shadow: 0 0 12px #ff8a5a; }
.dragghost.willdrop::after { content: 'drop'; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); font-size: 11px; color: #ffb08a; text-shadow: 0 1px 2px #000; }
#h-inv .item.dragging, #h-inv .slot.dragging { opacity: .35; }
.tmenu .tm-drop { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tmenu .tm-drop input { width: 72px; text-align: center; }
.tmenu .tm-drop .btn { padding: 9px 10px; }
.tmenu .tm-note { margin-top: 8px; }
#h-inv img { -webkit-user-drag: none; user-select: none; }

/* ---- v1.5: animated skins, class bundles, admin tools ---- */
.vcats div.star { color: #ffd27a; border-color: #6a5420; background: linear-gradient(180deg, #2a2010, #17120a); }
.vcats div.star.on { border-color: var(--gold); box-shadow: 0 0 8px rgba(226,192,106,.35); }
.cos canvas.cpv { display: block; margin: 0 auto 4px; background: radial-gradient(ellipse at 50% 70%, #1e1810, #0c0a07 70%); border-radius: 6px; image-rendering: pixelated; }
.cos canvas.cpv.ab { image-rendering: auto; }
.cos .bcls { font-size: 11px; color: var(--dim); margin: 1px 0 2px; line-height: 1.25; }
.cos .cbtns { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.cos.anim { border-color: #4a3a5a; }
.cos.anim.own { border-color: #5a7a3a; }
.cos.anim.worn, .cos.bundle.worn { border-color: var(--gold); }
.cosgrid.bundles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cos.bundle { border-color: color-mix(in srgb, var(--bc) 45%, #3a2e1c); background: linear-gradient(180deg, color-mix(in srgb, var(--bc) 10%, #15110c), #15110c 60%); padding: 8px; }
.cos.bundle canvas.cpv { box-shadow: 0 0 14px color-mix(in srgb, var(--bc) 30%, transparent) inset; }
.cos.bundle .cn { font-family: Cinzel, serif; font-size: 14px; color: #f2e2b8; }
.cos.bundle .bblurb { font-size: 11.5px; color: #cfc6b0; margin: 3px 0; line-height: 1.3; }
.cos.bundle .bparts { text-align: left; font-size: 11px; color: #bfb49a; margin: 4px 0 4px 14px; padding: 0; line-height: 1.35; }
.adtag { font-size: 10px; padding: 1px 5px; border-radius: 3px; background: #6a4a10; color: #ffe2a0; font-weight: bold; letter-spacing: .5px; vertical-align: middle; }
.tabbar div.admtab { color: #ffd27a; }
.admin .adgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 8px; }
.admin .adlist { max-height: 340px; overflow-y: auto; margin: 6px 0; }
.admin .adrow { padding: 5px 6px; border-radius: 4px; cursor: pointer; border: 1px solid transparent; }
.admin .adrow:hover { background: #221a10; } .admin .adrow.on { border-color: var(--gold); background: #2a2014; }
.admin .odot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #555; margin-right: 6px; }
.admin .odot.on { background: #5aff6a; box-shadow: 0 0 6px #5aff6a; }
.admin .adline { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.admin .adline input { flex: 1; min-width: 0; margin: 0; }
.admin .adinfo { background: #0f0c08; border: 1px solid #3a2e1c; border-radius: 4px; padding: 6px 8px; margin: 4px 0; font-size: 13px; }
.admin .adown { display: flex; flex-wrap: wrap; gap: 4px; max-height: 160px; overflow-y: auto; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 4px 2px 7px; border: 1px solid #3a2e1c; border-radius: 10px; background: #1a140d; }
.chip a { cursor: pointer; color: #ff8a6a; font-weight: bold; padding: 0 3px; }
label.chk { display: flex !important; align-items: center; gap: 6px; font-size: 13px; color: var(--text, #ddd) !important; cursor: pointer; }
label.chk input { width: auto !important; margin: 0 !important; }
.rkey { font-family: monospace; font-size: 15px; background: #0f0c08; border: 1px solid #5a4a2a; border-radius: 4px; padding: 6px 10px; margin: 6px 0; user-select: all; }

/* ---- v1.6: bank filters, multi-sell, new items, gear stats, auction house, companions, broadcasts ---- */
.bfilters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.bfilters select, .bfilters input { font-size: 13px; padding: 4px 6px; }
.bfilters input { flex: 1; min-width: 120px; max-width: 220px; }
.bselbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 8px; margin-bottom: 6px; border: 1px solid #6a5420; border-radius: 6px; background: #1d170c; font-size: 13px; }
.goldtxt { color: #ffd27a; } .warntxt { color: #ff9a6a; } .oktxt { color: #8fe08a; }
.item.sel { outline: 2px solid #ffd27a; outline-offset: -2px; box-shadow: 0 0 10px rgba(255,210,122,.55) inset; }
.item.sel::after { content: "✓"; position: absolute; top: 1px; left: 3px; font-size: 13px; font-weight: 800; color: #ffd27a; text-shadow: 0 0 3px #000; }
.item.isnew { box-shadow: 0 0 0 1px #7dff6a, 0 0 10px rgba(125,255,106,.45); animation: newpulse 1.8s ease-in-out infinite; }
@keyframes newpulse { 50% { box-shadow: 0 0 0 1px #7dff6a, 0 0 4px rgba(125,255,106,.2); } }
.item .newtag { position: absolute; top: -5px; right: -4px; font: 700 8.5px/1 sans-serif; letter-spacing: .5px; background: #3ad63a; color: #062006; padding: 2px 3px; border-radius: 3px; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .item.isnew { animation: none; } }
.look #statsb { margin-left: 2px; }
.gstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.gcol h5, .gsh { margin: 6px 0 4px; font-family: Cinzel, serif; color: var(--gold); font-size: 14px; }
.gs { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; padding: 3px 0; border-bottom: 1px dotted #3a2e1c; font-size: 13px; }
.gs b { color: #f2e2b8; font-variant-numeric: tabular-nums; }
.gs em { flex-basis: 100%; text-align: right; font-style: normal; font-size: 11.5px; color: var(--dim); margin-top: -3px; }
.gset { font-size: 12.5px; margin: 4px 0; padding: 6px 8px; border: 1px solid #3a4a2a; border-radius: 6px; background: #121a0e; }
.ahhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ahhead .vcats { margin: 0; }
.ahlist { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.ahrow { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 5px 8px; border: 1px solid #3a2e1c; border-radius: 6px; background: #15110c; }
.ahrow .item { width: 48px; height: 48px; }
.ahrow.sold { opacity: .7; } .ahrow.expired { border-color: #6a3a1c; }
.ahinfo { min-width: 0; } .ahinfo b { word-break: break-word; }
.ahbuy { text-align: right; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.ahbuy .price { color: #ffd27a; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ahpet { width: 56px; height: 50px; background: radial-gradient(circle, #2a2218, #120e0a); border-radius: 4px; image-rendering: pixelated; }
.cos.comp { border-color: #4a5a2a; } .cos.comp .cp .dim { font-weight: 400; }
.acard textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; background: #0f0c08; color: inherit; border: 1px solid #3a2e1c; border-radius: 4px; padding: 6px; }
.bcast { position: fixed; top: max(14px, env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 9999; width: min(620px, calc(100vw - 24px)); display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; background: linear-gradient(180deg, #2a2010, #17120a); border: 2px solid #e6b94e; box-shadow: 0 10px 40px rgba(0,0,0,.7), 0 0 24px rgba(230,185,78,.35); color: #f4ead0; animation: bcin .35s ease-out; }
.bcast.warn { border-color: #ff9a3a; box-shadow: 0 10px 40px rgba(0,0,0,.7), 0 0 26px rgba(255,140,50,.45); }
.bcast.restart { border-color: #ff4a3a; background: linear-gradient(180deg, #3a1210, #1a0a08); box-shadow: 0 10px 40px rgba(0,0,0,.7), 0 0 30px rgba(255,70,50,.5); }
.bcast.out { opacity: 0; transform: translate(-50%, -20px); transition: all .3s; }
@keyframes bcin { from { opacity: 0; transform: translate(-50%, -30px); } }
.bci { font-size: 30px; line-height: 1; }
.bcb { flex: 1; min-width: 0; }
.bch { font-family: Cinzel, serif; font-weight: 700; color: #ffd27a; font-size: 15px; } .bch span { font-family: sans-serif; font-weight: 400; color: #bfb49a; font-size: 12px; }
.bctxt { font-size: 16px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.bccd { margin-top: 6px; font: 700 18px/1 monospace; color: #ff8a6a; }
.bcx { background: none; border: 0; color: #bfb49a; font-size: 18px; cursor: pointer; padding: 0 4px; }
.bselbar[hidden], .bccd[hidden] { display: none !important; }
.gprops { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
