/* ============================================================
   Ceria Huruf — gaya super lucu untuk anak TK 🌈
   Warna pastel, tombol chunky, animasi bounce/wiggle yang halus.
   ============================================================ */
:root {
  --pink: #ff6b9d;
  --pink-dark: #e14e82;
  --blue: #4ecdc4;
  --blue-dark: #35a8a0;
  --yellow: #ffd93d;
  --yellow-dark: #e0b400;
  --purple: #a78bfa;
  --purple-dark: #8b5cf6;
  --green: #6bcb77;
  --green-dark: #4daa58;
  --orange: #ff9f5a;
  --orange-dark: #e07f35;
  --ink: #4a4a68;
  --card: #ffffff;
  --radius: 24px;
}

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

html, body { margin: 0; padding: 0; }

body {
  font-family: "Baloo 2", "Fredoka", "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(180deg, #ffeef8 0%, #e8f7ff 45%, #fff8e1 100%);
  overflow-x: hidden;
  touch-action: manipulation;
}

/* ---------- Dekorasi latar ---------- */
#bg-decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.rainbow {
  position: absolute; top: -70px; left: 50%; transform: translateX(-50%);
  width: 560px; height: 280px; border-radius: 280px 280px 0 0;
  background: repeating-radial-gradient(circle at 50% 100%,
    #ffb3c7 0 22px, #ffd6a5 22px 44px, #fdffb6 44px 66px,
    #caffbf 66px 88px, #9bf6ff 88px 110px, #bdb2ff 110px 132px);
  opacity: 0.35;
}

.cloud {
  position: absolute; background: #fff; border-radius: 50px; opacity: 0.9;
  animation: drift 18s linear infinite;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: #fff; border-radius: 50%;
}
.cloud.c1 { width: 110px; height: 36px; top: 12%; left: -140px; }
.cloud.c1::before { width: 44px; height: 44px; top: -20px; left: 20px; }
.cloud.c1::after { width: 30px; height: 30px; top: -14px; left: 58px; }
.cloud.c2 { width: 80px; height: 28px; top: 32%; left: -110px; animation-duration: 26s; animation-delay: -8s; opacity: 0.7; }
.cloud.c2::before { width: 34px; height: 34px; top: -15px; left: 15px; }
.cloud.c2::after { width: 24px; height: 24px; top: -10px; left: 44px; }
.cloud.c3 { width: 130px; height: 42px; top: 58%; left: -160px; animation-duration: 34s; animation-delay: -18s; opacity: 0.55; }
.cloud.c3::before { width: 52px; height: 52px; top: -24px; left: 26px; }
.cloud.c3::after { width: 36px; height: 36px; top: -16px; left: 70px; }

@keyframes drift { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 320px)); } }

.balloon { position: absolute; display: flex; flex-direction: column; align-items: center; animation: floaty 6s ease-in-out infinite; }
.balloon-body { width: 46px; height: 58px; border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%; display: block; }
.balloon-string { width: 2px; height: 44px; background: #999; display: block; }
.b1 { top: 16%; right: 6%; } .b1 .balloon-body { background: #ff8fab; }
.b2 { top: 44%; right: 12%; animation-delay: -2s; } .b2 .balloon-body { background: #4ecdc4; }
.b3 { top: 70%; right: 5%; animation-delay: -4s; } .b3 .balloon-body { background: #ffd93d; }

@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-22px) rotate(3deg); } }

.star-twinkle { position: absolute; font-size: 28px; animation: twinkle 2.4s ease-in-out infinite; }
.s1 { top: 8%; left: 8%; } .s2 { top: 38%; left: 4%; animation-delay: -0.8s; } .s3 { top: 64%; left: 10%; animation-delay: -1.6s; }
@keyframes twinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.7); opacity: 0.5; } }

/* ---------- Layout umum ---------- */
#app { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; }

.screen { display: none; text-align: center; }
.screen.active { display: block; animation: screen-in 0.35s ease; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.screen-title { font-size: clamp(1.8rem, 6vw, 2.6rem); margin: 12px 0 4px; color: var(--ink); }
.screen-desc { font-size: 1.15rem; margin: 0 0 18px; color: #77779a; }

/* ---------- Tombol chunky ---------- */
.btn {
  font-family: inherit; font-weight: 700; color: #fff;
  border: none; border-radius: 999px; cursor: pointer;
  padding: 18px 30px; font-size: 1.25rem; min-height: 64px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s;
}
.btn:active { transform: translateY(4px) scale(0.98); box-shadow: 0 2px 0 rgba(0,0,0,0.12); }
.btn-big { display: block; width: 100%; max-width: 420px; margin: 14px auto; font-size: 1.45rem; padding: 20px; }
.btn-pink { background: var(--pink); } .btn-pink:hover { filter: brightness(1.06); }
.btn-blue { background: var(--blue); }
.btn-yellow { background: var(--yellow); color: #6b5b00; }
.btn-purple { background: var(--purple); }
.btn-green { background: var(--green); }
.btn-orange { background: var(--orange); }

.btn-back {
  display: inline-block; font-size: 1.05rem; padding: 12px 22px; min-height: 56px;
  background: #fff; color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,0.08);
  margin-bottom: 8px;
}
.btn-small { padding: 10px 16px; min-height: 52px; font-size: 1.2rem; margin-bottom: 0; }

.sound-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 50;
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 1.8rem; background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,0.12);
  transition: transform 0.12s;
}
.sound-toggle:active { transform: scale(0.92); }

/* ---------- Home ---------- */
.mascot-wrap { margin: 8px auto 0; width: min(220px, 55vw); }
.mascot { width: 100%; height: auto; }
.bounce-soft { animation: bounce-soft 3s ease-in-out infinite; }
@keyframes bounce-soft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

.game-title {
  font-size: clamp(2.6rem, 10vw, 4.2rem); margin: 10px 0 0;
  background: linear-gradient(90deg, #ff6b9d, #ff9f5a, #ffd93d, #6bcb77, #4ecdc4, #a78bfa);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wiggle { animation: wiggle 4s ease-in-out infinite; display: inline-block; }
@keyframes wiggle { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }

.game-subtitle { font-size: clamp(1.2rem, 4.5vw, 1.6rem); font-weight: 700; margin: 6px 0; color: var(--pink-dark); }
.game-tagline { font-size: 1.1rem; color: #77779a; margin: 4px 0 20px; }
.home-buttons { margin-top: 8px; }
.footer-note { margin-top: 28px; color: #aaaac4; font-size: 0.95rem; }

/* ---------- Form & kartu murid ---------- */
.add-form { display: flex; gap: 10px; justify-content: center; margin: 0 auto 10px; max-width: 480px; }
.add-form input {
  flex: 1; font-family: inherit; font-size: 1.2rem; font-weight: 600;
  padding: 16px 20px; min-height: 64px; border-radius: 999px;
  border: 3px solid #ffd6e7; outline: none; color: var(--ink); background: #fff;
}
.add-form input:focus { border-color: var(--pink); }
.add-form .btn { min-width: 130px; }
.student-count { color: #77779a; font-weight: 600; margin: 6px 0 14px; }

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px; margin: 0 auto 22px; max-width: 720px;
}
.student-card {
  background: var(--card); border-radius: var(--radius); padding: 18px 10px;
  box-shadow: 0 5px 0 rgba(0,0,0,0.06); position: relative;
  animation: pop-in 0.3s ease; transition: transform 0.15s;
}
.student-card:hover { transform: translateY(-3px) rotate(-1deg); }
.student-avatar { font-size: 3rem; line-height: 1; }
.student-name { font-weight: 800; font-size: 1.15rem; margin: 8px 0 2px; word-break: break-word; }
.student-stars { color: #b8860b; font-weight: 700; }
.btn-delete {
  position: absolute; top: 6px; right: 6px; width: 44px; height: 44px;
  border-radius: 50%; border: none; background: #ffe3e3; font-size: 1.2rem; cursor: pointer;
}
.btn-delete:active { transform: scale(0.9); }
.empty-note { grid-column: 1 / -1; color: #9999b5; font-size: 1.1rem; padding: 24px; background: #fff; border-radius: var(--radius); }

@keyframes pop-in { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Pilih pemain ---------- */
#btn-shuffle { margin-bottom: 20px; }
.player-card { cursor: pointer; border: 4px solid transparent; }
.player-card:hover { border-color: var(--yellow); }
.player-card.shuffling { animation: shuffle-shake 0.12s linear infinite; border-color: var(--pink); }
@keyframes shuffle-shake {
  0% { transform: translateX(-4px) rotate(-3deg); }
  100% { transform: translateX(4px) rotate(3deg); }
}
.player-chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 999px; padding: 10px 24px; margin: 0 auto 18px;
  font-size: 1.3rem; font-weight: 800; box-shadow: 0 4px 0 rgba(0,0,0,0.07);
}
.player-chip .chip-avatar { font-size: 2rem; }

/* ---------- Kartu permainan ---------- */
.game-cards { display: flex; flex-direction: column; gap: 16px; max-width: 480px; margin: 0 auto; }
.game-card {
  font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #fff; border: 4px solid #ffe3ee; border-radius: 28px; padding: 22px;
  cursor: pointer; box-shadow: 0 6px 0 rgba(0,0,0,0.07); transition: transform 0.15s, border-color 0.15s;
  min-height: 120px;
}
.game-card:hover { transform: translateY(-4px) rotate(1deg); border-color: var(--pink); }
.game-card:active { transform: scale(0.97); }
.game-card.disabled {
  cursor: not-allowed; opacity: 0.65; filter: grayscale(0.6);
  border-style: dashed;
}
.game-card.disabled:hover { transform: none; border-color: #e3ecff; }
.soon-badge {
  display: inline-block; margin-top: 8px; font-size: 1rem; font-weight: 800;
  background: #f1f0ff; color: #7c6fd0; border-radius: 999px; padding: 6px 16px;
}
.game-emoji { font-size: 3.2rem; }
.game-name { font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.game-desc { font-size: 1.05rem; color: #8888a5; }

/* ---------- Pilih Jenjang & kategori game ---------- */
.level-card { border-color: #c8f0d8; }
.level-card.selected { border-color: var(--green); background: #f2fff6; }
.level-card .game-emoji { font-size: 4.2rem; }
.level-card .game-name { font-size: 2.2rem; }
.category-header {
  font-size: 1.4rem; font-weight: 800; color: var(--ink);
  margin: 18px 0 4px; text-align: center;
}
.category-header:first-child { margin-top: 0; }
#screen-games .game-cards .game-cards { margin: 0; }

/* ---------- Kartu game PAUD ---------- */
.emoji-card {
  font-family: inherit; font-size: 4.2rem; line-height: 1;
  background: #fff; border: 4px solid #e0f7fa; border-radius: 32px;
  padding: 28px 24px; cursor: pointer; min-width: 130px; min-height: 130px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.07); transition: transform 0.12s;
}
.emoji-card:hover { transform: scale(1.05); border-color: var(--blue); }
.emoji-card:active { transform: scale(0.95); }
.emoji-options {
  display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
  margin: 24px 0;
}
.size-options {
  display: flex; gap: 36px; justify-content: center; align-items: center;
  margin: 24px 0; flex-wrap: wrap;
}
.size-card {
  font-family: inherit; line-height: 1; background: #fff;
  border: 4px solid #ffe3ee; border-radius: 32px; padding: 24px;
  cursor: pointer; box-shadow: 0 6px 0 rgba(0,0,0,0.07);
  transition: transform 0.12s;
}
.size-card:hover { transform: scale(1.05); border-color: var(--pink); }
.size-card:active { transform: scale(0.95); }
.btn-participate {
  background: #e8f7ee; border-color: var(--green); font-size: 1.6rem;
}
.doa-box {
  background: #fff; border: 3px dashed #b9d7f7; border-radius: 24px;
  padding: 20px 24px; margin: 16px auto; max-width: 560px; text-align: center;
}
.doa-text { font-size: 1.7rem; font-weight: 700; color: var(--ink); line-height: 1.7; margin: 0 0 10px; }
.doa-arti { font-size: 1.15rem; color: #77779a; margin: 0; line-height: 1.6; }

/* ---------- HUD & area main ---------- */
.game-hud { display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 6px; }
.hud-player { font-weight: 800; font-size: 1.15rem; background: #fff; padding: 10px 18px; border-radius: 999px; box-shadow: 0 3px 0 rgba(0,0,0,0.06); }
.hud-progress { font-weight: 700; color: #8888a5; font-size: 1.05rem; }
.hud-score { font-weight: 800; font-size: 1.2rem; background: #fff7d6; padding: 10px 18px; border-radius: 999px; color: #8a6d00; }

.game-instruction { font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 700; margin: 10px 0 18px; min-height: 2.6em; }
.game-instruction .big-letter { color: var(--pink-dark); font-size: 1.3em; }

#game-area { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; }

.letter-options { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.letter-card {
  font-family: inherit; font-weight: 800; cursor: pointer;
  width: clamp(84px, 24vw, 120px); height: clamp(84px, 24vw, 120px);
  min-width: 64px; min-height: 64px;
  font-size: clamp(3rem, 12vw, 4.5rem);
  background: #fff; color: var(--ink); border: 5px solid #e3ecff; border-radius: 26px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.08); transition: transform 0.12s;
  display: flex; align-items: center; justify-content: center;
}
.letter-card:hover { transform: scale(1.06) rotate(-2deg); border-color: var(--blue); }
.letter-card:active { transform: scale(0.94); }
.letter-card.correct-flash { background: #d8f5d0; border-color: var(--green); animation: correct-pop 0.5s ease; }
@keyframes correct-pop { 0% { transform: scale(1); } 40% { transform: scale(1.25) rotate(5deg); } 100% { transform: scale(1); } }
.letter-card.shake { animation: shake 0.5s ease; border-color: var(--pink); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-12px) rotate(-4deg); }
  40% { transform: translateX(10px) rotate(4deg); }
  60% { transform: translateX(-8px); } 80% { transform: translateX(6px); }
}

/* Huruf Hilang */
.word-display { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.word-emoji { font-size: clamp(4.5rem, 18vw, 7rem); animation: bounce-soft 2.5s ease-in-out infinite; }
.word-text { font-size: clamp(3.5rem, 15vw, 6rem); font-weight: 800; letter-spacing: 0.08em; }
.word-blank {
  display: inline-block; min-width: 1.1em; border-bottom: 8px dashed var(--pink);
  color: var(--pink-dark); animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Dengar & Tebak */
.speaker-btn {
  font-family: inherit; border: none; cursor: pointer; border-radius: 50%;
  width: 150px; height: 150px; font-size: 4.2rem; background: var(--purple); color: #fff;
  box-shadow: 0 8px 0 var(--purple-dark); transition: transform 0.12s;
  animation: pulse 1.8s ease-in-out infinite;
}
.speaker-btn:active { transform: scale(0.92); }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.listen-hint { font-size: 1.2rem; color: #77779a; font-weight: 600; }

.encourage-text { min-height: 2em; font-size: 1.25rem; font-weight: 700; color: var(--pink-dark); margin-top: 14px; }

/* ---------- Hasil ---------- */
.trophy { font-size: 5rem; }
.result-name { font-size: 1.6rem; font-weight: 800; margin: 8px 0; }
.result-score { font-size: clamp(1.8rem, 7vw, 2.6rem); font-weight: 800; color: var(--pink-dark); margin: 6px 0; }
.result-stars { font-size: 1.5rem; font-weight: 700; color: #8a6d00; margin: 6px 0 18px; }

/* ---------- Papan bintang ---------- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 18px auto 24px; max-width: 560px; }
.podium-spot { background: #fff; border-radius: 20px 20px 0 0; padding: 14px 10px 10px; flex: 1; max-width: 170px; box-shadow: 0 4px 0 rgba(0,0,0,0.06); }
.podium-spot.first { padding-top: 22px; background: linear-gradient(180deg, #fff6cf, #fff); border: 3px solid var(--yellow); }
.podium-medal { font-size: 2.6rem; }
.podium-avatar { font-size: 2.8rem; margin: 4px 0; }
.podium-name { font-weight: 800; font-size: 1.05rem; word-break: break-word; }
.podium-stars { color: #8a6d00; font-weight: 700; }
.podium-rank { font-size: 2rem; font-weight: 800; color: #c9b458; }

.board-list { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.board-row {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border-radius: 18px; padding: 12px 18px; box-shadow: 0 3px 0 rgba(0,0,0,0.05);
  font-size: 1.15rem; font-weight: 700;
}
.board-row .rank { min-width: 40px; font-size: 1.3rem; }
.board-row .avatar { font-size: 2rem; }
.board-row .name { flex: 1; text-align: left; word-break: break-word; }
.board-row .stars { color: #8a6d00; }

/* ---------- Overlay selebrasi ---------- */
.celebration {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s;
}
.celebration.hidden { display: none; }
#confetti-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.celebration-inner { position: relative; text-align: center; padding: 20px; }
.pop-in { animation: pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.celebration-mascot { font-size: 5.5rem; }
.dance { animation: dance 0.9s ease-in-out infinite; display: inline-block; }
@keyframes dance {
  0%, 100% { transform: rotate(-12deg) translateY(0); }
  25% { transform: rotate(12deg) translateY(-18px); }
  50% { transform: rotate(-8deg) translateY(0) scale(1.1); }
  75% { transform: rotate(8deg) translateY(-10px); }
}
.celebration-text { font-size: clamp(2rem, 8vw, 3.2rem); font-weight: 800; color: var(--pink-dark); margin: 10px 0; }
.celebration-star { font-size: 1.8rem; font-weight: 800; color: #8a6d00; margin: 0 0 18px; animation: twinkle 1s ease-in-out infinite; }

/* ---------- Responsif kecil digabung ke blok max-width:480px di bawah ---------- */

/* ============================================================
   Modul game baru: Ceria Angka, Warna, Bentuk, Hewan 🎮
   ============================================================ */

/* Kartu jawaban berupa teks (nama warna / bentuk / hewan) */
.name-options { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; max-width: 660px; }
.name-card {
  font-family: inherit; font-weight: 800; cursor: pointer;
  font-size: clamp(1.4rem, 5vw, 2rem); color: var(--ink);
  background: #fff; border: 5px solid #e3ecff; border-radius: 22px;
  padding: 18px 26px; min-height: 76px; min-width: 128px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.08); transition: transform 0.12s;
}
.name-card:hover { transform: scale(1.05) rotate(-1deg); border-color: var(--pink); }
.name-card:active { transform: scale(0.95); }
.name-card.correct-flash { background: #d8f5d0; border-color: var(--green); animation: correct-pop 0.5s ease; }
.name-card.shake { animation: shake 0.5s ease; border-color: var(--pink); }
.name-card:disabled { opacity: 0.55; cursor: default; }
.letter-card.done { opacity: 0.55; border-color: var(--green); background: #eefbe9; cursor: default; }

/* Warna: kartu contoh warna */
.color-options { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.color-card {
  width: clamp(88px, 26vw, 128px); height: clamp(88px, 26vw, 128px);
  border-radius: 26px; border: 6px solid #fff; cursor: pointer;
  box-shadow: 0 6px 0 rgba(0,0,0,0.10); transition: transform 0.12s;
}
.color-card:hover { transform: scale(1.07) rotate(-2deg); }
.color-card:active { transform: scale(0.94); }
.color-card.correct-flash { animation: correct-pop 0.5s ease; outline: 6px solid var(--green); }
.color-card.shake { animation: shake 0.5s ease; outline: 6px solid var(--pink); }

/* Bentuk: kartu + tampilan besar (SVG inline) */
.shape-options { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.shape-card {
  width: clamp(96px, 28vw, 140px); height: clamp(96px, 28vw, 140px);
  background: #fff; border: 5px solid #e3ecff; border-radius: 26px; cursor: pointer;
  box-shadow: 0 6px 0 rgba(0,0,0,0.08); transition: transform 0.12s;
  display: flex; align-items: center; justify-content: center; padding: 12px;
}
.shape-card svg { width: 100%; height: 100%; }
.shape-card:hover { transform: scale(1.06) rotate(-2deg); border-color: var(--purple); }
.shape-card:active { transform: scale(0.94); }
.shape-card.correct-flash { background: #d8f5d0; border-color: var(--green); animation: correct-pop 0.5s ease; }
.shape-card.shake { animation: shake 0.5s ease; border-color: var(--pink); }
.shape-big { width: clamp(180px, 50vw, 280px); height: clamp(180px, 50vw, 280px); margin: 0 auto; }
.shape-big svg { width: 100%; height: 100%; animation: bounce-soft 2.5s ease-in-out infinite; }

/* Menghitung: tampilan benda yang dihitung */
.count-display {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center;
  max-width: 560px; background: #fff; border-radius: 26px; padding: 22px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.06);
}
.count-emoji { font-size: clamp(2.4rem, 9vw, 3.8rem); animation: pop-in 0.3s ease; }

/* Membandingkan: dua area kelompok benda */
.compare-wrap { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; width: 100%; }
.compare-area {
  font-family: inherit; cursor: pointer; flex: 1; min-width: 200px; max-width: 300px;
  background: #fff; border: 5px solid #e3ecff; border-radius: 26px; padding: 18px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.08); transition: transform 0.12s; min-height: 170px;
  display: flex; align-items: center; justify-content: center;
}
.compare-area:hover { transform: scale(1.03); border-color: var(--orange); }
.compare-area:active { transform: scale(0.96); }
.compare-items { font-size: clamp(1.7rem, 7vw, 2.5rem); line-height: 1.6; }
.compare-area.correct-flash { background: #d8f5d0; border-color: var(--green); animation: correct-pop 0.5s ease; }
.compare-area.shake { animation: shake 0.5s ease; border-color: var(--pink); }

/* Kartu emoji besar (pilihan hewan / benda berwarna) */
.emoji-options { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.emoji-card {
  font-family: inherit; cursor: pointer; font-size: clamp(3.2rem, 13vw, 4.8rem);
  width: clamp(96px, 28vw, 140px); height: clamp(96px, 28vw, 140px);
  background: #fff; border: 5px solid #e3ecff; border-radius: 26px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.08); transition: transform 0.12s;
  display: flex; align-items: center; justify-content: center;
}
.emoji-card:hover { transform: scale(1.07) rotate(-2deg); border-color: var(--green); }
.emoji-card:active { transform: scale(0.94); }
.emoji-card.correct-flash { background: #d8f5d0; border-color: var(--green); animation: correct-pop 0.5s ease; }
.emoji-card.shake { animation: shake 0.5s ease; border-color: var(--pink); }

/* Habitat: kartu besar bergambar + nama */
.habitat-options { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.habitat-card {
  font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #fff; border: 5px solid #e3ecff; border-radius: 26px;
  padding: 20px 28px; min-width: 150px; min-height: 130px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.08); transition: transform 0.12s;
}
.habitat-card:hover { transform: scale(1.05) rotate(-1deg); border-color: var(--blue); }
.habitat-card:active { transform: scale(0.95); }
.habitat-emoji { font-size: clamp(3rem, 12vw, 4.2rem); }
.habitat-name { font-size: clamp(1.3rem, 5vw, 1.8rem); font-weight: 800; color: var(--ink); }
.habitat-card.correct-flash { background: #d8f5d0; border-color: var(--green); animation: correct-pop 0.5s ease; }
.habitat-card.shake { animation: shake 0.5s ease; border-color: var(--pink); }

/* Kata target di instruksi */
.game-instruction .target-word { font-size: 1.25em; }

/* ============================================================
   Ceria Belajar — tambahan: nama sekolah, multi-kelas,
   & responsivitas TV besar / HP kecil 📺📱
   ============================================================ */

/* Utilitas */
.hidden { display: none !important; }

/* Tombol ikon kecil (✏️ ubah nama sekolah) */
.icon-btn {
  font-family: inherit; border: none; cursor: pointer;
  width: 56px; height: 56px; border-radius: 50%;
  font-size: 1.5rem; background: #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,0.10);
  vertical-align: middle; margin-left: 6px;
  transition: transform 0.12s;
  touch-action: manipulation;
}
.icon-btn:active { transform: scale(0.9); }

/* Form ubah nama sekolah (inline) */
.school-edit-form {
  display: flex; gap: 8px; justify-content: center; align-items: center;
  margin: 6px auto 12px; max-width: 480px; flex-wrap: wrap;
}
.school-edit-form input {
  flex: 1; min-width: 200px; font-family: inherit; font-size: 1.15rem; font-weight: 600;
  padding: 14px 18px; min-height: 60px; border-radius: 999px;
  border: 3px solid #ffd6e7; outline: none; color: var(--ink); background: #fff;
}
.school-edit-form input:focus { border-color: var(--pink); }

/* Chips pemilih kelas */
.class-chips {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin: 0 auto 12px; max-width: 720px;
}
.class-chip {
  font-family: inherit; font-weight: 800; font-size: 1.1rem; color: var(--ink);
  padding: 14px 24px; min-height: 64px; border-radius: 999px;
  border: 4px solid #e3ecff; background: #fff; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.06);
  transition: transform 0.12s, background 0.12s;
  touch-action: manipulation;
}
.class-chip:hover { transform: translateY(-2px); border-color: var(--purple); }
.class-chip:active { transform: scale(0.96); }
.class-chip.active {
  background: var(--purple); border-color: var(--purple-dark); color: #fff;
  box-shadow: 0 4px 0 var(--purple-dark);
}
.class-count { opacity: 0.75; font-size: 0.9em; }

/* Aksi kelola kelas */
.class-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 14px;
}
.class-form {
  display: flex; gap: 10px; justify-content: center; align-items: center;
  margin: 0 auto 14px; max-width: 480px; flex-wrap: wrap;
}
.class-form input {
  flex: 1; min-width: 180px; font-family: inherit; font-size: 1.15rem; font-weight: 600;
  padding: 14px 18px; min-height: 60px; border-radius: 999px;
  border: 3px solid #e3d6ff; outline: none; color: var(--ink); background: #fff;
}
.class-form input:focus { border-color: var(--purple); }

/* Semua tombol: tanpa delay/zoom double-tap di layar sentuh */
button, .btn { touch-action: manipulation; }

/* ============================================================
   Layar SANGAT BESAR (TV 43"+ / monitor lebar)
   - Skala dasar diperbesar, konten dibatasi & di tengah
   ============================================================ */
@media (min-width: 1400px) {
  html { font-size: 112.5%; } /* ~18px: semua rem ikut membesar */

  #app { max-width: 1500px; padding: 36px 28px 90px; }

  .mascot-wrap { width: min(280px, 30vw); }
  .game-title { font-size: 5rem; }
  .game-subtitle { font-size: 1.9rem; }
  .game-tagline { font-size: 1.35rem; }

  .btn { min-height: 72px; font-size: 1.4rem; }
  .btn-big { max-width: 520px; font-size: 1.65rem; padding: 26px; min-height: 88px; }
  .icon-btn { width: 64px; height: 64px; font-size: 1.7rem; }

  .card-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); max-width: 1000px; gap: 18px; }
  .student-avatar { font-size: 3.8rem; }
  .student-name { font-size: 1.35rem; }

  .class-chip { font-size: 1.3rem; padding: 18px 30px; min-height: 76px; }

  .game-cards { max-width: 580px; }
  .game-emoji { font-size: 4rem; }
  .game-name { font-size: 1.9rem; }
  .game-desc { font-size: 1.2rem; }

  .letter-card {
    width: clamp(120px, 10vw, 150px); height: clamp(120px, 10vw, 150px);
    font-size: 5rem;
  }
  .name-card { font-size: 2.2rem; padding: 24px 34px; min-height: 92px; }
  .color-card { width: 150px; height: 150px; }
  .emoji-card { width: 160px; height: 160px; font-size: 5.2rem; }
  .shape-card { width: 160px; height: 160px; }

  .podium, .board-list { max-width: 720px; }
  .speaker-btn { width: 180px; height: 180px; font-size: 5rem; }
}

/* ============================================================
   LAYAR LEBAR (TV / landscape) — manfaatkan sisi layar:
   menu tersebar horizontal, minimal scroll ke bawah
   ============================================================ */
@media (min-width: 1024px) {
  #app { max-width: 1500px; }

  /* Home: 3 tombol utama sejajar menyamping */
  .home-buttons {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 18px; margin-top: 16px;
  }
  .home-buttons .btn-big { max-width: none; width: 100%; margin: 0; min-height: 120px; }

  /* Pilih Jenjang: 3 kartu sejajar, tanpa scroll */
  #level-cards {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 20px; max-width: none;
  }

  /* Pilih Permainan: tiap kategori jadi grid multi-kolom */
  #game-cards { max-width: none; }
  #screen-games .game-cards .game-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px; max-width: none;
  }
  .category-header { text-align: left; margin: 26px 0 10px; font-size: 1.6rem; }

  /* Murid & pemain: kolom lebih banyak, manfaatkan lebar */
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); max-width: none; }

  /* Papan bintang lebih lega */
  .podium, .board-list { max-width: 900px; }
}

/* ============================================================
   HP KECIL — tidak ada overflow horizontal, tetap mudah diketuk
   ============================================================ */
@media (max-width: 480px) {
  #app { padding: 16px 10px 48px; }

  .game-title { font-size: clamp(2.2rem, 11vw, 2.8rem); }
  .game-subtitle { font-size: 1.1rem; }
  .icon-btn { width: 52px; height: 52px; font-size: 1.3rem; }

  .btn { font-size: 1.15rem; padding: 16px 22px; min-height: 64px; }
  .btn-big { font-size: 1.3rem; max-width: 100%; }

  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .student-card { padding: 14px 8px; }
  .student-avatar { font-size: 2.6rem; }
  .student-name { font-size: 1.05rem; }

  .class-chips { gap: 8px; }
  .class-chip { font-size: 1rem; padding: 12px 18px; min-height: 60px; }
  .class-actions .btn { font-size: 0.95rem; padding: 12px 16px; min-height: 56px; }

  .add-form input, .class-form input, .school-edit-form input { font-size: 1.05rem; min-height: 60px; }
  .add-form { flex-direction: column; }
  .add-form .btn { width: 100%; }

  .game-cards { max-width: 100%; }
  .game-emoji { font-size: 2.8rem; }
  .game-name { font-size: 1.4rem; }

  .podium { gap: 6px; }
  .podium-spot { padding: 10px 6px 8px; }
  .podium-medal { font-size: 2rem; }
  .podium-avatar { font-size: 2.2rem; }
  .podium-name { font-size: 0.9rem; }

  .board-row { padding: 10px 12px; font-size: 1.05rem; gap: 8px; }

  .sound-toggle { width: 56px; height: 56px; font-size: 1.5rem; top: 10px; right: 10px; }

  .celebration-text { font-size: clamp(1.7rem, 9vw, 2.4rem); }
}
