/* Quilomworld: mismo escritorio de Windows 98 y cómic que Quotidiano, pero encima de un mundo 3D. */
:root {
  --face: #C0C0C0; --page: #fff; --ink: #101014; --mute: #55555F; --hi: #fff; --md: #DFDFDF; --lo: #808080; --dk: #0A0A0A;
  --sel: #000080; --boom: #E4002B; --tape: #FFE04A; --ok: #0B7A3E;
  --display: "Bangers", "Impact", "Arial Narrow", sans-serif;
  --body: Tahoma, "Segoe UI", Verdana, "Trebuchet MS", sans-serif;
  --type: "Special Elite", "Courier New", monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: #6fc0f5; font-family: var(--body); font-size: 14px; color: var(--ink); -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); text-align: center; white-space: nowrap; will-change: transform; }
.tag .nm { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; padding: 1px 6px; background: rgba(0, 0, 0, .55); border-radius: 3px; }
.tag.me .nm { background: rgba(0, 0, 128, .75); }
.tag .bub { display: none; position: relative; max-width: 190px; margin: 0 auto 4px; padding: 4px 8px; background: #fff; color: var(--ink); border: 2px solid var(--dk); border-radius: 8px; font-size: 13px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; box-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.tag .bub.on { display: block; }
.tag .bub::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--dk); }

/* ventanas estilo Windows 98 */
.win { background: var(--face); box-shadow: inset -1px -1px var(--dk), inset 1px 1px var(--hi), inset -2px -2px var(--lo), inset 2px 2px var(--md), 4px 4px 0 rgba(0, 0, 0, .45); padding: 3px; }
.tb { display: flex; align-items: center; background: linear-gradient(90deg, #000080, #1084d0); color: #fff; padding: 2px 6px; font-weight: 700; font-size: 13px; min-height: 22px; }
.tb .ttl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb { padding: 10px; }
.face { background: var(--face); }
.center { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; z-index: 30; }
.btn { background: var(--face); border: 0; padding: 5px 12px; cursor: pointer; font-weight: 700; min-height: 34px; box-shadow: inset -1px -1px var(--dk), inset 1px 1px var(--hi), inset -2px -2px var(--lo), inset 2px 2px var(--md); color: var(--ink); }
.btn:active, .btn[aria-pressed="true"] { box-shadow: inset 1px 1px var(--dk), inset -1px -1px var(--hi), inset 2px 2px var(--lo); background: #b4b4b4; }
.btn.go { background: var(--tape); }
.btn:focus-visible, input:focus-visible { outline: 2px dotted var(--ink); outline-offset: 2px; }
input[type="text"] { width: 100%; padding: 6px 8px; border: 0; background: #fff; box-shadow: inset 1px 1px var(--dk), inset -1px -1px var(--hi), inset 2px 2px var(--lo); }
.hint { color: var(--mute); font-size: 12px; }
.err { color: var(--boom); font-weight: 700; min-height: 1.2em; margin: 6px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.logo { font-family: var(--display); font-size: 54px; letter-spacing: .05em; line-height: 1; margin: 0; text-align: center; color: var(--tape); text-shadow: 3px 3px 0 var(--dk), -1px -1px 0 var(--dk), 1px -1px 0 var(--dk), -1px 1px 0 var(--dk); }
.sub { text-align: center; margin: 4px 0 12px; }
.lgrid { display: flex; gap: 14px; align-items: flex-start; }
.lf { flex: 1; min-width: 0; }
.lf label { font-weight: 700; display: block; margin-bottom: 3px; }
.pick { margin-top: 8px; }
.pick span { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.pick div { display: flex; gap: 4px; flex-wrap: wrap; }
.pick button { width: 24px; height: 24px; border: 2px solid var(--dk); padding: 0; cursor: pointer; }
.pick button[aria-pressed="true"] { outline: 3px solid var(--sel); outline-offset: 1px; }
.pv { position: relative; width: 84px; height: 150px; flex: 0 0 auto; background: linear-gradient(#9fd8ff, #d8f0ff); border: 2px solid var(--dk); }
.pv i { position: absolute; display: block; border: 1px solid rgba(0, 0, 0, .55); }
.pv .h { left: 29px; top: 18px; width: 26px; height: 26px; }
.pv .hr { left: 27px; top: 14px; width: 30px; height: 10px; }
.pv .b { left: 27px; top: 46px; width: 30px; height: 40px; }
.pv .a { top: 46px; width: 11px; height: 38px; }
.pv .a.l { left: 14px; } .pv .a.r { left: 59px; }
.pv .lg { top: 86px; width: 14px; height: 42px; }
.pv .lg.l { left: 28px; } .pv .lg.r { left: 42px; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
#info { position: absolute; left: max(8px, env(safe-area-inset-left)); top: max(8px, env(safe-area-inset-top)); width: 220px; }
#info .wb { padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; font-weight: 700; }
#info .hint { font-weight: 400; font-size: 11px; line-height: 1.3; }
#chatLog { position: absolute; left: max(8px, env(safe-area-inset-left)); bottom: calc(92px + env(safe-area-inset-bottom)); width: min(340px, calc(100vw - 16px)); max-height: 38vh; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; pointer-events: none; }
#chatLog p { margin: 0; padding: 2px 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; border-radius: 3px; overflow-wrap: anywhere; transition: opacity .6s; }
#chatLog p b { margin-right: 4px; }
#chatLog p.old { opacity: 0; }
#chatLog p.sys { color: #ffe9a0; font-family: var(--type); font-size: 12px; }
#chatForm { position: absolute; left: max(8px, env(safe-area-inset-left)); bottom: calc(54px + env(safe-area-inset-bottom)); width: min(340px, calc(100vw - 16px)); display: flex; gap: 4px; padding: 4px; }
#chatForm input { flex: 1; }
#bar { position: absolute; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; max-width: calc(100vw - 8px); }
#bar .btn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 54px; min-height: 42px; padding: 2px 6px; font-size: 18px; line-height: 1.1; }
#bar .btn small { font-size: 10px; font-weight: 700; }
.sw { display: block; width: 20px; height: 20px; border: 2px solid var(--dk); }
#palette { position: absolute; left: 50%; bottom: calc(66px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(330px, calc(100vw - 16px)); }
#palGrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 8px; }
#palGrid button { border: 2px solid var(--dk); height: 38px; padding: 0; cursor: pointer; position: relative; }
#palGrid button[aria-pressed="true"] { outline: 3px solid var(--sel); outline-offset: 1px; }
#palGrid button span { position: absolute; left: 0; right: 0; bottom: -1px; font-size: 9px; background: rgba(255, 255, 255, .85); color: var(--ink); line-height: 1.1; text-align: center; }
#joy { position: absolute; left: calc(22px + env(safe-area-inset-left)); bottom: calc(110px + env(safe-area-inset-bottom)); width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .25); border: 3px solid rgba(0, 0, 0, .45); touch-action: none; }
#joy i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255, 224, 74, .9); border: 3px solid var(--dk); }
#jumpBtn { position: absolute; right: calc(20px + env(safe-area-inset-right)); bottom: calc(120px + env(safe-area-inset-bottom)); width: 84px; height: 84px; border-radius: 50%; touch-action: none; }
#toast { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); background: rgba(0, 0, 0, .8); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 40; max-width: calc(100vw - 24px); text-align: center; }
@media (max-width: 640px) {
  #info { width: 170px; } #info .hint { display: none; }
  #bar .btn { min-width: 46px; } #bar .btn small { display: none; }
  .logo { font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) { #chatLog p { transition: none; } }

.hpbar { position: relative; display: block; height: 14px; background: #4a1a1a; border: 2px solid var(--dk, #222); }
.hpbar i { display: block; height: 100%; width: 100%; background: #e33; transition: width .25s; }
.hpbar b { position: absolute; inset: 0; font-size: 10px; line-height: 10px; text-align: center; color: #fff; text-shadow: 1px 1px 0 #000; }
#coins { font-size: 14px; }
.tag .hp { display: block; width: 44px; height: 4px; margin: 2px auto 0; background: rgba(0,0,0,.6); }
.tag .hp i { display: block; height: 100%; background: #e33; }
.tag.me .hp { display: none; }

#wandInfo, #kd, #zone { font-size: 13px; }
#zone { color: #0a6; }
#shop { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); width: min(92vw, 330px); }
#shop p { margin: 0 0 6px; font-size: 12px; line-height: 1.3; font-weight: 400; }
#shop .row { display: flex; gap: 6px; flex-wrap: wrap; }
.tag.npc .hp { display: none; }
.tag.npc .nm { background: rgba(90, 20, 120, .85); }

.cpbar { background: #1a2a4a; } .cpbar i { background: #3b8cff; }
.xpbar { background: #3a3a1a; } .xpbar i { background: #e6c229; width: 0; }
#lvlInfo { font-size: 13px; }
#questInfo { font-size: 12px; font-weight: 400; line-height: 1.3; color: #5a2a00; }
#maestro { position: absolute; right: max(8px, env(safe-area-inset-right)); top: max(8px, env(safe-area-inset-top)); width: min(92vw, 290px); }
#maestro p { margin: 0 0 6px; font-size: 12px; line-height: 1.35; font-weight: 400; }
#maestro .row { display: flex; gap: 6px; flex-wrap: wrap; }
.tag .lv { font-style: normal; font-weight: 400; opacity: .85; margin-left: 4px; }
.tag.mob .nm { background: rgba(120, 20, 20, .8); }

.tb .x { border: 2px outset #eee; background: #c0c0c0; color: #000; font-size: 11px; line-height: 1; padding: 1px 5px; cursor: pointer; }
#zone.wild { color: #b03000; } #zone.calm { color: #2060b0; }

#wands { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); width: min(94vw, 440px); max-height: 80vh; overflow: auto; }
#wands p { margin: 0 0 6px; font-size: 12px; line-height: 1.3; font-weight: 400; } #wands .wh { margin-top: 8px; }
#wList { display: flex; flex-direction: column; gap: 4px; }
.wr { display: flex; align-items: center; gap: 6px; padding: 3px 4px; background: #d8d8d8; border: 2px inset #fff; font-size: 13px; flex-wrap: wrap; }
.wr b { flex: 1; min-width: 90px; } .wr small { font-weight: 400; color: #060; } .wr .btn { padding: 2px 6px; font-size: 12px; }
#wands .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } #wands select, #wands input { font: inherit; font-size: 12px; max-width: 130px; }
#wands input { width: 80px; }
#offerBox { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); width: min(92vw, 320px); z-index: 20; }
#offerBox p { margin: 0 0 6px; font-size: 13px; } #offerBox .row { display: flex; gap: 6px; }

#wx { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); padding: 5px 12px; font-size: 14px; font-weight: 700; text-align: center; max-width: min(92vw, 520px); z-index: 15; }
#wx.warn { background: #ffe9a8; } #wx.on { background: #ffb0a0; }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 30; transition: opacity .35s ease-out; }
#dead { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; background: rgba(60,0,0,.55); color: #fff; font-size: clamp(20px,4vw,34px); font-weight: 800; z-index: 25; pointer-events: none; text-shadow: 0 2px 6px #000; }
#dead[hidden] { display: none; }

/* chapitas de rango */
.bdg { width: 22px; height: 22px; margin-right: 4px; vertical-align: middle; filter: drop-shadow(0 0 1px #000); flex: none; }
#plist .bdg { width: 28px; height: 28px; }
#plist { position: absolute; right: 8px; top: 8px; width: min(60vw, 250px); max-height: 60vh; overflow: auto; z-index: 14; }
#plist ul { list-style: none; margin: 0; padding: 0; font-size: 13px; }
#plist li { display: flex; align-items: center; gap: 2px; padding: 2px 0; border-bottom: 1px dotted rgba(0,0,0,.25); }
#plist li.me { font-weight: 800; } #plist .pn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } #plist small { opacity: .7; font-size: 10px; margin-left: 4px; }
.tag .bdg { width: 19px; height: 19px; margin-right: 3px; }

#carryBar { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); padding: 5px 12px; font-size: 14px; font-weight: 700; background: #ffe2a8; text-align: center; max-width: min(92vw, 520px); z-index: 15; }
#home { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); width: min(94vw, 420px); max-height: 80vh; overflow: auto; z-index: 16; }
#home p { margin: 0 0 6px; font-size: 12px; line-height: 1.35; font-weight: 400; } #home .wh { margin-top: 8px; } #home .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
#home input { font: inherit; font-size: 12px; width: 120px; } #home ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; } #home li { display: flex; gap: 6px; align-items: center; padding: 1px 0; } #home .btn[disabled] { opacity: .5; }
.tag.carry .nm::before { content: '🥨 '; }
#donate { position: absolute; left: 50%; top: 20%; transform: translateX(-50%); width: min(86vw, 320px); z-index: 15; }
#donate a.btn { display: inline-block; text-decoration: none; }
