/* --- General Setup --- */
:root {
    --primary-font: 'Roboto Mono', monospace;
    --title-font: 'Share Tech Mono', monospace;
    --background-color: #1a1a2e;
    --panel-background: rgba(18, 22, 33, 0.85);
    --text-color: #e0e0e0;
    --primary-accent: #00ff9b;
    --secondary-accent: #ff55a5;
    --glow-color: rgba(0, 255, 155, 0.7);
    --border-color: rgba(0, 255, 155, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--primary-font);
    background-color: var(--background-color);
    color: var(--text-color);
    overflow: hidden;
    letter-spacing: 1px;
}

.screen {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

/* --- Character Selection Screen --- */
#characterSelectionScreen {
    flex-direction: column;
}

.selection-container {
    background: var(--panel-background);
    padding: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    max-width: 800px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
}

.selection-container h1 {
    font-family: var(--title-font);
    font-size: 4rem;
    color: var(--primary-accent);
    text-shadow: 0 0 10px var(--glow-color);
    letter-spacing: 4px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

#usernameInput {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-family: var(--primary-font);
    font-size: 1.2rem;
    text-align: center;
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.character-option {
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.character-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-accent);
}

.character-option.selected {
    background: var(--glow-color);
    border-color: var(--primary-accent);
    transform: scale(1.05);
}

.character-name {
    margin-top: 5px;
    font-size: 1rem;
    font-weight: bold;
}

#startGameButton {
    width: 100%;
    padding: 15px;
    background-color: var(--secondary-accent);
    color: white;
    font-family: var(--title-font);
    font-size: 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#startGameButton:disabled {
    background-color: #555;
    cursor: not-allowed;
}

#startGameButton:hover:not(:disabled) {
    box-shadow: 0 0 15px var(--secondary-accent);
}


/* --- In-Game UI --- */
#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#gameUI {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows mouse interaction with canvas */
    padding: 20px;
}

.ui-panel {
    background: var(--panel-background);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px;
    color: var(--text-color);
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

#player-info {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 250px;
}

#player-info h3 {
    color: var(--primary-accent);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

#player-info p {
    margin-bottom: 5px;
}

#top-right-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 250px;
}

#leaderboard h3 {
    text-align: center;
    color: var(--primary-accent);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

#leaderboard-list {
    list-style: none;
}

#leaderboard-list li {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#leaderboard-list li:last-child {
    border-bottom: none;
}

#leaderboard-list .self {
    font-weight: bold;
    color: #ffff00;
}

#powerup-status {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: none; /* Hidden by default */
}

/* --- Floating Messages --- */
#message-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.message {
    background: var(--panel-background);
    color: var(--primary-accent);
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    font-size: 1.1rem;
    animation: fade-in-out 3s ease-in-out forwards;
}

@keyframes fade-in-out {
    0% { opacity: 0; transform: translateY(-20px); }
    15% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}

/* Login Screen */
.login-container {
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
    border: 2px solid rgba(0, 255, 0, 0.3);
}

.login-container h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.login-container p {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: #ccc;
}

.input-group input:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.input-group input::placeholder {
    color: #aaa;
}

.instructions {
    text-align: left;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #00ff00;
}

.instructions h3 {
    color: #00ff00;
    margin-bottom: 10px;
}

.instructions ul {
    list-style: none;
}

.instructions li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.instructions li:before {
    content: '☢';
    position: absolute;
    left: 0;
    color: #00ff00;
}

/* Game Screen */
#gameScreen {
    position: relative;
}

.leaderboard {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid rgba(0, 255, 0, 0.3);
    min-width: 200px;
}

.leaderboard div {
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        margin: 20px;
        padding: 30px;
    }
    
    .login-container h1 {
        font-size: 2em;
    }
    
    .leaderboard {
        position: relative;
        top: auto;
        right: auto;
        margin: 20px;
        min-width: auto;
    }
    
    .character-container {
        margin: 20px;
        padding: 30px;
    }
    
    .character-container h1 {
        font-size: 2em;
    }
    
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .character-preview {
        width: 48px;
        height: 48px;
    }
} 