/* WIDGET compact action dock v7
 * One persistent six-button dock opens a fitted tray above it.
 * Root art fills its cell; opened actions reuse that same compact cell size.
 */

:root {
  --widget-dock-gap: 8px;
  --widget-dock-bottom: max(8px, env(safe-area-inset-bottom));
  --widget-dock-width: min(514px, calc(100vw - 12px));
  --widget-shelf-width: min(430px, calc(100vw - 12px));
}

body.sol-glow .quick-actions,
body.sol-glow .quick-actions.dock-mode,
body.sol-glow .quick-actions.expanded-mode,
body.sol-glow .quick-actions:not(.collapsed) {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  bottom: var(--widget-dock-bottom) !important;
  z-index: 50 !important;
  width: var(--widget-dock-width) !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 6px !important;
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  grid-template-rows: auto !important;
  grid-auto-flow: row !important;
  gap: 6px !important;
  overflow: hidden !important;
  border-radius: 20px !important;
  transform: translateX(-50%) !important;
}

/* Clear older inline rules that pinned every navigation control to column one. */
body.sol-glow .quick-actions > .sol-more-btn,
body.sol-glow .quick-actions > .sol-tricks-btn,
body.sol-glow .quick-actions > .sol-whistles-btn,
body.sol-glow .quick-actions > .sol-play-btn,
body.sol-glow .quick-actions > .bird-map-home-btn,
body.sol-glow .quick-actions > .bird-arcade-btn {
  grid-column: auto !important;
  grid-row: 1 !important;
  order: initial !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  box-shadow: none !important;
  z-index: auto !important;
}

body.sol-glow .quick-actions.collapsed {
  transform: translate(-50%, calc(100% + 28px)) !important;
}

body.sol-glow .quick-actions .quick-btn {
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  aspect-ratio: 1 !important;
  padding: 5px 4px !important;
  margin: 0 !important;
  flex: none !important;
  border-radius: 14px !important;
  font-size: 21px !important;
}

body.sol-glow .quick-actions .quick-btn::after {
  font-size: 8px !important;
  letter-spacing: 0.055em !important;
  line-height: 1.05 !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

body.sol-glow .quick-actions .bird-arcade-btn {
  background: rgba(197, 155, 39, 0.11) !important;
  border-color: rgba(197, 155, 39, 0.24) !important;
}

body.sol-glow .quick-actions > .sol-more-btn.active,
body.sol-glow .quick-actions > .sol-tricks-btn.active,
body.sol-glow .quick-actions > .sol-whistles-btn.active,
body.sol-glow .quick-actions > .sol-play-btn.active,
body.sol-glow .quick-actions > .bird-arcade-btn.active {
  background: rgba(143, 255, 194, 0.12) !important;
  border-color: rgba(143, 255, 194, 0.34) !important;
  color: var(--sol-mint) !important;
}

body.sol-glow .quick-actions .bird-arcade-btn .btn-icon-slot img {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(215, 174, 87, 0.45);
  border-radius: 9px;
  object-fit: cover;
}

body.sol-glow .sol-trick-shelf,
body.sol-glow .sol-trick-shelf.is-dense {
  position: fixed !important;
  left: 50% !important;
  bottom: calc(var(--widget-dock-bottom) + var(--action-bar-height, 70px) + var(--widget-dock-gap)) !important;
  z-index: 51 !important;
  width: var(--widget-shelf-width) !important;
  height: auto !important;
  max-height: none !important;
  padding: 8px !important;
  display: block !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  scroll-snap-type: none !important;
  touch-action: manipulation !important;
  border-radius: 20px !important;
  transform: translate(-50%, 0) scale(0.985) !important;
}

body.sol-glow .sol-trick-shelf.is-open {
  transform: translate(-50%, 0) scale(1) !important;
}

body.sol-glow .sol-shelf-header {
  min-height: 38px;
  margin-bottom: 6px;
  padding: 0 2px 0 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
}

body.sol-glow .sol-shelf-title {
  color: rgba(247, 255, 251, 0.92);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.sol-glow .sol-shelf-pagination {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body.sol-glow .sol-shelf-pagination[hidden] {
  display: none !important;
}

body.sol-glow .sol-shelf-page-btn {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: rgba(247, 255, 251, 0.88) !important;
  box-shadow: none !important;
  font: 700 22px/1 system-ui, sans-serif !important;
}

body.sol-glow .sol-shelf-page-btn:disabled {
  opacity: 0.28;
}

body.sol-glow .sol-shelf-page-indicator {
  min-width: 34px;
  color: rgba(239, 249, 245, 0.66);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

body.sol-glow .sol-shelf-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 5px;
}

body.sol-glow .sol-shelf-grid > [hidden] {
  display: none !important;
}

body.sol-glow .sol-shelf-grid .quick-btn,
body.sol-glow .sol-trick-shelf.is-dense .sol-shelf-grid .quick-btn {
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1 !important;
  padding: 4px 3px !important;
  margin: 0 !important;
  border-radius: 13px !important;
  font-size: 19px !important;
  scroll-snap-align: none !important;
}

body.sol-glow .sol-shelf-grid .quick-btn::after {
  min-height: 16px;
  display: -webkit-box !important;
  overflow: hidden !important;
  color: rgba(239, 249, 245, 0.7) !important;
  font-size: 7.5px !important;
  letter-spacing: 0.035em !important;
  line-height: 1.05 !important;
  white-space: normal !important;
  text-overflow: clip !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.sol-glow .sol-arcade-shelf .arcade-game-btn {
  border-color: rgba(215, 174, 87, 0.42) !important;
  color: #3b3127 !important;
  background: rgba(255, 249, 233, 0.96) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72) !important;
  text-decoration: none !important;
}

body.sol-glow .sol-arcade-shelf .arcade-game-btn:active {
  transform: scale(0.96);
}

body.sol-glow .sol-arcade-shelf .arcade-game-btn .btn-icon-slot {
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(185, 138, 55, 0.5);
  border-radius: 9px;
  background: #fff9e9;
}

body.sol-glow .sol-arcade-shelf .arcade-game-btn .btn-icon-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.sol-glow .sol-arcade-shelf .arcade-game-btn::after {
  color: rgba(49, 61, 47, 0.86) !important;
  font-weight: 800 !important;
}

/* The category row remains usable while either tray is open. */
body.sol-glow.trick-shelf-open .quick-actions {
  display: grid !important;
}

body.sol-glow.trick-shelf-open .action-bar-handle {
  display: none !important;
}

@media (max-height: 620px) {
  :root {
    --widget-dock-width: min(460px, calc(100vw - 12px));
    --widget-shelf-width: min(380px, calc(100vw - 12px));
  }

  body.sol-glow .quick-actions {
    width: var(--widget-dock-width) !important;
  }

  body.sol-glow .sol-trick-shelf {
    width: var(--widget-shelf-width) !important;
  }
}

/* A three-row tray consumes the whole stage in short landscape. Keep the
   root-sized cells, but present them as one forgiving horizontal strip while
   WIDGET settles just above it. */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 701px) {
  body.sol-glow .sol-trick-shelf,
  body.sol-glow .sol-trick-shelf.is-dense {
    width: min(700px, calc(100vw - 20px)) !important;
    height: 84px !important;
    padding: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain !important;
    scroll-snap-type: x proximity !important;
    scrollbar-width: none !important;
    touch-action: pan-x !important;
  }

  body.sol-glow .sol-trick-shelf::-webkit-scrollbar {
    display: none !important;
  }

  body.sol-glow .sol-shelf-grid {
    width: max-content !important;
    grid-template-columns: none !important;
    grid-template-rows: 68px !important;
    grid-auto-flow: column !important;
    grid-auto-columns: 68px !important;
  }

  body.sol-glow .sol-shelf-grid .quick-btn {
    scroll-snap-align: start !important;
  }

  body.sol-glow.trick-shelf-open {
    --sol-shelf-scale: 0.58;
    --sol-shelf-lift: -42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.sol-glow .sol-trick-shelf,
  body.sol-glow .quick-actions {
    transition-duration: 0.01ms !important;
  }
}
