:root {
  --sis-maroon: #851013;
  --sis-maroon-dark: #5a0a0c;
  --sis-maroon-deep: #3d0607;
  --sis-maroon-light: #a8181c;
  --sis-gold: #d4a017;
  --sis-gold-bright: #f59e0b;
  --sis-gold-dark: #b45309;
  --sis-cream: #fff8f0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Arial, sans-serif !important;
  letter-spacing: normal !important;
  text-shadow: none !important;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  background-image: url('../image/clean-plain-bg.webp?v=1') !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

body.biology-page {
  background-image: url('../image/clean-plain-bg.webp?v=1') !important;
}

body.chemistry-page {
  background-image: url('../image/clean-plain-bg.webp?v=1') !important;
}

body.physics-page {
  background-image: url('../image/clean-plain-bg.webp?v=1') !important;
}

body.geography-page {
  background-image: url('../image/clean-plain-bg.webp?v=1') !important;
}

#chapScr * {
  font-family: "Segoe UI", Arial, sans-serif !important;
  letter-spacing: normal !important;
  text-shadow: none !important;
}

.scr {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}

#chapScr.on {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

#chapScr .hub {
  padding-top: 12px;
  padding-bottom: 6vh;
}

.hub-title-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 16px !important;
  width: 100%;
}

.hub-main-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 9px 34px 12px !important;
  margin: 0 !important;
  font-family: 'Fredoka', sans-serif !important;
  font-weight: 800 !important;
  font-size: clamp(19px, 2.6vw, 25px) !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
  color: #ffffff !important;
  background: linear-gradient(180deg, #b91c1c 0%, #851013 52%, #5a0a0c 100%) !important;
  border: 3.5px solid #f59e0b !important;
  border-bottom: 7px solid #3d0607 !important;
  border-radius: 22px !important;
  box-shadow: 0 10px 22px rgba(61, 6, 7, 0.36), inset 0 2px 4px rgba(255, 255, 255, 0.3) !important;
  text-shadow: 0 3px 0 rgba(45, 4, 5, 0.55) !important;
  letter-spacing: 0.8px !important;
  text-transform: uppercase;
}

/* Bottom Back, Home & Next Navigation Bar (Desktop + All Mobile Views) */
.hub-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 22px;
  gap: 12px;
}

.hub-nav-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.hub-nav-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 24px 11px !important;
  font-family: 'Fredoka', sans-serif !important;
  font-weight: 700 !important;
  font-size: clamp(15px, 1.5vw, 18px) !important;
  white-space: nowrap !important;
  color: #ffffff !important;
  background: linear-gradient(180deg, #b91c1c 0%, #851013 52%, #5a0a0c 100%) !important;
  border: 3px solid #f59e0b !important;
  border-bottom: 6px solid #3d0607 !important;
  border-radius: 18px !important;
  box-shadow: 0 8px 18px rgba(61, 6, 7, 0.34), inset 0 2px 4px rgba(255, 255, 255, 0.3) !important;
  text-shadow: 0 2px 0 rgba(45, 4, 5, 0.55) !important;
  letter-spacing: 0.6px !important;
  text-transform: uppercase;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
}

.hub-nav-btn span {
  font-family: 'Fredoka', sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: 0.6px !important;
  text-shadow: 0 2px 0 rgba(45, 4, 5, 0.55) !important;
}

.hub-nav-btn svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 0 rgba(45, 4, 5, 0.55));
}

.hub-nav-btn:hover {
  transform: translateY(-3px) !important;
  border-color: #fde68a !important;
  box-shadow: 0 12px 24px rgba(133, 16, 19, 0.4), 0 0 0 2px rgba(245, 158, 11, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
}

.hub-nav-btn:active {
  transform: translateY(2px) scale(0.97) !important;
}

#chapCards {
  --bs-gutter-x: 18px;
  --bs-gutter-y: 18px;
  justify-content: center;
}

/* Attractive Vertical Chapter Card: Image on Top + Original Pill Section Below */
#chapCards .pcard.chapter-card {
  --theme-c1: #851013;
  --theme-c2: #5a0a0c;
  padding: 7px !important;
  color: #1e293b !important;
  background: linear-gradient(180deg, #ffffff 0%, #fff8f3 100%) !important;
  border: 2.5px solid #851013 !important;
  border-bottom: 6px solid #5a0a0c !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 22px rgba(61, 6, 7, 0.2), inset 0 2px 4px #ffffff !important;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

#chapCards .pcard.chapter-card:hover {
  transform: translateY(-5px) !important;
  border-color: #d97706 !important;
  border-bottom-color: #851013 !important;
  box-shadow: 0 16px 30px rgba(133, 16, 19, 0.3), 0 0 0 2px rgba(245, 158, 11, 0.35), inset 0 2px 4px #ffffff !important;
}

#chapCards .pcard.chapter-card:active {
  transform: scale(0.98) translateY(2px) !important;
}

/* Top Chapter Image Box */
#chapCards .pcard.chapter-card .card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2.16 / 1;
  height: auto;
  border-radius: 14px;
  overflow: hidden;
  background: #3d0607;
  border: 1.5px solid rgba(133, 16, 19, 0.18);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.18);
}

#chapCards .pcard.chapter-card .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center center;
  display: block;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#chapCards .pcard.chapter-card:hover .card-img-wrap img {
  transform: scale(1.07);
}

/* Subtle bottom gradient overlay on image for depth */
#chapCards .pcard.chapter-card .card-img-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, transparent 45%, rgba(61, 6, 7, 0.28) 100%);
  pointer-events: none;
}

/* Chapter Tag Pill in Top-Left of Image */
#chapCards .pcard.chapter-card .ch-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 2px 9px 3px;
  font-family: 'Fredoka', sans-serif !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  color: #ffffff !important;
  background: linear-gradient(180deg, #b91c1c 0%, #851013 100%) !important;
  border: 1.5px solid #fde68a !important;
  border-radius: 999px !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  letter-spacing: 0.5px !important;
}

/* Bottom Chapter Title + Arrow Bar (Directly Below the Image) */
#chapCards .pcard.chapter-card .card-bar {
  gap: 10px !important;
  min-height: 52px !important;
  padding: 8px 10px 4px 10px !important;
  margin-top: 2px;
  background: transparent;
  justify-content: center;
}

#chapCards .pcard.chapter-card .tx {
  min-width: 0 !important;
  align-items: center !important;
  text-align: center !important;
}

#chapCards .pcard.chapter-card .tt {
  font-family: 'Fredoka', sans-serif !important;
  font-weight: 700 !important;
  font-size: clamp(16px, 1.45vw, 19px) !important;
  line-height: 1.25 !important;
  color: #1e293b !important;
  text-align: center !important;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#chapCards .pcard.chapter-card:hover .tt {
  color: #851013 !important;
}

@media (max-width: 991.98px) {
  #chapScr .hub {
    padding-top: 16px;
    padding-bottom: 40px;
  }
}

@media (max-width: 767.98px) {
  .hub-title-section {
    margin-bottom: 14px !important;
  }

  .hub-main-badge {
    padding: 7px 22px 9px !important;
    font-size: clamp(13.5px, 4vw, 16.5px) !important;
    letter-spacing: 0.5px !important;
    border-width: 2.5px !important;
    border-bottom-width: 5px !important;
    border-radius: 16px !important;
    white-space: nowrap !important;
    max-width: 96%;
  }
}

@media (max-width: 575.98px) {
  .hub-nav-bar {
    margin-top: 18px;
    gap: 8px;
  }

  .hub-nav-right {
    gap: 8px;
  }

  .hub-nav-btn {
    padding: 7px 14px 9px !important;
    font-size: 13px !important;
    border-radius: 14px !important;
    gap: 6px;
  }

  .hub-nav-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* === UMA v32 FULL RESPONSIVE ENHANCEMENTS (MOBILE, TABLET, LAPTOP & DESKTOP) === */
#chapCards .pcard.chapter-card .card-img-wrap img {
  object-fit: cover !important;
  object-position: center center !important;
}

@media (min-width: 992px) {
  #chapScr .hub {
    max-width: min(1380px, 95vw) !important;
  }
}

@media (max-height: 860px) and (min-width: 992px) {
  #chapScr .hub {
    padding-top: 8px !important;
    padding-bottom: 14px !important;
  }
  .hub-title-section {
    margin-bottom: 10px !important;
  }
  .hub-main-badge {
    padding: 6px 26px 8px !important;
    font-size: clamp(16px, 1.9vw, 21px) !important;
  }
  #chapCards {
    --bs-gutter-x: 14px !important;
    --bs-gutter-y: 10px !important;
  }
  #chapCards .pcard.chapter-card {
    padding: 5px !important;
    border-radius: 15px !important;
  }
  #chapCards .pcard.chapter-card .card-img-wrap {
    aspect-ratio: 16 / 9.2 !important;
  }
  #chapCards .pcard.chapter-card .card-bar {
    min-height: 38px !important;
    padding: 5px 8px 2px !important;
  }
  #chapCards .pcard.chapter-card .tt {
    font-size: clamp(14px, 1.25vw, 17px) !important;
  }
  .hub-nav-bar {
    margin-top: 12px !important;
  }
  .hub-nav-btn {
    padding: 6px 18px 8px !important;
    font-size: 14.5px !important;
  }
}

@media (max-width: 991.98px) {
  body,
  body.launcher {
    background-attachment: scroll !important;
  }
  #chapScr.on {
    justify-content: flex-start !important;
  }
  #chapScr .hub {
    max-width: 100% !important;
    padding: 18px 16px 32px !important;
  }
  #chapCards > [class*="col-"] {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

@media (max-width: 575.98px) {
  #chapScr .hub {
    padding: 14px 12px 24px !important;
  }
  .hub-main-badge {
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.22 !important;
    padding: 7px 18px 9px !important;
    font-size: clamp(15px, 4.4vw, 18.5px) !important;
  }
  #chapCards {
    --bs-gutter-x: 10px !important;
    --bs-gutter-y: 10px !important;
  }
  #chapCards > .col-lg-4 {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  #chapCards > .col-lg-3 {
    width: 50% !important;
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
  #chapCards .pcard.chapter-card {
    padding: 5px !important;
    border-radius: 15px !important;
    border-width: 2px !important;
    border-bottom-width: 4.5px !important;
  }
  #chapCards .pcard.chapter-card .card-img-wrap {
    border-radius: 10px !important;
  }
  #chapCards .pcard.chapter-card .card-bar {
    min-height: 40px !important;
    padding: 6px 6px 4px !important;
  }
  #chapCards .pcard.chapter-card .tt {
    font-size: clamp(13px, 3.6vw, 15.5px) !important;
  }
  .hub-nav-bar {
    flex-wrap: wrap !important;
    margin-top: 16px !important;
    gap: 8px !important;
  }
  .hub-nav-right {
    gap: 6px !important;
  }
  .hub-nav-btn {
    padding: 7px 14px 9px !important;
    font-size: 12.5px !important;
    border-radius: 12px !important;
    border-width: 2px !important;
    border-bottom-width: 4px !important;
    gap: 5px !important;
  }
  .hub-nav-btn svg {
    width: 15px !important;
    height: 15px !important;
  }
}

@media (max-width: 399.98px) {
  #chapCards > [class*="col-"] {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 360px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

@media (max-width: 380px) {
  .hub-nav-bar {
    flex-wrap: nowrap !important;
    gap: 5px !important;
  }
  .hub-nav-right {
    gap: 5px !important;
  }
  .hub-nav-btn {
    padding: 6px 10px 8px !important;
    font-size: 11.5px !important;
    gap: 4px !important;
  }
  .hub-nav-btn svg {
    width: 13.5px !important;
    height: 13.5px !important;
  }
}
