* {
  font-family: 'Nunito', sans-serif;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.game-bg {
  background: linear-gradient(135deg, #9B7BFF 0%, #FF9BE3 50%, #7BC8FF 100%);
  min-height: 100vh;
}

.game-card {
  border: none;
  cursor: pointer;
}

.game-card:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.game-card:active {
  transform: scale(0.98);
}

/* Title bounce animation */
.title-bounce {
  animation: title-float 3s ease-in-out infinite;
}

@keyframes title-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Confetti Animation */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  border-radius: 2px;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Emoji bounce animation */
.emoji-bounce {
  display: inline-block;
  animation: emoji-bounce 0.6s ease-out;
}

@keyframes emoji-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Shake animation for wrong answers */
.shake-animation {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

/* Line through emoji for subtraction */
.line-through-emoji {
  position: relative;
}

.line-through-emoji::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  height: 3px;
  background: #FF6B6B;
  border-radius: 2px;
  transform: rotate(-15deg);
}

/* Sama game animations */
.merge-animation .comparison-group {
  animation: merge 0.8s ease-out forwards;
}

.merge-animation .left-group {
  animation: merge-left 0.8s ease-out forwards;
}

.merge-animation .right-group {
  animation: merge-right 0.8s ease-out forwards;
}

@keyframes merge-left {
  0% { transform: translateX(0); }
  50% { transform: translateX(20px) scale(1.1); }
  100% { transform: translateX(10px) scale(1.05); }
}

@keyframes merge-right {
  0% { transform: translateX(0); }
  50% { transform: translateX(-20px) scale(1.1); }
  100% { transform: translateX(-10px) scale(1.05); }
}

.separate-animation .left-group {
  animation: separate-left 0.8s ease-out forwards;
}

.separate-animation .right-group {
  animation: separate-right 0.8s ease-out forwards;
}

@keyframes separate-left {
  0% { transform: translateX(0); }
  50% { transform: translateX(-30px) rotate(-5deg); }
  100% { transform: translateX(-20px) rotate(-3deg); }
}

@keyframes separate-right {
  0% { transform: translateX(0); }
  50% { transform: translateX(30px) rotate(5deg); }
  100% { transform: translateX(20px) rotate(3deg); }
}

/* Feedback pop animation */
.feedback-pop {
  animation: feedback-pop 0.4s ease-out;
}

@keyframes feedback-pop {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* Correct answer sparkle */
.sama-correct, .tidak-correct {
  position: relative;
  overflow: visible;
}

.sama-correct::after, .tidak-correct::after {
  content: '✨';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 24px;
  animation: sparkle 0.5s ease-out;
}

@keyframes sparkle {
  0% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { transform: scale(1.5) rotate(180deg); opacity: 1; }
  100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

/* Anti-gravity Easter egg */
.antigravity {
  animation: float 3s ease-in-out infinite;
}

.antigravity * {
  animation: float-random 2s ease-in-out infinite alternate;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes float-random {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-10px) rotate(2deg); }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(155, 123, 255, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(155, 123, 255, 0.5);
}

/* Input number spinner removal */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Smooth transitions */
button, input {
  transition: all 0.2s ease;
}

/* Comparison group styling */
.comparison-group {
  transition: all 0.3s ease;
}

/* Mobile responsiveness */
@media (max-width: 400px) {
  .text-5xl {
    font-size: 2.5rem;
  }
  
  .text-3xl {
    font-size: 1.5rem;
  }
  
  .game-card {
    padding: 1rem;
  }
  
  .game-card h3 {
    font-size: 1.1rem;
  }
  
  .comparison-group {
    min-height: 100px !important;
    padding: 0.75rem !important;
  }
  
  .comparison-group span.text-2xl {
    font-size: 1.25rem;
  }
}

/* Pulse animation for interactive elements */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(155, 123, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(155, 123, 255, 0.2);
  }
}

.pulse-glow {
  animation: pulse-glow 2s infinite;
}

/* New badge pulse */
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}