/*
=================================
    Astro Jumper (Icy Tower)
=================================
*/

/* --- Page Body & Main Wrapper --- */
/* Assuming global.css sets a dark background */

#game-wrapper {
    width: 100%;
    max-width: 480px; /* A bit wider for better presence */
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(10, 20, 40, 0.6); /* Dark blue, semi-transparent */
    border: 1px solid rgba(0, 191, 255, 0.4); /* Deep sky blue border */
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(0, 191, 255, 0.2);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

header {
    margin-bottom: 1.5rem;
}

h1, h2 {
    font-family: 'Orbitron', sans-serif;
    color: #ffffff;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    /* Neon Glow Effect */
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px #00aaff, 0 0 30px #00aaff;
}

main {
    position: relative;
    /* This ensures the overlays are positioned correctly relative to the game area */
}

/* --- Game Canvas & UI --- */
#game-container {
    display: none; /* JS will show this when the game starts */
    position: relative;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden; /* Keeps canvas corners rounded */
}

#game-canvas {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid rgba(0, 191, 255, 0.2);
}

#score-display {
    position: absolute;
    top: 15px;
    left: 15px;
    font-family: 'Exo 2', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 5px;
    text-shadow: 2px 2px 4px #000;
    z-index: 5; /* Above the canvas */
}

/* --- Overlays (Character Select & Game Over) --- */
#character-selection-overlay,
#game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
    
    opacity: 1;
    transition: opacity 0.4s ease-in-out;
    z-index: 10;
}

#game-over-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#game-over-overlay p {
    font-family: 'Exo 2', sans-serif;
    font-size: 1.75rem;
    margin: 20px 0;
}

#final-score {
    color: #ffd700; /* Gold for emphasis */
    font-weight: bold;
    font-size: 2rem;
}

/* --- Character Selection Cards --- */
#character-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 2rem;
    max-width: 400px;
}

.character-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(0, 191, 255, 0.4);
    border-radius: 12px;
    padding: 15px;
    width: 110px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.character-card:hover {
    transform: translateY(-5px) scale(1.05);
    border-color: #00c3ff;
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.6);
}

.character-emoji {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 10px;
    transition: transform 0.2s ease;
}

.character-card:hover .character-emoji {
    transform: rotate(10deg) scale(1.1);
}

.character-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f0f0f0;
}

/* --- Buttons --- */
/* Using a class to potentially reuse your site's button styles */
.btn-primary, #restart-button {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: #fff;
    background: linear-gradient(145deg, #0077b3, #00aaff);
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0, 170, 255, 0.3);
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.btn-primary:hover, #restart-button:hover {
    background: linear-gradient(145deg, #00aaff, #00c3ff);
    box-shadow: 0 6px 20px rgba(0, 170, 255, 0.6);
    transform: translateY(-3px);
}