body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background-color: #0a0a0a;
    font-family: 'Arial', sans-serif;
    color: #fff;
    user-select: none; /* Prevent text selection during gameplay */
}

.game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    background-color: #111;
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.5), inset 0 0 10px rgba(0, 150, 255, 0.2);
    cursor: crosshair;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

canvas:focus {
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.7), inset 0 0 15px rgba(0, 150, 255, 0.3);
    outline: none;
}

.ui-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    font-size: 18px;
    text-shadow: 0 0 5px rgba(0, 150, 255, 0.7);
}

#score, #shield-charge {
    margin-bottom: 10px;
    padding: 8px 15px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
    border: 1px solid rgba(0, 150, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 150, 255, 0.3), inset 0 0 8px rgba(0, 150, 255, 0.2);
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    font-weight: 500;
}

#score, #shield-charge:hover {
    border-color: rgba(0, 150, 255, 0.8);
    box-shadow: 0 0 15px rgba(0, 150, 255, 0.5), inset 0 0 8px rgba(0, 150, 255, 0.3);
}

#game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.85);
    padding: 40px;
    border-radius: 15px;
    border: 2px solid rgba(0, 150, 255, 0.7);
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.6), inset 0 0 15px rgba(0, 150, 255, 0.2);
    text-align: center;
    z-index: 100;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.5s ease-out;
}

#restart-button {
    margin-top: 20px;
    padding: 12px 25px;
    background-color: rgba(0, 150, 255, 0.7);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    outline: none;
}

#restart-button:hover {
    background-color: rgba(0, 150, 255, 1);
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.8);
    transform: translateY(-2px);
}

#restart-button:active {
    transform: translateY(1px);
    box-shadow: 0 0 10px rgba(0, 150, 255, 0.6);
}

.hidden {
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}


/* High score display */
#high-score {
    position: absolute;
    top: 80px;
    right: 20px;
    padding: 8px 15px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
    border: 1px solid rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4), inset 0 0 8px rgba(255, 215, 0, 0.2);
    color: gold;
    font-weight: 500;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.7);
}
