﻿/* 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: rgba(24, 126, 127, 0.12);
    background: transparent url("assets/Icons/Settings.png") center / 26px 26px no-repeat;
    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[data-active-page="marketplace"] .app-header,
  body[data-active-page="leaderboard"] .app-header,
  body[data-active-page="game"] .app-header {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 8px;
    padding-top: calc(6px + env(safe-area-inset-top, 0px));
    padding-bottom: 3px;
  }

  body[data-active-page="marketplace"] .brand-lockup,
  body[data-active-page="leaderboard"] .brand-lockup,
  body[data-active-page="game"] .brand-lockup {
    grid-column: 1;
    gap: 0;
    align-self: center;
  }

  body[data-active-page="marketplace"] .brand-lockup h1,
  body[data-active-page="marketplace"] .brand-lockup p,
  body[data-active-page="leaderboard"] .brand-lockup h1,
  body[data-active-page="leaderboard"] .brand-lockup p,
  body[data-active-page="game"] .brand-lockup h1,
  body[data-active-page="game"] .brand-lockup p {
    display: none;
  }

  body[data-active-page="marketplace"] .brand-mark,
  body[data-active-page="leaderboard"] .brand-mark,
  body[data-active-page="game"] .brand-mark {
    width: 36px;
  }

  body[data-active-page="marketplace"] .brand-logo,
  body[data-active-page="leaderboard"] .brand-logo,
  body[data-active-page="game"] .brand-logo {
    width: 32px;
    height: 32px;
  }

  body[data-active-page="marketplace"] .header-actions,
  body[data-active-page="leaderboard"] .header-actions,
  body[data-active-page="game"] .header-actions {
    grid-column: 2;
    grid-template-columns: minmax(110px, 1fr) minmax(92px, 0.78fr) 40px;
    gap: 5px;
    width: 100%;
  }

  body[data-active-page="marketplace"] .credits-button,
  body[data-active-page="marketplace"] .account-button,
  body[data-active-page="marketplace"] .settings-button,
  body[data-active-page="leaderboard"] .credits-button,
  body[data-active-page="leaderboard"] .account-button,
  body[data-active-page="leaderboard"] .settings-button,
  body[data-active-page="game"] .credits-button,
  body[data-active-page="game"] .account-button,
  body[data-active-page="game"] .settings-button {
    min-height: 40px;
    border-radius: 8px;
  }

  body[data-active-page="marketplace"] .settings-button,
  body[data-active-page="leaderboard"] .settings-button,
  body[data-active-page="game"] .settings-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  body[data-active-page="marketplace"] .top-nav,
  body[data-active-page="leaderboard"] .top-nav,
  body[data-active-page="game"] .top-nav {
    min-height: 38px;
    border-radius: 10px;
    padding: 2px;
  }

  body[data-active-page="marketplace"] .top-nav button,
  body[data-active-page="marketplace"] .top-nav .nav-tab,
  body[data-active-page="leaderboard"] .top-nav button,
  body[data-active-page="leaderboard"] .top-nav .nav-tab,
  body[data-active-page="game"] .top-nav button,
  body[data-active-page="game"] .top-nav .nav-tab {
    min-height: 34px;
    padding: 5px 6px;
    font-size: 0.76rem;
  }

  body[data-active-page="marketplace"] .market-shell {
    gap: 4px;
    padding-top: 4px;
    padding-bottom: 12px;
  }

  body[data-active-page="marketplace"] .filters-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 10px;
    overflow: hidden;
  }

  body[data-active-page="marketplace"] .panel-block,
  body[data-active-page="marketplace"] .panel-block:nth-child(2n) {
    padding: 4px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  body[data-active-page="marketplace"] .panel-block:last-child {
    border-right: 0;
  }

  body[data-active-page="marketplace"] .collection-card {
    display: none;
  }

  body[data-active-page="marketplace"] .field-label,
  body[data-active-page="marketplace"] .sort-control span {
    display: none;
  }

  body[data-active-page="marketplace"] .text-input,
  body[data-active-page="marketplace"] .select-input {
    min-height: 40px;
    border-radius: 8px;
    padding: 0 8px;
    font-size: 0.78rem;
  }

  body[data-active-page="marketplace"] .market-main {
    gap: 4px;
  }

  body[data-active-page="marketplace"] .market-toolbar {
    display: grid;
    gap: 0;
    width: 100%;
  }

  body[data-active-page="marketplace"] .market-toolbar > div:first-child {
    display: none;
  }

  body[data-active-page="marketplace"] .toolbar-controls {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  body[data-active-page="marketplace"] .sort-control {
    gap: 0;
    min-width: 0;
  }

  body[data-active-page="marketplace"] .segmented-control {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    min-height: 40px;
    border-radius: 8px;
    padding: 2px;
  }

  body[data-active-page="marketplace"] .segmented-control button {
    min-width: 0;
    min-height: 36px;
    padding: 0 6px;
    font-size: 0.72rem;
  }

  body[data-active-page="marketplace"] .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  body[data-active-page="marketplace"] .stats-strip article:nth-child(n+3) {
    display: none;
  }

  body[data-active-page="marketplace"] .stats-strip article {
    min-width: 0;
    padding: 5px 6px;
    border-radius: 8px;
  }

  body[data-active-page="marketplace"] .stats-strip span {
    font-size: 0.92rem;
    line-height: 1;
  }

  body[data-active-page="marketplace"] .stats-strip small {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    font-size: 0.54rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-active-page="marketplace"] .cards-grid,
  body[data-active-page="marketplace"] .cards-grid.compact {
    gap: 8px;
  }

  body[data-active-page="marketplace"] .cards-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-active-page="marketplace"] .cards-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .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) {
    body[data-active-page="marketplace"] .cards-grid {
      grid-template-columns: repeat(auto-fit, minmax(min(42vw, 150px), 166px));
      justify-content: center;
      gap: 6px;
    }

    body[data-active-page="marketplace"] .cards-grid.compact {
      grid-template-columns: repeat(auto-fit, minmax(min(36vw, 124px), 138px));
    }

    body[data-active-page="marketplace"] .collection-card-shell {
      width: 100%;
    }

    body[data-active-page="marketplace"] .cards-grid.compact .collection-card-shell {
      width: 100%;
    }

    body:not([data-active-page="marketplace"]) .collection-card-shell {
      width: min(70vw, 262px);
    }

    body:not([data-active-page="marketplace"]) .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-podium {
    grid-template-columns: 1fr;
  }

  .leaderboard-podium-card,
  .leaderboard-podium-card.first {
    grid-template-columns: 40px minmax(0, 1fr);
    justify-items: start;
    min-height: 70px;
    padding: 12px 12px 12px 46px;
    text-align: left;
    transform: none;
  }

  .leaderboard-podium-card.first {
    order: -1;
  }

  .leaderboard-podium-card .leaderboard-avatar {
    grid-row: 1 / 3;
    width: 40px;
  }

  .leaderboard-podium-card strong,
  .leaderboard-podium-card small {
    grid-column: 2;
  }

  .leaderboard-medal {
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
  }

  .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 .currency-amount {
    font-size: 0.82rem;
  }

  .credits-button .currency-amount img {
    width: 22px;
    height: 22px;
  }

  .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,
  .settings-daub-grid {
    grid-template-columns: 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: none !important;
  }

  .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.table-theme-fiesta {
    background:
      linear-gradient(135deg, rgba(255, 252, 238, 0.7), rgba(255, 255, 255, 0.56)),
      url("assets/fiesta-table-1-scene.svg") center center / cover no-repeat,
      #fff8df;
  }

  .game-table-button.table-theme-beach {
    background:
      linear-gradient(135deg, rgba(242, 253, 255, 0.68), rgba(255, 255, 255, 0.55)),
      url("assets/beach-table-2-scene.svg") center center / cover no-repeat,
      #e9fbff;
  }

  .game-table-button.table-theme-halloween {
    background:
      linear-gradient(135deg, rgba(255, 246, 236, 0.62), rgba(255, 255, 255, 0.52)),
      url("assets/halloween-table-3-scene.svg") center center / cover no-repeat,
      #fbecff;
  }

  .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(0, 1fr);
    grid-template-rows: 44px clamp(112px, 32vw, 152px) 42px auto auto;
    gap: 4px;
    width: 100%;
    max-width: 100vw;
    margin: 0;
    overflow-x: hidden;
    overflow-y: visible;
    background: #000;
    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: none !important;
  }

  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 transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--teal);
    padding: 0 7px;
    box-shadow: none;
    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 / 3;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-color: transparent;
    background: transparent;
    color: var(--ink);
    text-align: center;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-credit-chip .currency-amount {
    gap: 3px;
    color: var(--ink);
    font-size: 0.8rem;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-credit-chip .currency-amount img {
    width: 22px;
    height: 22px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-resize-button {
    grid-column: 2;
    grid-row: 1;
    display: none !important;
    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;
    border-color: transparent;
    background: transparent;
    color: var(--ink);
  }

  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;
    border-color: transparent;
    background: transparent url("assets/Icons/Settings.png") center / 26px 26px no-repeat;
    font-size: 0;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .mobile-game-settings-button::before {
    content: none;
  }

  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"] .focused-game-header {
    grid-row: 1;
    grid-column: 1 / -1;
    min-height: 44px;
    border-radius: 10px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .focused-game-brand img {
    width: 30px;
    height: 30px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .focused-game-brand strong {
    font-size: 1rem;
  }

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

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

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-room-header-banner {
    grid-row: 2;
    grid-column: 1 / -1;
    min-height: clamp(112px, 32vw, 152px);
    height: clamp(112px, 32vw, 152px);
    border-radius: 8px;
    background-size: contain;
    background-position: center;
  }

  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: 3;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    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;
    border-color: transparent;
    background: transparent;
    padding: 3px 6px;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .called-ball-exit {
    position: static;
    z-index: 240;
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1) url("assets/Icons/Cancel.png") center / 74% 74% no-repeat;
    padding: 0;
    color: transparent;
    font-size: 0;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.18),
      0 10px 22px rgba(0, 0, 0, 0.35);
  }

  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"] .called-ball-face {
    width: 72%;
    border-width: 1px;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.9),
      inset -1px -2px 3px rgba(29, 35, 41, 0.12),
      inset 1px 1px 2px rgba(255, 255, 255, 0.95);
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .called-ball-face small {
    margin-top: 0;
    font-size: 0.3rem;
    line-height: 0.85;
    transform: translateY(-2px);
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .called-ball-face strong {
    margin-top: -4px;
    color: #111;
    font-size: 0.68rem;
    line-height: 0.9;
  }

  body:not(.mobile-landscape-game) .game-shell[data-mobile-step="game"] .game-cards-grid {
    grid-row: 4;
    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;
  }
}

@media (max-width: 680px) and (orientation: portrait) {
  body.mobile-portrait-game,
  body.mobile-game-lobby-tools:not(.mobile-landscape-game) {
    --mobile-portrait-tool-lane-height: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  body.mobile-portrait-game .mobile-game-quick-tools,
  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .mobile-game-quick-tools {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1200;
    display: block;
    height: var(--mobile-portrait-tool-lane-height);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.88) 18%),
      #000;
    pointer-events: none;
  }

  body.mobile-portrait-game .mobile-quick-tool,
  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .mobile-quick-tool {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    min-width: 76px;
    min-height: 52px;
  }

  body.mobile-portrait-game .mobile-quick-tool-battlepass,
  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .mobile-quick-tool-battlepass {
    left: calc(14px + env(safe-area-inset-left, 0px));
  }

  body.mobile-portrait-game .mobile-quick-tool-chat,
  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .mobile-quick-tool-chat {
    right: calc(14px + env(safe-area-inset-right, 0px));
  }

  body.mobile-portrait-game .game-shell[data-mobile-step="game"],
  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .game-shell[data-mobile-step="rooms"] {
    padding-bottom: calc(var(--mobile-portrait-tool-lane-height) + 10px);
  }

  body.mobile-portrait-game .game-shell[data-mobile-step="game"] .game-cards-grid {
    padding-bottom: calc(var(--mobile-portrait-tool-lane-height) + 10px);
  }

  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .game-shell[data-mobile-step="rooms"] .game-setup-panel {
    margin-bottom: 0;
  }

  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .game-shell[data-mobile-step="rooms"] > .table-chat-panel {
    bottom: calc(var(--mobile-portrait-tool-lane-height) + 8px);
  }

  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .mobile-battlepass-panel {
    display: grid;
    z-index: 5000;
    left: calc(8px + env(safe-area-inset-left, 0px));
    right: calc(8px + env(safe-area-inset-right, 0px));
    bottom: calc(var(--mobile-portrait-tool-lane-height) + 8px);
    height: min(238px, 34svh);
    max-height: calc(100svh - var(--mobile-portrait-tool-lane-height) - 72px);
  }

  body.mobile-portrait-game .mobile-battlepass-track,
  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .mobile-battlepass-track {
    overflow-x: auto !important;
    grid-auto-columns: 86px !important;
  }

  body.mobile-portrait-game .mobile-battlepass-tier,
  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .mobile-battlepass-tier {
    width: 86px;
    min-width: 86px;
  }

  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .mobile-battlepass-rewards {
    grid-template-columns: 70px minmax(0, 1fr) !important;
    padding: 0 10px 8px 10px !important;
  }

  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .mobile-battlepass-tier {
    grid-template-rows: minmax(34px, 1fr) 20px minmax(34px, 1fr) !important;
  }

  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .mobile-battlepass-reward {
    padding: 3px !important;
  }

  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .mobile-battlepass-reward-image {
    width: 82% !important;
    height: 82% !important;
  }

  body.mobile-game-lobby-tools:not(.mobile-landscape-game) .mobile-battlepass-tasks {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    padding: 0 10px 10px !important;
  }
}

@media (max-width: 680px), (max-height: 520px) and (max-width: 980px) {
  .game-shell[data-mobile-step="cards"] .game-card-picker {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
    max-height: none;
    overflow: visible;
    padding: 0 0 10px;
  }

  .game-shell[data-mobile-step="cards"] .game-picker-empty {
    grid-column: 1 / -1;
    width: 100%;
  }

  .game-shell[data-mobile-step="cards"] .game-picker-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    min-width: 0;
    width: 100%;
    min-height: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    padding: 0;
  }

  .game-shell[data-mobile-step="cards"] .game-picker-card .bingo-card {
    width: 100%;
    max-width: 168px;
  }

  .game-shell[data-mobile-step="cards"] .game-picker-select-badge {
    width: min(100%, 168px);
    min-height: 28px;
    padding: 0 8px;
    font-size: 0.68rem;
  }
}

@media (max-width: 420px) {
  .game-shell[data-mobile-step="cards"] .game-picker-card .bingo-card {
    max-width: 158px;
  }

  .game-shell[data-mobile-step="cards"] .game-picker-select-badge {
    width: min(100%, 158px);
  }
}

@media (max-width: 680px), (max-height: 520px) and (max-width: 980px) {
  .game-shell:not([data-mobile-step="game"]) .mobile-game-stepbar {
    display: none !important;
  }
}

@media (max-width: 680px), (max-height: 520px) and (max-width: 980px) {
  body[data-active-page="marketplace"] .market-shell {
    display: block;
    padding-top: 5px;
  }

  body[data-active-page="marketplace"] .market-main {
    display: grid;
    position: relative;
    gap: 6px;
  }

  body[data-active-page="marketplace"] .market-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    width: 100%;
  }

  body[data-active-page="marketplace"] .collection-title {
    display: none;
  }

  body[data-active-page="marketplace"] .collection-viewbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 6px;
  }

  body[data-active-page="marketplace"] .collection-tabs {
    min-height: 38px;
    padding: 2px;
  }

  body[data-active-page="marketplace"] .collection-tabs button {
    min-height: 34px;
    padding: 0 6px;
    font-size: 0.76rem;
  }

  body[data-active-page="marketplace"] .collection-filter-button {
    width: 40px;
    height: 38px;
    min-height: 38px;
    border-radius: 10px;
  }

  body[data-active-page="marketplace"] .filters-panel {
    position: absolute;
    z-index: 80;
    top: 44px;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    overflow: hidden;
  }

  body[data-active-page="marketplace"] .filters-panel[hidden] {
    display: none !important;
  }

  body[data-active-page="marketplace"] .filters-panel .panel-block,
  body[data-active-page="marketplace"] .filters-panel .panel-block:nth-child(2n) {
    padding: 5px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  body[data-active-page="marketplace"] .filters-panel .panel-block:nth-child(2n),
  body[data-active-page="marketplace"] .filters-panel .panel-block:last-child {
    border-right: 0;
  }

  body[data-active-page="marketplace"] .filters-panel .panel-block:nth-child(n+3) {
    border-bottom: 0;
  }

  body[data-active-page="marketplace"] .collection-card,
  body[data-active-page="marketplace"] .field-label,
  body[data-active-page="marketplace"] .sort-control span,
  body[data-active-page="marketplace"] .stats-strip {
    display: none !important;
  }

  body[data-active-page="marketplace"] .collection-inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-active-page="marketplace"] .collection-inventory-grid.collection-inventory-daubs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  body[data-active-page="marketplace"] .collection-inventory-tile {
    min-height: 164px;
    padding: 9px;
    border-radius: 12px;
  }

  body[data-active-page="marketplace"] .collection-inventory-daubs .collection-inventory-tile {
    min-height: 104px;
    gap: 5px;
    padding: 6px;
    border-radius: 9px;
  }

  body[data-active-page="marketplace"] .collection-inventory-preview {
    min-height: 94px;
  }

  body[data-active-page="marketplace"] .collection-inventory-daubs .collection-inventory-preview {
    min-height: 52px;
    border-radius: 8px;
  }

  body[data-active-page="marketplace"] .collection-inventory-daubs .collection-inventory-image {
    width: min(74%, 48px);
    height: min(74%, 48px);
  }

  body[data-active-page="marketplace"] .collection-inventory-daubs .collection-inventory-tile strong {
    font-size: 0.62rem;
    line-height: 1;
  }

  body[data-active-page="marketplace"] .collection-inventory-daubs .collection-inventory-status {
    padding: 2px 5px;
    font-size: 0.46rem;
  }

  body[data-active-page="marketplace"] .collection-inventory-tile-border .collection-inventory-preview {
    min-height: 136px;
  }
}

