:root {
  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --font-arabic: 'Scheherazade New', 'Amiri', serif;
}

* {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-body);
  background: #FEF9C3;
  overscroll-behavior-y: contain;
}

.font-display {
  font-family: var(--font-display);
}

.font-arabic {
  font-family: var(--font-arabic);
  direction: rtl;
  line-height: 1.5;
}

/* Tema Kamar Mochi */
.room-bg_meadow {
  background: linear-gradient(180deg, #BAE6FD 0%, #E0F2FE 55%, #86EFAC 55%, #4ADE80 100%);
}
.room-bg_pastel {
  background: linear-gradient(180deg, #FBCFE8 0%, #DDD6FE 48%, #BAE6FD 76%, #FEF08A 100%);
}
.room-bg_starry {
  background: linear-gradient(180deg, #1E1B4B 0%, #312E81 55%, #4338CA 100%);
  color: #FFFFFF;
}
.room-bg_candy {
  background: linear-gradient(180deg, #FFE4E6 0%, #FECDD3 52%, #FDE68A 52%, #FDBA74 100%);
}

/* Tombol 3D Empuk ala Game */
.btn-3d {
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.16);
}
.btn-3d:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
}

.btn-opt {
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.2s ease, opacity 0.25s ease;
  box-shadow: 0 6px 0 #CBD5E1;
}
.btn-opt:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 1px 0 #CBD5E1;
}
.btn-opt.opt-correct {
  background-color: #22C55E !important;
  border-color: #15803D !important;
  color: #FFFFFF !important;
  box-shadow: 0 6px 0 #15803D !important;
  animation: popBounce 0.45s ease;
}
.btn-opt.opt-wrong {
  background-color: #F1F5F9 !important;
  border-color: #CBD5E1 !important;
  color: #94A3B8 !important;
  opacity: 0.55;
  box-shadow: 0 2px 0 #CBD5E1 !important;
  animation: gentleShake 0.4s ease;
}

/* Animasi Karakter & Objek */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.animate-float {
  animation: floatSlow 3.2s ease-in-out infinite;
}

@keyframes popBounce {
  0% { transform: scale(1); }
  35% { transform: scale(1.07); }
  65% { transform: scale(0.97); }
  100% { transform: scale(1); }
}
.animate-pop {
  animation: popBounce 0.45s ease;
}

@keyframes gentleShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  45% { transform: translateX(7px); }
  70% { transform: translateX(-4px); }
}
.animate-shake {
  animation: gentleShake 0.4s ease;
}

@keyframes mochiJump {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-18px) scale(1.06); }
  60% { transform: translateY(0) scale(0.96); }
  80% { transform: translateY(-8px) scale(1.02); }
}
.animate-mochi-jump {
  animation: mochiJump 0.65s ease;
}

@keyframes blinkEyes {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}
.mochi-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: blinkEyes 4.2s infinite;
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(250, 204, 21, 0); }
  100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); }
}
.island-glow {
  animation: pulseRing 2s infinite;
}

/* Partikel Hati & Koin Melayang */
@keyframes floatUpFade {
  0% { transform: translateY(0) scale(0.8); opacity: 1; }
  100% { transform: translateY(-56px) scale(1.3); opacity: 0; }
}
.floating-fx {
  position: absolute;
  pointer-events: none;
  font-weight: 800;
  animation: floatUpFade 0.9s ease-out forwards;
  z-index: 40;
}

/* Konfeti */
@keyframes confettiFall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0.7; }
}
.confetti-piece {
  position: fixed;
  top: -12px;
  width: 11px;
  height: 15px;
  border-radius: 3px;
  z-index: 100;
  pointer-events: none;
  animation: confettiFall linear forwards;
}

/* Peti Harta Karun */
@keyframes chestWobble {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-9deg) scale(1.08); }
  50% { transform: rotate(9deg) scale(1.1); }
  75% { transform: rotate(-5deg) scale(1.05); }
}
.chest-hit {
  animation: chestWobble 0.35s ease;
}