/* ============================================================
 *  game-cards-t1.css — Theme 1 game / provider cards
 * ------------------------------------------------------------
 *  Game cards: landscape 16:9, 4 per row (desktop/tablet).
 *  Provider cards: portrait 3:4 grid.
 *  Active only when template 2 is NOT enabled (body:not(.tpl2-active)).
 * ========================================================== */

body:not(.tpl2-active) {
  --bg-color-gameimg: var(--runtime-primary, var(--t-primary, #00e7ff));
  --bg-color-gameimg-rgb: var(--runtime-primary-rgb, 0, 231, 255);
}

/* ── Game grid: 4 per row (landscape cards) ─────────────────── */
body:not(.tpl2-active) .game-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px;
  align-items: stretch;
}

/* ── Provider grid: portrait cards ─────────────────────────── */
body:not(.tpl2-active) .provider-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px;
  align-items: stretch;
}

/* ── Game card — landscape 16:9 ─────────────────────────────── */
body:not(.tpl2-active) .game-card {
  position: relative !important;
  display: block !important;
  flex-direction: unset !important;
  align-items: unset !important;
  justify-content: unset !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  cursor: pointer !important;
  isolation: isolate;
  aspect-ratio: 16 / 9 !important;
  border-radius: 14px;
  border: 1px solid rgba(80, 150, 255, .28);
  background: #0a1628;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .38);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
  pointer-events: auto !important;
  text-align: unset !important;
}

/* ── Provider card — portrait 3:4 ─────────────────────────── */
body:not(.tpl2-active) .provider-card {
  position: relative !important;
  display: block !important;
  flex-direction: unset !important;
  align-items: unset !important;
  justify-content: unset !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  cursor: pointer !important;
  isolation: isolate;
  aspect-ratio: 3 / 4 !important;
  border-radius: 14px;
  border: 1px solid rgba(80, 150, 255, .28);
  background: #0a1628;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .38);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
  pointer-events: auto !important;
  text-align: unset !important;
}

@supports not (aspect-ratio: 1 / 1) {
  body:not(.tpl2-active) .game-card {
    height: 0;
    padding-bottom: 56.25%;
  }
  body:not(.tpl2-active) .provider-card {
    height: 0;
    padding-bottom: 133.333%;
  }
}

body:not(.tpl2-active) .game-card:hover,
body:not(.tpl2-active) .provider-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 200, 80, .5);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .55),
              0 0 26px rgba(var(--bg-color-gameimg-rgb), .18);
}

/* ── Cover image (fills the whole card) ────────────────────── */
body:not(.tpl2-active) .game-thumb::before,
body:not(.tpl2-active) .provider-cover::before {
  content: none !important;
  display: none !important;
}

body:not(.tpl2-active) .game-thumb,
body:not(.tpl2-active) .provider-cover {
  position: absolute !important;
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  aspect-ratio: unset !important;
  flex-shrink: unset !important;
  display: block !important;
  z-index: 1;
  overflow: hidden;
  border-radius: inherit;
  background: #0a1628 !important;
  background-image: none !important;
  pointer-events: none !important;
}

body:not(.tpl2-active) .game-thumb img,
body:not(.tpl2-active) .provider-cover img {
  position: absolute !important;
  inset: 0;
  z-index: 2;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center;
  filter: none !important;
  transition: transform .35s ease;
  user-select: none;
  -webkit-user-drag: none;
}

body:not(.tpl2-active) .game-card:hover .game-thumb img,
body:not(.tpl2-active) .provider-card:hover .provider-cover img {
  transform: scale(1.05);
}

body:not(.tpl2-active) .game-thumb i,
body:not(.tpl2-active) .provider-cover i,
body:not(.tpl2-active) .provider-fallback-icon {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  font-size: 34px;
  color: var(--bg-color-gameimg);
  text-shadow: 0 0 18px rgba(var(--bg-color-gameimg-rgb), .55);
}

/* ── Bottom gradient + title ───────────────────────────────── */
body:not(.tpl2-active) .game-info,
body:not(.tpl2-active) .provider-info {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  z-index: 20;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px;
  padding: 20px 10px 8px !important;
  text-align: left;
  align-items: flex-start;
  background: linear-gradient(to top,
              rgba(0, 0, 0, .88) 0%,
              rgba(0, 0, 0, .5) 55%,
              transparent 100%) !important;
  flex-shrink: unset !important;
  pointer-events: none !important;
}

body:not(.tpl2-active) .game-info b,
body:not(.tpl2-active) .provider-info .provider-name {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .7);
}

body:not(.tpl2-active) .game-info span,
body:not(.tpl2-active) .provider-info .provider-enter {
  display: block !important;
  width: auto !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, .78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Hover wash + play button ──────────────────────────────── */
body:not(.tpl2-active) .card-hover {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: background .3s ease;
  pointer-events: none;
}

body:not(.tpl2-active) .game-card:hover .card-hover,
body:not(.tpl2-active) .provider-card:hover .card-hover {
  background: rgba(var(--bg-color-gameimg-rgb), .35);
}

body:not(.tpl2-active) .card-play {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  border: 2px solid #fff;
  color: #fff;
  font-size: 20px;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .3s ease, transform .3s ease;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .5);
}

body:not(.tpl2-active) .card-play i { margin-left: 3px; }

body:not(.tpl2-active) .game-card:hover .card-play,
body:not(.tpl2-active) .provider-card:hover .card-play {
  opacity: 1;
  transform: scale(1);
}

body:not(.tpl2-active) .game-badge,
body:not(.tpl2-active) .provider-badge {
  z-index: 45;
}

/* ── Responsive ────────────────────────────────────────────── */
/* Tablet / mobile: game grid 2 cols landscape; provider 3 cols */
@media (max-width: 1023px) {
  body:not(.tpl2-active) .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
  body:not(.tpl2-active) .provider-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  body:not(.tpl2-active) .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }
  body:not(.tpl2-active) .provider-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px;
  }
  body:not(.tpl2-active) .game-card,
  body:not(.tpl2-active) .provider-card {
    border-radius: 12px;
  }
  body:not(.tpl2-active) .game-info b {
    font-size: 11px;
  }
  body:not(.tpl2-active) .game-info span {
    font-size: 8.5px;
  }
  body:not(.tpl2-active) .card-play {
    width: 48px;
    height: 48px;
    font-size: 16px;
  }
}
