/*
 * Tablet / small-laptop game summary layout.
 *
 * Keep Players + Current Contract together on the left and the two score cards
 * together on the right. This deliberately uses the previously empty middle
 * space so the Players card has enough width for two readable team columns.
 */
@media (min-width: 901px) and (max-width: 1199px) {
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) {
    display: grid !important;
    grid-template-columns: minmax(500px, 1.5fr) minmax(330px, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 140px !important;
    margin: 0 0 14px !important;
    align-items: stretch !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) > .col-md-6 {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Left summary group: give Players the room that was previously empty in
     the center of the header, while keeping Current Contract beside it. */
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) > .col-md-6:first-child {
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(280px, 1.32fr) minmax(205px, .9fr) !important;
    gap: 12px !important;
    align-items: stretch !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) > .col-md-6:first-child > .row {
    display: none !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster {
    position: relative !important;
    inset: auto !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    overflow: hidden !important;
    box-shadow: 0 16px 36px rgba(0,0,0,.18) !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster__header {
    margin-bottom: 8px !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster__eyebrow {
    display: none !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster__title {
    font-size: 18px !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster__teams {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster__team {
    min-width: 0 !important;
    padding: 7px !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster__team-title {
    margin-bottom: 5px !important;
    font-size: 11px !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster__team-list {
    gap: 3px !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster__player {
    height: 22px !important;
    min-width: 0 !important;
    padding: 2px 5px !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster__name {
    min-width: 0 !important;
    font-size: 11px !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster__seat {
    width: 22px !important;
    font-size: 9px !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster__turn,
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster__you {
    font-size: 8px !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .winning-bid-summary {
    position: relative !important;
    inset: auto !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    width: 100% !important;
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
    margin: 0 !important;
    padding: 16px 14px !important;
    box-sizing: border-box !important;
    border: 1px solid #2b3d4d !important;
    border-radius: 14px !important;
    background: linear-gradient(145deg,#111f2b,#0c1821) !important;
    box-shadow: 0 16px 36px rgba(0,0,0,.18) !important;
    color: #eef3f7 !important;
    overflow: hidden !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .winning-bid-summary[hidden] {
    display: none !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .winning-bid-summary__eyebrow {
    margin: 0 0 7px !important;
    color: #8fa0ae !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    font-weight: 800 !important;
    letter-spacing: .10em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .winning-bid-summary__team {
    color: #fff !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    white-space: normal !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .winning-bid-summary__detail {
    margin: 7px 0 0 !important;
    color: #e6b84b !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    font-weight: 700 !important;
    white-space: normal !important;
  }

  /* Right summary group: score cards share the remaining width evenly. */
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) > .col-md-6:last-child {
    display: block !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) > .col-md-6:last-child > .row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
    margin: 0 !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .team-1-bg,
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .team-2-bg {
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 14px !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .team-1-bg > .row,
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .team-2-bg > .row {
    visibility: hidden !important;
    pointer-events: none !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .mock-score {
    visibility: visible !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 5 !important;
    display: grid !important;
    grid-template-rows: 34px 1fr !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 10px 10px 12px !important;
    pointer-events: none !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .mock-score__team {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    color: #f6f8fa !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .mock-score__stats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 0 !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .mock-score__stat {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    min-width: 0 !important;
    height: 72px !important;
    padding: 0 4px !important;
    color: #bdc9d4 !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .mock-score__stat + .mock-score__stat {
    padding-left: 10px !important;
    border-left: 1px solid rgba(255,255,255,.18) !important;
  }

  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .mock-score__value {
    display: block !important;
    margin-top: 6px !important;
    color: #fff !important;
    font-size: 28px !important;
    line-height: .9 !important;
    font-weight: 700 !important;
  }
}

/* Compact desktop (992-1199px) has older, more-specific rules in
   bid-summary.css and responsive-compact-desktop.css that try to collapse the
   Current Contract into a 25px strip inside the roster. Reassert this file's
   intended four-card summary at equal height with enough specificity to win. */
@media (min-width: 992px) and (max-width: 1199px) {
  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) {
    display: grid !important;
    grid-template-columns: minmax(500px, 1.5fr) minmax(330px, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
    margin: 0 0 14px !important;
    align-items: stretch !important;
  }

  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) > .col-md-6 {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: stretch !important;
  }

  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) > .col-md-6:first-child {
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(280px, 1.32fr) minmax(205px, .9fr) !important;
    gap: 12px !important;
    align-items: stretch !important;
    overflow: visible !important;
  }

  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .player-roster {
    position: relative !important;
    inset: auto !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
    margin: 0 !important;
    padding: 12px 14px !important;
  }

  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.winning-bid-summary:not([hidden])) .player-roster__header {
    display: flex !important;
    margin-bottom: 8px !important;
  }

  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .winning-bid-summary {
    position: relative !important;
    inset: auto !important;
    z-index: 1 !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 0 !important;
    width: 100% !important;
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
    margin: 0 !important;
    padding: 16px 14px !important;
    box-sizing: border-box !important;
    border: 1px solid #2b3d4d !important;
    border-radius: 14px !important;
    background: linear-gradient(145deg,#111f2b,#0c1821) !important;
    box-shadow: 0 16px 36px rgba(0,0,0,.18) !important;
    overflow: hidden !important;
  }

  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .winning-bid-summary__eyebrow {
    flex: 0 0 auto !important;
    margin: 0 0 7px !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    letter-spacing: .10em !important;
    white-space: nowrap !important;
  }

  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .winning-bid-summary__team {
    min-width: 0 !important;
    overflow: visible !important;
    text-overflow: clip !important;
    color: #fff !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .winning-bid-summary__detail {
    flex: 0 0 auto !important;
    margin: 7px 0 0 !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
  }

  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) > .col-md-6:last-child,
  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) > .col-md-6:last-child > .row,
  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .team-1-bg,
  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .team-2-bg {
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
  }

  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) > .col-md-6:last-child > .row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    align-items: stretch !important;
  }

  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .mock-score {
    grid-template-rows: 34px 1fr !important;
    padding: 10px 10px 12px !important;
  }

  html body[data-pepper-game-started="true"]
  #pepper-app > div > .row:first-child:has(.player-roster:not([hidden])) .mock-score__value {
    margin-top: 6px !important;
    font-size: 28px !important;
  }
}
