body.launcher, #coverScr, #chapScr, #listScr {
  background: linear-gradient(135deg, #e8f5e9 0%, #e0f2fe 50%, #f1f8e9 100%) !important;
  background-image: none !important;
}
#gameScr {
  background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%) !important;
  background-image: none !important;
}
.hub-title-section {
  background: transparent !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}
.hub-logo-emoji {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(38px, 8vw, 56px);
  margin-bottom: 6px;
}
#gameScr .card-shell {
  max-width: 960px !important;
  height: calc(100dvh - 30px) !important;
  display: flex !important;
  flex-direction: column !important;
}
#gameScr .gbody {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  padding: 10px 16px !important;
  overflow-y: auto !important;
}
#gameScr .qbig {
  font-size: clamp(17px, 2.1vw, 22px) !important;
  margin: 0 !important;
  text-align: center;
  font-weight: 800;
  color: #1e293b;
}
#gameScr .qsub {
  font-size: 13.5px !important;
  margin: 0 !important;
  color: #64748b;
}
#gameScr .qimg {
  max-height: min(24vh, 155px) !important;
  max-width: min(85%, 400px) !important;
  object-fit: contain;
  margin: 2px auto !important;
  border-radius: 14px;
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  border: 2px solid #e2e8f0;
}
#gameScr .cards3 {
  width: 100% !important;
  max-width: 780px !important;
  margin: 4px auto 0 !important;
  gap: 10px !important;
  display: grid !important;
}
#gameScr .cards3 .opt.txt,
#gameScr .cards3:has(> .opt:nth-child(2):last-child) .opt.txt {
  min-height: 68px !important;
  padding: 10px 14px 38px !important;
  border-radius: 18px !important;
}
#gameScr .opt .otext {
  font-size: 16px !important;
  line-height: 1.35 !important;
  color: #1e293b !important;
}
#gameScr .cards3 .opt.txt .radio,
#gameScr .cards3:has(> .opt:nth-child(2):last-child) .opt.txt .radio {
  width: 22px !important;
  height: 22px !important;
  bottom: 8px !important;
}
.book-card-img {
  width: 100%;
  height: 100%;
  max-height: 80px;
  object-fit: contain;
  border-radius: 12px;
  background: white;
  padding: 4px;
}
.chapter-book-img {
  width: 180px;
  height: 90px;
  object-fit: contain;
  border-radius: 16px;
  background: white;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* GK-6 keeps the illustrated Science launcher and the reference chapter grid. */
body.launcher,
#coverScr,
#chapScr,
#listScr {
  background-color: #bde8fa !important;
  background-image: url('../assets/ui/chapter-menu-bg.png') !important;
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

.launcher .bg-spheres {
  display: none !important;
}

#chapScr .hub-title-section {
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  padding: 0;
}

#chapCards {
  width: min(1320px, calc(100% - 24px));
  max-width: 1320px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 22px;
}

#chapCards .pcard {
  min-height: 108px;
}

/* Without a book image, keep the question group near the top instead of vertically floating. */
#gameScr .gbody:not(:has(.qimg)) {
  justify-content: flex-start !important;
  padding-top: 14px !important;
  gap: 12px !important;
}

@media (max-width: 1000px) {
  #chapCards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #chapCards {
    width: min(460px, calc(100% - 18px));
    grid-template-columns: 1fr;
    gap: 13px;
  }

  #chapCards .pcard {
    min-height: 88px;
  }
}

.hub-sub-badge, #listSubBadge {
  display: none !important;
}

@media (max-width: 640px) {
  #gameScr .cards3,
  .cards3 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 10px !important;
    width: 100% !important;
    max-width: 440px !important;
    margin: 0 auto !important;
    justify-content: center !important;
  }

  /* Exactly 3 options: 2 on top, 1 centered underneath with matching width */
  #gameScr .cards3 .opt:nth-child(3):last-child,
  .cards3 .opt:nth-child(3):last-child,
  #gameScr .cards3:has(> .opt) .opt:nth-child(3):last-child {
    grid-column: 1 / -1 !important;
    width: calc(50% - 5px) !important;
    justify-self: center !important;
  }

  #gameScr .cards3:has(> .opt:nth-child(2):last-child),
  .cards3:has(> .opt:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 400px !important;
    margin: 0 auto !important;
  }

  #gameScr .cards3 .opt.txt,
  #gameScr .cards3:has(> .opt:nth-child(2):last-child) .opt.txt,
  .opt.txt {
    padding: 12px 8px 38px !important;
    min-height: 86px !important;
    border-radius: 18px !important;
    border-width: 3px !important;
    border-bottom-width: 7px !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  #gameScr .opt .otext,
  #gameScr .cards3 .opt.txt .otext,
  .opt .otext {
    font-size: clamp(14px, 3.8vw, 16.5px) !important;
    padding: 0 4px !important;
    line-height: 1.25 !important;
    text-align: center !important;
  }

  #gameScr .cards3 .opt.txt .radio,
  #gameScr .cards3:has(> .opt:nth-child(2):last-child) .opt.txt .radio,
  .radio {
    width: 24px !important;
    height: 24px !important;
    bottom: 8px !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    transform: translateX(-50%) !important;
  }
}
