body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #2c3e50;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#gameContainer {
    position: relative;
    background-color: #34495e;
    border: 4px solid #ecf0f1;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#gameCanvas {
    display: block;
    background-color: #000;
    cursor: crosshair;
    border-radius: 4px;
}

#gameCanvas:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

.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;
    color: white;
    text-align: center;
    z-index: 100;
    border-radius: 4px;
}

.overlay.hidden {
    display: none;
}

.overlay-content h2 {
    font-size: 2.5em;
    margin: 0 0 20px 0;
    color: #ecf0f1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.overlay-content p {
    font-size: 1.2em;
    margin: 0;
    color: #bdc3c7;
    line-height: 1.4;
}

/* Responsive scaling */
@media (max-width: 700px) {
    #gameContainer {
        transform: scale(0.8);
    }
}

@media (max-width: 600px) {
    #gameContainer {
        transform: scale(0.6);
    }
}

/* Online UI Styles */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.menu-btn {
    padding: 15px 30px;
    font-size: 1.1em;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    min-width: 200px;
}

.menu-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.menu-btn.secondary {
    background-color: #95a5a6;
}

.menu-btn.secondary:hover {
    background-color: #7f8c8d;
}

.menu-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Room code and invite sections */
.room-info, .invite-info {
    margin: 20px 0;
}

.room-info h3, .invite-info h3 {
    margin: 0 0 10px 0;
    color: #ecf0f1;
    font-size: 1.2em;
}

.room-code-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.room-code-display span {
    font-size: 2em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    background-color: #2c3e50;
    padding: 10px 20px;
    border-radius: 6px;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    letter-spacing: 3px;
}

.invite-link-display {
    display: flex;
    gap: 10px;
    align-items: center;
}

.invite-link-display input {
    flex: 1;
    padding: 10px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    background-color: #ecf0f1;
    color: #2c3e50;
    font-family: monospace;
    font-size: 0.9em;
}

.copy-btn {
    padding: 10px 15px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.copy-btn:hover {
    background-color: #229954;
}

/* Connection status */
.connection-status {
    margin: 20px 0;
    padding: 15px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
}

.status-connecting {
    color: #f39c12;
}

.status-connected {
    color: #27ae60;
}

.status-disconnected {
    color: #e74c3c;
}

/* Join room form */
#joinRoomSection {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #bdc3c7;
}

#roomCodeInput {
    padding: 15px;
    font-size: 1.2em;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    border: 2px solid #3498db;
    border-radius: 6px;
    background-color: #ecf0f1;
    color: #2c3e50;
    width: 200px;
    margin-bottom: 20px;
}

#roomCodeInput:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

/* Online HUD */
.online-hud {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 50;
    font-size: 0.9em;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.status-indicator {
    font-size: 1.2em;
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    color: #27ae60;
    animation: none;
}

.status-indicator.disconnected {
    color: #e74c3c;
}

.latency-text {
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    color: #bdc3c7;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Lobby buttons */
.lobby-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 10000;
    font-family: Arial, sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive adjustments for online UI */
@media (max-width: 700px) {
    .overlay-content {
        padding: 20px;
        max-width: 90%;
    }
    
    .menu-btn {
        min-width: 150px;
        font-size: 1em;
        padding: 12px 20px;
    }
    
    .room-code-display span {
        font-size: 1.5em;
        padding: 8px 15px;
    }
    
    .invite-link-display {
        flex-direction: column;
    }
    
    .invite-link-display input {
        margin-bottom: 10px;
    }
}
