@charset "utf-8";

/* Mobile Scroll Fix - Perbaikan scrolling dengan min-width mobile */

/* Reset semua yang bermasalah */
* {
  box-sizing: border-box;
}

/* HTML container untuk desktop */
html {
  margin: 0;
  padding: 0;
  background: #e8eaf0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Body dengan min-width mobile */
body {
  margin: 0 auto;
  padding: 0;
  min-width: 375px;
  max-width: 480px;
  width: 100%;
  min-height: auto;
  height: auto;
  background: #fff;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Desktop styling */
@media (min-width: 481px) {
  html {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0;
    background: linear-gradient(135deg, #e8eaf0 0%, #d4d8e0 100%);
  }

  body {
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.25);
    overflow: auto;
    max-height: calc(100vh - 40px);
  }
}

/* Mobile styling */
@media (max-width: 480px) {
  body {
    min-width: 100%;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
  }

  .footer {
    width: 100%;
    max-width: 100%;
    left: 0;
    transform: none;
  }
}

/* Body content - bisa scroll dengan space untuk footer */
.body-content {
  width: 100%;
  min-height: auto;
  height: auto;
  padding: 0 0 70px 0;
  margin: 0;
  position: relative;
  overflow: visible;
}

/* Header - tidak fixed */
.topnav {
  position: relative;
  top: 0;
  width: 100%;
  z-index: 100;
  margin: 0;
  padding: 0;
}

/* Footer - fixed di bawah */
.footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  height: 100px;
  max-width: 480px;
  z-index: 1000;
  margin: 0;
  padding: 0;
  background: #fff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  border-top: 1px solid #e0e0e0;
}

/* Footer links styling */
.footer a {
  display: block;
  padding: 0.2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.footer a:hover {
  background: rgba(83, 182, 197, 0.1);
}

.footer a.on {
  background: linear-gradient(135deg, #53b6c5, #6aebff);
  color: #fff;
}

/* Semua content sections */
.carousel2,
.subject,
.com-module,
.category-con,
.friendly-link {
  width: 100%;
  margin: 0.2rem 0;
  padding: 0.3rem;
  position: relative;
  overflow: visible;
}

/* Enhanced subject section styling */
.subject {
  background: #fff;
  border-radius: 0.3rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  margin: 0.3rem;
  overflow: hidden;
}

.subject .module-title {
  background: linear-gradient(135deg, #53b6c5, #6aebff);
  color: white;
  padding: 0.4rem;
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subject .module-title h2 {
  margin: 0;
  font-size: 0.36rem;
  font-weight: 600;
}

.subject .module-title .view-more {
  background: rgba(255,255,255,0.2);
  color: white;
  padding: 0.15rem 0.3rem;
  border-radius: 0.15rem;
  text-decoration: none;
  font-size: 0.26rem;
  transition: all 0.3s ease;
}

.subject .module-title .view-more:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.05);
}

/* Game list layout */
.game-list {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  padding: 0.3rem;
  margin: 0;
}

.game-list .game-item.vertical {
  width: calc(25% - 0.2rem);
  margin: 0.1rem;
  flex-shrink: 0;
  background: #fff;
  border-radius: 0.2rem;
  padding: 0.2rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.game-list .game-item.vertical:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.game-list .game-item.vertical .game-icon {
  width: 100%;
  height: 1.2rem;
  margin-bottom: 0.15rem;
  border-radius: 0.15rem;
  overflow: hidden;
}

.game-list .game-item.vertical .game-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.15rem;
}

.game-list .game-item.vertical .game-name {
  font-size: 0.24rem;
  color: #333;
  margin-bottom: 0.15rem;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-list .game-item.vertical .down-btn {
  background: linear-gradient(135deg, #53b6c5, #6aebff);
  color: white;
  border: none;
  padding: 0.12rem 0.25rem;
  border-radius: 0.12rem;
  font-size: 0.22rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(83, 182, 197, 0.3);
}

.game-list .game-item.vertical .down-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(83, 182, 197, 0.4);
}

/* Horizontal game items */
.mo-c {
  width: 100%;
  padding: 0;
}

.game-item.hori {
  width: 100%;
  margin: 0.2rem 0;
  padding: 0 0.3rem;
}

/* Category navigation */
.category-con {
  display: flex;
  justify-content: space-around;
  padding: 0.3rem;
  background: #fff;
}

.category-con a {
  flex: 1;
  margin: 0 0.1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Module titles */
.module-title {
  padding: 0.3rem;
  width: 100%;
}

/* Carousel */
.carousel2 {
  background: #fff;
  padding: 0.3rem;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Fix banner container that has inline styles */
.carousel2 .banner {
  width: 100% !important;
  height: auto !important;
  overflow: visible !important;
}

/* Fix banner ul that has inline styles */
.carousel2 .banner ul {
  width: 100% !important;
  height: auto !important;
  position: relative !important;
  left: 0 !important;
  overflow: visible !important;
}

/* Fix slider items */
.carousel2 .slider-item {
  width: 100% !important;
  float: none !important;
  display: block !important;
}

.carousel2 .swiper-container-index2 {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  height: auto !important;
  margin: 0 auto;
  box-sizing: border-box !important;
}

.carousel2 .swiper-wrapper {
  width: 100% !important;
  height: auto !important;
}

.carousel2 .swiper-slide {
  width: 100% !important;
  height: auto !important;
  box-sizing: border-box !important;
}

/* Override any inline styles that might be applied by JavaScript */
.carousel2 .banner[style] {
  width: 100% !important;
  height: auto !important;
}

.carousel2 .banner ul[style] {
  width: 100% !important;
  height: auto !important;
  left: 0 !important;
}

.carousel2 .slider-item[style] {
  width: 100% !important;
  float: none !important;
}

/* Ensure carousel navigation doesn't interfere */
.carousel2.carousel-nav .banner,
.carousel2.carousel-nav .banner ul,
.carousel2.carousel-nav .slider-item {
  width: 100% !important;
}

/* Disable unslider behavior and make it static */
.carousel2 .banner#b04 {
  width: 100% !important;
  height: auto !important;
  overflow: visible !important;
}

.carousel2 .banner#b04 ul {
  width: 100% !important;
  height: auto !important;
  position: static !important;
  left: auto !important;
  transform: none !important;
  overflow: visible !important;
}

.carousel2 .banner#b04 .slider-item {
  width: 100% !important;
  float: none !important;
  display: block !important;
  margin-bottom: 1rem !important;
}

/* Force override any transform or positioning */
.carousel2 * {
  max-width: 100% !important;
}

/* Friendly links */
.friendly-link {
  background: #fff;
}

.friendly-link .bq {
  padding: 0.3rem;
}

/* Pastikan semua element tidak overflow */
img,
video,
iframe,
object,
embed {
  max-width: 100%;
  height: auto;
}

/* Text tidak overflow */
h1,
h2,
h3,
h4,
h5,
h6,
p,
div,
span,
a {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Clear floats */
.clearfix::after,
.clear::after,
.cf::after {
  content: "";
  display: table;
  clear: both;
}

/* Form elements */
input,
textarea,
select,
button {
  max-width: 100%;
}

/* Tables */
table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  word-wrap: break-word;
}

/* Pagination */
.pagination {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.3rem;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Touch scrolling untuk iOS */
body {
  -webkit-overflow-scrolling: touch;
}

/* Remove any transforms yang bisa ganggu scrolling */
.body-content,
.main-container,
.container {
  transform: none;
}

/* Ensure proper height calculation */
html,
body {
  height: auto;
  min-height: 100vh;
}

/* Responsive design for game items */
@media (max-width: 480px) {
  .game-list .game-item.vertical {
    width: calc(50% - 0.2rem);
  }
}

@media (max-width: 320px) {
  .game-list .game-item.vertical {
    width: calc(100% - 0.2rem);
  }
  
  .subject .module-title {
    flex-direction: column;
    text-align: center;
    gap: 0.2rem;
  }
}

/* Desktop border radius */
@media (min-width: 481px) {
  .topnav {
    border-radius: 20px 20px 0 0;
  }

  .footer {
    border-radius: 0 0 20px 20px;
    width: 480px;
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
}
