@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', cursive;
    background: #000;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    background-image: url('space-bg.png');
    background-size: cover;
    touch-action: manipulation;
}

#gameContainer {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.hidden {
    display: none !important;
}

.active {
    display: flex !important;
}

#registrationForm {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 2rem;
    border-radius: 15px;
    border: 3px solid #00ff00;
    box-shadow: 0 0 20px #00ff00;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.logo-img {
    width: 150px;
    height: auto;
    margin: 20px 0;
    animation: pulse 2s infinite;
}

h1 {
    color: #ff9900;
    text-shadow: 0 0 10px #ff9900;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

h2 {
    color: #ffcc00;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    width: 100%;
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #00ccff;
}

input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #00ccff;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 5px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
}

button {
    background: linear-gradient(to bottom, #ff3300, #cc0000);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'Press Start 2P', cursive;
    text-transform: uppercase;
    box-shadow: 0 0 10px #ff3300;
    transition: all 0.3s;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px #ff3300;
}

#gameScreen {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#gameCanvas {
    border: 3px solid #ff9900;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    width: 100%;
    max-width: 800px;
    height: 500px;
    touch-action: none;
}

#hud {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 0;
    color: #ffcc00;
    font-size: 0.8rem;
}

#controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 1rem;
    max-width: 500px;
    touch-action: manipulation;
}

#controls button {
    width: 70px;
    height: 70px;
    font-size: 1.5rem;
    border-radius: 50%;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#fireBtn {
    background: linear-gradient(to bottom, #ffcc00, #ff6600);
}

#gameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    padding: 2rem;
    border-radius: 15px;
    border: 3px solid #ff3300;
    box-shadow: 0 0 20px #ff3300;
    text-align: center;
    z-index: 100;
    width: 90%;
    max-width: 400px;
}

#finalScore {
    margin: 2rem 0;
    color: #ffcc00;
    font-size: 1.2rem;
}

#adminButton {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 200;
}

#adminButton button {
    background: rgba(50, 50, 50, 0.7);
    color: #999;
    font-size: 0.7rem;
    padding: 0.5rem;
    opacity: 0.5;
}

#adminButton button:hover {
    opacity: 1;
    transform: none;
    box-shadow: none;
}

#adminLogin, #adminPanel {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 2rem;
    border-radius: 15px;
    border: 3px solid #3366ff;
    box-shadow: 0 0 20px #3366ff;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

#adminLogin h2, #adminPanel h2, #adminPanel h3 {
    color: #3366ff;
    margin-bottom: 1.5rem;
}

#adminPanel h3 {
    margin-top: 1rem;
}

.admin-controls {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 1rem;
}

.table-container {
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
}

thead {
    position: sticky;
    top: 0;
    background-color: #000;
}

th, td {
    padding: 0.7rem;
    text-align: left;
    border-bottom: 1px solid #333;
}

th {
    background-color: #111;
    color: #3366ff;
}

tr:hover {
    background-color: rgba(51, 102, 255, 0.1);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1rem;
    }
    
    #controls button {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }
    
    #hud {
        font-size: 0.6rem;
        flex-direction: column;
        align-items: center;
    }
    
    #hud div {
        margin-bottom: 0.5rem;
    }
    
    table {
        font-size: 0.5rem;
    }
    
    th, td {
        padding: 0.4rem;
    }
    
    #gameCanvas {
        height: 400px;
    }
    
    #registrationForm, #adminLogin, #adminPanel, #gameOver {
        width: 90%;
        padding: 1rem;
    }
    
    button {
        padding: 0.7rem 1.4rem;
        font-size: 0.8rem;
    }

    input {
        font-size: 0.7rem;
        padding: 0.7rem;
    }
}

@media (max-width: 400px) {
    #controls button {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    #gameCanvas {
        height: 350px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
}