.mobile-menu-grip { display: none; }

/* Android landscape: table and hand fit the available dynamic viewport. */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1400px) {
  body { overscroll-behavior-y: none; }
  .app-shell { width: 100%; padding: 4px max(6px, env(safe-area-inset-right)) 4px max(6px, env(safe-area-inset-left)); }
  .topbar, .control-bar { overflow: hidden; transition: height 180ms ease, margin 180ms ease, opacity 160ms ease, transform 180ms ease; }
  .topbar { height: auto; min-height: 36px; margin: 0; gap: 5px; grid-template-columns: 1fr auto; align-items: center; }
  .brand-block { gap: 6px; }
  .brand-mark, .eyebrow, .brand-subtitle, .stat-divider, .level-chip { display: none; }
  h1 { margin: 0; font-size: 20px; }
  .topbar-stats { min-height: 34px; height: 34px; width: auto; padding: 0 8px; gap: 10px; border: 0; }
  .stat-item, .level-select-wrap { display: flex; align-items: center; gap: 5px; }
  .stat-item span, .level-select-wrap span { font-size: 11px; }
  .stat-item strong, .stat-item b { font-size: 15px; }
  #level-rank-select { min-height: 32px; padding: 3px 10px; font-size: 15px; }
  .control-bar { height: auto; padding: 0; margin: 0; background: none; border: 0; }
  .control-bar--side { top: auto; right: 6px; bottom: max(8px, env(safe-area-inset-bottom)); width: 38px; transform: none; gap: 5px; padding: 6px 4px; border-radius: 14px; }
  .control-bar--side .control-actions { gap: 4px; }
  .control-bar--side .control-button { width: 28px; height: 28px; border-radius: 8px; }
  .control-bar--side .control-icon { font-size: 15px; }
  .control-status { font-size: 11px; min-width: 0; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .control-actions { width: auto; gap: 5px; padding: 0; flex-wrap: nowrap; overflow: visible; }
  .control-button { min-height: 40px; padding: 7px 9px; font-size: 12px; white-space: nowrap; }
  .control-button span { display: none; }
  .game-workspace { gap: 3px; }
  .table-frame { min-height: 0; height: calc(100dvh - 158px); border-width: 3px; border-radius: 28px; }
  .mobile-menu-grip { display: block; position: fixed; z-index: 20; top: 0; left: 50%; width: 48px; height: 16px; padding: 0; transform: translateX(-50%); border: 1px solid rgba(241, 213, 138, .5); border-top: 0; border-radius: 0 0 10px 10px; background: rgba(7, 36, 28, .78); color: #f1d58a; font: 700 13px/12px system-ui, sans-serif; opacity: .8; touch-action: manipulation; }
  body.mobile-menu-hidden .topbar { height: 0; min-height: 0; margin: 0; opacity: 0; transform: translateY(-18px); pointer-events: none; }
  body.mobile-menu-hidden .topbar > :not(.top-inventory-wrap) { display: none; }
  body.mobile-menu-hidden .control-bar { height: 0; margin: 0; opacity: 0; transform: translateY(-18px); pointer-events: none; }
  body.mobile-menu-hidden .table-frame { height: calc(100dvh - 58px); }
  .wood-inlay { inset: 3px; border-radius: 24px; }
  .game-table { display: block; height: 100%; min-height: 0; padding: 0; border-width: 1px; border-radius: 24px; }
  .seat { position: absolute; }
  .seat--north { left: 30%; top: 3px; width: 40%; }
  .seat--west, .seat--east { display: flex; gap: 4px; top: 22%; width: 29%; align-items: center; }
  .seat--west { left: 5px; }
  .seat--east { right: 5px; }
  .seat--south { bottom: 2px; left: 4%; width: 92%; }
  .seat-person { padding: 3px 6px; gap: 4px; border-radius: 8px; }
  .seat-person--vertical { width: 55px; flex-shrink: 0; }
  .avatar, .seat-direction, .opponent-tag, .observer-tag, .opponent-hand { display: none !important; }
  .seat-copy strong, .seat-person--vertical .seat-copy strong { font-size: 10px; white-space: nowrap; }
  .card-count b { font-size: 13px; }
  .card-count span { font-size: 9px; }
  .play-zone { min-height: 0; min-width: 0; width: auto; max-width: 100%; }
  .play-zone--vertical { flex: 1; }
  .play-type-label { padding: 0 4px; font-size: 9px; margin-bottom: 1px; letter-spacing: 0; }
  .played-cards { flex-wrap: wrap; padding-left: 7px; max-width: 100%; row-gap: 2px; }
  .played-cards .card { margin-left: -7px; flex-shrink: 0; }
  .play-zone .card--compact { width: 34px; height: 46px; padding: 2px; border-radius: 4px; }
  .play-zone .card--compact .card-corner { font-size: 17px; gap: 0; }
  .play-zone .card--compact .card-suit { font-size: 27px; }
  .play-zone .card--compact .card-tag { display: none; }
  .wild-note { font-size: 9px; }
  .table-center { position: absolute; top: 29%; left: 33%; width: 34%; gap: 3px; }
  .center-brand, .countdown-ring::before, .countdown-ring span { display: none; }
  .countdown-ring { width: 44px; height: 28px; margin: 0; background: none; white-space: nowrap; }
  .countdown-ring strong { font-size: 17px; }
  .deal-announcement { font-size: 10px; padding: 2px 5px; margin-bottom: 0; }
  .trick-status { font-size: 10px; gap: 3px; }
  .round-metrics { width: auto; grid-template-columns: 1fr 1fr; margin: 0; gap: 0; }
  .round-metrics > div { padding: 2px 5px; font-size: 10px; }
  .round-metrics > div + div { border-top: 0; }
  .south-console { min-height: 0; padding: 2px 0 0; gap: 5px; width: 100%; align-items: flex-end; }
  .seat-person--south { min-width: 40px; width: 40px; padding: 3px; }
  .seat-person--south .seat-copy strong { font-size: 9px; white-space: normal; }
  .seat-person--south .card-count { display: none; }
  .hand-caption { margin: 0; }
  .hand-caption span { font-size: 10px; }
  .hand-caption small { display: none; }
  .south-hand { --card-height: min(64px, calc(252px / (var(--max-stack, 4) + 2))); --stack-step: calc(var(--card-height) / 3); min-height: 0; padding: 2px 0; gap: 3px; justify-content: center; overflow-x: auto; }
  .hand-group { flex: 1 0 28px; min-width: 28px; width: auto; max-width: 52px; }
  .hand-group .card { width: 100%; padding: 2px; height: var(--card-height); }
  .hand-group .card-corner { font-size: min(20px, calc(var(--card-height) / 2.8)); gap: 0; }
  .hand-group .card-suit { font-size: calc(var(--card-height) * .58); }
  .hand-group .card-tag { display: none; }
  .hand-group .card:hover { transform: none; }
  .memory-strip { min-height: 0; padding: 2px 5px; gap: 4px; border-radius: 5px; flex-wrap: nowrap; }
  .memory-strip__icon, .memory-strip ol, .memory-strip__copy > span, .memory-strip__copy > strong { display: none; }
  .memory-strip__copy { flex: 0 0 145px !important; min-width: 0 !important; justify-content: center; }
  #training-plan { display: block; font-size: 9px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 145px; }
  .visual-inventory-strip { flex: 1 1 auto; gap: 4px; padding: 0; }
  .visual-shelf { gap: 4px; padding: 2px 5px; border-radius: 5px; }
  .visual-shelf__icon { width: 23px; height: 23px; flex-basis: 23px; border-radius: 5px; font-size: 15px; }
  .visual-shelf__copy strong { display: none; }
  .visual-shelf__copy small { font-size: 8px; }
  .visual-shelf__count { min-width: 14px; font-size: 15px; }
  .top-inventory-wrap { grid-column: 1 / -1; gap: 3px; }
  .top-inventory-heading { font-size: 7px; }
  .top-inventory-heading strong { font-size: 8px; }
  .top-inventory { gap: 3px; }
  .top-inventory__item { min-width: 0; padding: 3px 4px; grid-template-columns: 18px 1fr; grid-template-rows: 18px auto; }
  .top-inventory__icon { width: 18px; height: 18px; font-size: 13px; }
  .top-inventory__name { display: none; }
  .top-inventory__dots { grid-template-columns: repeat(4, 5px); grid-auto-rows: 5px; gap: 2px; }
  .top-inventory__dots--big, .top-inventory__dots--small { grid-template-columns: repeat(2, 6px); }
  .top-inventory__dot { width: 5px; height: 5px; }
  .top-inventory__dots--big .top-inventory__dot, .top-inventory__dots--small .top-inventory__dot { width: 6px; height: 6px; }
  .modal { width: min(760px, calc(100vw - 16px)); max-height: calc(100dvh - 12px); }
  .modal-surface { max-height: calc(100dvh - 12px); border-radius: 12px; }
  .quiz-surface, .guide-surface, .review-surface { padding: 12px 18px; }
  .quiz-heading { margin: 8px 0; }
  .quiz-heading h2 { font-size: 20px; margin: 3px 0; }
  .quiz-heading p, .quiz-kicker { display: none; }
  #quiz-prompt { font-size: 18px; margin: 8px 0 12px; }
  .quiz-options { grid-template-columns: 1fr 1fr; gap: 8px; }
  .quiz-options button { min-height: 44px; padding: 10px 12px; font-size: 16px; }
  .modal-header { padding: 8px 0; gap: 8px; }
  .modal-header h2 { font-size: 22px; }
  .icon-button { min-width: 44px; min-height: 44px; }
  .guide-method { grid-template-columns: repeat(3, 1fr); }
  .residual-table__grid { grid-template-columns: repeat(3, 1fr); }
  .toast { max-width: calc(100vw - 32px); white-space: normal; font-size: 14px; }
}
