/* --- Part 3: Cake Intro Styles --- */

/* Boy Container */
.character {
    position: absolute;
    bottom: 15%; 
    left: 120vw; /* Starts off-screen on the RIGHT */
    transform: translateX(-50%); /* This makes the 'left' coordinate the exact center of the boy */
    
    /* --- TWEAK BOY SIZE HERE --- */
    width: 15vw; 
    
    height: auto;
    z-index: 5;
}

.character img#boy-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Cake Wrapper - Balanced on hands */
.cake-wrapper {
    position: absolute;
    bottom: 100%; /* Sits exactly on top of the boy's head */
    left: 50%;
    transform: translateX(-50%);
    width: 30vw; 
    max-width: 450px;
    height: auto;
    z-index: 10;
    opacity: 0;
    
    /* --- TWEAK THIS TO MOVE CAKE ONTO HIS HANDS --- */
    /* Positive number (e.g., 20px) moves it DOWN */
    /* Negative number (e.g., -20px) moves it UP */
    margin-bottom: -100px; 
}

.cake-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25));
}

/* Walking bounce effect */
.character.walking {
    animation: walkBounce 0.35s ease-in-out infinite;
}

@keyframes walkBounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0px);
    }

    50% {
        transform: translateX(-50%) translateY(-6px);
    }
}
/* Giant Cake (The one that falls) */
/* Giant Cake */
.big-cake {
    position: absolute;
    bottom: 15%; /* Same bottom as the boy */
    left: 50%;   /* Exact middle of the screen */
    transform: translateX(-50%); /* Centers the cake perfectly */
    
    /* --- TWEAK CAKE SIZE HERE --- */
    width: 25vw; 
    max-width: auto;
    
    height: auto;
    z-index: 10;
    opacity: 0; 
}

.big-cake img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.3));
}

/* --- Subtitle Boxes (Pill Shape) --- */
.dialogue-box {
    background: rgba(255, 245, 250, 0.95);
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    padding: 15px 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    z-index: 20;
    opacity: 0;
    max-width: 300px;
    text-align: center;
    position: absolute;
    white-space: normal;
    word-wrap: break-word;
}

.dialogue-box p {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    color: #c2185b;
    margin: 0;
    font-weight: 500;
    line-height: 1.4;
}

/* Boy's Subtitle: Floating to the left of his head */
.boy-dialogue {
    top: 20%; 
    right: 110%; /* <-- TWEAK: Move box left/right relative to boy */
    transform: translateY(-50%);
}

/* Cake's Subtitle: On the left side of the giant cake */
.cake-dialogue {
    top: 10vw; /* <-- TWEAK: Move box up/down on the cake */
    left: -30%; /* <-- TWEAK: Move box left/right relative to cake */
    transform: translateY(-50%);
}

@media (max-width: 768px) {
    .character { width: 40vw; }
    .cake-wrapper { width: 50vw; margin-bottom: -20px; }
    .big-cake { width: 50vw; }
    .boy-dialogue { right: 105%; }
    .cake-dialogue { left: -10%; }
}
/* Boy peeking from behind the EXISTING cake.
   This does not change the cake size or position. */

#big-cake-image {
    position: relative;
    z-index: 2;
}

#peeking-boy-image {
    position: absolute;
    bottom: 5vw;
    width: 25%;
    height: auto;
    opacity: 0;
    z-index: 1; /* Behind the cake */
}

/* Moves the existing dialogue to the left of the peeking boy */
.big-cake.boy-is-peeking .cake-dialogue {
    left: -50%;
    top: 27%;
    transition: left 0.45s ease, top 0.45s ease;
}

@media (max-width: 768px) {
    #peeking-boy-image {
        left: -31%;
        width: 61%;
    }

    .big-cake.boy-is-peeking .cake-dialogue {
        left: -130%;
        top: 22%;
    }
}