/* =========================================
   DINO LEARNING ADVENTURE — MODERN 3D UI
========================================= */
body {
  font-family: 'Nunito', sans-serif;
  background-color: #FFF9EE;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(99, 184, 232, 0.14) 0%, transparent 38%),
    radial-gradient(circle at 88% 82%, rgba(67, 166, 107, 0.14) 0%, transparent 40%),
    radial-gradient(#264B3A10 1.2px, transparent 1.2px);
  background-size: 100% 100%, 100% 100%, 26px 26px;
  color: #264B3A;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Fredoka', sans-serif;
}

/* Tombol 3D Glossy Tactile */
.btn-tactile {
  position: relative;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s ease, filter 0.15s ease;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.32), 0 5px 0 rgba(38, 75, 58, 0.16);
}
.btn-tactile:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}
.btn-tactile:active {
  transform: translateY(3px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 0 rgba(38, 75, 58, 0.16);
}

/* Kartu Game Pop-Out */
.card-pop {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.2s ease;
}
.card-pop:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -8px rgba(38, 75, 58, 0.16);
}

/* Animasi Mengambang Halus */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-7px); }
}
.animate-float {
  animation: floatSlow 3.4s ease-in-out infinite;
}

/* Animasi 3D Flip untuk Kartu Memory Match */
.memory-card {
  perspective: 900px;
}
.memory-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.34, 1.3, 0.64, 1);
  transform-style: preserve-3d;
}
.memory-card.is-flipped .memory-card-inner {
  transform: rotateY(180deg);
}
.memory-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 1.15rem;
  overflow: hidden;
}
.memory-card-front {
  transform: rotateY(180deg);
}

/* Scrollbar Halus */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #FFF9EE;
}
::-webkit-scrollbar-thumb {
  background: #b8dac6;
  border-radius: 9999px;
}

/* =========================================
   MEMORY MATCH: 3D CLAY STAGE & FLIP CARD
========================================= */
.memory-stage-wrapper {
  min-height: 360px;
}

.memory-stage-bg {
  position: absolute;
  inset: -10px;
  background-image: url('../assets/bg-jungle-runner.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(2.5px) brightness(1.03);
  z-index: 0;
}

.memory-grid-clay {
  display: grid;
  gap: 0.75rem;
  width: 100%;
  max-width: 620px;
  justify-items: center;
  align-items: center;
}

.memory-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 440px; }
.memory-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 540px; }
.memory-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 620px; }
.memory-cols-6 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 540px; }

.memory-clay-card {
  width: 100%;
  perspective: 900px;
}

.memory-clay-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.memory-clay-card.is-flipped .memory-clay-inner,
.memory-clay-card.is-matched .memory-clay-inner {
  transform: rotateY(180deg);
}

.memory-clay-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.memory-clay-front {
  transform: rotateY(180deg);
}

/* Efek kilau emas lembut saat kartu cocok */
.memory-clay-card.is-matched .memory-clay-front {
  border-color: #FFD45C;
  box-shadow: 0 0 18px rgba(255, 212, 92, 0.85), 0 6px 12px rgba(0, 0, 0, 0.15);
  animation: matchPop 0.35s ease;
}

@keyframes matchPop {
  0% { transform: rotateY(180deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.08); }
  100% { transform: rotateY(180deg) scale(1); }
}

/* =========================================
   MODE LANDSCAPE HP: FULL SCREEN + HUD MELAYANG
========================================= */
@media (orientation: landscape) and (max-height: 1024px) {
  #screen-4 {
    position: relative;
    height: 100dvh;
    max-height: 100dvh;
    width: 100vw;
    overflow: hidden;
  }

  /* Header melayang transparan di bagian atas game */
  #screen-4 header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: transparent !important;
    border-bottom: none !important;
    backdrop-filter: none !important;
    padding: 0.45rem 0.75rem;
    pointer-events: none; /* Area kosong tetap bisa diketuk untuk lompat */
  }

  #screen-4 header button,
  #screen-4 header .max-w-md {
    pointer-events: auto;
  }
  
  #screen-4 header .hud-pill {
    pointer-events: auto;
  }

  /* Beri latar kaca tipis pada progress bar agar tetap terbaca di atas langit */
  #screen-4 header .max-w-md {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(6px);
    padding: 0.25rem 0.65rem;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  /* Area main & papan game penuh 100% tanpa pinggiran putih */
  #screen-4 main {
    position: relative;
    max-width: 100% !important;
    width: 100vw;
    height: 100dvh;
    padding: 0 !important;
    margin: 0 !important;
  }

  #screen-4 .landscape-hide {
    display: none !important;
  }

  #screen-4 .game-board-box {
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #gameplayCanvasContent {
    width: 100%;
    max-width: 100% !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  /* --- KHUSUS MATH ADVENTURE (FULL LAYAR) --- */
  #gameplayCanvasContent .math-runner-wrapper {
    position: relative;
    max-width: 100% !important;
    width: 100vw;
    height: 100dvh;
    gap: 0 !important;
  }

  /* Bar soal melayang rapi di tengah atas (di bawah header) */
  #gameplayCanvasContent .math-question-bar {
    position: absolute;
    top: 3.35rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
    background: rgba(255, 249, 238, 0.9) !important;
    backdrop-filter: blur(6px);
    padding: 0.25rem 0.85rem !important;
    border-radius: 9999px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    width: auto;
    white-space: nowrap;
  }

  #mathQuestionBadge {
    font-size: 1.05rem;
  }

  #gameplayCanvasContent .math-canvas-frame {
    width: 100vw;
    height: 100dvh;
    border: none !important;
    border-radius: 0 !important;
  }

  #mathRunnerCanvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
  }
/* --- KHUSUS MEMORY MATCH (FULL LAYAR 3D CLAY) --- */
  #gameplayCanvasContent .memory-stage-wrapper {
    width: 100vw;
    height: 100dvh;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    padding-top: 3.1rem; /* Ruang untuk HUD atas melayang */
  }

  .memory-grid-clay {
    gap: 0.65rem;
    width: fit-content;
    max-width: 94vw;
  }

  .memory-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .memory-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .memory-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .memory-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

  .memory-clay-card {
    width: 31dvh;
    height: 31dvh;
  }

  .memory-cols-5 .memory-clay-card,
  .memory-cols-6 .memory-clay-card {
    width: 27dvh;
    height: 27dvh;
  }

  /* --- KOTAK MODAL MENANG & INSTRUKSI --- */
  #rewardModal > div,
  #instructionModal > div {
    max-width: 400px;
    max-height: 92dvh;
    padding: 0.9rem 1.25rem;
    overflow-y: auto;
  }

  #rewardModal img[alt="Piala Menang"] {
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 0.35rem;
  }

  #rewardModal h2 {
    font-size: 1.45rem;
    line-height: 1.2;
  }

  #rewardModal .my-5 {
    margin-top: 0.65rem;
    margin-bottom: 0.65rem;
    gap: 0.5rem;
  }

  #rewardModal .my-5 > div {
    padding: 0.5rem;
  }

  #rewardModal .my-5 img {
    width: 2.1rem;
    height: 2.1rem;
    margin-bottom: 0.2rem;
  }

  #rewardModal .my-5 .text-lg {
    font-size: 0.95rem;
  }

  #rewardModal button {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    font-size: 0.95rem;
  }
}
/* =========================================
   KOLEKSI & PENETASAN TELUR DINO (3D CLAY)
========================================= */
.collection-stage-bg {
  position: absolute;
  inset: -10px;
  background-image: url('../assets/bg-jungle-runner.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(2px) brightness(1.04);
  z-index: 0;
}

.egg-shaking {
  animation: eggShake 0.45s ease-in-out infinite;
}

@keyframes eggShake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-10deg) scale(1.05); }
  75% { transform: rotate(10deg) scale(1.05); }
}

@media (orientation: landscape) and (max-height: 1024px) {
  #screen-6 {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    z-index: 20;
  }

  #screen-6 header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0.45rem 0.85rem;
  }

  #screen-6 .collection-main {
    flex-direction: row !important;
    width: 100vw;
    height: 100dvh;
    max-width: 100% !important;
    padding: 3.1rem 1.25rem 0.75rem !important;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
  }

  #eggNestContainer {
    width: 40dvh;
    height: 40dvh;
  }

  #hatchHintText {
    display: none;
  }

  #screen-6 .collection-grid-area {
    max-width: 54vw;
  }

  #dinoCollectionGrid {
    gap: 0.55rem;
  }

  #dinoCollectionGrid .collection-slot {
    max-height: 35dvh;
  }
}
/* =========================================
   ALPHABET & WORD ADVENTURE (3D CLAY)
========================================= */
.alphabet-stage-wrapper {
  min-height: 360px;
}

.alphabet-stage-bg {
  position: absolute;
  inset: -10px;
  background-image: url('../assets/bg-jungle-runner.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(2.5px) brightness(1.04);
  z-index: 0;
}

.alphabet-shake {
  animation: alphaShake 0.35s ease;
}

@keyframes alphaShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@media (orientation: landscape) and (max-height: 1024px) {
  #gameplayCanvasContent .alphabet-stage-wrapper {
    width: 100vw;
    height: 100dvh;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    padding-top: 2.9rem;
  }

  .alphabet-stage-content {
    gap: 0.9rem !important;
    padding: 0.75rem 1.25rem !important;
  }

  .alphabet-top-row {
    flex-direction: row !important;
  }
}
/* =========================================
   PUZZLE WORLD (3D CLAY)
========================================= */
.puzzle-stage-wrapper {
  min-height: 380px;
}

.puzzle-stage-bg {
  position: absolute;
  inset: -10px;
  background-image: url('../assets/bg-jungle-runner.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(2.5px) brightness(1.04);
  z-index: 0;
}

.puzzle-board-grid {
  width: 240px;
  height: 240px;
}

.puzzle-tray-grid .puzzle-piece {
  width: 64px;
  height: 64px;
}

.puzzle-shake {
  animation: puzzleShake 0.35s ease;
}

@keyframes puzzleShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@media (min-width: 640px) {
  .puzzle-board-grid {
    width: 270px;
    height: 270px;
  }

  .puzzle-tray-grid .puzzle-piece {
    width: 72px;
    height: 72px;
  }
}

@media (orientation: landscape) and (max-height: 1024px) {
  #gameplayCanvasContent .puzzle-stage-wrapper {
    width: 100vw;
    height: 100dvh;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    padding-top: 2.9rem;
  }

  .puzzle-stage-content {
    flex-direction: row !important;
    gap: 1.25rem !important;
    padding: 0.5rem 1.25rem !important;
  }

  .puzzle-board-grid {
    width: 66dvh;
    height: 66dvh;
  }

  .puzzle-tray-grid .puzzle-piece {
    width: 18dvh;
    height: 18dvh;
  }
}
/* =========================================
   SCIENCE EXPLORER (3D CLAY)
========================================= */
.science-stage-wrapper {
  min-height: 380px;
}

.science-stage-bg {
  position: absolute;
  inset: -10px;
  background-image: url('../assets/bg-jungle-runner.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(2.5px) brightness(1.04);
  z-index: 0;
}

.science-shake {
  animation: sciShake 0.35s ease;
}

@keyframes sciShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@media (orientation: landscape) and (max-height: 1024px) {
  #gameplayCanvasContent .science-stage-wrapper {
    width: 100vw;
    height: 100dvh;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    padding-top: 2.9rem;
  }

  .science-stage-content {
    flex-direction: row !important;
    gap: 1.25rem !important;
    padding: 0.5rem 1.25rem !important;
  }

  .science-question-card {
    padding: 0.75rem 1rem !important;
    gap: 0.5rem !important;
  }

  .science-question-card img {
    max-height: 82px;
  }

  .science-opt-btn {
    padding: 0.4rem 0.75rem !important;
  }
}
/* =========================================
   POLESAN PROPORSI TABLET LANDSCAPE
========================================= */
@media (orientation: landscape) and (min-height: 561px) and (max-height: 1024px) {
  /* HUD sedikit lebih lega di tablet */
  #screen-4 header {
    padding: 0.75rem 1.25rem;
  }

  /* Memory Match: kartu tidak meluber di tablet 4:3 */
  .memory-clay-card {
    width: min(29dvh, 18vw);
    height: min(29dvh, 18vw);
  }
  .memory-cols-5 .memory-clay-card,
  .memory-cols-6 .memory-clay-card {
    width: min(25dvh, 13.5vw);
    height: min(25dvh, 13.5vw);
  }

  /* Puzzle World: papan & baki seimbang */
  .puzzle-board-grid {
    width: min(64dvh, 48vw);
    height: min(64dvh, 48vw);
  }
  .puzzle-tray-grid .puzzle-piece {
    width: min(17dvh, 12vw);
    height: min(17dvh, 12vw);
  }

  /* Science Explorer: gambar soal lebih besar & jelas di tablet */
  .science-question-card img {
    max-height: clamp(100px, 22dvh, 160px);
  }
}
/* =========================================
   FIX TINGGI FULL 100% (HILANGKAN BLOK KREM ATAS-BAWAH)
========================================= */
@media (orientation: landscape) and (max-height: 1024px) {
  #screen-4 {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
  }

  #gameplayCanvasContent .memory-stage-wrapper,
  #gameplayCanvasContent .alphabet-stage-wrapper,
  #gameplayCanvasContent .puzzle-stage-wrapper,
  #gameplayCanvasContent .science-stage-wrapper {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    flex: 1 0 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}
/* =========================================
   FIX MATH FULL-SCREEN & UKURAN KARTU MEMORY (HP & TABLET)
========================================= */
@media (orientation: landscape) and (max-height: 1024px) {
  /* 1. Math Adventure penuh 100% tanpa potong kiri-kanan */
  #gameplayCanvasContent .math-runner-wrapper,
  #gameplayCanvasContent .math-canvas-frame {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-width: 100vw !important;
    flex: 1 0 100% !important;
    border: none !important;
    border-radius: 0 !important;
  }

  #mathRunnerCanvas {
    display: block !important;
    width: 100vw !important;
    height: 100dvh !important;
    object-fit: fill !important;
  }

  /* 2. Memory Match: kunci ukuran kolom & kartu secara eksplisit */
  #gameplayCanvasContent .memory-stage-wrapper > .relative {
    width: 100% !important;
    height: 100% !important;
  }

  .memory-grid-clay {
    display: grid !important;
    width: auto !important;
    max-width: 96vw !important;
    gap: clamp(0.6rem, 1.8vw, 1.1rem) !important;
    place-items: center !important;
  }

  .memory-cols-3 {
    grid-template-columns: repeat(3, min(32vh, 21vw)) !important;
  }
  .memory-cols-4 {
    grid-template-columns: repeat(4, min(32vh, 18vw)) !important;
  }
  .memory-cols-5 {
    grid-template-columns: repeat(5, min(26vh, 15vw)) !important;
  }
  .memory-cols-6 {
    grid-template-columns: repeat(6, min(26vh, 13.5vw)) !important;
  }

  .memory-clay-card {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    min-width: 78px !important;
    min-height: 78px !important;
  }

  .memory-clay-inner {
    width: 100% !important;
    height: 100% !important;
  }
}
/* =========================================
   SCIENCE EXPLORER V2: SOAL ATAS + 3 KARTU BESAR BAWAH
========================================= */
@media (orientation: landscape) and (max-height: 1024px) {
  .science-stage-content {
    flex-direction: column !important;
    justify-content: center !important;
    gap: clamp(0.6rem, 2.2dvh, 1.35rem) !important;
    padding: 3.1rem clamp(1rem, 4vw, 2.5rem) 1rem !important;
  }

  .science-question-banner {
    width: min(92vw, 760px) !important;
    padding: clamp(0.45rem, 1.6dvh, 0.9rem) clamp(1rem, 3vw, 1.75rem) !important;
  }

  .science-question-banner h3 {
    font-size: clamp(1rem, 3.2dvh, 1.55rem) !important;
  }

  .science-options-row {
    width: min(92vw, 820px) !important;
    gap: clamp(0.65rem, 2vw, 1.35rem) !important;
  }

  .science-choice-card {
    padding: clamp(0.4rem, 1.4dvh, 0.75rem) !important;
    gap: clamp(0.3rem, 1dvh, 0.55rem) !important;
  }

  .science-choice-img-box {
    max-height: clamp(95px, 34dvh, 220px);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
  }

  .science-choice-label {
    font-size: clamp(0.85rem, 2.7dvh, 1.25rem) !important;
  }
}
/* =========================================
   CREATIVE STUDIO (3D CLAY FULL-SCREEN)
========================================= */
.creative-stage-wrapper {
  min-height: 400px;
}

.creative-stage-bg {
  position: absolute;
  inset: -10px;
  background-image: url('../assets/bg-jungle-runner.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(2.5px) brightness(1.04);
  z-index: 0;
}

@media (orientation: landscape) and (max-height: 1024px) {
  #gameplayCanvasContent .creative-stage-wrapper {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    flex: 1 0 100% !important;
    border: none !important;
    border-radius: 0 !important;
  }

  .creative-stage-content {
    padding: 3.1rem 0.85rem 0.75rem !important;
  }

  .creative-workspace {
    flex-direction: row !important;
  }

  .creative-toolbox {
    width: clamp(190px, 24vw, 235px) !important;
  }
}
/* =========================================
   CREATIVE STUDIO V3 (1 LAYAR PILIH + KANVAS BESAR)
========================================= */
/* Sembunyikan pil '0 Karya' di kiri atas khusus saat Creative Studio aktif */
#screen-4.creative-active header > div > div:first-child,
#screen-4.creative-active header .hud-pill:first-child {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Sembunyikan judul tengah ('Mewarnai • ...') saat masuk layar mewarnai */
#screen-4.creative-view-draw #gameplayTitle,
#screen-4.creative-view-draw header div:has(> #gameplayTitle) {
  display: none !important;
}

.creative-stage-wrapper {
  min-height: 420px;
}

.creative-sky-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #CBEFFF 0%, #E7F9FF 62%, #B5EA9B 62%, #8BD874 100%);
  z-index: 0;
}

/* Tombol mengambang di pojok atas sejajar dengan HUD */
.creative-gallery-floating,
.creative-back-floating {
  position: absolute;
  top: 0.55rem;
  left: 0.85rem;
  z-index: 35;
}

.creative-top-actions {
  position: absolute;
  top: 0.55rem;
  right: 4rem; /* Tepat di samping kiri tombol Jeda */
  z-index: 35;
}

.creative-tool-btn {
  width: 68px;
  height: 54px;
}

.creative-swatch-btn {
  width: 34px;
  height: 34px;
}

.creative-canvas-paper {
  width: 100%;
  max-height: 100%;
  max-width: 100%;
}

.creative-ref-img {
  width: 104px;
  height: 78px;
}

@media (orientation: landscape) and (max-height: 1024px) {
  #gameplayCanvasContent .creative-stage-wrapper {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    flex: 1 0 100% !important;
    border: none !important;
    border-radius: 0 !important;
  }

  /* Layar 1: Pilih Gambar 3x2 pas 1 layar tanpa scroll */
  .creative-picker-content {
    padding: 3.3rem clamp(1rem, 4vw, 2.5rem) 0.9rem !important;
    overflow: hidden !important;
  }

  .creative-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    gap: clamp(0.55rem, 1.8vw, 1.15rem) !important;
  }

  .creative-pick-card {
    padding: clamp(0.3rem, 1dvh, 0.65rem) !important;
  }

  .creative-pick-title {
    font-size: clamp(0.75rem, 2.5dvh, 1.15rem) !important;
  }

  /* Layar 2: Kanvas Lebih Besar (karena header tengah hilang) */
  .creative-draw-layout {
    padding: 0.7rem clamp(0.6rem, 2vw, 1.25rem) 0.7rem !important;
  }

  .creative-top-actions {
    top: 0.5rem;
    right: 4.1rem;
  }

  .creative-tool-btn {
    width: clamp(58px, 9vw, 84px) !important;
    height: clamp(46px, 16dvh, 76px) !important;
  }

  .creative-tool-icon {
    font-size: clamp(1.1rem, 3.8dvh, 1.7rem) !important;
  }

  .creative-tool-label {
    font-size: clamp(0.52rem, 1.5dvh, 0.72rem) !important;
  }

  .creative-swatch-btn {
    width: clamp(30px, 10.5dvh, 48px) !important;
    height: clamp(30px, 10.5dvh, 48px) !important;
  }

  .creative-canvas-paper {
    height: 94dvh !important;
    width: auto !important;
    max-width: 100% !important;
    aspect-ratio: 4 / 3 !important;
  }

  /* Contoh Warna lebih besar & jelas */
  .creative-ref-img {
    width: clamp(92px, 17vw, 165px) !important;
    height: clamp(70px, 14dvh, 124px) !important;
  }
}
/* =========================================
   POLESAN POSISI DOCK CREATIVE STUDIO & FIX LAYER PAUSE
========================================= */
#pauseModal {
  z-index: 9999 !important;
}

@media (orientation: landscape) and (max-height: 1024px) {
  /* Turunkan sedikit panel Ember Cat (kiri) & Palet Warna (kanan) */
  .creative-left-dock,
  .creative-right-dock {
    margin-top: clamp(2.2rem, 9dvh, 3.4rem) !important;
  }

  /* Sedikit perkecil tinggi tombol alat agar tetap muat rapi setelah diturunkan */
  .creative-tool-btn {
    height: clamp(42px, 14.5dvh, 68px) !important;
  }

  .creative-swatch-btn {
    width: clamp(27px, 9.2dvh, 44px) !important;
    height: clamp(27px, 9.2dvh, 44px) !important;
  }
}
/* =========================================
   IKON HEADER TANPA BULATAN & KOTAK CONTOH WARNA RAMPING
========================================= */
.creative-icon-btn {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.14s ease;
}

.creative-icon-btn:active {
  transform: scale(0.88);
}

.creative-zoom-active {
  transform: scale(1.14);
  filter: drop-shadow(0 0 8px rgba(255, 212, 92, 0.95));
}

/* Kotak contoh warna dibuat persegi pas (1:1) agar tidak melebar menutupi sketsa */
.creative-ref-card {
  width: fit-content !important;
}

.creative-ref-img {
  width: 96px;
  height: 96px;
  object-fit: cover !important;
}

@media (orientation: landscape) and (max-height: 1024px) {
  .creative-icon-btn {
    width: clamp(34px, 9.5dvh, 46px) !important;
    height: clamp(34px, 9.5dvh, 46px) !important;
  }

  .creative-top-actions {
    top: 0.45rem;
    right: clamp(3.3rem, 11dvh, 4.4rem) !important;
  }

  .creative-ref-img {
    width: clamp(78px, 24dvh, 128px) !important;
    height: clamp(78px, 24dvh, 128px) !important;
    object-fit: cover !important;
  }
}
/* =========================================
   KECILKAN 4 IKON AKSI ATAS CREATIVE STUDIO
========================================= */
.creative-top-actions .creative-icon-btn {
  width: 30px !important;
  height: 30px !important;
}

@media (orientation: landscape) and (max-height: 1024px) {
  .creative-top-actions {
    gap: 0.45rem !important;
    right: clamp(3.1rem, 10.5dvh, 4.1rem) !important;
  }

  .creative-top-actions .creative-icon-btn {
    width: clamp(26px, 7.2dvh, 36px) !important;
    height: clamp(26px, 7.2dvh, 36px) !important;
  }
}
/* =========================================
   PENGINGAT PUTAR KE LANDSCAPE (KHUSUS SAAT MAIN)
========================================= */
.rotate-landscape-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(38, 75, 58, 0.92);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* Hanya muncul di perangkat HP/Tablet saat posisi berdiri (Portrait) di dalam game */
@media (orientation: portrait) and (max-width: 1024px) {
  #screen-4:not(.hidden) .rotate-landscape-overlay {
    display: flex !important;
  }
}
/* =========================================
   SEJAJARKAN 4 IKON AKSI DENGAN PAUSE + BERI JARAK
========================================= */
.creative-top-actions {
  top: 0.72rem !important;
  right: 4.5rem !important;
  align-items: center !important;
}

@media (orientation: landscape) and (max-height: 1024px) {
  .creative-top-actions {
    top: 0.68rem !important;
    right: clamp(3.85rem, 13.5dvh, 4.9rem) !important;
    gap: 0.5rem !important;
  }
}
/* =========================================
   PAPAN KAYU SOAL 3D CLAY (MATH ADVENTURE)
========================================= */
/* Sembunyikan pil judul putih default khusus saat Math Adventure aktif */
#screen-4.math-wood-active #gameplayTitle,
#screen-4.math-wood-active header div:has(> #gameplayTitle) {
  display: none !important;
}

.math-wood-sign {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  pointer-events: none;
  width: clamp(190px, 34vw, 310px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.math-wood-sign img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(38, 75, 58, 0.32));
}

.math-wood-sign-text {
  position: absolute;
  top: 56%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 78%;
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  color: #FFFFFF;
  font-size: clamp(1rem, 3.2vw, 1.85rem);
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(62, 32, 12, 0.65);
  white-space: nowrap;
}

@media (orientation: landscape) and (max-height: 1024px) {
  .math-wood-sign {
    top: -6px;
    width: clamp(185px, 44dvh, 300px);
  }

  .math-wood-sign-text {
    font-size: clamp(1rem, 4.6dvh, 1.8rem);
  }
}
/* =========================================
   PAPAN KAYU SOAL 3D CLAY (MATH ADVENTURE)
========================================= */
/* Pastikan pil judul lama di tengah header 100% tersembunyi (PAUD & TK) */
#screen-4.math-wood-active #gameplayTitle,
#screen-4.math-wood-active header > div > *:has(#gameplayTitle),
#screen-4.math-wood-active header > *:has(#gameplayTitle):not(:has(#pauseToggleBtn)) {
  display: none !important;
}

.math-wood-sign {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  pointer-events: none;
  width: clamp(235px, 44vw, 380px);
  height: clamp(74px, 14vw, 112px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.math-wood-sign img {
  width: 100%;
  height: 100%;
  object-fit: fill; /* Membuat papan lebih panjang/lebar tanpa jadi terlalu tinggi */
  display: block;
  filter: drop-shadow(0 6px 10px rgba(38, 75, 58, 0.32));
}

.math-wood-sign-text {
  position: absolute;
  top: 57%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 82%;
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  color: #FFFFFF;
  font-size: clamp(0.95rem, 2.7vw, 1.65rem);
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(62, 32, 12, 0.65);
  white-space: nowrap;
}

@media (orientation: landscape) and (max-height: 1024px) {
  .math-wood-sign {
    top: -6px;
    width: clamp(245px, 64dvh, 390px);
    height: clamp(70px, 21dvh, 108px);
  }

  .math-wood-sign-text {
    font-size: clamp(0.95rem, 4.1dvh, 1.6rem);
  }
}
/* =========================================
   PUZZLE WORLD SD (KELAS 1–3 • 4:3 SEJAJAR + MODAL SAMA PAUD/TK)
========================================= */
#rewardModal {
  z-index: 9999 !important;
}

#screen-4.psd-active > header,
#screen-4.psd-active > footer,
#screen-4.psd-active .landscape-hide,
#screen-4.psd-active #gameplayPromptHint {
  display: none !important;
}

.psd-stage {
  position: relative;
  width: 100%;
  min-height: 380px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Fredoka', 'Nunito', sans-serif;
  background: #1c4d2e;
}

.psd-bg {
  position: absolute;
  inset: -10px;
  width: calc(100% + 20px);
  height: calc(100% + 20px);
  object-fit: cover;
  object-position: center;
  filter: blur(2px) brightness(1.02);
  pointer-events: none;
  z-index: 0;
}

.psd-wood-pill {
  background: linear-gradient(180deg, #c17434 0%, #924e1e 58%, #6f3711 100%);
  border: 2.5px solid #4c2308;
  box-shadow: 0 3px 0 #3a1904, inset 0 1.5px 0 rgba(255, 232, 194, 0.5);
  color: #fffaf0;
  text-shadow: 0 1.5px 2px rgba(45, 18, 0, 0.72);
}

.psd-icon-btn {
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.15s ease;
}
.psd-icon-btn:active {
  transform: scale(0.92);
}

.psd-gallery-wrap {
  position: relative;
  z-index: 15;
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.8dvh, 18px);
  padding: clamp(6px, 1.4dvh, 14px) clamp(12px, 3vw, 32px);
}

.psd-pick-card {
  background: linear-gradient(180deg, #fffdf4 0%, #f8e5bd 100%);
  border: 3.5px solid #ffffff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  border-radius: clamp(0.95rem, 2.2dvh, 1.5rem);
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.15s ease;
}
.psd-pick-card:hover {
  transform: translateY(-3px) scale(1.03);
  border-color: #ffd43b;
}

/* Area kerja utama: papan kayu kiri & rak kaca buram kanan sejajar 4:3 tanpa scroll */
.psd-work-area {
  position: relative;
  z-index: 15;
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.2vw, 26px);
  padding: clamp(6px, 1.4dvh, 14px) clamp(10px, 2.4vw, 26px) clamp(10px, 2dvh, 18px);
}

.psd-board-frame,
.psd-tray {
  aspect-ratio: 4 / 3;
  width: min(45.5vw, calc((100dvh - 86px) * 4 / 3), 500px);
  max-height: 100%;
  display: grid;
  flex-shrink: 0;
  box-sizing: border-box;
}

.psd-board-frame {
  background: linear-gradient(180deg, #98521f 0%, #6b340e 100%);
  border: 3.5px solid #471f06;
  border-radius: clamp(0.9rem, 2.4dvh, 1.45rem);
  padding: clamp(5px, 1.2dvh, 10px);
  gap: clamp(3px, 0.8dvh, 6px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38);
}

.psd-slot {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: clamp(0.4rem, 1.1dvh, 0.75rem);
  background: rgba(255, 214, 130, 0.24);
  border: 2px solid rgba(255, 224, 140, 0.72);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.psd-slot.is-target-ready {
  border: 2px solid #ffd45c;
  background: rgba(255, 218, 110, 0.3);
}

.psd-slot.is-solved {
  border: 2px solid rgba(255, 255, 255, 0.95);
  cursor: default;
}

.psd-slot.is-wrong {
  border: 2.5px solid #e24c3b;
  animation: puzzleShake 0.35s ease;
}

.psd-guide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.psd-tray {
  background: rgba(255, 255, 255, 0.44);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 2.5px solid rgba(255, 255, 255, 0.82);
  border-radius: clamp(0.9rem, 2.4dvh, 1.45rem);
  padding: clamp(5px, 1.2dvh, 10px);
  gap: clamp(4px, 1dvh, 8px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  overflow: visible;
}

.psd-piece {
  width: 100%;
  height: 100%;
  border-radius: clamp(0.45rem, 1.2dvh, 0.8rem);
  border: 2.5px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background-color: transparent;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s ease, border-color 0.14s ease;
}

.psd-piece:hover:not(:disabled) {
  transform: scale(1.03);
}

.psd-piece.is-selected {
  position: relative;
  z-index: 6;
  transform: scale(1.06);
  border: 3px solid #ffd43b;
  box-shadow: 0 0 0 3px rgba(255, 212, 59, 0.65), 0 8px 16px rgba(0, 0, 0, 0.36);
}

.psd-piece.is-placed {
  opacity: 0.18;
  pointer-events: none;
  transform: scale(0.94);
}

/* Samakan perilaku full-screen Puzzle SD dengan stage PAUD/TK di mode landscape HP & Tablet */
@media (orientation: landscape) and (max-height: 1024px) {
  #gameplayCanvasContent .psd-stage {
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    flex: 1 0 100% !important;
    border: none !important;
    border-radius: 0 !important;
  }

  /* Pengaman agar kotak pesan tidak pernah kepotong di layar HP landscape yang rendah */
#psdOverlayModal > div {
    max-height: 92dvh;
    overflow-y: auto;
    padding: 0.85rem 1.1rem !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
}
/* =========================================
   SCIENCE EXPLORER SD (ACTION ADVENTURE • V4)
========================================= */
#screen-4.ssd-active > header,
#screen-4.ssd-active > footer,
#screen-4.ssd-active .landscape-hide,
#screen-4.ssd-active #gameplayPromptHint {
  display: none !important;
}

.ssd-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 360px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Fredoka', 'Nunito', sans-serif;
  background: #1c4d2e;
}

.ssd-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ssd-hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 0.45rem 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  pointer-events: none;
}

.ssd-hud-top button,
.ssd-hud-top .ssd-wood-pill {
  pointer-events: auto;
}

/* Teks misi bersih tanpa kotak lonjong, diturunkan sedikit di bawah ikon nyawa */
.ssd-mission-center-wrap {
  position: absolute;
  top: clamp(60px, 15.5dvh, 80px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 21;
  width: min(88vw, 640px);
  text-align: center;
  pointer-events: none;
}

.ssd-mission-text-btn {
  pointer-events: auto;
  background: transparent;
  border: none;
  padding: 0.15rem 0.35rem;
}


.ssd-mission-text {
  font-family: 'Fredoka', 'Nunito', sans-serif;
  font-weight: 800;
  font-size: clamp(0.95rem, 3.6dvh, 1.32rem);
  line-height: 1.2;
  color: #ffffff;
  text-shadow:
    0 2px 6px rgba(14, 38, 22, 0.85),
    1.5px 1.5px 0 #1c4427,
    -1.5px -1.5px 0 #1c4427,
    1.5px -1.5px 0 #1c4427,
    -1.5px 1.5px 0 #1c4427;
}

.ssd-wood-pill {
  background: linear-gradient(180deg, #c17434 0%, #924e1e 58%, #6f3711 100%);
  border: 2.5px solid #4c2308;
  box-shadow: 0 3px 0 #3a1904, inset 0 1.5px 0 rgba(255, 232, 194, 0.5);
  color: #fffaf0;
  text-shadow: 0 1.5px 2px rgba(45, 18, 0, 0.72);
}

.ssd-icon-btn {
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ssd-icon-btn:active {
  transform: scale(0.92);
}

/* Kontrol Glossy Lebih Besar untuk Anak */
.ssd-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}

.ssd-ctrl-btn {
  pointer-events: auto;
  touch-action: none;
  width: clamp(60px, 17.5dvh, 80px);
  height: clamp(60px, 17.5dvh, 80px);
  border-radius: 9999px;
  border: 3.5px solid #ffffff;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(12, 34, 24, 0.4), inset 0 3px 0 rgba(255, 255, 255, 0.5), inset 0 -4px 6px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.1s ease;
}

.ssd-ctrl-move {
  background: linear-gradient(180deg, #56c8ff 0%, #2aa3f4 55%, #1682dc 100%);
}

.ssd-ctrl-jump {
  background: linear-gradient(180deg, #8ce339 0%, #52c424 58%, #349e15 100%);
}

.ssd-ctrl-net {
  background: linear-gradient(180deg, #ffca3a 0%, #f59f00 58%, #d97706 100%);
}

.ssd-ctrl-btn.is-pressed {
  transform: scale(0.9);
  filter: brightness(1.1);
}

@media (orientation: landscape) and (max-height: 1024px) {
  #gameplayCanvasContent .ssd-stage {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
  }

  /* Kotak pesan akhir level dibuat lebih lega atas-bawah namun tetap tanpa scrollbar */
  #ssdOverlayModal {
    padding: 0.45rem !important;
  }

  #ssdOverlayModal .ssd-modal-card {
    max-height: 94dvh;
    min-height: min(82dvh, 330px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    padding: 1.25rem 1.35rem !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #ssdOverlayModal .ssd-modal-card::-webkit-scrollbar {
    display: none;
  }
}
/* =========================================
   CREATIVE STUDIO SD (KELAS 1–3 • V4 • 24 WARNA KRAYON)
========================================= */
#screen-4.csd-active > header,
#screen-4.csd-active > footer,
#screen-4.csd-active .landscape-hide,
#screen-4.csd-active #gameplayPromptHint {
  display: none !important;
}

.csd-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 360px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Fredoka', 'Nunito', sans-serif;
  display: flex;
  flex-direction: column;
}

.csd-bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.04) 45%, rgba(16, 42, 26, 0.25) 100%);
  pointer-events: none;
}

.csd-hud-top {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  padding: 0.4rem 0.7rem 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.csd-wood-pill {
  background: linear-gradient(180deg, #c17434 0%, #924e1e 58%, #6f3711 100%);
  border: 2.5px solid #4c2308;
  box-shadow: 0 3px 0 #3a1904, inset 0 1.5px 0 rgba(255, 232, 194, 0.5);
  color: #fffaf0;
  text-shadow: 0 1.5px 2px rgba(45, 18, 0, 0.72);
}

.csd-header-icon-btn {
  width: clamp(34px, 9.5dvh, 46px);
  height: clamp(34px, 9.5dvh, 46px);
  background: transparent;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.csd-zoom-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #f59e0b;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 0 4px;
  border-radius: 9999px;
  border: 1.5px solid #ffffff;
  line-height: 1.3;
}

.csd-pan-toggle-btn {
  width: clamp(34px, 9.5dvh, 44px);
  height: clamp(34px, 9.5dvh, 44px);
  border-radius: 9999px;
  border: 2.5px solid #ffffff;
  background: linear-gradient(180deg, #56c8ff 0%, #1682dc 100%);
  font-size: clamp(1rem, 3.2dvh, 1.3rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(14, 38, 56, 0.35);
}

.csd-pan-toggle-btn.is-active {
  background: linear-gradient(180deg, #fde047 0%, #f59e0b 100%);
  transform: scale(1.08);
  box-shadow: 0 0 0 2.5px #ffffff, 0 4px 10px rgba(0, 0, 0, 0.35);
}

.csd-press {
  transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.csd-press:active {
  transform: scale(0.9);
}

/* Layar Pilih Gambar Favorit (3x2) */
.csd-picker-area {
  position: relative;
  z-index: 10;
  flex: 1;
  min-height: 0;
  padding: 0.25rem 0.9rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.csd-picker-inner {
  width: 100%;
  height: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.csd-picker-title {
  font-weight: 800;
  font-size: clamp(0.88rem, 3.3dvh, 1.25rem);
  color: #ffffff;
  text-align: center;
  text-shadow:
    0 2px 6px rgba(20, 36, 22, 0.8),
    1.5px 1.5px 0 #3b1d06,
    -1.5px -1.5px 0 #3b1d06,
    1.5px -1.5px 0 #3b1d06,
    -1.5px 1.5px 0 #3b1d06;
}

.csd-picker-grid {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

/* Area Kerja 3 Kolom */
.csd-workspace {
  position: relative;
  z-index: 10;
  flex: 1;
  min-height: 0;
  padding: 0.15rem 0.7rem 0.45rem;
  display: grid;
  grid-template-columns: clamp(128px, 19vw, 194px) minmax(0, 1fr) clamp(154px, 23vw, 224px);
  gap: 0.6rem;
  align-items: stretch;
}

/* Kolom Kiri: Pemandu Dino */
.csd-guide-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 0.15rem 0;
  gap: 0.25rem;
}

.csd-bubble {
  width: 100%;
  background: linear-gradient(180deg, #fffdf4 0%, #fff2c6 100%);
  border: 2.5px solid #b46924;
  border-radius: 1rem;
  padding: 0.35rem 0.55rem;
  box-shadow: 0 4px 10px rgba(30, 20, 5, 0.25);
}

.csd-guide-dino-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.csd-guide-dino {
  max-height: clamp(92px, 36dvh, 188px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(15, 36, 20, 0.35));
}

.csd-mission-card {
  width: 100%;
  background: linear-gradient(180deg, #fffbeb 0%, #fde68a 100%);
  border: 2.5px solid #a15c1e;
  border-radius: 0.9rem;
  padding: 0.35rem 0.55rem;
  box-shadow: 0 3px 0 #6f3711;
}

/* Kolom Tengah: Kanvas + 6 Ikon Alat Tanpa Kotak Rata Tengah */
.csd-center-area {
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.csd-easel-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.32rem;
}

.csd-easel-frame {
  flex: 1;
  min-height: 0;
  max-width: 100%;
  background: linear-gradient(180deg, #c67b36 0%, #8f4b18 100%);
  border: 4px solid #592b0b;
  border-radius: 1.15rem;
  padding: 0.35rem;
  box-shadow: 0 10px 22px rgba(25, 14, 4, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
}

.csd-easel-viewport {
  width: 100%;
  height: 100%;
  border-radius: 0.78rem;
  overflow: hidden;
  background: #ffffff;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.csd-draw-canvas {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 640 / 440;
  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
  transform-origin: center center;
}

.csd-floating-tools {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.45rem, 1.8vw, 0.95rem);
  padding: 0.05rem 0;
}

.csd-float-tool {
  width: clamp(40px, 11.8dvh, 56px);
  height: clamp(40px, 11.8dvh, 56px);
  background: transparent;
  border: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  filter: drop-shadow(0 4px 6px rgba(15, 32, 20, 0.42));
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.15s ease;
}

.csd-float-tool img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.csd-float-tool.is-active {
  transform: translateY(-4px) scale(1.16);
  filter: drop-shadow(0 0 10px rgba(254, 240, 138, 0.98)) drop-shadow(0 5px 8px rgba(15, 32, 20, 0.48));
}

/* Kolom Kanan: Kotak 24 Warna Krayon + Tombol previous.png di Sudut Kanan Bawah */
.csd-right-panel {
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.csd-right-stack {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.25rem;
  padding-top: 0.65rem;
}

.csd-wood-panel {
  width: 100%;
  max-height: calc(100% - 48px);
  background: linear-gradient(180deg, #c97d38 0%, #98521d 60%, #713811 100%);
  border: 3px solid #4c2308;
  border-radius: 1.15rem;
  padding: 0.42rem;
  box-shadow: 0 6px 16px rgba(24, 12, 3, 0.38), inset 0 2px 0 rgba(255, 232, 194, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.csd-panel-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff8e7;
  text-align: center;
  margin-bottom: 0.3rem;
  text-shadow: 0 1px 2px rgba(40, 16, 0, 0.7);
  flex-shrink: 0;
}

.csd-swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.28rem;
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: none;
}
.csd-swatch-grid::-webkit-scrollbar {
  display: none;
}

.csd-swatch {
  aspect-ratio: 1;
  border-radius: 0.55rem;
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 2.5px 0 rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.csd-swatch-white {
  border-color: #cbd5e1;
}

.csd-swatch.is-active {
  border-color: #fef08a;
  transform: scale(1.1);
  box-shadow: 0 0 0 2px #ffffff, 0 4px 10px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.csd-prev-corner-btn {
  width: clamp(38px, 11.2dvh, 52px);
  height: clamp(38px, 11.2dvh, 52px);
  background: transparent;
  border: none;
  padding: 0;
  margin-right: 0.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 6px rgba(15, 32, 20, 0.42));
}

.csd-prev-corner-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.csd-scroll-clean {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.csd-scroll-clean::-webkit-scrollbar {
  display: none;
}

@media (orientation: landscape) and (max-height: 1024px) {
  #gameplayCanvasContent .csd-stage {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
  }

  #csdOverlayModal {
    padding: 0.45rem !important;
  }

  #csdOverlayModal .csd-modal-card {
    max-height: 94dvh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #csdOverlayModal .csd-modal-card::-webkit-scrollbar {
    display: none;
  }
}
/* =========================================
   ENGLISH ADVENTURE — V3
========================================= */
#screen-4.eng-active > header,
#screen-4.eng-active > footer,
#screen-4.eng-active .landscape-hide,
#screen-4.eng-active #gameplayPromptHint {
  display: none !important;
}

.eng-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 360px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Fredoka', 'Nunito', sans-serif;
  display: flex;
  flex-direction: column;
}

.eng-bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 48%, rgba(16, 46, 26, 0.22) 100%);
  pointer-events: none;
}

.eng-hud-top {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  padding: 0.15rem 0.7rem 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
}

.eng-wood-pill {
  margin-top: 0.22rem;
  background: linear-gradient(180deg, #c17434 0%, #924e1e 58%, #6f3711 100%);
  border: 2.5px solid #4c2308;
  box-shadow: 0 3px 0 #3a1904, inset 0 1.5px 0 rgba(255, 232, 194, 0.5);
  color: #fffaf0;
  text-shadow: 0 1.5px 2px rgba(45, 18, 0, 0.72);
}

/* wood-sign.png dipertinggi ke bawah agar proporsional & tidak ceper */
.eng-wood-sign-btn {
  position: relative;
  width: clamp(255px, 43vw, 445px);
  height: clamp(64px, 18.5dvh, 92px);
  margin-top: -0.35rem;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.eng-wood-sign-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(15, 34, 20, 0.38));
}

.eng-wood-sign-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.32rem, 1vw, 0.65rem);
  padding: 0.1rem 2rem 0.42rem;
  color: #fffdf5;
  text-shadow: 0 1.5px 2px rgba(45, 18, 0, 0.85);
  white-space: nowrap;
}

.eng-sign-title {
  font-weight: 800;
  font-size: clamp(0.7rem, 2.7dvh, 1.02rem);
}

.eng-sign-count {
  background: rgba(58, 25, 4, 0.52);
  color: #fde68a;
  font-weight: 800;
  font-size: clamp(0.62rem, 2.3dvh, 0.86rem);
  padding: 0.06rem 0.45rem;
  border-radius: 9999px;
}

.eng-sign-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.12rem;
  font-size: clamp(0.74rem, 2.7dvh, 1.02rem);
}

.eng-press {
  transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.eng-press:active {
  transform: scale(0.92);
}

/* Workspace 2 Kolom */
.eng-workspace {
  position: relative;
  z-index: 10;
  flex: 1;
  min-height: 0;
  padding: 0 0.75rem 0.35rem;
  display: grid;
  grid-template-columns: clamp(170px, 27vw, 270px) minmax(0, 1fr);
  gap: clamp(0.35rem, 1.4vw, 1rem);
  align-items: stretch;
}

/* Kolom Kiri: Balon en-cakap.png rapat di atas kepala Dino + Dino + bg-papanUI.png */
.eng-dino-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-left: clamp(0.1rem, 1vw, 0.6rem);
}

.eng-cakap-btn {
  position: relative;
  z-index: 6;
  width: clamp(162px, 24.5vw, 246px);
  height: clamp(76px, 23dvh, 118px);
  margin-bottom: -2.95rem;
  margin-left: clamp(2.2rem, 35vw, 16.6rem);
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.eng-cakap-text {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0.35rem 9% 0.65rem 9%; /* ⬅️ Angka pertama (0.35rem) untuk turun/naik */
  font-weight: 800;
  font-size: clamp(0.72rem, 2.55dvh, 1rem);
  line-height: 1.18;
  color: #264b3a;
  text-align: center;
}
.eng-cakap-feedback {
  font-size: 1.14em;
}
.eng-cakap-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(24, 34, 18, 0.3));
}

.eng-cakap-text {
  position: relative;
  z-index: 2;
  padding: 0 15% 12% 15%;
  font-weight: 800;
  font-size: clamp(0.66rem, 2.35dvh, 0.9rem);
  line-height: 1.2;
  color: #264b3a;
  text-align: center;
}

.eng-dino-wrap {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform: translate(4px, 7px);
  flex-shrink: 1;
  min-height: 0;
}

.eng-dino-img {
  max-height: clamp(114px, 46dvh, 238px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(15, 36, 20, 0.38));
  transition: transform 0.25s ease;
}

.eng-dino-cheer {
  transform: translateY(-8px) scale(1.06);
}

.eng-papan-find {
  position: relative;
  z-index: 5;
  width: clamp(118px, 18vw, 174px);
  height: clamp(34px, 10.5dvh, 52px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.eng-papan-find-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(20, 32, 18, 0.38));
}

.eng-papan-find-text {
  position: relative;
  z-index: 2;
  font-weight: 800;
  font-size: clamp(0.86rem, 3.2dvh, 1.2rem);
  color: #3a1a05;
  text-shadow: 0 1px 0 rgba(255, 232, 185, 0.7);
}

/* Kolom Kanan: Papan Soal + 3 Pilihan digeser sedikit ke kiri */
.eng-play-col {
  height: 100%;
  min-height: 0;
  padding-right: clamp(0.9rem, 5vw, 3.6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.15rem;
}

/* Papan Soal en-soal.png (tanpa speaker -> huruf & teks plakat jauh lebih besar) */
.eng-soal-wrap {
  position: relative;
  height: clamp(120px, 42dvh, 230px);
  max-width: min(100%, 405px);
  aspect-ratio: 600 / 390;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.eng-soal-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(20, 36, 18, 0.35));
}

.eng-soal-main {
  position: absolute;
  top: 17%;
  bottom: 26%;
  left: 10%;
  right: 10%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.4rem;
}

.eng-soal-plaque {
  position: absolute;
  top: 74%;
  bottom: 6%;
  left: 20%;
  right: 20%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(0.98rem, 4.3dvh, 1.55rem);
  color: #3a1d06;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.eng-big-letter {
  font-size: clamp(3.8rem, 20.5dvh, 7.2rem);
  font-weight: 800;
  line-height: 0.9;
  text-shadow:
    0 5px 0 rgba(0, 0, 0, 0.16),
    0 8px 14px rgba(0, 0, 0, 0.14);
}

.eng-l2-word-main {
  font-weight: 800;
  font-size: clamp(1.5rem, 6.8dvh, 2.55rem);
  color: #1e3a5f;
}

.eng-l2-preview {
  height: 92%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.eng-l2-preview img {
  max-width: 96%;
  max-height: 96%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.eng-l3-phrase {
  font-weight: 800;
  font-size: clamp(0.96rem, 4.3dvh, 1.65rem);
  color: #1e3a5f;
  line-height: 1.22;
  text-align: center;
}

.eng-pulse-once {
  animation: engPulse 0.42s ease;
}

@keyframes engPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Dock 3 Pilihan (grid-template-rows dikunci agar gambar TIDAK meluber ke bawah!) */
.eng-pilihan-dock {
  position: relative;
  height: clamp(114px, 39dvh, 206px);
  width: auto;
  max-width: 100%;
  aspect-ratio: 880 / 300;
  flex-shrink: 0;
}

.eng-pilihan-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(14, 34, 20, 0.32));
}

.eng-pilihan-overlay {
  position: absolute;
  top: 10%;
  bottom: 34%;
  left: 4.5%;
  right: 4.5%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 3%;
}

.eng-choice-slot {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: transparent;
  border: 3px solid transparent;
  border-radius: 1rem;
  padding: 6%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.eng-choice-slot img {
  max-width: 92%;
  max-height: 92%;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(20, 32, 20, 0.16));
}

/* Otomatis menyamarkan kotak putih bila masih memakai fallback .jpg */
.eng-jpg-blend {
  mix-blend-mode: multiply;
  filter: none !important;
}

.eng-choice-slot.is-correct {
  border-color: #fde047;
  background: rgba(254, 240, 138, 0.28);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.95);
  transform: scale(1.04);
}

.eng-choice-slot.is-wrong {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.2);
  animation: engShake 0.35s ease;
}

@keyframes engShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@media (orientation: landscape) and (max-height: 1024px) {
  #gameplayCanvasContent .eng-stage {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
  }

  #engOverlayModal {
    padding: 0.45rem !important;
  }

  #engOverlayModal .eng-modal-card {
    max-height: 94dvh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #engOverlayModal .eng-modal-card::-webkit-scrollbar {
    display: none;
  }
}
/* Teks pilihan kata bahasa Inggris untuk Level 2 */
.eng-choice-word {
  font-weight: 800;
  font-size: clamp(0.95rem, 4.4dvh, 1.55rem);
  line-height: 1.12;
  color: #1e3a5f;
  text-align: center;
  word-break: break-word;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.85);
}

.eng-choice-word.is-long {
  font-size: clamp(0.76rem, 3.3dvh, 1.18rem);
}

.eng-plaque-sm {
  font-size: 0.78em;
}
/* =========================================
   ENGLISH ADVENTURE SD KELAS 1–3
========================================= */
.esd-missing-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

.esd-mini-img {
  height: 52%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.esd-mini-img img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.esd-letter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.18rem, 0.7vw, 0.42rem);
}

.esd-letter-char {
  font-weight: 800;
  font-size: clamp(1.15rem, 5.4dvh, 2.05rem);
  color: #1e3a5f;
  line-height: 1;
}

.esd-letter-row.is-compact .esd-letter-char {
  font-size: clamp(0.95rem, 4.3dvh, 1.6rem);
}

.esd-missing-box {
  width: clamp(1.45rem, 6.4dvh, 2.35rem);
  height: clamp(1.45rem, 6.4dvh, 2.35rem);
  border-radius: 0.45rem;
  border: 2.5px solid #b46924;
  background: linear-gradient(180deg, #fde68a 0%, #f59e0b 100%);
  box-shadow: inset 0 2px 4px rgba(120, 53, 15, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: clamp(1.05rem, 4.8dvh, 1.8rem);
  color: #ffffff;
}

.esd-letter-row.is-compact .esd-missing-box {
  width: clamp(1.25rem, 5.2dvh, 1.9rem);
  height: clamp(1.25rem, 5.2dvh, 1.9rem);
  font-size: clamp(0.9rem, 3.8dvh, 1.4rem);
}

.esd-missing-box.is-filled {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  border-color: #14532d;
}

.esd-letter-space {
  width: 0.45rem;
}

.esd-choice-letter {
  font-weight: 800;
  font-size: clamp(1.75rem, 8.8dvh, 3.2rem);
  color: #1e3a5f;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.85);
}

.eng-choice-word.is-xlong {
  font-size: clamp(0.68rem, 2.75dvh, 0.98rem);
}

/* Kalimat & Grammar di papan soal */
.esd-sentence-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0 0.35rem;
}

.esd-sent-img {
  height: 48%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.esd-sent-img img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.esd-sentence-text,
.esd-qa-text,
.esd-clue-text {
  font-weight: 800;
  font-size: clamp(0.8rem, 3.5dvh, 1.32rem);
  line-height: 1.24;
  color: #1e3a5f;
  text-align: center;
}

.esd-blank-slot {
  color: #d97706;
  border-bottom: 3px solid #d97706;
  padding: 0 0.2rem;
}

.esd-blank-filled {
  color: #15803d;
  background: #dcfce7;
  padding: 0.05rem 0.35rem;
  border-radius: 0.4rem;
}

/* Pilihan Gambar + Label (Read & Guess Kelas 2 L3) */
.esd-img-choice {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
}

.esd-img-choice-pic {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.esd-img-choice-pic img {
  max-height: 94%;
  max-width: 90%;
  object-fit: contain;
}

.esd-img-choice-label {
  font-weight: 800;
  font-size: clamp(0.62rem, 2.25dvh, 0.85rem);
  color: #1e3a5f;
  line-height: 1.05;
}

/* Mini Story Quiz (Kelas 3 L3) */
.esd-story-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0 0.35rem;
  text-align: center;
}

.esd-story-body {
  font-weight: 700;
  font-size: clamp(0.68rem, 2.75dvh, 1.04rem);
  line-height: 1.22;
  color: #334155;
}

.esd-story-q {
  font-weight: 800;
  font-size: clamp(0.72rem, 2.95dvh, 1.12rem);
  line-height: 1.2;
  color: #b45309;
}
/* Perbesar tulisan balon percakapan Dino & kalimat panjang di papan soal SD Kelas 1–3 */
.esd-cakap-text {
  padding: 0.28rem 7% 0.rem 7%;
  font-size: clamp(0.84rem, 3.05dvh, 1.18rem);
  line-height: 1.16;
}

.esd-soal-main {
  top: 15%;
  bottom: 25%;
  left: 8%;
  right: 8%;
  padding: 0 0.2rem;
}

.esd-sentence-wrap {
  gap: 0.18rem;
  padding: 0 0.12rem;
}

.esd-sent-img {
  height: 43%;
}

.esd-sentence-text,
.esd-qa-text,
.esd-clue-text {
  font-size: clamp(0.95rem, 4.15dvh, 1.56rem);
  line-height: 1.2;
}

.esd-story-wrap {
  gap: 0.2rem;
  padding: 0 0.12rem;
}

.esd-story-body {
  font-size: clamp(0.82rem, 3.35dvh, 1.26rem);
  line-height: 1.18;
}

.esd-story-q {
  font-size: clamp(0.86rem, 3.55dvh, 1.34rem);
  line-height: 1.16;
}
/* =========================================
   FIX RESPONSIF CREATIVE STUDIO (HP, TABLET 4:3/16:10 & LAPTOP)
   + PALET 18 WARNA (3x6) + FIX PAUSE LAPTOP & KANVAS TABLET
========================================= */

/* 1. Sembunyikan kapsul judul secara aman (dipisah dari :has agar Chrome tablet lama tetap jalan) */
#screen-4.creative-view-draw #gameplayTitle,
#screen-4.creative-view-draw #gameplayTitlePill {
  display: none !important;
}
#screen-4.creative-view-draw header div:has(> #gameplayTitle) {
  display: none !important;
}
@media (orientation: landscape) {
  /* 2. Header khusus Creative Studio selebar 100% agar tombol Pause tidak tertarik ke tengah di laptop */
  #screen-4.creative-active header {
    z-index: 36 !important;
  }
  #screen-4.creative-active header > div {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  /* 3. Full-screen Creative Studio untuk semua tinggi layar landscape (termasuk laptop > 1024px) */
  #screen-4.creative-active {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  #screen-4.creative-active header {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    background: transparent !important;
    border-bottom: none !important;
    backdrop-filter: none !important;
    pointer-events: none;
  }

  #screen-4.creative-active header button,
  #screen-4.creative-active header .hud-pill {
    pointer-events: auto;
  }

  #screen-4.creative-active main {
    position: relative;
    max-width: 100% !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #screen-4.creative-active .landscape-hide {
    display: none !important;
  }

  #screen-4.creative-active .game-board-box,
  #screen-4.creative-active #gameplayCanvasContent {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  #screen-4.creative-active .creative-stage-wrapper {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    border: none !important;
    border-radius: 0 !important;
  }

  /* Layar 1: Pilih Gambar 3x2 */
  #screen-4.creative-active .creative-picker-content {
    padding: 3.6rem clamp(1rem, 4vw, 2.5rem) 1rem !important;
    overflow: hidden !important;
  }

  #screen-4.creative-active .creative-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    gap: clamp(0.55rem, 1.8vw, 1.25rem) !important;
  }

  /* Layar 2: Kanvas anti-titik (fallback vh + dvh & dikunci dua sumbu) */
  #screen-4.creative-active .creative-canvas-shell {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #screen-4.creative-active .creative-canvas-paper {
    width: min(100%, calc(92vh * 4 / 3)) !important;
    width: min(100%, calc(92dvh * 4 / 3)) !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    max-height: 92dvh !important;
    aspect-ratio: 4 / 3 !important;
    flex-shrink: 0 !important;
  }

  /* Kartu Contoh Warna proporsional di semua layar */
  #screen-4.creative-active #creativeRefBox img,
  #screen-4.creative-active #creativeTKRefBox img {
    width: clamp(76px, 11.5vw, 134px) !important;
    height: auto !important;
    aspect-ratio: 4 / 3 !important;
  }

  /* Panel Kanan: 18 Warna (3 kolom x 6 baris) — ukuran aman untuk HP Landscape */
  #screen-4.creative-active .creative-right-dock {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    padding: 0.45rem !important;
    gap: 0.3rem !important;
  }

  #screen-4.creative-active .creative-swatch-btn {
    width: clamp(23px, 7.6vh, 34px) !important;
    height: clamp(23px, 7.6vh, 34px) !important;
    width: clamp(23px, 7.6dvh, 34px) !important;
    height: clamp(23px, 7.6dvh, 34px) !important;
  }
}

/* 4. Khusus TABLET Landscape (4:3 & 16:10) dan LAPTOP */
@media (orientation: landscape) and (min-height: 541px) {
  #screen-4.creative-active header {
    padding: 0.75rem 1.25rem !important;
  }

  #screen-4.creative-active #pauseToggleBtn,
  #screen-4.creative-active .creative-back-floating {
    width: 44px !important;
    height: 44px !important;
  }

  #screen-4.creative-active .creative-back-floating {
    top: 0.75rem !important;
    left: 1.25rem !important;
  }

  /* 4 Ikon aksi sejajar rapi tepat di sebelah kiri Pause tanpa pernah bertumpuk */
  #screen-4.creative-active .creative-top-actions {
    top: 0.75rem !important;
    right: 4.75rem !important;
    height: 44px !important;
    gap: 0.65rem !important;
    align-items: center !important;
  }

  #screen-4.creative-active .creative-top-actions .creative-icon-btn {
    width: 36px !important;
    height: 36px !important;
  }

  /* Beri ruang atas khusus header agar kanvas & dock tidak menabrak ikon atas */
  #screen-4.creative-active .creative-draw-layout {
    padding: 4.25rem clamp(1rem, 2.2vw, 1.75rem) 1rem !important;
    gap: clamp(0.75rem, 1.8vw, 1.5rem) !important;
  }

  #screen-4.creative-active .creative-left-dock,
  #screen-4.creative-active .creative-right-dock {
    margin-top: 0 !important;
  }

  #screen-4.creative-active .creative-canvas-paper {
    width: min(100%, calc((100vh - 5.5rem) * 4 / 3)) !important;
    width: min(100%, calc((100dvh - 5.5rem) * 4 / 3)) !important;
    max-height: 100% !important;
  }

  /* Panel Kiri (Alat) lebih lega di Tablet & Laptop */
  #screen-4.creative-active .creative-tool-btn {
    width: clamp(72px, 8vw, 88px) !important;
    height: clamp(62px, 10.5vh, 80px) !important;
    height: clamp(62px, 10.5dvh, 80px) !important;
  }

  /* Panel Kanan (18 Warna 3x6) nyaman diklik anak di Tablet & Laptop */
  #screen-4.creative-active .creative-right-dock {
    padding: 0.65rem !important;
    gap: 0.45rem !important;
  }

  #screen-4.creative-active .creative-swatch-btn {
    width: clamp(32px, 5.2vh, 42px) !important;
    height: clamp(32px, 5.2vh, 42px) !important;
    width: clamp(32px, 5.2dvh, 42px) !important;
    height: clamp(32px, 5.2dvh, 42px) !important;
  }
}
/* =========================================
   FIX RESPONSIF CREATIVE STUDIO SD (TABLET & LAPTOP)
   + FALLBACK VH ANTI-IKON RAKSASA + DINO NAPAK & LEBIH BESAR
========================================= */

/* 1. Fallback vh sebelum dvh untuk semua elemen Creative Studio SD (bereskan ikon raksasa di Chrome tablet) */
.csd-header-icon-btn {
  width: clamp(34px, 9.5vh, 46px);
  height: clamp(34px, 9.5vh, 46px);
  width: clamp(34px, 9.5dvh, 46px);
  height: clamp(34px, 9.5dvh, 46px);
}

.csd-pan-toggle-btn {
  width: clamp(34px, 9.5vh, 44px);
  height: clamp(34px, 9.5vh, 44px);
  font-size: clamp(1rem, 3.2vh, 1.3rem);
  width: clamp(34px, 9.5dvh, 44px);
  height: clamp(34px, 9.5dvh, 44px);
  font-size: clamp(1rem, 3.2dvh, 1.3rem);
}

.csd-picker-title {
  font-size: clamp(0.88rem, 3.3vh, 1.25rem);
  font-size: clamp(0.88rem, 3.3dvh, 1.25rem);
}

.csd-float-tool {
  width: clamp(40px, 11.8vh, 56px);
  height: clamp(40px, 11.8vh, 56px);
  width: clamp(40px, 11.8dvh, 56px);
  height: clamp(40px, 11.8dvh, 56px);
}

.csd-prev-corner-btn {
  width: clamp(38px, 11.2vh, 52px);
  height: clamp(38px, 11.2vh, 52px);
  width: clamp(38px, 11.2dvh, 52px);
  height: clamp(38px, 11.2dvh, 52px);
}

/* Dino napak di dasar wrapper di semua layar (termasuk HP) */
.csd-guide-dino-wrap {
  align-items: flex-end !important;
  justify-content: center !important;
  overflow: visible !important;
}

.csd-guide-dino {
  max-height: clamp(92px, 36vh, 188px);
  max-height: clamp(92px, 36dvh, 188px);
  object-position: bottom center;
  margin-bottom: -6px;
  position: relative;
  z-index: 2;
}

.csd-mission-card {
  position: relative;
  z-index: 3;
}

#csdOverlayModal .csd-modal-card {
  max-height: 94vh;
  max-height: 94dvh;
}

#csdOverlayModal .csd-scroll-clean {
  max-height: 54vh;
  max-height: 54dvh;
}

/* 2. Full-screen Creative Studio SD untuk semua ukuran layar landscape (termasuk laptop tinggi > 1024px) */
@media (orientation: landscape) {
  #gameplayCanvasContent .csd-stage {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
  }
}

/* 3. Khusus TABLET Landscape (4:3 & 16:10) dan LAPTOP */
@media (orientation: landscape) and (min-height: 541px) {
  .csd-hud-top {
    padding: 0.55rem 1rem 0.25rem !important;
  }

  .csd-header-icon-btn {
    width: 44px !important;
    height: 44px !important;
  }

  .csd-pan-toggle-btn {
    width: 42px !important;
    height: 42px !important;
    font-size: 1.25rem !important;
  }

  /* Lebarkan sedikit kolom kiri agar Dino leluasa diperbesar */
  .csd-workspace {
    padding: 0.25rem 1rem 0.65rem !important;
    grid-template-columns: clamp(165px, 20vw, 240px) minmax(0, 1fr) clamp(175px, 21vw, 232px) !important;
    gap: clamp(0.65rem, 1.4vw, 1.1rem) !important;
  }

  /* Dino lebih besar & kaki napak pas di atas kartu Misi Kreatif */
  .csd-guide-col {
    gap: 0.2rem !important;
    padding: 0.2rem 0 0.1rem !important;
  }

  .csd-guide-dino {
    height: 100% !important;
    max-height: clamp(220px, 54vh, 360px) !important;
    max-height: clamp(220px, 54dvh, 360px) !important;
    width: auto !important;
    max-width: 108% !important;
    object-fit: contain !important;
    object-position: bottom center !important;
    margin-bottom: -10px !important;
  }

  /* Kanvas tetap proporsional 640:440 (tidak gepeng di tablet 4:3) & 6 alat rapat di bawahnya */
  .csd-easel-wrap {
    justify-content: center !important;
    gap: 0.55rem !important;
  }

  .csd-easel-frame {
    flex: 0 1 auto !important;
    width: min(100%, calc((100vh - 140px) * 640 / 440)) !important;
    width: min(100%, calc((100dvh - 140px) * 640 / 440)) !important;
    height: auto !important;
    max-height: calc(100% - 66px) !important;
  }

  .csd-easel-viewport {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 640 / 440 !important;
  }

  .csd-draw-canvas {
    width: 100% !important;
    height: 100% !important;
  }

  .csd-float-tool {
    width: clamp(46px, 6.6vh, 56px) !important;
    height: clamp(46px, 6.6vh, 56px) !important;
    width: clamp(46px, 6.6dvh, 56px) !important;
    height: clamp(46px, 6.6dvh, 56px) !important;
  }

  /* Panel 24 Warna Krayon & tombol previous di kanan bawah selalu muat utuh */
  .csd-right-stack {
    padding-top: 0.25rem !important;
    gap: 0.5rem !important;
  }

  .csd-wood-panel {
    max-height: calc(100% - 62px) !important;
    padding: 0.5rem !important;
  }

  .csd-swatch-grid {
    gap: 0.35rem !important;
  }

  .csd-prev-corner-btn {
    width: 50px !important;
    height: 50px !important;
  }
}
/* Turunkan kotak krayon khusus tablet (4:3 & 16:10) agar sejajar kanvas */
@media (orientation: landscape) and (min-height: 541px) and (max-aspect-ratio: 16 / 10) {
  .csd-right-stack {
    padding-top: 3.5rem !important; /* ⬅️ Geser naik/turun angka ini sesuai selera di tablet */
  }
}
/* Khusus HP Landscape: Dino lebih besar & kaki napak pas di atas kartu Misi Kreatif */
@media (orientation: landscape) and (max-height: 540px) {
  .csd-guide-dino {
    max-height: clamp(135px, 46vh, 215px) !important;
    max-height: clamp(135px, 46dvh, 215px) !important;
    transform-origin: bottom center;
    transform: translateY(14px) scale(1.12); /* ⬅️ Geser & besar/kecilkan di sini */
  }
}
/* =========================================
   FIX SCIENCE EXPLORER SD (TABLET CHROME LAMA & LAPTOP)
   + FALLBACK VH UNTUK TEKS MISI & TOMBOL KONTROL
========================================= */
.ssd-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ssd-mission-center-wrap {
  top: clamp(58px, 15vh, 84px);
  top: clamp(58px, 15.5dvh, 84px);
}

.ssd-mission-text {
  font-size: clamp(0.95rem, 3.6vh, 1.32rem);
  font-size: clamp(0.95rem, 3.6dvh, 1.32rem);
}

.ssd-ctrl-btn {
  width: clamp(60px, 17.5vh, 80px);
  height: clamp(60px, 17.5vh, 80px);
  width: clamp(60px, 17.5dvh, 80px);
  height: clamp(60px, 17.5dvh, 80px);
}

@media (orientation: landscape) {
  #gameplayCanvasContent .ssd-stage {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
  }

  #ssdOverlayModal .ssd-modal-card {
    max-height: 94vh;
    max-height: 94dvh;
    min-height: min(82vh, 330px);
    min-height: min(82dvh, 330px);
  }
}

@media (orientation: landscape) and (min-height: 541px) {
  .ssd-hud-top {
    padding: 0.65rem 1rem !important;
  }

  .ssd-mission-center-wrap {
    top: clamp(72px, 11vh, 96px) !important;
    top: clamp(72px, 11dvh, 96px) !important;
  }

  .ssd-controls {
    padding: 0.9rem 1.35rem !important;
  }

  .ssd-ctrl-btn {
    width: clamp(68px, 10vh, 82px) !important;
    height: clamp(68px, 10vh, 82px) !important;
    width: clamp(68px, 10dvh, 82px) !important;
    height: clamp(68px, 10dvh, 82px) !important;
  }
}
/* =========================================
   FIX RESPONSIF ALPHABET & PUZZLE (TABLET CHROME LAMA & LAPTOP)
========================================= */
@media (orientation: landscape) {
  #screen-4 {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
  }

  #gameplayCanvasContent .alphabet-stage-wrapper,
  #gameplayCanvasContent .puzzle-stage-wrapper,
  #gameplayCanvasContent .psd-stage {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    flex: 1 0 100% !important;
    border: none !important;
    border-radius: 0 !important;
  }

  /* Puzzle PAUD & TK: fallback vh agar tidak menyusut di Chrome tablet */
  .puzzle-board-grid {
    width: min(64vh, 48vw);
    height: min(64vh, 48vw);
    width: min(64dvh, 48vw);
    height: min(64dvh, 48vw);
  }

  .puzzle-tray-grid .puzzle-piece {
    width: min(17vh, 12vw);
    height: min(17vh, 12vw);
    width: min(17dvh, 12vw);
    height: min(17dvh, 12vw);
  }

  /* Puzzle SD (Kelas 1–3): fallback vh agar bingkai 4:3 tidak gepeng/kecil di Chrome tablet */
  .psd-board-frame,
  .psd-tray {
    width: min(45.5vw, calc((100vh - 86px) * 4 / 3), 500px);
    width: min(45.5vw, calc((100dvh - 86px) * 4 / 3), 500px);
  }
}
/* =========================================
   FIX JARAK LEVEL & SUDUT KARTU PUZZLE SD (TABLET & LAPTOP)
========================================= */
.psd-gallery-wrap {
  gap: clamp(12px, 2.2vh, 22px);
  gap: clamp(12px, 2.2dvh, 22px);
  padding: clamp(8px, 1.6vh, 16px) clamp(12px, 3vw, 32px);
  padding: clamp(8px, 1.6dvh, 16px) clamp(12px, 3vw, 32px);
}

.psd-pick-card {
  border-radius: clamp(0.95rem, 2.2vh, 1.5rem);
  border-radius: clamp(0.95rem, 2.2dvh, 1.5rem);
}

@media (orientation: landscape) and (min-height: 541px) {
  .psd-gallery-wrap {
    gap: clamp(24px, 4.2vh, 40px) !important; /* ⬅️ Jarak tombol Level dengan 3 kotak pilihan */
    padding-bottom: clamp(22px, 5vh, 48px) !important; /* ⬅️ Angkat sedikit ke atas */
  }
}
/* =========================================
   FIX APP-SHELL BERANDA HP & TABLET
   (Menu bawah 100% utuh, tidak terpotong setengah & klik selalu aktif)
========================================= */
html,
body {
  overflow-x: clip !important;
}

/* Menu bawah tidak pernah muncul di luar #screen-3 */
#screen-3.hidden nav[aria-label="Navigasi Bawah Anak"] {
  display: none !important;
}

@media (max-width: 1023px) {
  /* Kunci #screen-3 pas setinggi layar aktif agar bar browser tidak menggeser menu */
  #screen-3:not(.hidden) {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    z-index: 10 !important;
    display: flex !important;
    flex-direction: column !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
  }

  /* Wrapper konten utama (Header + Main) */
  #screen-3:not(.hidden) > div {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  /* Header atas menempel rapi di puncak */
  #screen-3:not(.hidden) #childDashboardTop {
    position: relative !important;
    top: auto !important;
    flex-shrink: 0 !important;
    z-index: 20 !important;
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Hanya area tengah (daftar game / galeri / toko / taman) yang di-scroll */
  #screen-3:not(.hidden) > div > main {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    padding-bottom: 1.5rem !important;
  }

  /* Menu bawah jadi bagian flex tetap (bukan fixed melayang) */
  #screen-3:not(.hidden) > nav[aria-label="Navigasi Bawah Anak"] {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    -webkit-transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 0 !important;
    flex-shrink: 0 !important;
    z-index: 30 !important;
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom)) !important;
    pointer-events: auto !important;
  }
}
/* =========================================
   FIX ENGLISH ADVENTURE (CHROME TABLET LAMA + LAPTOP)
   & HIDE HEADER BAWAAN KHUSUS MATH ADVENTURE SD
========================================= */

/* 1. Sembunyikan header bawaan (#screen-4) saat Math Adventure SD aktif
      agar pil putih "Level 1 • 2/4" tidak muncul menumpuk di belakang "Level 1-1 Kelas 1" */
#screen-4.math-sd-active > header,
#screen-4.math-sd-active > footer,
#screen-4.math-sd-active .landscape-hide,
#screen-4.math-sd-active #gameplayPromptHint {
  display: none !important;
}

/* 2. Fallback satuan vh sebelum dvh untuk seluruh elemen English Adventure (PAUD, TK & SD) */
.eng-wood-sign-btn {
  height: clamp(64px, 18.5vh, 92px);
  height: clamp(64px, 18.5dvh, 92px);
}

.eng-sign-title {
  font-size: clamp(0.7rem, 2.7vh, 1.02rem);
  font-size: clamp(0.7rem, 2.7dvh, 1.02rem);
}

.eng-sign-count {
  font-size: clamp(0.62rem, 2.3vh, 0.86rem);
  font-size: clamp(0.62rem, 2.3dvh, 0.86rem);
}

.eng-sign-stars {
  font-size: clamp(0.74rem, 2.7vh, 1.02rem);
  font-size: clamp(0.74rem, 2.7dvh, 1.02rem);
}

.eng-cakap-btn {
  height: clamp(76px, 23vh, 118px);
  height: clamp(76px, 23dvh, 118px);
}

.eng-cakap-text {
  font-size: clamp(0.68rem, 2.35vh, 0.94rem);
  font-size: clamp(0.68rem, 2.35dvh, 0.94rem);
}

.eng-dino-img {
  max-height: clamp(114px, 46vh, 238px);
  max-height: clamp(114px, 46dvh, 238px);
}

.eng-papan-find {
  height: clamp(34px, 10.5vh, 52px);
  height: clamp(34px, 10.5dvh, 52px);
}

.eng-papan-find-text {
  font-size: clamp(0.86rem, 3.2vh, 1.2rem);
  font-size: clamp(0.86rem, 3.2dvh, 1.2rem);
}

/* Papan Soal & Dock 3 Pilihan dikunci tinggi + lebarnya agar tidak pernah mengempis 0px */
.eng-soal-wrap {
  height: clamp(120px, 42vh, 240px);
  height: clamp(120px, 42dvh, 240px);
  width: min(100%, 420px);
}

.eng-soal-plaque {
  font-size: clamp(0.98rem, 4.3vh, 1.55rem);
  font-size: clamp(0.98rem, 4.3dvh, 1.55rem);
}

.eng-big-letter {
  font-size: clamp(3.8rem, 20.5vh, 7.2rem);
  font-size: clamp(3.8rem, 20.5dvh, 7.2rem);
}

.eng-l2-word-main {
  font-size: clamp(1.5rem, 6.8vh, 2.55rem);
  font-size: clamp(1.5rem, 6.8dvh, 2.55rem);
}

.eng-l3-phrase {
  font-size: clamp(0.96rem, 4.3vh, 1.65rem);
  font-size: clamp(0.96rem, 4.3dvh, 1.65rem);
}

.eng-pilihan-dock {
  height: clamp(114px, 39vh, 220px);
  height: clamp(114px, 39dvh, 220px);
  width: min(100%, 620px);
}

.eng-choice-word {
  font-size: clamp(0.95rem, 4.4vh, 1.55rem);
  font-size: clamp(0.95rem, 4.4dvh, 1.55rem);
}

.eng-choice-word.is-long {
  font-size: clamp(0.76rem, 3.3vh, 1.18rem);
  font-size: clamp(0.76rem, 3.3dvh, 1.18rem);
}

.eng-choice-word.is-xlong {
  font-size: clamp(0.68rem, 2.75vh, 0.98rem);
  font-size: clamp(0.68rem, 2.75dvh, 0.98rem);
}

/* Fallback vh untuk English Adventure SD */
.esd-cakap-text {
  padding: 0.28rem 8% 0.55rem 8%;
  font-size: clamp(0.84rem, 3.05vh, 1.18rem);
  font-size: clamp(0.84rem, 3.05dvh, 1.18rem);
}

.esd-letter-char {
  font-size: clamp(1.15rem, 5.4vh, 2.05rem);
  font-size: clamp(1.15rem, 5.4dvh, 2.05rem);
}

.esd-letter-row.is-compact .esd-letter-char {
  font-size: clamp(0.95rem, 4.3vh, 1.6rem);
  font-size: clamp(0.95rem, 4.3dvh, 1.6rem);
}

.esd-missing-box {
  width: clamp(1.45rem, 6.4vh, 2.35rem);
  height: clamp(1.45rem, 6.4vh, 2.35rem);
  font-size: clamp(1.05rem, 4.8vh, 1.8rem);
  width: clamp(1.45rem, 6.4dvh, 2.35rem);
  height: clamp(1.45rem, 6.4dvh, 2.35rem);
  font-size: clamp(1.05rem, 4.8dvh, 1.8rem);
}

.esd-letter-row.is-compact .esd-missing-box {
  width: clamp(1.25rem, 5.2vh, 1.9rem);
  height: clamp(1.25rem, 5.2vh, 1.9rem);
  font-size: clamp(0.9rem, 3.8vh, 1.4rem);
  width: clamp(1.25rem, 5.2dvh, 1.9rem);
  height: clamp(1.25rem, 5.2dvh, 1.9rem);
  font-size: clamp(0.9rem, 3.8dvh, 1.4rem);
}

.esd-choice-letter {
  font-size: clamp(1.75rem, 8.8vh, 3.2rem);
  font-size: clamp(1.75rem, 8.8dvh, 3.2rem);
}

.esd-sentence-text,
.esd-qa-text,
.esd-clue-text {
  font-size: clamp(0.95rem, 4.15vh, 1.56rem);
  font-size: clamp(0.95rem, 4.15dvh, 1.56rem);
}

.esd-img-choice-label {
  font-size: clamp(0.62rem, 2.25vh, 0.85rem);
  font-size: clamp(0.62rem, 2.25dvh, 0.85rem);
}

.esd-story-body {
  font-size: clamp(0.82rem, 3.35vh, 1.26rem);
  font-size: clamp(0.82rem, 3.35dvh, 1.26rem);
}

.esd-story-q {
  font-size: clamp(0.86rem, 3.55vh, 1.34rem);
  font-size: clamp(0.86rem, 3.55dvh, 1.34rem);
}

/* Full-screen English Adventure untuk semua ukuran layar landscape (termasuk tablet & laptop) */
@media (orientation: landscape) {
  #gameplayCanvasContent .eng-stage {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    border: none !important;
    border-radius: 0 !important;
  }

  #engOverlayModal .eng-modal-card {
    max-height: 94vh;
    max-height: 94dvh;
  }
}

/* Proporsi rapi khusus TABLET Landscape (min-height: 541px) & LAPTOP */
@media (orientation: landscape) and (min-height: 541px) {
  .eng-hud-top {
    padding: 0.45rem 1rem 0 !important;
  }

  .eng-wood-sign-btn {
    width: clamp(320px, 44vw, 480px) !important;
    height: clamp(74px, 12vh, 96px) !important;
    margin-top: -0.2rem !important;
  }

  .eng-workspace {
    padding: 0.25rem 1.25rem 0.9rem !important;
    grid-template-columns: clamp(210px, 28vw, 310px) minmax(0, 1fr) !important;
    gap: 1.25rem !important;
  }

  /* Balon percakapan rapi di atas kepala Dino, tidak kabur ke kanan */
 .eng-cakap-btn {
    width: clamp(250px, 30vw, 340px) !important;         /* Lebar balon */
    height: clamp(100px, 10vh, 100px) !important;        /* Tinggi balon (besarkan bareng width!) */
    margin-bottom: -4.2rem !important;                   /* Naik / Turun */
    margin-left: clamp(1.5rem, 32vw, 20.5rem) !important;  /* Geser Kiri / Kanan */
  }
  /* Teks di dalam balon agar lega & tidak nempel ke garis pinggir */
  .eng-cakap-text,
  .esd-cakap-text {
    padding: 0.25rem 12% 0.9rem 12% !important;          /* Jarak teks: Atas | Kanan | Bawah | Kiri */
    font-size: clamp(0.85rem, 2.4vh, 1.1rem) !important; /* Ukuran huruf di dalam balon */
  }

  .eng-dino-img {
    max-height: clamp(180px, 42vh, 290px) !important;
  }

  .eng-papan-find {
    width: clamp(140px, 18vw, 188px) !important;
    height: clamp(44px, 7.5vh, 56px) !important;
  }

  /* Kolom Kanan: Papan soal & 3 pilihan seimbang di tengah */
  .eng-play-col {
    justify-content: center !important;
    gap: clamp(0.75rem, 2.5vh, 1.5rem) !important;
    padding-right: clamp(0.5rem, 2vw, 2rem) !important;
  }

  .eng-soal-wrap {
    height: clamp(185px, 38vh, 280px) !important;
    width: min(100%, 440px) !important;
  }

  .eng-pilihan-dock {
    height: clamp(150px, 31vh, 230px) !important;
    width: min(100%, 620px) !important;
  }
}/* =========================================
   FIX TEKS SOAL ENGLISH SD RAPI 2 BARIS DI DALAM PAPAN (HP & TABLET)
========================================= */
.eng-soal-wrap {
  width: clamp(185px, 64.6vh, 369px) !important;
  width: clamp(185px, 64.6dvh, 369px) !important;
  max-width: 100% !important;
}

.eng-soal-main,
.esd-soal-main {
  left: 11% !important;
  right: 11% !important;
  overflow: hidden;
}

.esd-sentence-wrap,
.esd-story-wrap {
  width: 100%;
  max-width: 100%;
  padding: 0 0.2rem !important;
}

.esd-sentence-text,
.esd-qa-text,
.esd-clue-text,
.eng-l3-phrase {
  width: 100%;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: break-word;
  word-wrap: break-word;
  text-wrap: balance;
}

/* Khusus HP Landscape: ukuran huruf pas untuk 2 baris di dalam papan */
@media (orientation: landscape) and (max-height: 540px) {
  .esd-sentence-text,
  .esd-qa-text,
  .esd-clue-text {
    font-size: clamp(0.76rem, 3.6vh, 1.02rem) !important;
    font-size: clamp(0.76rem, 3.6dvh, 1.02rem) !important;
    line-height: 1.28 !important;
  }

  .esd-story-body {
    font-size: clamp(0.68rem, 2.9vh, 0.9rem) !important;
    font-size: clamp(0.68rem, 2.9dvh, 0.9rem) !important;
    line-height: 1.2 !important;
  }

  .esd-story-q {
    font-size: clamp(0.72rem, 3.1vh, 0.95rem) !important;
    font-size: clamp(0.72rem, 3.1dvh, 0.95rem) !important;
    line-height: 1.2 !important;
  }
}

/* Khusus Tablet & Laptop: lebar papan tetap pas mengikuti rasio 600:390 */
@media (orientation: landscape) and (min-height: 541px) {
  .eng-soal-wrap {
    width: clamp(285px, 58.5vh, 431px) !important;
    max-width: 100% !important;
  }
}