/* Phone website: the card board fills the space that the keyboard used. */
html.gm-touch-matching, html.gm-touch-matching body { overflow: hidden; overscroll-behavior: none; }
.gm-touch-matching .main-tagline, .gm-touch-matching #tabbar { display: none !important; }
.gm-touch-matching #gameModal { inset: 0; z-index: 5000; padding: 0; background: #FFF; align-items: stretch; }
.gm-touch-matching #gameModal .gm-box.playing { width: 100%; height: 100%; max-width: none; max-height: none; border-radius: 0; box-shadow: none; }
.gm-touch-matching #gameModal .vs-match-body { box-sizing: border-box; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); overflow: auto; }
.gm-touch-matching .vs-match-body .vs-keyboard-guide, .gm-touch-matching .vs-match-body .vs-board-kicker,
.gm-touch-matching .vs-match-body .vs-match-side, .gm-touch-matching .vs-match-body .vs-mid,
.gm-touch-matching .vs-match-body .vs-num, .gm-touch-matching .vs-match-body .vs-number-key-hint,
.gm-touch-matching .vs-match-body .vs-spk, .gm-touch-matching .vs-match-body .gr-energy { display: none !important; }
.gm-touch-matching .vs-match-body .game-top { flex: 0 0 auto; margin: 0 0 5px; gap: 7px; }
.gm-touch-matching .vs-match-body .game-top .g-timer { display: block; font-size: 22px; }
.gm-touch-matching .vs-match-body .vs-help { flex: 0 0 auto; margin: 4px 0 12px; font-size: 12px; line-height: 1.5; text-align: center; }
.gm-touch-matching .vs-match-layout, .gm-touch-matching .vs-match-board, .gm-touch-matching .vs-card-stage { display: flex; flex: 1 0 auto; flex-direction: column; min-height: 0; }
.gm-touch-matching .vs-match-layout { margin: 0; }
.gm-touch-matching .vs-match-body .vs-wrap { display: flex; flex: 1 0 auto; align-items: stretch; gap: 10px; }
.gm-touch-matching .vs-match-body .vs-col { flex: 1 1 0; min-width: 0; gap: 10px; }
.gm-touch-matching .vs-match-body .vs-card { flex: 1 0 75px; justify-content: center; min-width: 0; min-height: 75px; margin: 0; padding: 14px 10px; border-radius: 12px; text-align: center; touch-action: manipulation; }
.gm-touch-matching .vs-match-body .vs-tx { min-width: 0; width: 100%; font-size: 19px; font-weight: 750; line-height: 1.4; overflow-wrap: anywhere; word-break: keep-all; }
.gm-touch-matching .vs-match-body .vs-en .vs-tx { font-size: 22px; word-break: normal; }

/* Installed app already uses touch cards: let its five rows occupy the screen. */
.mm-playing #gameModal .mm-shell { box-sizing: border-box; width: 100%; max-width: 100%; height: 100%; min-height: 100%; padding: max(10px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
.mm-playing #gameModal .mm-top { gap: 10px; }
.mm-playing #gameModal .mm-instruction { margin: 8px 0 0; font-size: 21px; line-height: 1.35; }
.mm-playing #gameModal .mm-meta { margin-top: 7px; gap: 5px 12px; font-size: 12px; }
.mm-playing #gameModal .mm-board { flex: 1 0 auto; grid-auto-rows: minmax(56px, 1fr); align-content: stretch; gap: 9px 10px; margin: 12px 0 0; }
.mm-playing #gameModal .mm-card { min-height: 56px; padding: 10px 8px; border-radius: 12px; font-size: 18px; font-weight: 650; line-height: 1.35; }
.mm-playing #gameModal .mm-card-en { font-size: 21px; font-weight: 750; }
.mm-playing #gameModal .mm-footer { flex: 0 0 auto; padding-top: 10px; gap: 6px; }
.mm-playing #gameModal .mm-feedback { min-height: 20px; font-size: 12px; }
.mm-playing #gameModal .mm-confirm { min-height: 44px; padding: 10px 14px; border-radius: 10px; font-size: 15px; }
@media (min-width: 641px) {
  .gm-touch-matching .vs-match-body .vs-wrap { gap: 16px; }
  .gm-touch-matching .vs-match-body .vs-col { gap: 14px; }
  .gm-touch-matching .vs-match-body .vs-tx, .mm-playing #gameModal .mm-card { font-size: 23px; }
  .gm-touch-matching .vs-match-body .vs-en .vs-tx, .mm-playing #gameModal .mm-card-en { font-size: 27px; }
}
@media (max-height: 640px) {
  .gm-touch-matching .vs-match-body .vs-card { flex-basis: 56px; min-height: 56px; padding: 9px 8px; }
  .mm-playing #gameModal .mm-instruction { font-size: 18px; margin-top: 3px; }
  .mm-playing #gameModal .mm-meta { margin-top: 3px; }
  .mm-playing #gameModal .mm-board { margin-top: 8px; gap: 7px 9px; }
}

.gm-touch-matching .vs-match-body .vs-study-action { min-height: 44px; padding: 8px 14px; }
