@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Roboto:wght@400;700&display=swap');

/* General game styles */
body {
    overflow: hidden;
    background: linear-gradient(to bottom, #0f0c29, #302b63, #24243e);
    color: #fff;
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
}

#game-container {
    position: relative;
    width: 800px; /* Fixed width */
    height: 600px; /* Fixed height */
    box-shadow: 0 0 100px rgba(74, 0, 224, 0.5);
    border-radius: 15px;
    overflow: hidden;
}

#game-canvas {
    display: block;
    background: #000;
    border-radius: 15px;
    width: 100%;
    height: 100%;
}

/* Character Selection */
#character-selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#character-selection-modal {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid rgba(142, 45, 226, 0.5);
    text-align: center;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

#character-selection-modal h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 4rem;
    margin-bottom: 2.5rem;
    color: #fff;
    text-shadow: 0 0 15px #8e2de2;
}

#character-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 2rem;
}

.character-card {
    background: #232946;
    border: 2px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    overflow: hidden;
    position: relative;
}

.character-card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: #e43f5a;
    box-shadow: 0 10px 20px rgba(228, 63, 90, 0.3);
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.character-card:hover::before {
    left: 100%;
}


.character-card img {
    width: 100%;
    height: auto;
    display: block;
    filter: saturate(1.2);
}

.character-name {
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    background: rgba(0,0,0,0.6);
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
    color: #fff;
    transition: all 0.3s ease;
}

.character-card:hover .character-name {
    background: #e43f5a;
}


/* In-Game UI */
#exit-button {
    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 10;
    padding: 10px 20px;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    transition: all 0.3s ease;
}
#exit-button:hover {
    background: #e43f5a;
}

.game-ui {
    position: absolute;
    top: 25px;
    left: 25px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: 'Roboto', sans-serif;
}

#level-display, #lives-display {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.7);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
}

#level-display img, #lives-display img {
    width: 28px;
    height: 28px;
    margin-right: 12px;
    filter: drop-shadow(0 0 5px #fff);
}


/* Game Over Overlay */
#game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    animation: fadeIn 0.5s ease;
}

.game-over-modal {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    padding: 3rem 4rem;
    border-radius: 20px;
    border: 1px solid #e43f5a;
    text-align: center;
    width: 400px;
    box-shadow: 0 10px 40px rgba(228, 63, 90, 0.3);
    animation: slideInUp 0.6s ease;
}

@keyframes slideInUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


#game-over-character {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid #e43f5a;
    margin: 1.5rem auto;
    object-fit: cover;
    box-shadow: 0 0 25px #e43f5a;
}

.game-over-modal p {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    color: #ddd;
}

#game-over-overlay.visible {
    display: flex;
}

#game-over-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 5rem;
    color: #e43f5a;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px #e43f5a;
}

#play-again-btn {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2.2rem;
    padding: 1.2rem 3rem;
    background: linear-gradient(45deg, #e43f5a, #f7b733);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#play-again-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px #e43f5a;
}

#how-to-play {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(142, 45, 226, 0.2);
    text-align: left;
}

#how-to-play h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #8e2de2;
    text-align: center;
}

#how-to-play p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

#how-to-play strong {
    color: #e43f5a;
    font-weight: 700;
}
