body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: url('../images/bgMainMenu.png') no-repeat center center fixed;
  background-size: cover;
  height: 100vh;
  overflow: hidden; /* cegah scroll di body */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Container utama level */
.level-container {
  background: rgba(0, 50, 0, 0.6);
  padding: 20px;
  border-radius: 20px;
  margin-top: 120px;
  width: 80%;
  max-width: 1200px;
  height: 70vh;              /* batasi tinggi supaya scroll di dalam */
  overflow-y: auto;          /* scroll hanya di kontainer */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  grid-gap: 20px;
  position: relative;
}

@media (min-width: 1024px) {
  .level-container { grid-template-columns: repeat(5, 1fr); }
}

@media (max-width: 768px) {
  .level-container { grid-template-columns: repeat(3, 1fr); }
}

/* Kotak level */
.soal {
  aspect-ratio: 1/1;
  position: relative;
  background: linear-gradient(180deg, #ffffff, #f9f6a3) !important;        /* kotak putih jelas */
  border-radius: 15px;
  padding: 15px;
  text-align: center;
  width: 100%;
  height: auto;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
  text-decoration: none;      /* hilangkan underline link */
  color: #0a3c1a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.soal:hover {
  transform: scale(1.07);
  background: linear-gradient(180deg, #e0ffe0, #b3ffb3); /* efek hijau lembut saat hover */
}

.soal.locked {
  pointer-events: none;
  opacity: .55;
  filter: grayscale(40%);
}

.soal .level-lock {
  position: absolute;
  right: .4rem;
  top: .35rem;
  font-size: 1rem;
  opacity: .9;
}

.soal.done .soal-number {
  background: #28a745;
  color: #fff;
}

/* Angka level */
.soal-number {
  font-size: 2.5em;
  font-weight: bold;
  margin-bottom: 5px;
}

/* Bintang */
.stars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  margin-bottom: 30px;
}

.star {
  color: gold;
  line-height: 1;
}

.star.inactive {
  color: lightgray;
}

.star-big {
  font-size: 4.2em;   /* tengah lebih besar */
}

.star-small {
  font-size: 3.4em;   /* kiri kanan lebih kecil */
}

/* ===== NAVBAR TANPA BIKIN SCROLL ===== */
:root{
  /* Tinggi bar navigasi fleksibel tapi dibatasi */
  --nav-h: clamp(56px, 10vh, 80px);
}

/* Bar navigasi nempel di bagian bawah layout (dipakai bareng .game-layout yang sudah kuberi) */
.navigation{
  /* hilangkan pemicu scroll */
  margin: 0;
  padding: 12px 16px;                 /* ruang dalam, bukan margin luar */
  box-sizing: border-box;

  /* lebar penuh layar biar gak ada overflow horizontal */
  width: 100%;

  /* struktur */
  display: flex;
  align-items: center;
  justify-content: center;            /* kita pusatkan konten di dalam */
  gap: 16px;

  /* kunci tinggi agar total tinggi halaman tetap = 100svh */
  height: var(--nav-h);
  flex: 0 0 var(--nav-h);             /* kalau pakai .game-layout {display:flex;flex-direction:column} */

  /* efek visual opsional */
  backdrop-filter: blur(2px);
}

/* Bungkus dalam untuk jaga max-width 900px seperti niat awalmu, TANPA bikin scroll */
.navigation .nav-wrap{
  width: min(90%, 900px);             /* ganti “80% + max-width” jadi aman */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Tombol (punyamu, dirapikan sedikit) */
.nav-button{
  padding: 12px 28px;
  background: linear-gradient(180deg, #f4d35e, #dfba5c) !important; /* gradasi emas */
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.2em;
  color: #2e2e2e;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, background 0.3s ease, color 0.3s ease;
  white-space: nowrap;                /* biar teks tombol gak turun baris */
}

.nav-button:hover{
  background: linear-gradient(180deg, #ffd86f, #e0b652);
  transform: scale(1.05);
  color: #000;
}

.nav-button:active{ transform: scale(0.97); }

a.soal:focus-visible,
.nav-button:focus-visible{
  outline: 3px solid #3b82f6;
  outline-offset: 3px;
  border-radius: 12px;
  transform: scale(1.05);
}

/* Responsif: di layar kecil, kompres padding & font */
@media (max-width: 480px){
  .nav-button{
    padding: 10px 18px;
    font-size: 1rem;
  }
}

/* Chapter badge */
.chapter-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #0d6efd;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  padding: .35rem .6rem;
  border-radius: .5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  pointer-events: none;
  z-index: 3;
}

@media (min-width: 768px) {
  .chapter-badge {
    font-size: 1.5rem;
    padding: .6rem 1rem;
  }
}

@media (max-width: 768px) {
  .navigation {
    flex-direction: column;
    gap: 10px;
  }
}