/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #000011 0%, #001133 50%, #000022 100%);
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    padding-bottom: 80px; /* Make space for footer */
    z-index: 10;
}

/* Game Area Styles */
.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    position: relative;
    z-index: 10;
}

#canvas-container {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
}

/* Critical styling for response display */
#response-display {
    text-align: center;
    font-size: 1.5rem;
    min-height: 80px;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    background-color: rgba(40, 40, 100, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 1000; /* Ensure it's on top */
    position: fixed; /* Changed from absolute to fixed */
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 0;
    visibility: visible;
    display: block;
    pointer-events: none; /* Allow clicks through */
}

#response-display.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    visibility: visible !important; /* Force visibility */
    display: block !important; /* Force display */
    color: white;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.3); /* Add border for visibility */
}

/* Add a pulse animation for better visibility */
@keyframes responsePulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 40, 100, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(40, 40, 100, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 40, 100, 0); }
}

#response-display.active {
    animation: responsePulse 2s infinite;
}

/* Magic response style */
#response-display.magic {
    background: linear-gradient(135deg, #7303c0, #ec38bc, #fdeff9);
    color: white;
    text-shadow: 0 0 5px #fff, 0 0 10px #fff;
    font-weight: bold;
    box-shadow: 0 0 20px rgba(237, 56, 188, 0.7);
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 20;
}

footer a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

footer a:hover {
    color: #a9a0fc;
    text-decoration: underline;
}

/* Animation Classes */
@keyframes sparkle {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* Interaction prompt */
.interaction-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 130px);
    color: rgba(255, 255, 255, 1);
    font-size: 1.5rem;
    text-align: center;
    opacity: 1;
    transition: opacity 1s ease;
    pointer-events: none;
    z-index: 30;
    background-color: rgba(0, 0, 50, 0.5);
    padding: 15px;
    border-radius: 10px;
    max-width: 80%;
    font-weight: bold;
    text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}

/* Responsive Styles */
@media (max-width: 768px) {
    #response-display {
        font-size: 1.2rem;
        width: 95%;
        bottom: 80px;
    }
}

@media (max-width: 480px) {
    #response-display {
        font-size: 1rem;
        padding: 0.8rem;
        bottom: 60px;
    }
    
    footer {
        padding: 0.8rem;
        font-size: 0.8rem;
    }
}