html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Comic Neue', sans-serif;
    text-align: center;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f7ff 100%); /* Subtle gradient */
    /* --- MODIFICATION --- */
    overflow-y: auto; /* Changed from hidden to allow scrolling */
    /* --- END MODIFICATION --- */
    touch-action: manipulation;
}

h1 {
    font-size: 3.5em;
    margin: 40px 0 20px 0;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25em;
    text-shadow: 2px 2px 0px #fff;
}

.title-logo {
    height: 2.5em;
    width: auto; /* Maintain aspect ratio */
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.1));
}

.menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 20px;
    /* --- ADD THIS --- */
    padding-bottom: 40px; /* Add padding to bottom for scrolling */
    /* --- END ADDITION --- */
}

.menu-btn {
    font-family: 'Comic Neue', sans-serif;
    font-size: 2.8em;
    font-weight: 700;
    padding: 25px 50px;
    width: 80%;
    max-width: 450px;
    border-radius: 25px; /* Softer corners */
    border: none; /* Removed border for cleaner look */
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 0 rgba(0,0,0,0.2), 0 10px 10px rgba(0,0,0,0.1); /* 3D effect */
    position: relative;
    top: 0;
}

.menu-btn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 rgba(0,0,0,0.2), 0 0 0 rgba(0,0,0,0.1);
}

/* Button Colors with Gradients */
#alphabet-btn { background: linear-gradient(to bottom, #5cb85c, #4cae4c); }
#number-btn   { background: linear-gradient(to bottom, #3F51B5, #303F9F); }
#coloring-btn { background: linear-gradient(to bottom, #FF9800, #F57C00); }
#spelling-btn { background: linear-gradient(to bottom, #90D5FF, #64B5F6); color: #01579B; text-shadow: none; }
#shapes-colors-btn { background: linear-gradient(to bottom, #9C27B0, #7B1FA2); }


/* Responsive styles for smaller screens */
@media (max-width: 600px) {
    h1 {
        font-size: 2.5em;
    }
    .menu-btn {
        font-size: 2em;
        padding: 20px 30px;
    }
    .title-logo {
        height: 2.2em; /* 10% smaller than the text's full height */
    }
}
/* --- START: ADD THIS FOR LANDSCAPE PHONES --- */

/* This targets screens in landscape (width > height) 
  AND where the height is very short (max-height: 500px).
  This is the typical profile for a phone held sideways.
*/
@media (orientation: landscape) and (max-height: 600px) {

    h1 {
        font-size: 2.2em;      /* Make the title smaller */
        margin: 13px 0 13px 0; /* Reduce top/bottom margin */
    }

    .menu-container {
        gap: 15px;      /* Reduce space between buttons */
        padding: 8px;  /* Reduce top/bottom padding */
    }

    .menu-btn {
        font-size: 1.6em;       /* Make button text much smaller */
        padding: 12px 20px;   /* Reduce button padding */
        border-width: 3px;
    }
    .title-logo {
        height: 2.2em; /* 10% smaller than the text's full height */
    }
}
/* --- END: ADD THIS FOR LANDSCAPE PHONES --- */
/* --- Video Time Link Button --- */
.video-link-btn {
  display:  inline;
  position: absolute;
  top: 20px;
  right: 20px; /* Position opposite the home/back button */
  font-size: 2.2em;
  color: #dc3545; /* Red color to attract attention */
  text-decoration: none;
  padding: 10px;
  z-index: 100;
  transition: transform 0.2s;
  /* Add the animation */
  animation: pulse-red 1.5s infinite ease-in-out;
}

.video-link-btn:active {
  transform: scale(0.9);
}

/* Pulse animation */
@keyframes pulse-red {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- Responsive Fixes for Video Link --- */
@media (orientation: landscape) and (max-height: 500px) {
  .video-link-btn {
    top: 10px;
    right: 10px;
    font-size: 1.8em;
  }
}

@media (orientation: portrait) and (max-width: 480px) {
  .video-link-btn {
    top: 15px;
    right: 15px;
  }
}

/* Fix for Spelling/Number apps where back-btn becomes static */
@media (orientation: portrait) and (max-width: 480px) {
  .back-btn {
    position: static; 
    margin-top: 15px;
  }
  /* Ensure video link stays in the corner */
  .video-link-btn {
      position: absolute; 
  }
}
#sticker-book-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
}
.sticker-book-content {
    background: white; padding: 20px; border-radius: 20px;
    width: 80%; max-width: 600px; text-align: center;
}
#sticker-grid {
    display: flex; flex-wrap: wrap; gap: 15px; justify-content: center;
}
.sticker-slot {
    width: 80px; height: 80px; border-radius: 50%;
    border: 4px dashed #ccc; display: flex;
    justify-content: center; align-items: center; font-size: 3em;
    background: #f9f9f9; opacity: 0.5; grayscale: 100%;
}
.sticker-slot.earned {
    border-style: solid; border-color: #FFD700;
    background: #fff; opacity: 1; grayscale: 0%;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
/* --- Sticker Book Upgrades --- */

/* Silhouette Effect for locked stickers */
.sticker-locked {
    filter: brightness(0) opacity(0.2);
    pointer-events: none;
}

/* Click animation */
.sticker-slot {
    cursor: pointer;
    transition: transform 0.1s;
}
.sticker-slot:active {
    transform: scale(0.9);
}
.sticker-slot.bounce {
    animation: stickerBounce 0.5s;
}
@keyframes stickerBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Progress Bar */
#sticker-progress-container {
    width: 100%;
    background-color: #eee;
    border-radius: 10px;
    margin: 10px 0 20px 0;
    height: 25px;
    overflow: hidden;
    border: 2px solid #ccc;
}
#sticker-progress-bar {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9em;
    font-weight: bold;
    white-space: nowrap;
}

/* Modal Open Animation */
#sticker-overlay > div {
    animation: bookOpen 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes bookOpen {
    0% { transform: scale(0) rotateY(90deg); opacity: 0; }
    100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}

/* Play Mode Canvas */
#sticker-canvas-container {
    width: 100%;
    /* Make it occupy 55% of the screen height, or at least 400px */
    height: 55vh; 
    min-height: 400px;
    background-color: #fff;
    border: 4px dashed #FFD700;
    border-radius: 15px;
    margin-top: 20px;
    overflow: hidden;
    display: none; /* Hidden by default */
    position: relative;
}
.play-mode-active #sticker-grid { display: none; }
.play-mode-active #sticker-canvas-container { display: block; }
