/* v2 shell: how the LINKFRAME UI sits on top of the real game (js/v2/boot.js adds body.v2).
   Layers: field (hub.js) < #v2hud 100 < #walkcv 110 < #inst 120 < #v2dock 130 < #desk old windows 140 < toasts 200 < modal 900 < battle 1000 */
body.v2 #top, body.v2 #dock, body.v2 #field > .banner, body.v2 #field > .partner, body.v2 #field > .townp, body.v2 #field > .npcs, body.v2 #field > .safe,
body.v2 .rail, body.v2 #rail, body.v2 .tracker, body.v2 #tracker { display: none !important; }
body.v2 #field { top: 0 !important; bottom: 0 !important; transition: filter .2s; }
body.v2.v2open #field { filter: brightness(.55) saturate(.8); }
body.v2 #desk { inset: 0 !important; z-index: 140 !important; }
:is(#inst, #v2dock, #v2hud, #v2talk) { font: 15px/1.4 var(--tx); color: var(--ink); box-sizing: border-box; }
:is(#inst, #v2dock, #v2hud, #v2talk) *, :is(#inst, #v2dock, #v2hud, #v2talk) *::before, :is(#inst, #v2dock, #v2hud, #v2talk) *::after { box-sizing: border-box; }
:is(#inst, #v2dock, #v2hud, #v2talk) button { font: inherit; color: inherit; cursor: pointer; }
:is(#inst, #v2dock, #v2hud, #v2talk) img.px { image-rendering: pixelated; }
#v2hud { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
#v2hud .fld { position: absolute; inset: 0; background: none !important; overflow: visible; }
#v2hud .fld > * { pointer-events: auto; }
body.v2open #v2hud { display: none; }
#walkcv { z-index: 110 !important; }
#inst { z-index: 120 !important; }
#inst:empty { display: none; }
#v2dock { z-index: 130 !important; }
/* the field boss tracker stays (top left, under the location card) */
body.v2 #field > .bosshud { top: 150px !important; left: 16px !important; right: auto !important; z-index: 101; }
body.v2.v2open #field > .bosshud { display: none; }
/* other Tamers: above the wild Digimon labels, under the HUD */
body.v2 #field > .mpl { z-index: 98 !important; }
@media (max-width: 700px) { body.v2 #field > .bosshud { top: 128px !important; left: 8px !important; } }
/* chat: opened from the dock's Chat button (the floating pill and the side rail stay hidden) */
body.v2 #chat { z-index: 115; right: 16px; bottom: 84px; }
body.v2 #chat .ch-pill, body.v2 #chat .ch-bubble, body.v2 #field .tp-pill { display: none !important; }
#v2dock .dchat { position: relative; }
#v2dock .dbadge { position: absolute; top: 2px; right: 12px; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--org); color: #fff; font: 700 10px/16px var(--mono); }
#v2dock .dmore { position: absolute; right: 0; bottom: calc(100% + 6px); display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; background: var(--shell); box-shadow: 0 0 0 1px #0005, 0 8px 24px #0006; border-radius: 4px; }
#v2dock .dmore button { width: 84px; }
#v2dock .more { display: none; }
@media (max-width: 760px) { #v2dock .more { display: flex; } body.v2 #chat { left: 0; right: 0; bottom: 64px; } }
@media (max-width: 760px) { body.v2 #chat .ch-panel { height: 26vh; } }
/* field boss tracker: under the location card, never shifted off screen */
body.v2 #field > .bosshud { transform: none !important; top: 196px !important; left: 28px !important; max-width: 340px; flex-direction: column; align-items: flex-start; }
@media (max-width: 760px) { body.v2 #field > .bosshud { top: 246px !important; left: 10px !important; max-width: calc(100vw - 20px); } }
/* v0.67 PHONE (the player: "the screen is full of menus, the Maze bosses fill half the screen, menus are huge"):
   field bosses = one row of small chips (sprite + count), the HUD, the dock, the chat and every panel drawn smaller */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
#field > .bosshud .bhc { display: none; }
@media (max-width: 760px) {
  body.v2 #field > .bosshud { flex-direction: row !important; flex-wrap: nowrap; overflow-x: auto; gap: 4px; max-width: calc(100vw - 16px) !important; left: 8px !important; scrollbar-width: none; }
  body.v2 #field > .bosshud .bh { flex: none; flex-direction: column; gap: 0; padding: 2px 3px !important; border-width: 1px !important; border-radius: 6px !important; min-width: 40px; }
  body.v2 #field > .bosshud .bh img { width: 28px !important; height: 28px !important; }
  body.v2 #field > .bosshud .bh > span { display: none !important; }
  body.v2 #field > .bosshud .bhc { display: block; font: 700 9px/1 var(--mono, monospace); font-style: normal; color: #ffd8d0; text-align: center; }
  body.v2 #field > .bosshud .bh.ready .bhc { color: #ffd34a; }
  body.v2 #inst, body.v2 #v2hud { zoom: .8; }
  body.v2 #v2dock, body.v2 #chat { zoom: .82; }
  body.v2 #chat .ch-panel { height: 30vh; }
}
