* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    overflow: hidden;
    height: 100vh;
}

.screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid #3498db;
    box-shadow: 0 0 30px rgba(52, 152, 219, 0.3);
    max-width: 500px;
    width: 90%;
}

.login-container h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #f39c12;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.login-container p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #ecf0f1;
}

.input-group {
    margin-bottom: 30px;
}

.input-group input {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #3498db;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.input-group input:focus {
    border-color: #f39c12;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}

.input-group button {
    width: 100%;
    padding: 15px;
    font-size: 1.3em;
    font-weight: bold;
    background: linear-gradient(45deg, #e74c3c, #f39c12);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.instructions {
    text-align: left;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #f39c12;
}

.instructions h3 {
    color: #f39c12;
    margin-bottom: 10px;
}

.instructions p {
    margin: 5px 0;
    font-size: 0.9em;
}

.controls-desktop {
    display: block;
}

.controls-mobile {
    display: none;
}

/* Game Screen */
#gameScreen {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid #3498db;
}

.game-header h2 {
    color: #f39c12;
    font-size: 1.8em;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.health-display {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.health-info {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.9em;
}

.health-bar {
    width: 150px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #ecf0f1;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #2ecc71);
    transition: width 0.3s ease;
    width: 100%;
}

.hits-remaining {
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.hits-remaining.hits-5 {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.hits-remaining.hits-4 {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
    border: 1px solid #27ae60;
}

.hits-remaining.hits-3 {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
    border: 1px solid #f39c12;
}

.hits-remaining.hits-2 {
    background: rgba(230, 126, 34, 0.2);
    color: #e67e22;
    border: 1px solid #e67e22;
}

.hits-remaining.hits-1 {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
    animation: pulse-danger 1s infinite;
}

.hits-remaining.hits-0 {
    background: rgba(0, 0, 0, 0.8);
    color: #95a5a6;
    border: 1px solid #95a5a6;
}

.effects-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    min-height: 40px;
    max-width: 100%;
    overflow: hidden;
}

.effect-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.8);
    padding: 5px 10px;
    border-radius: 15px;
    border: 2px solid;
    font-size: 0.8em;
    animation: effectPulse 2s infinite;
}

.effect-item.power-up {
    border-color: #2ecc71;
    color: #2ecc71;
}

.effect-item.power-down {
    border-color: #e74c3c;
    color: #e74c3c;
}

.effect-icon {
    font-size: 1.2em;
}

.effect-timer {
    background: rgba(255, 255, 255, 0.2);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: bold;
}

@keyframes effectPulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: scale(0.98);
    }
}

@keyframes pulse-danger {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.8;
    }
}

.game-container {
    display: flex;
    gap: 20px;
    flex: 1;
}

.game-area {
    position: relative;
    flex: 1;
}

#gameCanvas {
    border: 3px solid #3498db;
    border-radius: 10px;
    background: #1e3a2e;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.3);
    max-width: 100%;
    height: auto;
}

.death-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(231, 76, 60, 0.9);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border: 3px solid #c0392b;
    box-shadow: 0 0 30px rgba(231, 76, 60, 0.5);
}

.death-message h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
}

.sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.scoreboard {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #3498db;
    flex: 0 0 auto;
}

.scoreboard h3 {
    color: #f39c12;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.scores-list {
    max-height: 250px;
    overflow-y: auto;
}

.chat-section {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #2ecc71;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.chat-section h3 {
    color: #2ecc71;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.chat-messages {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    overflow-y: auto;
    max-height: 200px;
    min-height: 150px;
}

.chat-message {
    margin-bottom: 8px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.9em;
    line-height: 1.3;
}

.chat-message.system {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    font-style: italic;
}

.chat-message.player {
    background: rgba(255, 255, 255, 0.1);
    color: #ecf0f1;
}

.chat-message.own {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.chat-player-name {
    font-weight: bold;
    margin-right: 5px;
}

.chat-input-container {
    display: flex;
    gap: 5px;
}

.chat-input-container input {
    flex: 1;
    padding: 8px;
    border: 1px solid #3498db;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9em;
    outline: none;
}

.chat-input-container input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chat-input-container input:focus {
    border-color: #2ecc71;
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.3);
}

.chat-input-container button {
    padding: 8px 15px;
    background: #2ecc71;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s;
}

.chat-input-container button:hover {
    background: #27ae60;
}

.respawn-button {
    background: linear-gradient(45deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s;
    animation: respawnPulse 1s infinite;
}

.respawn-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

@keyframes respawnPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* Mobile Controls */
.mobile-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    z-index: 1000;
}

.mobile-controls.hidden {
    display: none;
}

.joystick-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
}

.joystick {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid #3498db;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.joystick-handle {
    width: 30px;
    height: 30px;
    background: linear-gradient(45deg, #3498db, #2980b9);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.joystick-label {
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.fire-button-container {
    pointer-events: auto;
}

.fire-button {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    border: 3px solid #e74c3c;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 0.8em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.fire-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.6);
}

.fire-button:hover {
    background: linear-gradient(45deg, #c0392b, #a93226);
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 5px 0;
    background: rgba(52, 152, 219, 0.2);
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.score-item.own-score {
    background: rgba(243, 156, 18, 0.3);
    border-left-color: #f39c12;
}

.score-name {
    font-weight: bold;
    color: #ecf0f1;
}

.score-stats {
    font-size: 0.9em;
    color: #bdc3c7;
}

.score-kills {
    color: #2ecc71;
    font-weight: bold;
}

.score-deaths {
    color: #e74c3c;
}

/* Responsive design */
@media (max-width: 1400px) {
    .game-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        margin-top: 20px;
    }
    
    .scoreboard {
        flex: 1;
        max-height: 200px;
        margin-right: 10px;
    }
    
    .chat-section {
        flex: 1;
        min-height: 200px;
        margin-left: 10px;
    }
    
    .chat-messages {
        max-height: 120px;
        min-height: 100px;
    }
    
    .game-area {
        overflow: auto;
    }
}

@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .player-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .health-display {
        align-items: center;
    }
    
    .sidebar {
        flex-direction: column;
        gap: 10px;
    }
    
    .scoreboard, .chat-section {
        margin: 0;
    }
    
    .chat-section {
        min-height: 250px;
    }
    
    .chat-messages {
        min-height: 120px;
        max-height: 150px;
    }
    
    .login-container {
        padding: 20px;
    }
    
    .login-container h1 {
        font-size: 2em;
    }
    
    /* Mobile-specific styles */
    .controls-desktop {
        display: none;
    }
    
    .controls-mobile {
        display: block;
    }
    
    .mobile-controls {
        display: flex !important;
    }
    
    .mobile-controls.hidden {
        display: none !important;
    }
    
    /* Adjust game area for mobile */
    .game-area {
        position: relative;
        overflow: hidden;
    }
    
    #gameCanvas {
        max-width: 100%;
        height: auto;
    }
    
    /* Make controls larger on very small screens */
    @media (max-width: 480px) {
        .joystick {
            width: 70px;
            height: 70px;
        }
        
        .joystick-handle {
            width: 25px;
            height: 25px;
        }
        
        .fire-button {
            width: 70px;
            height: 70px;
            font-size: 0.7em;
        }
    }
} 