* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #07070c; color: #e8dcc8; font: 14px/1.4 "Trebuchet MS", "Segoe UI", sans-serif; -webkit-user-select: none; user-select: none; touch-action: none; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.hidden { display: none !important; }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .04em; margin: 0 0 .4em; color: #ffb45a; }
h1 { font-size: 34px; text-shadow: 0 0 18px #e0541e88; } h2 { font-size: 22px; } h3 { font-size: 16px; margin-top: 1em; border-bottom: 1px solid #5a4630; }
h2 small, h3 small { font-size: 12px; color: #b8a888; font-variant: normal; letter-spacing: 0; margin-left: .5em; }
small { color: #b8a888; } .gold { color: #f2d14b !important; } .err { color: #ff6a5a; min-height: 1.4em; margin: .4em 0 0; }
button { font: inherit; color: #e8dcc8; background: #2a2230; border: 1px solid #5a4630; border-radius: 4px; padding: 6px 12px; cursor: pointer; }
button:hover:not(:disabled) { background: #3a2e40; border-color: #ffb45a; } button:disabled { opacity: .45; cursor: default; }
button.go { background: #a8421c; border-color: #ff8a2e; color: #fff; font-weight: bold; } button.go:hover { background: #c8521c !important; }
input { font: inherit; width: 100%; padding: 8px; margin-top: 3px; background: #0e0b12; color: #fff; border: 1px solid #5a4630; border-radius: 4px; -webkit-user-select: text; user-select: text; }
input:focus, textarea:focus { outline: none; border-color: #ffb45a; }
textarea { font: inherit; width: 100%; padding: 8px; margin: 3px 0 6px; background: #0e0b12; color: #fff; border: 1px solid #5a4630; border-radius: 4px; resize: vertical; -webkit-user-select: text; user-select: text; }

.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; overflow: auto; z-index: 30;
  background: radial-gradient(ellipse at 50% 110%, #5a1e0c 0%, #1a0e14 45%, #07070c 100%); }
.card { width: 100%; max-width: 380px; background: #16121cf2; border: 2px solid #5a4630; border-radius: 8px; padding: 22px; box-shadow: 0 10px 40px #000; }
.card.wide { max-width: 640px; } .card label { display: block; margin: 10px 0; } .card .go { width: 100%; padding: 11px; margin-top: 10px; font-size: 16px; }
#createAcct, #logout, #forgotGo, #fSend, #fBack { width: 100%; margin-top: 6px; } #forgotGo { background: none; border: none; color: #b8a888; text-decoration: underline; } #charNameRow { margin: 0 0 10px !important; }
#charList { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.charCard { background: #0e0b12; border: 1px solid #5a4630; border-radius: 6px; padding: 8px; text-align: center; } .charCard img { width: 64px; height: 96px; image-rendering: pixelated; display: block; margin: 0 auto; }
.charCard b { display: block; } .charCard small { display: block; min-height: 2.6em; } .charCard button { width: 100%; margin-top: 4px; padding: 5px; } .charCard.new { display: flex; align-items: center; justify-content: center; min-height: 190px; }
.pwrow { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; } .pwrow input { flex: 1 1 130px; margin: 0; width: auto; }
.sub { color: #b8a888; margin: 0 0 1em; } .hint { color: #8a7a68; font-size: 12px; margin-bottom: 0; }
.cols { display: flex; gap: 16px; flex-wrap: wrap; } .col { flex: 0 0 auto; } .col.wide { flex: 1 1 260px; min-width: 0; }
#preview, #pv { display: block; background: #0e0b12; border: 1px solid #5a4630; border-radius: 6px; margin-bottom: 8px; }
#creator #createCancel { width: 100%; margin-top: 6px; } #randLook { width: 100%; }
.opt { display: flex; align-items: center; gap: 8px; margin: 5px 0; } .opt span { flex: 1; } .opt b { width: 78px; text-align: center; text-transform: capitalize; } .opt button { padding: 3px 10px; }
.sw { display: inline-block; width: 34px; height: 16px; border: 1px solid #000; border-radius: 3px; vertical-align: middle; }
.kits { display: flex; gap: 6px; margin-top: 12px; } .kit { flex: 1; text-align: left; padding: 8px; } .kit small { display: block; font-size: 11px; } .kit.on { border-color: #ff8a2e; background: #4a2416; } .kits.realms { margin: 0 0 12px; flex-wrap: wrap; }

#hud > * { position: fixed; z-index: 5; }
#vitals { left: 10px; top: 10px; width: 230px; } #who { font-family: Georgia, serif; font-weight: bold; text-shadow: 0 1px 3px #000; margin-bottom: 3px; }
.bar { position: relative; height: 16px; background: #000a; border: 1px solid #000; border-radius: 3px; margin-bottom: 3px; overflow: hidden; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width .15s; } .bar span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 14px; text-shadow: 0 1px 2px #000; }
.hp i { background: linear-gradient(#e8503a, #a82a20); } .mp i { background: linear-gradient(#4a8ae8, #2a4aa8); } .xp { height: 9px; } .xp i { background: #f2d14b; } .xp span { font-size: 8px; line-height: 8px; color: #000; text-shadow: none; }
#boss { left: 50%; top: 10px; transform: translateX(-50%); width: min(46vw, 420px); text-align: center; text-shadow: 0 1px 3px #000; color: #ff9a5a; font-family: Georgia, serif; }
#topright { right: 10px; top: 10px; width: 150px; text-align: right; } #mini { border: 2px solid #5a4630; border-radius: 4px; background: #0b0b12; width: 140px; height: 140px; }
#zoneName { font-family: Georgia, serif; font-variant: small-caps; color: #ffb45a; text-shadow: 0 1px 3px #000; }
#menu { display: flex; flex-wrap: wrap; gap: 3px; justify-content: flex-end; margin: 4px 0; } #menu button { padding: 3px 6px; font-size: 12px; background: #16121cd8; }
#tracker { font-size: 12px; text-shadow: 0 1px 2px #000, 0 0 4px #000; } #tracker b { color: #f2d14b; display: block; margin-top: 5px; } #tracker .ok { color: #7dffa0; }
#chat { left: 10px; bottom: 10px; width: min(320px, 44vw); } #chatLog { max-height: 130px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; font-size: 13px; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
#chatLog div { word-wrap: break-word; } #chatLog b { color: #9fe0ff; } #chatLog .sys { color: #c8b890; font-style: italic; }
#chatIn { background: #0006; border-color: #5a463088; padding: 4px 8px; font-size: 13px; }
#hotbar { left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; gap: 4px; }
.slot { position: relative; width: 46px; height: 46px; padding: 0; background: #16121cd8; overflow: hidden; }
.slot i { position: absolute; inset: 9px; border-radius: 50%; box-shadow: 0 0 10px currentColor inset, 0 0 6px #000; opacity: .9; } .slot img { position: absolute; inset: 5px; width: 36px; height: 36px; }
.slot b { position: absolute; left: 3px; top: 0; font-size: 11px; text-shadow: 0 1px 2px #000; } .slot u { position: absolute; right: 3px; bottom: 0; font-size: 11px; text-decoration: none; text-shadow: 0 1px 2px #000; }
.slot em { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: #000b; } .slot small { display: none; } .slot.nomana i { opacity: .3; } .slot.pot { margin-left: 6px; }
#prompt { left: 50%; bottom: 76px; transform: translateX(-50%); background: #16121ce8; border-color: #ffb45a; white-space: nowrap; }
#banner { left: 0; right: 0; top: 22%; text-align: center; pointer-events: none; font: small-caps 38px Georgia, serif; color: #ffd9a0; text-shadow: 0 2px 6px #000, 0 0 24px #e0541e; opacity: 0; }
#banner small { display: block; font-size: 16px; color: #e8dcc8; } #banner.show { animation: banner 3.5s ease-out; }
@keyframes banner { 0% { opacity: 0; transform: translateY(12px); } 15%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }
#death { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #3a0808a8; font: small-caps 44px Georgia, serif; color: #ff8a7a; text-shadow: 0 2px 8px #000; pointer-events: none; } #death small { font-size: 16px; }
#touchUI { inset: 0; pointer-events: none; } #touchUI button { position: absolute; pointer-events: auto; border-radius: 50%; background: #16121ca0; }
#tAtk { right: 18px; bottom: 76px; width: 84px; height: 84px; font-weight: bold; } #tRoll { right: 112px; bottom: 66px; width: 58px; height: 58px; font-size: 12px; }
#stick { position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; border: 2px solid #fff4; border-radius: 50%; display: none; } #stick i { position: absolute; left: 30px; top: 30px; width: 36px; height: 36px; border-radius: 50%; background: #fff5; }

#panel { position: fixed; z-index: 20; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(680px, 96vw); max-height: 88vh; overflow-y: auto; background: #16121cf4; border: 2px solid #5a4630; border-radius: 8px; padding: 16px 18px; box-shadow: 0 10px 40px #000; touch-action: pan-y; }
#panel .x { position: absolute; right: 8px; top: 8px; padding: 2px 9px; }
.equip, .grid { display: grid; gap: 4px; } .equip { grid-template-columns: repeat(4, 44px); margin-bottom: 8px; } .grid { grid-template-columns: repeat(auto-fill, 44px); }
.cell { position: relative; width: 44px; height: 44px; padding: 0; background: #0e0b12; } .cell img { width: 36px; height: 36px; margin: 3px; display: block; } .cell.on { border-color: #ff8a2e; box-shadow: 0 0 8px #ff8a2e; }
.cell u { position: absolute; right: 3px; bottom: 0; font-size: 11px; text-decoration: none; text-shadow: 0 1px 2px #000; } .cell small { font-size: 9px; }
.stats div { display: flex; gap: 6px; align-items: center; padding: 1px 0; } .stats span { flex: 1; color: #b8a888; } .stats button { padding: 0 7px; } .pts { color: #7dffa0; margin: 0 0 4px; font-weight: bold; }
.detail { margin-top: 10px; min-height: 96px; padding: 8px; background: #0e0b12; border: 1px solid #3a2e30; border-radius: 4px; } .detail .btns { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.say { font-style: italic; color: #d8c8a8; } .quest { padding: 8px 10px; margin: 6px 0; background: #0e0b12; border-left: 3px solid #5a4630; border-radius: 3px; } .quest.ready { border-color: #f2d14b; } .quest.available { border-color: #7dffa0; }
.quest p { margin: 4px 0; } .quest ul { margin: 4px 0; padding-left: 18px; } .quest li.ok { color: #7dffa0; } .quest button { margin-top: 4px; }
.ware { display: flex; gap: 10px; align-items: center; padding: 6px; border-bottom: 1px solid #2a2230; } .ware img { width: 36px; height: 36px; } .ware div { flex: 1; font-size: 13px; }
.ach { display: flex; gap: 10px; align-items: center; padding: 6px 8px; margin: 3px 0; background: #0e0b12; border-radius: 3px; opacity: .55; } .ach.got { opacity: 1; border-left: 3px solid #f2d14b; } .ach div { flex: 1; } .ach p { margin: 0; font-size: 12px; color: #b8a888; }
#bigmap { width: 100%; max-width: 512px; display: block; margin: 0 auto 8px; border: 2px solid #5a4630; background: #0b0b12; }
.keys { columns: 2; padding-left: 18px; } kbd { background: #2a2230; border: 1px solid #5a4630; border-radius: 3px; padding: 0 5px; font: 12px monospace; }
#toasts { position: fixed; z-index: 40; left: 50%; top: 64px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.toast { padding: 6px 14px; background: #16121ce8; border: 1px solid #5a4630; border-radius: 16px; text-shadow: 0 1px 2px #000; animation: toast 4.5s forwards; white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }
.toast.bad { border-color: #c8423a; color: #ff9a8a; } .toast.good { border-color: #4fae4a; color: #9fffa8; } .toast.quest { border-color: #f2d14b; color: #ffe89a; }
.toast.level, .toast.ach { border-color: #ff8a2e; color: #ffd9a0; font-weight: bold; box-shadow: 0 0 14px #e0541e; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

@media (max-width: 720px) {
  #vitals { width: 150px; } #chat { width: 46vw; bottom: 64px; } #chatLog { max-height: 54px; font-size: 11px; } #chatIn { display: none; }
  #mini { width: 96px; height: 96px; } #topright { width: 132px; } #tracker { display: none; }
  .slot { width: 38px; height: 38px; } .slot img { inset: 3px; width: 30px; height: 30px; } #hotbar { gap: 2px; bottom: 6px; } #prompt { bottom: 170px; }
  #banner { font-size: 26px; }
}
