/*
 * SR FAMILY BETX LOBBY COMPATIBILITY UI
 * Existing homepage gamecards are not restyled here.
 */

#w9SrBetxLobby,
#w9SrBetxLobby * {
  box-sizing: border-box;
}

#w9SrBetxLobby {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  font-family: Arial, Helvetica, sans-serif;
}

.w9-sr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.72);
}

.w9-sr-lobby-panel {
  position: absolute;
  inset: 3% 3%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #111;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,.45);
}

.w9-sr-lobby-header {
  min-height: 48px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  background: #f2c400;
  color: #111;
}

.w9-sr-lobby-title {
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 16px;
}

.w9-sr-back,
.w9-sr-close {
  height: 44px;
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.w9-sr-lobby-toolbar {
  padding: 8px;
  background: #1b1b1b;
}

.w9-sr-search {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #444;
  border-radius: 4px;
  outline: none;
  background: #fff;
  color: #111;
}

.w9-sr-lobby-content {
  flex: 1;
  overflow: auto;
  padding: 10px;
  background: #151515;
}

.w9-sr-section-title {
  margin: 3px 0 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.w9-sr-provider-grid {
  display: grid;
  grid-template-columns:
    repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.w9-sr-provider-card,
.w9-sr-others-button {
  min-height: 78px;
  padding: 10px;
  border: 1px solid #343434;
  border-radius: 6px;
  background: #222;
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.w9-sr-provider-card:hover,
.w9-sr-others-button:hover {
  border-color: #f2c400;
}

.w9-sr-provider-name {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.w9-sr-provider-card small,
.w9-sr-others-button small {
  display: block;
  margin-top: 6px;
  color: #aaa;
  font-size: 11px;
}

.w9-sr-others-button {
  width: 100%;
  margin-top: 12px;
}

.w9-sr-games-grid {
  display: grid;
  grid-template-columns:
    repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.w9-sr-game-card {
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: #242424;
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.w9-sr-game-card:disabled {
  opacity: .6;
  cursor: wait;
}

.w9-sr-game-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #090909;
}

.w9-sr-game-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.w9-sr-game-title {
  display: block;
  overflow: hidden;
  padding: 7px 7px 2px;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 700;
}

.w9-sr-game-card small {
  display: block;
  overflow: hidden;
  padding: 0 7px 7px;
  color: #aaa;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
}

.w9-sr-load-more {
  display: block;
  min-width: 160px;
  min-height: 38px;
  margin: 16px auto 5px;
  border: 0;
  border-radius: 4px;
  background: #f2c400;
  color: #111;
  cursor: pointer;
  font-weight: 700;
}

.w9-sr-loading,
.w9-sr-error {
  padding: 35px 15px;
  text-align: center;
  color: #fff;
}

.w9-sr-error {
  color: #ffb5b5;
}

@media (max-width: 900px) {
  .w9-sr-lobby-panel {
    inset: 0;
    border-radius: 0;
  }

  .w9-sr-provider-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

  .w9-sr-games-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .w9-sr-lobby-content {
    padding: 6px;
  }

  .w9-sr-game-title {
    font-size: 11px;
  }
}

@media (max-width: 430px) {
  .w9-sr-provider-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .w9-sr-games-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }
}

.w9-sr-site-notice {
  position: fixed;
  top: 55px;
  left: 50%;
  z-index: 2147483646;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 3px;
  background: #202020;
  color: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
  font-size: 12px;
  line-height: 1.35;
}

.w9-sr-site-notice-error {
  border-left: 4px solid #d71920;
}

.w9-sr-site-notice button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

/*
 * W9_DESKTOP_CASINO_SOURCE_GRID_STABILITY_V1
 *
 * Desktop only.
 * Preserve source BIG/SMALL geometry while preventing
 * intrinsic image dimensions from stretching grid rows.
 */
@media screen and (min-width: 769px) {

  .gamehall-wrap-simple {
    grid-template-columns:
      minmax(0,1fr)
      minmax(0,1fr)
      minmax(0,1fr)
      minmax(0,1fr) !important;

    align-items: start !important;
  }

  .gamehall-wrap-simple > a {
    position: relative !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  /*
   * Source:
   * normal/BIG card = 2 columns
   * entrance-half/SMALL = 1 column
   */
  .gamehall-wrap-simple > a:not(.entrance-half) {
    grid-column: span 2 !important;
  }

  .gamehall-wrap-simple > a.entrance-half {
    grid-column: span 1 !important;
  }

  /*
   * The source :before ratio owner determines card height.
   * Image must fill that box, never determine row height.
   */
  .gamehall-wrap-simple > a > img,
  .gamehall-wrap-simple > a .card-img {
    position: absolute !important;

    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;

    width: 100% !important;
    height: 100% !important;

    max-width: none !important;
    max-height: none !important;

    object-fit: cover !important;
    object-position: center center !important;
  }

}
