/* Layout of the walking HUD on every device (mobile-hud.js; owner 26/11/2026). Linked before index.html's own styles:
   rules that move an element named there take two ids (#hud > #act) so they win. */

/* the place card goes: its name sits on the minimap's lower edge and shows as a banner on entering */
#hud > #place { display: none; }
#zoneTag { position: absolute; left: -.15rem; bottom: -.75rem; max-width: 14rem; padding: .16rem .62rem; border-radius: 1rem; font-size: .8rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--white); pointer-events: none; z-index: 1; }
#zoneTag:empty { display: none; }
#zoneBanner { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); text-align: center; color: var(--white); white-space: nowrap; pointer-events: none; text-shadow: 0 .15rem .8rem rgba(0, 0, 0, .65); opacity: 0; transition: opacity .6s; z-index: 4; }
#zoneBanner.show { opacity: 1; }
#zoneBanner small { display: block; font-size: .85rem; font-weight: 800; letter-spacing: .25em; color: var(--gold); }
#zoneBanner b { display: block; margin-top: .3rem; font-size: 1.9rem; font-weight: 800; }
#zoneBanner i { display: block; width: 70%; height: 2px; margin: .5rem auto 0; background: linear-gradient(90deg, transparent, rgba(255, 214, 90, .9), transparent); }

/* the left column under the minimap: the status box, the next quest task, the list when opened */
#hudCol { position: absolute; left: 1rem; top: 10.6rem; display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; pointer-events: none; }
#hudCol > * { pointer-events: auto; }
#mobileStatus { position: relative; display: flex; flex-direction: column; gap: .25rem; min-width: 8.5rem; box-sizing: border-box; padding: .45rem .7rem .55rem; border-radius: .85rem; }
#mobileStatus #clock, #mobileStatus #mana { position: static; width: auto; height: auto; min-width: 0; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
#mobileStatus #clock { display: flex; align-items: center; justify-content: flex-start; gap: .4rem; }
#mobileStatus #clock svg { width: 1.45rem; height: 1.45rem; }
#mobileStatus #clock small { display: none; }
#mobileStatus #clock b, #mobileStatus #clock em { margin: 0; font-size: 1.05rem; white-space: nowrap; }
#mobileStatus #clock em { margin-left: auto; }
/* the "giả định" badge on the box's lower corner (the area name sits above the box) */
#mobileStatus #clock i { top: auto; bottom: -.6rem; right: -.45rem; z-index: 2; font-size: .6rem; }
#questToggle { display: flex; align-items: center; gap: .5rem; min-height: 2.5rem; max-width: 18rem; box-sizing: border-box; padding: 0 .8rem; border-radius: .85rem; font-size: .9rem; font-weight: 700; color: var(--white); text-align: left; }
#questToggle .box { width: .9rem; height: .9rem; flex: none; box-sizing: border-box; border: .14rem solid var(--white); border-radius: .2rem; }
#questToggle.done .box { background: #5ee28f; border-color: #5ee28f; }
#questToggle .txt { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#questToggle .more { color: var(--gold); }
#hudCol #quests { position: relative; left: auto; top: auto; }
#quests[data-collapsed="true"], #hudCol:has(#questToggle[aria-expanded="true"]) #questToggle { display: none; }
#questCollapse { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0; border-radius: 50%; font-size: 12px; background: #ffffff12; color: var(--muted); }
#hudCol #quests > h2 { padding-right: 24px; }   /* two ids: index.html's #quests h2 padding comes later */

/* top right: the bag (mana.js) beside Menu; the wallet, pieces and collection are entries in the Menu */
#top > #wallet, #top > #pieces, #top > #btnCollect { display: none; }
#top > #btnMenu, #top > #bagBtn { height: 2.9rem; }
@media (pointer: coarse) { #top > #btnMenu, #top > #bagBtn { height: 3.5rem; } }
/* the Sổ tay chip under the Menu button; hidden while a card is open in the same corner */
body:has(#hud:not([hidden])) #exploreLauncher { top: calc(5rem + env(safe-area-inset-top, 0px)); right: calc(1rem + env(safe-area-inset-right, 0px)); left: auto; transform: none; }
body:has(#card:not([hidden])) #exploreLauncher { visibility: hidden; }

/* notices under the compass (compass.js puts it on top); the act button by the right thumb, left of the ride button */
#hud > #toast { top: 3.6rem; max-width: min(62%, calc(100% - 2rem)); box-sizing: border-box; }
#hud > .worldChip { top: 3.6rem !important; }
body:has(#hud > .worldChip:not([hidden])) #hud > #toast { top: 6.2rem; }
#hud > #act { left: auto; right: 10.4rem; bottom: 2.35rem; transform: none; max-width: calc(100% - 22rem); }
#hud > #gearArc:not([hidden]) ~ #act, #hud > #gearArc:not([hidden]) ~ #lampBtn { visibility: hidden; }

/* held upright: notices under the left column, the act button above the ride button */
@media (orientation: portrait) {
  #hud > #toast { top: 20rem; max-width: calc(100% - 2rem); }
  #hud > .worldChip { top: 20rem !important; }
  body:has(#hud > .worldChip:not([hidden])) #hud > #toast { top: 22.6rem; }
  body:has(#questToggle[aria-expanded="true"]) #hud > #toast { top: 29rem; }
  #hud > #act { right: 6rem; bottom: 7.2rem; max-width: calc(100% - 8rem); }
  #zoneBanner b { font-size: 1.45rem; }
}

/* the Menu sheet */
.mobile-menu-nav { display: grid; gap: 8px; }
.mobile-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px; background: var(--paper-soft); color: var(--ink); border-radius: .7rem; text-align: left; font-size: max(13px, .8rem); }
.mobile-menu-item svg { width: max(24px, 1.4rem); height: max(24px, 1.4rem); flex: none; }
.mobile-menu-item > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mobile-menu-item strong { font-size: max(12px, .78rem); white-space: nowrap; }
.mobile-menu-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mobile-menu-actions > button { flex: 1 1 120px; width: auto; min-height: 44px; font-size: max(12px, .78rem); }
.mobile-menu-more { font-size: max(12px, .78rem); }
.mobile-menu-more summary { cursor: pointer; padding: 10px 0; font-weight: 700; }
