﻿/* BingoRon mobile vertical layout. Keep portrait/mobile-flow rules here. */
@media (max-width: 980px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(86px, 0.78fr) 42px;
    gap: 8px;
    width: min(420px, 100%);
    justify-self: end;
  }

  .credits-button,
  .account-button {
    min-width: 0;
  }

  .account-button {
    justify-content: center;
  }

  .settings-button {
    width: 42px;
    min-width: 42px;
  }

  .top-nav {
    display: flex;
    grid-column: 1 / -1;
    width: 100%;
    justify-self: stretch;
    order: 3;
  }

  .top-nav button,
  .top-nav .nav-tab {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .market-shell,
  .preview-shell,
  .leaderboard-grid,
  .game-shell {
    grid-template-columns: 1fr;
  }

  .table-chat-panel {
    width: min(292px, calc(100% - 32px));
  }

  .filters-panel {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-block {
    border-right: 1px solid var(--line);
  }

  .panel-block:nth-child(2n),
  .panel-block:last-child {
    border-right: 0;
  }
}

@media (max-width: 680px) {
  :root {
    --mobile-page-gutter: 12px;
  }

  .app-header,
  .market-shell,
  .preview-shell,
  .leaderboard-shell,
  .game-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .app-header {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: stretch;
    overflow: hidden;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    padding-bottom: 10px;
  }

  .app-header > *,
  .market-main,
  .filters-panel,
  .preview-controls-panel,
  .preview-stage,
  .leaderboard-hero,
  .leaderboard-panel,
  .game-setup-panel,
  .game-stage {
    min-width: 0;
    max-width: calc(100vw - var(--mobile-page-gutter) - var(--mobile-page-gutter));
  }

  .brand-lockup {
    gap: 10px;
  }

  .brand-mark {
    width: 40px;
    border-radius: 9px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .credits-button,
  .account-button {
    min-width: 0;
    padding: 0 10px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(86px, 0.78fr) 42px;
    gap: 6px;
    width: calc(100vw - var(--mobile-page-gutter) - var(--mobile-page-gutter));
    justify-self: stretch;
  }

  .settings-button {
    position: static;
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-color: var(--line);
    background: #fff;
    color: var(--ink);
    box-shadow: none;
  }

  .account-button {
    justify-content: center;
  }

  .account-name {
    max-width: 92px;
  }

  .brand-lockup p {
    display: none;
  }

  .top-nav {
    display: flex;
    width: calc(100vw - var(--mobile-page-gutter) - var(--mobile-page-gutter));
    min-width: 0;
    max-width: 100%;
    justify-self: stretch;
    overflow: visible;
    border-radius: 10px;
  }

  .top-nav button,
  .top-nav .nav-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.mobile-portrait-game .app-header {
    display: none;
  }

  .market-toolbar,
  .toolbar-controls,
  .game-toolbar,
  .game-actions {
    display: grid;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .market-toolbar h2 {
    font-size: 1.45rem;
  }

  .toolbar-controls {
    grid-template-columns: 1fr;
  }

  .sort-control {
    min-width: 0;
    width: 100%;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1 1 0;
    min-width: 0;
  }

  .filters-panel {
    grid-template-columns: 1fr;
  }

  .stats-strip,
  .game-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stats-strip article,
  .game-hud article {
    padding: 12px;
  }

  .panel-block,
  .panel-block:nth-child(2n) {
    border-right: 0;
  }

  .cards-grid,
  .cards-grid.compact {
    grid-template-columns: minmax(0, 1fr);
  }

  .collection-card-shell {
    width: min(100%, 360px);
    justify-self: center;
  }

  @media (orientation: portrait) {
    .collection-card-shell {
      width: min(70vw, 262px);
    }

    .cards-grid.compact .collection-card-shell {
      width: min(62vw, 224px);
    }
  }

  .preview-stage {
    min-height: 480px;
    padding: 16px;
  }

  .preview-card-slot {
    width: min(320px, calc(100vw - 48px));
  }

  .leaderboard-hero {
    display: grid;
  }

  .leaderboard-season-card {
    min-width: 0;
  }

  .leaderboard-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .leaderboard-score {
    grid-column: 2;
    justify-self: start;
  }

  .game-shell {
    gap: 14px;
  }

  .game-stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .game-toolbar,
  .game-hud,
  .called-ball-row,
  .called-ball-strip,
  .game-cards-grid {
    grid-column: 1;
    grid-row: auto;
  }

  .game-setup-panel {
    overflow: hidden;
    width: calc(100vw - var(--mobile-page-gutter) - var(--mobile-page-gutter));
  }

  .game-control-header,
  .game-table-tabs,
  .game-join-block,
  .game-picker-block,
  .game-start-actions,
  .game-prize-table {
    padding: 12px;
  }

  .game-table-tabs {
    grid-template-columns: repeat(3, minmax(142px, 1fr));
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .game-table-button {
    scroll-snap-align: start;
  }

  .custom-room-panel {
    margin: 12px;
  }

  .game-card-picker {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: none;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .game-selection-header {
    min-width: 0;
  }

  .game-selection-header strong {
    min-width: 0;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-picker-empty {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
  }

  .game-picker-card {
    grid-template-columns: auto 40px minmax(132px, 1fr);
    min-width: 232px;
  }

  .game-picker-art,
  .game-picker-fallback {
    width: 40px;
  }

  .game-start-actions {
    grid-template-columns: 1fr 1fr;
  }

  .game-prize-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-prize-table div {
    display: grid;
    gap: 4px;
    align-content: start;
  }

  .game-toolbar {
    grid-template-columns: 1fr;
  }

  .game-toolbar h2 {
    font-size: 1.2rem;
    line-height: 1.2;
  }

  .game-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-actions button,
  .audio-action {
    min-width: 0;
    width: 100%;
  }

  .called-ball-strip {
    flex-wrap: nowrap;
    min-height: 58px;
    overflow-x: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .called-ball-row {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 8px;
  }

  .called-ball-exit {
    min-width: 112px;
    min-height: 58px;
    font-size: 1.48rem;
  }

  .called-ball,
  .called-ball-empty {
    flex: 0 0 auto;
  }

  .called-ball {
    width: 42px;
  }

  .game-cards-grid {
    min-height: 720px;
  }

  .game-cards-grid.table-theme-fiesta,
  .game-cards-grid.table-theme-beach,
  .game-cards-grid.table-theme-halloween {
    --theme-scene-height: 720px;
  }

  .table-chat-panel {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    min-height: 0;
    height: min(46vh, 320px);
  }

  .credits-dialog,
  .settings-menu {
    top: auto;
    right: calc(8px + env(safe-area-inset-right, 0px));
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left: calc(8px + env(safe-area-inset-left, 0px));
    width: auto;
    max-height: min(78vh, 640px);
    border-radius: 12px;
  }

  .game-cards-grid .game-empty {
    padding-right: 0;
    padding-bottom: min(46vh, 320px);
  }

  .win-row {
    grid-template-columns: 1fr;
  }

  .detail-drawer {
    width: 100vw;
    max-width: none;
    padding:
      calc(14px + env(safe-area-inset-top, 0px))
      calc(14px + env(safe-area-inset-right, 0px))
      calc(18px + env(safe-area-inset-bottom, 0px))
      calc(14px + env(safe-area-inset-left, 0px));
  }

  .drawer-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  :root {
    --mobile-page-gutter: 10px;
  }

  .app-header,
  .market-shell,
  .preview-shell,
  .leaderboard-shell,
  .game-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .brand-lockup h1 {
    font-size: 1rem;
  }

  .credits-button span {
    font-size: 0.7rem;
  }

  .credits-button small {
    font-size: 0.56rem;
  }

  .account-name {
    max-width: 72px;
  }

  .top-nav button {
    font-size: 0.78rem;
    padding: 8px 5px;
  }

  .stats-strip,
  .game-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-hud span {
    font-size: 1.06rem;
  }

  .current-ball-tile span {
    font-size: 1.28rem;
  }

  .game-table-tabs {
    grid-template-columns: repeat(3, minmax(128px, 1fr));
  }

  .custom-room-panel {
    margin: 12px;
    padding: 14px;
  }

  .game-picker-card {
    min-width: 218px;
  }

  .game-actions {
    grid-template-columns: 1fr 1fr;
  }

  .called-ball {
    width: 38px;
  }

  .called-ball-face small {
    font-size: 0.38rem;
  }

  .called-ball-face strong {
    font-size: 0.78rem;
  }

  .settings-avatar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .settings-daub-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px), (max-height: 520px) and (max-width: 980px) {
  html,
  body,
  .game-shell {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar,
  .game-shell::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .mobile-game-stepbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: calc(100vw - var(--mobile-page-gutter) - var(--mobile-page-gutter));
    margin: 0 auto;
    border: 1px solid rgba(216, 222, 223, 0.95);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    padding: 4px;
    box-shadow: 0 10px 22px rgba(29, 35, 41, 0.08);
    backdrop-filter: blur(10px);
  }

  .mobile-game-stepbar button {
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
  }

  .mobile-game-stepbar button.active {
    background: var(--teal);
    color: #fff;
  }

  .mobile-game-stepbar button:disabled {
    color: rgba(107, 119, 128, 0.5);
    cursor: not-allowed;
  }

  .game-shell[data-mobile-step="game"] .mobile-game-stepbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .game-shell[data-mobile-step="game"] .mobile-game-stepbar [data-mobile-game-step] {
    display: none;
  }

  .game-shell[data-mobile-step="game"] .mobile-game-resize-button {
    display: block;
  }

  .game-shell {
    display: block;
    min-height: auto;
    padding-top: 12px;
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  }

  .game-shell[data-mobile-step="rooms"] .game-stage,
  .game-shell[data-mobile-step="cards"] .game-stage,
  .game-shell[data-mobile-step="game"] .game-setup-panel {
    display: none;
  }

  .game-shell[data-mobile-step="rooms"] .game-setup-panel,
  .game-shell[data-mobile-step="cards"] .game-setup-panel {
    display: grid;
    width: calc(100vw - var(--mobile-page-gutter) - var(--mobile-page-gutter));
    max-width: none;
    margin: 12px auto 0;
    overflow: visible;
  }

  .game-shell[data-mobile-step="rooms"] .game-join-block,
  .game-shell[data-mobile-step="rooms"] .game-picker-block,
  .game-shell[data-mobile-step="rooms"] .mobile-card-confirm,
  .game-shell[data-mobile-step="rooms"] .game-start-actions,
  .game-shell[data-mobile-step="rooms"] .game-prize-table {
    display: none;
  }

  .game-shell[data-mobile-step="cards"] .game-control-header,
  .game-shell[data-mobile-step="cards"] .game-prize-table {
    display: none;
  }

  .game-shell[data-mobile-step="cards"] .game-join-block {
    display: grid;
    padding: 12px 14px;
  }

  .game-table-tabs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    overflow: visible;
    padding: 12px;
    scroll-snap-type: none;
  }

  .game-table-button {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 12px;
    align-items: start;
    width: 100%;
    min-height: 150px;
    border-radius: 12px;
    padding: 14px;
    background:
      radial-gradient(circle at 90% 10%, rgba(214, 154, 25, 0.13), transparent 34%),
      #fff;
  }

  .game-table-button > strong {
    font-size: 1.08rem;
  }

  .game-table-button > small {
    justify-self: end;
    border-radius: 999px;
    background: rgba(24, 126, 127, 0.08);
    color: var(--teal);
    padding: 4px 9px;
    text-align: right;
  }

  .game-room-metrics,
  .custom-room-summary {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .game-room-metric {
    display: grid;
    gap: 2px;
    border: 1px solid rgba(216, 222, 223, 0.82);
    border-radius: 8px;
    background: rgba(247, 250, 250, 0.86);
    padding: 8px;
  }

  .game-room-metric small {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .game-room-metric strong {
    color: var(--ink);
    font-size: 0.88rem;
    line-height: 1.1;
  }

  .game-room-cta {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 999px;
    background: var(--teal);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 900;
  }

  .game-card-picker {
    display: grid;
    gap: 10px;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .game-picker-card {
    grid-template-columns: auto 54px minmax(0, 1fr);
    min-width: 0;
    width: 100%;
    min-height: 74px;
    border-radius: 10px;
    padding: 10px;
  }

  .game-picker-art,
  .game-picker-fallback {
    width: 54px;
  }

  .mobile-card-confirm {
    position: sticky;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    padding:
      10px
      12px
      calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -14px 28px rgba(29, 35, 41, 0.1);
    backdrop-filter: blur(10px);
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] {
    display: grid;
    grid-template-columns: minmax(74px, 0.52fr) minmax(0, 1fr) max-content 38px;
    gap: 4px;
    width: 100%;
    max-width: 100vw;
    margin: 0;
    overflow-x: hidden;
    overflow-y: visible;
    padding-top: calc(5px + env(safe-area-inset-top, 0px));
    -webkit-overflow-scrolling: touch;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-meta-bar,
  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-stepbar {
    display: contents;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-stepbar [data-mobile-game-step] {
    display: none;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-credit-chip,
  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-resize-button,
  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-account-chip,
  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-settings-button {
    appearance: none;
    min-width: 0;
    min-height: 34px;
    border: 1px solid rgba(216, 222, 223, 0.95);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--teal);
    padding: 0 7px;
    box-shadow: 0 6px 14px rgba(29, 35, 41, 0.07);
    font: inherit;
    font-weight: 1000;
    cursor: pointer;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-credit-chip {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    align-content: center;
    gap: 0;
    background: var(--teal);
    color: #fff;
    text-align: left;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-credit-chip span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.46rem;
    line-height: 1;
    text-transform: uppercase;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-credit-chip small {
    overflow: hidden;
    color: #fff;
    font-size: 0.72rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-resize-button {
    grid-column: 2;
    grid-row: 1;
    display: block;
    width: 100%;
    padding: 0 6px;
    overflow: hidden;
    font-size: 0.75rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-account-chip {
    grid-column: 3;
    grid-row: 1;
    display: grid;
    min-width: 54px;
    width: 100%;
    padding: 0 6px;
    place-items: center;
    overflow: hidden;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-account-chip.connected {
    min-width: 38px;
    width: 38px;
    padding: 0;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-avatar {
    width: 24px;
    border-color: rgba(24, 126, 127, 0.28);
    font-size: 0.72rem;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-account-name {
    display: none;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-settings-button {
    grid-column: 4;
    grid-row: 1;
    display: grid;
    width: 38px;
    padding: 0;
    place-items: center;
    font-size: 0;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-settings-button::before {
    content: "\2699";
    font-size: 1.34rem;
    line-height: 1;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-resize-button.active {
    background: var(--teal);
    color: #fff;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-stage {
    display: contents;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-toolbar {
    display: contents;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-toolbar > div:first-child {
    grid-row: 2;
    grid-column: 1 / 3;
    min-width: 0;
    min-height: 30px;
    border: 1px solid rgba(216, 222, 223, 0.95);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.94);
    padding: 3px 6px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-toolbar h2 {
    font-size: 0.8rem;
    line-height: 1.05;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-actions {
    grid-row: 2;
    grid-column: 3 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-self: stretch;
    gap: 3px;
    width: 100%;
    min-height: 30px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-actions button,
  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .audio-action {
    width: 100%;
    min-width: 0;
    min-height: 30px;
    padding: 0 3px;
    font-size: 0.5rem;
    white-space: nowrap;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .creator-draw-controls:not([hidden]) {
    grid-row: 3;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(58px, 0.72fr) repeat(3, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    min-height: 28px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .creator-room-code,
  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .creator-control-button {
    display: grid;
    min-width: 0;
    min-height: 28px;
    padding: 0 5px;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    font-size: 0.52rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-hud {
    grid-row: 4;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    width: 100%;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-hud article {
    min-height: 38px;
    border-radius: 9px;
    padding: 2px 4px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-hud article:nth-child(-n + 3),
  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-hud article:nth-child(n + 4) {
    grid-column: auto;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-hud small {
    font-size: clamp(0.34rem, 1.65vw, 0.42rem);
    line-height: 1.05;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-hud span {
    margin-top: 1px;
    font-size: clamp(0.58rem, 2.4vw, 0.68rem);
    line-height: 1.05;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .current-ball-tile span {
    font-size: 0.76rem;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .called-ball-row {
    grid-row: 5;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) 112px;
    width: 100%;
    max-width: none;
    min-height: 42px;
    height: 42px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .called-ball-strip {
    flex-wrap: nowrap;
    min-height: 42px;
    height: 42px;
    overflow: hidden;
    padding: 3px 6px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .called-ball-exit {
    min-height: 42px;
    height: 42px;
    font-size: 1.08rem;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .called-ball {
    width: 34px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-cards-grid {
    grid-row: 6;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
    width: 100%;
    max-width: none;
    min-height: 0 !important;
    overflow: visible;
    padding: 10px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-cards-grid.table-theme-fiesta,
  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-cards-grid.table-theme-beach,
  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-cards-grid.table-theme-halloween {
    --theme-scene-height: 100%;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-card-frame {
    position: relative;
    z-index: 1;
    top: auto;
    left: auto;
    width: 100%;
    cursor: default;
    touch-action: manipulation;
    transform: none !important;
    user-select: auto;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"].mobile-cards-resized .game-cards-grid {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame {
    width: min(80vw, 288px);
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame .bingo-card {
    grid-template-rows: 1fr;
    aspect-ratio: 5 / 5.35;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame .art-panel {
    position: absolute;
    z-index: 0;
    inset: 0;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame .art-panel::after {
    inset: 0;
    height: auto;
    background: rgba(255, 255, 255, 0.14);
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame .nft-image {
    width: 100%;
    height: 100%;
    margin-top: 0;
    opacity: 0.5;
    object-fit: contain;
    filter: saturate(1.08) drop-shadow(0 10px 16px rgba(29, 35, 41, 0.2));
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame .card-meta,
  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame .card-owner-badge {
    display: none;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame .grid-panel {
    z-index: 2;
    grid-row: 1;
    align-self: stretch;
    padding: clamp(7px, 3cqw, 10px);
    background: transparent;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame .bingo-grid {
    --bingo-header-row-height: clamp(13px, 6cqw, 19px);
    --bingo-panel-bottom-padding: 0px;
    --bingo-number-row-height: calc((92cqw - var(--bingo-header-row-height) - 15px) / 5);
    align-self: center;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame .grid-cell {
    background: rgba(255, 255, 255, 0.84);
    font-size: clamp(0.74rem, 5.2cqw, 1rem);
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame .grid-cell.header {
    background: rgba(29, 35, 41, 0.92);
    color: #fff;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-card-frame.dragging {
    filter: none;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-card-footer {
    min-height: 28px;
    padding: 5px 6px;
    font-size: 0.68rem;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .table-chat-panel {
    position: relative;
    z-index: 2;
    grid-column: 1 / -1;
    grid-row: auto;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    height: clamp(260px, 38vh, 320px);
    min-height: 260px;
    max-height: none;
    order: 2;
  }

  body.chat-keyboard-active:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .table-chat-panel {
    position: relative;
    z-index: 20;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    height: clamp(260px, 38vh, 320px);
    min-height: 260px;
    max-height: none;
    order: 2;
    transform: translateY(calc(-1 * var(--mobile-chat-lift, 0px)));
    transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .other-player-cards-zone {
    position: relative;
    z-index: 1;
    grid-column: 1 / -1;
    top: auto;
    left: auto;
    width: 100% !important;
    transform: none !important;
    order: 3;
    pointer-events: auto;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .other-player-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-cards-grid .game-empty {
    grid-column: 1 / -1;
    min-height: 180px;
    height: auto;
    padding: 16px;
  }
}

