/* --- Part 4: Blow the Candle --- */

/* Flame is placed on the candle already drawn in the cake image.
   It does not affect cake size or cake position. */
#magic-candle-flame {
    position: absolute;
    top: -4.7vw;
    left: 52%;
    width: 15%;
    height: auto;
    opacity: 0;
    transform: translateX(-50%);
    transform-origin: bottom center;
    z-index: 4;
    cursor: pointer;
    user-select: none;
    -webkit-user-drag: none;
}

/* Instruction box at the top of the screen */
.candle-instruction {
    position: fixed;
    top: 4vh;
    left: 50%;
    width: min(430px, 82vw);
    padding: 14px 28px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 50px;
    background: rgba(255, 245, 250, 0.94);
    box-shadow: 0 8px 24px rgba(194, 24, 91, 0.16);
    color: #c2185b;
    font-family: 'Fredoka', sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    z-index: 100;
}

/* Custom air-blower / knife cursor */
.magic-cursor {
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    pointer-events: none;
    font-size: 30px;
    line-height: 1;
    transform: translate(-4px, -4px);
    z-index: 1000;
}

.candle-mode,
.candle-mode * {
    cursor: none !important;
}

.candle-mode .magic-cursor {
    display: block;
}

/* Little sparkle at the candle after each scratch */
.candle-spark {
    position: fixed;
    pointer-events: none;
    color: #ffd54f;
    font-size: 22px;
    z-index: 200;
}

/* Emoji rain when candle goes out */
.candle-celebration {
    position: fixed;
    top: -40px;
    pointer-events: none;
    z-index: 150;
}

@media (max-width: 768px) {
    #magic-candle-flame {
        top: -8%;
        width: 13%;
    }

    .candle-instruction {
        top: 3vh;
        padding: 12px 20px;
    }
}