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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    color: #00ffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#container {
    display: flex;
    gap: 30px;
    padding: 20px;
}

#gameArea {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#sidePanel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#lobby {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

#lobby h1 {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #00ffff;
    letter-spacing: 5px;
}

#lobby input {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    border-radius: 5px;
    color: #00ffff;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

#lobby input:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

#lobby button, #readyBtn {
    padding: 15px 40px;
    font-size: 1.2em;
    background: rgba(0, 255, 255, 0.2);
    border: 2px solid #00ffff;
    border-radius: 5px;
    color: #00ffff;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#lobby button:hover, #readyBtn:hover {
    background: rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

#lobby button:disabled, #readyBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#readyContainer {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

#readyBtn.ready {
    background: rgba(0, 255, 0, 0.3);
    border-color: #00ff00;
    color: #00ff00;
}

#readyBtn.ready:hover {
    background: rgba(0, 255, 0, 0.5);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
}

#directionFeedback {
    margin-top: 10px;
    color: #00ffff;
    font-size: 48px;
    text-align: center;
    text-shadow: 0 0 20px #00ffff;
}

#directionFeedback.pulse {
    animation: pulse 0.3s ease-in-out;
}

#gameCanvas {
    border: 3px solid #00ffff;
    border-radius: 5px;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.4);
    background: #000;
    display: none;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#playerList {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 20px;
    min-width: 250px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
}

#playerList h2 {
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
    text-shadow: 0 0 10px #00ffff;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.player-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.player-name {
    flex: 1;
    font-size: 1.1em;
}

.player-score {
    font-weight: bold;
    font-size: 1.2em;
}

.player-ready {
    color: #00ff00;
    font-size: 0.9em;
}

.player-spectator {
    color: #888;
    font-size: 0.9em;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#overlayContent {
    text-align: center;
    padding: 50px;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #00ffff;
    border-radius: 15px;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
}

#overlayContent h2 {
    font-size: 3em;
    margin-bottom: 30px;
    text-shadow: 0 0 20px #00ffff;
}

#countdown {
    font-size: 8em;
    font-weight: bold;
    text-shadow: 0 0 40px #00ffff;
    animation: pulse 1s infinite;
}

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

#roundScores {
    margin-top: 20px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    font-size: 1.5em;
    gap: 20px;
}

.score-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-color {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    box-shadow: 0 0 15px currentColor;
}

.score-value {
    font-weight: bold;
    font-size: 1.3em;
}

#gameInfo {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1.2em;
    text-shadow: 0 0 10px #00ffff;
}

.hidden {
    display: none !important;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    #container {
        flex-direction: column;
        gap: 20px;
        padding: 10px;
    }

    #sidePanel {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    #playerList {
        min-width: 200px;
    }
}

@media screen and (max-width: 900px) {
    body {
        overflow: auto;
    }

    #container {
        padding: 10px;
    }

    #lobby h1 {
        font-size: 2em;
    }

    #overlayContent h2 {
        font-size: 2em;
    }

    #countdown {
        font-size: 4em;
    }

    .score-item {
        font-size: 1.2em;
    }
}

@media screen and (max-width: 600px) {
    #container {
        gap: 15px;
    }

    #lobby {
        padding: 20px;
    }

    #lobby h1 {
        font-size: 1.5em;
        letter-spacing: 3px;
    }

    #lobby input,
    #lobby button,
    #readyBtn {
        padding: 12px 20px;
        font-size: 1em;
    }

    #playerList {
        padding: 15px;
        min-width: auto;
        width: 100%;
    }

    #readyContainer {
        padding: 20px;
        width: 100%;
    }

    #overlayContent {
        padding: 30px 20px;
        max-width: 90vw;
    }

    #overlayContent h2 {
        font-size: 1.5em;
    }

    .score-item {
        font-size: 1em;
        padding: 10px;
    }

    /* Show touch controls on mobile/tablet */
    #touchControls {
        display: flex !important;
        bottom: 10px;
        right: 10px;
    }

    .touch-btn {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }
}
