/* Docked picks: level-up, item, chest, boss and keystone
   hands sit in a compact column on the right, between the minimap and the action bar; a bottom sheet on narrow portrait screens.
   No full-screen dim or rays; only the panel takes clicks, so the field stays visible and playable around it. */
html body #levelup { inset: auto; right: 10px; top: 29vh; bottom: max(66px, 8.5vh); width: clamp(280px, 24vw, 360px); padding: 0; display: flex; flex-direction: column; justify-content: flex-end; background: none; overflow: visible; pointer-events: none; }
html body #levelup::before, html body #levelup::after { display: none; }
html body #levelup .lubox { width: 100%; max-height: 100%; margin: 0; overflow-y: auto; overscroll-behavior: contain; pointer-events: auto; text-align: left; padding: 6px 8px; background: rgba(10, 8, 5, 0.82); border: 1px solid #6a5226; border-radius: 8px; box-shadow: 0 2px 14px rgba(0, 0, 0, 0.7); scrollbar-width: thin; }
html body #levelup .lulvl { font-size: 9px; letter-spacing: 2px; padding: 3px 8px 2px; }
html body #levelup .lubox h2 { display: block; margin: 3px 0 0; font-size: 21px; line-height: 1.1; animation: none; }
html body #levelup .lusub { display: block; margin: 1px 0 6px; font-size: 11px; }
html body #levelup #luQueue { font-size: 10px; margin: 0 0 4px; }
html body #levelup #cards { flex-direction: column; align-items: stretch; gap: 5px; perspective: none; }
html body #levelup #cards .card { flex: none; min-height: 0; height: auto; display: grid; grid-template-columns: 34px 1fr; grid-template-areas: "icon head" "tip tip" "foot foot"; align-items: center; column-gap: 7px; text-align: left; padding: 6px 8px 5px 26px; font-size: 12px; animation-duration: 0.25s; }
html body #levelup #cards .card:hover { transform: translateX(-4px); }
html body #levelup #cards .card .sicon { grid-area: icon; width: 32px; height: 32px; flex-basis: 32px; margin: 0; }
html body #levelup #cards .card .hd { grid-area: head; min-width: 0; }
html body #levelup #cards .card h3 { margin: 0; font-size: 14px; line-height: 1.15; }
html body #levelup #cards .card .kind { font-size: 10px; line-height: 1.2; }
html body #levelup #cards .card .tip { grid-area: tip; margin: 3px 0 0; padding-top: 3px; font-size: 11.5px; line-height: 1.25; }
html body #levelup #cards .card .foot { grid-area: foot; padding-top: 2px; margin-top: 2px; font-size: 10px; }
html body #levelup #cards .card .key { top: 5px; left: 5px; width: 16px; height: 16px; font-size: 10px; line-height: 14px; }
html body #levelup #cards .card .new { top: 4px; right: 5px; font-size: 8px; padding: 2px 4px; }
html body #levelup #cards.picking .card.picked { transform: scale(1.03); }
html body #levelup .lufoot { justify-content: flex-start; gap: 4px; margin-top: 6px; }
html body #levelup .lulab { display: none; }
html body #levelup #luSlots { justify-content: flex-start; max-width: none; gap: 2px; }
html body #levelup #luSlots .sicon, html body #levelup #luSlots .es { width: 20px; height: 20px; font-size: 8px; }
html body #levelup .lufoot button { padding: 3px 9px; font-size: 11px; }
html body #levelup #luNote { margin: 4px 0 0; font-size: 10px; }
html body #levelup .lucast { margin: 4px 0; }
/* Short screens (phones held sideways): a tighter column; the tip keeps two lines. */
@media (max-height: 560px) and (min-width: 601px) {
  html body #levelup { top: 64px; bottom: max(44px, env(safe-area-inset-bottom)); right: max(8px, env(safe-area-inset-right)); width: clamp(250px, 34vw, 320px); }
  html body #levelup .lubox { padding: 4px 6px; }
  html body #levelup .lubox h2 { font-size: 16px; }
  html body #levelup .lusub { display: none; }
  html body #levelup #cards { gap: 3px; }
  html body #levelup #cards .card { padding: 4px 6px 3px 22px; grid-template-columns: 28px 1fr; }
  html body #levelup #cards .card .sicon { width: 26px; height: 26px; flex-basis: 26px; }
  html body #levelup #cards .card h3 { font-size: 12.5px; }
  html body #levelup #cards .card .tip { font-size: 10.5px; margin-top: 2px; padding-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html body #levelup #cards .card .foot { display: none; }
  html body #levelup .lufoot { margin-top: 3px; }
}
/* Narrow portrait screens (phones, a folded Fold): a bottom sheet above the action bar. */
@media (max-width: 600px) {
  html body #levelup { left: 6px; right: 6px; top: auto; bottom: max(70px, calc(env(safe-area-inset-bottom) + 64px)); width: auto; max-height: 46vh; }
  html body #levelup .lubox { max-height: 46vh; }
  html body #levelup .lubox h2 { font-size: 17px; }
  html body #levelup .lusub { display: none; }
  html body #levelup #cards .card .tip { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
/* Touch: the touch layer's own level-up rules (centre sheet, scroll) are overridden by the dock. */
html.tch-game body #levelup { pointer-events: none !important; overflow: visible !important; }
html.tch-game body #levelup .lubox { pointer-events: auto; }
html.tch-game body #levelup .lufoot button { min-height: 34px; }
/* With the hand docked, the chat, the ability buttons and the loot summary stay up while it is open. */
body:has(#levelup:not(.hidden)) .wui .wchat { visibility: visible; }
body:has(#levelup:not(.hidden)) .wui .wabil { display: revert; }
html body #levelup .lubox h2 { position: relative; z-index: 1; }
html body #levelup #cards .card .hd { padding-right: 30px; }
@media (max-height: 560px) and (min-width: 601px) { html body #levelup .lubox h2 { font-size: 15px; line-height: 1.25; margin: 2px 0 3px; } }
/* Mid-width screens (a Fold held open, small tablets): the chat reaches far right, so the column ends above it. */
@media (max-width: 1100px) and (min-width: 601px) and (min-height: 561px) { html body #levelup { bottom: 25vh; } }
/* Short screens: start below the minimap. */
@media (max-height: 560px) and (min-width: 601px) { html body #levelup { top: max(132px, 34vh); } }
@media (max-height: 560px) and (min-width: 601px) {
  html body #levelup .lulvl { display: none; }
  html body #levelup .lubox h2 { font-size: 13px; margin: 0 0 3px; }
  html body #levelup #cards .card .kind { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html body #levelup #cards .card .tip { -webkit-line-clamp: 1; }
}
@media (max-height: 560px) and (min-width: 601px) {
  html body #levelup .lubox { display: flex; flex-direction: column; }
  html body #levelup .lufoot { order: -1; margin: 0 0 3px; }
  html body #levelup .lufoot:not(:has(button:not(.hidden))) { display: none; }
  html body #levelup #luSlots { display: none; }
}
@media (max-height: 560px) and (min-width: 601px) {
  html body #levelup .lubox h2 { order: -2; }
  html body #levelup .lufoot { flex-wrap: nowrap; gap: 3px; }
  html body #levelup .lufoot button, html.tch-game body #levelup .lufoot button { min-height: 26px; padding: 1px 7px; font-size: 10.5px; line-height: 14px; white-space: nowrap; }
  html body #levelup .lufoot button kbd { display: none; }
}
