body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100vw;
  max-width: 100%;
  font-family: Arial, 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
  background: linear-gradient(135deg, #fff6b7 0%, #f6416c 100%);
  overflow-x: hidden;
}

header {
  text-align: center;
  padding: 1rem;
  background: #007acc;
  color: white;
}

.main-suku-kataContainer {
  position: absolute; /* or fixed */
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0; /* ⚠️ Might be causing overlap issues */
  overflow: auto;
}

.main-menu {
  display: block;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
}

.main-menu button {
  
  position: relative;
  font-family: 'The Season', cursive;
  font-size: larger;
  width: 300px;
  padding: 20px;
  background: linear-gradient(135deg, #fff6b7 0%, #f6416c 100%);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(255, 99, 71, 0.4);
  overflow: hidden;
  text-align: center;
  animation: wobble 3s infinite ease-in-out;
  transition: transform 0.3s ease-in-out;
 
}

.main-menu button::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 10%, transparent 70%);
  transform: rotate(30deg);
  animation: shine 3s infinite linear;
}

.main-menu button::after {
  content: "🍬";
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 30px;
  animation: bounce 2s infinite ease-in-out;
}
.mainButtons{
  margin-top: 10px;
  gap:20px;
}

/*section*/
.section {
  display: none;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: linear-gradient(135deg, #4e54c8, #8f94fb);
  overflow: auto;
  width: 90%;
  height: auto;
  margin: auto;
  margin-top: 10px;
  align-items: center;
  justify-content: center;
  margin-bottom: 3%;
}

/* Container for each section */
.section-container {
display: flex; /* Use Flexbox for layout */
align-items: center; /* Vertically center the content */
margin-bottom: 20px; /* Add spacing between sections */

}

/* Style for the images */
.section-image {
  display: none;
  width: 100px; /* Set a fixed width for the images */
  height: auto; /* Maintain aspect ratio */
  margin-left: 100px; 
  margin-top: 50px;
  border: #eaf1f3;
  border-radius: 10px;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Optional: Add shadow */
  animation: slideFromRight 1.5s ease-in-out forwards, float 3s infinite ease-in-out; /* Optional: Add animation */}
/* Animation for floating effect (optional) */
@keyframes float {
0%, 100% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
}
/* Pop effect */
@keyframes pop {
0% {
opacity: 0;
transform: scale(0.5);
}
60% {
opacity: 1;
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}

.back-to-menu-container {
  display: inline-flex;
  align-items: center;
   gap: 8px;
  padding: 10px 16px;
  background-color: #25c8da; /* Cheerful yellow */
  color: #1E3A8A; /* Deep blue for contrast */
  font-size: 18px;
  font-weight: bold;
  border-radius: 999px; /* Makes it pill-shaped */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.back-to-menu-container:hover {
  background-color: #2bdae7;
  transform: scale(1.05);
}

.back-to-menu-container .arrow {
  font-size: 20px;
  transform: translateY(-1px);
}

/*options*/
.option button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #4f46e5; /* Indigo */
  color: white;
  font-size: 2rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, background-color 0.3s ease, box-shadow 0.2s ease;
}

.option button:hover{
  background-color: #4338ca; /* Darker indigo */
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

.option button:active{
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/*carousel*/
.carousel, .vokalCarousel{
 margin-top: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-left: -90px;
  margin-right: -90px;
  position: relative;

}
/* Main carousel container */
.carousel {
  margin: auto;
  border-radius: 25px;
  padding: 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
  border: 8px solid #ff6b6b;
  position: relative;
  overflow: hidden;
}

/* Background pattern animation */
.carousel::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 30px 30px;
  animation: float 20s infinite linear;
  z-index: 0;
}

@keyframes float {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-30px, -30px) rotate(360deg); }
}

/* Alphabet letter display - Enhanced */
.carousel #alphabetDisplay {
   padding: 25px 20px;
  font-size: 8rem;
  width: 280px;
  height: 280px;
  background: linear-gradient(145deg, #ff6b6b, #ff8e8e);
  color: white;
  border: 6px solid #ffd93d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 10px 0 #ff4757, 0 15px 25px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-weight: 900;
  text-shadow: 3px 3px 0 #ff4757;
  animation: bounce 2s infinite ease-in-out;
}

.carousel #alphabetDisplay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #ffd93d);
  border-radius: 25px 25px 0 0;
  z-index: 2;
}

.carousel #alphabetDisplay:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 15px 0 #ff4757, 0 20px 30px rgba(0,0,0,0.25);
  animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
  0%, 100% { transform: translateY(-8px) rotate(-3deg) scale(1.05); }
  50% { transform: translateY(-8px) rotate(3deg) scale(1.05); }
}

.carousel div {
  font-size: 8rem;
  width: 250px;
  height: 250px;
  background: #007acc;
  color: white;
  border: 2px solid rgb(245, 245, 250);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
}
/* Vokal carousel - Enhanced */
.vokalCarousel div {
  font-size: 10rem;
  width: 280px;
  height: 280px;
  background: linear-gradient(145deg, #0a8a42, #0bbf5c);
  color: white;
  border: 6px solid #ffd93d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 10px 0 #087533, 0 15px 25px rgba(0,0,0,0.2);
  position: relative;
  font-weight: 900;
  text-shadow: 3px 3px 0 #087533;
  animation: bounce 2s infinite ease-in-out;
}

.vokalCarousel div::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #ffd93d);
  border-radius: 25px 25px 0 0;
}

.vokalCarousel div:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 15px 0 #087533, 0 20px 30px rgba(0,0,0,0.25);
}

/* Enhanced buttons */
.carousel button, .vokalCarousel button {
  font-size: 3rem;
  color: white;
  background: linear-gradient(145deg, #035669, #02738b);
  position: relative;
  margin-left: -20px;
  margin-right: -20px;
  border: 4px solid #ffd93d;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99999;
  box-shadow: 0 6px 0 #014a5a, 0 8px 15px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  display: flex;
}

.carousel button:hover, .vokalCarousel button:hover {
  background: linear-gradient(145deg, #02738b, #035669);
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 8px 0 #014a5a, 0 12px 20px rgba(0,0,0,0.3);
}

.carousel button:active, .vokalCarousel button:active {
  transform: translateY(2px) scale(1);
  box-shadow: 0 3px 0 #014a5a, 0 5px 10px rgba(0,0,0,0.2);
}

/* Enhanced animations */
@keyframes rainbow-border {
    0% { border-color: #ff6b6b; }
    25% { border-color: #4ecdc4; }
    50% { border-color: #45b7d1; }
    75% { border-color: #96ceb4; }
    100% { border-color: #ff6b6b; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

/* Bubbles background effect */
#emojiDisplay::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.3) 5%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.2) 8%, transparent 25%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.4) 6%, transparent 22%);
    animation: bubbles 8s infinite linear;
    z-index: 0;
}

@keyframes bubbles {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

.carouselImage{
display: none;
width: 300px; /* Set a fixed width for the images */
height: auto; /* Maintain aspect ratio */
justify-content: center;
align-items: center;
margin: auto;
 margin-right: 10px;
margin-top: 50px;
border: #eaf1f3;
border-radius: 10px;
transform: translate(-50%, -50%);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Optional: Add shadow */
animation: slideFromRight 1.5s ease-in-out forwards, float 3s infinite ease-in-out; /* Optional: Add animation */
}

/* Enhanced emoji display */
#emojiDisplay {
    padding: 25px 20px;
    font-size: 1.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #4ecdc4, #6a89cc);
    animation: zoom-in 0.5s forwards, rainbow-border 3s infinite linear;
    text-align: center;
    gap: 15px;
    border-radius: 25px;
    border: 6px solid #ffd93d;
    background-clip: padding-box;
    position: relative;
    box-shadow: 0 10px 0 #2a9d8f, 0 15px 25px rgba(0, 0, 0, 0.3);
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    width: 280px;
    height: 280px;
    margin: 10px;
    overflow: hidden;
    z-index: 1;
}

#emojiDisplay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #ffd93d);
  border-radius: 25px 25px 0 0;
  z-index: 2;
}
/* Enhanced animations */
@keyframes rainbow-border {
    0% { border-color: #ff6b6b; }
    25% { border-color: #4ecdc4; }
    50% { border-color: #45b7d1; }
    75% { border-color: #96ceb4; }
    100% { border-color: #ff6b6b; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

/* Bubbles background effect */
#emojiDisplay::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.3) 5%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.2) 8%, transparent 25%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.4) 6%, transparent 22%);
    animation: bubbles 8s infinite linear;
    z-index: 0;
}

@keyframes bubbles {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}
@keyframes instruction-pulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 8px 25px rgba(255, 165, 0, 0.6);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
    }
}
.target-letter-display {
    font-size: 3em;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    margin-top: 10px;
    animation: letter-glow 1.5s infinite alternate;
}

@keyframes letter-glow {
    from {
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    }
    to {
        text-shadow: 0 0 20px #FFD700, 0 0 30px #FFA500;
    }
}
.instruction-container {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 15px;
}
#bubbleInstruction {
    font-size: 1.5em;
    font-weight: bold;
    color: #000;
    text-shadow: 2px 2px 4px rgba(255, 215, 0, 0.7);
    margin-bottom: 15px;
    padding: 12px 24px;
    border-radius: 25px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
    display: inline-block;
    transition: all 0.3s ease;
    animation: instruction-pulse 2s infinite;
    border: 3px solid #FF8C00;
}
/* Ensure content stays above effects */
#emojiDisplay > *, .carousel #alphabetDisplay, .vokalCarousel div {
    position: relative;
    z-index: 1;
}

.emojiDisplay:hover {
    transform: translateY(-8px) scale(1.05);
    background: linear-gradient(145deg, #6a89cc, #4ecdc4);
    box-shadow: 0 15px 0 #2a9d8f, 0 20px 30px rgba(0, 0, 0, 0.4);
}

.emojiDisplay .emoji {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: 
        bounce 2s infinite ease-in-out,
        spin 8s infinite linear;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sparkle effects */
.carousel #alphabetDisplay::after, #emojiDisplay::after, .vokalCarousel div::after {
    content: '✨';
    position: absolute;
    font-size: 1.5rem;
    top: 15px;
    right: 15px;
    animation: sparkle 2s infinite;
    z-index: 3;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

/* Image styles */
#emojiDisplay img, .grid-item img, .dialog img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border-radius: 15px;
    border: 3px solid #ffd93d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .carousel, .vokalCarousel {
        margin-left: -20px;
        margin-right: -20px;
        gap: 1rem;
        padding: 20px;
    }
    
    #emojiDisplay, .carousel #alphabetDisplay, .vokalCarousel div {
        width: 200px;
        height: 200px;
        font-size: 1.5rem;
    }
    
    .carousel #alphabetDisplay {
        font-size: 5rem;
    }
    
    .vokalCarousel div {
        font-size: 6rem;
    }
    
    .carousel button, .vokalCarousel button {
        width: 50px;
        height: 50px;
        font-size: 2rem;
        margin-left: -15px;
        margin-right: -15px;
    }
}
/*grid*/
.grid-container {
  margin-top: 30px;
  display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 10px;
padding: 20px;
}
.grid-item {
  padding: 20px;
background: rgb(4, 95, 102);
text-align: center;
font-size: 24px;
font-weight: bold;
cursor: pointer;
border-radius: 5px;
}
.grid-item:hover{
  transform: scale(1.05);
}

.grid-item img {
  width: 60px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.grid-item:hover {
background: rgba(255, 255, 255, 0.1) !important;
transform: scale(1.05);
}
/* Style for the carousel, grid, and equation sections */
.grid-container {
flex: 2; /* Allow the section to take up remaining space */
padding: 10px; /* Add padding inside the sections */
}

/*sukukata*/
/* Ensure the sukukata container constrains its children */
#sukukata {
position: relative; /* Ensure child elements are positioned relative to this container */
overflow: auto;
}
.sukukata-dialog {
 
font-size: 5rem;
  position: fixed;
  width: 50%;
  height: auto;
  top: 50%;
  left: 50%;
  border: #035669;
  border-radius: 10px;
  transform: translate(-50%, -50%);
  background: rgb(37, 187, 122);
  padding: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
   display: none;
  z-index: 20;
}

.sukukata-dialog button {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #007acc;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.sukukata-dialog button:hover {
  background: #0056b3;
}
/* Style for dialogs */
#syllableDialog, #equationDialog {

position: fixed;
width: 50%;
height: auto;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 70px;
border-radius: 10px;
text-align: center;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
z-index: 1000;
}
#syllableDialog span {
font-size: 10rem;
}
#equationDialog div{
font-size: 4rem;
}
/* Close button for dialogs */
#closeDialogSukukata, #closeDialogEquation {
margin-top: 10px;
padding: 5px 10px;
background: rgba(255, 255, 255, 0.2);
border: none;
color: white;
cursor: pointer;
border-radius: 5px;
}

#closeDialogSukukata:hover, #closeDialogEquation:hover {
background: rgba(255, 255, 255, 0.3);
}
/* Style for clickable elements in the dialog */
.clickable {
cursor: pointer;
text-decoration: underline;
color: #ffcc00; /* Highlight color */
transition: color 0.3s ease;
}

.clickable:hover {
color: #ff9900; /* Hover color */
}



/*drag and drop sukukata*/

#syllable-bank {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  gap: 10px;
}
  
.syllable {
  width: 30px;
  height: 30px;
  color: #f0f0f0; 
  padding: 10px;
  border: 2px solid #ebf0ed;
  border-radius: 10px;
  text-align: center; 
  background-color: #055169;
  display: inline-block;
  margin: 5px;
  cursor: grab;
}
/* New class for clicked state */
.syllable.clicked {
  background-color: #ffcc00 !important; /* Change to yellow */
  color: #000 !important; /* Change text color to black */
}
/* New class for clicked state */
.syllable:hover {
  background-color: #ffcc00; /* Change to yellow */
  color: #000; /* Change text color to black */
}
.syllable.dragging {
  opacity: 0.8;
  transform: scale(1.1);
  cursor: grabbing;
}

   .drop-area {
    display: flex;
    justify-content: center;
    gap: 10px;
   
  }
  
.drop-box {
  color: #f0f0f0;
  width: 50px;
  height: 30px;
  padding: 20px;
  border: 3px solid #f6fafb;
  border-radius: 10px;
  text-align: center;
  background-color: #055169;
  display: inline-block;
  margin: 5px;
  touch-action: manipulation; /* Improves touch responsiveness */

  
  }
  .drop-box.highlight {
    background-color: rgba(100, 200, 100, 0.3);
    border: 2px dashed #4CAF50;
}
  .plus-sign,
.equals-sign {
    padding: 10px;
  font-weight: bold;
  margin: 0 10px;
}

.answer-container {
    color: #f0f0f0;
    width: 100px;
    padding: 20px;
    border: 3px solid #f4f7f8;
    border-radius: 10px;
    text-align: center;
    background-color: #055169;
    display: inline-block;
    margin: 5px;
    opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
.answer-container.answer-container{
  opacity: 1;
}

.hidden {
    visibility: hidden;
}
.hint-image {
    
  border-radius: 10px;
  background-color: #f0f0f0;
  border: 5px solid #055169;
  width: 150px;       /* Adjust size as needed */
  height: 150px;
  margin-right: 20px; /* Space between image and drop area */
  opacity: 0;
   

}
.syllable { touch-action: none; }
.dragging { opacity: .6; }   /* nice visual cue */

#image-container{
  width: 150px;       /* Adjust size as needed */
  height: 150px;
  background-color: #f0f0f0;
  border: 5px solid #219dc3;
  transition: opacity 0.3s ease-in-out;
}
#hint-image {
    display: flex;
    justify-content: center;
    vertical-align: center;
   
} 

img {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

img.lazy-loaded {
  opacity: 1;
}
#question-counter {
  position: absolute;
  top: 20px; /* Distance from the top of the viewport */
  left: 50%;
  font-size: 24px;
  font-weight: bold;
  color: #333; /* Adjust color to fit your design */
  z-index: 2;
}
#level-selection {
  text-align: center;           /* Center the content */
  margin-top: 50px;             /* Position it lower on the page */
  
}
#level-selection button {
  background-color: #4CAF50;    /* Green background */
  color: white;                 /* White text */
  padding: 10px 20px;           /* Padding around the text */
  font-size: 16px;              /* Font size */
  margin: 10px;                 /* Space between buttons */
  border: 5px solid #f0f0f0;                 /* Remove border */
  border-radius: 10px;           /* Rounded corners */
 }
#level-selection button:hover{
  cursor: pointer;              /* Pointer cursor on hover */
  transition: background-color 0.3s; /* Smooth hover effect */
  background-color: #074f09;  
}
.balloon-hidden {
  display: none;
}

/* Ensure balloons float on top */
#balloon-container {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999999 !important;
}

/* Balloon styling */
.balloon {
  width: 60px;
  height: 80px;
  background-image: url('/assets/image-mainsukukata/balloon.svg'); /* Replace with your SVG path */
  background-size: cover;
  background-repeat: no-repeat;
  position: absolute;
  bottom: 0;
  z-index: 9999;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.1s;
  animation-fill-mode: forwards;
}

/* Different float animations */
@keyframes floatUp {
  0% { transform: translateY(0) translateX(0); }
  100% { transform: translateY(-110vh) translateX(20px); }
}

@keyframes floatUpLeft {
  0% { transform: translateY(0) translateX(0); }
  100% { transform: translateY(-110vh) translateX(-30px); }
}

@keyframes floatUpRight {
  0% { transform: translateY(0) translateX(0); }
  100% { transform: translateY(-110vh) translateX(30px); }
}

/* Varying speeds for more natural float effect */
@keyframes floatUpSlow {
  0% { transform: translateY(0) translateX(0); }
  100% { transform: translateY(-110vh) translateX(10px); }
}

@keyframes floatUpFast {
  0% { transform: translateY(0) translateX(0); }
  100% { transform: translateY(-110vh) translateX(40px); }
}

/* Pop effect */
.pop {
  transform: scale(0);
  opacity: 0;
  transition: transform 0.2s, opacity 0.2s;
}

/* Ensure pop-up is always visible */
#popup-modal {
  color: #0056b3;
  position: fixed !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  padding: 15px;
  background-color: #ffffff;
  border-radius: 10px;
  border: 2px solid #e795c5;
  box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.7);
  text-align: center;
  z-index: 9999999 !important; /* SUPER HIGH to override everything */
  visibility: hidden;
  opacity: 0;
}

#popup-modal.show {
  visibility: visible;
  opacity: 1;
}

.popup-message {
  font-size: 18px;
  font-weight: bold;
  
}

.popup-message.success {
   color:#ee0fab
   
}

.popup-message.error {
    color:#cf6f95;
     
}


#popup-button {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  border-radius: 10px;
  border: 4px solid #fcf6fa;
  height: auto;
  cursor: pointer;
  z-index: 9999 !important; /* Ensures it's always on top */
  display: none; /* Hidden initially */
  transition: opacity 0.3s ease-in-out;
}

#popup-button.show {
  display: block; /* Show when balloons are done */
  opacity: 1;
}
#popup-button.hover {
  transform: scale(0.95);
}
#level-selection button:focus {
  outline: 2px solid #31a4ce;
}
/* Overlay ensures focus on pop-up */
#popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999998; /* Just below pop-up */
  visibility: visible;
  opacity: 1;
}

#popup-modal.show ~ #popup-overlay,#confirm-overlay {
  visibility: visible;
  opacity: 1;
}
.syllable:hover, .drop-box:hover, .answer-container:hover {
  transform: scale(1.05);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}
.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.game-container {
  opacity: 1;
  transition: opacity 0.5s ease-in;
}


.dialog img{
  margin-top: 50px;
  width: 150px;
  height: 150px;
}



.dialog {
  font-size: 4rem;
  letter-spacing: 20px;
  position: fixed;
  width: 50%;
  height: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(to right, rgb(10, 98, 113), rgb(19, 161, 174));
  border-radius: 20px;
  border: 4px solid white; /* Transparent inner border */
  
  outline: 4px solid  rgb(15, 159, 150); /* Solid outer border */
  padding: 20px;
  box-shadow: 0 0 10px rgba(65, 182, 109, 0.3);
   display: none;
  z-index: 20;
}
.dialog p {
  font-size: 4rem;
  margin: 0 0 20px 0;
 
}
.dialog button {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #007acc;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.dialog button:hover {
  background: #0056b3;
}
.overlay {
  position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: none;
z-index: 10;
}
.buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}
.buttons-grid button {
  padding: 1rem;
  background: #007acc;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.game-links a {
  margin: 0 1rem;
  text-decoration: none;
  color: white;
  background: #007acc;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.large-letter {
  font-size: 50px;
  display: inline-block;
font-weight: bold;
text-align: center;
}
@keyframes zoomIn {
  from {
      transform: scale(0.5);
      opacity: 0;
  }
  to {
      transform: scale(1);
      opacity: 1;
  }
}

@keyframes bounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-10px); }
}

@keyframes shake {
0%, 100% { transform: translateX(0); }
25% { transform: translateX(-5px); }
50% { transform: translateX(5px); }
75% { transform: translateX(-5px); }
}

@keyframes zoom-in {
0% { transform: scale(0.5); opacity: 0; }
100% { transform: scale(1); opacity: 1; }
}

@keyframes zoom-out {
0% { transform: scale(1.2); opacity: 1; }
100% { transform: scale(0.8); opacity: 0.5; }
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Animations */
@keyframes slideFromLeft {
  from { transform: translateX(-100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideFromTop {
  from { transform: translateY(-100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideFromRight {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideFromBottom {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Applying animations */
.left { animation: slideFromLeft 1.5s ease-in-out forwards; }
.top { animation: slideFromTop 1.5s ease-in-out forwards; }
.right { animation: slideFromRight 1.5s ease-in-out forwards; }
.bottom { animation: slideFromBottom 1.5s ease-in-out forwards; }
.fade-in { animation: fadeIn 1.5s ease-in-out forwards; }
.fade-out { animation: fadeOut 1.5s ease-in-out forwards; }


/* Assign animations */
.bounce {
animation: bounce 1.5s infinite;
}

.shake {
animation: shake 0.5s infinite;
}

.zoom-in {
animation: zoom-in 0.5s forwards;
}

.zoom-out {
animation: zoom-out 0.5s forwards;
}

.spin {
animation: spin 1.5s linear infinite;
}


/* Matching Game - Enhanced for Children */
@media (max-width: 768px) {
    #game-container, .card, .matching-card {
        min-height: 0;
        height: auto;
        padding: 10px;
        overflow: auto;
    }
    #equationDialog {
        font-size: 0.5em;
    }
}

@media (max-width: 480px) {
    #game-container, #matching-game-container, .card {
        flex-wrap: wrap;
        min-height: 0;
        height: auto;
        padding: 5px;
    }
}

.emoji {
    font-size: 60px;
    display: block;
    flex-direction: column;
    text-align: center;
}

.emoji-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.emoji-name, .emoji-namematching {
    font-size: 0.8em;
    margin-top: 4px;
    color: #edeaea;
}

.emoji-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

/* Enhanced Game Board with Fun Animations */
.game-board {
    display: grid;
    justify-content: center;
    width: 100%;
    height: auto;
    padding: 5px;
    gap: 5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    animation: boardAppear 0.8s ease-out;
}

@keyframes boardAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* Level-specific grid layouts */
.game-board.level-1-2 {
    grid-template-rows: repeat(2, minmax(70px, 1fr));
}

.game-board.level-3 {
    grid-template-rows: repeat(3, minmax(60px, 1fr));
}

.game-board.level-4-5 {
    grid-template-rows: repeat(4, minmax(50px, 1fr));
}

/* Enhanced Card Styling */
.card {
    width: 100%;
    height: 100%;
    aspect-ratio: 3/4;
    perspective: 800px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px) scale(1.05);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-style: preserve-3d;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3px;
    box-sizing: border-box;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.card-front {
    background: linear-gradient(145deg, #ff6b6b, #ff8e8e);
    font-size: 2em;
    color: white;
    border: 3px solid #ff4757;
    animation: cardPulse 2s infinite;
}

@keyframes cardPulse {
    0%, 100% {
        box-shadow: 0 4px 8px rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 6px 12px rgba(255, 107, 107, 0.6);
    }
}

.card-back {
    background: linear-gradient(145deg, #2decc9, #30daac);
    transform: rotateY(180deg);
    border: 3px solid #00b894;
}

.card.matched .card-back {
    background: linear-gradient(145deg, #8bc34a, #aed581);
    border-color: #689f38;
    animation: matchedCelebrate 0.6s ease-out;
}

@keyframes matchedCelebrate {
    0% {
        transform: rotateY(180deg) scale(1);
    }
    50% {
        transform: rotateY(180deg) scale(1.1);
    }
    100% {
        transform: rotateY(180deg) scale(1);
    }
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card.flipped {
    animation: flipBounce 0.6s ease-out;
}

@keyframes flipBounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Enhanced Content Styling */
.image-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    animation: contentAppear 0.5s ease-out;
}

@keyframes contentAppear {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.image-content img {
    max-width: 100%;
    max-height: 60px;
    object-fit: contain;
    margin-bottom: 5px;
    transition: transform 0.3s ease;
}

.image-content img:hover {
    transform: scale(1.1) rotate(5deg);
}

.emoji-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    animation: contentAppear 0.5s ease-out;
}

.emoji-symbol {
    font-size: 2em;
    margin-bottom: 5px;
    transition: transform 0.3s ease;
}

.emoji-symbol:hover {
    transform: scale(1.2);
}

.emoji-name {
    font-size: 1em;
    word-break: break-word;
    font-weight: bold;
    color: #2d3436;
}

.letter-display {
    font-size: 2em;
    font-weight: bold;
    color: #2d3436;
    animation: letterBounce 0.5s ease-out;
}

@keyframes letterBounce {
    0% {
        transform: scale(0.5);
    }
    70% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.emoji-name, .emoji-namematching {
    font-size: 1em;
    margin-top: 5px;
    text-align: center;
    word-break: break-word;
    font-weight: bold;
}

/* Success Animation for Completed Levels */
.level-complete {
    animation: levelComplete 1s ease-out;
}

@keyframes levelComplete {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .game-board {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
        gap: 4px;
    }
    
    .game-board.level-1-2 {
        grid-template-rows: repeat(2, minmax(60px, 1fr));
    }
    .game-board.level-3 {
        grid-template-rows: repeat(3, minmax(50px, 1fr));
    }
    .game-board.level-4-5 {
        grid-template-rows: repeat(4, minmax(40px, 1fr));
    }
    
    .card-front, .card-back {
        font-size: 0.8em;
        padding: 2px;
    }
    
    .emoji-symbol {
        font-size: 1.2em;
    }
    
    .image-content img {
        max-height: 30px;
    }
    
    .card:hover {
        transform: none; /* Disable hover effects on mobile */
    }
}

@media (max-width: 480px) {
    .game-board {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
        gap: 3px;
    }
    
    .game-board.level-1-2 {
        grid-template-rows: repeat(2, minmax(40px, 1fr));
    }
    .game-board.level-3 {
        grid-template-rows: repeat(3, minmax(30px, 1fr));
    }
    .game-board.level-4-5 {
        grid-template-rows: repeat(4, minmax(15px, 1fr));
    }
    
    .emoji-name {
        font-size: 1em;
    }
    
    .image-content img {
        max-height: 30px;
    }
}

/* For very small screens (e.g., iPhone 5/SE) */
@media (max-width: 320px) {
    .game-board {
        grid-template-columns: repeat(auto-fit, minmax(20px, 1fr));
    }
    
    .game-board.level-4-5 {
        grid-template-rows: repeat(4, minmax(20px, 1fr));
    }
    
    .image-content img {
        max-height: 20px;
    }
}

/* Floating Animation for Cards */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.card:nth-child(odd) {
    animation: float 3s ease-in-out infinite;
}

.card:nth-child(even) {
    animation: float 3s ease-in-out infinite 1.5s;
}

/* Celebration Effects */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #ff6b6b;
    animation: confettiFall 5s linear forwards;
    z-index: 1000;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Enhanced Level Title */
#levelTitle {
    font-family: 'Comic Sans MS', cursive;
    color: #ff6b6b;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    }
    to {
        text-shadow: 2px 2px 8px rgba(255, 107, 107, 0.6);
    }
}

/* Game Container Enhancement */
#gameContainer {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    border-radius: 20px;
    padding: 20px;
    margin: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: containerSlide 0.8s ease-out;
      align-items: center;
   overflow: hidden; /* Prevent scrolling */
  touch-action: none; /* Prevent accidental drag scrolls */
}

@keyframes containerSlide {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Hover Effects for Popup */
.popup-buttons button {
    transition: all 0.3s ease;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-weight: bold;
    cursor: pointer;
}

.popup-buttons button:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Sound Feedback Animation */
.card.sound-playing .card-back {
    animation: soundFeedback 0.5s ease-out;
}

@keyframes soundFeedback {
    0%, 100% {
        background: linear-gradient(145deg, #2decc9, #30daac);
    }
    50% {
        background: linear-gradient(145deg, #ffeaa7, #fab1a0);
    }
}
/* end of matching-game */


.card img, #emojiDisplay img, .grid-item img, .dialog img,
 .level-complete-image,.secondaryHeader img,#fillBlanksImage, 
 .subject-card img, #resultImage{
  opacity: 1 !important;
  display: block !important;
  visibility: visible !important;
}
.fill-blank-game, #emojiDisplay {
  position: relative;
  z-index: 10;
}

/* Popup styles with level images */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100px;
    height: auto;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
/* Popup styles */
.popup-image-container {
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.popup-image-container img.lazy {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s;
}
.popup-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.popup-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

#restartLevelButton {
    background-color: #f0f0f0;
}

#nextLevelButton {
    background-color: #4CAF50;
    color: white;
}

#restartLevelButton {
    background-color: #f0f0f0;
}

#nextLevelButton {
    background-color: #4CAF50;
    color: white;
    
}.buttonGame {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 180px;
  height: 180px;
  border: none;
  border-radius: 25px;
  overflow: hidden;
  cursor: pointer;
  background-color: #fef6e4;
  background-size: cover;
  background-position: center;
 box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.1), -4px -4px 10px rgba(255, 255, 255, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Soft gradient overlay for light and depth */
.buttonGame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom right, rgba(255,255,255,0.3), rgba(0,0,0,0.1));
  border-radius: 25px;
  z-index: 0;
}

/* Fun label with friendly look */
.buttonGame .button-label {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #fff8e1, #ffe082);
  color: #333;
  font-weight: 800;
  font-size: 1rem;
  border-radius: 15px;
  padding: 0.5rem 1rem;
  margin-bottom: 10px;
  box-shadow: 0 4px 0 #d7b94f, 0 6px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hover/tap bounce */
.buttonGame:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 #d4b483, 0 14px 18px rgba(0, 0, 0, 0.25);
}

/* Pressed squish effect */
.buttonGame:active {
  transform: translateY(4px) scale(0.96);
  box-shadow: 0 2px 0 #d4b483, 0 5px 8px rgba(0, 0, 0, 0.2);
}

.buttonGame:active .button-label {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b7953c;
}

/* Glow animation when hovered */
.buttonGame:hover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 25px;
  box-shadow: 0 0 15px rgba(255, 230, 120, 0.6);
  z-index: 0;
  animation: softGlow 1.5s infinite alternate;
}

@keyframes softGlow {
  from { box-shadow: 0 0 8px rgba(255, 230, 120, 0.3); }
  to { box-shadow: 0 0 18px rgba(255, 230, 120, 0.8); }
}

/* Fun wiggle animation for mobile tap */
@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.buttonGame:active {
  animation: bounce 0.25s ease;
}


/* Responsive text for small screens */
@media (max-width: 480px) {
  .buttonGame {
    width: 140px;
    height: 140px;
    border-radius: 20px;
  }
  .buttonGame .button-label {
    font-size: 0.9rem;
  }
}
.sound-controls {
  margin: auto;
color: #0056b3;
  top: 20px;
  right: 20px;
  display: inline-flex;
  gap: 10px;
  font-family: sans-serif;
  font-size: 14px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 24px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #4caf50;
}

input:checked + .slider:before {
  transform: translateX(26px);
}
#sound-Display{
  font-size: 1.5em;
  margin-bottom: 4px;
}

/* Bubble Game Styles */
#bubbleGameContainer {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.bubble-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.bubble-game-stats {
    display: flex;
    gap: 25px;
    align-items: center;
}

.bubble-stat {
    font-size: 1.3em;
    font-weight: bold;
    padding: 10px 20px;
    background: rgba(255,255,255,0.15);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
    min-width: 120px;
    text-align: center;
}

#bubbleInstruction {
    font-size: 1.4em;
    font-weight: bold;
    text-align: center;
    padding: 12px 25px;
    background: rgba(255,255,255,0.95);
    border-radius: 30px;
    color: #333;
    border: 3px solid #ffd700;
    animation: pulse-glow 2s infinite;
    box-shadow: 0 4px 15px rgba(255,215,0,0.3);
}

#bubbleCanvas {
    display: block;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    background: linear-gradient(180deg, #1a2980 0%, #26d0ce 100%);
    cursor: pointer;
}
@import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@400;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Verdana:wght@400;700;900&display=swap');

/* Add these styles to your existing CSS */
#bubbleCanvas {
    font-smooth: always;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* End Game Dialog */
.bubble-end-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.bubble-end-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 25px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: scale-in 0.4s ease;
    color: white;
    border: 3px solid rgba(255,255,255,0.2);
}

.bubble-end-content h2 {
    color: white;
    margin-bottom: 20px;
    font-size: 2.2em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#bubbleFinalScore {
    font-size: 3em;
    font-weight: bold;
    color: #FFD700;
    margin: 25px 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    animation: bounce 0.5s ease;
}

.bubble-end-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.bubble-end-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

#restartBubbleBtn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #8B4513;
}

#backToMenuBubbleBtn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.bubble-end-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.bubble-end-btn:active {
    transform: translateY(-1px);
}

/* Animations */
@keyframes score-pop {
    0% { transform: scale(1); color: white; }
    50% { transform: scale(1.3); color: #FFD700; }
    100% { transform: scale(1); color: white; }
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.8);
        transform: scale(1.05);
    }
}

@keyframes scale-in {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .bubble-game-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .bubble-game-stats {
        justify-content: center;
        gap: 15px;
    }
    
    .bubble-stat {
        font-size: 1.1em;
        min-width: 100px;
        padding: 8px 15px;
    }
    
    #bubbleInstruction {
        font-size: 1.2em;
        padding: 10px 20px;
    }
    
    .bubble-end-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .bubble-end-btn {
        min-width: 120px;
        padding: 12px 25px;
    }
}

/* Canvas hover effects */
#bubbleCanvas:hover {
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    transition: box-shadow 0.3s ease;
}

/*fill in the blanks*/
.fill-blanks-game {
    text-align: center;
    padding: 1em;
}


.blank-word {
  margin-top: .5em;
  font-size: 3em;
  margin-bottom: .5em;

}

.letter-choices {
    display: flex;
    justify-content: center;
    gap: 2.5em;
    margin-bottom: 1em;
    color: #eaf1f3;
}

.letter-btn {
  color: #f0f0f0;
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid #1a92b3;
    background: #094b65;
    flex-direction: wrap;
    font-size: 1.5em;
    cursor: pointer;
}

.feedback-message {
    font-size: 1.2em;
    margin-bottom: 1em;
}

/*fill in the blank*/
.progress-text   { font-weight:600; margin:0.4em 0; }
.end-modal       { position:fixed; inset:0; display:flex; justify-content:center; align-items:center;
                   background:rgba(0,0,0,.6); z-index:999; color: #0056b3;}
.end-card        { background:#fff; padding:2em 3em; border-radius:1rem; text-align:center;
                   max-width:90%; box-shadow:0 8px 20px rgba(0,0,0,.2); }
.end-card button { margin-top:1em; padding:.6em 1.2em; font-size:1.1em; cursor:pointer; }
/* Add to your CSS file */
#fillBlanksImage {
  display:block;      /* ensures it participates in layout */
  max-width:150px;    /* or whatever you like */
  width:100%;         /* allows it to scale in a flex/column */
  height:auto;        /* keeps aspect ratio */
  margin: auto;
  margin-bottom: 10px;
}
.blank.correct {
  color: green;
  font-weight: bold;
}
.blank.wrong {
  color: red;
  font-weight: bold;
}
.blank {
    padding: 0 6px;
    cursor: pointer;
    border-bottom: 2px dashed #aaa;
    min-width: 20px;
    display: inline-block;
    text-align: center;
}

.blank.active-blank {
    border-bottom: 2px solid #000;
    background-color: #2535c6; /* light yellow */
}

.blank.filled-temp {
    background-color: #119496; /* same light yellow */
    font-weight: bold;
}


#confettiContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: visible;
  pointer-events: none;
  z-index: 999999; /* Make sure it's above ALL other elements */
}

.confetto {
  position: absolute;
  top: 0;
  pointer-events: none;
  border-radius: 50%;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}
/* Loading spinner styles */ 
.loading-Spinner {
   display: none; /* Hidden initially */ 
   width: 40px; height: 40px; border: 4px solid rgba(37, 35, 144, 0.1); 
   border-top-color: #6466ed; 
   border-radius: 50%; 
   animation: spin 1s linear infinite; 
   margin: 20px auto; } @keyframes spin { to { transform: rotate(360deg); } }


.confirm-overlay {
  color: #000;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; justify-content: center; align-items: center;
  z-index: 9999;
}

.confirm-box {
  background: #fff; padding: 1.5em 2em; border-radius: 12px;
  text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.3);
}

.confirm-box button {
  margin: 0.5em 0.8em; padding: 0.5em 1.2em; cursor: pointer;
}
.fun-btn {
  font-size: 1.2em;
  background: linear-gradient(to right, #ff8a00, #ffc837);
  border: none;
  border-radius: 20px;
  padding: 12px 20px;
  margin: 10px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.fun-btn:hover {
  transform: scale(1.1);
  background: linear-gradient(to right, #ffc837, #ff8a00);
}

.next-btn {
  background: linear-gradient(to right, #00b09b, #96c93d);
}

.next-btn:hover {
  background: linear-gradient(to right, #96c93d, #00b09b);
}
/*fill in the blanks*/

.fillBlanksGameContainer{
  display: flex;
}


/* --- Subject Grid --- */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 380px;
  padding: 10px;
  box-sizing: border-box;
}

.subject-card {
  background: linear-gradient(135deg, #fff, #ffe082);
  border-radius: 16px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 3px solid transparent;
}

.subject-card:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.subject-card.selected {
  border-color: #4caf50;
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
}

.subject-card img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin-bottom: 6px;
}

.subject-card span {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

/* --- Fun buttons --- */
.fun-btn {
  background: linear-gradient(90deg, #ffca28, #ffa726);
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  color: white;
  font-weight: bold;
  font-size: 1rem;
  margin-top: 10px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(255, 152, 0, 0.4);
  transition: transform 0.2s;
}

.fun-btn:hover {
  transform: scale(1.05);
}

.fun-btn:disabled {
  background: #ffe082;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
}

/* Small button variant */
.small-btn {
  background: linear-gradient(90deg, #ffecb3, #ffd54f);
  border: 2px solid #ffa000;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #444;
}

/* --- Text and feedback --- */
h3 {
  font-size: 1.4rem;
  color: #333;
  margin: 5px 0;
  text-shadow: 1px 1px #fff;
}

.highscore,
.timer-text,
.progress-text {
  font-size: 1rem;
  color: #5d4037;
  margin: 2px;
}

.feedback-message {
  font-size: 1.2rem;
  font-weight: bold;
  color: #4caf50;
  animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0.7); opacity: 0; }
  80% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

/* --- Letter choices --- */
.letter-choices {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}

.letter-choices button {
  width: 45px;
  height: 45px;
  font-size: 1.2rem;
  border-radius: 10px;
  background: #ffcc80;
  border: none;
  box-shadow: 0 3px 5px rgba(0,0,0,0.2);
  color: #333;
  transition: transform 0.2s;
}

.letter-choices button:hover {
  transform: scale(1.1);
}

/* --- Make sure images fit --- */
#imageWrapper img {
  width: 120px;
  height: auto;
  margin: 5px auto;
  display: block;
  border-radius: 12px;
  background: #fff8e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* --- Fit all nicely within viewport --- */
#subjectSelectorPanel, #fillBlanksGameArea {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.button-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px; /* space between buttons */
  margin-top: 10px;
  flex-wrap: wrap; /* ensures it stays mobile-friendly */
}

.button-row .fun-btn {
  flex: 1;
  max-width: 160px;
}
.next-btn {
  background: linear-gradient(90deg, #66bb6a, #43a047);
}

/* Container for inline buttons */
.button-group {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 10px;
  position: relative;
}

/* Fullscreen Button Styling */
.mainContainer[data-fullscreen] {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  font-size: 24px;
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
  animation: pulse-glow 2s infinite, bounce-gentle 3s infinite;
  order: 2; /* Fullscreen button on the right */
}

/* Cool Back Button Styling */
#back-to-menu-container.back-to-menu-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  border: none;
  border-radius: 50%;
  font-size: 24px;
  color: white;
  box-shadow: 
    0 4px 15px rgba(76, 175, 80, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
  animation: pulse-green 2s infinite, bounce-subtle 3s infinite;
  order: 1; /* Back button on the left */
}

/* Hover effects */
.mainContainer[data-fullscreen]:hover,
#back-to-menu-container.back-to-menu-container:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  animation: none;
}

/* Active/click effects */
.mainContainer[data-fullscreen]:active,
#back-to-menu-container.back-to-menu-container:active {
  transform: scale(0.95);
}

/* Pointer for Fullscreen Button (points right) */
.mainContainer[data-fullscreen]::after {
  content: "👈";
  position: absolute;
  top: 50%;
  right: -50px;
  transform: translateY(-50%);
  font-size: 24px;
  opacity: 0;
  animation: point-right 2s infinite;
  pointer-events: none;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* Pointer for Back Button (points left) */
#back-to-menu-container.back-to-menu-container::after {
  content: "🔙";
  position: absolute;
  top: 50%;
  left: -50px;
  transform: translateY(-50%);
  font-size: 24px;
  opacity: 0;
  animation: point-left 2s infinite;
  pointer-events: none;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* Back icon animations */
#back-to-menu-container .back-icon {
  display: inline-block;
  transition: transform 0.3s ease;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.3));
}

#back-to-menu-container:hover .back-icon {
  transform: translateX(-2px);
}

/* Fullscreen icon animations */
.mainContainer .fullscreen-icon {
  display: inline-block;
  transition: transform 0.3s ease;
}

.mainContainer:hover .fullscreen-icon {
  transform: scale(1.1);
}

/* Animations */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); }
  50% { box-shadow: 0 4px 25px rgba(102, 126, 234, 0.6), 0 0 30px rgba(102, 126, 234, 0.4); }
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3); }
  50% { box-shadow: 0 4px 25px rgba(76, 175, 80, 0.6), 0 0 30px rgba(76, 175, 80, 0.4); }
}

@keyframes bounce-gentle {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
  60% { transform: translateY(-3px); }
}

@keyframes bounce-subtle {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-3px); }
  60% { transform: translateY(-2px); }
}

@keyframes point-right {
  0%, 100% {
    opacity: 0;
    transform: translateY(-50%) translateX(-10px);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

@keyframes point-left {
  0%, 100% {
    opacity: 0;
    transform: translateY(-50%) translateX(10px);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* Ripple effects */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .button-group {
    gap: 15px;
  }
  
.blank-word {
   font-size: 2em;
}
  
  .mainContainer[data-fullscreen],
  #back-to-menu-container.back-to-menu-container {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  
  .mainContainer[data-fullscreen]::after {
    font-size: 20px;
    right: -40px;
  }
  
  #back-to-menu-container.back-to-menu-container::after {
    font-size: 20px;
    left: -40px;
  }
}
.mirror-drag {
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  transition: transform 0.1s ease;
}
