body {
    margin: 0;
    padding: 0;
    background: #000;
    font-family: Arial, sans-serif;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    height: 100vh;
    width: 100vw;
}

/* Authentication form styles */
#authForm {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid #333;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    min-width: 280px;
    z-index: 1000;
}

#authForm input[type="text"],
#authForm input[type="password"] {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    background: white;
    outline: none;
}

#authForm input[type="text"]:focus,
#authForm input[type="password"]:focus {
    border-color: #45a049;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

#authButtons {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.auth-btn {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

#authToggle {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

#authToggleText {
    color: #666;
    font-size: 14px;
}

.link-btn {
    background: none;
    border: none;
    color: #4CAF50;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    margin-left: 5px;
}

.link-btn:hover {
    color: #45a049;
}

.error-message {
    color: #f44336;
    font-size: 14px;
    margin: 10px 0;
    min-height: 20px;
    font-weight: bold;
}

/* Mobile responsiveness for auth form */
@media (max-width: 480px) {
    #authForm {
        min-width: 90%;
        padding: 15px;
    }
    
    #authForm input[type="text"],
    #authForm input[type="password"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

#gameContainer {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
    padding: 0;
    box-sizing: border-box;
}

#gameCanvas {
    border: 2px solid #333;
    width: 100vw;
    height: 100vh;
    max-width: 600px;
    max-height: 800px;
    touch-action: none;
    object-fit: contain;
}

#mobileControls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 100;
}

.control-btn {
    width: 100%;
    height: 60px;
    font-size: 24px;
    font-weight: bold;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    margin: 5px 0;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.control-btn:active {
    background: #45a049;
    transform: scale(0.95);
}

#menuButtons {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.menu-btn {
    flex: 1;
    height: 50px;
    font-size: 16px;
    font-weight: bold;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.menu-btn:active {
    background: #1976D2;
    transform: scale(0.95);
}

.menu-btn.active {
    background: #FF9800;
    color: white;
    border: 2px solid #F57C00;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.5);
}

.menu-btn.active:active {
    background: #F57C00;
    transform: scale(0.95);
}

.menu-btn.hidden {
    display: none;
}

/* Name input field */
#nameInput {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 20px;
    font-size: 18px;
    border: 3px solid #2196F3;
    border-radius: 25px;
    background: white;
    text-align: center;
    outline: none;
    z-index: 1000;
    max-width: 280px;
    width: 80%;
}

#nameInput:focus {
    border-color: #1976D2;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.3);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    #gameCanvas {
        width: 100vw;
        height: 100vh;
        border: none;
    }
    
    #gameContainer {
        padding: 0;
    }
    
    .control-btn {
        height: 70px;
        font-size: 28px;
    }
    
    .menu-btn {
        height: 55px;
        font-size: 16px;
    }
}

/* Large phones (iPhone Pro Max, etc.) */
@media (min-width: 414px) and (max-width: 768px) {
    #gameCanvas {
        max-width: 414px;
        max-height: 896px;
    }
    
    .control-btn {
        height: 80px;
        font-size: 32px;
    }
}

/* Very tall screens */
@media (min-height: 800px) and (max-width: 768px) {
    #gameCanvas {
        height: 100vh;
    }
}

/* Short screens */
@media (max-height: 600px) {
    #mobileControls {
        bottom: 10px;
    }
    
    .control-btn {
        height: 50px;
        font-size: 20px;
    }
    
    .menu-btn {
        height: 40px;
        font-size: 14px;
    }
}
