/* PHASE10_V71_MOBILE_HAND_RESCUE_START
 * Mobile-only: cards remain fully visible and tappable above the toolbar.
 * Does not affect desktop table layout.
 */
@media (max-width: 900px), (pointer: coarse) {
  #gameScreen #handShell.hand-shell {
    position: absolute !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    width: auto !important;
    height: clamp(82px, 19dvh, 136px) !important;
    min-height: 0 !important;
    max-height: none !important;
    bottom: calc(var(--mp-v71-bar-h, 53px) + max(5px, env(safe-area-inset-bottom))) !important;
    aspect-ratio: auto !important;
    overflow: visible !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  #gameScreen #handCards.hand-cards {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 8px 4px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    clip-path: none !important;
    touch-action: pan-x !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  #gameScreen #handCards.hand-cards .hand-card {
    flex: 0 0 clamp(47px, 11.4vw, 67px) !important;
    width: clamp(47px, 11.4vw, 67px) !important;
    height: auto !important;
    aspect-ratio: 0.66 !important;
    margin-left: -10px !important;
    transform: translateY(var(--lift, 0px)) !important;
    pointer-events: auto !important;
  }
  #gameScreen #handCards.hand-cards .hand-card:first-child { margin-left: 0 !important; margin-right: 0 !important; }
  #gameScreen #handCards.hand-cards .hand-card:last-child { margin-right: 6px !important; }
  #gameScreen #handCards.hand-cards .hand-card .fairy-card,
  #gameScreen #handCards.hand-cards .hand-card .card-png {
    display: block !important;
    width: 100% !important; height: 100% !important;
    max-width: none !important; max-height: none !important;
  }
  #gameScreen .game-action-bar {
    position: absolute !important;
    z-index: 350 !important;
    left: max(6px, env(safe-area-inset-left)) !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    bottom: max(3px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    min-height: 0 !important; height: auto !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important; justify-content: space-around !important;
    gap: 3px !important;
    padding: 5px !important;
    transform: none !important;
    overflow-x: auto !important;
    border-radius: 13px !important;
  }
  #gameScreen .game-action-bar > * { flex: 0 1 auto !important; min-width: 0 !important; }
  #gameScreen .game-action-button {
    height: 37px !important; min-height: 37px !important;
    padding: 5px 8px !important;
    font-size: clamp(9px, 1.9vw, 12px) !important;
    white-space: nowrap !important;
    line-height: 1.1 !important;
  }
  #gameScreen .selected-count {
    min-width: 0 !important;
    font-size: clamp(9px, 1.8vw, 12px) !important;
    padding: 0 3px !important;
  }
}
@media (max-width: 900px) and (orientation: portrait) {
  #gameScreen #handShell.hand-shell { --mp-v71-bar-h: 53px; }
}
@media (max-width: 900px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
  #gameScreen #handShell.hand-shell { --mp-v71-bar-h: 53px; }
}
/* PHASE10_V71_MOBILE_HAND_RESCUE_END */
