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

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
}

:root, .theme-default {
    --background-color: #1a1a1a;
    --text-color: #ffffff;
    --primary-color: #4CAF50;
    --primary-hover-color: #45a049;
    --secondary-color: #2196F3;
    --secondary-hover-color: #1976D2;
    --danger-color: #F44336;
    --danger-hover-color: #D32F2F;
}

.theme-dark {
    --background-color: #121212;
    --text-color: #BBBBBB;
    --primary-color: #F44336;
    --primary-hover-color: #D32F2F;
    --secondary-color: #2196F3;
    --secondary-hover-color: #1976D2;
    --danger-color: #F44336;
    --danger-hover-color: #D32F2F;
}

.theme-retro {
    --background-color: #2C2C2C;
    --text-color: #00FF00;
    --primary-color: #00FF00;
    --primary-hover-color: #00DD00;
    --secondary-color: #00FFFF;
    --secondary-hover-color: #00DDDD;
    --danger-color: #FF0000;
    --danger-hover-color: #DD0000;
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    display: block;
    touch-action: none;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.overlay-content {
    text-align: center;
    padding: 20px;
}

.theme-selector {
    margin-top: 20px;
}

.theme-selector label {
    margin-right: 10px;
}

.theme-selector select {
    padding: 5px;
    border-radius: 5px;
}

.color-picker {
    margin-top: 20px;
}

.color-picker label {
    margin-right: 10px;
}

.color-picker input {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.overlay h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.overlay h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #f44336;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
    margin: 10px;
    min-width: 200px;
}

button:hover {
    background-color: var(--primary-hover-color);
}

#restartBtn {
    background-color: var(--secondary-color);
}

#restartBtn:hover {
    background-color: var(--secondary-hover-color);
}

.hud {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 24px;
    z-index: 5;
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
    color: var(--text-color);
}

.hud div {
    margin-bottom: 10px;
}

.hud-tip {
    font-size: 14px;
    margin-top: 15px;
    opacity: 0.7;
}

.hud-tip kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 12px;
    margin: 0 2px;
}

.join-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.join-game input {
    padding: 10px;
    font-size: 16px;
    margin-bottom: 10px;
    border: none;
    border-radius: 5px;
    width: 250px;
    text-align: center;
}

#multiplayerBtn {
    background-color: var(--secondary-color);
}

#multiplayerBtn:hover {
    background-color: var(--secondary-hover-color);
}

#hostBtn {
    background-color: #9C27B0;
}

#hostBtn:hover {
    background-color: #7B1FA2;
}

#backBtn {
    background-color: var(--danger-color);
}

#backBtn:hover {
    background-color: var(--danger-hover-color);
}

@media (max-width: 768px) {
    .overlay h1 {
        font-size: 36px;
    }
    
    .overlay h2 {
        font-size: 28px;
    }
    
    button {
        padding: 12px 24px;
        font-size: 18px;
    }
    
    .hud {
        font-size: 18px;
    }
}
