/* Regular games only. Desktop layout and every displayed game value are retained. */
@media (max-width: 960px) {
  #gameShell.regular-game.game-shell .game-surface,
  #gameShell.regular-game.game-shell #gameRoot,
  #gameShell.regular-game.game-shell #gameRoot > * {
    height: auto !important;
    min-height: 0 !important;
  }

  #gameShell.regular-game.game-shell.is-game-loading .game-surface { min-height: 300px !important; }

  #gameShell.regular-game #gameRoot .autobet-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  #gameShell.regular-game #gameRoot .autobet-left {
    order: 2;
    height: auto;
    padding: 14px;
    overflow: visible;
    border-radius: 0 0 12px 12px;
  }

  #gameShell.regular-game #gameRoot .autobet-scroll {
    flex: 0 0 auto;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    gap: 12px;
  }

  #gameShell.regular-game #gameRoot .autobet-left + div {
    order: 1;
    flex: 0 0 auto;
    width: 100%;
    height: 300px;
    min-height: 0;
    padding: 12px;
    border: 0;
    border-radius: 12px 12px 0 0;
  }

  #gameShell.regular-game #gameRoot :is(.autobet-mode-switch, .mines-mode-switch, .chicken-mode-switch) {
    margin: 0 0 12px;
    flex-shrink: 0;
  }

  #gameShell.regular-game #gameRoot :is(.autobet-mode-switch, .mines-mode-switch, .chicken-mode-switch) button {
    min-height: 40px;
  }

  /* The action stays next to the scene; the form now uses normal page scrolling. */
  #gameShell.regular-game #gameRoot .autobet-mobile-bet {
    min-height: 44px;
    margin-bottom: 12px;
  }

  #gameShell.regular-game #gameRoot :is(input:not([type="range"]), select) {
    min-width: 0;
    min-height: 44px;
    font-size: 16px;
  }

  #gameShell.regular-game #gameRoot :is(.autobet-rule, .mines-auto-rule, .chicken-auto-rule) {
    grid-template-columns: auto auto minmax(70px, 1fr);
  }

  #gameShell.regular-game #gameRoot :is(.autobet-rule, .mines-auto-rule, .chicken-auto-rule) button {
    min-height: 40px;
    padding-inline: 8px;
    font-size: 12px;
  }

  #gameShell.regular-game #gameRoot :is(.autobet-advanced-toggle, .mines-auto-advanced-toggle, .chicken-auto-advanced-toggle) {
    min-height: 44px;
  }

  #gameShell.regular-game #gameRoot :is(.autobet-panel, .mines-auto-panel, .chicken-auto-panel,
    .autobet-advanced, .mines-auto-advanced, .chicken-auto-advanced) {
    gap: 12px;
  }

  #gameShell.regular-game #gameRoot :is(.autobet-advanced, .mines-auto-advanced, .chicken-auto-advanced) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #gameShell.regular-game #gameRoot :is(.autobet-advanced, .mines-auto-advanced, .chicken-auto-advanced) > :nth-child(-n+2) {
    grid-column: 1 / -1;
  }
  #gameShell.regular-game #gameRoot .autobet-scroll:where(:has(#plinkoBet), :has(#minesBet)) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #gameShell.regular-game #gameRoot .autobet-scroll:where(:has(#plinkoBet), :has(#minesBet)) > * { grid-column: 1 / -1; }
  #gameShell.regular-game #gameRoot .autobet-scroll > :is(.plinko-select-row, .mines-select-row) { grid-column: auto; }

  #gameShell.regular-game #gameRoot :is(.dice-small-btn, .cf-small-btn, .blackjack-small-btn, .baccarat-small-btn,
    .hilo-small-btn, .poker-small-btn, .rps-small-btn, .mines-secondary-btn, .chicken-go-btn) {
    min-height: 44px;
  }

  #gameShell.regular-game #gameRoot :is(.dice-msg, .cf-msg, .blackjack-msg, .baccarat-msg, .hilo-msg,
    .poker-msg, .roulette-msg, .rps-msg, .plinko-msg):empty { display: none; }

  /* Crash: reserve space for both existing inputs below the chart. */
  #gameShell.regular-game #gameRoot .crash-right-inner { gap: 12px; min-height: 0; }
  #gameShell.regular-game #gameRoot .crash-main-display { min-height: 0; }
  #gameShell.regular-game #gameRoot .crash-mult-value { font-size: clamp(48px, 16vw, 80px); }
  #gameShell.regular-game #gameRoot .crash-bottom-block { flex: 0 0 auto; margin: 0; padding: 0; }
  #gameShell.regular-game #gameRoot .crash-stats-row { gap: 10px; }
  #gameShell.regular-game #gameRoot .crash-stat-label { font-size: 12px; }

  /* Dice: ticks have their own line above the entire result marker. */
  #gameShell.regular-game #gameRoot .dice-slider-block { padding: 0 14px; gap: 44px; }
  #gameShell.regular-game #gameRoot .dice-ticks { margin: 0; }
  #gameShell.regular-game #gameRoot .dice-stats-row { gap: 6px; }
  #gameShell.regular-game #gameRoot .dice-stat { min-width: 0; padding: 8px 5px; }
  #gameShell.regular-game #gameRoot .dice-stat-label { font-size: 11px; }

  /* Mines: the live profit field travels with the board, using the same DOM/value. */
  #gameShell.regular-game #gameRoot .autobet-left + div:has(.mines-right-inner) {
    height: auto;
    padding: 12px;
  }
  #gameShell.regular-game #gameRoot .mines-right-inner { container-type: normal; height: auto; padding: 0; gap: 12px; }
  #gameShell.regular-game #gameRoot .mines-board { width: min(100%, 320px); max-height: none; gap: 6px; margin: 0 auto; }
  #gameShell.regular-game #gameRoot .mines-right-inner > .game-profit-field { max-width: 360px; margin: 0; flex-shrink: 0; }
  #gameShell.regular-game #gameRoot .mines-actions-row { margin: 0; }

  /* Plinko: a proportional board and full, unchanged labels, even with 17 pockets. */
  #gameShell.regular-game #gameRoot .autobet-left + div:has(.plinko-board) { height: clamp(330px, 100vw, 440px); padding: 12px 10px; }
  #gameShell.regular-game #gameRoot .plinko-board { min-height: 0; padding: 16px 4px 0; gap: 10px; }
  #gameShell.regular-game #gameRoot .plinko-pins { min-height: 0; }
  #gameShell.regular-game #gameRoot .plinko-pin { width: var(--plinko-pin-size); height: var(--plinko-pin-size); }
  #gameShell.regular-game #gameRoot .plinko-slots-row { gap: 2px; }
  #gameShell.regular-game #gameRoot .plinko-slot { min-width: 0; min-height: 36px; padding: 4px 0; border-radius: 4px; }
  #gameShell.regular-game #gameRoot .plinko-slot-mult { font-size: 11px; line-height: 1; letter-spacing: -.5px; white-space: nowrap; }
  #gameShell.regular-game #gameRoot .plinko-slots-row:has(.plinko-slot:nth-child(11)) .plinko-slot { min-height: 50px; }
  #gameShell.regular-game #gameRoot .plinko-slots-row:has(.plinko-slot:nth-child(11)) .plinko-slot-mult {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 12px;
    letter-spacing: 0;
  }
  #gameShell.regular-game #gameRoot .plinko-slot:focus .plinko-slot-tooltip { opacity: 1; transform: translate(-50%, 0); }
  #gameShell.regular-game #gameRoot .plinko-slot:nth-child(-n+4) .plinko-slot-tooltip { left: 0; transform: none; }
  #gameShell.regular-game #gameRoot .plinko-slot:nth-last-child(-n+4) .plinko-slot-tooltip { left: auto; right: 0; transform: none; }

  /* Chicken: keep several lanes in view without a tall, empty road surface. */
  #gameShell.regular-game #gameRoot .autobet-left + div:has(.chicken-stage) { height: 280px; padding: 0; }
  #gameShell.regular-game #gameRoot .chicken-track-viewport { touch-action: pan-y; }
  #gameShell.regular-game #gameRoot .autobet-left:has(#chickenGoBtn) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
  #gameShell.regular-game #gameRoot .autobet-left:has(#chickenGoBtn) > :is(.chicken-mode-switch, .autobet-scroll, .chicken-auto-footer) { grid-column: 1 / -1; }
  #gameShell.regular-game #gameRoot .autobet-left > #chickenGoBtn { margin: 0 0 12px; }

  /* Higher/Lower: independent rows prevent history cards covering the active card. */
  #gameShell.regular-game #gameRoot .autobet-left + .hilo-right { height: 320px; }
  #gameShell.regular-game #gameRoot .hilo-table { display: grid; grid-template-rows: 24px minmax(0, 1fr) 54px; gap: 12px; }
  #gameShell.regular-game #gameRoot :is(.hilo-title, .hilo-center, .hilo-history) {
    position: static;
    transform: none;
    width: 100%;
    min-width: 0;
  }
  #gameShell.regular-game #gameRoot .hilo-title { font-size: 16px; line-height: 24px; }
  #gameShell.regular-game #gameRoot .hilo-center { justify-content: center; gap: 8px; }
  #gameShell.regular-game #gameRoot .hilo-current-card-wrap { width: 78px; flex-shrink: 0; }
  #gameShell.regular-game #gameRoot .hilo-card-mult { font-size: 19px; min-height: 20px; }
  #gameShell.regular-game #gameRoot .hilo-history { gap: 6px; overflow-x: auto; justify-content: safe center; align-items: flex-start; pointer-events: auto; padding: 2px; }
  #gameShell.regular-game #gameRoot .hilo-history-card { width: 34px; flex-shrink: 0; }
  #gameShell.regular-game #gameRoot .hilo-action-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #gameShell.regular-game #gameRoot .hilo-choice-btn { min-width: 0; min-height: 86px; padding: 10px 8px; gap: 8px; }
  #gameShell.regular-game #gameRoot .hilo-choice-top { flex-wrap: wrap; justify-content: center; gap: 5px; }
  #gameShell.regular-game #gameRoot .hilo-choice-bottom { flex-wrap: wrap; gap: 4px; }
  #gameShell.regular-game #gameRoot .hilo-choice-bottom span { white-space: normal; overflow-wrap: anywhere; }

  /* Blackjack: compact actions, with enough height for both hands. */
  #gameShell.regular-game #gameRoot .blackjack-action-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  #gameShell.regular-game #gameRoot .blackjack-action-btn { min-height: 68px; aspect-ratio: auto; padding: 6px 3px; gap: 4px; }
  #gameShell.regular-game #gameRoot .blackjack-action-btn img { width: 36px; }
  #gameShell.regular-game #gameRoot .blackjack-card-img-wrap { width: 48px; }
  #gameShell.regular-game #gameRoot .blackjack-cards { max-width: 100%; }

  /* Poker: explicit rows for dealer, board, player and actions. */
  #gameShell.regular-game #gameRoot .autobet-left + .poker-right { height: 420px; }
  #gameShell.regular-game #gameRoot .poker-table {
    display: grid;
    grid-template-rows: 1fr 1fr 1fr 82px;
    gap: 10px;
    --poker-card-w: 48px;
    --poker-board-card-w: clamp(34px, 10vw, 48px);
  }
  #gameShell.regular-game #gameRoot .poker-zone {
    position: static;
    transform: none;
    width: 100%;
    min-height: 0;
    gap: 4px;
    justify-content: center;
  }
  #gameShell.regular-game #gameRoot .poker-zone-label { display: block; color: var(--muted); font-size: 11px; line-height: 1; }
  #gameShell.regular-game #gameRoot .poker-cards { min-height: 0; padding: 0; gap: 6px; }
  #gameShell.regular-game #gameRoot .poker-card-img-wrap { flex-shrink: 0; }
  #gameShell.regular-game #gameRoot .poker-table-actions { position: static; transform: none; width: 100%; gap: 8px; }
  #gameShell.regular-game #gameRoot .poker-table-action { min-height: 0; padding: 8px; gap: 5px; }
  #gameShell.regular-game #gameRoot .poker-table-action-sub,
  #gameShell.regular-game #gameRoot .poker-table-action-pay { white-space: normal; overflow: visible; }
  #gameShell.regular-game #gameRoot .poker-intro { width: 90%; top: 45%; }
  #gameShell.regular-game #gameRoot .poker-table:has(.poker-intro:not(.is-hidden)) .poker-zone-label { visibility: hidden; }

  /* Roulette: transpose the existing numbered grid into a readable portrait table. */
  #gameShell.regular-game #gameRoot .autobet-left + .roulette-right { height: auto; padding: 12px; }
  #gameShell.regular-game #gameRoot .roulette-table-shell { height: auto; display: flex; flex-direction: column; gap: 12px; }
  #gameShell.regular-game #gameRoot .roulette-wheel-zone { height: 186px; padding: 6px 0; flex-shrink: 0; }
  #gameShell.regular-game #gameRoot .roulette-wheel { display: block; width: 174px; min-width: 174px; max-width: 174px; }
  #gameShell.regular-game #gameRoot .roulette-pocket { width: 18px; height: 18px; margin: -9px 0 0 -9px; font-size: 9px; }
  #gameShell.regular-game #gameRoot .roulette-wheel-center { box-shadow: 0 0 0 8px rgba(15,23,42,.94); }
  #gameShell.regular-game #gameRoot .roulette-result-pill { position: absolute; left: 0; top: 50%; transform: translateY(-50%); flex-direction: column; gap: 4px; }
  #gameShell.regular-game #gameRoot .roulette-board-zone { display: flex; flex-direction: column; padding: 0; overflow: visible; }
  #gameShell.regular-game #gameRoot .roulette-board-wrap {
    --roulette-cell: 32px;
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1fr);
    width: min(100%, 480px);
    gap: 4px;
    overflow: visible;
  }
  #gameShell.regular-game #gameRoot .roulette-board { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(14, var(--roulette-cell)); gap: 4px; }
  #gameShell.regular-game #gameRoot .roulette-board .roulette-bet-spot { grid-row: var(--mobile-row) !important; grid-column: var(--mobile-column) !important; font-size: 13px; }
  #gameShell.regular-game #gameRoot .roulette-board .roulette-zero { grid-row: 1 !important; grid-column: 1 / -1 !important; }
  #gameShell.regular-game #gameRoot :is(.roulette-dozens, .roulette-outside) { margin: 36px 0; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  #gameShell.regular-game #gameRoot .roulette-dozens { grid-template-rows: repeat(3, 1fr); }
  #gameShell.regular-game #gameRoot .roulette-outside { grid-template-rows: repeat(6, 1fr); }
  #gameShell.regular-game #gameRoot :is(.roulette-dozens, .roulette-outside) .roulette-bet-spot { font-size: 11px; padding: 4px; line-height: 1.3; }
  #gameShell.regular-game #gameRoot .roulette-chip-badge { width: 27px; height: 27px; }
  #gameShell.regular-game #gameRoot .roulette-table-actions { position: static; margin-top: 8px; gap: 12px; }
  #gameShell.regular-game #gameRoot .roulette-action-btn { min-height: 44px; padding: 8px; }
  #gameShell.regular-game #gameRoot .roulette-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  /* The remaining regular games share the same expanded controls. */
  #gameShell.regular-game #gameRoot .cf-coin-wrap { max-width: 100%; }
  #gameShell.regular-game #gameRoot .rps-choice-grid { gap: 6px; }
  #gameShell.regular-game #gameRoot .rps-arena { inset: 8px 0 auto; height: 190px; display: flex; align-items: center; justify-content: center; gap: 24px; }
  #gameShell.regular-game #gameRoot .rps-card-slot { position: static; transform: none; }
  #gameShell.regular-game #gameRoot .rps-card-wrap { width: 84px; }
  #gameShell.regular-game #gameRoot .rps-history { bottom: 6px; gap: 6px; overflow-x: auto; justify-content: safe center; pointer-events: auto; padding: 2px; }
  #gameShell.regular-game #gameRoot .rps-history-card { flex-shrink: 0; width: 32px; }
  #gameShell.regular-game #gameRoot .rps-choice-icon { max-width: 66px; margin-inline: auto; }
  #gameShell.regular-game #gameRoot .baccarat-play-area { inset: 16px 0 100px; gap: 6px; }
  #gameShell.regular-game #gameRoot .baccarat-cards { min-height: 84px; padding: 0; }
  #gameShell.regular-game #gameRoot .baccarat-card-img-wrap { width: min(13vw, 46px); flex-shrink: 0; margin-left: -10px; }
  #gameShell.regular-game #gameRoot .baccarat-card-img-wrap:first-child { margin-left: 0; }
  #gameShell.regular-game #gameRoot .baccarat-table-bets { bottom: 0; width: 100%; gap: 6px; }
  #gameShell.regular-game #gameRoot .baccarat-table-bet { min-height: 76px; padding: 8px 4px; }
  #gameShell.regular-game #gameRoot :is(.baccarat-table-bet-sub, .baccarat-table-bet-pay) { white-space: normal; overflow: visible; }
}
