.qp-games-grid{
  position: relative;
  padding: 80px 0;
  --qp-section-bg: var(--color-surface, #001220);
  background: var(--qp-section-bg);
  overflow: visible;
}

.qp-games-grid__title{
  margin: 0 0 10px;
  text-align: left;
  font-size: clamp(28px, 3.2vw, 48px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 20px;
}

.qp-games-grid__description{
  margin: 0 0 42px;
  text-align: left;
  max-width: 70ch;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  line-height: 1.65;  
}


.qp-games-grid__grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 1024px){
  .qp-games-grid__grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px){
  .qp-games-grid__grid {
    grid-template-columns: 1fr;
  }
  .qp-game-card__media{
    height: 260px;
  }

  .qp-game-card__content{
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .qp-game-card__btn{
    width: 100%;
  }
}

.qp-game-card{
  position: relative;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid rgba(255, 111, 97, 0.14);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
}

.qp-game-card:hover,
.qp-game-card:focus-within{
  border-color: rgba(255, 111, 97, 0.34);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 16px 36px rgba(0,0,0,0.24);
}

.qp-game-card__media{
  position: relative;
  width: 100%;
  height: 380px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #151a22;
}

.qp-game-card__media::after{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 18, 32, 0.08) 0%, rgba(0, 18, 32, 0.35) 55%, rgba(0, 18, 32, 0.88) 100%);
  pointer-events: none;
}

.qp-game-card__title{
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  margin: 0;
  padding: 16px 18px;
  width: 100%;
  box-sizing: border-box;
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  border-top: 2px solid var(--color-primary, #FF6F61);
  background: rgba(0, 18, 32, 0.55);
}

.qp-game-card__content{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 111, 97, 0.12);
  flex: 1 1 auto;
}

.qp-game-card__desc{
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.5;
}

.qp-game-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0;
  padding: 12px 20px;
  border-radius: 0;
  color: var(--e-global-color-19a9565, #ffffff);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  border: 0;
  background-color: var(--qp-btn-bg, #ea4670);
  background-image: none;
  text-transform: uppercase;
  min-width: 120px;
  letter-spacing: 0.04em;
}

.qp-game-card__btn:focus,
.qp-game-card__btn:focus-visible{
  outline: none;
}

.qp-games-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.qp-games-modal[hidden]{
  display: none;
}

.qp-games-modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}

.qp-games-modal__dialog{
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  border-radius: 0;
  padding: 24px;
  background: var(--color-surface, #001220);
  box-shadow: 0 24px 70px rgba(0,0,0,0.45);
}

.qp-games-modal__close{
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.qp-games-modal__title{
  margin: 0 36px 18px 0;
  color: #fff;
  font-size: 22px;
  font-weight: 600;
}

.qp-games-modal__body{
  aspect-ratio: 16 / 9;
  min-height: 380px;
  width: 100%;
  max-height: 70vh;
}

.qp-games-modal__body iframe{
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  border-radius: 12px;
  background: #000;
}

body.qp-games-modal-open{
  overflow: hidden;
}

@media (max-width: 767px){
  .qp-games-grid__title,
  .qp-games-grid__description{
    text-align: left;
  }

  .qp-games-modal{
    padding: 16px;
  }

  .qp-games-modal__dialog{
    padding: 18px;
  }

  .qp-games-modal__title{
    font-size: 20px;
  }

  .qp-games-modal__body{
    aspect-ratio: auto;
    height: 70vh;
    max-height: 70vh;
    min-height: 320px;
  }

  /* On touch devices: keep CTA visible (no hover). */
  .qp-game-card__overlay{
    opacity: 1;
  }

  .qp-game-card__content{
    opacity: 1;
    transform: translateY(0);
  }
}

