﻿/* BingoRon mobile horizontal game layout. Keep landscape game rules here. */

@media (max-width: 680px), (max-height: 520px) and (max-width: 980px) {
  body.mobile-landscape-game {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    width: 100svw;
    height: 100svh;
    overflow: hidden;
    background: #10181b;
  }

  body.mobile-landscape-game .app-header,
  body.mobile-landscape-game .market-shell,
  body.mobile-landscape-game .preview-shell,
  body.mobile-landscape-game .leaderboard-shell {
    display: none !important;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] {
    --mobile-landscape-chat-width: clamp(244px, 38vw, 360px);
    --mobile-landscape-meta-width: clamp(152px, 24vw, 190px);
    --mobile-landscape-top-gap: 5px;
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 3px;
    width: 100vw;
    height: 100vh;
    width: 100svw;
    height: 100svh;
    max-width: none;
    min-height: 0;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background:
      linear-gradient(135deg, rgba(18, 29, 32, 0.96), rgba(12, 18, 22, 0.98)),
      var(--surface-soft);
    padding: 4px;
    -webkit-overflow-scrolling: touch;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"].mobile-cards-resized {
    --mobile-landscape-chat-width: 244px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .mobile-game-stepbar {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    z-index: 60;
    grid-template-columns: minmax(0, 1fr);
    align-self: stretch;
    justify-self: start;
    width: calc(100% - var(--mobile-landscape-meta-width) - var(--mobile-landscape-top-gap));
    margin: 0;
    min-height: 20px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.92);
    padding: 1px;
    box-shadow: none;
  }

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

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .mobile-game-resize-button {
    display: block;
    color: var(--teal);
    font-weight: 1000;
  }

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

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .mobile-game-stepbar button {
    min-height: 18px;
    border-radius: 7px;
    font-size: 0.58rem;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .mobile-game-meta-bar {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: minmax(54px, 1fr) max-content 30px;
    gap: 3px;
    align-self: stretch;
    justify-self: end;
    width: var(--mobile-landscape-meta-width);
    margin-right: 0;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .mobile-game-credit-chip,
  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .mobile-game-account-chip,
  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .mobile-game-settings-button {
    appearance: none;
    min-width: 0;
    min-height: 22px;
    border: 1px solid rgba(216, 222, 223, 0.95);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    padding: 0 6px;
    font: inherit;
    cursor: pointer;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .mobile-game-credit-chip {
    display: grid;
    align-content: center;
    gap: 0;
    text-align: left;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .mobile-game-credit-chip span {
    color: var(--muted);
    font-size: 0.42rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
  }

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

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .mobile-game-account-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
    font-size: 0.6rem;
    font-weight: 900;
    white-space: nowrap;
  }

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

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .mobile-game-avatar {
    flex: 0 0 auto;
    width: 18px;
    font-size: 0.56rem;
  }

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

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .mobile-game-settings-button {
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--teal);
    font-size: 0;
    font-weight: 1000;
  }

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

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

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .game-toolbar {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    min-width: 0;
    min-height: 24px;
    padding: 2px 5px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .game-toolbar > div:first-child {
    min-width: 0;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .game-toolbar h2 {
    overflow: hidden;
    margin-top: 1px;
    font-size: 0.76rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .eyebrow {
    font-size: 0.46rem;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .game-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    width: auto;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .game-actions button,
  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .audio-action {
    min-width: 50px;
    width: auto;
    min-height: 22px;
    padding: 0 4px;
    font-size: 0.52rem;
    white-space: nowrap;
  }

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

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .game-hud article {
    border-radius: 9px;
    padding: 2px 5px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .game-hud small {
    font-size: 0.38rem;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .game-hud span {
    margin-top: 1px;
    font-size: 0.66rem;
  }

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

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .called-ball-row {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    grid-template-columns: minmax(0, calc((34px * 6) + (4px * 5) + 12px)) 72px;
    gap: 5px;
    width: calc((34px * 6) + (4px * 5) + 12px + 72px + 5px);
    max-width: 100%;
    min-height: 40px;
    height: 40px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .called-ball-strip {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    width: calc((34px * 6) + (4px * 5) + 12px);
    max-width: 100%;
    min-height: 40px;
    height: 40px;
    gap: 4px;
    overflow: hidden;
    padding: 2px 6px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .called-ball-exit {
    min-width: 72px;
    min-height: 40px;
    height: 40px;
    border-radius: 9px;
    padding: 0 3px;
    color: #c1121f;
    font-size: 0.96rem;
    font-weight: 1000;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .called-ball {
    flex: 0 0 auto;
    width: 34px;
    will-change: transform;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .called-ball-empty {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .called-ball.roll-in {
    animation: called-ball-roll-in 560ms cubic-bezier(0.22, 0.9, 0.24, 1) both;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .called-ball.push-slide {
    animation: called-ball-push-slide 560ms cubic-bezier(0.22, 0.9, 0.24, 1) both;
  }

  @keyframes called-ball-roll-in {
    from {
      opacity: 0;
      transform: translateX(-34px) rotate(-300deg) scale(0.82);
    }

    72% {
      opacity: 1;
      transform: translateX(2px) rotate(14deg) scale(1.04);
    }

    to {
      opacity: 1;
      transform: translateX(0) rotate(0deg) scale(1);
    }
  }

  @keyframes called-ball-push-slide {
    from {
      transform: translateX(-32px);
    }

    to {
      transform: translateX(0);
    }
  }

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

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

  @media (prefers-reduced-motion: reduce) {
    body.mobile-landscape-game .game-shell[data-mobile-step="game"] .called-ball.roll-in,
    body.mobile-landscape-game .game-shell[data-mobile-step="game"] .called-ball.push-slide {
      animation: none;
    }
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .game-cards-grid {
    grid-column: 1 / -1;
    grid-row: 3;
    align-self: stretch;
    min-height: 252px;
    border-radius: 10px;
  }

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

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .game-card-frame {
    width: 171px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame {
    width: 193px;
  }

  body.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.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.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.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.mobile-landscape-game .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame .card-meta,
  body.mobile-landscape-game .game-shell[data-mobile-step="game"].mobile-cards-resized .game-card-frame .card-owner-badge {
    display: none;
  }

  body.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.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.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.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.mobile-landscape-game .game-shell[data-mobile-step="game"] .game-card-footer {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 0.62rem;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .other-player-cards-zone {
    gap: 5px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .other-player-cards-title {
    padding: 2px 7px;
    font-size: 0.52rem;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .other-player-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 106px));
    gap: 8px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .other-player-card-frame .bingo-card {
    border-width: 3px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .other-player-card-frame .grid-panel {
    padding: 3px;
    padding-top: 0;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .other-player-card-frame .bingo-grid {
    --bingo-header-row-height: 7px;
    --bingo-panel-bottom-padding: 3px;
    gap: 1.5px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-panel {
    position: fixed;
    top: 78px;
    right: 4px;
    bottom: 4px;
    left: auto;
    width: min(var(--mobile-landscape-chat-width), calc(100svw - 8px));
    height: auto;
    min-height: 0;
    max-height: none;
    border-radius: 10px;
    transition: bottom 180ms cubic-bezier(0.2, 0.8, 0.2, 1), max-height 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  body.mobile-landscape-game.chat-keyboard-active .game-shell[data-mobile-step="game"] .table-chat-panel {
    bottom: calc(var(--mobile-keyboard-offset, 0px) + 4px + env(safe-area-inset-bottom, 0px));
    max-height: calc(var(--mobile-keyboard-viewport-height, 100svh) - 82px);
    will-change: bottom, max-height;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-header {
    min-height: 45px;
    gap: 3px;
    padding: 4px 7px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-title strong {
    font-size: 0.76rem;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-room-label {
    font-size: 0.62rem;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-tab {
    padding: 3px 6px;
    font-size: 0.62rem;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-messages {
    padding: 6px 8px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-reaction-bar {
    padding: 4px 8px 0;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-reaction-button {
    width: 28px;
    min-width: 28px;
    font-size: 0.94rem;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-form {
    gap: 5px;
    padding: 5px 7px 6px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-avatar {
    width: 24px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-input {
    height: 28px;
    font-size: 0.76rem;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-emoji-toggle,
  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .table-chat-send {
    width: 28px;
    height: 28px;
  }

  body.mobile-landscape-game .game-shell[data-mobile-step="game"] .game-cards-grid .game-empty {
    padding-right: calc(var(--mobile-landscape-chat-width) + 22px);
    padding-bottom: 0;
  }
}
