/* Mystery Pupil Styles */

.mystery-pupil {
    width: 100px;
    height: 100px;
    background-color: #000;
    border-radius: 50%;
    position: relative;
    animation: blink 5s infinite;
}

.mystery-pupil::before {
    content: '';
    width: 30px;
    height: 30px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 35px;
    left: 35px;
}

@keyframes blink {
    0%, 20%, 40%, 60%, 80%, 100% {
        transform: scaleY(1);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: scaleY(0.1);
    }
}

#mystery-pupil-tool {
    width: 250px;
    height: 165px; /* Consistent height with Random Name picker */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribute space evenly */
    box-sizing: border-box;
    padding: 15px; /* Standard padding */
    background: white;
    text-align: center; /* Match Random Name picker */
}

#mystery-pupil-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px; /* Increased to ensure consistent size */
    margin: 0; /* Remove vertical margins */
    padding: 10px; /* Consistent padding */
    word-wrap: break-word;
    word-break: break-word;
    text-align: center;
    overflow: hidden; /* Prevent overflow */
}

/* Removed mystery-pupil-controls wrapper div */

/* Mystery Pupil Button styling */
#mystery-pupil-button {
    background-color: #e0e0e0;
    color: #333;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    margin: 0 0 8px 0;
    min-width: 80px;
    width: auto;
    white-space: nowrap;
    align-self: center;
}

#mystery-pupil-button:hover {
    background-color: #d0d0d0;
}

#mystery-pupil-display.no-class {
    font-size: 1.2em;  /* Match random name picker size */
    color: #666;
    font-style: italic;
    text-align: center;
    opacity: 1;
    visibility: visible;
    font-weight: bold;  /* Match random name picker */
    margin: 0; /* No additional margins to maintain consistent dimensions */
    padding: 10px; /* Consistent padding */
}

#mystery-pupil-display.obscured {
    color: transparent;
    user-select: none;
}

.particle-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.6; /* Reduced from 0.8 */
    width: 6px;
    height: 6px;
    border: 1px solid transparent;
    will-change: transform; /* Optimize transforms */
    transition: opacity 0.4s ease-out;
    background: transparent;
}

.particle.trail {
    width: 3px;
    height: 3px;
    opacity: 0.6; /* Increased from 0.4 */
    background: #4CAF50;
    transition: transform 0.15s linear, opacity 0.3s ease; /* Slower fade */
}

.particle.floating {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.5; /* Reduced from 0.7 */
    filter: blur(0.5px);
    transition: all 3s ease-in-out, transform 0.1s linear;
}

#mystery-pupil-button:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Removed duplicate button styling that was overriding the margin */

/* Remove or comment out the old floatingAnimation keyframes since we're using JS for movement */

@keyframes particleAnimation {
    0% {
        transform: translate(0, 0);
        opacity: 0.8;
    }
    100% {
        transform: translate(var(--tx), var(--ty));
        opacity: 0;
    }
}

@keyframes glowPulse {
    0% {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.5),
                     0 0 20px rgba(255, 223, 0, 0.3);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.8),
                     0 0 30px rgba(255, 223, 0, 0.5),
                     0 0 40px rgba(255, 223, 0, 0.3);
        transform: scale(1.05);
    }
    100% {
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.5),
                     0 0 20px rgba(255, 223, 0, 0.3);
        transform: scale(1);
    }
}

@keyframes rainbowGlow {
    0% {
        color: #ff0000;
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.5),
                     0 0 20px rgba(255, 0, 0, 0.3);
        transform: scale(1);
    }
    20% {
        color: #ff9900;
        text-shadow: 0 0 10px rgba(255, 153, 0, 0.5),
                     0 0 20px rgba(255, 153, 0, 0.3);
    }
    40% {
        color: #ffff00;
        text-shadow: 0 0 20px rgba(255, 255, 0, 0.8),
                     0 0 30px rgba(255, 255, 0, 0.5);
        transform: scale(1.05);
    }
    60% {
        color: #33ff33;
        text-shadow: 0 0 10px rgba(51, 255, 51, 0.5),
                     0 0 20px rgba(51, 255, 51, 0.3);
    }
    80% {
        color: #3333ff;
        text-shadow: 0 0 20px rgba(51, 51, 255, 0.8),
                     0 0 30px rgba(51, 51, 255, 0.5);
        transform: scale(1);
    }
    100% {
        color: #ff0000;
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.5),
                     0 0 20px rgba(255, 0, 0, 0.3);
        transform: scale(1);
    }
}

.explosion {
    animation: explode 0.5s ease-out forwards;
}

@keyframes revealName {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.reveal {
    animation: revealName 0.3s ease-out forwards;
}

#mystery-pupil-display:not(.obscured):not(.no-class):not(:empty) {
    font-size: 1.5em;      /* Slightly reduced font size */
    line-height: 1.2;      /* Add line height control */
    padding: 10px;         /* Consistent with other states */
    font-weight: bold;     /* Make text bold */
    animation: rainbowGlow 4s infinite ease-in-out;
    margin: 0;             /* Ensure consistent margins */
}