/* Tiny Realms UI redesign 2026-11-19 (owner-approved, DesignPreview/ui-redesign-20261119/DESIGN.md).
   One window frame for every window, labelled HUD navigation, and the grouped Menu window (Client/js/menu-hub.js).
   Loaded after the older layout sheets and before css/vip-theme.css so the VIP window themes still apply on top.
   Palette: cream #FFF8E8, ink #53576C, line #E6DDC9, selected #40BFB7. Close buttons and phone controls are 44 px. */

/* ---------- labelled main navigation: กระเป๋า / สกิล / เควส / เมนู ---------- */
#hud-nav { position: fixed; z-index: 13; display: flex; gap: 2px; padding: 5px; background: var(--glass); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow); pointer-events: auto; }
#hud-nav .nav-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 64px; min-height: 58px; padding: 4px 2px; border: 0; border-radius: 13px; background: transparent; color: var(--ink);
  font: 500 13px/1.15 var(--font); white-space: nowrap; }
#hud-nav .nav-btn:hover { background: var(--chip); }
#hud-nav .nav-btn:active { transform: translateY(1px); }
#hud-nav .nav-btn img { width: 32px; height: 32px; object-fit: contain; pointer-events: none; }
#hud-nav .nav-btn svg { width: 28px; height: 28px; margin: 2px 0; pointer-events: none; }
#hud-nav .nav-btn.nav-dot::after { content: ''; position: absolute; top: 5px; right: 12px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--coral); box-shadow: 0 0 0 2px var(--cream); }
#hud-nav .nav-badge { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--coral); color: #fff; font: 500 11px/18px var(--font); box-shadow: 0 0 0 2px var(--cream); }
#hud-nav .nav-btn.nav-dot .nav-badge:not([hidden]) ~ * { display: none; }
#hud:has(#panel-layer > .panel) #hud-nav { z-index: 13; }

/* PC: bottom-right, the chat keeps the bottom-left and the hotbar the bottom-centre */
html:not([data-ui="mobile"]) #hud-nav { right: calc(12px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); }
/* owner 2026-11-19 (later): PC - every Menu entry floats as its own labelled button in a column at the top left under the
   food / potion row (#hud-dock, Client/js/menu-hub.js mountPcDock), no white frame, foldable; the phone bar is phone-only */
html:not([data-ui="mobile"]) #hud-nav { display: none; }
#hud-dock { display: none; }
html:not([data-ui="mobile"]) #hud-dock { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin-top: 2px; pointer-events: none; }
#hud-dock .dock-list { display: grid; grid-template-columns: repeat(3, 60px); gap: 1px 2px; } /* most important first, read across the rows */
#hud-dock.folded .dock-list { display: none; }
#hud-dock :is(.dock-btn, .dock-fold) { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  width: 60px; padding: 2px 0 1px; border: 0; border-radius: 12px; background: none; color: #fff; cursor: pointer; pointer-events: auto;
  font: 600 11.5px/1.15 var(--font); white-space: nowrap; text-shadow: 0 0 2px #3d3a4f, 0 0 2px #3d3a4f, 0 1px 3px #3d3a4fcc; }
#hud-dock :is(.dock-btn, .dock-fold):hover { background: #ffffff2e; }
#hud-dock :is(.dock-btn, .dock-fold):active { transform: translateY(1px); }
#hud-dock .dock-btn :is(img, svg) { width: 30px; height: 30px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 2px #0005); }
#hud-dock .dock-fold { width: 60px; flex-direction: row; gap: 3px; padding: 2px 0; }
#hud-dock .dock-fold span { font-size: 18px; line-height: 1; }
#hud-dock .dock-fold small { font: inherit; }
#hud-dock .dock-badge { position: absolute; top: 0; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--coral);
  color: #fff; text-shadow: none; font: 600 10.5px/17px var(--font); box-shadow: 0 0 0 2px var(--cream); }
#hud-dock .dock-dot::after { content: ''; position: absolute; top: 2px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--cream); }
#hud-nav .nav-support svg { color: #ff6f7d; }

/* the old icon rail and the loose top icons now live in the Menu window (same windows, same buttons) */
#hud #hud-menu, #hud #menu-scrim { display: none !important; }
#hud .top-row > #btn-support, #hud .top-row > #btn-menu { display: none !important; }
/* owner 2026-11-19: on PC กิจกรรม lives in the left button group and ตั้งค่า sits in the top-right row, right of อันดับ */
html:not([data-ui="mobile"]) #hud .top-row > #top-events { display: none !important; }

/* labelled top shortcuts: VIP, starter pack and กิจกรรม (owner: VIP keeps its own direct button) */
#hud .top-row .tl { display: none; }
html:not([data-ui="mobile"]) #hud .top-row > :is(.vip-btn, [data-panel="starter"], #top-events, [data-panel="rank"], [data-panel="settings"]) { width: auto; min-width: 44px; padding: 0 12px 0 9px;
  display: inline-flex; align-items: center; gap: 6px; border-radius: 14px; font: 500 13px/1 var(--font); }
html:not([data-ui="mobile"]) #hud .top-row .tl { display: inline; white-space: nowrap; font: 500 13px/1 var(--font); color: var(--ink); }
#hud .top-row > :is(.vip-btn, [data-panel="starter"]) > span[aria-hidden] { font-size: 17px; line-height: 1; }
#hud .top-row > :is(#top-events, [data-panel="rank"], [data-panel="settings"]) img { width: 24px; height: 24px; flex: none; object-fit: contain; }
#hud .top-row > #top-events.ev-live { background: #fff1cf; border-color: #ecd391; }
html[data-ui="mobile"] #hud .top-row > #top-events { display: none; }
html[data-ui="mobile"][data-orient="landscape"] #hud .top-row > .vip-btn { width: auto; padding: 0 8px 0 5px; display: inline-flex; align-items: center; gap: 3px; }
html[data-ui="mobile"][data-orient="landscape"] #hud .top-row > .vip-btn .tl { display: inline; font: 500 12px/1 var(--font); }

/* phone portrait: a full-width bar under the thumbs; every bottom control moves up by its height */
html[data-ui="mobile"] { --nav-h: 0px; }
html[data-ui="mobile"][data-orient="portrait"] { --nav-h: calc(64px + var(--safe-b)); }
html[data-ui="mobile"][data-orient="portrait"] #hud-nav { left: 0; right: 0; bottom: 0; justify-content: space-around; padding: 4px calc(6px + var(--safe-r)) calc(4px + var(--safe-b)) calc(6px + var(--safe-l));
  border-radius: 18px 18px 0 0; border-width: 1px 0 0; background: rgba(255, 248, 232, .97); }
html[data-ui="mobile"][data-orient="portrait"] #hud-nav .nav-btn { flex: 1; width: auto; max-width: 96px; min-height: 54px; }
html[data-ui="mobile"][data-orient="portrait"] :is(#hud-actions, #hud-bar, #joy-ghost, #btn-pk, #hud-chat, #cq-btn) { translate: 0 calc(-1 * var(--nav-h)); }
html[data-ui="mobile"][data-orient="portrait"] #hud-exp { bottom: var(--nav-h); }

/* phone landscape: a compact labelled row at the top centre, away from the joystick and the attack thumb */
/* owner 2026-11-19 (later): smaller, and the white frame always hugs the buttons (width / height fit the icons) */
html[data-ui="mobile"][data-orient="landscape"] #hud-nav { top: calc(6px + env(safe-area-inset-top, 0px)); left: calc(144px + var(--safe-l)); right: auto; bottom: auto;
  width: max-content; height: max-content; padding: 1px 2px; gap: 0; border-radius: 11px; align-items: center; }
html[data-ui="mobile"][data-orient="landscape"] #hud-nav .nav-btn { width: auto; min-width: 0; min-height: 30px; flex-direction: row; gap: 2px; padding: 0 4px; border-radius: 9px; font-size: 11px; line-height: 1; }
/* short landscape phones: icon over a small label so the row never reaches the gold / map pill */
@media (max-width: 819px) { html[data-ui="mobile"][data-orient="landscape"] #hud-nav .nav-btn { flex-direction: column; gap: 0; min-height: 32px; padding: 1px 4px; font-size: 10px; } }
html[data-ui="mobile"][data-orient="landscape"] #hud-nav .nav-btn img { width: 18px; height: 18px; }
html[data-ui="mobile"][data-orient="landscape"] #hud-nav .nav-btn svg { width: 18px; height: 18px; margin: 0; }
html[data-ui="mobile"][data-orient="landscape"] #hud-nav .nav-btn.nav-dot::after { top: 1px; right: 1px; width: 8px; height: 8px; }
html[data-ui="mobile"][data-orient="landscape"] #hud-nav .nav-badge { top: -4px; right: -2px; min-width: 15px; height: 15px; padding: 0 4px; font-size: 10px; line-height: 15px; }
/* a window open on a phone covers the game: the navigation steps back so it never covers a window */
html[data-ui="mobile"][data-orient="landscape"] #hud:has(#panel-layer > .panel) #hud-nav { display: none; }

/* ---------- one window frame for every window ---------- */
#panel-layer .panel { border: 1px solid var(--line); border-radius: 18px; background: var(--cream); }
#panel-layer .panel > header, html[data-ui="mobile"] #panel-layer .panel > header, #panel-layer > .panel.npc-panel > header {
  min-height: 56px; padding: 6px 6px 6px 16px; gap: 8px; border-bottom: 1px solid var(--line); background: var(--paper);
  font-size: 18px; font-weight: 500; flex-shrink: 0; }
#panel-layer .panel > header > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel-layer .panel > header img, html[data-ui="mobile"] #panel-layer .panel > header img { width: 28px; height: 28px; flex: none; }
#panel-layer .panel > header .x, html[data-ui="mobile"] #panel-layer .panel > header .x, html[data-ui="mobile"] .panel header .x {
  width: 44px; height: 44px; flex: none; border: 1px solid var(--line); border-radius: 12px; background: var(--cream); color: var(--ink);
  font-size: 18px; line-height: 1; display: grid; place-items: center; }
#panel-layer .panel > header .x:hover { background: var(--chip); }
#panel-layer .panel > .body { padding-top: 10px; }
#panel-layer .panel .body h4 { color: var(--muted); }

/* tabs: one look everywhere (the NPC windows used orange, the rest grey) */
#panel-layer .panel .tabs button, #panel-layer > .panel.npc-panel .tabs button, html[data-ui="mobile"] #panel-layer .panel .tabs button {
  min-height: 40px; padding: 5px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink);
  font-size: 14px; font-weight: 500; }
#panel-layer .panel .tabs button:hover { background: var(--chip); }
#panel-layer .panel .tabs button.on, #panel-layer > .panel.npc-panel .tabs button.on, html[data-ui="mobile"] #panel-layer .panel .tabs button.on {
  background: var(--teal); border-color: var(--teal); color: #fff; }
#panel-layer .panel .tabs button.on .badge { background: #fff; color: var(--teal-d); }
#panel-layer [data-window-key="panel:market"] .tabs button { min-height: 40px !important; }
html[data-ui="mobile"] #panel-layer .panel .tabs button, html[data-ui="mobile"] #panel-layer [data-window-key="panel:market"] .tabs button { min-height: 44px !important; }
html[data-ui="mobile"] #panel-layer .panel .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
html[data-ui="mobile"] #panel-layer .panel .tabs button { flex: none; }

/* main actions are big enough to hit on a phone; secondary ones stay smaller but never under 40 px */
html[data-ui="mobile"] #panel-layer .panel .btn.primary, html[data-ui="mobile"] #panel-layer .panel .btn:not(.small) { min-height: 44px; }
html[data-ui="mobile"] #panel-layer .panel .btn.small { min-height: 40px; }
#panel-layer .panel .tip { color: var(--muted); }

/* the other window types (class-up quest, trade, confirm, support, festival, spirit viewer, board room) share the close size */
.cq-x, .trade-overlay .x, .support-close, .festival-close, .spirit-viewer .x, .room-exit, .item-popup-dialog .x { min-width: 44px; min-height: 44px; }
.ask-box .ask-btns .btn { min-height: 44px; }

/* ---------- Menu window (Client/js/menu-hub.js) ---------- */
html[data-ui] #panel-layer > .panel.panel[data-window-key="panel:menu"] { width: min(780px, calc(100vw - 24px)); }
html[data-ui="mobile"][data-orient="landscape"] #panel-layer > .panel.panel[data-window-key="panel:menu"] { width: min(660px, calc(100vw - 24px)); }
#panel-layer > .panel[data-window-key="panel:menu"] > .body { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 12px; }
.mh-tabs { flex: none; }
.mh-scroll { overflow: auto; min-height: 0; flex: 1; padding: 0 2px 4px; }
.mh-group h4 { margin: 8px 0 6px !important; }
.mh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.mh-item { position: relative; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 7px 10px; text-align: left;
  border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); font: inherit; }
.mh-item:hover { background: #fff; border-color: var(--sel-line); }
.mh-item:active { transform: translateY(1px); }
.mh-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--chip); color: #6a6478; }
.mh-ic img { width: 32px; height: 32px; object-fit: contain; }
.mh-ic svg { width: 22px; height: 22px; }
.mh-tx { min-width: 0; flex: 1; }
.mh-tx b { display: block; font-size: 15px; font-weight: 500; line-height: 1.3; }
.mh-tx small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.mh-key { flex: none; min-width: 24px; height: 24px; padding: 0 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--cream);
  color: var(--muted); font: 500 12px/22px var(--font); text-align: center; }
.mh-badge { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--coral); color: #fff; font: 500 12px/22px var(--font); text-align: center; }
.mh-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
html[data-ui="mobile"] .mh-key { display: none; }
html[data-ui="mobile"] .mh-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
html[data-ui="mobile"] .mh-item { min-height: 56px; padding: 6px 8px; gap: 8px; }
html[data-ui="mobile"] .mh-tx small { font-size: 12px; }
html[data-ui="mobile"][data-orient="portrait"] .mh-grid { grid-template-columns: minmax(0, 1fr); }

/* กิจกรรม window */
.ev-list .ev-row { align-items: center; gap: 10px; }
.ev-list .ev-row.off { opacity: .75; }
.ev-list .ev-row small { display: block; }

/* purchases closed until OBT (Client/js/menu-hub.js) */
#panel-layer .panel > .buy-closed { flex: none; margin: 8px 12px 0; padding: 8px 12px; border: 1px solid #ecd391; border-radius: 12px; background: #fff1cf; color: #7a5a14; font-size: 14px; line-height: 1.45; }

/* map name under the minimap (moved there by Client/js/menu-hub.js), with the SAFE / level chip beside it */
#hud-topright .mm-map-stack .map-pill, html[data-ui="mobile"] #hud-topright .mm-map-stack .map-pill { display: flex; align-items: center; gap: 5px;
  min-height: 24px; max-width: 230px; padding: 2px 4px 2px 9px; border-radius: 9px; font-size: 13px; line-height: 1.2; white-space: nowrap; }
#hud-topright .mm-map-stack .map-pill #hud-mapname { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#hud-topright .mm-map-stack .map-pill .safe { display: none; }
#hud-topright .mm-map-stack .map-pill .mm-chip { flex: none; }
html[data-ui="mobile"] #hud-topright .mm-map-stack .map-pill { max-width: 150px; font-size: 11px; min-height: 20px; padding: 1px 3px 1px 7px; }
html[data-ui="mobile"][data-orient="portrait"] #hud-topright .mm-map-stack .map-pill { max-width: 100px; }
html[data-ui="mobile"][data-orient="portrait"] #hud-topright .mm-map-stack .map-pill { flex-wrap: wrap; justify-content: flex-end; row-gap: 1px; padding: 2px 4px 2px 6px; }

/* owner 2026-11-19 (later): HUD buttons float without the white frame, like the menu buttons (icons keep a soft shadow, words a
   dark outline so they read on any map). Skill slots, dodge / attack, the status card and the gold pill keep their frames. */
#hud :is(.top-row > .sq-btn, .mm-zoom > button, #hud-quick > .sq-btn, #hud-quick .slot, #btn-pk, #hud-quest.is-folded, #hud-daily.is-folded) {
  background-color: transparent !important; border-color: transparent !important; box-shadow: none !important; }
#hud :is(.top-row > .sq-btn, .mm-zoom > button, #hud-quick > .sq-btn, #btn-pk, #hud-quest.is-folded, #hud-daily.is-folded) { background-image: none !important; }
#hud :is(.top-row > .sq-btn, .mm-zoom > button, #hud-quick > .sq-btn, #btn-pk, #hud-quest.is-folded, #hud-daily.is-folded) {
  color: #fff !important; text-shadow: 0 0 2px #3d3a4f, 0 0 2px #3d3a4f, 0 1px 3px #3d3a4fcc; }
#hud :is(.top-row > .sq-btn, .mm-zoom > button, #hud-quick > .sq-btn, #btn-pk, #hud-quest.is-folded, #hud-daily.is-folded) :is(span, small, b, .tl) { color: #fff !important; }
#hud :is(.top-row > .sq-btn, .mm-zoom > button, #hud-quick > .sq-btn, #hud-quick .slot, #hud-quest.is-folded, #hud-daily.is-folded) :is(img, svg) { filter: drop-shadow(0 2px 2px #0006); }
#hud :is(.top-row > .sq-btn, .mm-zoom > button, #hud-quick > .sq-btn, #btn-pk):hover { background-color: #ffffff2e !important; }
#hud #hud-quick .slot { background-size: 36px !important; filter: drop-shadow(0 2px 2px #0006); }
#hud :is(.mm-zoom > button, #btn-full) { font-size: 22px; }

/* owner 2026-11-19 (later still): the gold / crystal line floats too, and the top-right buttons sit closer together (PC) */
#hud #hud-gold, #hud .world-summary { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
#hud #hud-gold { color: #fff; text-shadow: 0 0 2px #3d3a4f, 0 0 2px #3d3a4f, 0 1px 3px #3d3a4fcc; }
#hud #hud-gold :is(span, b) { color: #fff; }
#hud #hud-gold img { filter: drop-shadow(0 2px 2px #0006); }
html:not([data-ui="mobile"]) #hud-topright .top-row { gap: 0; }
html:not([data-ui="mobile"]) #hud .top-row > :is(.vip-btn, [data-panel="starter"], #top-events, [data-panel="rank"], [data-panel="settings"]) { padding: 0 6px; gap: 4px; }
html:not([data-ui="mobile"]) #hud .top-row > #btn-full { width: 36px; min-width: 36px; }

/* the support heart: a soft glow and a heartbeat so it stands out (still when the player asks for reduced motion) */
:is(#hud-dock [data-dock="support"], #hud-nav .nav-support) { color: #fff; }
:is(#hud-dock [data-dock="support"], #hud-nav .nav-support) :is(img, svg) { animation: heart-beat 1.3s ease-in-out infinite; transform-origin: 50% 60%;
  filter: drop-shadow(0 0 4px #ff8fa0) drop-shadow(0 0 9px #ff5d78cc) drop-shadow(0 2px 2px #0006) !important; }
#hud-dock [data-dock="support"]::before { content: ''; position: absolute; left: 50%; top: 17px; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  background: radial-gradient(circle, #ff8fa088 0%, #ff8fa033 45%, transparent 70%); animation: heart-glow 1.3s ease-in-out infinite; pointer-events: none; }
#hud-dock [data-dock="support"] span { color: #ffd6dd; }
@keyframes heart-beat { 0%, 100% { transform: scale(1); } 14% { transform: scale(1.18); } 28% { transform: scale(1); } 42% { transform: scale(1.12); } 70% { transform: scale(1); } }
@keyframes heart-glow { 0%, 100% { opacity: .55; transform: scale(.9); } 14%, 42% { opacity: 1; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { :is(#hud-dock [data-dock="support"], #hud-nav .nav-support) :is(img, svg), #hud-dock [data-dock="support"]::before { animation: none; } }

/* owner 2026-11-19: on PC hotbar slots 1 and 2 live in the bar again; the quick row keeps only the food slot and chat
   (phones keep the two quick potion buttons by the portrait: Hud.buildBar) */
html:not([data-ui="mobile"]) #hud #hud-quick > :is(#quick-hp, #quick-mp) { display: none !important; }
html:not([data-ui="mobile"]) #hud #hud-quick { grid-template-columns: repeat(2, 44px); }
/* a short PC window: the button group spreads into more columns so it never runs into the chat */
@media (max-height: 760px) { html:not([data-ui="mobile"]) #hud-dock .dock-list { grid-template-columns: repeat(5, 58px); } }
@media (max-height: 520px) { html:not([data-ui="mobile"]) #hud-dock .dock-list { grid-template-columns: repeat(9, 56px); } }

/* owner 2026-11-19: the minimap and its name tag float too (a soft shadow instead of the cream border) */
#hud #hud-minimap { background: transparent !important; border-color: transparent !important; box-shadow: 0 3px 10px #0006 !important; }
#hud #hud-topright .map-pill { background: transparent !important; box-shadow: none !important; color: #fff; text-shadow: 0 0 2px #3d3a4f, 0 0 2px #3d3a4f, 0 1px 3px #3d3a4fcc; }
#hud #hud-topright .map-pill :is(span, b) { color: #fff; }
#hud #hud-topright .map-pill .safe { background: #3f8f86cc; text-shadow: none; }

/* owner 2026-11-19: แพ็กมือใหม่ and VIP icons sparkle so they stand out */
#hud .top-row > :is(.vip-btn, [data-panel="starter"]) > span[aria-hidden] { position: relative; display: inline-block;
  animation: promo-shine 2.4s ease-in-out infinite; filter: drop-shadow(0 0 3px #ffe58a) drop-shadow(0 0 7px #ffc94acc); }
#hud .top-row > :is(.vip-btn, [data-panel="starter"]) > span[aria-hidden]::after { content: '✦'; position: absolute; right: -5px; top: -6px; font-size: 9px;
  color: #fff6c8; text-shadow: 0 0 4px #ffd34d; animation: promo-twinkle 2.4s ease-in-out infinite; }
#hud .top-row > .vip-btn > span[aria-hidden]::after { animation-delay: 1.2s; }
@keyframes promo-shine { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.12) rotate(-6deg); filter: drop-shadow(0 0 5px #fff2b0) drop-shadow(0 0 11px #ffc94a); } }
@keyframes promo-twinkle { 0%, 35%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.2) rotate(30deg); } 65% { opacity: 0; transform: scale(.4); } }
@media (prefers-reduced-motion: reduce) { #hud .top-row > :is(.vip-btn, [data-panel="starter"]) > span[aria-hidden], #hud .top-row > :is(.vip-btn, [data-panel="starter"]) > span[aria-hidden]::after { animation: none; } }
#hud .mm-zoom > :is(#mm-in, #mm-out) { font-weight: 800; font-size: 24px !important; }
#hud .mm-zoom > #mm-mail svg { width: 26px; height: 26px; }

/* owner 2026-11-19: phones use the same floating, frameless, foldable button group as PC (no white bar any more).
   Landscape: a wide short grid under the food / potion row, clear of the joystick. Portrait: a 4-wide grid under it.
   อันดับ and ตั้งค่า join the top-right icons; everything else is in the group (เมนู window no longer needed). */
html[data-ui="mobile"] #hud-nav { display: none !important; }
html[data-ui="mobile"] { --nav-h: 0px !important; }
html[data-ui="mobile"] #hud-dock { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin-top: 2px; pointer-events: none; }
html[data-ui="mobile"] #hud-dock :is(.dock-btn, .dock-fold) { width: 50px; padding: 1px 0; font-size: 10px; }
html[data-ui="mobile"] #hud-dock .dock-btn :is(img, svg) { width: 26px; height: 26px; }
html[data-ui="mobile"] #hud-dock .dock-badge { right: 3px; min-width: 15px; height: 15px; font-size: 9.5px; line-height: 15px; }
html[data-ui="mobile"] #hud-dock .dock-dot::after { right: 7px; }
html[data-ui="mobile"] #hud-dock [data-dock="support"]::before { top: 14px; width: 34px; height: 34px; margin: -17px 0 0 -17px; }
html[data-ui="mobile"][data-orient="landscape"] #hud-dock .dock-list { grid-template-columns: repeat(9, 46px); }
html[data-ui="mobile"][data-orient="landscape"] #hud-dock :is(.dock-btn, .dock-fold) { width: 46px; }
/* phone landscape: while the group is open, the chat log starts under it instead of behind it */
html[data-ui="mobile"][data-orient="landscape"] #hud:has(#hud-dock:not(.folded)) #hud-chat { top: 188px !important; }
html[data-ui="mobile"][data-orient="portrait"] #hud-dock .dock-list { grid-template-columns: repeat(4, 50px); }
html[data-ui="mobile"] #hud:has(#panel-layer > .panel) #hud-dock { visibility: hidden; }
/* top-right on phones: อันดับ and ตั้งค่า as icons beside VIP */
html[data-ui="mobile"] #hud .top-row > :is([data-panel="rank"], [data-panel="settings"]) { display: inline-flex !important; align-items: center; justify-content: center; }
html[data-ui="mobile"] #hud .top-row > :is([data-panel="rank"], [data-panel="settings"]) img { width: 24px; height: 24px; }
html[data-ui="mobile"] #hud .top-row > :is([data-panel="rank"], [data-panel="settings"]) .tl { display: none !important; }
/* the phone status panel is drawn smaller (--mobile-status-scale); the button group keeps a real, tappable size */
html[data-ui="mobile"] #hud-dock { transform: scale(calc(1 / var(--mobile-status-scale, 1))); transform-origin: top left; }

/* owner 2026-11-20: on PC slots 1 and 2 (potions or any item) look like the skill slots: a cream rim round a coloured
   rounded tile with the item on it, instead of a flat cream square (Hud.buildBar sets --icon and data-pot) */
html:not([data-ui="mobile"]) #hud #hud-bar .slot.pot { background-color: #f6ead0 !important; background-image: var(--icon), radial-gradient(circle at 50% 38%, var(--pot-a) 0%, var(--pot-b) 78%) !important;
  background-size: 78%, 100% 100% !important; background-position: center, center !important; background-repeat: no-repeat !important; background-origin: padding-box !important; background-clip: padding-box !important;
  border: 3px solid #f6ead0 !important; box-sizing: border-box; border-radius: 10px; --pot-a: #f2c48a; --pot-b: #b9783c; }
html:not([data-ui="mobile"]) #hud #hud-bar .slot.pot[data-pot="hp"] { --pot-a: #f39a8e; --pot-b: #b8434a; }
html:not([data-ui="mobile"]) #hud #hud-bar .slot.pot[data-pot="mp"] { --pot-a: #8fc4f0; --pot-b: #3c6db0; }

/* owner 2026-11-20 ("แถบลัดให้เป็นแบบช่อง 1 2 ให้หมด"): on PC every hotbar slot is the same cream-rimmed rounded tile as
   slots 1-2, VIP themes included (the VIP round skill ring stays on phones' skill wheel only) */
html:not([data-ui="mobile"]) #hud #hud-bar .slot.skill { border-radius: 10px !important; border: 3px solid #f6ead0 !important; box-sizing: border-box;
  background-origin: padding-box !important; background-clip: padding-box !important; background-size: 100% 100% !important; }
html:not([data-ui="mobile"]) #hud #hud-bar .slot.skill:not(.no-auto) { box-shadow: 0 1px 4px #53576c22 !important; } /* the orange "not used by AUTO" ring stays */
html:not([data-ui="mobile"]) #hud #hud-bar .slot.skill::after { display: none !important; }
html:not([data-ui="mobile"]) #hud #hud-bar .slot.skill .cd { border-radius: 7px; }
